/* Layout: one narrow column, like a guided form at a ventanilla; a thin zellige/azulejo band ties Morocco and Andalusia together. */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #10233A;
  --muted: #586779;
  --line: #D9E0E8;
  --accent: #2148B8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E5EBFA;
  --saffron: #C98A12;
  --ok: #1D7A4B;
  --ok-soft: #E3F3EA;
  --warn: #A9600C;
  --warn-soft: #FBEFDD;
  --no: #A83636;
  --no-soft: #F8E6E6;
  --pro: #5B44A6;
  --pro-soft: #EEEAF8;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C141F; --surface: #142030; --ink: #E6ECF3; --muted: #98A6B7; --line: #24344A;
    --accent: #85A3FF; --accent-ink: #0C141F; --accent-soft: #1A2A48; --saffron: #EDB44A;
    --ok: #55C792; --ok-soft: #12301F; --warn: #EBA552; --warn-soft: #33240F;
    --no: #F08383; --no-soft: #3A1A1A; --pro: #B5A2F2; --pro-soft: #251D40;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C141F; --surface: #142030; --ink: #E6ECF3; --muted: #98A6B7; --line: #24344A;
  --accent: #85A3FF; --accent-ink: #0C141F; --accent-soft: #1A2A48; --saffron: #EDB44A;
  --ok: #55C792; --ok-soft: #12301F; --warn: #EBA552; --warn-soft: #33240F;
  --no: #F08383; --no-soft: #3A1A1A; --pro: #B5A2F2; --pro-soft: #251D40;
  color-scheme: dark;
}
[dir="rtl"] { --display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif; --body: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.demo { background: var(--saffron); color: var(--bg); font-size: 13px; font-weight: 600; text-align: center; padding-block: 6px; }
.demo .wrap { padding-block: 0; }

header { padding-block: 16px; }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.star { position: relative; width: 22px; height: 22px; flex: none; }
.star i { position: absolute; inset: 3px; background: var(--accent); }
.star i + i { transform: rotate(45deg); background: var(--saffron); mix-blend-mode: multiply; }
.langs { display: flex; gap: 4px; }
.langs button { font: 500 13px var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.band { height: 10px; background: repeating-conic-gradient(from 45deg, var(--accent) 0 25%, var(--accent-soft) 0 50%) 0 0 / 10px 10px; opacity: .55; }

main { padding-block: 28px 48px; }
h1, h2 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
[dir="rtl"] h1, [dir="rtl"] h2 { font-weight: 700; }
h1 { font-size: clamp(32px, 8vw, 46px); line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: clamp(23px, 5.5vw, 30px); line-height: 1.2; }
p { margin: 0; }
.lead { color: var(--muted); font-size: 17px; max-width: 58ch; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 16px var(--body); border-radius: 12px; padding: 14px 20px; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible, .langs button:focus-visible, .back:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; list-style: none; padding: 0; margin: 0; }
.facts li { display: flex; align-items: center; gap: 6px; }
.facts li::before { content: ""; width: 6px; height: 6px; background: var(--saffron); transform: rotate(45deg); }

.preview { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 8px; }
.preview .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ref { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.collab { font-size: 14px; color: var(--muted); }
.collab b { color: var(--ink); font-weight: 600; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.hint { color: var(--muted); font-size: 15px; }
.opts { display: grid; gap: 10px; }
.opt { width: 100%; text-align: start; font: 500 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.opt::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"]::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 45%, transparent 50%); }
@media (hover: hover) { .opt:hover { border-color: var(--accent); } }
.back { background: none; border: 0; color: var(--muted); font: 500 15px var(--body); cursor: pointer; padding: 4px 0; align-self: flex-start; }
.selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select, input[type="text"], input[type="email"], input[type="tel"] { width: 100%; font: 400 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; }
label.field { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 10px; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-ok { color: var(--ok); background: var(--ok-soft); }
.lv-warn { color: var(--warn); background: var(--warn-soft); }
.lv-no { color: var(--no); background: var(--no-soft); }
.lv-pro { color: var(--pro); background: var(--pro-soft); }

.route { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.route h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.25; margin: 0; }
[dir="rtl"] .route h3 { font-weight: 700; font-size: 19px; }
.route .head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sub { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
[dir="rtl"] .sub { letter-spacing: 0; }
.docs { margin: 0; padding-inline-start: 18px; display: grid; gap: 3px; }
.tbc { font-family: var(--mono); font-size: 12px; color: var(--saffron); background: var(--accent-soft); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.when { font-weight: 600; color: var(--ink); }
.note { border-inline-start: 3px solid var(--saffron); background: var(--surface); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 15px; }
[dir="rtl"] .note { border-radius: 10px 0 0 10px; }
.note.alert { border-color: var(--no); }
.actions { display: grid; gap: 10px; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.error { color: var(--no); font-size: 14px; font-weight: 500; }
.done { background: var(--ok-soft); color: var(--ink); border-radius: 14px; padding: 18px; }

.gest { background: var(--accent-soft); border-radius: 16px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.gname { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.btnrow .btn { padding: 12px 16px; font-size: 15px; }
.demo-note { font-size: 14px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.panel h2 { font-size: 22px; }
.grid2 { display: grid; gap: 12px; }
.mail { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.mail .mh { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.mail .mh b { color: var(--ink); font-weight: 500; }
.mail .mb { padding: 18px 16px; display: grid; gap: 14px; min-width: 0; }
.mres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mfoot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
footer { border-top: 1px solid var(--line); padding-block: 18px 28px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--accent); font: 600 14px var(--body); cursor: pointer; padding: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--body); color: var(--ink); cursor: pointer; }
.tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
textarea { width: 100%; min-height: 100px; font: 400 15px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
input[type="url"], input[type="number"] { width: 100%; font: 400 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.acts { display: grid; gap: 8px; }
.acts label { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.acts input { width: 18px; height: 18px; accent-color: var(--accent); }
.mono { font-family: var(--mono); font-size: 14px; }
.tabs button:focus-visible, .linkbtn:focus-visible, textarea:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.svc { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.svc li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line); }
.bar i { display: block; height: 100%; }
.seg-ok { background: var(--ok); } .seg-warn { background: var(--warn); } .seg-no { background: var(--no); } .seg-pro { background: var(--pro); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.toplist { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.toplist li { display: flex; justify-content: space-between; gap: 10px; }
.toplist b { font-variant-numeric: tabular-nums; }
.lrow { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; min-width: 0; }
.lrow .who { font-weight: 600; font-size: 16px; }
.lmeta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.badge.mine { border-color: var(--accent); color: var(--accent); }
.lrow select { width: auto; padding: 8px 10px; font-size: 14px; }
.qa { margin: 0; display: grid; gap: 8px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.qa dt { color: var(--muted); }
.qa dd { margin: 0; font-weight: 500; }
.dashtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.bubble { background: #DCF8C6; color: #111B21; border-radius: 12px 12px 4px 12px; padding: 10px 12px; max-width: 34ch; font-size: 15px; justify-self: end; }
[dir="rtl"] .bubble { border-radius: 12px 12px 12px 4px; justify-self: start; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 560px) { .actions { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .progress span { transition: none; } }

/* Base (remplace le gabarit de la maquette) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
