* { box-sizing:border-box; margin:0; padding:0; }
:root {
  --bleu-fonce:#4251AE;
  --bleu:#5263C0;
  --bleu-clair:#EEF0FF;
  --orange:#F0A436;
  --orange-clair:#FFF4E2;
  --fond:#F6F7FB;
  --card:#fff;
  --texte:#25304B;
  --muted:#7C849A;
  --border:#E1E4EE;
  --danger:#D84B4B;

  /* Aliases / valeurs du header MyReferee */
  --bleuFonce:var(--bleu-fonce);
  --primary:var(--orange);
  --header-muted:#C7CBE0;
  --safe-top: var(
        --safe-area-inset-top,
        env(safe-area-inset-top, 0px)
    );
  --header-real-h:64px;
}
html,body { min-height:100%; }
body {
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--fond);
  color:var(--texte);
  overscroll-behavior-y:contain;
}
body.reader-mode { overflow:hidden; }
button,input { font:inherit; }
button { -webkit-tap-highlight-color:transparent; }

header.app-header {
    position: relative;
    z-index: 1000;

    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;

    padding:
        calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))
        20px
        10px;

    background: var(--bleuFonce);
    color: #fff;
    box-shadow: 0 5px 10px #151c48;
    /*border: 1px solid red;*/
}
.brand-text {
    text-align: left;
    display: grid;
    align-content: center;
    line-height: 15px;
}

.app-header .left {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    -webkit-box-shadow: 0 0 2px 2px #fff;
    box-shadow: 0 0 2px 2px #fff;
    border-radius: 10px;
}

.app-header .left img,
.app-header .left .icon-btn {
    position: absolute;
    inset: 0;
    margin: auto;
}

.app-header .left img {
    width: 42x;
    height: 42px;
    object-fit: contain;
}

.app-header .left .icon-btn {
    width: 42px;
    height: 42px;
}

.app-header .left .is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.brand-title {
  font-size:1.05rem;
  font-weight:850;
  line-height:.8;
  white-space:nowrap;
  color:#fff;
}

.brand-subtitle {
  color:var(--header-muted);
  font-size:.78rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-top:4px;
}

.header-actions {
  display:flex;
  align-items:center;
  gap:20px;
  position:relative;
  margin-left:auto;
}

.icon-btn {
  position:relative;
  width:35px;
  height:35px;
  border:0;
  border-radius:10px;
  color:var(--primary);
  background: var(--bleu-fonce);
  
  cursor:pointer;
  display:grid;
  place-items:center;
  flex:0 0 40px;    
}
.icon-btn i {
    font-size:18px;
}

.icon-btn:active {
  transform:scale(.96);
}

.back-btn.is-hidden, #logo.is-hidden {
    display: none;
}
main {
  width:min(900px,100%);
  margin:auto;
  /*padding-top: var(--header-real-h);*/
    padding-top: 30px;
}
.page { display:none; padding: 0 10px;}
.page.active { display:block; }



.home-app {
  display:flex;
  flex-direction:column;
  gap:10px;
    padding: 0 5px;
}

.home-title {
  padding:4px 2px 8px;
}
.home-title h1 {
  color:var(--bleu-fonce);
  font-size:24px;
  line-height:1.15;
  letter-spacing:-.45px;
}
.home-title p {
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}

.home-modules {
  display:grid;
  gap:10px;
}

.home-module {
  width:100%;
  min-height:92px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  padding:14px;
  display:grid;
  grid-template-columns:54px 1fr 34px;
  gap:12px;
  align-items:center;
  text-align:left;
  box-shadow:0 2px 9px rgba(13,39,64,.055);
  cursor:pointer;
  color:var(--bleu-fonce);
  -webkit-tap-highlight-color:transparent;
}

.home-module:active {
  transform:scale(.992);
}

.module-icon {
  width:54px;
  height:54px;
  border-radius:15px;
  display:grid;
  place-items:center;
  background:var(--bleu-clair);
  color:var(--bleu-fonce);
}

.home-module.wifi .module-icon {
  background:var(--orange-clair);
  color:var(--orange);
}

