/* base.css — composants du prototype client (cadre téléphone + écrans).
   RÈGLES : propriétés logiques uniquement (margin-inline, padding-inline, inset-inline, text-align:start,
   border-start-*) ; aucune couleur en dur (tokens.css) ; cibles >= 44 px ; focus visible.
   Exceptions physiques assumées : la CARTE (géographie, jamais en miroir). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stage);
  color: var(--foreground);
  font-family: var(--font-body);
  line-height: var(--leading-body);
  min-height: 100dvh;
  overflow-x: clip;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--heading-weight); letter-spacing: var(--tracking-display); margin: 0; line-height: 1.3; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--foreground); color: var(--background); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* ---------- texte ---------- */
.small { font-size: 0.8125rem; }
.xs { font-size: 0.75rem; }
html[dir="rtl"] .small { font-size: 0.875rem; }   /* +1 cran en arabe sous 14 px */
html[dir="rtl"] .xs { font-size: 0.8125rem; }
.muted { color: var(--muted-foreground); }
.strong { font-weight: 700; }
.t-title { font-size: 1.25rem; }
.t-hero { font-size: 1.5rem; }
.num, .ltr { unicode-bidi: isolate; }
.ltr { direction: ltr; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-lg { width: 28px; height: 28px; }
html[dir="rtl"] .dirflip { transform: scaleX(-1); }   /* chevrons / retour : miroir RTL ; jamais les logos, coches, loupes */

/* ---------- barre d'outils desktop (hors téléphone) ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 10px 16px; background: var(--card); border-block-end: 1px solid var(--border); }
.toolbar .tb-title { font-weight: 700; flex: 1 1 200px; }
.toolbar a { color: var(--primary-ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { min-height: 44px; min-width: 52px; padding-inline: 14px; border: 0; background: transparent; color: var(--foreground); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); }
.seg button + button { border-inline-start: 1px solid var(--input); }

.stage { display: flex; gap: 24px; justify-content: center; align-items: flex-start; padding: 20px 16px 40px; flex-wrap: wrap; }
.panel { width: 300px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 14px; }
.panel h2 { font-size: 0.9375rem; }
.panel .grp { display: grid; gap: 6px; }
.panel .grp > .lbl { font-size: 0.8125rem; font-weight: 700; color: var(--muted-foreground); }
html[dir="rtl"] .panel .grp > .lbl { font-size: 0.875rem; }
.panel .seg { flex-wrap: wrap; border-radius: 12px; }
.panel .seg button { flex: 1 1 auto; border-radius: 0; }
.panel .jump { display: grid; gap: 6px; }
.panel .jump button { min-height: 44px; text-align: start; padding-inline: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); cursor: pointer; }
.panel .jump button:hover { border-color: var(--primary); }
.panel .note { font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.7; }
html[dir="rtl"] .panel .note { font-size: 0.875rem; }
.panel select { min-height: 44px; border: 1px solid var(--input); border-radius: 10px; background: var(--card); padding-inline: 10px; }

/* ---------- téléphone ---------- */
.phone-wrap { display: grid; justify-items: center; gap: 8px; }
.ribbon { font-size: 0.8125rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--highlight); color: var(--highlight-foreground); }
html[dir="rtl"] .ribbon { font-size: 0.875rem; }
.phone {
  position: relative; width: 390px; height: 844px; flex: none;
  border: 10px solid var(--device); border-radius: 46px; overflow: hidden;
  background: var(--background); color: var(--foreground);
  box-shadow: var(--elevation-lg); display: flex; flex-direction: column; isolation: isolate;
}
.statusbar { flex: none; height: 30px; position: relative; background: transparent; z-index: 3; }
.notch { position: absolute; top: 6px; inset-inline: 0; margin-inline: auto; width: 96px; height: 20px; border-radius: 999px; background: var(--device); }
.screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.page.anim { animation: pgin 0.18s ease-out; }
@keyframes pgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.phone .page { padding-block-end: 8px; }
.pad { padding: 16px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding-block: 2px; scroll-snap-type: x proximity; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* header de page */
.hdr { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 56px; }
.hdr h1 { font-size: 1.0625rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--foreground); cursor: pointer; }
.icon-btn:hover { background: var(--muted); }
.icon-btn.solid { background: var(--card); border: 1px solid var(--border); box-shadow: var(--elevation-sm); }
.icon-btn[aria-pressed="true"] { color: var(--danger); }
.icon-btn[aria-pressed="true"] .ic { fill: currentColor; }

