/* ============================================================
   Tableau-style analytics shell — French real-estate dashboard
   Thème clair / sombre piloté par :root[data-theme]
   ============================================================ */

:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f2f3f5;
  --surface: #ffffff;
  --tile: #fbfcfd;
  --track: #f0f2f4;
  --hover: #f7f9fb;
  --foot: #fafbfc;

  --line: #dfe3e8;
  --line-soft: #eceef1;
  --line-strong: #c9cfd6;

  --ink: #1b1d21;
  --ink-2: #4a5058;
  --ink-3: #7b828c;

  --accent: #1a73b7;
  --accent-soft: #e8f1f9;
  --topbar: #16181d;

  --good: #2e8540;
  --bad: #c0392b;

  --chip-bg: #f1f3f5;
  --live-bg: #e9f6ec;
  --live-ink: #1d6b33;
  --live-line: #c7e6cf;

  --mvp-row: #fffdf5;
  --mvp-bg: linear-gradient(135deg, #fff3d0, #ffe3a3);
  --mvp-line: #f0cd72;
  --mvp-ink: #7a5807;

  --ai-bg: #f6f2fe;
  --ai-line: #e2d7fb;
  --ai-ink: #4a3a7a;

  --persona-bg: linear-gradient(180deg, #fbfcfe, #fff);
  --badge-x: #eef0f3;
  --badge-x-ink: #8a929c;

  --shadow: 0 1px 2px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .06);
  --scroll-shadow: rgba(16, 24, 40, .16);

  --c1: #4E79A7;
  --c2: #F28E2B;
  --c3: #E15759;
  --c4: #76B7B2;
  --c5: #59A14F;

  --radius: 3px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1116;
  --surface: #171b22;
  --tile: #1c212a;
  --track: #262d38;
  --hover: #1f2530;
  --foot: #1a1f27;

  --line: #2b323d;
  --line-soft: #232a34;
  --line-strong: #3c4653;

  --ink: #e6eaef;
  --ink-2: #b2bac5;
  --ink-3: #858e9b;

  --accent: #57a8ea;
  --accent-soft: #14263a;
  --topbar: #0a0c10;

  --good: #4cc267;
  --bad: #ef6f5e;

  --chip-bg: #212831;
  --live-bg: #12291a;
  --live-ink: #6bd085;
  --live-line: #24492f;

  --mvp-row: #1f1d16;
  --mvp-bg: linear-gradient(135deg, #3a2f12, #4a3a12);
  --mvp-line: #6b5518;
  --mvp-ink: #f0cd72;

  --ai-bg: #1d1830;
  --ai-line: #322a52;
  --ai-ink: #c3b3f5;

  --persona-bg: linear-gradient(180deg, #1b212a, #171b22);
  --badge-x: #262d38;
  --badge-x-ink: #8a939f;

  --shadow: 0 1px 2px rgba(0, 0, 0, .38), 0 1px 3px rgba(0, 0, 0, .3);
  --scroll-shadow: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Salesforce Sans", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  transition: background-color .16s ease, color .16s ease;
}

button { font: inherit; color: inherit; }

/* ---------- top bar ---------- */

.topbar {
  height: 48px;
  background: var(--topbar);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 8px;
  position: sticky;
  top: 0;
  z-index: 60;
}

.hamburger {
  display: none;
  background: none;
  border: 0;
  padding: 6px;
  border-radius: 3px;
  cursor: pointer;
}

.hamburger:hover { background: rgba(255,255,255,.12); }

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(135deg, #2a9df4 0%, #1a5fb4 55%, #7b52d3 100%);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand .mark svg { display: block; }
.brand .sub { color: #a9b0ba; font-weight: 400; font-size: 12.5px; }

.topsearch {
  flex: 1;
  max-width: 460px;
  height: 30px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: #9aa1ab;
  font-size: 12.5px;
}

.topright { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.iconbtn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: none;
  border: 0;
  cursor: pointer;
  color: #cfd4da;
  position: relative;
}

.iconbtn:hover { background: rgba(255,255,255,.13); color: #fff; }
.iconbtn svg { display: block; }

.iconbtn .dot {
  position: absolute;
  top: 5px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff6b57;
}

/* icône du thème : soleil en clair, lune en sombre */
#themeToggle .moon { display: none; }
:root[data-theme="dark"] #themeToggle .moon { display: block; }
:root[data-theme="dark"] #themeToggle .sun { display: none; }

.avatar {
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #3d6fb0;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  margin-left: 5px;
}

/* ---------- layout ---------- */

.shell { display: flex; min-height: calc(100vh - 48px); }

.rail {
  width: 208px;
  flex: 0 0 208px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 10px 0;
  position: sticky;
  top: 48px;
  height: calc(100vh - 48px);
  overflow-y: auto;
}

.rail .grp {
  padding: 12px 16px 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.rail a:hover { background: var(--hover); color: var(--ink); }

.rail a.on {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.rail a svg { flex: 0 0 auto; opacity: .8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- workbook header ---------- */

.wbhead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px 0;
}

.crumb {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.crumb b { color: var(--ink-2); font-weight: 500; }

.wbtitle { display: flex; align-items: center; gap: 12px; margin: 5px 0 2px; flex-wrap: wrap; }

.wbtitle h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.2px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
}

.chip.live { color: var(--live-ink); background: var(--live-bg); border-color: var(--live-line); }

.chip.live .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #23a145;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.28} }

.wbactions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }

/* ---------- sheet tabs ---------- */

.tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 13px 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover { color: var(--ink); background: var(--hover); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- filter bar ---------- */

.filterbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filt { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.filt label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

.filt select {
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--surface);
  padding: 0 24px 0 8px;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237b828c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.filt select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.filtnote { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- canvas / cards ---------- */

.canvas {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.card > header {
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card > header h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.1px; }
.card > header .hint { font-size: 11.5px; color: var(--ink-3); }
.card > header .tools { margin-left: auto; display: flex; gap: 8px; color: var(--ink-3); opacity: .7; }

.card .body { padding: 12px; flex: 1; min-width: 0; }

.card .cap {
  padding: 7px 12px 9px;
  font-size: 11px;
  color: var(--ink-3);
  border-top: 1px solid var(--line-soft);
  background: var(--tile);
}

.s12 { grid-column: span 12; }
.s8  { grid-column: span 8; }
.s7  { grid-column: span 7; }
.s6  { grid-column: span 6; }
.s5  { grid-column: span 5; }
.s4  { grid-column: span 4; }
.s3  { grid-column: span 3; }

/* ---------- KPI (BAN) tiles ---------- */

.bans {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ban {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}

.ban .lab {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ban .val {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.9px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.ban .foot { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.ban .delta { font-weight: 700; white-space: nowrap; }
.ban .delta.up { color: var(--good); }
.ban .delta.down { color: var(--bad); }
.ban .spark { position: absolute; right: 10px; top: 12px; opacity: .55; }
.ban .accentbar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }

/* ---------- legend ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 11px;
  font-size: 11.5px;
  color: var(--ink-2);
}

.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- stacked bar rows ---------- */

.rows { display: flex; flex-direction: column; gap: 5px; }

.row {
  display: grid;
  grid-template-columns: 78px 1fr 54px;
  align-items: center;
  gap: 9px;
}

.row .rlab {
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.row .rval { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }

.bar { display: flex; height: 17px; border-radius: 2px; overflow: hidden; background: var(--track); }
.bar > i { display: block; height: 100%; transition: filter .12s; cursor: default; }
.bar > i:hover { filter: brightness(1.12) saturate(1.15); }

.row.wide { grid-template-columns: 136px 1fr 62px; }

/* ---------- colonnes verticales empilées ---------- */

.vchart { padding-left: 44px; }

.vplot {
  display: grid;
  gap: 5px;
  height: var(--vh, 230px);
  align-items: end;
  position: relative;
}

.vgl {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid var(--line-soft);
  grid-column: 1 / -1;
  grid-row: 1;
  pointer-events: none;
}

.vgl.zero { border-top-color: var(--line-strong); }

.vtick {
  position: absolute;
  left: -44px;
  width: 38px;
  text-align: right;
  font-size: 10.5px;
  color: var(--ink-3);
  transform: translateY(50%);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.vcol {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  grid-row: 1;
  /* au-dessus des lignes de grille absolues */
  position: relative;
  z-index: 1;
}

.vtot {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

.vstack {
  display: flex;
  flex-direction: column-reverse;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  min-height: 2px;
}

.vstack > i { display: block; width: 100%; transition: filter .12s; }
.vstack:hover > i { filter: brightness(1.06); }
.vstack > i:hover { filter: brightness(1.2) saturate(1.15); }

.vlabs { display: grid; gap: 5px; margin-top: 7px; }

.vlabs span {
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---------- meter (single-value bar) ---------- */

.meter { position: relative; height: 17px; background: var(--track); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; }
.meter .tgt { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-2); opacity: .75; }

/* ---------- tables ---------- */

.tw {
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent),
    linear-gradient(to right, transparent, var(--surface) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent),
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 34px 100%, 34px 100%, 13px 100%, 13px 100%;
  background-attachment: local, local, scroll, scroll;
}

table.grid { width: 100%; border-collapse: collapse; font-size: 12.2px; min-width: 620px; }

table.grid th {
  text-align: right;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}

table.grid th:first-child, table.grid td:first-child { text-align: left; }

table.grid td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.grid tbody tr:hover td { background: var(--hover); }
table.grid tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: var(--foot); }

td.name { font-weight: 500; }
td.name .sub { font-size: 11px; color: var(--ink-3); padding-left: 29px; white-space: normal; }
td .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: baseline; }

.cellbar { display: inline-block; height: 9px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }

.heat { border-radius: 2px; padding: 2px 7px; font-weight: 600; display: inline-block; min-width: 52px; }

/* ---------- badges ---------- */

.badge {
  display: inline-grid;
  place-items: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #4a3a06;
  margin-right: 8px;
  vertical-align: middle;
  flex: 0 0 auto;
}

.badge.g1 { background: linear-gradient(150deg,#ffd76e,#e8a90c); box-shadow: 0 0 0 1.5px #f3c53d inset; }
.badge.g2 { background: linear-gradient(150deg,#e6e9ee,#b4bcc7); color: #3f4753; box-shadow: 0 0 0 1.5px #c8cfd8 inset; }
.badge.g3 { background: linear-gradient(150deg,#e8b98c,#c07f45); color: #4d2f13; box-shadow: 0 0 0 1.5px #d19a63 inset; }
.badge.gx { background: var(--badge-x); color: var(--badge-x-ink); font-weight: 600; box-shadow: none; }

.mvp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--mvp-bg);
  border: 1px solid var(--mvp-line);
  color: var(--mvp-ink);
  border-radius: 20px;
  padding: 1px 8px 1px 5px;
  font-size: 10.5px;
  font-weight: 700;
  margin-left: 8px;
  white-space: nowrap;
}

tr.mvprow td { background: var(--mvp-row) !important; }

/* ---------- personas ---------- */

.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 11px; }

.persona {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  position: relative;
  background: var(--persona-bg);
  overflow: hidden;
}

.persona .rank {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  color: #fff; background: var(--c1);
  border-radius: 20px; padding: 2px 8px;
}

.persona h3 { margin: 0 0 2px; font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.persona .who { font-size: 11.5px; color: var(--ink-3); margin-bottom: 9px; }
.persona .share { font-size: 22px; font-weight: 600; letter-spacing: -.6px; }
.persona .share small { font-size: 11.5px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }

.persona dl { margin: 9px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11.5px; }
.persona dt { color: var(--ink-3); white-space: nowrap; }
.persona dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink-2); }

.persona .strip { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

/* ---------- misc ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }

.tile { border: 1px solid var(--line-soft); border-radius: 3px; padding: 9px 10px; background: var(--tile); }
.tile .t { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tile .v { font-size: 19px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.tile .d { font-size: 11px; color: var(--ink-3); }

.callout {
  margin-top: 10px;
  padding: 9px 10px;
  background: var(--ai-bg);
  border: 1px solid var(--ai-line);
  border-radius: 3px;
  font-size: 11.8px;
  color: var(--ai-ink);
}

.funnel { display: flex; flex-direction: column; gap: 4px; }

.fstep { display: grid; grid-template-columns: 148px 1fr; align-items: center; gap: 9px; }
.fstep .fl { font-size: 11.5px; color: var(--ink-2); text-align: right; }
.fstep .fb { display: flex; align-items: center; gap: 8px; }
.fstep .fb > i { display: block; height: 21px; border-radius: 2px; }
.fstep .fb b { font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fstep .fb em { font-style: normal; font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.divrow { display: grid; grid-template-columns: 118px 1fr 1fr; align-items: center; gap: 8px; font-size: 11.5px; }
.divrow .dl { text-align: right; color: var(--ink-2); }
.divrow .left { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.divrow .right { display: flex; align-items: center; gap: 6px; }
.divrow i { display: block; height: 15px; border-radius: 2px; }
.divrow span { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }

.subhead { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }

/* ---------- SVG (thème via classes) ---------- */

svg.chart { width: 100%; height: auto; display: block; }

.chart .ax { fill: var(--ink-3); }
.chart .lab { fill: var(--ink-2); }
.chart .big { fill: var(--ink); }
.chart .gl { stroke: var(--line-soft); }
.chart .axl { stroke: var(--line-strong); }
.chart .pt { fill: var(--surface); }
.chart .dot { stroke: var(--surface); }

/* ---------- tooltip ---------- */

.tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  border-radius: 3px;
  padding: 7px 9px;
  font-size: 11.8px;
  color: var(--ink);
  max-width: 260px;
  opacity: 0;
  transition: opacity .09s;
  white-space: nowrap;
}

.tip.on { opacity: 1; }
.tip b { font-weight: 700; }

.footnote {
  grid-column: span 12;
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 4px 16px;
  line-height: 1.6;
}

.scrim { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .s8, .s7 { grid-column: span 12; }
  .s5, .s4, .s3 { grid-column: span 6; }
  .bans { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .rail {
    position: fixed;
    top: 48px; left: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.28);
  }
  body.nav-open .rail { transform: none; }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 48px 0 0 0;
    background: rgba(12,14,18,.42);
    z-index: 80;
  }
  .hamburger { display: grid; place-items: center; }
  .topsearch { display: none; }
  .s6, .s5, .s4, .s3 { grid-column: span 12; }
  .bans { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .canvas { padding: 10px; gap: 10px; }
  .wbhead { padding: 8px 12px 0; }
  .filterbar { padding: 8px 12px; gap: 10px; }
  .wbtitle { gap: 7px; margin: 3px 0 0; }
  .wbtitle h1 { font-size: 16.5px; width: 100%; }
  .crumb { font-size: 11px; }
  .chip { font-size: 10.5px; padding: 1px 8px; }
  .btn { height: 26px; padding: 0 9px; }
  .tab { padding: 7px 10px 8px; font-size: 12.5px; }
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ban .val { font-size: 22px; }
  .ban .spark { display: none; }
  .row { grid-template-columns: 62px 1fr 42px; gap: 7px; }
  .row.wide { grid-template-columns: 92px 1fr 50px; }
  .row .rlab, .row .rval { font-size: 10.8px; }
  .fstep { grid-template-columns: 104px 1fr; }
  .fstep .fl { font-size: 10.8px; }
  .divrow { grid-template-columns: 78px 1fr 1fr; font-size: 10.8px; }
  .btn .txt { display: none; }
  .wbactions { gap: 5px; }
  .card .body { padding: 10px; }
  .legend { font-size: 10.8px; gap: 3px 9px; }
  .vchart { padding-left: 34px; }
  .vtick { left: -34px; width: 30px; font-size: 9.5px; }
  .vplot { gap: 3px; }
  .vlabs { gap: 3px; }
  .vtot { display: none; }
  .vlabs span { font-size: 9px; }
}
