:root {
  --ink: #2b2d42; --muted: #6b6f85; --paper: #fffaf0; --card: #ffffff; --line: #eadfca;
  --accent: #ff5d8f; --accent-ink: #fff; --good: #1f8a5b; --bad: #c62828; --gold: #b7791f;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1b1a3a; color: var(--ink); font-size: 16px; line-height: 1.35; overscroll-behavior: none; }
#app { --panel: clamp(380px, 33vw, 480px); position: fixed; inset: 0; display: flex; flex-direction: column; background: #9fd8ff; }
#world { position: relative; flex: 1 1 auto; min-height: 38%; min-width: 0; overflow: hidden; touch-action: none; }   /* the picture can be dragged and pinched, so the page must not scroll under a finger */
.world-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; image-rendering: pixelated; display: block; }
.world-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* Speech bubbles and tap targets inside the shop */
.bubble { position: absolute; left: 0; top: 0; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 1px 7px; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.bubble.good { border-color: var(--good); color: var(--good); }
.bubble.bad { border-color: var(--bad); color: var(--bad); }
.bubble.gain { border-color: var(--gold); color: #7a4d00; background: #fff3c4; }
.marker { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -50px 0 0 -22px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font-size: 20px; line-height: 1; padding: 0; pointer-events: auto; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.3); animation: bob 1s ease-in-out infinite; }
.marker.urgent { border-color: var(--bad); background: #ffe3e3; }
@keyframes bob { 50% { margin-top: -56px; } }

/* Top bar */
#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(8px + env(safe-area-inset-top)) 8px 0; pointer-events: none; container: hudc / inline-size; }   /* its own width decides how the bar lays out (see the end of this file) */
.hud-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { pointer-events: auto; display: flex; align-items: baseline; gap: 5px; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 9px; box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; }
.chip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.chip small { font-size: 11px; color: var(--muted); font-weight: 700; }
.chip small.on { color: var(--good); } .chip small.off { color: var(--bad); }
.chip.soft { border-color: transparent; background: rgba(255,250,240,.88); box-shadow: none; font-size: 13px; }
.speed { pointer-events: auto; margin-left: auto; display: flex; gap: 4px; }
.speed button { min-width: 44px; min-height: 40px; }
.dayctl button { pointer-events: auto; min-height: 44px; font-size: 15px; background: var(--paper); }
.dayctl button.primary { background: var(--accent); }
.speed button[aria-pressed="true"] { background: var(--ink); color: #fff; }

#toasts { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(92%, 520px); pointer-events: none; z-index: 3; }
.toast { background: var(--ink); color: #fff; border: 2px solid #14152a; border-radius: 12px; padding: 7px 12px; font-size: 14px; font-weight: 700; text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }

/* Bottom sheet */
.sheet { flex: 0 0 auto; background: var(--paper); border-top: 3px solid var(--ink); display: flex; flex-direction: column; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
.sheet { max-height: 62%; overflow-y: auto; }
.sheet.tall { max-height: 62%; overflow: hidden; }
.sheet.low { max-height: 40%; overflow-y: auto; }
.scroll { flex: 1 1 auto; overflow-y: auto; padding: 8px 12px 12px; min-height: 0; }
.pad { padding: 12px 14px 14px; overflow-y: auto; }
h1 { margin: 0 0 4px; font-size: 28px; } h2 { margin: 0 0 8px; font-size: 20px; } h3 { margin: 12px 0 6px; font-size: 15px; }
p { margin: 0 0 8px; } .lead { font-size: 16px; } .sub, .or { color: var(--muted); font-size: 13px; } .or { text-align: center; margin: 10px 0 6px; }
.good { color: var(--good); } .bad { color: var(--bad); }

button { font: inherit; font-weight: 700; color: var(--ink); background: #f3e9d6; border: 2px solid var(--ink); border-radius: 12px; min-height: 44px; padding: 0 12px; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button:focus-visible { outline: 3px solid #3a86ff; outline-offset: 2px; }
button.primary { background: var(--accent); color: var(--accent-ink); font-size: 16px; padding: 0 16px; min-height: 48px; }
button.wide { width: 100%; }
button.x { margin-left: auto; min-width: 44px; padding: 0; }
button[aria-pressed="true"].card, button[aria-pressed="true"].shop, button[aria-pressed="true"].pill { background: #dff7ea; border-color: var(--good); }

.shops { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }   /* wraps: two across on a 375px phone, three on a wide screen */
.shop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; text-align: center; height: auto; }
.shop small { font-weight: 500; color: var(--muted); font-size: 12px; }
.big { font-size: 28px; line-height: 1; }

.news { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; border-bottom: 2px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.tabs button { flex: 1; min-height: 44px; padding: 0 4px; border-radius: 12px 12px 0 0; box-shadow: none; background: #efe3cb; border-bottom: none; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--card); }
.row { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-top small { color: var(--muted); font-size: 13px; }
/* Labels can wrap to different heights, so each cell pushes its stepper to the bottom to keep the two rows of buttons level. */
.row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 6px; }
.row-grid > div { display: flex; flex-direction: column; justify-content: flex-end; }
.row-grid small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; min-height: 16px; }
.row.locked, .row.up { display: flex; align-items: center; gap: 10px; }
.row.locked small { color: var(--muted); flex: 1; } .row.up > div { flex: 1; } .row.up small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); flex: none; }
.pill { margin-left: auto; min-height: 36px; font-size: 13px; border-radius: 999px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper output { flex: 1; text-align: center; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.stepper button { min-width: 44px; padding: 0; font-size: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 8px 10px; height: auto; }
.card small { font-weight: 500; color: var(--muted); font-size: 13px; }
.foot { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 2px solid var(--line); background: var(--paper); }
.foot > div { display: flex; flex-direction: column; } .foot small { font-size: 11px; color: var(--muted); } .foot b { font-variant-numeric: tabular-nums; }
.foot .primary { margin-left: auto; }

.hint { padding: 6px 14px 10px; font-size: 14px; color: var(--muted); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px 0; }
.acts button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; height: auto; padding: 6px 10px; }
.acts button small, .act-row small, .card small.state { font-weight: 500; color: var(--muted); font-size: 12px; }
.act-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .act-row small { flex: 1; }
.ctx { padding: 8px 12px 10px; }
.alert { padding: 10px 14px 12px; background: #fff0f0; border-top: 4px solid var(--bad); }
.alert h2 { color: var(--bad); margin-bottom: 2px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { text-align: left; min-height: 48px; background: #fff; }

.asks { padding: 8px 10px 4px; border-bottom: 2px solid var(--line); background: #fff7e0; max-height: 42vh; overflow-y: auto; }
.ask { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.ask p { margin: 4px 0 6px; font-size: 14px; } .ask .result { color: var(--muted); font-weight: 700; }
.ask.done { opacity: 0.85; }
.why, .queue { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.queue { margin-top: 6px; }
.banner { border: 2px solid currentColor; border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; background: #fff; }
.bars { display: grid; gap: 4px; margin-bottom: 8px; }
.bars div { position: relative; height: 22px; background: #f0e6d2; border-radius: 6px; overflow: hidden; }
.bars i { position: absolute; inset: 0 auto 0 0; } .bars .in { background: #7bd3a4; } .bars .out { background: #f29a9a; }
.bars small { position: relative; padding-left: 8px; font-size: 12px; font-weight: 700; line-height: 22px; }
.ledger div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.ledger .total { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; font-weight: 800; font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; text-align: center; }
.facts div { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 4px; }
.facts b { display: block; font-size: 18px; } .facts small { color: var(--muted); font-size: 12px; }
.notes { margin: 0 0 8px; padding-left: 20px; font-size: 14px; } .notes li { margin-bottom: 3px; }
.ask { font-weight: 800; font-size: 17px; margin: 6px 0 0; }

@media (max-width: 420px) {
  .chip { padding: 2px 6px; } .chip b { font-size: 14px; }
  .row-grid { grid-template-columns: 1fr; }
  .foot { gap: 8px; } .foot .primary { padding: 0 10px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .marker { animation: none; } }

/* Levels, equipment, arranging, making your own, bills */
.grow { padding: 6px 12px 8px; border-bottom: 2px solid var(--line); background: #fff7e0; }
.grow .row-top b { font-size: 15px; } .grow small { color: var(--muted); font-size: 12px; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.meter { position: relative; height: 24px; background: #f0e6d2; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: #7bd3a4; }
.meter small { position: relative; display: block; padding: 0 6px; line-height: 20px; font-weight: 700; color: var(--ink); white-space: nowrap; font-size: 12px; }
.grow .primary { margin-top: 4px; } .grow .why { display: block; margin-top: 2px; }
.cards.two { grid-template-columns: 1fr 1fr; }
.eqk h3 { margin-bottom: 2px; } .eqk { margin-bottom: 10px; }
h2 { font-size: 17px; margin: 14px 0 4px; }
.arrange { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { display: flex; align-items: center; gap: 8px; text-align: left; height: auto; padding: 6px 10px; }
.slot small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.slot[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.verdict { font-weight: 800; color: var(--gold); }
.mk input { width: 100%; min-height: 44px; font: inherit; font-size: 16px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 12px; margin: 2px 0 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sw { min-width: 44px; width: 44px; padding: 0; border-radius: 50%; }
.sw[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
.mk .cards { margin-bottom: 8px; } .mk .card[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.ledger .row-btn { display: flex; justify-content: space-between; width: 100%; min-height: 44px; align-items: center; background: none; border: none; box-shadow: none; padding: 3px 0; border-radius: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ledger .sub-line { padding-left: 18px; color: var(--muted); font-size: 14px; }
@media (max-width: 420px) { .arrange, .cards.two { grid-template-columns: 1fr; } .meters { grid-template-columns: 1fr; } }

/* Words over the 3D shop (door sign, promotion board). Crisp HTML instead of tiny textures. */
.wlabel { position: absolute; left: 0; top: 0; pointer-events: none; font-weight: 800; font-size: 14px; line-height: 1.2; color: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.wlabel.open { background: var(--good); } .wlabel.closed { background: var(--bad); } .wlabel.emergency { background: #8a1c1c; }
.wlabel.board { background: #ffd166; color: #b3261e; } .wlabel.board.flash { background: var(--bad); color: #fff; }

/* "Opens up" line with a See all button, and the oven card */
button.link { min-height: 40px; padding: 0 10px; font-size: 12px; border-radius: 999px; box-shadow: none; margin-left: 4px; vertical-align: middle; }
.allup { max-height: 5.5em; overflow-y: auto; margin: 2px 0 4px; padding: 4px 8px; font-size: 12px; color: var(--muted); background: #fff; border: 2px solid var(--line); border-radius: 8px; }
.trays { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.trayrow { display: flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 4px 8px; }
.trayrow > span:nth-child(2) { flex: 1; } .trayrow small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* Restaurant: dish chips under the day controls, and the table and kitchen cards */
.tchips { padding: 6px 12px 0; }
.ctx .meter { margin: 4px 0; }

/* Top bar: two compact rows at any width from 320px up. Row one is the day, clock, cash and happiness; row two is speed, sound and a small menu. Nothing may push the page sideways. */
html, body { overflow-x: hidden; }
#hud { max-width: 100%; gap: 4px; }
.hud-row { flex-wrap: nowrap; min-width: 0; }
.hud-row.top .chip { flex: 0 1 auto; min-width: 0; }
.hud-row.bar { justify-content: space-between; }
.chip.stack { flex-direction: column; align-items: center; gap: 0; line-height: 1.1; }
.hud-row .speed { margin-left: 0; }
.menu { pointer-events: auto; display: flex; gap: 4px; margin-left: auto; }
.menu button, .speed button { min-height: 44px; min-width: 44px; padding: 0 8px; font-size: 15px; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.menu button.primary { background: var(--accent); font-size: 15px; min-height: 44px; }
.speed button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.menu button { flex-direction: column; gap: 2px; } .menu button > span[aria-hidden] { font-size: 19px; line-height: 1; }   /* a picture with its name under it */
.menu .lbl { display: none; font-size: 10px; font-weight: 800; line-height: 1; }
@media (max-width: 479px) {
  #hud { padding: calc(4px + env(safe-area-inset-top)) 4px 0; }
  .hud-row.top { gap: 3px; }
  .chip { padding: 1px 5px; gap: 3px; border-radius: 10px; }
  .chip b { font-size: 13px; } .chip small { font-size: 10px; }
  .chip .opt { display: none; }
  .speed { gap: 2px; } .speed button, .menu button { min-width: 40px; padding: 0 5px; }
  .menu { gap: 2px; }
  #toasts { top: 92px; }
}
/* Wide screens (900px and up): the shop on the left, a full-height panel on the right that scrolls on its own. One tidy bar across the top of the shop area. */
@media (min-width: 900px) {
  #app { flex-direction: row; }
  #world { min-height: 0; }
  #sheet, .sheet, .sheet.tall, .sheet.low, .sheet.day { flex: 0 0 var(--panel); width: var(--panel); height: 100%; max-height: none; border-top: 0; border-left: 3px solid var(--ink); }
  #hud { right: var(--panel); padding: 8px; background: rgba(255,250,240,.82); border-bottom: 2px solid var(--ink); }
}
@media (max-width: 899px) and (max-height: 520px) { #toasts { top: 88px; } }

/* Morning plan: a slim header, sticky tabs, a pinned footer */
.scroll.plan { padding: 0; }
.tabbody { padding: 8px 12px 12px; }
.tabs.sticky { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 2px solid var(--line); }
.hd { padding: 4px 10px; border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.hd .news1 { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd button { min-height: 44px; padding: 0 10px; font-size: 12px; flex: none; }
.hd.lv { flex-wrap: wrap; background: #fff7e0; gap: 4px 8px; }
.hd.lv .lvn { flex: 1 1 110px; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd.lv .meter { flex: 1 1 90px; height: 18px; border-width: 1px; min-width: 0; } .hd.lv .meter small { line-height: 16px; font-size: 11px; }
.more { padding: 4px 12px 6px; font-size: 13px; background: #fff7e0; border-bottom: 2px solid var(--line); } .more span { display: block; margin-bottom: 2px; }
.qcard { margin: 4px 8px; } .qcard > button.qt { width: 100%; text-align: left; min-height: 44px; background: #fff; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.qcard.done > button.qt { opacity: .8; }
.pop { pointer-events: auto; position: absolute; right: 8px; top: 100%; margin-top: 4px; z-index: 5; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; width: min(260px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.pop.moremenu { width: min(280px, calc(100vw - 16px)); max-height: calc(100vh - 90px); overflow-y: auto; gap: 8px; } .moremenu [role=menuitem] { width: 100%; min-height: 44px; justify-content: flex-start; gap: 10px; text-align: left; flex-direction: row; font-size: 15px; } .moremenu .msec { display: flex; flex-direction: column; gap: 8px; border-top: 2px solid var(--line); padding-top: 8px; }
.pop button[role=switch] { width: 100%; } .pop button[aria-checked=true] { background: #dff7ea; border-color: var(--good); }
#hud { position: absolute; }
.hud-row.bar { position: relative; flex-wrap: wrap; }

/* Sound, boxes, orders, what you sold */
.settings { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 2px solid var(--line); }
.vol { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; flex: 1 1 140px; min-width: 0; }
.vol input { flex: 1; min-width: 80px; min-height: 44px; accent-color: var(--accent); }
.snd { min-width: 44px; padding: 0 8px; }
.speed { position: relative; } .pop.spdpop { left: 0; right: auto; width: max-content; } .spdpop button { width: 100%; justify-content: flex-start; }   /* the speed choices drop from their own button */
.statsline { padding: 4px 12px 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.boxes { display: flex; align-items: center; gap: 10px; margin: 6px 12px 0; padding: 6px 10px; background: #fff3c4; border: 2px solid var(--gold); border-radius: 12px; }
.boxes > div { flex: 1; min-width: 0; } .boxes small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.orders { padding: 0 12px; } .orders h3 { margin: 8px 0 4px; }
.ord { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; margin-bottom: 6px; }
.ord.urgent { border-color: var(--bad); background: #fff0f0; }
.ord-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; } .ord-top small { color: var(--muted); font-size: 12px; }
.confirm { margin: 6px 12px 0; padding: 6px 10px; background: #fff0f0; border: 2px solid var(--bad); border-radius: 12px; }
.margin { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--good); } .margin.bad { color: var(--bad); }
.sold { margin: 4px 0 6px; } .sold-head, .sold-row { display: grid; grid-template-columns: minmax(0, 1fr) 2.4em 4.4em 4.4em 4.6em; gap: 4px; padding: 3px 0; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.sold-head { font-weight: 800; color: var(--muted); border-bottom: 2px solid var(--line); } .sold-row { border-bottom: 1px solid var(--line); }
.sold-head span:first-child, .sold-row .nm { text-align: left; overflow-wrap: anywhere; }

/* Faces on the customer card and the table card (drawn by world3d.js), zoom buttons over the shop, the Graphics choice */
.who { display: flex; align-items: center; gap: 10px; }
.who-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .who-t small { color: var(--muted); font-size: 13px; } .feel { margin: 2px 0 0; font-weight: 700; font-size: 15px; }
.face { display: block; border-radius: 50%; flex: none; background: #fff; }
.face.lg { width: 72px; height: 72px; } .face.sm { width: 40px; height: 40px; }
.diners { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; } .diner { margin: 0; display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.zoomctl { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.zoomctl button { min-width: 44px; min-height: 44px; padding: 0; font-size: 24px; line-height: 1; background: var(--paper); }
.gfx { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; flex-wrap: wrap; } .gfx span { flex: 1 1 100%; } .gfx button { flex: 1; min-height: 44px; }
.gfx button[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }

/* Top bar. #hud is a container, so the layout follows the width of the shop area, not of the window.
   900px and wider: everything on one row. Narrower: exactly two rows (day, clock, cash, happiness, streak / speed and the menu). From 720px each icon has its name under it; the names are always there for screen readers. */
.hud-in { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hud-row.bar { flex-wrap: nowrap; }
.chip.streak { background: #fff0d6; border-color: #e07a00; } .chip.streak[hidden] { display: none; }
@container hudc (min-width: 900px) { .hud-in { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; } .hud-row.bar { margin-left: auto; } }
@container hudc (min-width: 720px) { .menu .lbl { display: inline; } }
@container hudc (min-width: 900px) and (max-width: 999px) { .menu .lbl { display: none; } }
@container hudc (max-width: 719px) { .hud-row.bar { flex-wrap: wrap; } .menu { flex-wrap: wrap; } }   /* a morning with every button showing takes a second line, never runs off the side */
@container hudc (max-width: 1099px) { .chip .opt, .chip.streak .lbl { display: none; } }
@container hudc (max-width: 479px) { .fsb { display: none; } .speed button, .menu button { min-width: 40px; padding: 0 4px; } .hud-row.bar { flex-wrap: wrap; } }

/* Toasts are placed by ui.js under the bar, over the shop only. */
#toasts { transform: translateX(-50%); }

/* New things, folded lists and goals on the plan screens */
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 800; line-height: 18px; vertical-align: middle; }
.isnew { background: #fff3c4 !important; border-color: var(--gold) !important; }
.gh { margin: 12px 0 6px; } .gnew { color: #b3261e; }
.stack > * { margin-bottom: 8px; }
.restbtn { margin: 6px 0; } .card small.role { color: var(--ink); font-weight: 700; }
.tomorrow { margin: 10px 0 0; text-align: center; }
.goals { list-style: none; margin: 4px 0 8px; padding: 0; } .goals li { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; font-size: 14px; } .goals .gn { color: var(--muted); margin-left: auto; white-space: nowrap; }
.goalhd b { white-space: nowrap; } .goalsh { display: flex; justify-content: space-between; align-items: baseline; } .goalsh span { font-size: 14px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.banner.great { background: #fff3c4; border-color: var(--gold); color: #7a4d00; text-align: center; font-size: 18px; }

/* While the shop is open: a card on top (when something is tapped), the dashboard below it */
.sheet.day { overflow-y: auto; max-height: 52%; }
@media (min-width: 900px) { .sheet.day { max-height: none; } }
@media (max-width: 899px) { .sheet.day.hascard .dash { display: none; } }
.backrow { padding: 0 12px 10px; }
.dash { padding: 0 0 12px; }
.dsec { border-top: 2px solid var(--line); } .dsec[hidden] { display: none; }
.dhead { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0 12px; text-align: left; font-size: 15px; }
.dhead .dt { flex: 1; } .dhead .dn { color: var(--muted); font-size: 13px; font-weight: 700; } .dhead .dn.hot::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); margin-right: 6px; }
.dbody { padding: 0 12px 8px; } .dbody[hidden] { display: none; }
.dbody h4 { margin: 10px 0 4px; font-size: 14px; }
.needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.need { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; }
.need .nt { flex: 1; font-size: 14px; } .need.urgent { border-color: var(--bad); background: #fff0f0; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); flex: none; }
.srow { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.srow.low { background: #fff3c4; border-color: var(--gold); } .srow.empty { background: #ffe3e3; border-color: var(--bad); }
.srow .sl1 { display: flex; align-items: center; gap: 8px; min-width: 0; } .srow .sn { flex: 0 1 auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sbar { flex: 1 1 96px; min-width: 96px; height: 20px; margin: 0; } .srow .sbar small { line-height: 16px; font-size: 11px; }
.srow .sl2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .srow .sprice { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.srow .sprice button { min-width: 44px; padding: 0; font-size: 20px; } .srow .spv { min-width: 5em; text-align: center; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.srow .sl3 { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; } .srow .sl3 small:empty { display: none; } .srow .sback { color: var(--muted); font-size: 12px; } .srow .skeep { color: var(--good); font-weight: 700; font-size: 12px; } .srow .skeep.bad { color: var(--bad); }
.srow .sact { flex: 1 1 120px; max-width: 170px; min-width: 112px; font-size: 13px; padding: 0 8px; }
.srow.low .sbar i { background: #f4c542; } .srow.empty .sbar i { background: #f29a9a; }
.xrows { margin-top: 6px; } .xrow { display: flex; align-items: center; gap: 8px; padding: 2px 4px; font-size: 13px; border-radius: 8px; } .xrow b { flex: 1; } .xrow.low { background: #fff3c4; } .xrow.empty { background: #ffe3e3; }
.swatch.sm { width: 14px; height: 14px; border-radius: 4px; border-width: 1px; }
.tgrid { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-variant-numeric: tabular-nums; } .tgrid small { color: var(--muted); font-size: 12px; } .tgrid small + small { text-align: right; } .tgrid b, .tgrid .tp { text-align: right; } .tp { border-top: 2px solid var(--ink); padding-top: 2px; font-weight: 800; }
.tcust { margin: 6px 0 2px; } .lostl { margin: 0 0 4px; padding-left: 20px; font-size: 13px; color: var(--muted); } .happyl { margin: 4px 0 0; font-size: 15px; } .happyl small { color: #b3571a; font-weight: 700; }
.idea { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; margin-bottom: 6px; } .idea p { margin: 0 0 6px; font-size: 14px; } .irow { display: flex; flex-wrap: wrap; gap: 6px; } .irow button { font-size: 13px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2px 8px; align-items: center; margin-bottom: 6px; } .tname small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; } .trow .doing { font-size: 13px; } .trow .tbar { grid-column: 1 / 3; height: 18px; margin: 0; } .trow .tbar small { line-height: 14px; font-size: 11px; }
.hirebtn { width: 100%; margin-top: 4px; }
.dash .acts { padding: 0; } .dash .orders { padding: 0; } .dash .boxes { margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Tester panel and the Test mode tag */
.chip.tag { background: #ffe066; border-color: #b7791f; font-size: 12px; font-weight: 800; }
.tester .head { display: flex; align-items: center; } .tester .tk { margin: 10px 0 4px; font-size: 14px; }
.tester input[type=search], .tester input[type=number], .tester textarea { width: 100%; min-height: 44px; font: inherit; font-size: 16px; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 12px; margin: 2px 0 8px; }
.tester input[type=range] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.tester .act-row { flex-wrap: wrap; } .tester .act-row input[type=number] { flex: 1; min-width: 6em; margin: 0; }
.trow2 { display: flex; align-items: center; gap: 8px; padding: 2px 0; } .trow2[hidden] { display: none; } .trow2 > span { flex: 1; min-width: 0; overflow-wrap: anywhere; } .trow2 small { display: block; color: var(--muted); font-size: 12px; }
.tabs button { position: relative; } .tabs .badge { position: absolute; top: 1px; right: 2px; line-height: 14px; font-size: 10px; padding: 0 5px; }

/* First-bake hint under the top bar */
#guide { position: absolute; left: 8px; bottom: 8px; right: 66px; z-index: 2; width: fit-content; pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff8e1; border: 2px solid var(--ink); border-radius: 12px; font-weight: 700; font-size: 14px; max-width: 520px; }
#guide button { min-height: 44px; flex: none; }
.marker.guide { border-color: var(--accent); animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { from { margin-top: -56px; } to { margin-top: -44px; } }

/* Hold-to-spray marker: a ring that fills as you hold */
.marker.spray { background: radial-gradient(circle, #fff 56%, transparent 58%), conic-gradient(var(--accent) var(--p, 0%), #d9d2c3 0); touch-action: none; user-select: none; }
.marker.spray:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Patience bar over a waiting person */
.pbar { position: absolute; left: 0; top: 0; width: 34px; height: 6px; background: #3a3a44; border: 1px solid #1d1d25; border-radius: 4px; overflow: hidden; pointer-events: none; }
.pbar i { display: block; height: 100%; background: #2a9d8f; transition: width .3s; }
.pbar[data-lvl="mid"] i { background: #f4a300; } .pbar[data-lvl="low"] i { background: #d62828; } .pbar[data-lvl="calm"] i { background: #4cc9f0; }

/* Helping a shopper choose, the offer at the till, sizes, the returns rail and the sale rail */
.act-col { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.want { font-size: 17px; font-weight: 800; margin: 4px 0 0; }
button.pickrow { display: flex; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; width: 100%; height: auto; min-height: 48px; padding: 6px 12px; }
button.pickrow small { display: block; font-weight: 500; color: inherit; font-size: 12px; opacity: .85; }
.sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.sizes .stepper { gap: 2px; } .sizes b.sz { min-width: 1.4em; text-align: center; }
.ssz { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.railrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; border: 2px dashed var(--ink); border-radius: 12px; background: #fff8e6; }
.railrow.full { background: #ffe3e3; border-color: var(--bad); }
.railrow .rtxt { flex: 1; }
.sizes .stepper output { min-width: 3.4em; text-align: center; font-weight: 700; }
.srow .ssz { flex-basis: 100%; }
.sizes { flex-wrap: wrap; row-gap: 4px; }
.sizes .stepper button { min-width: 40px; } .sizes .stepper output { min-width: 3em; }

/* ---------- Opening hours and the rest day ---------- */
.hoursbody { display: flex; flex-direction: column; gap: 6px; }
.hoursbody .hrow { display: flex; align-items: center; gap: 10px; } .hoursbody .hrow > span { flex: none; min-width: 3.6em; font-weight: 800; display: block; }
.hoursbody .hrow .stepper { flex: 1; max-width: 280px; }
.hoursbody > button { align-self: flex-start; font-size: 13px; }
.restpick .days { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; } .restpick .days button { flex: 1 1 44px; min-width: 44px; padding: 0 4px; font-size: 13px; }
.restpick .days button[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.restcard { padding: 8px 12px; background: #eaf3ff; border: 2px solid var(--ink); border-radius: 12px; } .restcard p { margin: 4px 0; font-size: 14px; }
.hd.hoursrow.isnew { background: #fff7e0; }
.restcard .settings { padding: 4px 0; border: 0; } .restcard .pill { margin-left: 0; min-height: 44px; }

/* ---------- Online: the page, a post a day, reviews ---------- */
.onl-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 6px 2px; font-size: 15px; } .onl-head b { flex: 1 1 100%; font-size: 16px; }
.stars { color: #f2a900; letter-spacing: 1px; white-space: nowrap; } .stars i { font-style: normal; color: #d7ccb4; }
.postcard.shut { opacity: 0.75; } .postcard .chips { margin-top: 6px; } .postcard .chip { text-align: left; }
.postdone { background: #eaf8ef; border: 2px solid var(--good); border-radius: 12px; padding: 8px 12px; margin: 6px 0; } .postdone small { display: block; margin-top: 2px; }
.review { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; margin: 6px 0; } .review.badr { border-color: #e9b4b4; } .review p { margin: 2px 0 4px; }
.review .rvtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .review .rvact { display: flex; flex-wrap: wrap; gap: 6px; } .review .rvact button { flex: 1 1 130px; font-size: 13px; }
.onl { margin: 4px 0; } .onl small { color: var(--muted); }
/* The calendar tab, campaigns and hosted events */
.cal { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.calrow { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; align-items: center; }
.calrow.today { border-color: var(--gold); background: #fff7e0; }
.cald { display: flex; flex-direction: column; line-height: 1.15; } .cald small { color: var(--muted); font-size: 12px; }
.calw small, .cali small, .planlist small { color: var(--muted); font-size: 12px; font-weight: 500; }
.cali { grid-column: 2; list-style: none; margin: 0; padding: 0; font-size: 14px; } .cali li { margin: 1px 0; } .cali li.bad { color: #b3261e; }
.plansec { margin: 14px 0; padding: 4px 0; border-top: 2px solid var(--line); } .plansec h3 { margin: 6px 0; } .plansec h4 { margin: 12px 0 4px; }
.planlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.planlist > li { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; } .planlist > li > div { flex: 1; min-width: 0; } .planlist small { display: block; }
.planlist > li > button { flex: none; align-self: center; font-size: 13px; }
.check { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; } .check li { margin: 1px 0; } .check li.todo { color: #8a3b00; font-weight: 700; }
.cpform .hrow, .plansec .hrow { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .plansec .hrow > span { flex: none; min-width: 3.6em; font-weight: 800; } .plansec .hrow .stepper { flex: 1; max-width: 280px; }
.cpform .card[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.estimate { background: #eef6ff; border: 2px solid #b6d4f2; border-radius: 12px; padding: 8px 10px; font-size: 14px; margin: 8px 0; }
.chips button[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.hd.comingup.isnew { background: #fff7e0; }
.campbox { margin: 0 0 6px; } .campl { margin: 2px 0; font-size: 13px; } .campl small { display: block; color: var(--muted); }
.tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
@media (max-width: 480px) { .tabs button { font-size: 12px; padding: 0 2px; min-width: 52px; } }

/* ===================== Touch: no scrolling, zooming or selecting while playing ===================== */
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
  button { min-width: 44px; min-height: 44px; }
  .stepper, .tabs, .speed, .menu, .chips, .cards, .acts, .irow, .choices, .act-row, .sizes, .swatches { gap: 8px; }
  .pill, .hd button, button.link { min-height: 44px; }
  .scroll, .sheet, #dash, #more, #dock, .tabs { touch-action: pan-y; }
  .tabs { touch-action: pan-x pan-y; }
}
button { transition: transform .08s, box-shadow .08s, filter .08s; }
button:active:not(:disabled) { transform: translateY(2px) scale(.97); filter: brightness(.94); }
/* Pressed buttons, money, bounces. With reduced motion everything below becomes a fade or nothing. */
@keyframes pulse { 40% { transform: scale(1.16); } }
@keyframes flashbg { 0% { background: #fff3c4; } 100% { background: var(--paper); } }
@keyframes bnc { 30% { transform: scale(1.5) rotate(-8deg); } 60% { transform: scale(.9); } }
@keyframes popin { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); } to { transform: scale(1); opacity: 1; } }
@keyframes settle { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes starland { 0% { transform: scale(3) rotate(-30deg); opacity: 0; } 60% { transform: scale(.85) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.chip.pulse { animation: pulse .45s; } .chip.pulse.up b { color: var(--good); } .chip.pulse.down b { color: var(--bad); }
.bounce { display: inline-block; animation: bnc .5s; }
#fxl { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.coin { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a0, #f2b705 60%, #b7791f); border: 2px solid #7a4d00; display: none; will-change: transform; }
.conf { position: absolute; left: 0; top: 0; width: 9px; height: 14px; border-radius: 2px; display: none; will-change: transform; }
.cbanner { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 22%; max-width: calc(100vw - 24px); padding: 10px 22px; background: #fff3c4; border: 3px solid var(--ink); border-radius: 16px; font-size: 22px; font-weight: 800; color: #7a4d00; box-shadow: 0 4px 0 rgba(0,0,0,.3); text-align: center; animation: popin .4s; }
.daystars { display: flex; justify-content: center; gap: 8px; margin: 2px 0 6px; } .daystars .st { font-size: 44px; line-height: 1; color: #d7ccb4; } .daystars .st.earn.in { color: #f2a900; animation: starland .5s; }
.rv { opacity: 0; transform: translateY(10px); } .rv.in { opacity: 1; transform: none; transition: opacity .25s, transform .25s; }
.starstrip { gap: 8px; } .sst { display: flex; gap: 3px; align-items: flex-end; margin-left: auto; } .sst i { width: 12px; height: 20px; border: 2px solid var(--ink); border-radius: 3px; background: linear-gradient(to top, #f2a900 calc(var(--n) / 3 * 100%), #fff 0); }
@media (prefers-reduced-motion: reduce) {
  button, .rv, .rv.in { transition: none; } button:active:not(:disabled) { transform: none; }
  .chip.pulse { animation: flashbg .6s; } .bounce, .cbanner, .daystars .st.earn.in, #topcard > *, .nb { animation: none; }
  .rv { transform: none; }
}

/* ===================== The first-day helper ===================== */
#tour { position: fixed; inset: 0; z-index: 50; pointer-events: none; } #tour[hidden] { display: none; }
.tring { position: fixed; display: none; border: 4px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 4px rgba(255,255,255,.7), 0 0 18px rgba(255,93,143,.8); animation: ringp 1.2s ease-in-out infinite alternate; }
@keyframes ringp { to { box-shadow: 0 0 0 8px rgba(255,255,255,.5), 0 0 26px rgba(255,93,143,.9); } }
@media (prefers-reduced-motion: reduce) { .tring { animation: none; } }
.tbub { position: fixed; pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: #fff8e1; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.tbub .tt { flex: 1; min-width: 0; } .tbub p { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.tbub .trow { display: flex; gap: 8px; flex-wrap: wrap; } .tbub .trow button { min-height: 44px; font-size: 14px; padding: 0 12px; }
.a2hs { margin: 8px 0; padding: 8px 12px; background: #eaf3ff; border: 2px solid #b6d4f2; border-radius: 12px; font-size: 14px; } .a2hs ol { margin: 4px 0 0; padding-left: 20px; }
.stackb { display: flex; flex-direction: column; gap: 8px; } .stackb button[aria-checked=true] { background: #dff7ea; border-color: var(--good); }
.morehead { display: none; align-items: center; justify-content: space-between; } .morehead b { font-size: 18px; }
#hintbar { flex: none; margin: 0; display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #fff8e1; border-top: 3px solid var(--ink); font-weight: 700; font-size: 14px; } #hintbar[hidden] { display: none; }
#hintbar span { flex: 1; }

/* ===================== Dock, drawers and badges (shared) ===================== */
#dock, #dhead, #needsbar, #more { display: none; }
.dk { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 2px; min-height: 48px; background: var(--paper); }
.dk .di { font-size: 21px; line-height: 1.1; } .dk .dl { font-size: 9.5px; font-weight: 800; line-height: 1.1; }
.dk[aria-pressed="true"] { background: var(--ink); color: #fff; }
.dk .badge { position: absolute; top: -5px; right: -4px; line-height: 16px; font-size: 10px; padding: 0 5px; } .dk .badge.hot { background: var(--bad); }
.nb { position: relative; width: 52px; height: 52px; min-width: 52px; border-radius: 50%; padding: 0; font-size: 24px; background: #fff; animation: popin .3s; }
.nb.urgent { border-color: var(--bad); background: #ffe3e3; } .nb .dot { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border: 2px solid #fff; } .nb.nbmore { font-size: 16px; }
#dhead .dtitle { flex: 1; font-size: 16px; } #dhead .dpause { min-height: 44px; font-size: 13px; padding: 0 10px; } #dhead .dpause[aria-pressed="true"] { background: var(--ink); color: #fff; } #dhead .x { margin-left: 0; }

/* ===================== Landscape: phones and tablets ===================== */
body.land { --sb: 44px; --dock: 72px; --dw: min(56vw, 440px); --nbw: 60px; --sl: env(safe-area-inset-left); --sr: env(safe-area-inset-right); --st: env(safe-area-inset-top); --sbot: env(safe-area-inset-bottom); }
body.land.tab { --sb: 52px; --dock: 80px; --dw: min(46vw, 560px); font-size: 18px; }
.land #app { display: block; }
.land #world { position: absolute; inset: 0; min-height: 0; width: auto; }
.land #hud { left: 0; right: 0; top: 0; width: auto; height: calc(var(--sb) + var(--st)); padding: var(--st) calc(6px + var(--sr)) 0 calc(6px + var(--sl)); background: rgba(27,26,58,.86); border: 0; z-index: 15; display: flex; align-items: center; }
.land .land-bar { flex-direction: row; align-items: center; gap: 6px; width: 100%; flex-wrap: nowrap; }
.land .land-bar .chip { min-height: 32px; align-items: center; padding: 0 8px; gap: 4px; border-radius: 10px; } .land .land-bar .chip b { font-size: 15px; }
.land .land-bar .sbgap { flex: 1; } .land .sb { min-height: 44px; min-width: 48px; padding: 0 8px; font-size: 16px; background: var(--paper); } .land .sb[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land #toasts { z-index: 30; } .land .toast { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 4px 12px; font-size: 14px; }
.land .zoomctl { right: auto; left: calc(8px + var(--sl)); bottom: calc(8px + var(--sbot)); flex-direction: row; }
.land.lefty .zoomctl { left: auto; right: calc(8px + var(--sr)); }
.land #guide { bottom: auto; top: calc(var(--sb) + var(--st) + 8px); left: calc(var(--nbw) + 8px + var(--sl)); right: auto; max-width: 46vw; }
.land #dock { display: flex; position: fixed; z-index: 14; top: calc(var(--sb) + var(--st)); bottom: 0; right: 0; width: calc(var(--dock) + var(--sr)); flex-direction: column; gap: 8px; padding: 8px calc(6px + var(--sr)) calc(8px + var(--sbot)) 6px; overflow-y: auto; background: rgba(255,250,240,.94); border-left: 3px solid var(--ink); scrollbar-width: none; }
.land.lefty #dock { right: auto; left: 0; width: calc(var(--dock) + var(--sl)); padding: 8px 6px calc(8px + var(--sbot)) calc(6px + var(--sl)); border-left: 0; border-right: 3px solid var(--ink); }
.land #dock::-webkit-scrollbar { display: none; }
.land.tab .dk .di { font-size: 26px; } .land.tab .dk .dl { font-size: 12px; } .land.tab .dk { min-height: 60px; }
.land #needsbar { display: flex; position: fixed; z-index: 13; flex-direction: column; gap: 10px; top: calc(var(--sb) + var(--st) + 12px); left: calc(8px + var(--sl)); }
.land.lefty #needsbar { left: auto; right: calc(8px + var(--sr)); }
/* The drawers. They slide by their offset, not by a transform, so the floating buttons inside them still stick to the screen. */
.land #sheet:not(.day):not(.title):not(.rep), .land #sheet.day #dash, .land #more { display: flex; flex-direction: column; position: fixed; z-index: 12; top: calc(var(--sb) + var(--st)); bottom: 0; right: calc(-1 * var(--dw) - 80px); left: auto; width: var(--dw); height: auto; max-height: none; margin: 0; flex: none; background: var(--paper); border: 0; border-left: 3px solid var(--ink); visibility: hidden; padding: 52px 0 var(--sbot); overflow-y: auto; transition: right .26s cubic-bezier(.2,.8,.2,1), visibility 0s .26s; touch-action: pan-y; }
.land.lefty #sheet:not(.day):not(.title):not(.rep), .land.lefty #sheet.day #dash, .land.lefty #more { right: auto; left: calc(-1 * var(--dw) - 80px); border-left: 0; border-right: 3px solid var(--ink); }
.land.dr #sheet:not(.day):not(.title):not(.rep), .land.dr #sheet.day #dash, .land.mo #more { right: calc(var(--dock) + var(--sr)); visibility: visible; transition: right .26s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.land.lefty.dr #sheet:not(.day):not(.title):not(.rep), .land.lefty.dr #sheet.day #dash, .land.lefty.mo #more { right: auto; left: calc(var(--dock) + var(--sl)); }
.land.mo #more { overflow-y: auto; } .land #more .scroll { overflow: visible; padding: 4px 12px 12px; }
@media (prefers-reduced-motion: reduce) { .land #sheet:not(.day):not(.title):not(.rep), .land #sheet.day #dash, .land #more { transition: none !important; } }
.land.dr #dhead, .land.mo #dhead { display: flex; position: fixed; z-index: 16; align-items: center; gap: 8px; top: calc(var(--sb) + var(--st)); height: 52px; width: var(--dw); right: calc(var(--dock) + var(--sr)); padding: 4px 8px 4px 14px; background: var(--paper); border-bottom: 2px solid var(--line); border-left: 3px solid var(--ink); }
.land.lefty.dr #dhead, .land.lefty.mo #dhead { right: auto; left: calc(var(--dock) + var(--sl)); border-left: 0; border-right: 3px solid var(--ink); }
.land #sheet.tall { overflow: hidden; } .land #sheet .scroll { overflow-y: auto; }
/* The day: the sheet is only a holder. The card for a tapped thing and the emergency strip sit at the bottom centre, above everything. */
.land #sheet.day { position: fixed; inset: 0; width: auto; height: auto; max-height: none; flex: none; background: none; border: 0; padding: 0; overflow: visible; pointer-events: none; z-index: 12; }
.land #sheet.day #dash { pointer-events: auto; }
.land #sheet.day.hascard .dash { display: flex; }
.land #sheet.day #topcard { position: fixed; z-index: 20; pointer-events: auto; left: calc(var(--nbw) + 12px + var(--sl)); right: calc(var(--dock) + 12px + var(--sr)); margin: 0 auto; width: min(600px, calc(100vw - var(--dock) - var(--nbw) - 24px - var(--sl) - var(--sr))); bottom: calc(8px + var(--sbot)); max-height: 52vh; overflow-y: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.land.lefty #sheet.day #topcard { left: calc(var(--dock) + 12px + var(--sl)); right: calc(var(--nbw) + 12px + var(--sr)); }
.land #topcard:empty { display: none !important; } .land #topcard > * { animation: settle .25s ease-out; }
.land .backrow { display: none; } .land .ctx { padding: 6px 10px 8px; }
.land .alert { padding: 8px 12px 10px; border-top: 0; background: #fff0f0; border-radius: 11px; } .land .alert h2 { font-size: 16px; margin: 0 0 2px; } .land .alert p { font-size: 13px; margin: 0 0 6px; }
.land .alert .choices { flex-direction: row; flex-wrap: wrap; } .land .choice { flex: 1 1 150px; min-height: 44px; font-size: 14px; padding: 0 10px; }
.land .confirm { margin: 0; border: 0; }
/* Morning: the Open button floats at the bottom centre. */
.land #sheet.morning .foot { visibility: visible; position: fixed; z-index: 14; bottom: calc(10px + var(--sbot)); left: calc(50% + (var(--sl) - var(--sr) - var(--dock)) / 2); transform: translateX(-50%); width: auto; max-width: calc(100vw - var(--dock) * 2 - 16px); gap: 12px; padding: 6px 8px 6px 16px; background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.land.lefty #sheet.morning .foot { left: calc(50% + (var(--sl) - var(--sr) + var(--dock)) / 2); }
.land.dr #sheet.morning .foot { left: calc(8px + var(--sl)); transform: none; max-width: calc(100vw - var(--dock) - var(--dw) - 16px - var(--sl)); padding-left: 8px; } .land.lefty.dr #sheet.morning .foot { left: calc(var(--dock) + var(--dw) + 8px); max-width: calc(100vw - var(--dock) - var(--dw) - 16px - var(--sr)); } .land.dr #sheet.morning .foot .spend { display: none; }
.land #sheet.morning .foot > div:nth-child(2) { display: none; } .land #sheet.morning .foot .spend small { display: none; } .land #sheet.morning .foot .spend b::before { content: 'Spent '; font-weight: 500; } .land #sheet.morning .foot .primary { margin-left: 0; white-space: nowrap; }
.land.dr #sheet.morning .scroll { padding-bottom: 76px; }
.land #sheet.morning .tabs.sticky { display: none; }
/* Title and report fill the screen. */
.land #sheet.title, .land #sheet.rep { display: flex; position: fixed; inset: 0; z-index: 17; width: auto; height: auto; max-height: none; border: 0; padding: var(--st) var(--sr) var(--sbot) var(--sl); background: var(--paper); overflow-y: auto; }
.land #sheet.rep { top: calc(var(--sb) + var(--st)); padding-top: 0; } .land #sheet.rep .scroll { padding-left: 16px; padding-right: 16px; }
.land #sheet.title .pad { max-width: 760px; margin: 0 auto; } .land #sheet.title .shops { grid-template-columns: repeat(4, 1fr); } .land #sheet.title h1 { font-size: 24px; } .land #sheet.title .lead { margin-bottom: 4px; }
.land #sheet.rep { max-width: none; } .land #sheet.rep .scroll.pad { max-width: 720px; margin: 0 auto; width: 100%; }

/* ===================== Portrait phones and tablets: the dock is a bottom tab bar ===================== */
.port #dock { display: flex; position: static; flex: 0 0 auto; gap: 8px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; background: var(--paper); border-top: 3px solid var(--ink); scrollbar-width: none; z-index: 14; }
.port #dock::-webkit-scrollbar { display: none; } .port .dk { flex: 1 0 62px; }
.port .sheet { padding-bottom: 0; } .port #sheet .tabs.sticky { display: none; }
.port #more { display: block; position: fixed; z-index: 16; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); max-height: 72%; overflow-y: auto; background: var(--paper); border-top: 3px solid var(--ink); transform: translateY(105%); visibility: hidden; transition: transform .26s, visibility 0s .26s; }
.port.mo #more { transform: none; visibility: visible; transition: transform .26s, visibility 0s; } .port .morehead { display: flex; }
@media (prefers-reduced-motion: reduce) { .port #more { transition: none; } }
.port #app { padding-bottom: 0; }
.port #hud { padding-left: calc(4px + env(safe-area-inset-left)); padding-right: calc(4px + env(safe-area-inset-right)); }
.port .nb { display: none; }

.port #world { min-height: 26%; } .port #sheet, .port #sheet.tall, .port #sheet.day { max-height: calc(74% - 76px); } .port #dock { flex: none; min-height: 64px; }
.port .hud-row.bar .menu, .port .fsb { display: none; }

.port.tab #dock { min-height: 76px; }

.titled .zoomctl, .inrep .zoomctl, .land.dr .zoomctl, .land.mo .zoomctl { display: none; }
@media (pointer: coarse) { .speed button, .menu button { min-width: 44px !important; } }

.land.mo #sheet.morning .foot { visibility: hidden; }

.port #sheet, .port #sheet.tall, .port #sheet.day { flex: 0 1 auto; min-height: 0; }
.port.tab #more { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (pointer: coarse) { .gfx { gap: 8px; } .srow { row-gap: 8px; } .row-grid { row-gap: 8px; } }

/* ===================== A small window over the shop ===================== */
#modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); background: rgba(27,26,58,.55); }
#modal[hidden] { display: none; }
.mcard { width: min(440px, 100%); max-height: 100%; overflow: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 16px; box-shadow: 0 6px 0 rgba(0,0,0,.3); animation: settle .25s; }
#modal.wide .mcard { width: min(760px, 100%); }
.mcard h2 { margin: 0 0 6px; font-size: 24px; } .mcard p { margin: 6px 0; } .mcard .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .mcard .head h2 { margin: 0; flex: 1; }
.waitl { margin: 4px 0 12px; padding-left: 22px; } .waitl li { margin: 3px 0; }
@media (prefers-reduced-motion: reduce) { .mcard { animation: none; } }

/* ===================== Sticker book ===================== */
.stkchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.stkgrid { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.stk { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 8px 6px; border: 2px dashed #b9b2a2; border-radius: 14px; background: transparent; color: var(--muted); min-height: 118px; }
.stk .si { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #b9b2a2; font-size: 24px; filter: grayscale(1); opacity: .55; }
.stk b { font-size: 13px; line-height: 1.15; } .stk small { font-size: 11.5px; line-height: 1.2; }
.stk.got { border: 2px solid var(--ink); border-style: solid; background: #fff3c4; color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.25); transform: rotate(-1.2deg); }
.stk.got:nth-child(even) { transform: rotate(1.2deg); }
.stk.got .si { filter: none; opacity: 1; background: #fff; border-color: var(--ink); }
.stk.hid .si { font-size: 26px; font-weight: 800; filter: none; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .stk.got, .stk.got:nth-child(even) { transform: none; } }

/* ===================== Decorate ===================== */
#decor { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: var(--panel, 420px); display: flex; flex-direction: column; background: var(--paper); border-left: 3px solid var(--ink); box-shadow: -4px 0 0 rgba(0,0,0,.15); }
#decor[hidden] { display: none; }
.dhd { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 6px; border-bottom: 2px solid var(--line); } .dhd h2 { margin: 0; flex: 1; font-size: 20px; }
.dsc { flex: 1 1 auto; overflow-y: auto; padding: 4px 12px 12px; } .dsc h3 { margin: 12px 0 4px; font-size: 15px; }
.dft { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); }
.dlab { display: block; font-weight: 700; margin-top: 8px; } .drow { display: flex; gap: 6px; } .drow input { flex: 1; min-width: 0; font: inherit; min-height: 44px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.drow input:focus-visible { outline: 3px solid #3a86ff; outline-offset: 2px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.dopt { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; padding: 6px 4px; min-height: 76px; font-size: 12px; line-height: 1.15; }
.dopt b { font-size: 12px; } .dopt small { font-size: 11px; color: var(--muted); min-height: 13px; }
.dopt[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); } .dopt.lk { background: #efe9dc; color: var(--muted); }
.dsw { width: 40px; height: 28px; border: 2px solid var(--ink); border-radius: 8px; display: grid; place-items: center; background: #fff; } .dsw.cl { font-size: 14px; background: repeating-linear-gradient(45deg, #fff, #fff 5px, #eee 5px, #eee 10px); }
.ditem { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; } .ditem .dic { font-size: 22px; width: 30px; text-align: center; } .ditem b { min-width: 86px; } .ditem small { color: var(--muted); }
.dspots { display: flex; gap: 6px; } .dspots button { min-width: 44px; padding: 0; } .dspots button[aria-pressed="true"] { background: #dff7ea; border-color: var(--good); }
.land #decor { top: calc(var(--sb) + var(--st)); right: calc(var(--dock) + var(--sr)); width: min(44vw, 380px); }
.land.lefty #decor { right: auto; left: calc(var(--dock) + var(--sl)); border-left: 0; border-right: 3px solid var(--ink); }
.land .dhd { padding-top: 6px; }
.port #decor { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 58%; border-left: 0; border-top: 3px solid var(--ink); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 0 rgba(0,0,0,.15); }
.port .dhd { padding-top: 8px; }

/* ===================== Regulars ===================== */
.nametag { position: absolute; left: 0; top: 0; padding: 0 7px; border: 2px solid var(--ink); border-radius: 10px; background: #fff3c4; color: #5a3a00; font-size: 12px; font-weight: 800; line-height: 18px; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.regc { margin: 6px 0; padding: 8px 10px; background: #fff9e6; border: 2px solid var(--line); border-radius: 12px; } .regc p { margin: 2px 0; font-size: 13px; line-height: 1.3; }
.regs { list-style: none; margin: 4px 0 8px; padding: 0; } .regs li { margin: 3px 0; padding: 4px 8px; border-radius: 10px; background: #eefaf3; } .regs li.bad { background: #fdecec; }
.pplist { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.ppl { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; } .ppl p { margin: 2px 0; } .ppl canvas { flex: 0 0 auto; }
.rel { font-weight: 700; font-size: 13px; } .rel.l2 { color: #b0245a; } .rel.l1 { color: #7a4d00; } .rel.l0 { color: var(--muted); }

/* ===================== The town square ===================== */
.town { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; padding: 10px; border: 3px solid var(--ink); border-radius: 16px; background: radial-gradient(circle at 50% 50%, #e9dcc0 0 22%, transparent 23%), linear-gradient(90deg, transparent 47%, #e9dcc0 47% 53%, transparent 53%), linear-gradient(0deg, transparent 47%, #e9dcc0 47% 53%, transparent 53%), #a8d98a; }
.fountain { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; font-size: 26px; background: #cfeafc; border: 3px solid var(--ink); border-radius: 50%; pointer-events: none; z-index: 1; }
.plot { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.plotb { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; padding: 6px 4px 6px; min-height: 124px; background: rgba(255,250,240,.92); font-size: 13px; line-height: 1.15; }
.plot.rent .plotb { background: rgba(255,250,240,.7); border-style: dashed; }
.bld { width: 100%; max-width: 128px; height: auto; display: block; } .pname { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pmeta { font-size: 12px; font-weight: 700; color: var(--muted); } .pmeta span { color: #e0a100; letter-spacing: 1px; }
.rentsign, .soonsign { padding: 1px 8px; border: 2px solid var(--ink); border-radius: 6px; background: #fff3c4; color: #7a4d00; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.plot.soon { align-items: center; gap: 1px; min-height: 124px; padding: 6px 4px; border: 2px dashed var(--ink); border-radius: 12px; background: rgba(255,250,240,.55); text-align: center; }
.plot.soon .bld { opacity: .85; } .plot.soon .soonsign { background: #e4dfd2; color: var(--muted); }
.plot.lock .plotb { background: rgba(255,250,240,.55); border-style: dashed; } .plot.lock .soonsign { background: #e4dfd2; color: var(--muted); }
#pcode { width: 100%; min-height: 48px; margin-top: 4px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: inherit; font: 700 18px ui-monospace, Menlo, monospace; letter-spacing: 1px; text-transform: uppercase; }
#pmsg { padding: 8px 10px; border: 2px solid var(--bad); border-radius: 10px; background: #ffe3e3; color: var(--bad); font-weight: 700; }
.plotx { position: absolute; right: 2px; top: 2px; min-width: 44px; min-height: 44px; width: 44px; padding: 0; font-size: 16px; background: rgba(255,250,240,.95); z-index: 2; }
.land #sheet.title .town { grid-template-columns: repeat(3, 1fr); } .land .plotb, .land .plot.soon { min-height: 110px; } .land .bld { max-width: 96px; }
.port .town { grid-template-columns: repeat(2, 1fr); }
/* ===================== A picture ===================== */
body.photo #hud, body.photo #sheet, body.photo #dock, body.photo #more, body.photo #needsbar, body.photo #toasts, body.photo #hintbar, body.photo #dhead, body.photo #tour, body.photo #decor, body.photo .world-overlay, body.photo .zoomctl, body.photo #fxl { visibility: hidden !important; }
#flash { position: fixed; inset: 0; z-index: 90; background: #fff; pointer-events: none; opacity: 0; } #flash.go { animation: shutter .45s; } @keyframes shutter { 0% { opacity: .9; } 100% { opacity: 0; } }
.photoimg { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; border: 3px solid var(--ink); border-radius: 12px; margin: 8px 0; background: #fff; image-rendering: pixelated; }
.mcard .act-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.land .fountain { display: none; }

/* One rule for every screen: pressable things never touch, and neighbours are at least 8px apart (tools/layout-check.mjs measures it). */
.tabs, .speed, .menu, .zoomctl, .gfx, .hud-row, .hud-row.top, .land .land-bar, .stepper, .chips, .cards, .acts, .irow, .choices, .act-row, .sizes, .swatches, .stackb, .eqs, .moremenu { gap: 8px; }
@media (max-width: 479px) { .hud-row.top, .speed, .menu { gap: 8px; } }

/* Sideways rows (tab bars, the phone dock): swipe with momentum, snap to a button, no scrollbar, a faded edge where there is more. */
.hs { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.hs::-webkit-scrollbar { display: none; } .hs > * { scroll-snap-align: start; flex-shrink: 0; white-space: nowrap; }
.hs.fr { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.hs.fl { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.hs.fl.fr { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.land #dock.hs { overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; } .land #dock.hs > * { scroll-snap-align: start; }
.land #dock.hs.fb { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.land #dock.hs.ft { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 28px), transparent); }
.land #dock.hs.ft.fb { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
@media (prefers-reduced-motion: reduce) { .hs { scroll-behavior: auto; } }
.eqk .cards + .cards, .cards.two + .cards { margin-top: 8px; }
.stackb + .settings { margin-top: 8px; } .dsec + .dsec { margin-top: 8px; }
.port #dock { box-sizing: border-box; height: calc(64px + env(safe-area-inset-bottom)); min-height: 0; } .port.tab #dock { height: calc(76px + env(safe-area-inset-bottom)); } .port.tab #more { bottom: calc(76px + env(safe-area-inset-bottom)); }
.dgrid, .drow { gap: 8px; }
.savechip { min-height: 32px; cursor: pointer; font: inherit; box-shadow: none; } .savechip.warn { background: #fff3c4; border-color: var(--gold); } .savechip #h-savei { font-weight: 800; color: var(--good); } .savechip.warn #h-savei { color: inherit; }
@media (pointer: coarse) { .savechip { min-width: 44px; min-height: 44px; } }
@media (pointer: coarse) { .hud-row.top .savechip, .land .land-bar .savechip { min-width: 44px; min-height: 44px; justify-content: center; } }

/* The end-of-day report: a short first view, the rest folded behind "More details". */
.rhead { font-size: 22px; line-height: 1.25; margin: 8px 0; text-align: center; } .rhead .good { color: var(--good); } .rhead .bad { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; } .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.08); text-align: center; font: inherit; color: inherit; }
button.tile { border: 2px solid var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.3); cursor: pointer; } button.tile[disabled] { border-color: var(--line); box-shadow: none; opacity: 1; cursor: default; }
.tile small { color: var(--muted); font-size: 12px; font-weight: 700; } .tile b { font-size: 20px; font-variant-numeric: tabular-nums; } .tile b.good { color: var(--good); } .tile b.bad { color: var(--bad); } .tile.kept { background: #eefaf3; }
.tile.small { flex-direction: row; min-height: 44px; gap: 6px; } .tile.small b { font-size: 17px; }
.ledger.costs { margin: 0 0 8px; padding: 4px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.bf { margin: 8px 0; font-size: 15px; } .bf b { font-weight: 800; } .lefts { margin-top: 0; }
.rgoals { margin: 8px 0; } .rgoals li { min-height: 28px; align-items: center; font-size: 15px; } .rgoals li.met { color: var(--good); font-weight: 700; }
.moredet { width: 100%; min-height: 44px; margin: 8px 0; font-weight: 800; }
.details { display: flex; flex-direction: column; gap: 8px; }
.rsec { border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.rsh { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-weight: 800; background: transparent; border: 0; box-shadow: none; border-radius: 12px; } .rsh span + span { color: var(--muted); }
.rbody { padding: 0 12px 10px; }
@media (max-width: 359px) { .hud-row.top { gap: 4px; } .hud-row.top .chip { padding: 1px 4px; gap: 2px; flex-shrink: 0; } .hud-row.top .chip b { font-size: 12px; } .hud-row.top .chip small { font-size: 9px; } #hud { padding-left: 2px; padding-right: 2px; } }

/* The morning goals and the goals pill; the amber warning button; calmer containers. */
.mgoals { margin: 8px 12px 4px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); } .mgoals ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mgoals li { font-size: 15px; font-weight: 700; min-height: 24px; display: flex; align-items: center; } .mgoals small { color: var(--muted); font-size: 12px; }
.primary.warn { background: #ffe29a; color: var(--ink); border-color: var(--ink); } .primary.warn:hover { background: #ffd978; }
#goalpill { position: absolute; z-index: 7; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; } #goalpill[hidden] { display: none; }
.gpill { pointer-events: auto; display: flex; gap: 8px; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 18px; background: rgba(255,250,240,.96); font-size: 13px; font-weight: 800; white-space: nowrap; max-width: 100%; overflow: hidden; }
.gp { padding: 2px 6px; border-radius: 10px; font-variant-numeric: tabular-nums; } .gp.met { background: #dff7ea; color: #1b6b3f; } .gp.risk { background: #fff3c4; color: #7a5200; } .gp.pop { animation: gpop .5s; }
@keyframes gpop { 50% { transform: scale(1.25); } }
.gpl { pointer-events: auto; list-style: none; margin: 0; padding: 8px 12px; background: rgba(255,250,240,.97); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15); font-size: 14px; display: flex; flex-direction: column; gap: 4px; } .gpl li.met { color: var(--good); font-weight: 700; }
@media (pointer: coarse) { .gpill { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .gp.pop { animation: none; } }
body.photo #goalpill { visibility: hidden !important; }
.gpill { gap: 4px; padding: 2px 6px; font-size: 12px; } .gp { padding: 2px 4px; }
.dbody { padding-top: 8px; } .needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* Message cards: one question at a time over the shop. */
#msgcard { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(27,26,58,.35); } #msgcard[hidden] { display: none; }
.mcardm { width: min(380px, 100%); max-height: 100%; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mcardm .from { margin: 0; font-weight: 800; font-size: 14px; color: var(--muted); } .mcardm .mt { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.mcardm .choices { display: flex; flex-direction: column; gap: 8px; } .mcardm .choice { text-align: left; min-height: 44px; } .mcardm .mfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .mcardm .mfoot small { color: var(--muted); }
.chip.env { cursor: pointer; font: inherit; background: #fff; gap: 4px; } .chip.env .envn { background: var(--bad); color: #fff; border-radius: 10px; min-width: 20px; padding: 0 5px; text-align: center; font-size: 12px; line-height: 20px; }
@media (pointer: coarse) { .hud-row.top .chip.env, .land .land-bar .chip.env { min-width: 44px; min-height: 44px; justify-content: center; } }
body.photo #msgcard { visibility: hidden !important; }
