/* ترقية 2027 — interface arabe, de droite à gauche.
   Palette « échiquier de tournoi » : vert de club, cases claires et foncées. */

:root {
  --bg: #F2F4EF;
  --surface: #FFFFFF;
  --surface-2: #F7F9F5;
  --ink: #16201A;
  --ink-2: #2E3A33;
  --muted: #5A675F;
  --line: #D3DBD0;
  --line-2: #E4E9E1;
  --accent: #2B6A4A;
  --accent-strong: #1F5139;
  --accent-ink: #FFFFFF;
  --accent-soft: #E0ECE3;
  --sq-light: #E9EEE4;
  --sq-dark: #9BB29E;
  --sq-dark-ink: #12301F;
  --ok: #2B6A4A;
  --ok-soft: #E0ECE3;
  --warn: #8F5400;
  --warn-soft: #FAEBD2;
  --crit: #B3261E;
  --crit-soft: #FAE1DE;
  --info: #3D5A87;
  --info-soft: #E3EAF5;
  --k-classe: #C8D2E2;
  --k-etude: #2B6A4A;
  --k-repos: #E4C06B;
  --k-repas: #E6D7C5;
  --k-trajet: #C9CFC5;
  --k-ecran: #D6C8E6;
  --shadow: 0 1px 0 rgba(22, 32, 26, .04), 0 12px 30px -18px rgba(22, 32, 26, .35);
  --radius: 10px;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --naskh: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;
  --glyph: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1411;
    --surface: #161D19;
    --surface-2: #1B231E;
    --ink: #E2E9E0;
    --ink-2: #C6D0C7;
    --muted: #98A69D;
    --line: #2A342E;
    --line-2: #222A25;
    --accent: #7DBA95;
    --accent-strong: #97CCAB;
    --accent-ink: #0F1411;
    --accent-soft: #1B2C22;
    --sq-light: #1F2823;
    --sq-dark: #3C5344;
    --sq-dark-ink: #E2EFE5;
    --ok: #7DBA95;
    --ok-soft: #1B2C22;
    --warn: #E2A443;
    --warn-soft: #2E2413;
    --crit: #F07A6F;
    --crit-soft: #331A18;
    --info: #93AEDB;
    --info-soft: #1C2536;
    --k-classe: #34405A;
    --k-etude: #5FA57C;
    --k-repos: #8A6E25;
    --k-repas: #4B4034;
    --k-trajet: #39413B;
    --k-ecran: #4A3F5E;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 12px 30px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; }
h1 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin: 22px 0 4px; }
h2 { font-size: 1.22rem; margin: 0 0 10px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.eyebrow { font-size: .85rem; color: var(--muted); margin: 0; font-weight: 700; }
.boot-msg { text-align: center; padding: 60px 16px; color: var(--muted); }
.shell { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 0 72px; }
.stack { display: grid; gap: 16px; align-content: start; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 160px; }
.row.mid { align-items: center; }
.row > input[type=text] { flex: 1 1 200px; width: auto; }
.days-fs { border: 0; padding: 0; margin: 16px 0 0; }
.days-fs legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: 6px; }
.spark text.dl { font-family: var(--font); font-size: 12px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.sp { flex: 1; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.notice { background: var(--info-soft); color: var(--info); border-radius: var(--radius); padding: 12px 16px; font-weight: 700; margin: 16px 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.08rem; color: var(--ink); text-decoration: none; }
.brand .glyph { font-family: var(--glyph); font-size: 1.35rem; color: var(--accent); line-height: 1; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.who { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-weight: 700; }

/* ---------- Boutons, puces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 7px 16px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; border-color: var(--crit); color: var(--crit); }
.btn.sm { min-height: 34px; padding: 3px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; white-space: nowrap;
  background: var(--sq-light); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Panneaux, onglets ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.page-head { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 12px 0 20px; }
.tabs a { padding: 8px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.crumbs { margin-top: 14px; font-size: .92rem; }
.crumbs a { text-decoration: none; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-weight: 700; font-size: .92rem; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; min-height: 42px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
}
input[type=number], input[type=date], input[type=time] { font-family: var(--mono); }
textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.bad { border-color: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.hint { font-size: .8rem; color: var(--muted); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { padding: 6px 18px; min-height: 40px; border: 0; background: var(--surface); cursor: pointer; font-weight: 700; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.on.no { background: var(--crit); color: #fff; }

/* ---------- Tableaux ---------- */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th { text-align: start; font-size: .82rem; font-weight: 700; color: var(--muted); padding: 9px 12px; background: var(--sq-light); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 700; }

/* ---------- Connexion ---------- */
.login { max-width: 900px; margin: 0 auto; padding: 28px 16px 64px; }
.login-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.login-title { font-size: clamp(2.4rem, 7vw, 3.8rem); line-height: 1; margin: 8px 0 10px; font-weight: 700; }
.login-title .num { color: var(--accent); }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.name-card {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 132px; padding: 14px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.name-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.name-card .piece { font-family: var(--glyph); font-size: 2.3rem; line-height: 1.1; color: var(--ink-2); }
.name-card .nm { font-size: 1.4rem; font-weight: 700; }
.name-card .st { font-size: .8rem; color: var(--muted); min-height: 1.3em; }
.name-card.admin { background: var(--sq-light); grid-template-columns: auto auto; column-gap: 12px; min-height: 0; justify-content: center; }
.name-card.admin .piece { grid-row: span 2; }
.admin-row { margin-top: 12px; display: flex; justify-content: center; }
.team { margin-top: 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.team .v { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; }

/* Pendule (compte à rebours) */
.clockface {
  position: relative; min-width: 190px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 12px;
  padding: 14px 20px 10px; box-shadow: var(--shadow);
}
.clockface::before {
  content: ""; position: absolute; top: -9px; inset-inline-end: 28px;
  width: 40px; height: 7px; background: var(--ink); border-radius: 4px 4px 0 0;
}
.clockface .k { display: block; font-size: .85rem; color: var(--muted); }
.clockface .big { display: inline-block; font-family: var(--mono); font-size: 2.5rem; font-weight: 500; line-height: 1.1; direction: ltr; }
.clockface .cap { display: block; font-size: .82rem; color: var(--muted); max-width: 26ch; line-height: 1.4; }

/* ---------- Modale, pavé numérique ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 14, 10, .58); }
.modal {
  width: min(430px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
}
.modal.wide { width: min(620px, 100%); }
.modal-title { text-align: center; font-size: 1.5rem; margin: 0 0 2px; }
.dots { display: flex; justify-content: center; gap: 12px; margin: 16px 0 4px; }
.dots i { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-2); }
.dots i.on { background: var(--ink); border-color: var(--ink); }
.err { color: var(--crit); font-weight: 700; min-height: 1.5em; margin: 6px 0 0; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.keypad button { min-height: 58px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 1.45rem; cursor: pointer; }
.keypad button:hover { border-color: var(--accent); }
.keypad button.fn { font-family: var(--font); font-size: 1rem; }

/* ---------- Tableau de bord du joueur ---------- */
.player-head { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.player-head h1 { margin-bottom: 0; }
.board-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 16px; }
.goal-text { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.35; margin: 2px 0 0; text-wrap: balance; }
.bubble {
  position: relative; margin: 0 0 16px; padding: 12px 18px;
  background: var(--accent-soft); border-radius: 16px; border-start-start-radius: 4px;
  font-family: var(--naskh); font-size: 1.2rem; line-height: 1.8;
}
.banner { border-radius: var(--radius); padding: 12px 16px; font-weight: 700; margin: 0 0 16px; }
.banner.crit { background: var(--crit-soft); color: var(--crit); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.tile .k { display: block; font-size: .85rem; color: var(--muted); }
.tile .v { display: inline-block; font-family: var(--mono); font-size: 1.85rem; font-weight: 500; line-height: 1.2; direction: ltr; }
.tile .s { display: block; font-size: .85rem; color: var(--ink-2); }

/* Colonne e */
.efile { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.erank { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line); min-height: 54px; }
.erank:last-child { border-bottom: 0; }
.erank .sq { align-self: stretch; position: relative; display: grid; place-items: center; font-family: var(--glyph); font-size: 1.85rem; line-height: 1; }
.erank .sq.l { background: var(--sq-light); color: var(--ink); }
.erank .sq.d { background: var(--sq-dark); color: var(--sq-dark-ink); }
.erank .sq em { position: absolute; bottom: 3px; inset-inline-start: 5px; font: normal 10px var(--mono); opacity: .75; direction: ltr; }
.erank .nm { padding: 6px 12px; min-width: 0; }
.erank .nm strong { display: block; font-size: .98rem; }
.erank .nm span { font-size: .82rem; color: var(--muted); }
.erank .th { padding: 6px 12px; font-family: var(--mono); color: var(--muted); font-size: .9rem; }
.erank.here { background: var(--accent-soft); }
.erank.here .nm strong { color: var(--accent); }
.erank.done .th::before { content: "✓ "; color: var(--accent); }
.progress { height: 8px; background: var(--sq-light); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* Semaine */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wd { border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; text-align: center; font-size: .78rem; background: var(--surface); }
.wd b { display: block; font-size: 1.05rem; line-height: 1.3; }
.wd .dn { color: var(--muted); }
.wd.clean { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.wd.fail { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.wd.neutral { background: var(--info-soft); color: var(--info); border-color: transparent; }
.wd.missing { border-style: dashed; }
.wd.today { border-color: var(--accent); border-style: dashed; color: var(--accent); }
.err.wait { color: var(--muted); }
.wd.future { opacity: .45; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Courbe d'Elo */
.spark { width: 100%; height: auto; display: block; }
.spark .area { fill: var(--accent-soft); }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .grid-l { stroke: var(--line); stroke-width: 1; }
.spark .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.spark text { fill: var(--muted); font-family: var(--mono); font-size: 11px; }

/* Barres de notes */
.gbars { display: grid; gap: 10px; }
.gbar { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: .92rem; }
.gbar .track { position: relative; height: 12px; background: var(--sq-light); border-radius: 99px; }
.gbar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: var(--accent); }
.gbar .fill.low { background: var(--warn); }
.gbar .target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.gbar .val { font-family: var(--mono); direction: ltr; text-align: end; }

/* ---------- Journée ---------- */
.day-head { display: flex; gap: 12px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.day-head h1 { margin-bottom: 0; }
.day-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 18px; align-items: start; }
@media (max-width: 920px) { .day-grid { grid-template-columns: minmax(0, 1fr); } }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; }
.sec-h .n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: .95rem; }
.sec-h .chip { margin-inline-start: auto; }
.screen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; margin: 14px 0; }
.gauge { height: 6px; border-radius: 99px; background: var(--sq-light); overflow: hidden; }
.gauge i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .15s ease; }
.gauge.warn i { background: var(--warn); }
.gauge.crit i { background: var(--crit); }
.slot {
  display: grid; grid-template-columns: 104px 150px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-inline-start: 6px solid var(--k-classe);
}
.slot + .slot { margin-top: 6px; }
.slot.k-etude { border-inline-start-color: var(--k-etude); }
.slot.k-repos { border-inline-start-color: var(--k-repos); }
.slot.k-repas { border-inline-start-color: var(--k-repas); }
.slot.k-trajet { border-inline-start-color: var(--k-trajet); }
.slot.k-ecran { border-inline-start-color: var(--k-ecran); }
.slot .detail { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0; }
.slot .detail.plain { grid-template-columns: minmax(0, 1fr); }
.slot .proof { white-space: nowrap; font-size: .88rem; }
.slot.ro { grid-template-columns: 70px minmax(0, 1fr); }
@media (max-width: 700px) {
  .slot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .slot .detail { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); }
}
.verdict { display: grid; gap: 12px; }
.verdict ul { margin: 0; padding-inline-start: 1.2em; }
.verdict li { margin: 2px 0; }
.pts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; font-size: .94rem; }
.pts .num { text-align: end; }
.pts .zero { color: var(--muted); }
.delta { display: inline-block; font-family: var(--mono); font-size: 2rem; font-weight: 500; line-height: 1.1; direction: ltr; }
.delta.pos { color: var(--ok); }
.delta.neg { color: var(--crit); }
.saved-at { font-size: .82rem; color: var(--muted); }

/* ---------- Administration ---------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-bottom: 18px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.pcard header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pcard h2 { margin: 0; font-size: 1.35rem; }
.pcard .stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .92rem; color: var(--ink-2); }
.pcard .stats b { font-family: var(--mono); font-weight: 500; font-size: 1.1rem; color: var(--ink); }
.req { border-top: 1px solid var(--line-2); padding: 12px 0; display: grid; gap: 8px; }
.req:first-of-type { border-top: 0; }
.tt-wrap { overflow-x: auto; }
.tt { display: grid; grid-template-columns: 84px repeat(13, minmax(34px, 1fr)); gap: 3px; min-width: 620px; }
.tt .h { font: 11px var(--mono); color: var(--muted); text-align: center; align-self: end; }
.tt .dn { font-size: .85rem; font-weight: 700; align-self: center; }
.tt button { min-height: 30px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); cursor: pointer; }
.tt button.on { background: var(--k-classe); border-color: var(--info); }
pre.json { direction: ltr; text-align: left; font: 12px/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Charte ---------- */
.charter {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 26px; box-shadow: var(--shadow);
  font-family: var(--naskh); font-size: 1.12rem; line-height: 2;
}
.charter h2 { font-family: var(--naskh); font-size: 1.6rem; margin-bottom: 0; }
.charter .sub { color: var(--muted); font-size: .95rem; }
.charter ol { padding-inline-start: 1.5em; margin: 12px 0 0; }
.charter .var { background: var(--accent-soft); color: var(--accent); padding: 0 6px; border-radius: 4px; font-weight: 700; }
.sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; font-family: var(--font); font-size: .9rem; line-height: 1.5; }
.sign > div { border-top: 1.5px solid var(--ink); padding-top: 8px; display: grid; gap: 6px; align-content: start; }
.sign .when { color: var(--accent); font-weight: 700; }

/* ---------- Message éphémère ---------- */
#toast {
  position: fixed; bottom: 20px; inset-inline: 0; margin-inline: auto; z-index: 60;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 18px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 700;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }
#toast.err { background: var(--crit); color: #fff; }

@media (max-width: 640px) {
  .login-head, .board-head { grid-template-columns: minmax(0, 1fr); }
  .clockface { justify-self: start; }
  .sign { grid-template-columns: minmax(0, 1fr); }
  .gbar { grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 56px; }
  .who span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