/* barre d'onglets */
.tabbar { flex: none; display: flex; background: var(--card); border-block-start: 1px solid var(--border); padding-block-end: env(safe-area-inset-bottom); z-index: 4; }
.tab { position: relative; flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: var(--muted-foreground); cursor: pointer; font-size: 0.75rem; padding-inline: 2px; }
html[dir="rtl"] .tab { font-size: 0.8125rem; }
.tab[aria-current="page"] { color: var(--primary-ink); font-weight: 800; }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; inset-inline: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.tab .badge-dot { position: absolute; top: 8px; inset-inline-end: 28%; min-width: 18px; height: 18px; padding-inline: 4px; border-radius: 9px; background: var(--danger); color: var(--on-state); font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; }

/* ---------- boutons, chips, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-h); padding-inline: 18px; border-radius: var(--radius); border: 1px solid var(--input); background: var(--card); color: var(--foreground); font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.25; text-align: center; }
.btn:hover { background: var(--muted); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-state); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 44px; padding-inline: 14px; font-size: 0.875rem; }
.btn[aria-disabled="true"], .btn:disabled { background: var(--muted); border-color: var(--border); color: var(--muted-foreground); cursor: not-allowed; }
.btn small { display: block; font-weight: 500; font-size: 0.75rem; opacity: 1; }
.btn-stack { flex-direction: column; gap: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--input); background: var(--card); color: var(--foreground); font-size: 0.875rem; white-space: nowrap; cursor: pointer; scroll-snap-align: start; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); font-weight: 700; }
html[dir="rtl"] .chip { font-size: 0.9375rem; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; min-height: 24px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); white-space: nowrap; }
html[dir="rtl"] .badge { font-size: 0.8125rem; }
.badge .ic { width: 14px; height: 14px; }
.badge.primary { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.hl { background: var(--highlight); color: var(--highlight-foreground); border-color: transparent; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--muted); color: var(--foreground); font-size: 0.875rem; }
html[dir="rtl"] .banner { font-size: 0.9375rem; }
.banner .ic { margin-block-start: 2px; }
.banner.warn { background: var(--warning-soft); }
.banner.warn .ic { color: var(--warning); }
.banner.err { background: var(--danger-soft); }
.banner.err .ic { color: var(--danger); }
.banner.info { background: var(--info-soft); }
.banner.info .ic { color: var(--info); }
.banner.ok { background: var(--success-soft); }
.banner.ok .ic { color: var(--success); }
.banner .btn { margin-block-start: 8px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.hr { border: 0; border-block-start: 1px solid var(--border); margin: 0; }

.page.noscroll { overflow: hidden; }
.pillbtn { background: none; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; color: inherit; }

/* ---------- squelette / vide / erreur ---------- */
.sk { background: linear-gradient(90deg, var(--muted), var(--border), var(--muted)); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { height: 150px; border-radius: var(--radius); }
.sk-line { height: 14px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 20px; }
.empty .ill { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.empty .ill .ic { width: 32px; height: 32px; }
.empty h2 { font-size: 1.0625rem; }
.empty p { color: var(--muted-foreground); max-width: 28ch; }

/* ---------- cartes d'offres ---------- */
.ocard { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--elevation-sm); }
.ocard-main { display: block; width: 100%; text-align: start; border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; }
.ocard-media { display: grid; place-items: center; height: 96px; background: color-mix(in srgb, var(--primary) 18%, var(--muted)); color: var(--foreground); }
.ocard-media .ic { width: 30px; height: 30px; }
.ocard-body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.ocard-merchant { font-size: 0.8125rem; color: var(--muted-foreground); }
html[dir="rtl"] .ocard-merchant { font-size: 0.875rem; }
.ocard-title { font-weight: 700; line-height: 1.45; }
.ocard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 4px; }
.ocard .fav { position: absolute; top: 4px; inset-inline-end: 4px; z-index: 2; background: color-mix(in srgb, var(--card) 88%, transparent); }
.lockmark { display: inline-flex; align-items: center; gap: 4px; }

