:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2130;
  --surface-3: #232a3b;
  --border: rgba(255, 255, 255, 0.07);
  --text: #eef1f7;
  --muted: #8d95a9;
  --accent: #5b8cff;
  --accent-text: #ffffff;
  --free: #34d399;
  --free-bg: rgba(52, 211, 153, 0.12);
  --occ: #f87171;
  --occ-bg: rgba(248, 113, 113, 0.12);
  --unk: #8d95a9;
  --unk-bg: rgba(141, 149, 169, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
.root { max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + var(--safe-b) + 24px); }

/* ---------- boot / fatal ---------- */
.boot, .fatal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 70vh; text-align: center; color: var(--muted); padding: 0 12px; }
.fatal h2 { margin: 0; color: var(--text); font-size: 20px; }
.fatal p { margin: 0; max-width: 32ch; }
.fatal .icon { font-size: 38px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 12px; background: linear-gradient(var(--bg) 75%, rgba(11, 13, 18, 0)); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #5b8cff, #7c5cff); display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; flex: none; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.1px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.3px; background: var(--unk-bg); color: var(--muted); border: 1px solid var(--border); flex: none; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.online { color: var(--free); background: var(--free-bg); }
.pill.online i { box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s infinite; }
.pill.starting, .pill.stopping, .pill.recovering { color: var(--warn); background: var(--warn-bg); }
.pill.starting i, .pill.stopping i, .pill.recovering i { animation: blink 1.1s infinite; }
.pill.error, .pill.session_expired { color: var(--occ); background: var(--occ-bg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* hero */
.hero { display: flex; align-items: center; gap: 18px; background: radial-gradient(120% 140% at 0% 0%, rgba(91, 140, 255, 0.14), transparent 55%), var(--surface); }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring .bar { fill: none; stroke: var(--free); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.hero.stale .ring .bar { stroke: var(--unk); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid b { font-size: 36px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.ring .mid span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.hero-text { min-width: 0; }
.hero-text .big { font-size: 22px; font-weight: 700; letter-spacing: 0.1px; }
.hero-text .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--free-bg); color: var(--free); }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 20px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 650; background: var(--accent); color: var(--accent-text); cursor: pointer; transition: transform 0.08s ease, opacity 0.15s, background 0.15s; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--occ-bg); color: var(--occ); border: 1px solid rgba(248, 113, 113, 0.28); }
.btn.ghost { background: transparent; color: var(--muted); min-height: 44px; font-weight: 550; font-size: 14.5px; }
.btn.sm { min-height: 44px; font-size: 14.5px; border-radius: 13px; width: auto; padding: 0 16px; }
.actions { display: grid; gap: 10px; margin-bottom: 14px; }

/* banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--warn-bg); color: #f6d98a; border: 1px solid rgba(251, 191, 36, 0.22); font-size: 14px; }
.banner.bad { background: var(--occ-bg); color: #fca5a5; border-color: rgba(248, 113, 113, 0.25); }
.banner b { display: block; color: var(--text); margin-bottom: 2px; }
.banner .ic { font-size: 18px; line-height: 1.2; flex: none; }

/* progress */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; color: var(--muted); font-size: 15px; }
.steps .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; background: var(--surface-2); color: var(--muted); }
.steps li.done { color: var(--text); }
.steps li.done .ic { background: var(--free-bg); color: var(--free); }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active .ic { background: transparent; }
.steps li.skipped { display: none; }
.bar-wrap { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 14px 0 6px; }
.bar-wrap > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #5b8cff, #7c5cff); transition: width 0.8s ease; }
.hint { color: var(--muted); font-size: 13px; }