.module-icon svg {
  width:27px;
  height:27px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.module-copy {
  min-width:0;
}

.home-module strong {
  display:block;
  font-size:17px;
  line-height:1.2;
  font-weight:850;
  letter-spacing:-.15px;
}

.home-module small {
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}

.module-arrow {
  width:32px;
  height:32px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#f1f5f7;
  color:#8a99a5;
  font-size:21px;
}

.home-season {
  margin-top:5px;
  text-align:center;
  color:#a0acb5;
  font-size:10px;
}



.module-head { margin-bottom:17px; }
.module-head h1 {
  font-size:26px;
  color:var(--bleu-fonce);
  letter-spacing:-.5px;
}
.module-head p {
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
}
.search-wrap {
  position:sticky;
  top:var(--header-real-h);
  z-index:50;
  background:linear-gradient(var(--fond) 76%,rgba(244,246,248,0));
  padding-bottom:15px;
}
.search {
  width:100%;
  border:1px solid var(--border);
  border-radius:14px;
  padding:13px 15px;
  background:#fff;
  outline:none;
  box-shadow:0 2px 8px rgba(13,39,64,.05);
}
.search:focus {
  border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(242,140,40,.13);
}

/* Liste des lois */
.law-menu {
  display:grid;
  gap:8px;
}
.law-menu-btn {
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  display:grid;
  grid-template-columns:38px 1fr;
  align-items:center;
  gap:10px;
  text-align:left;
  padding:14px 13px;
  box-shadow:0 2px 9px rgba(13,39,64,.05);
  cursor:pointer;
}
.law-menu-num {
  color:var(--orange);
  font-weight:850;
  font-size:12px;
  text-transform:uppercase;
}
.law-menu-name {
  color:var(--bleu-fonce);
  font-weight:600;
  font-size:15px;
}
.law-menu-arrow {
  color:var(--muted);
  font-size:22px;
  text-align:center;
}

/* Fiche loi / swipe */
#lawReaderPage {
  padding:0;
}
.reader-shell {
  position:fixed;
  top:var(--header-real-h);
  left:0;
  right:0;
  bottom:66px;
  overflow:hidden;
  background:var(--fond);
}
.reader-stage {
  position:relative;
  width:100%;
  height:100%;
  overflow:hidden;
  touch-action:pan-y;
}
.reader-track {
  display:flex;
  width:300%;
  height:100%;
  transform:translateX(-33.333333%);
  will-change:transform;
}
.reader-slide {
  width:33.333333%;
  flex:0 0 33.333333%;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  /*padding:14px 16px 18px;*/    
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
}
.reader-card {
  background:#fff;
  /*border:1px solid var(--border);*/
  /*border-radius:15px;
  */
  /*box-shadow:0 2px 10px rgba(13,39,64,.05);*/
    
    padding:35px 16px 22px;
}
.reader-card h3 {
  color:var(--bleu-fonce);
  font-size:16px;
  margin:20px 0 8px;
  padding-left:10px;
  border-left:4px solid var(--orange);
}
.reader-card h3:first-child { margin-top:0; }
.reader-card p {
  color:#33414d;
  line-height:1.68;
  margin-bottom:10px;
  font-size:14px;
}
.reader-card ul {
  list-style:none;
  margin:8px 0 12px;
}
.reader-card li {
  position:relative;
  padding:4px 0 4px 18px;
  color:#33414d;
  line-height:1.6;
  font-size:14px;
}
.reader-card li::before {
  content:"›";
  position:absolute;
  left:2px;
  color:var(--orange);
  font-weight:900;
}
.reader-card strong { color:var(--bleu-fonce); }
.callout {
  margin:12px 0;
  padding:11px 13px;
  border-radius:10px;
  background:var(--bleu-clair);
  border-left:4px solid var(--bleu);
  color:#284154;
  font-size:13px;
  line-height:1.55;
}
.callout.warn {
  background:var(--orange-clair);
  border-left-color:var(--orange);
  color:#75410d;
}
.callout.danger {
  background:#fff0ef;
  border-left-color:var(--danger);
  color:#74241d;
}
.rule-table {
  width:100%;
  border-collapse:collapse;
  margin:12px 0;
  font-size:12px;
}
.rule-table th {
  background:var(--bleu-fonce);
  color:#fff;
  text-align:left;
  padding:8px;
}
.rule-table td {
  border-bottom:1px solid var(--border);
  padding:8px;
  vertical-align:top;
}
.rule-table tr:nth-child(even) td { background:#f7f9fa; }
.dim-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin:10px 0;
}
.dim-card {
  border:1px solid var(--border);
  background:#f8fafb;
  border-radius:10px;
  padding:11px;
}
.dim-label {
  color:var(--orange);
  text-transform:uppercase;
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
  margin-bottom:3px;
}
.dim-val {
  color:var(--bleu-fonce);
  font-size:13px;
  line-height:1.5;
}

