/* ZAIA · Console développeur
   Style éditorial NEWTIV : surfaces plates, un seul accent, angles quasi nets,
   typographie forte. Pas de halo, pas de flou, pas d'ombre décorative. */

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --line: #e4e3df;
  --line-strong: #cfcdc7;
  --ink: #0b0b0b;
  --ink-2: #3d3c39;
  --muted: #6b6a66;
  --accent: #0a4fa3;
  --accent-strong: #083d7e;
  --accent-soft: #e8f0fa;
  --ok: #0b7a2b;
  --ok-soft: #e7f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --bad: #b42323;
  --bad-soft: #fbe9e9;
  /* Graphiques (validés daltonisme, mode clair) */
  --c-allow: #2a78d6;
  --c-challenge: #eda100;
  --c-deny: #e34948;
  --c-seq: #2a78d6;
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Sora', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --side: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; color: var(--ink); }
h1 { font-size: 30px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 700 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--bad); border-color: #e6b8b8; }
.btn.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #efeeeb; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: #efeeeb; color: var(--ink); }

/* ── Champs ─────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: 600 14px var(--font);
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #cfcdc7; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 19px; }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.segmented button { border: 0; background: #fff; padding: 0 14px; height: 38px; font: 700 13px var(--font); cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--ink); color: #fff; }

/* ── Auth ───────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand h1 { color: #fff; font-size: 40px; margin: 28px 0 14px; }
.auth-brand p { color: #c9c8c3; font-size: 16px; max-width: 460px; }
.auth-points { display: grid; gap: 18px; margin-top: 36px; max-width: 460px; }
.auth-points div { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: #e7e6e1; font-weight: 600; }
.auth-points svg { color: #8fb8ea; margin-top: 2px; }
.auth-points b { color: #fff; display: block; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-foot { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .04em; color: inherit; }
.logo-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: var(--r-sm); }
.logo-mark svg { width: 18px; height: 18px; }

/* ── Coquille ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 8px 18px; color: var(--ink); }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.nav-item:hover { background: #f1f0ed; text-decoration: none; color: var(--ink); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); }
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: auto; }
.nav-item .dot.off { background: var(--bad); }
.nav-item span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: 14px; min-width: 0; }
.crumbs b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.page { padding: 28px 32px 64px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.banner svg { margin-top: 1px; }
.banner.warn { background: var(--warn-soft); color: #5c3c00; }
.banner.info { background: var(--accent-soft); color: #0b3366; }
.banner.bad { background: var(--bad-soft); color: #7a1414; }
.banner.ok { background: var(--ok-soft); color: #0b4d1d; }
.banner .grow p { margin: 2px 0 0; font-weight: 500; }

/* ── Cartes, tuiles ─────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.tile .k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tile .k i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tile .v { font-family: var(--display); font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.tile .s { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.grey { background: #efeeeb; color: var(--ink-2); }
.pill svg { width: 13px; height: 13px; }

.copy { display: inline-flex; align-items: center; gap: 8px; background: #f1f0ed; border-radius: var(--r-sm); padding: 4px 6px 4px 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; max-width: 100%; }
.copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy button { border: 0; background: transparent; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; padding: 3px; border-radius: 2px; }
.copy button:hover { background: #e2e1dc; color: var(--ink); }
.copy button svg { width: 15px; height: 15px; }

.secret-box { background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 16px; font-family: var(--mono); font-size: 14px; word-break: break-all; display: flex; gap: 12px; align-items: center; }
.secret-box span { flex: 1; }

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--muted); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a svg { width: 16px; height: 16px; }

/* ── Tableaux ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-mini { height: 6px; background: #ecebe7; border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar-mini i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ── Démarrage ───────────────────────────────────────────────────────────── */
.steps { display: grid; gap: 0; counter-reset: s; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: var(--display); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-2); }
pre.code { position: relative; background: #111214; color: #e9e7e1; border-radius: var(--r-md); padding: 16px 18px; overflow-x: auto; font: 500 12.8px/1.6 var(--mono); margin: 8px 0 0; }
pre.code .cp { position: absolute; top: 8px; right: 8px; background: #2a2b2e; color: #e9e7e1; border: 0; border-radius: 2px; height: 28px; padding: 0 10px; font: 700 12px var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
pre.code .cp:hover { background: #3a3b3f; }
pre.code .cp svg { width: 14px; height: 14px; }
.lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lang-tabs button { border: 1px solid var(--line-strong); background: #fff; height: 30px; padding: 0 12px; border-radius: 15px; font: 700 12.5px var(--font); cursor: pointer; color: var(--ink-2); }
.lang-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Graphiques ─────────────────────────────────────────────────────────── */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: #ecebe7; stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 600 11px var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; z-index: 20; transform: translate(-50%, calc(-100% - 10px)); }
.tooltip b { display: block; font-size: 13px; margin-bottom: 4px; }
.tooltip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.tooltip .tr { display: flex; justify-content: space-between; gap: 18px; }

/* Seuils de décision */
.zones { display: flex; height: 34px; border-radius: var(--r-sm); overflow: hidden; margin: 10px 0 6px; }
.zones div { display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #fff; min-width: 0; overflow: hidden; white-space: nowrap; }
.zones .z-allow { background: #2a78d6; }
.zones .z-soft { background: #6da7ec; color: #0b2a55; }
.zones .z-chal { background: #eda100; color: #3b2600; }
.zones .z-deny { background: #e34948; }
.zones .z-alert { background: #8f1d1d; }
.zone-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; }

/* Simulateur */
.sim { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.sim-row { display: grid; grid-template-columns: 1fr 140px 40px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f0efec; font-size: 13.5px; font-weight: 600; }
.sim-row input[type=range] { width: 100%; accent-color: var(--accent); }
.sim-row output { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--muted); }
.sim-result { position: sticky; top: 80px; align-self: start; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; text-align: center; }
.sim-result .big { font-family: var(--display); font-size: 52px; font-weight: 800; letter-spacing: -0.03em; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* Journal */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: #fff; font: 700 12.5px var(--font); cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ev-detail td { background: var(--surface-2); }
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 6px 4px; }
.feat { display: grid; grid-template-columns: 1fr 120px 36px; gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; font-weight: 600; }
.feat .bar-mini i { background: var(--ink-2); }
.feat.hot .bar-mini i { background: var(--c-deny); }
.reason { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 4px 0; font-weight: 600; }
.reason svg { color: var(--bad); width: 16px; height: 16px; }

/* Adapters */
.presets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.preset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; color: inherit; display: grid; gap: 4px; }
.preset:hover { border-color: var(--ink); }
.preset b { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.preset small { color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.preset.on { border-color: var(--accent); background: var(--accent-soft); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .ico { width: 36px; height: 36px; border-radius: var(--r-md); background: #f1f0ed; display: grid; place-items: center; flex: none; }

/* Origines */
.origin-row { display: grid; grid-template-columns: 170px 1fr 36px; gap: 8px; margin-bottom: 8px; }

/* Chips de permissions */
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; min-height: 42px; align-items: center; }
.tags span { background: #f1f0ed; border-radius: 2px; padding: 3px 4px 3px 8px; font: 600 12.5px var(--mono); display: inline-flex; gap: 4px; align-items: center; }
.tags span button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 14px; line-height: 1; }
.tags input { border: 0; height: 28px; flex: 1; min-width: 120px; padding: 0 4px; font: 600 13px var(--mono); }
.tags input:focus { outline: none; }

/* ── Modale, toasts ─────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(11, 11, 11, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); font-weight: 700; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 380px; }
.toast.bad { background: var(--bad); }
.toast svg { width: 18px; height: 18px; }

.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; }

.doc h2 { margin: 30px 0 10px; }
.doc h3 { margin: 22px 0 8px; }
.doc table { margin: 10px 0 16px; }
.doc td code { white-space: nowrap; }
.method { font: 800 11.5px var(--mono); padding: 3px 7px; border-radius: 2px; background: var(--ink); color: #fff; margin-right: 8px; }
.method.get { background: var(--ok); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sim { grid-template-columns: 1fr; }
  .sim-result { position: static; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 20px; }
  .auth-brand h1 { font-size: 30px; }
  .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .page { padding: 20px 16px 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .ev-grid { grid-template-columns: 1fr; }
  .origin-row { grid-template-columns: 1fr 36px; }
  .origin-row select { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  h1 { font-size: 24px; }
  .sim-row { grid-template-columns: 1fr 100px 36px; }
}
