/* Gilded Ace — shared theme for the floor page and the dashboard.
   Direction: warm off-white canvas with a soft yellow glow, white rounded cards,
   charcoal pills and feature cards, one yellow accent, light large numerals. */
:root {
  --bg: #f1f0eb;
  --glow: #fbeeb4;
  --surface: #ffffff;
  --surface-2: #ecebe5;
  --ink: #1b1b1a;
  --muted: #696964;
  --faint: #95948e;
  --rule: #e3e2dc;
  --dark: #232322;
  --on-dark: #f4f3ee;
  --on-dark-muted: #b4b3ac;
  --yellow: #f4c542;
  --yellow-soft: #fbefc4;
  --on-yellow: #1b1b1a;
  --s1: #232322;
  --s2: #e9b520;
  --s3: #a8a395;
  --context: #d3d1c8;
  --grid: #e8e7e1;
  --axis: #8d8c86;
  --div-lo: #3d3d3a;
  --div-mid: #e1dfd7;
  --div-hi: #ecb51c;
  --good: #2c7a4b;
  --good-soft: #e1f0e6;
  --warn: #8a6100;
  --warn-soft: #fbefc4;
  --bad: #c9392f;
  --bad-soft: #f9e0dd;
  --radius-lg: 24px;
  --radius: 14px;
  --display: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --glow: #2c2612; --surface: #1c1c1a; --surface-2: #272724; --ink: #f2f1ec; --muted: #aaa9a2; --faint: #84837d; --rule: #31312d;
    --dark: #2b2b28; --on-dark: #f4f3ee; --on-dark-muted: #b4b3ac; --yellow: #f2c544; --yellow-soft: #3a3115; --on-yellow: #1b1b1a;
    --s1: #ecebe6; --s2: #f2c544; --s3: #8f8b7e; --context: #4b4a45; --grid: #2a2a27; --axis: #8d8c86;
    --div-lo: #a9a8a1; --div-mid: #3a3935; --div-hi: #f2c544;
    --good: #6ccf94; --good-soft: #17301f; --warn: #f2c544; --warn-soft: #3a3115; --bad: #f08a80; --bad-soft: #3d1d1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --glow: #2c2612; --surface: #1c1c1a; --surface-2: #272724; --ink: #f2f1ec; --muted: #aaa9a2; --faint: #84837d; --rule: #31312d;
  --dark: #2b2b28; --on-dark: #f4f3ee; --on-dark-muted: #b4b3ac; --yellow: #f2c544; --yellow-soft: #3a3115; --on-yellow: #1b1b1a;
  --s1: #ecebe6; --s2: #f2c544; --s3: #8f8b7e; --context: #4b4a45; --grid: #2a2a27; --axis: #8d8c86;
  --div-lo: #a9a8a1; --div-mid: #3a3935; --div-hi: #f2c544;
  --good: #6ccf94; --good-soft: #17301f; --warn: #f2c544; --warn-soft: #3a3115; --bad: #f08a80; --bad-soft: #3d1d1a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1100px 520px at 88% -8%, var(--glow) 0%, transparent 62%), var(--bg);
  background-attachment: fixed;
  color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: 1240px; margin: 0 auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
a { color: var(--ink); text-decoration-color: var(--s2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar .inner { display: grid; gap: 12px; padding-block: 14px 12px; }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; }
.brand-pill { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 16px; font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--s2); }
.pillnav { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.pillnav::-webkit-scrollbar { display: none; }
.pillnav a, .pillnav button { flex: none; border: 0; background: none; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 0.88rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pillnav a:hover, .pillnav button:hover { color: var(--ink); background: var(--surface-2); }
.pillnav [aria-current="page"], .pillnav [aria-selected="true"] { background: var(--dark); color: var(--on-dark); }
.sub { font-size: 0.8rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.field { display: grid; gap: 3px; min-width: 0; }
.field label { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
select, input[type="search"] { background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 7px 30px 7px 14px; min-width: 0; max-width: 100%; }
input[type="search"] { padding-right: 14px; width: 220px; }
.btn { background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.btn.primary:hover { background: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.btn.link { border: 0; padding: 0; background: none; text-decoration: underline; text-decoration-color: var(--s2); text-decoration-thickness: 2px; text-underline-offset: 3px; border-radius: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; background: var(--yellow); color: var(--on-yellow); border-radius: 999px; padding: 4px 12px; }
.tabs { display: inline-flex; }

/* ---------- Content ---------- */
main .inner { padding-block: 28px 64px; }
.view { display: grid; gap: 22px; }
.finding { display: grid; gap: 8px; padding-block: 6px 4px; }
.finding h2 { font-family: var(--display); font-weight: 300; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; max-width: 26ch; }
.finding p { max-width: 74ch; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 2px; min-width: 0; box-shadow: 0 1px 0 var(--rule); }
.kpi .v { font-family: var(--display); font-size: 1.85rem; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .l { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.kpi .d { font-size: 0.78rem; color: var(--faint); }
.card .kpi { background: var(--surface-2); box-shadow: none; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px; display: grid; gap: 12px; min-width: 0; align-content: start; box-shadow: 0 1px 0 var(--rule); }
.card h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.card .cap { font-size: 0.83rem; color: var(--muted); }
.card.dark { background: var(--dark); color: var(--on-dark); }
.card.dark .cap, .card.dark .muted { color: var(--on-dark-muted); }
.chartbox { position: relative; width: 100%; min-width: 0; }
.h120 { height: 120px; } .h220 { height: 220px; } .h260 { height: 260px; } .h300 { height: 300px; } .h340 { height: 340px; } .h400 { height: 400px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.key.line { height: 3px; border-radius: 2px; width: 16px; }
.key.dash { height: 0; border-top: 2px dashed currentColor; width: 16px; border-radius: 0; }
.key.dot { border-radius: 50%; width: 10px; height: 10px; }

/* Explanation tiles */
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.why { border-radius: var(--radius-lg); padding: 18px 20px; display: grid; gap: 6px; background: var(--surface); box-shadow: 0 1px 0 var(--rule); }
.why:last-child { background: var(--dark); color: var(--on-dark); }
.why:last-child .btn.link { color: var(--on-dark); }
.why .tag { justify-self: start; }
.why .big { font-family: var(--display); font-size: 2.1rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.why .btn.link { justify-self: start; }
.tag { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.t-luck { background: var(--surface-2); color: var(--muted); }
.t-loc { background: var(--yellow-soft); color: var(--warn); }
.t-leak { background: var(--bad-soft); color: var(--bad); }
.t-short { background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule); }
.t-fact { background: var(--good-soft); color: var(--good); }
.t-model { background: var(--yellow-soft); color: var(--warn); }
.t-assume { background: var(--bad-soft); color: var(--bad); }

/* Tables */
.tablewrap { overflow-x: auto; min-width: 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
td.r, th.r { text-align: right; }
td.nw { white-space: nowrap; }
td.num, td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sel td { background: var(--yellow-soft); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.neg { color: var(--bad); }
.pos { color: var(--good); }

/* Bank-level map on the dashboard */
.map { width: 100%; height: auto; display: block; }
.map .walk { stroke: var(--rule); stroke-width: 3; }
.map .walk.closed { stroke: var(--bad); stroke-dasharray: 6 5; }
.map .zone-label { font-family: var(--body); font-size: 19px; font-weight: 600; fill: var(--ink); }
.map .zone-sub { font-family: var(--mono); font-size: 15px; fill: var(--muted); }
.map .bank { cursor: pointer; stroke: var(--surface); stroke-width: 1.5; }
.map .bank:hover, .map .bank.sel { stroke: var(--ink); stroke-width: 2.5; }
.map .poi { fill: var(--muted); }
.map .poi-label { font-size: 15px; fill: var(--muted); font-family: var(--body); }
.map .note { font-size: 15px; fill: var(--bad); font-family: var(--body); font-weight: 600; }
.ramp { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }
.ramp .bar { width: 160px; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--div-lo), var(--div-mid), var(--div-hi)); }

/* Plan */
.budget { display: flex; height: 36px; border-radius: 999px; overflow: hidden; gap: 3px; }
.budget span { display: block; height: 100%; }
.dates { display: grid; border-top: 1px solid var(--rule); }
.dates div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.dates .d { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 2px; }
.rules ol, .card ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 5px; font-size: 0.9rem; }
.searchrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.note-banner { background: var(--surface-2); border-radius: var(--radius); padding: 10px 14px; font-size: 0.86rem; color: var(--muted); }
.view [id] { scroll-margin-top: 170px; }
footer { border-top: 1px solid var(--rule); }
footer .inner { padding-block: 18px 32px; font-size: 0.8rem; color: var(--muted); display: grid; gap: 4px; }

/* ---------- Floor page ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px 32px; align-items: end; padding-block: 8px 6px; }
.hero h1 { font-family: var(--display); font-weight: 300; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.05; }
.hero p { color: var(--muted); max-width: 60ch; margin-top: 8px; }
.stats { display: flex; justify-content: flex-end; gap: 28px; flex-wrap: wrap; }
.stat { display: grid; gap: 0; }
.stat .v { font-family: var(--display); font-weight: 300; font-size: clamp(2.2rem, 4.4vw, 3.2rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.colorby { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-2); border-radius: 999px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); }
.floor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.floorsvg { width: 100%; height: auto; display: block; }
.floorsvg .zone-hull { fill: var(--surface-2); }
.floorsvg .walk { stroke: var(--rule); stroke-width: 6; stroke-linecap: round; }
.floorsvg .walk.closed { stroke: var(--bad); stroke-dasharray: 8 7; stroke-width: 3; }
.floorsvg .slot { cursor: pointer; stroke: var(--surface); stroke-width: 1.5; transition: transform 0.12s ease; transform-box: fill-box; transform-origin: center; }
.floorsvg .slot:hover { transform: scale(1.35); }
.floorsvg .slot.empty { fill: none; stroke: var(--context); stroke-dasharray: 2 2; cursor: default; }
.floorsvg .slot.empty:hover { transform: none; }
.floorsvg .slot.sel { stroke: var(--ink); stroke-width: 3; }
.floorsvg .slot.flag { stroke: var(--bad); stroke-width: 3; }
.floorsvg .ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.floorsvg .zl { font-family: var(--body); font-size: 19px; font-weight: 700; fill: var(--ink); }
.floorsvg .zs { font-family: var(--mono); font-size: 14px; fill: var(--muted); }
.floorsvg .poi { fill: var(--muted); }
.floorsvg .pl { font-family: var(--body); font-size: 14px; fill: var(--muted); }
.floorsvg .note { font-family: var(--body); font-size: 14px; fill: var(--bad); font-weight: 600; }
.mcard { position: sticky; top: 150px; }
.p-right .id, .mcard .id { font-family: var(--display); font-weight: 300; font-size: 2.4rem; letter-spacing: -0.03em; line-height: 1; }
.mstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.mstats div { display: grid; gap: 0; min-width: 0; }
.mstats .v { font-family: var(--display); font-size: 1.3rem; font-weight: 400; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.mstats .l { font-size: 0.72rem; color: var(--on-dark-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.card.dark .tag.t-luck { background: #3a3a37; color: var(--on-dark); }
.card.dark .tag.t-short { background: #3a3a37; color: var(--on-dark); border-color: #4a4a46; }
.card.dark .btn { background: transparent; color: var(--on-dark); border-color: #4a4a46; }
.card.dark .btn.yellow { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 0.8rem; font-family: var(--mono); cursor: pointer; }
.quick button:hover, .quick button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.quick button.flag { border-color: var(--bad); color: var(--bad); }
.quick button.flag[aria-pressed="true"] { background: var(--bad); color: #fff; }
.floor3d { position: relative; width: 100%; aspect-ratio: 16 / 11; min-height: 340px; max-height: 78vh; border-radius: 18px; overflow: hidden; background: #123d27; touch-action: none; }
.floor3d canvas { display: block; position: absolute; inset: 0; }
.f3-bar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; pointer-events: none; z-index: 2; }
.f3-bar > * { pointer-events: auto; }
.f3-clock { background: rgba(20, 20, 19, 0.78); color: #f4f3ee; border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.f3-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.small-btn { padding: 5px 11px; font-size: 0.8rem; background: rgba(255, 255, 255, 0.9); color: #1b1b1a; border-color: transparent; }
.btn.small-btn:hover { background: #fff; border-color: #f4c542; }
.f3-help { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: 0.74rem; color: rgba(244, 243, 238, 0.85); background: rgba(20, 20, 19, 0.55); padding: 4px 10px; border-radius: 999px; pointer-events: none; z-index: 2; }
.timebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 0.84rem; }
.timebar label { font-weight: 600; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; }
.timebar input[type="range"] { flex: 1 1 200px; min-width: 0; accent-color: var(--s2); }
.timebar .num { min-width: 70px; font-weight: 500; }
.seg.dark-seg button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.tip { position: absolute; pointer-events: none; background: var(--dark); color: var(--on-dark); border-radius: 10px; padding: 7px 10px; font-size: 0.8rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 5; }
.floorwrap { position: relative; }

/* ---------- Full-screen floor page ---------- */
.floor-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.floor-page .topbar { position: relative; padding-block: 10px 8px; }
.floor-page .topbar .bar-row { max-width: none; }
.floor-page #m-error:empty { display: none; }
.stage { position: relative; flex: 1; min-height: 0; }
.mapbox { position: absolute; inset: 0; background: #123d27; }
.mapbox .floor3d { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }
.mapbox .floorwrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px 380px 96px 370px; background: var(--bg); }
.mapbox .floorwrap svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
.mapbox .f3-bar { left: 370px; right: 380px; top: 14px; justify-content: center; }
.panel { position: absolute; z-index: 3; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.p-left { top: 14px; left: 14px; width: 340px; max-height: calc(100% - 28px); overflow: auto; padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.p-left .panel-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.p-left h1 { font-family: var(--display); font-weight: 300; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.1; }
.panel-body { display: grid; gap: 14px; }
.panel-body[hidden] { display: none !important; }
.stats.compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; justify-content: stretch; }
.stats.compact .stat .v { font-size: 1.35rem; white-space: nowrap; }
.stats.compact .stat .l { font-size: 0.7rem; line-height: 1.25; }
.ctl { display: grid; gap: 6px; }
.ctl-label { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.legendbox { display: grid; gap: 8px; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 0.82rem; }
.lg-ramp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-ramp .bar { width: 120px; height: 10px; border-radius: 999px; }
.lg-items { display: grid; gap: 6px; }
.lg-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.35; }
.lg-item .key { margin-top: 2px; }
.lg-item b { font-weight: 600; }
.lg-item.strong b { color: var(--bad); }
.lg-note { font-size: 0.76rem; line-height: 1.4; margin: 0; }
.p-left .timebar { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.p-left .timebar input[type="range"] { flex-basis: 100%; order: 3; }
.hint { font-size: 0.76rem; color: var(--muted); margin: 0; }
.about { font-size: 0.8rem; color: var(--muted); }
.about summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.about p { margin: 8px 0 0; line-height: 1.45; }
.icon-btn { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; width: 30px; height: 30px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink); flex: none; }
.icon-btn:hover { border-color: var(--ink); }
.p-right { top: 14px; right: 14px; width: 350px; max-height: calc(100% - 28px); overflow: auto; background: var(--dark); color: var(--on-dark); padding: 18px 20px; }
.p-right #mcard { display: grid; gap: 12px; }
.p-right #mcard > :first-child { padding-right: 36px; }
.p-right .cap, .p-right .muted { color: var(--on-dark-muted); font-size: 0.83rem; }
.p-right .close { position: absolute; top: 12px; right: 12px; background: #3a3a37; color: var(--on-dark); border-color: #4a4a46; z-index: 1; }
.p-right .tag.t-luck { background: #3a3a37; color: var(--on-dark); }
.p-right .tag.t-short { background: #3a3a37; color: var(--on-dark); border-color: #4a4a46; }
.reopen { position: absolute; top: 14px; right: 14px; z-index: 3; }
.p-bottom { left: 370px; right: 380px; bottom: 14px; padding: 10px 14px; display: grid; gap: 6px; }
.p-bottom .quick { gap: 5px; }
@media (max-width: 1400px) {
  .p-left { width: 300px; }
  .p-right { width: 310px; }
  .p-bottom { left: 330px; right: 338px; }
  .mapbox .f3-bar { left: 330px; right: 338px; }
  .mapbox .floorwrap { padding: 18px 340px 110px 330px; }
}
@media (max-width: 1100px) {
  .floor-page { height: auto; overflow: visible; }
  .stage { display: grid; gap: 12px; padding: 0 12px 24px; }
  .mapbox { position: relative; height: 68vh; min-height: 360px; border-radius: 18px; overflow: hidden; }
  .mapbox .floorwrap { padding: 12px; }
  .mapbox .f3-bar { left: 10px; right: 10px; }
  .panel { position: static; width: auto; max-height: none; box-shadow: none; }
  .p-bottom { order: 2; }
  .p-right { order: 3; }
  .p-left { order: 4; }
  .reopen { position: static; justify-self: start; }
  .p-right .close { display: none; }
}

@media (max-width: 980px) {
  .floor-layout { grid-template-columns: 1fr; }
  .mcard { position: static; }
  .hero { grid-template-columns: 1fr; }
  .stats { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .topbar { position: static; }
}
@media (max-width: 560px) {
  .dates div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