.orow { position: relative; display: flex; gap: 12px; align-items: stretch; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 84px; }
.orow-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; text-align: start; border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; }
.orow-thumb { width: 64px; height: 64px; flex: none; border-radius: calc(var(--radius) * 0.7); display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 18%, var(--muted)); color: var(--foreground); }
.orow-text { display: grid; gap: 2px; min-width: 0; }
.orow-text .t { font-weight: 700; line-height: 1.4; }
.orow .fav { align-self: center; }

.tile { display: grid; gap: 6px; justify-items: start; text-align: start; padding: 14px; min-height: 88px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); cursor: pointer; color: inherit; }
.tile .ic { width: 26px; height: 26px; color: var(--primary-ink); }
.tile .t { font-weight: 700; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-h h2 { font-size: 1.0625rem; }

/* ---------- carte fictive ---------- */
.map { position: relative; overflow: hidden; direction: ltr; background: var(--map-land); }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mp-land { fill: var(--map-land); }
.mp-water { fill: var(--map-water); }
.mp-block { fill: var(--map-block); }
.mp-road { stroke: var(--map-road); fill: none; stroke-linecap: round; }
/* physical-ok: positions géographiques, la carte ne se met pas en miroir */
.pin { position: absolute; width: 44px; height: 44px; margin: -44px 0 0 -22px; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.pin-body { width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--primary); color: var(--primary-foreground); border: 2px solid var(--pin-border); display: grid; place-items: center; box-shadow: var(--elevation-md); }
.pin-body .ic { transform: rotate(45deg); width: 17px; height: 17px; }
.pin.is-sel { z-index: 4; }
.pin.is-sel .pin-body { width: 42px; height: 42px; background: var(--foreground); color: var(--background); border-color: var(--primary); border-width: 3px; }
.pin-label { position: absolute; top: -10px; inset-inline-start: 50%; transform: translate(-50%, -100%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: 0.75rem; font-weight: 700; unicode-bidi: plaintext; direction: ltr; }
.udot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--info); border: 3px solid var(--pin-border); box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 22%, transparent); z-index: 3; }
.areamark { position: absolute; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%; border: 2px dashed var(--foreground); display: grid; place-items: start center; z-index: 1; background: color-mix(in srgb, var(--primary) 8%, transparent); }
.areamark-chip { margin-top: -14px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: 0.75rem; font-weight: 700; }
.areamark-chip .ic { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .udot { animation: pulse 2.4s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 40%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
}

/* ---------- détail d'offre ---------- */
.hero { height: 190px; display: grid; place-items: center; align-content: center; gap: 6px; background: color-mix(in srgb, var(--primary) 18%, var(--muted)); color: var(--foreground); text-align: center; }
.hero .ic { width: 40px; height: 40px; }
.dbody { padding: 16px; display: grid; gap: 14px; }
.dbody h1 { font-size: 1.375rem; }
.kv { display: grid; gap: 4px; }
.kv .k { font-size: 0.8125rem; font-weight: 700; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
html[dir="rtl"] .kv .k { font-size: 0.875rem; }
.kv .v { line-height: 1.7; }
.terms { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.locked { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; min-height: 190px; }
.locked-body { display: grid; gap: 12px; padding: 14px; filter: blur(7px); user-select: none; pointer-events: none; }
.bar { height: 12px; border-radius: 6px; background: var(--muted-foreground); opacity: 0.45; }
.bar.w60 { width: 60%; } .bar.w80 { width: 80%; } .bar.w40 { width: 40%; }
.locked-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px; background: color-mix(in srgb, var(--card) 62%, transparent); }
.locked-cta .ic { width: 28px; height: 28px; }
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-block-start: 1px solid var(--border); }
.actionbar .btn-primary, .actionbar .btn-block { flex: 1; }
.quota { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--primary-soft); color: var(--foreground); font-size: 0.875rem; }
html[dir="rtl"] .quota { font-size: 0.9375rem; }
.quota .ic { color: var(--primary-ink); }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--primary-ink); background: transparent; }
.dot.on { background: var(--primary-ink); }

