/* The building dashboard: page tokens, sky, intro, roof, floors, plaques, ground floor, street,
   sheets (dialogs) and the plain list. Art colours live in art.css. */

:root,
html[data-scene="day"] {
  --sky-top: #6aa6e2;
  --sky-bot: #d9e9f3;
  --text: #2a2026;
  --muted: #5d4e4a;
  --faint: #8a7a72;
  --chip-bg: rgba(255, 252, 245, 0.8);
  --chip-line: rgba(42, 32, 38, 0.12);
  --plaster: #e9d8bb;
  --plaster-dark: #dcc6a2;
  --ledge: #cbb48f;
  --ledge-top: #f3e6cc;
  --plinth: #b9a27e;
  --pipe: #8f8577;
  --plaque: #f8f1e2;
  --plaque-end: #f1e6cf;
  --plaque-ink: #33262c;
  --plaque-muted: #7a6458;
  --pavement: #cbc1b0;
  --kerb: #a99e8c;
  --road: #6f6c68;
  --road-line: #f1e7d0;
  --door: #7a4a2c;
  --door-panel: #693e22;
  --transom: #e8dcc2;
  --letterbox: #b4362c;
  --board-bg: #1f3d33;
  --board-ink: #f3e6c4;
  --shutter: #a3a7ab;
  --sheet-bg: #fbf6ec;
  --sheet-line: rgba(42, 32, 38, 0.12);
  --btn-bg: #2a2026;
  --btn-text: #fbf6ec;
  --focus: #c2410c;
  --ok: #2f7d4f;
  --bad: #b4362c;
  --wait: #9a7b2f;
  --bulb-dim: 0.55;

  /* Names used by carried.css and visuals.css. */
  --bg: var(--sheet-bg);
  --surface: var(--sheet-bg);
  --surface-solid: var(--sheet-bg);
  --line: var(--sheet-line);
  --line-strong: rgba(42, 32, 38, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 16px 40px -16px rgba(0, 0, 0, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  color-scheme: light;
}

/* Layout settings stay outside the day/night blocks so the scene never overrides them. */
:root { --cols: 2; --pier: 16px; --side: 18px; --bw: min(960px, calc(100vw - 24px)); }
@media (min-width: 720px) {
  :root { --cols: 3; --pier: 46px; --side: 44px; --bw: min(960px, calc(100vw - 48px)); }
}

html[data-scene="night"] {
  --sky-top: #0a0f26;
  --sky-bot: #1c2246;
  --text: #f3e9d6;
  --muted: #c3b6a6;
  --faint: #8f8576;
  --chip-bg: rgba(16, 19, 40, 0.62);
  --chip-line: rgba(255, 255, 255, 0.12);
  --plaster: #2b2f49;
  --plaster-dark: #252840;
  --ledge: #343958;
  --ledge-top: #444a6e;
  --plinth: #23263c;
  --pipe: #3d4260;
  --plaque: #efe3c8;
  --plaque-end: #e2d2b0;
  --plaque-ink: #2a1f25;
  --plaque-muted: #6f5a4e;
  --pavement: #2c2d3a;
  --kerb: #3a3b4b;
  --road: #1a1b25;
  --road-line: #6b6556;
  --door: #6a3e24;
  --door-panel: #5a331d;
  --transom: #f3b45e;
  --letterbox: #a3322a;
  --board-bg: #18302a;
  --shutter: #555b68;
  --sheet-bg: #1d2036;
  --sheet-line: rgba(255, 255, 255, 0.1);
  --btn-bg: #f3c56b;
  --btn-text: #1d2036;
  --focus: #ffd36b;
  --ok: #6fd39a;
  --bad: #f08a7e;
  --wait: #e5c56a;
  --bulb-dim: 1;
  --line-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 16px/1.55 var(--font-body); color: var(--text);
  background: var(--sky-bot);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 70; padding: 8px 14px; border-radius: 8px; background: var(--btn-bg); color: var(--btn-text); }
.skip:focus { top: 12px; }
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(var(--sky-top), var(--sky-bot)); }
.page { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; padding: 0 12px; }
/* The lamp's night glow (and roof decorations) may poke past the edge on phones: no sideways scroll. */
.page { overflow-x: clip; }

/* ---------- Day/night switch ---------- */
.scene-btn {
  position: fixed; top: 14px; right: 14px; z-index: 30;
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid var(--chip-line); background: var(--chip-bg); color: var(--text);
  cursor: pointer; backdrop-filter: blur(6px);
}
.scene-btn svg { width: 20px; height: 20px; }

/* ---------- Intro (in the sky above the roof) ---------- */
.intro { width: min(640px, 100%); padding: 96px 4px 56px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--chip-line); background: var(--chip-bg);
  font-size: 13px; color: var(--text); backdrop-filter: blur(6px);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wait) 22%, transparent); }