/* spaces grid */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: currentColor; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.space { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1 / 1.08; padding: 6px 2px; border-radius: 14px; border: 1.5px solid transparent; background: var(--unk-bg); color: var(--unk); cursor: pointer; transition: transform 0.08s ease, background 0.2s; }
.space:active { transform: scale(0.96); }
.space .n { font-size: 20px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.space .t { font-size: 10px; font-weight: 650; letter-spacing: 0; text-transform: lowercase; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.space .g { font-size: 12px; line-height: 1; }
.space.FREE { background: var(--free-bg); color: var(--free); border-color: rgba(52, 211, 153, 0.35); }
.space.OCCUPIED { background: var(--occ-bg); color: var(--occ); border-color: rgba(248, 113, 113, 0.32); }
.space.UNKNOWN { border-color: rgba(141, 149, 169, 0.25); }
.space.stale { border-style: dashed; filter: saturate(0.55); opacity: 0.85; }
.space.stale::after { content: "🕓"; position: absolute; top: 3px; right: 4px; font-size: 9px; opacity: 0.75; }
.space.pending .t::after { content: "…"; }

/* camera */
.shot { position: relative; border-radius: 14px; overflow: hidden; background: #05070b; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .empty { color: var(--muted); text-align: center; padding: 16px; font-size: 14px; }
.shot .tag { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(6px); color: #fff; }
.shot .tag.live { color: var(--free); }
.shot .tag.old { color: var(--warn); }
.shot-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }

/* system */
.items { display: grid; gap: 2px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item .l { display: flex; align-items: center; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--unk); flex: none; }
.dot.ok { background: var(--free); box-shadow: 0 0 10px rgba(52, 211, 153, 0.45); }
.dot.warn, .dot.wait { background: var(--warn); }
.dot.bad { background: var(--occ); }
.dot.off { background: var(--surface-3); }
.item .v { color: var(--muted); font-size: 14px; text-align: right; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.stat b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 12.5px; }
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; padding: 12px 2px; color: var(--accent); font-weight: 600; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.kv { display: grid; gap: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }

/* calibration */
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 16px; }
.chip { min-height: 48px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface-2); font-weight: 700; font-size: 17px; cursor: pointer; }
.chip.sel { border-color: var(--accent); background: rgba(91, 140, 255, 0.16); color: #fff; }
.chip:disabled { opacity: 0.45; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding-bottom: var(--safe-b); background: rgba(15, 18, 26, 0.92); backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tab-h); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: 0; color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--accent); }