/* ---------- passeport ---------- */
.passport { padding: 16px; border-radius: calc(var(--radius) * 1.2); background: var(--highlight); color: var(--highlight-foreground); display: grid; gap: 10px; }
.passport h2 { font-size: 1.125rem; }
.stamps { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.stamp { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--highlight-foreground); color: var(--highlight-foreground); }
.stamp.used { background: var(--highlight-foreground); border-style: solid; color: var(--highlight); }
.passport .btn { background: var(--highlight-foreground); border-color: var(--highlight-foreground); color: var(--highlight); }
.passport .btn:hover { background: var(--highlight-foreground); }

/* ---------- formulaires ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.875rem; }
.input, .select, .textarea { width: 100%; min-height: var(--control-h); border: 1px solid var(--input); border-radius: calc(var(--radius) * 0.8); background: var(--card); color: var(--foreground); padding-inline: 12px; font-size: 1rem; }
.textarea { padding-block: 10px; min-height: 96px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.err-msg { color: var(--danger); font-size: 0.8125rem; display: flex; gap: 6px; align-items: center; }
html[dir="rtl"] .err-msg { font-size: 0.875rem; }
.hint { color: var(--muted-foreground); font-size: 0.8125rem; }
html[dir="rtl"] .hint { font-size: 0.875rem; }
.searchbox { display: flex; align-items: center; gap: 8px; min-height: 48px; padding-inline: 14px; border: 1px solid var(--input); border-radius: 999px; background: var(--card); color: var(--muted-foreground); width: 100%; cursor: text; text-align: start; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; min-height: 44px; color: var(--foreground); }
.searchbox:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.lrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding-inline: 4px; border: 0; background: transparent; width: 100%; text-align: start; cursor: pointer; color: inherit; border-block-end: 1px solid var(--border); }
.lrow .grow { display: grid; }
.lrow.danger { color: var(--danger); }

/* ---------- forfaits ---------- */
.plan { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; min-height: 72px; padding: 14px; border: 2px solid var(--input); border-radius: var(--radius); background: var(--card); cursor: pointer; color: inherit; }
.plan[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--input); display: grid; place-items: center; flex: none; }
.plan[aria-checked="true"] .radio { border-color: var(--primary-ink); background: var(--primary-ink); color: var(--card); }
.plan .radio .ic { width: 14px; height: 14px; }
.plan .price { font-weight: 800; font-size: 1.125rem; }

/* ---------- QR ---------- */
.qrwrap { position: relative; display: grid; place-items: center; width: 232px; height: 232px; margin-inline: auto; }
.qrbox { background: var(--qr-bg); padding: 14px; border-radius: 16px; border: 1px solid var(--border); }
.qr-svg { width: 168px; height: 168px; display: block; }
.qr-mod { fill: var(--qr-fg); }
.qrbox.dim .qr-svg { opacity: 0.12; }
.qr-over { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
html[dir="rtl"] .ringsvg { transform: rotate(-90deg) scaleY(-1); }  /* le compte à rebours tourne dans le sens de lecture */
.ring-bg { fill: none; stroke: var(--border); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.4s linear; }
.codebox { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.18em; direction: ltr; text-align: center; padding: 10px 14px; border: 1px dashed var(--input); border-radius: 12px; background: var(--card); }

/* ---------- feuilles et toasts ---------- */
.scrim { position: absolute; inset: 0; background: var(--overlay); z-index: 30; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: absolute; inset-inline: 0; bottom: 0; z-index: 31; max-height: 90%; overflow-y: auto; background: var(--card); color: var(--card-foreground); border-start-start-radius: 22px; border-start-end-radius: 22px; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; animation: up 0.2s ease-out; box-shadow: var(--elevation-lg); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin-inline: auto; }
.sheet h2 { font-size: 1.1875rem; }
.toast { position: absolute; inset-inline: 16px; bottom: 76px; z-index: 40; padding: 12px 16px; border-radius: 12px; background: var(--foreground); color: var(--background); font-size: 0.9375rem; box-shadow: var(--elevation-md); display: flex; gap: 8px; align-items: center; }
.toast:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- petit écran réel : le cadre devient l'écran ---------- */
@media (max-width: 520px) {
  .stage { padding: 0; gap: 0; }
  .phone-wrap { width: 100%; }
  .phone { width: 100%; height: calc(100dvh - 120px); border: 0; border-radius: 0; box-shadow: none; }
  .notch { display: none; }
  .statusbar { height: 8px; }
  .panel { width: 100%; border-radius: 0; margin-block-start: 12px; }
}