/* Footer fixe des lois */
.law-footer {
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:120;
  display:none;
  background:var(--bleu-fonce);
  color:#fff;
  padding:9px 10px calc(9px + env(safe-area-inset-bottom));
  box-shadow:0 -3px 12px rgba(0,0,0,.16);
}
.law-footer.visible {
  display:block;
}
.law-footer-inner {
  width:min(900px,100%);
  margin:auto;
  display:grid;
  grid-template-columns:46px 1fr 46px;
  gap:8px;
  align-items:center;
}
.law-footer-nav {
  width:46px;
  height:46px;
  border:0;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:24px;
  cursor:pointer;
}
.law-footer-nav:disabled {
  opacity:.28;
}
.law-footer-center {
  min-width:0;
  text-align:center;
  line-height:1.15;
}
.law-footer-num {
  display:block;
  color:var(--orange);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.law-footer-title {
  display:block;
  margin-top:3px;
  color:#fff;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.law-footer-count {
  display:block;
  margin-top:2px;
  color:#9fb0be;
  font-size:10px;
  font-weight:700;
}

/* Wi-Fi */
.wifi-list { display:grid; gap:8px; }
.wifi-row {
  width:100%; border:1px solid var(--border); background:#fff; border-radius:14px;
  display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px;
  text-align:left; padding:13px 13px 13px 15px;
  box-shadow:0 2px 8px rgba(13,39,64,.045); cursor:pointer;
}
.wifi-row-main { min-width:0;  display:grid; grid-template-columns:40px 1fr;align-items:center;}
.wifi-row-id { color:var(--orange); font-size:10px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; margin-top: 3px;}
.wifi-row-name { color:var(--bleu-fonce); font-size:15px; font-weight:780; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wifi-row-status { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:10px; font-weight:750; white-space:nowrap; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#aab4bc; }
.status-dot.ok { background:#3c9b68; }
.status-dot.bof { background:var(--orange); }
.wifi-row-arrow { color:#91a0ab; font-size:21px; text-align:center; }

.sheet-backdrop {
  position:fixed; inset:0; z-index:180; background:rgba(7,20,32,.46);
  opacity:0; pointer-events:none; transition:opacity .22s ease;
}
.sheet-backdrop.open { opacity:1; pointer-events:auto; }
.wifi-sheet {
  position:fixed; left:0; right:0; bottom:0; z-index:190; max-height:min(82vh,720px);
  background:#fff; border-radius:22px 22px 0 0; box-shadow:0 -10px 32px rgba(0,0,0,.20);
  transform:translateY(105%); transition:transform .28s cubic-bezier(.22,.8,.25,1); overflow:hidden;
}
.wifi-sheet.open { transform:translateY(0); }
.wifi-sheet.dragging { transition:none; }
.wifi-sheet-scroll {
  max-height:min(82vh,720px); overflow-y:auto; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; padding-bottom:calc(18px + env(safe-area-inset-bottom));
}
.sheet-grab {
  display:none;
}
.sheet-head {
  position:sticky;
  top:0;
  z-index:8;
  display:grid;
  grid-template-columns:1fr 38px;
  gap:10px;
  align-items:start;
  padding:24px 18px 14px;
  border-bottom:1px solid var(--border);
  background:#fff;
  box-shadow:0 2px 8px rgba(13,39,64,.05);
  touch-action:none;
}

.sheet-handle {
  position:absolute;
  top:8px;
  left:50%;
  transform:translateX(-50%);
  width:48px;
  height:5px;
  border-radius:999px;
  background:#bfc9d1;
  box-shadow:0 1px 2px rgba(13,39,64,.10);
  pointer-events:none;
}
.sheet-id { color:var(--orange); font-size:10px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.sheet-title { color:var(--bleu-fonce); font-size:22px; font-weight:850; line-height:1.15; margin-top:2px; }
.sheet-status { display:inline-flex; align-items:center; gap:6px; margin-top:7px; color:var(--muted); font-size:11px; font-weight:750; }
.sheet-close { width:38px; height:38px; border:0; border-radius:11px; background:#eef2f5; color:var(--bleu-fonce); font-size:22px; cursor:pointer; }
.sheet-content { padding:16px 18px 4px; }
.sheet-field { border:1px solid var(--border); border-radius:14px; padding:12px 13px; margin-bottom:10px; }
.sheet-field-label { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.05em; }
.sheet-field-value { color:var(--bleu-fonce); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:14px; margin-top:6px; word-break:break-word; }
.sheet-field-empty { color:var(--muted); font-style:italic; font-family:inherit; }
.sheet-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.sheet-btn { border:0; border-radius:12px; padding:11px 12px; font-weight:800; cursor:pointer; }
.sheet-btn.secondary { background:#edf2f5; color:var(--bleu-fonce); }
.sheet-btn.primary { background:var(--orange); color:#fff; }
.sheet-btn.copied { background:#e4f5ea; color:#287046; }
.sheet-note { margin-top:10px; padding:10px 12px; border-radius:11px; background:var(--orange-clair); color:#7d4817; font-size:12px; line-height:1.45; }
.sheet-qr { display:none; margin-top:14px; text-align:center; padding:16px 10px 4px; border-top:1px solid var(--border); }
.sheet-qr.open { display:block; }
.sheet-qr-wrap { display:inline-block; background:#fff; padding:10px; border-radius:12px; box-shadow:0 2px 10px rgba(13,39,64,.08); }
.sheet-qr-hint { color:var(--muted); font-size:11px; margin-top:8px; line-height:1.4; }
.no-result {
  display:none;
  padding:28px 16px;
  text-align:center;
  color:var(--muted);
}

@media (min-width:700px) {
  .dim-grid { grid-template-columns:1fr 1fr; }
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 3000;

    max-width: calc(100vw - 32px);
    padding: 10px 14px;
    border-radius: 12px;

    background: #151c48;
    color: #fff;

    font-size: .82rem;
    font-weight: 700;
    text-align: center;

    box-shadow: 0 5px 14px rgba(21, 28, 72, .28);

    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px);

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

#appSplash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: opacity .35s ease;
}

#appSplash img {
    width: min(90vw, 700px);
    height: auto;
}

#appSplash.hide {
    opacity: 0;
    pointer-events: none;
}