/* sheet + dialog + toast */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(3, 5, 9, 0.62); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s ease; }
.scrim.center { align-items: center; padding: 24px; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px 24px 0 0; padding: 10px 20px calc(22px + var(--safe-b)); animation: up 0.22s ease; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet h3 { margin: 0 0 6px; font-size: 22px; }
.chipline { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 650; }
.chipline.FREE { background: var(--free-bg); color: var(--free); }
.chipline.OCCUPIED { background: var(--occ-bg); color: var(--occ); }
.chipline.UNKNOWN { background: var(--unk-bg); color: var(--muted); }
.dlg { width: 100%; max-width: 380px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px; padding: 22px; animation: pop 0.18s ease; }
.dlg h3 { margin: 0 0 8px; font-size: 18px; }
.dlg p { margin: 0 0 18px; color: var(--muted); }
.dlg .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 30; max-width: 528px; margin: 0 auto; padding: 13px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 14.5px; animation: up 0.2s ease; }
.toast.bad { background: #3a1d22; color: #ffc9c9; }
.toast.ok { background: #14352b; color: #bdf3dc; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

.hidden { display: none !important; }
@media (max-width: 360px) { .ring { width: 92px; height: 92px; } .ring .mid b { font-size: 29px; } .hero { gap: 12px; } .space .n { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- zoomed look at a place (sheet) ---------- */
.sheet { max-height: 92vh; overflow-y: auto; }
.shot.zoom { margin: 14px 0 10px; aspect-ratio: 1.6 / 1; }
.zoom-cv { width: 100%; height: 100%; display: block; background: #05070b; }
.zoom-ctl { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.zoom-ctl .btn { flex: 1; }
.sheet .kv { margin: 6px 0 12px; }

/* ---------- calibration chips: place without a reference ---------- */
.chip.noref { position: relative; }
.chip.noref::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* ---------- zone editor ---------- */
.ed-card { padding: 12px; }
.ed-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ed-toolbar.zoom-row { margin: 10px 0 0; }
.ed-toolbar .sp { flex: 1; }
.tool { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; cursor: pointer; }
.tool.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.tool:disabled { opacity: 0.4; }
.tool:active:not(:disabled) { transform: scale(0.97); }
.zoom-label { min-width: 34px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ed-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #05070b; touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-inner { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; }
.ed-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-zone { fill: rgba(141, 149, 169, 0.16); stroke: rgba(141, 149, 169, 0.9); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.ed-zone.FREE { fill: rgba(52, 211, 153, 0.2); stroke: #34d399; }
.ed-zone.OCCUPIED { fill: rgba(248, 113, 113, 0.2); stroke: #f87171; }
.ed-zone.NEW { fill: rgba(91, 140, 255, 0.22); stroke: #7aa2ff; }
.ed-zone.chg { stroke-dasharray: 7 4; }
.ed-zone.sel { stroke: #ffffff; stroke-width: 3; fill: rgba(91, 140, 255, 0.1); stroke-dasharray: none; }
.ed-zone.bad { stroke: #fbbf24; stroke-dasharray: 3 3; fill: rgba(251, 191, 36, 0.25); }
.ed-label { fill: #fff; font-weight: 800; stroke: rgba(0, 0, 0, 0.75); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }
.ed-hit { fill: transparent; cursor: grab; }
.ed-handle { fill: #fff; stroke: #5b8cff; }
.ed-panel { display: grid; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { font-size: 17px; }
.field { display: grid; gap: 6px; }
.field .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px; }
.stepper { display: flex; gap: 8px; align-items: center; }
.step { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 22px; cursor: pointer; }
.step:disabled { opacity: 0.4; }
.num-in, .txt-in { height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; padding: 0 14px; width: 100%; min-width: 0; }
.num-in { text-align: center; font-weight: 700; font-size: 18px; }
.num-in:focus, .txt-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg-b { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.seg-b.on { background: var(--surface-3); color: var(--text); }
.seg-b:disabled { opacity: 0.5; }
.hint.ref { margin: 0; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-btns .btn { width: 100%; }
.ed-problem { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: #f6d98a; font-size: 13.5px; }
.ed-footer { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); z-index: 4; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 10px; border-radius: 18px; background: rgba(20, 24, 33, 0.92); backdrop-filter: blur(12px); border: 1px solid var(--border); }
.actions-inline { margin-top: 10px; }
.shot .empty.hidden, .shot .tag.hidden { display: none; }
@media (max-width: 360px) { .tool { padding: 0 9px; min-width: 40px; } .ed-toolbar { gap: 4px; } }

/* ---------- calibration: multi-select ---------- */
.sel-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.sel-tools .sp { flex: 1; }
.pill-btn { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.pill-btn:disabled { opacity: 0.4; }
.pill-btn:active:not(:disabled) { transform: scale(0.97); }
.sel-summary { min-height: 20px; color: var(--muted); font-size: 13.5px; margin-top: -6px; }
.chip.sel::before { content: "✓"; position: absolute; top: 4px; left: 7px; font-size: 11px; color: var(--accent); }
.chip { position: relative; }
.actions .btn.danger:disabled { opacity: 0.35; }

/* ---------- place history + statistics (inside the place sheet) ---------- */
.hist-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; padding: 0 16px; margin: 4px 0 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; cursor: pointer; }
.hist-toggle .chev { color: var(--muted); transition: transform 0.2s; }
.hist-toggle.open .chev { transform: rotate(180deg); }
.hist { display: grid; gap: 12px; margin: 0 0 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.hist .seg { background: var(--surface); }
.hist-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.hist-empty { display: grid; gap: 4px; color: var(--muted); font-size: 14px; padding: 6px 0; }
.hist-empty b { color: var(--text); font-size: 15px; }
.pop { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; }
.pop b { font-size: 15px; }
.pop span { color: var(--muted); }
.pop.high { background: rgba(248, 113, 113, 0.12); color: #fda4a4; }
.pop.mid { background: rgba(251, 191, 36, 0.12); color: #f6d98a; }
.pop.low { background: rgba(52, 211, 153, 0.12); color: #86e8c3; }
.pop.none { background: var(--surface); color: var(--muted); }
.cur { font-size: 14px; font-weight: 600; padding: 2px 2px; }
.cur.occupied { color: var(--occ); }
.cur.free { color: var(--free); }
.cur.none { color: var(--muted); font-weight: 500; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: grid; gap: 1px; padding: 12px; border-radius: 12px; background: var(--surface); min-width: 0; }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .tl { color: var(--text); font-size: 12.5px; font-weight: 600; }
.tile .ts { color: var(--muted); font-size: 11.5px; }
.tile.occ b { color: var(--occ); }
.tile.free b { color: var(--free); }
.hist-h { display: grid; gap: 0; margin-top: 4px; }
.hist-h .hint { font-size: 12px; }
.hours-wrap { display: grid; gap: 4px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 84px; padding: 4px 0; }
.hb { height: 100%; display: flex; align-items: flex-end; border-radius: 3px; background: rgba(255, 255, 255, 0.04); }
.hb i { display: block; width: 100%; border-radius: 3px; background: var(--muted); opacity: 0.35; }
.hb.l0 i { background: var(--free); opacity: 0.75; }
.hb.l1 i { background: #a3d977; opacity: 0.85; }
.hb.l2 i { background: var(--warn); opacity: 0.9; }
.hb.l3 i { background: var(--occ); opacity: 0.95; }
.hb.na i { background: var(--muted); opacity: 0.25; }
.hb.peak { outline: 1px solid rgba(255, 255, 255, 0.35); outline-offset: 1px; }
.hours-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 0 1px; }
.hist-peaks { margin: 0; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tl-list li { display: flex; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.tl-list li:last-child { border-bottom: 0; }
.tl-list .dotk { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted); }
.tl-list li.free .dotk { background: var(--free); }
.tl-list li.occupied .dotk { background: var(--occ); }
.tl-list div { display: grid; gap: 1px; min-width: 0; }
.tl-list b { font-size: 14.5px; }
.tl-list .when { color: var(--text); font-size: 13px; }
.tl-list .sub { color: var(--muted); font-size: 12.5px; }
.hist-foot { margin: 0; font-size: 12px; }

.hist .seg.period { grid-template-columns: repeat(4, 1fr); }
.sel-tools .hint { white-space: nowrap; }