.live-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.intro h1 { margin: 0 0 14px; font: 700 clamp(34px, 6vw, 52px)/1.08 var(--font-display); letter-spacing: -0.01em; }
.intro .lede { margin: 0 auto 18px; max-width: 34em; font-size: clamp(16px, 2.2vw, 18px); color: var(--muted); }
.intro-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; margin: 0; font-size: 15px; }
.intro-links a, .intro-links button { padding: 0; border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.intro-icons { display: inline-flex; gap: 10px; }
.intro-icons a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--chip-line); background: var(--chip-bg); text-decoration: none; }

/* ---------- Building frame ---------- */
.building { position: relative; width: var(--bw); }
.facade-texture {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(90deg, var(--plaster-dark), var(--plaster) 6%, var(--plaster) 94%, var(--plaster-dark));
}

/* ---------- Roof ---------- */
.roof { position: relative; }
.roof-scene { position: relative; height: 150px; }
@media (min-width: 720px) { .roof-scene { height: 200px; } }
.roof-scene > * { position: absolute; bottom: 0; }
.tank-wrap { left: 3%; height: 92px; width: 58px; }
.dish-wrap { left: calc(3% + 62px); height: 34px; width: 28px; }
@media (min-width: 720px) { .tank-wrap { height: 122px; width: 76px; } .dish-wrap { left: calc(3% + 82px); height: 46px; width: 37px; } }
.tank-wrap svg, .dish-wrap svg, .barsati svg { display: block; width: 100%; height: 100%; }
.lights, .bunting { left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.lights { overflow: visible; }
.lights .wire-l { fill: none; stroke: rgba(30, 24, 30, 0.6); stroke-width: 1.2; }
html[data-scene="night"] .lights .wire-l { stroke: rgba(230, 220, 200, 0.35); }
.lights .pole { stroke: var(--post); stroke-width: 3; stroke-linecap: round; }
.bulb-l { opacity: var(--bulb-dim); }
html[data-scene="night"] .bulb-l { filter: drop-shadow(0 0 4px currentColor); }
.bulb-l.new { animation: bulb-pop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes bulb-pop { from { transform: scale(0); } }
@media (prefers-reduced-motion: no-preference) {
  html[data-scene="night"] .bulb-l { animation: bulb-tw 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
  @keyframes bulb-tw { 50% { opacity: 0.55; } }
}
.lights .more { font: 600 11px var(--font-mono); fill: var(--text); }
.bunting img {
  position: absolute; width: 18px; height: 20px; margin-left: -9px; object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 50% 100%); pointer-events: auto;
}
@media (max-width: 719px) { .bunting img { width: 14px; height: 16px; margin-left: -7px; } }
.barsati { right: 2%; width: 36%; height: 104px; padding: 0; border: 0; background: none; cursor: pointer; }
@media (min-width: 720px) { .barsati { width: 30%; height: 150px; } }
html[data-scene="night"] .barsati .bulb { filter: drop-shadow(0 0 6px #ffcf7a); }
.parapet {
  position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 44px; padding: 7px var(--side) 7px;
  border-top: 6px solid var(--ledge-top); box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.roof-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.18); background: var(--plaque); color: var(--plaque-ink);
  font: 600 13px var(--font-body); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.roof-btn b { font: 600 12px var(--font-mono); color: var(--plaque-muted); }
.roof-btn img { width: 18px; height: 13px; border-radius: 2px; }
.roof-btn:disabled { cursor: default; opacity: 0.8; }
.roof-btn.done { background: #fff3c4; }

/* ---------- Floors (one .storey per floor) ---------- */
.storey {
  position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--pier); padding: 34px var(--side) 30px;
}
.storey::after {
  content: ""; position: absolute; left: -10px; right: -10px; bottom: -6px; height: 14px; z-index: 2;
  background: linear-gradient(var(--ledge-top) 0 3px, var(--ledge) 3px);
  box-shadow: 0 6px 8px -4px rgba(0, 0, 0, 0.35);
}
.pipe {
  position: absolute; left: 14px; top: 0; bottom: -8px; width: 8px; z-index: 1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 40%, rgba(0, 0, 0, 0.2)), var(--pipe);
}
.pipe::before { content: ""; position: absolute; left: -2px; right: -2px; top: 40%; height: 5px; background: var(--pipe); filter: brightness(0.8); border-radius: 1px; }
@media (max-width: 719px) { .pipe { left: 4px; width: 6px; } }
.bay { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.chhajja {
  position: relative; z-index: 3; width: 112%; height: 13px; margin-bottom: 10px;
  background: linear-gradient(var(--ledge-top) 0 3px, var(--ledge) 3px);
  clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%);
}
.chhajja::after { content: ""; position: absolute; left: 4%; right: 4%; top: 100%; height: 12px; background: linear-gradient(rgba(0, 0, 0, 0.28), transparent); }
@media (max-width: 719px) { .chhajja { width: 110%; height: 10px; } }
.win-wrap { position: relative; width: 100%; padding: 5px; background: var(--ledge); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.win-sill { display: block; width: 108%; height: 8px; margin: -1px 0 0 -4%; background: var(--ledge-top); border-radius: 2px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14); }
html[data-scene="night"] .bay:has(.win[data-state="live"])::before {
  content: ""; position: absolute; left: -12%; right: -12%; top: 4%; height: 60%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 180, 90, 0.16), transparent);
}
.pot { position: absolute; right: 3%; bottom: 3px; width: 22%; max-width: 54px; z-index: 5; pointer-events: none; }
.pot svg { display: block; width: 100%; }
.ac { position: absolute; z-index: 4; width: 36px; top: 64px; right: calc(-1 * var(--pier) / 2 - 18px); }
.ac svg { display: block; width: 100%; height: auto; }
@media (max-width: 719px) { .ac { display: none; } }

/* ---------- Plaques (the description under each window) ---------- */
.plaque {
  position: relative; width: 100%; margin-top: 18px; padding: 12px 14px; text-align: left;
  border: 0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(var(--plaque), var(--plaque-end)); color: var(--plaque-ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 10px 18px -12px rgba(0, 0, 0, 0.6);
}
.plaque::before, .plaque::after { content: ""; position: absolute; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--plaque-muted); opacity: 0.5; }
.plaque::before { left: 7px; }
.plaque::after { right: 7px; }
.plaque-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.flat { font: 500 11px var(--font-mono); letter-spacing: 0.06em; color: var(--plaque-muted); }
.st { display: inline-flex; align-items: center; gap: 5px; font: 500 11px var(--font-mono); color: #8a6d1f; }
.st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.st[data-state="live"] { color: #2f7d4f; }
.st[data-state="down"] { color: #b4362c; }
.plaque h3 { margin: 0; font: 700 17px/1.2 var(--font-display); }
.kick { margin: 2px 0 6px; font: 500 10.5px var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--plaque-muted); }
.line { margin: 0; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.more { display: inline-block; margin-top: 8px; font: 600 12px var(--font-body); border-bottom: 1.5px solid currentColor; }
.plaque.neighbour { cursor: default; opacity: 0.85; }
.plaque.neighbour h3 { font-size: 15px; }
@media (hover: hover) { .plaque:not(.neighbour):hover { transform: translateY(-2px); } }
@media (max-width: 719px) {
  .plaque { margin-top: 14px; padding: 10px; }
  .plaque h3 { font-size: 14.5px; }
  .kick { display: none; }
  .line { font-size: 12.5px; -webkit-line-clamp: 7; }
}

/* ---------- Ground floor ---------- */
.ground { position: relative; padding: 26px var(--side) 0; }
.ground::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: var(--plinth); }
.nameboard {
  display: block; margin: 0 auto 22px; padding: 10px 22px 9px; max-width: 92%;
  border: 3px solid #c9a24d; border-radius: 4px; background: var(--board-bg); color: var(--board-ink);
  text-align: center; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
html[data-scene="night"] .nameboard { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25), 0 -10px 30px rgba(255, 210, 140, 0.25); }
.nb-name { display: block; font: 700 clamp(17px, 3vw, 24px)/1.1 var(--font-display); letter-spacing: 0.14em; }
.nb-sub { display: block; margin-top: 3px; font: 500 10.5px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.ground-row { position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 4vw, 48px); }
.shutter {
  display: none; width: 26%; height: 128px; margin-bottom: 16px; border-radius: 2px 2px 0 0;
  background: repeating-linear-gradient(var(--shutter) 0 7px, rgba(0, 0, 0, 0.22) 7px 8px);
  box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.25);
}
@media (min-width: 720px) { .shutter { display: block; } }
.door {
  position: relative; width: 116px; height: 156px; padding: 0; cursor: pointer;
  border: 6px solid var(--ledge); border-bottom: 0; border-radius: 3px 3px 0 0;
  background:
    linear-gradient(var(--transom), var(--transom)) 50% 6px / 70% 22px no-repeat,
    linear-gradient(var(--door-panel), var(--door-panel)) 18% 40px / 32% 46px no-repeat,
    linear-gradient(var(--door-panel), var(--door-panel)) 82% 40px / 32% 46px no-repeat,
    linear-gradient(var(--door-panel), var(--door-panel)) 18% 96px / 32% 40px no-repeat,
    linear-gradient(var(--door-panel), var(--door-panel)) 82% 96px / 32% 40px no-repeat,
    var(--door);
}
@media (min-width: 720px) { .door { width: 146px; height: 190px; } }
.door::after { content: ""; position: absolute; right: 14px; top: 52%; width: 8px; height: 8px; border-radius: 50%; background: #e2b04e; }
.door-plate {
  position: absolute; left: 50%; top: 34px; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 8px; border-radius: 2px; background: #e2c27a; color: #3a2a1a; font: 600 11px var(--font-display);
}
.steps { position: absolute; left: 50%; bottom: 0; z-index: 2; width: 150px; height: 16px; transform: translateX(-50%); background: linear-gradient(var(--ledge-top) 0 3px, var(--ledge) 3px 8px, var(--ledge-top) 8px 11px, var(--ledge) 11px); }
@media (min-width: 720px) { .steps { width: 190px; } }
.letterbox {
  position: relative; width: 48px; height: 64px; margin-bottom: 64px; padding: 0; cursor: pointer;
  border: 0; border-radius: 10px 10px 4px 4px; background: var(--letterbox); color: #fff;
  box-shadow: inset -5px 0 0 rgba(0, 0, 0, 0.18), 0 3px 0 rgba(0, 0, 0, 0.25);
}
.letterbox::before { content: ""; position: absolute; left: 10px; right: 10px; top: 14px; height: 5px; border-radius: 3px; background: #2a1414; }
.letterbox span { position: absolute; left: 0; right: 0; bottom: 10px; font: 700 10px var(--font-body); text-align: center; letter-spacing: 0.04em; }

/* ---------- Street ---------- */
.street {
  position: relative; z-index: 2; height: 110px;
  background:
    linear-gradient(var(--pavement) 0 28px, var(--kerb) 28px 34px, var(--road) 34px),
    var(--road);
}
.street { overflow-x: clip; }
.street::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28px; background: repeating-linear-gradient(90deg, transparent 0 58px, rgba(0, 0, 0, 0.08) 58px 60px); }
.street::after { content: ""; position: absolute; left: 0; right: 0; top: 70px; height: 4px; background: repeating-linear-gradient(90deg, var(--road-line) 0 34px, transparent 34px 70px); opacity: 0.8; }
.lamp-post { --lw: 28px; --lh: 180px; position: absolute; z-index: 4; bottom: -28px; right: 4px; width: var(--lw); height: var(--lh); pointer-events: none; }
.lamp-post svg { display: block; width: 100%; height: 100%; }
/* The glow is centred on the bulb. The drawing (viewBox 40x160) sits at the bottom of the box at scale lw/40,
   so the bulb (31, 21) is 0.775*lw from the left and 3.475*lw up from the bottom. "closest-side" makes the
   gradient fade to nothing inside its own box, so it never shows a hard edge. */
html[data-scene="night"] .lamp-post::before {
  content: ""; position: absolute; pointer-events: none;
  width: 200px; height: 200px;
  left: calc(var(--lw) * 0.775 - 100px);
  top: calc(var(--lh) - var(--lw) * 3.475 - 100px);
  background: radial-gradient(circle closest-side, rgba(255, 214, 140, 0.32), rgba(255, 214, 140, 0.14) 40%, rgba(255, 214, 140, 0.04) 75%, transparent 100%);
}
.chai { position: absolute; z-index: 4; bottom: -24px; left: 6px; width: 96px; height: 72px; padding: 0; border: 0; background: none; cursor: pointer; }
.chai svg { display: block; width: 100%; height: 100%; }
.chai.empty .steam { display: none; }
@media (min-width: 1300px) {
  .lamp-post { right: auto; left: -64px; --lw: 34px; --lh: 220px; }
  .chai { left: auto; right: -150px; width: 128px; height: 96px; }
}

/* ---------- Sheets (dialogs) ---------- */
.sheet {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--sheet-line); border-radius: 18px; background: var(--sheet-bg); color: var(--text);
  box-shadow: var(--shadow); overflow: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(10, 12, 24, 0.55); backdrop-filter: blur(2px); }
@media (max-width: 719px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 88vh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}
.sheet-inner { position: relative; padding: 18px 20px 20px; }
.sheet-close {
  position: absolute; top: 10px; right: 10px; z-index: 5; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid var(--sheet-line); background: var(--sheet-bg); font-size: 20px; line-height: 1; cursor: pointer;
}
.sheet-peek { position: relative; height: 220px; margin: 44px 0 16px; border-radius: 12px; overflow: hidden; background: #0b0d16; }
.sheet-peek > .visual { position: absolute; inset: 0; }
@media (max-width: 719px) { .sheet-peek { height: 180px; } }
.sheet-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 4px; font: 500 12px var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.sheet h2 { margin: 0 0 8px; font: 700 clamp(24px, 4vw, 30px)/1.15 var(--font-display); }
.sheet-friendly { margin: 0 0 16px; font-size: 17px; line-height: 1.5; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  font: 600 14px var(--font-body); text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-solid { background: var(--btn-bg); color: var(--btn-text); }
.btn-line { border-color: var(--line-strong); background: transparent; color: var(--text); }
.sheet-more { border-top: 1px solid var(--sheet-line); padding-top: 12px; }
.sheet-more summary { cursor: pointer; font-weight: 600; }
.sheet-more p { color: var(--muted); }
.sheet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 12px 0; list-style: none; }
.sheet-stats li { padding: 8px; border-radius: 10px; border: 1px solid var(--sheet-line); text-align: center; }
.sheet-stats strong { display: block; font: 600 20px var(--font-mono); }
.sheet-stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 719px) { .sheet-stats { grid-template-columns: repeat(2, 1fr); } }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sheet-tags span { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--sheet-line); font-size: 12px; color: var(--muted); }
.sheet-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--sheet-line); }
.sheet-nav button { padding: 6px 0; border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--muted); text-align: left; }
.sheet-nav button:last-child { text-align: right; }
.sheet h2 + .about-text p, .about-text p { margin: 0 0 12px; color: var(--muted); }
.toolbox { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; list-style: none; }
.toolbox li { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--sheet-line); font-size: 13px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }

/* ---------- Plain list (below the street) ---------- */
.list { position: relative; z-index: 2; background: var(--sheet-bg); padding: 48px 16px 32px; }
.list-inner { width: min(860px, 100%); margin: 0 auto; }
.list h2 { margin: 0 0 6px; font: 700 26px var(--font-display); }
.list-note { margin: 0 0 24px; color: var(--muted); }
.list-group h3 { margin: 26px 0 8px; font: 600 13px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.list-group ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--sheet-line); }
.list-group li { display: grid; grid-template-columns: 14px 1fr auto; gap: 4px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--sheet-line); }
.list-group .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); }
.list-group .dot[data-state="live"] { background: var(--ok); }
.list-group .dot[data-state="down"] { background: var(--bad); }
.list-group a.name { font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.list-group .li-line { grid-column: 2 / 4; margin: 0; font-size: 14px; color: var(--muted); }
.list-group .li-side { display: flex; gap: 12px; font: 500 12px var(--font-mono); }
.list-group .li-side button { padding: 0; border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.upcoming-line { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.visitors { margin-top: 34px; }
.flag-wall { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0; list-style: none; }
.flag-wall li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--sheet-line); font: 500 12px var(--font-mono); }
.flag-wall img { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; }
.flag-wall li.pop { animation: bulb-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fine { font-size: 12px; color: var(--faint); }
.foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--sheet-line); font-size: 13px; color: var(--muted); }
.foot-short { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 12px var(--font-mono); }
.foot-short a { display: inline-block; }

