/* Squeeze City for iPad: a touch-first shell over the same simulation as the web game.
   The page never scrolls: a fixed frame (top bar, sidebar, content pane) with scroll inside the panes.
   Sizes are for fingers: 44 pt targets, 16 px text in fields (iOS zooms on anything smaller). */

:root {
  --lemon: #f6c90e;
  --lemon-dark: #d9ad00;
  --lemon-pale: #fff3b0;
  --lemon-wash: #fffae0;
  --leaf: #5caa5f;
  --leaf-dark: #3f8a42;
  --sky: #cfe9ff;
  --cream: #fff8e7;
  --cream-2: #fbf3dc;
  --paper: #ffffff;
  --ink: #2b2a28;
  --ink-soft: #5f5b54;
  --ink-mute: #8a857c;
  --line: #eadfc4;
  --line-soft: #f3ead2;
  --danger: #d64545;
  --danger-bg: #fdecec;
  --warn: #c98a00;
  --warn-ink: #7a5300;
  --warn-bg: #fff4d6;
  --ok: #2f8f4e;
  --ok-bg: #e6f6ea;
  --info: #1f5c99;
  --info-bg: #eaf3ff;
  --shadow: 0 1px 2px rgba(80, 60, 0, .06), 0 6px 18px rgba(80, 60, 0, .07);
  --shadow-pop: 0 18px 50px rgba(40, 30, 0, .28);
  --radius: 16px;
  --radius-s: 11px;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Nunito", "Segoe UI", system-ui, sans-serif;
  --scale: 1;
  --top-h: 60px;
  --side-w: 224px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
html.large-text { --scale: 1.14; }
@media (max-width: 1099px) { :root { --side-w: 84px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: calc(16px * var(--scale));
  line-height: 1.42;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.08em; }
h4 { font-size: 1em; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--ink-soft); }
.mute { color: var(--ink-mute); }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
a { color: var(--leaf-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num, .tabnum { font-variant-numeric: tabular-nums; }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------------ the frame */
.shell {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: calc(var(--side-w) + var(--safe-l)) minmax(0, 1fr);
  grid-template-rows: calc(var(--top-h) + var(--safe-t)) minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
  background: var(--cream);
}
.shell.no-side { grid-template-columns: 0 minmax(0, 1fr); }
.shell.no-side .sidebar { display: none; }
.shell.title-mode { display: block; }

/* top bar */
.topbar {
  grid-area: top; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: var(--safe-t) calc(14px + var(--safe-r)) 0 calc(14px + var(--safe-l));
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(246, 201, 14, .55);
  min-width: 0;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05em; min-width: 0; max-width: 230px; border: 0; background: transparent; padding: 6px 8px 6px 2px; border-radius: 12px; cursor: pointer; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand svg { width: 32px; height: 32px; flex: none; }
.topbar .brand:active { background: var(--cream-2); }
.tstats { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.tstat { display: flex; flex-direction: column; justify-content: center; line-height: 1.12; padding: 4px 10px; border-radius: 10px; min-width: 0; white-space: nowrap; }
.tstat .l { font-size: .68em; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tstat .v { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .98em; }
.tstat .v.neg { color: var(--danger); }
.tstat.opt { }
.topbar .spacer { flex: 1; min-width: 4px; }
.topbar .tbtn { flex: none; position: relative; width: 46px; height: 46px; border-radius: 14px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.topbar .tbtn:active { background: var(--cream-2); }
.topbar .tbtn .dot { position: absolute; top: 5px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.topbar .tbtn .dot.soft { background: var(--lemon-dark); }
.topbar .phase-go { flex: none; }
.phase-pill { flex: none; background: var(--lemon-pale); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .92em; white-space: nowrap; }
@media (max-width: 1180px) { .tstat.opt2 { display: none; } }
@media (max-width: 1024px) { .tstat.opt { display: none; } .topbar .brand { max-width: 170px; } }
@media (max-width: 820px) { .topbar .brand span { display: none; } .tstat { padding: 4px 7px; } }
.sm-only { display: none; }
@media (max-width: 640px) {
  .sm-only { display: inline; }
  .lg-only { display: none; }
  .topbar { gap: 6px; padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
  .topbar .tbtn { width: 42px; }
  .tstat.date { display: none; }
}

/* sidebar */
.sidebar {
  grid-area: side; z-index: 20;
  display: flex; flex-direction: column;
  padding: 10px 8px calc(10px + var(--safe-b)) calc(8px + var(--safe-l));
  background: rgba(255, 253, 246, .96);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.nav-sep { height: 1px; background: var(--line); margin: 6px 8px; flex: none; }
.nav-head { font-size: .68em; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 800; padding: 8px 12px 2px; }
.nav-item {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 6px 12px; margin: 1px 0;
  border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer;
  font-weight: 700; color: var(--ink-soft);
}
.nav-item .ic { font-size: 21px; width: 26px; text-align: center; flex: none; line-height: 1; }
.nav-item .lb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nb { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; }
.nav-item .nb.soft { background: var(--lemon); color: #3a2f00; }
.nav-item.on { background: var(--lemon-pale); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(217, 173, 0, .35); }
.nav-item:active { background: var(--cream-2); }
.nav-item.disabled { opacity: .38; pointer-events: none; }
@media (max-width: 1099px) {
  .sidebar { padding-left: calc(6px + var(--safe-l)); padding-right: 6px; }
  .nav-head { display: none; }
  .nav-item { flex-direction: column; gap: 2px; padding: 7px 2px 5px; min-height: 56px; justify-content: center; text-align: center; }
  .nav-item .lb { font-size: 10.5px; font-weight: 700; letter-spacing: -.01em; overflow: visible; }
  .nav-item .nb { position: absolute; top: 3px; right: 8px; height: 18px; min-width: 18px; line-height: 18px; font-size: 11px; padding: 0 4px; }
}

/* main pane */
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.sect-head {
  flex: none; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 12px calc(18px + var(--safe-r)) 10px 18px; min-height: 60px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(var(--cream), rgba(255, 248, 231, .92));
}
.sect-head h1 { font-size: 1.4em; margin: 0; white-space: nowrap; }
.sect-head .sub { color: var(--ink-mute); font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sect-head .grow { flex: 1; min-width: 0; }
.sect-head .acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; flex: none; max-width: 100%; margin-left: auto; }
.content {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 16px calc(18px + var(--safe-r)) calc(28px + var(--safe-b)) 18px;
}
.content.flush { padding: 0; }
@media (max-width: 640px) {
  .sect-head { padding: 10px calc(10px + var(--safe-r)) 8px 12px; }
  .content { padding: 12px calc(10px + var(--safe-r)) calc(24px + var(--safe-b)) 10px; }
}
.content.fill { overflow: hidden; display: flex; flex-direction: column; }
.fade-in { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* stand picker button in the section head */
.stand-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 12px 5px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; max-width: 340px; box-shadow: var(--shadow); text-align: left; }
.stand-btn .sw { width: 28px; height: 28px; border-radius: 9px; flex: none; border: 2px solid rgba(0, 0, 0, .12); }
.stand-btn .t { min-width: 0; line-height: 1.15; }
.stand-btn .t strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand-btn .t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-mute); }
.stand-btn .chev { color: var(--ink-mute); font-size: .9em; flex: none; }
.stand-btn:active { background: var(--cream-2); }

/* ------------------------------------------------------------------ layout helpers */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.no-wrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-auto-s { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.cols > *, .stack > *, .home-grid > *, .city-layout > *, .tile-row > * { min-width: 0; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols.side-r { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1099px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.side-r { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .cols, .cols.even, .cols.side-r { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-auto { grid-template-columns: minmax(0, 1fr); }
}

/* cards */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line-soft); min-width: 0; }
.card.tight { padding: 12px 14px; }
.card.flat { box-shadow: none; }
.card.hi { border: 2px solid var(--lemon); }
.card.soft { background: var(--lemon-wash); border-color: #f5e6a6; box-shadow: none; }
.card > h3, .card-head h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-foot { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 16px 2px 8px; font-size: .82em; font-weight: 800; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec-title small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.sec-title:first-child { margin-top: 0; }

/* stat tiles */
.tile { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-soft); padding: 12px 14px; min-width: 0; }
.tile .l { font-size: .74em; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.tile .v { font-size: 1.7em; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v.neg { color: var(--danger); }
.tile .v.pos { color: var(--ok); }
.tile .s { font-size: .82em; color: var(--ink-soft); }
.tile-row { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.big-number { font-size: 1.8em; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
.big-number.neg { color: var(--danger); }
.big-number.pos { color: var(--ok); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid transparent; border-radius: 999px; padding: 9px 18px; font-weight: 800;
  background: #f1ecdc; color: var(--ink); cursor: pointer; min-height: 44px; line-height: 1.15;
  transition: transform .08s, background .15s, box-shadow .15s, opacity .15s;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .42; transform: none; pointer-events: none; }
.btn.primary { background: var(--lemon); color: #3a2f00; box-shadow: 0 3px 0 var(--lemon-dark); }
.btn.good { background: var(--leaf); color: #fff; box-shadow: 0 3px 0 var(--leaf-dark); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: #f2b8b8; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.plain { background: transparent; border-color: transparent; }
.btn.small { padding: 6px 13px; min-height: 38px; font-size: .9em; }
.btn.big { padding: 13px 26px; min-height: 52px; font-size: 1.08em; }
.btn.icon { padding: 6px; min-width: 44px; }
.btn.block { width: 100%; }
.btn.on, .btn.active { background: var(--lemon-pale); border-color: var(--lemon-dark); }
@media (hover: hover) {
  .btn:hover { filter: brightness(.98); }
  .btn.primary:hover { background: #ffd83a; }
  .nav-item:hover { background: var(--cream-2); }
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.help { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #ece5d1; color: var(--ink-soft); font-size: .78em; font-weight: 900; border: 0; margin-left: 2px; vertical-align: middle; cursor: pointer; flex: none; position: relative; }
.help::after { content: ""; position: absolute; inset: -8px; }
.help:active { background: var(--lemon-pale); }

/* segmented control */
.seg { display: flex; gap: 4px; padding: 4px; background: #efe8d4; border-radius: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; min-height: 38px; padding: 6px 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 800; color: var(--ink-soft); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg button .badge { margin: 0; }
.seg button small { font-weight: 600; color: var(--ink-mute); }
.seg.wide button { flex: 1; }
.seg-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* forms */
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .95em; }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  font: inherit; font-size: max(16px, 1em); padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); min-height: 44px; max-width: 100%;
}
select { padding-right: 30px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a857c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 8px; }
select.small, input.small { min-height: 38px; padding: 5px 28px 5px 10px; font-size: 16px; border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #8fd3ff; outline-offset: 0; }
button:focus-visible { outline: 3px solid #8fd3ff; outline-offset: 2px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #e9e0c7; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; border: 2px solid var(--leaf-dark); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: #e9e0c7; }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--leaf-dark); }
input[type="range"]:disabled { opacity: .45; }

/* iOS-style switch: <label class="switch"><input type="checkbox"> text</label> */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; min-height: 44px; position: relative; }
.switch input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: #e0d8c2; position: relative; margin: 0; cursor: pointer; transition: background .2s; border: 0; }
.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .22); transition: transform .2s; }
.switch input[type="checkbox"]:checked { background: #34c759; }
.switch input[type="checkbox"]:checked::after { transform: translateX(20px); }
.switch input[type="checkbox"]:disabled { opacity: .45; }
.switch input[type="radio"] { width: 24px; height: 24px; accent-color: var(--leaf-dark); flex: none; margin: 0; }
.switch.small { min-height: 36px; font-size: .92em; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; flex: none; }
.stepper button { flex: none; border: 0; background: #f7f2e3; width: 44px; height: 42px; font-size: 1.35em; font-weight: 700; cursor: pointer; line-height: 1; color: var(--ink); }
.stepper button:active { background: #efe5c9; }
.stepper button:disabled { opacity: .35; }
.stepper .val { min-width: 76px; text-align: center; font-weight: 800; padding: 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stepper input.val { width: 62px; min-width: 0; height: 42px; border: 0; border-radius: 0; font: inherit; font-size: 16px; font-weight: 800; background: #fff; color: inherit; text-align: center; padding: 0; min-height: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper input.val::-webkit-outer-spin-button, .stepper input.val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.s button { width: 38px; height: 36px; font-size: 1.2em; }
.stepper.s .val { min-width: 58px; }

/* badges, chips, notes, bars */
.badge { display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 2px 9px; font-size: .76em; font-weight: 800; background: var(--lemon-pale); color: #5a4600; vertical-align: middle; white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.plain { background: #f1ecdc; color: var(--ink-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 5px 11px; background: #f3efe2; font-size: .88em; font-weight: 700; border: 0; white-space: nowrap; }
button.chip { cursor: pointer; min-height: 40px; padding: 6px 14px; font-size: .92em; }
.chip.bad { background: var(--danger-bg); color: var(--danger); }
.chip.good { background: var(--ok-bg); color: var(--ok); }
.chip.active, .chip.on { background: var(--lemon-pale); box-shadow: inset 0 0 0 2px var(--lemon); }
.note { padding: 10px 12px; border-radius: var(--radius-s); background: var(--info-bg); border-left: 4px solid #6fb1f0; margin: 0; font-size: .95em; }
.note + .note { margin-top: 8px; }
.note.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.note.danger { background: var(--danger-bg); border-left-color: var(--danger); }
.note.ok { background: var(--ok-bg); border-left-color: var(--ok); }
.note .btn { margin-top: 6px; }
.bar { height: 10px; border-radius: 5px; background: #f0ead8; overflow: hidden; min-width: 40px; }
.bar > span { display: block; height: 100%; background: var(--leaf); border-radius: 5px; }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }
.bar.info > span { background: #6fb1f0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 52px; gap: 8px; align-items: center; font-size: .93em; }
.bar-row .n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.stars { color: #e0a800; letter-spacing: 1px; white-space: nowrap; }
.empty { color: var(--ink-mute); font-style: italic; margin: 4px 0; }
.dot-ok, .dot-warn, .dot-bad { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--danger); }

/* key-value lists */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content); gap: 5px 14px; align-items: baseline; }
.kv .k { color: var(--ink-soft); }
.kv .v { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv.wrap { grid-template-columns: minmax(40%, 1fr) minmax(0, max-content); }
.kv .v.neg { color: var(--danger); }
.kv .v.pos { color: var(--ok); }
.kv .v.mute { color: var(--ink-mute); font-weight: 600; }
.kv .total { border-top: 2px solid var(--line); padding-top: 5px; margin-top: 3px; font-weight: 900; }

/* lists of rows (the iPad replacement for most wide tables) */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list > li:last-child { border-bottom: 0; }
.rows { display: flex; flex-direction: column; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-height: 56px; }
.rowi:last-child { border-bottom: 0; }
.rowi .ic { font-size: 22px; width: 30px; text-align: center; flex: none; }
.rowi .main { flex: 1; min-width: 0; display: block; }
.rowi .main strong { font-weight: 800; }
.rowi .main small { display: block; }
.rowi .side { flex: none; display: flex; align-items: center; gap: 8px; }
.rowi .amt { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rowi.dim { opacity: .55; }
.rowi.tap { cursor: pointer; }
.rowi.tap:active { background: var(--cream-2); }

/* tables that must stay tables: horizontal scroll inside their card, first column sticky */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
table { border-collapse: collapse; width: 100%; font-size: .93em; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: .8em; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.mute td { color: var(--ink-mute); }
tr.group th { background: var(--cream-2); color: var(--ink); padding-top: 10px; }
table.sticky-first th:first-child, table.sticky-first td:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; }

/* details / folds */
details.fold { border-top: 1px solid var(--line-soft); margin-top: 10px; }
details.fold > summary { cursor: pointer; font-weight: 800; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--ink-mute); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }

/* ------------------------------------------------------------------ overlays */
.backdrop { position: fixed; inset: 0; background: rgba(40, 30, 0, .32); z-index: 60; animation: fade .18s ease-out; }
.sheet-wrap { position: fixed; inset: 0; z-index: 61; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b)); pointer-events: none; }
.sheet {
  pointer-events: auto;
  width: min(680px, 100%); max-height: 100%;
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px; box-shadow: var(--shadow-pop);
  animation: sheet-in .24s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.sheet.wide { width: min(1000px, 100%); }
.sheet.narrow { width: min(520px, 100%); }
.sheet-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line-soft); }
.sheet-head h2 { margin: 0; flex: 1; min-width: 0; font-size: 1.22em; }
.sheet-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #efe8d4; font-size: 18px; font-weight: 800; color: var(--ink-soft); cursor: pointer; position: relative; }
.sheet-x::after { content: ""; position: absolute; inset: -6px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px 22px; }
.sheet-actions { flex: none; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line-soft); background: #fffdf7; }
.sheet-actions .btn { min-width: 110px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@media (orientation: portrait) and (max-width: 900px) {
  .sheet-wrap { align-items: flex-end; padding: calc(40px + var(--safe-t)) 0 0; }
  .sheet, .sheet.wide, .sheet.narrow { width: 100%; max-height: 92%; border-radius: 22px 22px 0 0; }
}

/* flyout panels (the inbox) */
.flyout {
  position: fixed; z-index: 55; top: calc(var(--top-h) + var(--safe-t)); right: 0; bottom: 0;
  width: min(440px, 94vw);
  display: flex; flex-direction: column;
  background: #fffdf6; border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(40, 30, 0, .18);
  animation: fly-in .24s cubic-bezier(.2, .8, .2, 1);
  padding-right: var(--safe-r);
}
.flyout-scrim { position: fixed; z-index: 54; inset: calc(var(--top-h) + var(--safe-t)) 0 0 0; background: rgba(40, 30, 0, .18); animation: fade .18s; }
@keyframes fly-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.flyout-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line-soft); }
.flyout-head h2 { flex: 1; margin: 0; font-size: 1.2em; }
.flyout-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 14px calc(20px + var(--safe-b)); }
.inbox-group { margin-bottom: 14px; }
.inbox-group > h4 { font-size: .74em; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-mute); margin: 4px 4px 6px; display: flex; gap: 6px; align-items: center; }
.inbox-item { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px; padding: 11px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(80, 60, 0, .05); font-size: .94em; position: relative; }
.inbox-item.new::before { content: ""; position: absolute; left: -4px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.inbox-item.act { border-color: var(--lemon); background: var(--lemon-wash); }
.inbox-item.warn { border-left: 4px solid var(--warn); }
.inbox-item.danger { border-left: 4px solid var(--danger); }
.inbox-item.ok { border-left: 4px solid var(--ok); }
.inbox-item .t { font-weight: 800; margin-bottom: 2px; }
.inbox-item .btn-row { margin-top: 8px; }

/* popover menus */
.pop { position: fixed; z-index: 70; min-width: 250px; max-width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); padding: 6px; animation: pop-in .16s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; background: transparent; border-radius: 11px; text-align: left; cursor: pointer; font-weight: 700; }
.pop-item:active, .pop-item.on { background: var(--lemon-pale); }
.pop-item .ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.pop-item .t { flex: 1; min-width: 0; line-height: 1.2; }
.pop-item .t small { display: block; font-weight: 600; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }

/* long-press tip */
.tip { position: fixed; z-index: 90; max-width: min(360px, 90vw); background: #2b2a28; color: #fff; padding: 10px 13px; border-radius: 12px; font-size: .9em; font-weight: 600; line-height: 1.35; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); pointer-events: none; animation: pop-in .12s ease-out; }

/* toasts: top centre, under the bar */
.toasts { position: fixed; top: calc(var(--top-h) + var(--safe-t) + 10px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; pointer-events: none; width: min(560px, 90vw); }
.toast { background: rgba(43, 42, 40, .96); color: #fff; padding: 11px 16px; border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); font-weight: 700; font-size: .95em; animation: toast-in .22s ease-out; pointer-events: auto; }
.toast.error { background: rgba(214, 69, 69, .97); }
.toast.ok { background: rgba(47, 143, 78, .97); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* the tutorial card */
.tut-highlight { outline: 4px solid #ff9f1c !important; outline-offset: 2px; border-radius: 12px; box-shadow: 0 0 0 7px rgba(255, 159, 28, .22); position: relative; z-index: 3; }
.tut-box { position: fixed; z-index: 75; right: calc(18px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); width: min(380px, calc(100vw - 36px)); background: #fff; border: 3px solid #ff9f1c; border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-pop); }
.tut-box .tut-step { font-size: .74em; color: var(--ink-mute); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.tut-box.left { right: auto; left: calc(var(--side-w) + 18px + var(--safe-l)); }

/* ------------------------------------------------------------------ shared game pieces */
.timeline { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.timeline .day { flex: 1 0 86px; background: #fffdf5; border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; line-height: 1.25; }
.timeline .day.today { border-color: var(--lemon); background: var(--lemon-pale); }
.timeline .day .wx { font-size: 1.55em; line-height: 1.2; }
.inv-bar { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.inv-bar .nm { flex: none; width: 104px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-bar .bar { flex: 1; }
.inv-bar .q { flex: none; min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; font-size: .92em; white-space: nowrap; }
.price-history { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 100%; }
.price-history span { flex: 1; background: #d7e9d8; border-radius: 2px 2px 0 0; min-width: 2px; }
.price-history span.last { background: var(--leaf); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .08); cursor: pointer; }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 3px #fff inset; }
.flavor-meter { display: grid; grid-template-columns: 116px 1fr 52px; gap: 10px; align-items: center; margin: 6px 0; }
.flavor-meter .track { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #dbe9ff, #fff3b0, #ffb3a7); position: relative; }
.flavor-meter .track .marker { position: absolute; top: -5px; width: 7px; height: 24px; background: var(--ink); border-radius: 4px; transform: translateX(-50%); }
.flavor-meter .track .zone { position: absolute; top: 3px; height: 8px; background: rgba(92, 170, 95, .55); border-radius: 4px; }
.sat-buckets { display: flex; gap: 4px; align-items: flex-end; height: 56px; }
.sat-buckets div { flex: 1; background: var(--leaf); border-radius: 4px 4px 0 0; min-height: 3px; }
.sat-buckets div.low { background: var(--danger); }
.sat-buckets div.mid { background: var(--warn); }
.pay-faces { display: inline-flex; gap: 8px; align-items: flex-end; }
.pay-face { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; border: 2px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; opacity: .5; transition: opacity .15s, transform .15s; min-height: 44px; justify-content: center; }
.pay-face.on { opacity: 1; border-color: var(--leaf-dark); background: #f4f9ea; }
.pay-face.gone svg { filter: grayscale(1) opacity(.5); }
.pay-face small { font-size: .72em; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.pay-face svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.pay-toggle { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: #efe8d4; }
.pay-toggle button { min-height: 36px; border: 0; border-radius: 9px; padding: 4px 12px; background: transparent; font-weight: 800; color: var(--ink-soft); cursor: pointer; }
.pay-toggle button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* controls laid out as label | control | value */
.control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.control:last-child { border-bottom: 0; }
.control > .name { font-weight: 800; min-width: 0; }
.control > .name small { display: block; font-weight: 500; }
.control > .ctl { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.control > .ctl select { min-width: 150px; }
.control > .note-line { grid-column: 1 / -1; font-size: .86em; color: var(--ink-soft); margin-top: -2px; }

/* the recipe editor's ingredient rows */
.ing-group { padding-top: 6px; margin-top: 6px; }
.ing-group + .ing-group { border-top: 1px dashed var(--line); }
.ing-group-name { font-size: .72em; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); font-weight: 800; margin: 4px 0 2px; }
.ing { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 0; }
.ing .ing-name { min-width: 0; line-height: 1.2; }
.ing .ing-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing .ing-name small { display: block; font-size: .78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing.on .ing-name strong { color: var(--leaf-dark); }
.ing .stepper .val { width: 86px; min-width: 86px; font-size: .9em; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
@media (max-width: 1000px) and (orientation: portrait) { .ing { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; } }
/* very narrow windows (Slide Over): the slider gets its own line under the name and the stepper */
@media (max-width: 480px) {
  .ing { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ing > input[type=range] { grid-column: 1 / -1; grid-row: 2; }
  .rowi .side { max-width: 100%; flex-wrap: wrap; }
  .topbar [data-act="phase-test"] { display: none; }
}

/* the shop's item rows */
.shop-list { display: flex; flex-direction: column; }
.shop-cat { font-size: .74em; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; color: var(--ink-mute); padding: 14px 4px 6px; border-bottom: 1px solid var(--line); position: sticky; top: -17px; background: var(--paper); z-index: 2; }
.shop-item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, .8fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.shop-item.dim { opacity: .5; }
.shop-item .nm strong { font-weight: 800; }
.shop-item .nm small { display: block; line-height: 1.25; }
.shop-item .pr { min-width: 0; }
.shop-item .pr strong { font-variant-numeric: tabular-nums; }
.shop-item .pr small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-item .oh { font-size: .92em; min-width: 0; }
.shop-item .oh small { display: block; }
.shop-item .buy { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 4px 6px; align-items: center; justify-items: end; }
.shop-item .buy .stepper { grid-column: 1; grid-row: 1 / span 2; }
.shop-item .buy .qk { grid-column: 2; grid-row: 1; display: flex; gap: 4px; }
.shop-item .buy .qk .btn { min-height: 34px; padding: 3px 11px; font-size: .82em; }
.shop-item .line { grid-column: 2; grid-row: 2; font-weight: 800; font-size: .88em; font-variant-numeric: tabular-nums; color: var(--leaf-dark); min-height: 1.1em; }
.shop-item .price-history { height: 20px; margin-top: 4px; opacity: .9; }
@media (max-width: 900px) {
  .shop-item { grid-template-columns: minmax(0, 1fr) auto; }
  .shop-item .pr, .shop-item .oh { grid-column: 1; }
  .shop-item .buy { grid-column: 2; grid-row: 1 / span 3; }
}
.dock {
  flex: none; z-index: 6;
  padding: 10px calc(18px + var(--safe-r)) calc(10px + var(--safe-b)) 18px;
  background: rgba(255, 253, 246, .97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(60, 40, 0, .08);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dock[hidden] { display: none; }
.dock .lines { flex: 1; min-width: 220px; font-size: .92em; line-height: 1.3; }

/* equipment cards */
.eq-card { display: flex; flex-direction: column; gap: 6px; }
.eq-card .eq-top { display: flex; align-items: flex-start; gap: 10px; }
.eq-card .eq-top .grow strong { display: block; }
.eq-card .eq-next { background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.eq-card .cond { display: flex; align-items: center; gap: 10px; }
.eq-card .cond .bar { flex: 1; }

/* pitchers */
.pitcher-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.pitcher { width: 52px; text-align: center; font-size: .72em; color: var(--ink-soft); }
.pitcher::before { content: ""; display: block; width: 38px; height: 60px; margin: 0 auto 3px; border: 2px solid #c8b56a; border-radius: 9px; background: linear-gradient(to top, var(--liquid) 0, var(--liquid) 0, rgba(255, 255, 255, .6) 0); }
.pitcher.filled::before { background: linear-gradient(to top, var(--liquid) 0, var(--liquid) 78%, rgba(255, 255, 255, .6) 78%); }
.pitcher.spare::before { border-style: dashed; opacity: .6; }
.pitcher small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* skills */
.skill-levels { margin: 6px 0 0 20px; padding: 0; }
.skill-levels li { margin: 0 0 8px; }
.skill-levels li.later { color: var(--ink-mute); }
.skill-levels li.next { background: var(--lemon-pale); border-radius: 12px; padding: 10px 12px; margin-left: -12px; list-style-position: inside; }
.skill-levels .unlocks { margin: 4px 0 0 16px; padding: 0; }
.skill-levels .needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* achievements */
.ach { display: flex; gap: 12px; align-items: flex-start; }
.ach .ach-icon { font-size: 28px; line-height: 1; flex: none; }
.card.ach-card.done { background: var(--ok-bg); }
.card.ach-card:not(.done) .ach-icon { filter: grayscale(1); opacity: .5; }

/* charts */
.chart-card .chart-box { position: relative; width: 100%; min-width: 0; }
.chart-card canvas { width: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: .82em; line-height: 1.35; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); white-space: nowrap; z-index: 5; }

/* city map */
.city-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1099px) { .city-layout { grid-template-columns: minmax(0, 1fr); } }
.map-wrap { position: relative; background: #eaf4e2; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-marker { cursor: pointer; }
.map-marker .pin-body { transition: transform .15s; transform-origin: 0 0; transform-box: view-box; }
.map-marker.locked .pin-body { fill: #b9b4a8; }
.map-marker.owned .pin-body { fill: var(--leaf); }
.map-marker.available .pin-body { fill: var(--lemon); }
.map-marker.selected .pin-body { stroke: var(--ink); stroke-width: 3; transform: scale(1.12); }
.map-marker.hell .pin-body { fill: #d63a0a; }
.map-marker.hell.owned .pin-body { fill: #ff8a1a; }
.req { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.req .mark { width: 22px; text-align: center; font-weight: 900; flex: none; }
.req.met .mark { color: var(--ok); }
.req.unmet .mark { color: var(--danger); }

/* comments (Sell screen and the report) */
.comment-feed { display: flex; flex-direction: column; gap: 6px; }
.comment { background: #fffdf5; border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font-size: .92em; display: flex; gap: 8px; align-items: center; }
.comment .who { flex: none; display: inline-flex; align-items: center; }
.comment .say { min-width: 0; }
.comment .name { font-weight: 800; }
.comment .reg { color: #c98a00; font-size: .85em; margin-left: 3px; }
.comment .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff8e7; border: 1px solid var(--line); flex: none; }
.comment.bad { border-left: 4px solid var(--danger); }
.comment.good { border-left: 4px solid var(--ok); }
.comment.meh { border-left: 4px solid var(--warn); }

/* ------------------------------------------------------------------ the Sell screen */
.sell {
  height: 100%; display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "tabs tabs" "stage side";
  padding: 12px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
}
.sell-tabs { grid-area: tabs; display: flex; gap: 8px; align-items: center; min-width: 0; }
.sell-tabs .chips { flex: 1; min-width: 0; }
.sell-stage { grid-area: stage; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.scene-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sky); box-shadow: var(--shadow); flex: none; }
.scene-wrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: manipulation; }
.hud { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 5; display: flex; gap: 5px 6px; flex-wrap: wrap; pointer-events: none; }
.hud .pill { pointer-events: none; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: .84em; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); white-space: nowrap; }
.hud .pill.clock { min-width: 6.6em; text-align: center; }
.hud .pill.danger { background: #fdecec; color: var(--danger); }
.hud .pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.hud .pill.good { background: var(--ok-bg); color: var(--ok); }
.ticker { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5; pointer-events: none; display: flex; justify-content: center; }
.ticker span { background: rgba(43, 42, 40, .82); color: #fff; font-weight: 700; font-size: .86em; border-radius: 999px; padding: 5px 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: toast-in .2s ease-out; }
.ticker span.bad { background: rgba(214, 69, 69, .92); }
.ticker span.good { background: rgba(47, 143, 78, .92); }
.stage-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }
.stage-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; flex: none; }
.stage-stats .tile { padding: 8px 12px; box-shadow: none; }
.stage-stats .tile .v { font-size: 1.25em; }
.speed-bar { display: flex; gap: 4px; padding: 4px; background: #efe8d4; border-radius: 16px; }
.speed-bar button { min-width: 54px; height: 46px; border: 0; border-radius: 12px; background: transparent; font-weight: 900; font-size: 1.02em; cursor: pointer; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; }
.speed-bar button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.sell-side { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sell-side .card { padding: 12px; }
.sell-side .scrollpane { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: var(--radius); }
.menu-price { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.menu-price .ic { flex: none; font-size: 20px; }
.menu-price .nm { flex: 1; min-width: 0; line-height: 1.15; }
.menu-price .nm strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-limit { display: block; margin-top: 4px; color: var(--warn-ink); font-weight: 700; }
.menu-price .nm small { color: var(--ink-mute); }
.menu-price + .menu-price { border-top: 1px solid var(--line-soft); }
.stock-mini { width: 100%; font-size: .9em; }
.stock-mini td { padding: 5px 4px; }
.stock-mini th { padding: 3px 4px; }
.stock-mini td.name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.stock-mini tr.low td { color: var(--danger); font-weight: 800; }
.stock-mini tr.warn td { color: var(--warn-ink); }
.lost-tally { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: .92em; }
.sell-log { display: flex; flex-direction: column; gap: 6px; }
.sell-log .ev { font-size: .9em; padding: 7px 10px; border-radius: 10px; background: #fffdf5; border: 1px solid var(--line-soft); }
.sell-log .ev.bad { border-left: 4px solid var(--danger); }
.sell-log .ev.good { border-left: 4px solid var(--ok); }
.sell-log .ev small { color: var(--ink-mute); font-weight: 700; margin-right: 4px; }
@media (max-width: 1099px) { .sell { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (orientation: portrait), (max-width: 900px) {
  .sell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "tabs" "stage" "side"; }
  .sell-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; overflow-y: auto; }
  .sell-side .scrollpane { max-height: none; }
}

/* ------------------------------------------------------------------ the title screen */
.title {
  position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(circle at 20% 0%, #fff9e0 0, transparent 50%), radial-gradient(circle at 90% 100%, #eef7e4 0, transparent 50%), var(--cream);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px;
  padding: calc(18px + var(--safe-t)) calc(22px + var(--safe-r)) calc(18px + var(--safe-b)) calc(22px + var(--safe-l));
}
.title-top { display: flex; align-items: center; gap: 14px; }
.title-top .logo { width: 56px; height: 56px; flex: none; animation: bob 3.2s ease-in-out infinite; }
.title-top h1 { font-size: 2.2em; margin: 0; letter-spacing: -.02em; }
.title-top .tag { color: var(--ink-soft); font-weight: 600; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.title-mid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; min-height: 0; align-items: center; }
.title-hero { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 16px 44px rgba(60, 40, 0, .2); border: 1px solid var(--line-soft); background: var(--sky); align-self: center; }
.title-hero canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.title-slots { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; }
.tslot { background: var(--paper); border-radius: 18px; padding: 14px 14px 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.tslot .sw { width: 44px; height: 44px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--cream-2); }
.tslot .info { flex: 1; min-width: 0; line-height: 1.25; }
.tslot .info strong { display: block; font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tslot .info small { display: block; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tslot .acts { display: flex; gap: 6px; flex: none; }
.tslot.blank { background: rgba(255, 255, 255, .6); border-style: dashed; box-shadow: none; }
.title-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.title-foot p { margin: 0; color: var(--ink-mute); font-size: .88em; }
@media (orientation: portrait), (max-width: 900px) {
  .title { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .title-mid { display: contents; }
  .title-hero { align-self: start; }
}

/* setup sheet */
.setup-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .setup-grid { grid-template-columns: minmax(0, 1fr); } }
.rules-grid { font-size: .88em; }
.rules-grid td, .rules-grid th { padding: 6px; vertical-align: top; }
.rules-grid td.n { white-space: nowrap; }
.rules-grid td:first-child { min-width: 220px; }
.rules-grid input[type="number"] { padding: 4px 6px; min-height: 38px; }
.rules-grid tr.dim { opacity: .55; }

/* the report */
.report-banner { display: flex; flex-direction: column; gap: 8px; }
.report-stand > summary { list-style: none; cursor: pointer; }
.report-stand > summary::-webkit-details-marker { display: none; }
.rs-head { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.rs-head .chev { color: var(--ink-mute); transition: transform .15s; }
.report-stand[open] .rs-head .chev { transform: rotate(90deg); }
.rs-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: .92em; }
.rs-nums span strong { font-variant-numeric: tabular-nums; }
.insights { margin: 6px 0 0 18px; padding: 0; }
.insights li { margin-bottom: 5px; }

/* home */
.home-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.attn { display: flex; flex-direction: column; gap: 8px; }
.attn .a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); font-size: .93em; }
.attn .a.danger { background: var(--danger-bg); }
.attn .a.info { background: var(--info-bg); }
.attn .a.ok { background: var(--ok-bg); }
.attn .a .i { flex: none; font-size: 18px; line-height: 1.3; }
.attn .a .x { flex: 1; min-width: 0; }
.attn .a .go { flex: none; align-self: center; }
@media (max-width: 1099px) and (orientation: portrait) { .attn .a { flex-wrap: wrap; } .attn .a .go { margin-left: 28px; } }
.inbox-peek { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--lemon); background: var(--lemon-wash); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.inbox-peek .ic { font-size: 26px; flex: none; }
.inbox-peek .t { flex: 1; min-width: 0; }
.inbox-peek .t strong { display: block; }
.inbox-peek .go { flex: none; font-weight: 800; color: var(--leaf-dark); }