/* ---------- Easter egg: name board tapped five times ---------- */
@media (prefers-reduced-motion: no-preference) {
  .building.blink .win[data-state="live"] .win-glass { animation: win-blink 0.3s steps(1) 4; }
  @keyframes win-blink { 50% { filter: brightness(1.6); } }
}

/* ---------- Life on the facade and the street ---------- */
.pigeon { position: absolute; bottom: 100%; z-index: 6; width: 26px; height: 21px; margin-bottom: -2px; pointer-events: none; }
.pigeon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pigeon.left svg { transform: scaleX(-1); }
.pigeon.flying .pg-leg { display: none; }
.auto { position: absolute; z-index: 3; left: 0; width: 104px; height: 66px; cursor: pointer; will-change: transform; }
.auto.near { bottom: 4px; }
.auto.far { bottom: 40px; width: 90px; height: 57px; }
.auto svg { display: block; width: 100%; height: 100%; overflow: visible; }
.auto.left svg { transform: scaleX(-1); }
/* Floors that are scrolled out of view pause their animations to save battery. */
.storey.idle *, .storey.idle *::before, .storey.idle *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: no-preference) {
  .bunting img { transform-origin: 50% 0; animation: flutter 2.2s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes flutter { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
  .pigeon.flying .pg-wing { transform-box: fill-box; transform-origin: 50% 80%; animation: flap 0.16s ease-in-out infinite alternate; }
  @keyframes flap { to { transform: scaleY(-1.2) translateY(-3px); } }
  html[data-scene="night"] .lamp-post .bulb, html[data-scene="night"] .lamp-post::before { animation: lamp-on 1.8s steps(1) 1; }
  @keyframes lamp-on { 0% { opacity: 0.15; } 14% { opacity: 1; } 24% { opacity: 0.3; } 38% { opacity: 1; } 48% { opacity: 0.4; } 60%, 100% { opacity: 1; } }
}

/* Safety net for visitors who ask for reduced motion: the few loops and pops that sit outside the no-preference blocks. */
@media (prefers-reduced-motion: reduce) {
  .day-sun::before, .chakor .wing, .chakor .head, .cursor, .bulb-l.new, .flag-wall li.pop, .hello-text.pop { animation: none !important; }
}
