:root {
  --ink: #f7eedb;
  --muted: #b9ad9d;
  --gold: #e8b458;
  --gold-2: #ffd58a;
  --teal: #1f7a78;
  --teal-2: #5fc4b8;
  --red: #e0735a;
  --green: #8fcf8a;
  --panel: rgba(22, 20, 28, 0.78);
  --panel-solid: #1c1a22;
  --line: rgba(255, 255, 255, 0.1);
  --serif: "Marcellus", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d1020;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; touch-action: none; }

.eyebrow { display: block; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }
.eyebrow em { font-style: normal; color: var(--muted); margin-left: 6px; }

/* ------------------------------------------------------------ HUD */

.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 18px; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }

.brand, .stats, .clock-card, .card, .queue-panel, .dock {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 14px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--teal), #15403f); color: var(--gold-2); font-size: 20px; }
.brand strong { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0.1em; }
.brand span { display: block; color: var(--muted); font-size: 11px; }

.stats { display: flex; border-radius: 14px; padding: 8px 4px; }
.stat { padding: 0 15px; border-right: 1px solid var(--line); min-width: 78px; }
.stat:last-child { border: 0; }
.stat span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; }
.stat b { display: block; margin-top: 2px; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.stat b.neg { color: var(--red); }

.clock-card { border-radius: 14px; padding: 9px 14px; min-width: 250px; text-align: right; }
.clock-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
.clock-row b { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.clock-row span { color: var(--gold); font-size: 11px; font-weight: 600; }
.clock-card > span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.clock-card .weather { color: var(--teal-2); }

.left-panel { position: fixed; z-index: 9; top: 92px; left: 18px; width: 250px; display: flex; flex-direction: column; gap: 10px; }
.card { border-radius: 14px; padding: 12px 14px; }
.card strong { display: block; margin-top: 6px; font-size: 13px; line-height: 1.35; }
.card small { display: block; margin-top: 4px; color: var(--gold-2); font-size: 11px; }
.news-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.mini-grid span { color: var(--muted); font-size: 10px; }
.mini-grid b { display: block; color: var(--ink); font-family: var(--serif); font-size: 15px; font-weight: 400; }

.queue-panel { position: fixed; z-index: 9; top: 118px; right: 18px; width: 250px; max-height: calc(100vh - 220px); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.queue-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.queue-head b { display: grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: #2a1c0a; font-size: 12px; }
.queue-list { overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.queue-list .empty { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.q-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.04); text-align: left; transition: background 0.15s, border-color 0.15s; }
.q-item:hover { background: rgba(232, 180, 88, 0.12); border-color: rgba(232, 180, 88, 0.45); }
.q-item.serving { opacity: 0.7; }
.q-flag { font-size: 22px; }
.q-main b { display: block; font-size: 12px; }
.q-main span { font-size: 12px; letter-spacing: 1px; }
.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.q-side small { font-size: 10px; color: var(--muted); }
.q-side small.cta { color: var(--gold-2); font-weight: 700; }
.q-pat { display: block; width: 54px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.q-pat i { display: block; height: 100%; background: var(--green); transition: width 0.3s; }
.q-pat i.low { background: var(--red); }

.dock { position: fixed; z-index: 10; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 16px; }
.speed { display: flex; gap: 2px; padding: 3px; margin-right: 4px; border-radius: 11px; background: rgba(0, 0, 0, 0.25); }
.speed button { min-width: 36px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 11px; letter-spacing: -2px; color: var(--muted); }
.speed button.active { background: var(--gold); color: #2a1c0a; }
.dock-btn { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-size: 13px; font-weight: 600; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.dock-btn span { font-size: 17px; }
.dock-btn:hover { background: rgba(232, 180, 88, 0.14); border-color: rgba(232, 180, 88, 0.4); transform: translateY(-1px); }
.dock-btn.icon { padding: 0 11px; }

.banner { position: fixed; z-index: 20; top: 96px; left: 50%; transform: translate(-50%, -16px); max-width: min(620px, calc(100vw - 600px)); min-width: 320px; padding: 14px 20px; border-radius: 14px; background: rgba(20, 18, 26, 0.92); border: 1px solid var(--line); border-top: 3px solid var(--gold); text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.35s, transform 0.35s; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35); }
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner.bad { border-top-color: var(--red); }
.banner.good { border-top-color: var(--teal-2); }
.banner strong { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.banner span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.toasts { position: fixed; z-index: 30; right: 18px; bottom: 80px; width: 300px; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { padding: 10px 13px; border-radius: 11px; background: rgba(20, 18, 26, 0.93); border: 1px solid var(--line); border-left: 3px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); animation: tin 0.25s ease both; transition: opacity 0.3s, transform 0.3s; }
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.info { border-left-color: var(--teal-2); }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast strong { display: block; font-size: 13px; }
.toast span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }

.tooltip { position: fixed; z-index: 40; top: 0; left: 0; padding: 6px 10px; border-radius: 8px; background: rgba(15, 14, 20, 0.92); border: 1px solid var(--line); font-size: 12px; pointer-events: none; opacity: 0; transition: opacity 0.12s; white-space: nowrap; }
.tooltip.show { opacity: 1; }

.paused-badge { position: fixed; z-index: 9; bottom: 78px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 20px; background: rgba(224, 115, 90, 0.9); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; display: none; }
body.paused:not(.welcome) .paused-badge { display: block; }

body.welcome .hud-top, body.welcome .left-panel, body.welcome .queue-panel, body.welcome .dock { opacity: 0; pointer-events: none; }
.hud-top, .left-panel, .queue-panel, .dock { transition: opacity 0.6s; }

/* ------------------------------------------------------------ modals */

.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 14, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-root.open { opacity: 1; pointer-events: auto; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px 30px; border-radius: 20px; background: linear-gradient(160deg, rgba(38, 34, 44, 0.98), rgba(22, 20, 28, 0.98)); border: 1px solid rgba(232, 180, 88, 0.22); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55); animation: pop 0.22s ease both; }
.modal.wide { width: min(980px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-size: 20px; line-height: 1; }
.modal h1, .modal h2 { margin: 8px 0 10px; font-family: var(--serif); font-weight: 400; line-height: 1.08; }
.modal h1 { font-size: clamp(38px, 6vw, 60px); }
.modal h1 em { color: var(--gold); font-style: normal; font-size: 0.6em; }
.modal h2 { font-size: 30px; }
.modal h2 .pos, .pos { color: var(--green); }
.modal h2 .neg, .neg { color: var(--red); }
.modal h4 { margin: 18px 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 760px; }
.hint, .small-note { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; }
.empty { color: var(--muted); font-size: 13px; }
.ok { color: var(--green); font-size: 12px; }
.busy { color: var(--gold-2); font-size: 12px; }

button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #d8913f, var(--gold)); color: #2a1a08; font-weight: 700; letter-spacing: 0.03em; box-shadow: 0 8px 26px rgba(232, 180, 88, 0.22); transition: filter 0.15s, transform 0.15s; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
button.ghost { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-weight: 600; font-size: 13px; transition: background 0.15s, border-color 0.15s; }
button.ghost:hover:not(:disabled) { background: rgba(232, 180, 88, 0.12); border-color: rgba(232, 180, 88, 0.4); }
button.small { padding: 7px 11px; font-size: 12px; }
button.link { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover:not(:disabled) { color: var(--ink); }
.danger { color: #f19a86 !important; }

/* welcome */
.modal.welcome { width: min(820px, 100%); background: radial-gradient(circle at 100% 0%, rgba(232, 180, 88, 0.14), transparent 45%), linear-gradient(160deg, rgba(36, 30, 40, 0.94), rgba(18, 17, 26, 0.95)); }
.welcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.welcome-grid div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.welcome-grid b { display: block; font-size: 14px; }
.welcome-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.controls { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.welcome-actions, .menu-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* serve */
.serve-head { display: flex; gap: 16px; align-items: center; }
.serve-head .flag { font-size: 58px; line-height: 1; }
.serve-head h2 { margin: 4px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 9px; border-radius: 20px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chip b { color: var(--ink); }
.chip.good { color: var(--green); }
.chip.warn { color: var(--gold-2); }
.wants { margin: 16px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.want { padding: 5px 10px; border-radius: 20px; background: rgba(232, 180, 88, 0.14); border: 1px solid rgba(232, 180, 88, 0.45); color: var(--gold-2); font-weight: 600; }
.offer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.offer-grid.one { grid-template-columns: 1fr; }
.offer { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 84px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.offer:hover:not(:disabled) { border-color: rgba(232, 180, 88, 0.55); background: rgba(232, 180, 88, 0.1); transform: translateY(-1px); }
.offer.wanted { border-color: rgba(232, 180, 88, 0.5); }
.offer .want-badge { position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 6px; background: var(--gold); color: #2a1a08; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.o-icon { font-size: 22px; }
.o-label { font-weight: 700; font-size: 13px; }
.o-sub { color: var(--muted); font-size: 11px; }
.offer em { margin-top: 4px; font-style: normal; font-size: 11.5px; font-weight: 600; }
.offer.ok { border-color: rgba(143, 207, 138, 0.6); background: rgba(143, 207, 138, 0.1); opacity: 1; }
.offer.ok em { color: var(--green); }
.offer.fail { border-color: rgba(224, 115, 90, 0.5); background: rgba(224, 115, 90, 0.08); opacity: 0.85; }
.offer.fail em { color: var(--red); }
.offer.na em { color: var(--muted); }
.serve-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

/* market */
.market-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.kpi span { display: block; color: var(--muted); font-size: 11px; }
.kpi b { display: block; margin: 3px 0; font-family: var(--serif); font-size: 26px; font-weight: 400; }
.kpi small { color: var(--muted); font-size: 11px; }
#chart { width: 100%; height: 150px; margin-top: 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.18); }
.legend { display: flex; gap: 16px; margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.l-w { color: #f0a24b; } .l-r { color: var(--teal-2); } .l-p { color: var(--ink); }
.price-box { margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(232, 180, 88, 0.35); background: rgba(232, 180, 88, 0.06); }
.price-row { display: flex; justify-content: space-between; align-items: baseline; }
.price-row label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.price-row strong { font-family: var(--serif); font-size: 30px; font-weight: 400; color: var(--gold-2); }
.price-box input[type="range"] { width: 100%; margin: 10px 0; accent-color: var(--gold); }
.price-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.trade { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.trade h4 { width: 100%; }
.trade button { flex: 1; min-width: 90px; }
.trade small { color: var(--muted); font-weight: 500; }
.news { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(95, 196, 184, 0.08); color: var(--muted); font-size: 12.5px; }

/* fleet */
.fleet-grid, .partner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fleet-card, .partner { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.fleet-top, .p-top { display: flex; align-items: center; gap: 12px; }
.fleet-top > div, .p-top > div { flex: 1; }
.fleet-top strong, .p-top strong { display: block; font-size: 15px; }
.fleet-top small, .p-top small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; line-height: 1.4; }
.big-icon { font-size: 30px; }
.fleet-card ul { list-style: none; margin: 12px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.fleet-card li { display: grid; grid-template-columns: 1fr auto 44px auto auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.15); }
.fleet-card li small { display: block; color: var(--muted); font-size: 10.5px; }
.fleet-card li.due { box-shadow: inset 3px 0 0 #e0604a; }
.fleet-card li:has(em) { grid-template-columns: 1fr; }
.fleet-card .wear { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.fleet-card .wear i { display: block; height: 100%; background: #7fc48a; }
.fleet-card .wear i.warn { background: #e8b64a; }
.fleet-card .wear i.neg { background: #e0604a; }
.fleet-buy { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.cap { color: var(--muted); font-size: 11px; }

/* guides */
.guide-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guide { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), #15403f); color: var(--gold-2); font-weight: 700; }
.g-info strong { display: block; font-size: 14px; }
.g-info small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.g-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.g-side b { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.g-side b small { color: var(--muted); font-size: 11px; }

/* partners */
.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.p-stats span { color: var(--muted); font-size: 10.5px; }
.p-stats b { display: block; color: var(--ink); font-size: 13px; margin-top: 2px; }
.p-foot { display: flex; align-items: center; gap: 8px; }
.p-foot small { color: var(--muted); font-size: 11px; margin-right: auto; }

/* report */
.report-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ledger li { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.ledger li span { color: var(--muted); }
.tomorrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.tomorrow > div { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.tomorrow strong { display: block; margin-top: 5px; font-size: 13px; }
.ad-toggle { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.ad-toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.report-actions .primary { margin-left: auto; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .left-panel { display: none; }
  .stat { min-width: 64px; padding: 0 10px; }
  .banner { max-width: calc(100vw - 320px); }
}

@media (max-width: 860px) {
  .brand, .queue-panel .empty { display: none; }
  .hud-top { padding: 8px; gap: 8px; }
  .stats { flex-wrap: wrap; }
  .stat { min-width: 0; padding: 0 8px; }
  .stat b { font-size: 15px; }
  .clock-card { min-width: 0; padding: 7px 10px; }
  .queue-panel { top: auto; bottom: 76px; right: 8px; width: 190px; max-height: 38vh; }
  .dock { bottom: 8px; left: 8px; right: 8px; transform: none; overflow-x: auto; }
  .dock-btn { font-size: 0; padding: 0 10px; }
  .dock-btn span { font-size: 18px; }
  .banner { top: 120px; max-width: calc(100vw - 20px); min-width: 0; }
  .offer-grid, .market-grid, .tomorrow, .p-stats { grid-template-columns: 1fr 1fr; }
  .fleet-grid, .partner-grid, .guide-list, .report-cols, .welcome-grid, .trade { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px; }
  .toasts { bottom: auto; top: 110px; left: 8px; right: auto; width: min(280px, 60vw); }
}

/* ---------------------------------------------------------------- phone */
.phone-card { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.phone-card:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.phone-head { display: flex; align-items: center; justify-content: space-between; }
.phone-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 11px; }
.phone-badge.zero { background: rgba(255, 255, 255, 0.12); color: var(--muted); }
.phone-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.phone-list .empty { margin: 0; color: var(--muted); font-size: 12px; }
.pmsg { display: grid; grid-template-columns: 22px 1fr; gap: 7px; padding: 7px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border-left: 3px solid var(--teal-2); animation: tin 0.3s ease both; }
.pmsg.good { border-left-color: var(--green); }
.pmsg.bad { border-left-color: var(--red); }
.pmsg .app { font-size: 16px; line-height: 1.2; }
.pmsg strong { display: block; font-size: 11.5px; line-height: 1.3; }
.pmsg p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.pmsg small { display: block; color: rgba(255, 255, 255, 0.4); font-size: 10px; margin-top: 2px; }
.pmsg.unread strong::after { content: " •"; color: var(--gold); }
.pmsg .p-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pmsg .p-done { color: var(--teal-2); font-size: 11px; margin-top: 4px; }
.phone-card .pmsg p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phone-modal .phone-frame { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.phone-modal .p-scores { display: flex; gap: 10px; margin: 8px 0 12px; }
.phone-modal .p-scores span { flex: 1; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-size: 12px; color: var(--muted); }
.phone-modal .p-scores b { display: block; color: var(--gold-2); font-size: 16px; }
.phone-pop { position: fixed; z-index: 31; left: 280px; top: 96px; width: 290px; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.phone-pop .pmsg { background: rgba(20, 18, 26, 0.95); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: opacity 0.35s, transform 0.35s; }
.phone-pop .pmsg.out { opacity: 0; transform: translateX(-16px); }

/* ---------------------------------------------------------------- venues */
.venue-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.venue-filter button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.venue-filter button.on { background: var(--gold); color: #1c1510; border-color: var(--gold); }
.venue-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.venue-table th { text-align: left; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.venue-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.venue-table tr { cursor: pointer; }
.venue-table tr:hover td { background: rgba(255, 255, 255, 0.04); }
.venue-table .own td:first-child { box-shadow: inset 3px 0 0 var(--teal-2); }
.venue-scroll { max-height: 52vh; overflow-y: auto; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.v-grid span { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 11px; }
.v-grid b { display: block; color: #fff; font-size: 15px; margin-top: 2px; }
.v-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 104px; margin-top: 6px; position: relative; background: linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--line) calc(50% - 0.5px), var(--line) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.v-chart .col { position: relative; height: 100%; }
.v-chart .bar { position: absolute; left: 0; right: 0; border-radius: 4px 4px 0 0; background: var(--teal-2); min-height: 2px; }
.v-chart .bar.neg { background: var(--red); border-radius: 0 0 4px 4px; }
.v-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 9.5px; color: var(--muted); text-align: center; margin-top: 3px; }
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.v-offer { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.v-offer input[type=range] { flex: 1; }
.v-offer strong { min-width: 110px; text-align: right; }
.v-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { padding: 6px 12px; background: none; border: 0; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.seg button.on { background: var(--gold); color: #1c1510; }
@media (max-width: 900px) { .phone-pop { left: 12px; top: auto; bottom: 90px; } .v-grid { grid-template-columns: repeat(2, 1fr); } }

.bar-share { display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.bar-share i { display: block; height: 100%; border-radius: 4px; }

/* ---------------------------------------------------------------- loading */
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #2a2340, #0d1020 70%); transition: opacity 0.6s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading-box { width: min(420px, 86vw); text-align: center; }
.loading-box strong { display: block; margin-top: 18px; font-family: var(--serif); font-size: 26px; letter-spacing: 0.14em; }
.loading-box > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.loading-bar { height: 6px; margin: 22px 0 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.loading-bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #d8913f, var(--gold-2)); transition: width 0.25s; }
.loading-box small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.loading-box p { margin: 26px auto 0; max-width: 340px; color: var(--muted); font-size: 12.5px; line-height: 1.55; min-height: 40px; }
.loading-balloon { position: relative; width: 64px; height: 92px; margin: 0 auto; animation: bob 2.4s ease-in-out infinite; }
.loading-balloon i { position: absolute; left: 0; top: 0; width: 64px; height: 70px; border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%; background: repeating-linear-gradient(90deg, #c8452d 0 12px, #f2c14e 12px 22px, #1f7a78 22px 32px); box-shadow: inset -8px -6px 14px rgba(0, 0, 0, 0.25); }
.loading-balloon b { position: absolute; left: 24px; top: 80px; width: 16px; height: 12px; border-radius: 2px; background: #8a5a2b; }
.loading-balloon::after { content: ""; position: absolute; left: 22px; top: 66px; width: 20px; height: 15px; border-left: 1px solid #8a5a2b; border-right: 1px solid #8a5a2b; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------- confirm dialog */
.confirm-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 8, 14, 0.45); animation: fadein 0.15s ease both; }
.confirm-root.out { opacity: 0; transition: opacity 0.15s; }
.confirm { width: min(420px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 16px; background: linear-gradient(160deg, #2c2733, #1c1a22); border: 1px solid rgba(232, 180, 88, 0.3); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop 0.18s ease both; }
.confirm h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 21px; }
.confirm p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
button.primary.danger-btn { background: linear-gradient(135deg, #b8452f, var(--red)); color: #fff; box-shadow: 0 8px 26px rgba(224, 115, 90, 0.25); }
@keyframes fadein { from { opacity: 0; } }

/* ---------------------------------------------------------------- save slots & new game */
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot-card { display: grid; grid-template-columns: 128px 1fr auto; gap: 14px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.slot-card.current { border-color: rgba(95, 196, 184, 0.5); }
.slot-card.empty { opacity: 0.55; }
.slot-thumb { width: 128px; height: 72px; border-radius: 9px; background: linear-gradient(135deg, #2b3a55, #5a4538) center / cover no-repeat; }
.slot-info b { display: block; font-size: 14px; }
.slot-info span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.slot-info small { display: block; color: rgba(255, 255, 255, 0.4); font-size: 11px; margin-top: 3px; }
.slot-info .tag { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(95, 196, 184, 0.18); color: var(--teal-2); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }
.slot-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; padding-right: 6px; }
.diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.diff-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); text-align: left; transition: border-color 0.15s, background 0.15s; }
.diff-card b { font-size: 16px; }
.diff-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.diff-card.on { border-color: var(--gold); background: rgba(232, 180, 88, 0.1); }
.slot-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.slot-pick button { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.04); font-weight: 700; font-size: 13px; }
.slot-pick button small { color: var(--muted); font-weight: 500; font-size: 11px; }
.slot-pick button.on { border-color: var(--gold); background: rgba(232, 180, 88, 0.12); }
.warn-note { color: var(--gold-2) !important; }
.modal.welcome .welcome-actions { margin-top: 18px; }
.modal.welcome h4 { margin-top: 20px; }

/* ---------------------------------------------------------------- settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; margin-bottom: 6px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); cursor: pointer; }
.set-row b { display: block; font-size: 13px; }
.set-row small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.set-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
@media (max-width: 860px) {
  .slot-card { grid-template-columns: 80px 1fr; }
  .slot-thumb { width: 80px; height: 45px; }
  .slot-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .diff-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- dock v2 */
.dock { gap: 4px; padding: 6px; }
.dock-group { display: flex; gap: 3px; padding-left: 5px; margin-left: 1px; border-left: 1px solid var(--line); }
.dock .dock-btn { flex-direction: column; justify-content: center; gap: 1px; height: 48px; min-width: 58px; padding: 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; }
.dock .dock-btn span { font-size: 18px; line-height: 1.1; }
.dock .dock-btn em { font-style: normal; color: var(--muted); white-space: nowrap; }
.dock .dock-btn:hover em { color: var(--ink); }
.dock .dock-btn.icon { min-width: 40px; }
.speed .skip { font-size: 14px; letter-spacing: 0; }
.speed .sound { font-size: 14px; letter-spacing: 0; }
.speed .sound.off { opacity: 0.6; }
body.skipping .speed .skip { background: var(--teal-2); color: #0f2a28; }
body.skipping .speed button[data-speed].active { background: none; color: var(--muted); }

/* ---------------------------------------------------------------- day track */
.day-track { position: relative; height: 18px; margin-top: 7px; border-radius: 9px; background: rgba(255, 255, 255, 0.06); }
.day-track .open { position: absolute; top: 7px; height: 4px; border-radius: 2px; background: rgba(95, 196, 184, 0.28); }
.day-track b { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; line-height: 18px; font-weight: 400; filter: grayscale(0.1); cursor: default; }
.day-track b.done { opacity: 0.35; filter: grayscale(1); }
.day-track .needle { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--gold-2); box-shadow: 0 0 6px rgba(255, 213, 138, 0.8); transition: left 0.25s linear; z-index: 2; }

/* ---------------------------------------------------------------- hover card */
.tooltip.card { white-space: normal; width: 270px; padding: 10px 12px; line-height: 1.45; border-color: rgba(232, 180, 88, 0.3); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }
.tooltip.card b { display: block; font-size: 13px; margin-bottom: 2px; }
.tooltip.card span { display: block; color: var(--muted); font-size: 11.5px; }
.tooltip.card span b { display: inline; font-size: 11.5px; }
.tooltip.card small { display: block; margin-top: 5px; color: var(--gold-2); font-size: 10.5px; font-weight: 700; }
.tooltip.card em { font-style: normal; }
.tip-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tip-bar i { display: block; height: 100%; background: var(--green); }
.tip-bar i.low { background: var(--red); }

/* ---------------------------------------------------------------- charts */
.chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.chart text { fill: rgba(255, 255, 255, 0.45); font-size: 10px; font-family: "DM Sans", sans-serif; }
.chart.bars { max-height: 150px; }
.spark { display: block; margin-top: 6px; }
.donut text { fill: var(--ink); font-size: 14px; font-family: var(--serif); }

/* ---------------------------------------------------------------- office */
.modal h2 .h-sub { display: block; margin-top: 4px; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 12px; letter-spacing: 0.04em; }
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.kpi-tile { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); min-width: 0; }
.kpi-tile span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 0.06em; }
.kpi-tile b { display: block; margin: 2px 0; font-family: var(--serif); font-size: 22px; font-weight: 400; white-space: nowrap; }
.kpi-tile small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.kpi-tile.pos b { color: var(--green); }
.kpi-tile.neg b { color: var(--red); }
.office-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.al { display: grid; grid-template-columns: 22px 1fr 12px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--teal-2); font-size: 12.5px; }
.al p { margin: 0; line-height: 1.4; }
.al i { color: var(--muted); font-style: normal; }
.al[data-open] { cursor: pointer; }
.al[data-open]:hover { background: rgba(232, 180, 88, 0.1); }
.al.bad { border-left-color: var(--red); }
.al.warn { border-left-color: var(--gold); }
.al.good { border-left-color: var(--green); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.timeline li { display: grid; grid-template-columns: 44px 22px 1fr; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; }
.timeline li time { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.timeline li p { margin: 0; }
.timeline li.done { opacity: 0.45; }
.tomorrow-mini { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.tomorrow-mini span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.tomorrow-mini b { display: block; margin: 3px 0; font-size: 14px; }
.tomorrow-mini small { color: var(--muted); font-size: 11.5px; }
.ledger li em { margin-left: auto; margin-right: 10px; font-style: normal; font-size: 11px; opacity: 0.85; }
.modal h2 small.delta { margin-left: 10px; font-family: "DM Sans", sans-serif; font-size: 13px; }

/* ---------------------------------------------------------------- tutorial coach marks */
.coach { position: fixed; z-index: 70; width: 300px; padding: 13px 15px; border-radius: 14px; background: linear-gradient(160deg, #2f2a1f, #221e18); border: 1px solid rgba(232, 180, 88, 0.55); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
.coach.show { opacity: 1; pointer-events: auto; transform: none; }
.coach b { display: block; color: var(--gold-2); font-size: 14px; }
.coach p { margin: 5px 0 0; color: var(--ink); font-size: 12.5px; line-height: 1.5; }
.coach-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.coach::after { content: ""; position: absolute; left: var(--arrow-x, 50%); width: 12px; height: 12px; margin-left: -6px; background: #2c271d; border: 1px solid rgba(232, 180, 88, 0.55); transform: rotate(45deg); }
.coach[data-side="below"]::after { top: -7px; border-right: 0; border-bottom: 0; }
.coach[data-side="above"]::after { bottom: -7px; border-left: 0; border-top: 0; }
.coach-ring { position: fixed; z-index: 69; border-radius: 14px; border: 2px solid var(--gold-2); pointer-events: none; opacity: 0; transition: opacity 0.25s; animation: ring 1.6s ease-in-out infinite; }
.coach-ring.show { opacity: 1; }
@keyframes ring { 50% { box-shadow: 0 0 0 6px rgba(255, 213, 138, 0.18); } }

@media (max-width: 1180px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dock .dock-btn { min-width: 50px; padding: 0 6px; font-size: 9.5px; letter-spacing: 0; }
  .dock { gap: 2px; padding: 5px; }
  .dock-group { gap: 2px; padding-left: 3px; }
}
@media (max-width: 860px) {
  .kpi-row, .office-grid { grid-template-columns: 1fr 1fr; }
  .dock .dock-btn em { display: none; }
  .dock .dock-btn { height: 40px; min-width: 40px; }
  .day-track { display: none; }
}
@media (max-width: 1180px) { .phone-pop { left: 18px; top: 96px; } }
.chart-box { margin-top: 12px; padding: 8px 10px 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.18); }

/* ---------------------------------------------------------------- missions */
.goals-card { cursor: pointer; }
.goal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.mission b { display: block; font-size: 12.5px; line-height: 1.35; }
.mission small { display: block; color: var(--gold-2); font-size: 10.5px; margin-top: 1px; }
.mission .m-bar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mission .m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-2), var(--gold)); }
.mission .m-prog { grid-column: 1 / -1; color: var(--muted) !important; margin: 0 !important; }
.mission .tick { color: var(--green); font-weight: 800; }
.mission.done { opacity: 0.55; border-color: rgba(143, 207, 138, 0.35); }
.mission.locked { opacity: 0.35; }
.mission.compact { padding: 6px 8px; background: rgba(0, 0, 0, 0.15); }
.mission.compact b { font-size: 12px; margin: 0; }
.goals-card .mission.compact small { margin: 0; }
.branches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.branch { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.branch h4 { margin: 8px 0 2px; }
.branch h4 em { font-style: normal; color: var(--gold-2); margin-left: 4px; }
.victory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.victory { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.victory > span { font-size: 22px; }
.victory b { display: block; font-size: 13px; }
.victory small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 2px; }
.victory.won { border-color: var(--gold); background: rgba(232, 180, 88, 0.12); }
.victory em { position: absolute; top: 8px; right: 10px; color: var(--gold-2); font-style: normal; font-weight: 800; }

/* ---------------------------------------------------------------- finance */
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, 0.25); width: fit-content; }
.tabs button { padding: 7px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.tabs button.on { background: var(--gold); color: #2a1c0a; }
.kpi-row.four { grid-template-columns: repeat(4, 1fr); }
.fin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.mix { display: flex; gap: 16px; align-items: center; }
.mix ul { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mix li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mix li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix li b { margin-left: auto; color: var(--ink); font-weight: 600; }
.fin-table td, .fin-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-table small { color: var(--muted); }
.report-cols.two { grid-template-columns: 1fr 1fr; }
.networth { margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px solid rgba(232, 180, 88, 0.35); background: rgba(232, 180, 88, 0.06); }
.networth span { display: block; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; }
.networth b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 400; margin: 2px 0; }
.networth small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.loan-box { margin: 14px 0 6px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(95, 196, 184, 0.35); background: rgba(95, 196, 184, 0.06); }
.loan-box input[type="range"] { width: 100%; margin: 10px 0; accent-color: var(--teal-2); }
.loan-box .seg { margin-bottom: 8px; }
.loan-box .primary { margin-top: 6px; }
.grade { font-family: var(--serif); font-size: 22px !important; }
.grade.gA { color: var(--green) !important; }
.grade.gB { color: var(--teal-2) !important; }
.grade.gC { color: var(--gold-2) !important; }
.grade.gD { color: var(--red) !important; }

/* ---------------------------------------------------------------- milestones */
.modal.celebrate { background: radial-gradient(circle at 50% -10%, rgba(232, 180, 88, 0.22), transparent 55%), linear-gradient(160deg, rgba(38, 34, 44, 0.98), rgba(22, 20, 28, 0.98)); }
.big-icon-hero { font-size: 64px; line-height: 1; margin-bottom: 8px; animation: bob 2.4s ease-in-out infinite; }
.ledger li.me span, .ledger li.me b { color: var(--teal-2); font-weight: 700; }
@media (max-width: 1180px) {
  .branches { grid-template-columns: repeat(3, 1fr); }
  .victory-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .branches, .fin-grid, .report-cols.two, .kpi-row.four { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- serve tabs */
.serve-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 10px; }
.serve-tabs button { padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 12px; font-weight: 700; }
.serve-tabs button:hover { color: var(--ink); border-color: rgba(232, 180, 88, 0.4); }
.serve-tabs button.on { background: var(--gold); color: #2a1c0a; border-color: var(--gold); }
.serve-tabs button b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 4px; border-radius: 9px; background: rgba(0, 0, 0, 0.25); font-size: 10.5px; }
.modal.serve .offer-grid { min-height: 96px; }

/* ---------------------------------------------------------------- staff */
.role-tag { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: 0.04em; }
.s-meters { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.s-meters span { display: flex; align-items: center; gap: 6px; }
.s-bar { display: inline-block; width: 80px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.s-bar i { display: block; height: 100%; background: var(--green); }
.s-bar.xp i { background: var(--teal-2); }
.s-bar.hot i { background: var(--red); }
.s-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.guide.absent { opacity: 0.6; }
.warn-text { color: var(--gold-2) !important; }
.muted-2 { color: rgba(255, 255, 255, 0.45); }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }

/* ---------------------------------------------------------------- products */
.prod-table td { vertical-align: middle; }
.price-ctl { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.price-ctl b { min-width: 52px; text-align: center; }
.price-ctl small { font-size: 10.5px; }
button.step { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.05); font-weight: 800; line-height: 1; }
button.step:hover:not(:disabled) { border-color: var(--gold); }
.offer .want-badge.sug { background: var(--teal-2); color: #0f2a28; }

/* ---------------------------------------------------------------- program card */
.program-card { cursor: pointer; }
.program-list { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.prog-row { display: grid; grid-template-columns: 38px 1fr auto 16px; gap: 6px; align-items: center; font-size: 11.5px; }
.prog-row time { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.prog-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-row i { font-style: normal; text-align: center; }
.program-list small { display: block; margin-top: 5px; color: var(--muted) !important; font-size: 10.5px; }
.program-list .empty { margin: 0; font-size: 11.5px; }
.left-panel { max-height: calc(100vh - 170px); overflow-y: auto; scrollbar-width: none; }
.left-panel::-webkit-scrollbar { display: none; }
.outlook { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.outlook span { display: flex; flex-direction: column; align-items: center; padding: 5px; border-radius: 8px; background: rgba(0, 0, 0, 0.18); text-transform: none; letter-spacing: 0; }
.outlook small { color: var(--muted); font-size: 10px; }
.outlook b { font-size: 15px; margin: 1px 0; }
.tomorrow-mini + .tomorrow-mini { margin-top: 8px; }
.poach { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.poach input { flex: 1; accent-color: var(--gold); }
.poach span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* ---------------------------------------------------------------- marketing */
.review-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.review { padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--teal-2); }
.review.bad { border-left-color: var(--red); }
.review.good { border-left-color: var(--green); }
.rv-head { display: flex; gap: 10px; align-items: baseline; }
.rv-head b { color: var(--gold-2); letter-spacing: 1px; }
.rv-head span { color: var(--muted); font-size: 11px; }
.review p { margin: 4px 0; font-size: 12.5px; line-height: 1.45; }
.rv-actions { display: flex; gap: 6px; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border-radius: 11px; border: 1px dashed rgba(224, 115, 90, 0.5); }
.danger-zone b { display: block; font-size: 13px; }
.danger-zone small { color: var(--muted); font-size: 11.5px; }
.post-grid, .budget-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.budget-row { grid-template-columns: repeat(5, 1fr); margin: 10px 0 6px; }
.post-grid button, .budget-row button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.post-grid small, .budget-row small { color: var(--muted); font-size: 11px; font-weight: 500; }
.budget-row button.on { border-color: var(--gold); background: rgba(232, 180, 88, 0.12); }
.hotel-list { display: flex; flex-direction: column; gap: 6px; }
.hotel-card { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.hotel-card.on { border-color: rgba(143, 207, 138, 0.45); }
.hotel-card b { display: block; font-size: 13px; }
.hotel-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.set-row input[type="range"] { width: 160px; accent-color: var(--gold); flex: none; }

/* ---------------------------------------------------------------- customers */
.chip.persona { color: var(--ink); border-color: rgba(232, 180, 88, 0.4); }
.bargain { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 0; padding: 8px 12px; border-radius: 11px; background: rgba(232, 180, 88, 0.08); border: 1px solid rgba(232, 180, 88, 0.35); font-size: 12.5px; }
.q-item { cursor: pointer; }
.q-item .tea { width: 24px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.06); font-size: 12px; line-height: 1; }
.q-item .tea:hover { border-color: var(--gold); }
.q-side { flex-direction: column; }
.src-mix { font-weight: 500; font-size: 12px; }

/* ---------- risk checklist (finance → tax) */
.risk-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.risk-list > div { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.16); font-size: 12.5px; }
.risk-list > div.ok b { color: #8fd49a; }
.risk-list > div.bad b { color: #f08a72; }
.risk-list small { color: var(--muted); }
@media (max-width: 640px) { .risk-list > div { grid-template-columns: 1fr auto; } .risk-list small { grid-column: 1 / -1; } }
.badge-tag { font-style: normal; font-size: 10.5px; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.badge-tag.ok { color: #8fd49a; }
.badge-tag.bad { color: #f08a72; background: rgba(224, 96, 74, 0.12); }
.badge-tag.busy { color: #e8b64a; }

/* ---------- lost WebGL context */
.gl-lost { position: fixed; inset: 0; z-index: 9000; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; background: rgba(12, 10, 16, 0.86); color: var(--ink); }
.gl-lost p { max-width: 420px; margin: 0; }

/* ================================================================ touch · tablets · phones
   Nothing here changes wide desktop windows: rules apply to touch pointers, to windows up to 1180 px wide
   (tablets: the side panel becomes a drawer) and to short landscape screens up to 500 px tall (phones). */

html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.panel-toggle { display: none; }
.modal.again { animation: none; } /* the same window re-drawn after an action */

/* ---- fingers: no text selection or callouts, no double-tap zoom, bigger controls */
@media (pointer: coarse), (max-height: 500px) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
  button, [role="button"], .card, .q-item, .venue-table tr, .set-row, .al[data-open], .modal { touch-action: manipulation; }
  button.small { min-height: 36px; }
  button.ghost, button.primary { min-height: 40px; }
  button.step { width: 36px; height: 36px; font-size: 15px; }
  .tabs button, .serve-tabs button { min-height: 40px; }
  .seg button, .venue-filter button { min-height: 36px; padding-left: 12px; padding-right: 12px; }
  .set-row > .seg { flex: none; }
  button.link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 6px; }
  .ad-toggle { min-height: 40px; }
  .ad-toggle input { width: 22px; height: 22px; }
  .q-item .tea { width: 36px; height: 34px; font-size: 14px; }
  .speed button { min-width: 40px; height: 40px; }
  .modal-x { width: 40px; height: 40px; }
  .set-row { min-height: 48px; }
  .set-row input[type="checkbox"] { width: 24px; height: 24px; }
  .venue-table td { padding-top: 10px; padding-bottom: 10px; }
  input[type="range"] { min-height: 28px; }
}
@media (hover: none) {
  .dock-btn:hover, button.primary:hover:not(:disabled), .offer:hover:not(:disabled), .phone-card:hover { transform: none; }
}

/* ---- up to 1180 px (and on phones) the left panel is hidden: the 📋 button opens it as a drawer */
@media (max-width: 1180px), (max-height: 500px) {
  .panel-toggle { position: relative; display: grid; place-items: center; flex: none; width: 54px; height: 54px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28); font-size: 21px; }
  .panel-toggle .phone-badge { position: absolute; top: -5px; right: -5px; }
  .panel-toggle .phone-badge.zero { display: none; }
  body.panel-open .panel-toggle { background: rgba(232, 180, 88, 0.22); border-color: var(--gold); }
  body.panel-open .left-panel { display: flex; z-index: 12; }
  body.welcome .panel-toggle { pointer-events: none; }
}
@media (max-width: 860px), (max-height: 500px) {
  .hud-top .stats { margin-right: auto; } /* the button and the stats on the left, the clock on the right */
}
@media (max-width: 860px) {
  .panel-toggle { width: 46px; height: 46px; }
}
/* Tablets: the top bar stays as on desktop; the button floats under the brand and the drawer opens below it. */
@media (min-width: 861px) and (max-width: 1180px) and (min-height: 501px) {
  .panel-toggle { position: fixed; top: 92px; left: 18px; width: 50px; height: 50px; }
  .left-panel { top: 150px; max-height: calc(100vh - 246px); }
  .queue-panel { top: 132px; max-height: calc(100vh - 232px); } /* clear of the clock card, whose weather line is longer in Turkish */
}

/* ---- phones in landscape (and any window up to 500 px tall) */
@media (max-height: 500px) {
  :root {
    --sl: max(8px, env(safe-area-inset-left));
    --sr: max(8px, env(safe-area-inset-right));
    --st: max(6px, env(safe-area-inset-top));
    --sb: max(6px, calc(env(safe-area-inset-bottom) - 8px));
    --mb: max(6px, env(safe-area-inset-bottom));
    --bar-h: 48px; /* top bar */
    --dock-h: 54px;
    --side-w: clamp(216px, 28vw, 250px); /* right column: clock, speed, queue */
    --col-top: calc(var(--st) + var(--bar-h) + 6px);
  }

  /* Opaque glass: a live blur of the 3D view is too costly on phones (and it would trap the fixed speed bar). */
  .brand, .stats, .clock-card, .card, .queue-panel, .dock, .panel-toggle, .dock .speed { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(22, 20, 28, 0.88); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28); }

  /* top bar: drawer button · stats · clock */
  .hud-top { padding: var(--st) var(--sr) 0 var(--sl); gap: 6px; }
  .hud-top .brand { display: none; }
  .panel-toggle { width: 46px; height: var(--bar-h); border-radius: 12px; font-size: 19px; }
  .stats { flex-wrap: nowrap; align-items: center; height: var(--bar-h); padding: 0 3px; border-radius: 12px; min-width: 0; }
  .stat { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0 9px; white-space: nowrap; }
  .stat span { font-size: 0; letter-spacing: 0; } /* labels stay for screen readers; icons show instead */
  .stat span::before { font-size: 14px; }
  .stat:has(#stat-seats) span::before { content: "🎈"; }
  .stat:has(#stat-tickets) span::before { content: "🎟️"; }
  .stat:has(#stat-guides) span::before { content: "🧑‍💼"; }
  .stat b { margin: 0; font-size: 16px; }
  .clock-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; column-gap: 9px; flex: 0 1 auto; width: auto; min-width: var(--side-w); max-width: 300px; height: var(--bar-h); padding: 4px 10px; border-radius: 12px; text-align: left; overflow: hidden; }
  .clock-row { display: contents; }
  .clock-row b { grid-column: 1; grid-row: 1 / span 3; align-self: center; font-size: 23px; line-height: 1; }
  .clock-row span, .clock-card > span { grid-column: 2; margin: 0; font-size: 11px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .day-track { display: none; }

  /* bottom dock: icons only; the speed buttons sit under the clock */
  .dock { left: 0; right: 0; bottom: var(--sb); width: fit-content; max-width: calc(100vw - var(--sl) - var(--sr)); margin: 0 auto; transform: none; overflow: visible; gap: 2px; padding: 4px; border-radius: 14px; }
  .dock .dock-btn { width: 44px; min-width: 44px; height: 44px; padding: 0; font-size: 0; }
  .dock .dock-btn em { display: none; }
  .dock .dock-btn span { font-size: 20px; }
  .dock-group { gap: 2px; padding-left: 3px; margin-left: 1px; }
  .dock .speed + .dock-group { padding-left: 0; margin-left: 0; border-left: 0; }
  .dock .speed { position: fixed; top: var(--col-top); right: var(--sr); width: var(--side-w); margin: 0; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 12px; }
  .speed button { flex: 1; min-width: 0; height: 40px; }

  /* kiosk queue: right column under the speed buttons; tap the header to fold it */
  .queue-panel { top: calc(var(--col-top) + 54px); right: var(--sr); bottom: auto; width: var(--side-w); padding: 8px; border-radius: 12px;
    max-height: calc(100vh - var(--col-top) - 54px - var(--dock-h) - var(--sb) - 10px);
    max-height: calc(100dvh - var(--col-top) - 54px - var(--dock-h) - var(--sb) - 10px); }
  .queue-head { min-height: 26px; margin-bottom: 6px; cursor: pointer; }
  .queue-head .eyebrow { font-size: 11px; letter-spacing: 0.12em; }
  .queue-head .eyebrow::after { content: " ▾"; color: var(--muted); }
  body.queue-min .queue-head .eyebrow::after { content: " ▸"; }
  body.queue-min .queue-head { margin-bottom: 0; }
  body.queue-min .queue-list { display: none; }
  .queue-list { overscroll-behavior: contain; }
  .q-item { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 6px; min-height: 46px; padding: 5px 7px; }
  .q-flag { font-size: 20px; }
  .q-side { flex-direction: row; align-items: center; }
  .q-side small { display: none; }
  .q-pat { width: 34px; }

  /* the left panel slides in as a drawer */
  .left-panel { display: flex; top: var(--col-top); left: var(--sl); bottom: var(--sb); width: min(290px, 46vw); max-height: none; gap: 8px; z-index: 12; overscroll-behavior: contain;
    transform: translateX(calc(-100% - var(--sl) - 16px)); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s, opacity 0.6s; }
  body.panel-open .left-panel { transform: none; visibility: visible; transition: transform 0.22s ease, opacity 0.6s; }
  .left-panel .card { padding: 10px 12px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.14em; }
  .mini-grid span, .p-stats span { font-size: 11px; }
  .prog-row, .program-list small, .program-list .empty, .mission small, .phone-list .empty { font-size: 11px !important; }
  .pmsg small { font-size: 11px; }

  /* messages over the map */
  .paused-badge { bottom: calc(var(--sb) + var(--dock-h) + 8px); font-size: 11px; }
  body.touch .paused-badge { cursor: pointer; padding: 9px 14px; }
  .banner { top: calc(var(--col-top) + 4px); left: calc((var(--sl) + 52px + 100vw - var(--sr) - var(--side-w) - 8px) / 2); min-width: 0; width: max-content; max-width: min(460px, calc(100vw - var(--sl) - var(--sr) - var(--side-w) - 70px)); padding: 9px 14px; }
  .banner strong { font-size: 16px; }
  .banner span { font-size: 11.5px; line-height: 1.4; }
  /* One column of short-lived messages on the left: the newest phone message at the top (under the event
     banner when one is up), at most two toasts at the bottom; both kept to two lines so they never meet. */
  .toasts { top: auto; right: auto; left: var(--sl); bottom: calc(var(--sb) + var(--dock-h) + 8px); width: min(300px, 44vw); gap: 6px; z-index: 60; }
  .toast:nth-child(n + 3), body:has(.banner.show) .toast:nth-child(n + 2) { display: none; }
  body.paused:not(.welcome) .toasts { bottom: calc(var(--sb) + var(--dock-h) + 44px); } /* above the "paused" badge */
  .toast { padding: 7px 11px; }
  .toast strong { font-size: 12.5px; }
  .toast span, .phone-pop .pmsg p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; }
  .phone-pop { left: var(--sl); top: var(--col-top); bottom: auto; width: min(300px, 44vw); }
  .phone-pop .pmsg:not(:last-child), .phone-pop .pmsg small { display: none; } /* only the newest */
  body:has(.banner.show) .phone-pop { top: calc(var(--col-top) + 84px); } /* below the event banner */
  .tooltip.card { width: min(270px, 62vw); }
  .tooltip.card small, .tooltip.card span { font-size: 11px; }

  /* windows: sheets that use the whole height and scroll inside */
  .modal-root { padding: var(--st) var(--sr) var(--mb) var(--sl); }
  .modal { max-height: calc(100vh - var(--st) - var(--mb)); max-height: calc(100dvh - var(--st) - var(--mb)); padding: 12px 16px 16px; border-radius: 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal.wide, .modal.welcome { width: 100%; }
  /* Full-height sheets. The close button is placed against the screen (the sheet is not its containing block,
     so it does not scroll away) in a gutter of its own, where it never covers a control. */
  .modal-root { place-items: stretch center; }
  .modal { position: static; animation-name: fadein; }
  .modal:not(.wide):not(.welcome) { align-self: start; } /* short windows (menu, settings…) hang from the top */
  .modal:has(> .modal-x) { padding-right: 56px; }
  .modal-x { top: calc(var(--st) + 6px); right: max(calc(var(--sr) + 6px), calc(50vw - 274px)); z-index: 3; background: #2d2934; }
  .modal.wide > .modal-x, .modal.welcome > .modal-x { right: calc(var(--sr) + 6px); }
  .modal h1 { font-size: 32px; margin: 4px 0 6px; }
  .modal h2 { font-size: 22px; margin: 4px 0 8px; }
  .modal h4 { margin: 12px 0 6px; font-size: 11px; }
  .modal h2 .h-sub { font-size: 11.5px; }
  .lead { margin-bottom: 10px; font-size: 12.5px; line-height: 1.5; }
  .hint, .small-note, .cap, .kpi small, .kpi span, .kpi-tile span, .kpi-tile small, .o-sub, .fleet-card li small, .p-foot small, .v-months, .tomorrow-mini span, .outlook small, .chip, .role-tag, .badge-tag, .slot-info .tag, .s-meters, .victory small, .mission small, .post-grid small, .budget-row small, .hotel-card small, .rv-head span, .offer .want-badge, .serve-tabs button b, .v-grid span, .venue-table th, .stars, .chart text, .venue-table small, .trade small, .risk-list small, .networth span, .muted-2 { font-size: 11px; }
  .chart.lines { max-height: 160px; }
  .chart-box { margin-top: 8px; }
  .kpi b { font-size: 22px; }
  .kpi-tile b { font-size: 19px; }
  .networth b, .price-row strong { font-size: 24px; }
  .big-icon-hero { font-size: 44px; }

  /* serving a customer: compact head, one scrolling row of category tabs, the "see them off" bar stays in view */
  .serve-head { gap: 12px; }
  .serve-head .flag { font-size: 42px; }
  .serve-head h2 { margin: 2px 0 6px; }
  .chip { padding: 3px 8px; }
  .modal.serve .wants { display: none; } /* the same list is the "★ Wanted" tab, which opens first */
  .bargain { margin-top: 8px; padding: 5px 10px; }
  .serve-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 8px; padding: 0 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .serve-tabs::-webkit-scrollbar { display: none; }
  .serve-tabs button { flex: none; white-space: nowrap; }
  .modal.serve .offer-grid { min-height: 0; flex: none; }
  .modal.serve { display: flex; flex-direction: column; }
  .modal.serve > * { flex: none; }
  .modal.serve > .hint { order: 5; margin-top: 12px; } /* the general advice goes under the offers */
  .modal.serve > .serve-foot { order: 6; }
  .serve-foot, .report-actions { position: sticky; bottom: -16px; z-index: 2; /* sticks to the padding edge */ margin: 12px -16px -16px; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: rgba(27, 24, 33, 0.97); }

  /* grids: a landscape phone is as wide as a small laptop window, so keep several columns */
  .offer-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .offer { min-height: 76px; padding: 9px 10px; }
  .market-grid, .tomorrow, .p-stats, .kpi-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .kpi-tile { padding: 8px 10px; }
  .office-grid, .fin-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
  .welcome-grid, .trade, .report-cols.two, .victory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fleet-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 8px; } /* one column on the smallest phones */
  .partner-grid, .guide-list { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
  .branches, .diff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .report-cols { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
  .ledger li { gap: 8px; }
  .ledger li b { white-space: nowrap; }
  .v-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .fleet-card, .partner { padding: 10px; }
  .welcome-grid { margin: 10px 0; }
  .welcome-grid div { padding: 9px 11px; }
  .welcome-grid span { font-size: 11.5px; }
  .modal.welcome .welcome-actions, .modal.welcome .menu-actions { position: sticky; bottom: -16px; z-index: 2; margin: 12px -16px -16px; padding: 14px 16px 12px; background: linear-gradient(to bottom, rgba(24, 21, 30, 0), rgba(24, 21, 30, 0.98) 12px); }
  .controls { margin: 10px 0 0; }
  .slot-card { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; }
  .slot-thumb { width: 96px; height: 54px; }
  .slot-actions { grid-column: auto; flex-direction: column; }

  /* tables scroll sideways inside their box; the window scrolls up and down */
  .venue-scroll, .review-list, .phone-modal .phone-frame { max-height: none; }
  .venue-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
  .modal table.venue-table { display: block; overflow-x: auto; overscroll-behavior-x: contain; }
  .modal .venue-scroll > table.venue-table { display: table; overflow: visible; }
  .venue-table td, .venue-table th { white-space: nowrap; }
  .venue-scroll .venue-table td:first-child, .venue-scroll .venue-table th:first-child { position: sticky; left: 0; z-index: 1; background: #211e27; } /* the name stays while the numbers scroll */

  /* loading screen */
  .loading-box strong { margin-top: 10px; font-size: 22px; }
  .loading-bar { margin: 14px 0 6px; }
  .loading-box p { margin-top: 14px; min-height: 0; }
  .loading-balloon { zoom: 0.8; }
}

/* ---------------------------------------------------------------- shop: emeralds and premium venue licences */
.dock-btn.hidden { display: none; }
.emerald { color: #6fe3b4; font-style: normal; }
.venue-table tr.premium td:first-child b::after { content: " 💎"; font-size: 10px; }
.shop-earn { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 4px 0 6px; }
.shop-earn span { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(111, 227, 180, 0.07); border: 1px solid rgba(111, 227, 180, 0.18); color: var(--muted); font-size: 12px; line-height: 1.4; }
.shop-earn i { font-style: normal; font-size: 15px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.shop-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.shop-card.has { border-color: rgba(111, 227, 180, 0.45); }
.shop-card.own { border-color: rgba(95, 196, 184, 0.5); background: rgba(95, 196, 184, 0.06); }
.shop-card-head { display: flex; gap: 10px; align-items: flex-start; }
.shop-icon { font-size: 26px; line-height: 1; flex: none; }
.shop-card-head b { display: block; font-size: 14px; }
.shop-card-head small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
.shop-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 11.5px; }
.shop-card-meta b { color: #fff; }
.shop-status { font-style: normal; font-weight: 700; }
.shop-status.own { color: var(--teal-2); }
.shop-status.has { color: #6fe3b4; }
.shop-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.shop-card-actions:empty { display: none; }
.shop-bundle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(232, 180, 88, 0.4); background: linear-gradient(135deg, rgba(232, 180, 88, 0.12), rgba(111, 227, 180, 0.06)); }
.shop-bundle b { display: block; font-size: 14px; }
.shop-bundle small { display: block; color: var(--muted); font-size: 11.5px; }
.shop-bundle button { margin-left: auto; }
.shop-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.shop-foot small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.shop-foot a { color: var(--teal-2); }
.shop-log { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.shop-log b { color: #6fe3b4; }
@media (max-width: 700px) { .shop-earn { grid-template-columns: 1fr; } .shop-grid { grid-template-columns: 1fr; } }

/* 10-language picker (2026-09-30): the segmented control wraps onto more rows */
.seg.seg-wrap { flex-wrap: wrap; justify-content: flex-end; border-radius: 14px; max-width: 460px; }
.set-row > .seg.seg-wrap { flex: 1 1 260px; }

/* Hybrid touch layout: labelled, scrollable navigation rather than shrunken icons. */
@media (pointer: coarse), (max-height: 500px), (max-width: 700px) {
  button, button.small, button.link, button.ghost, button.primary, button.step,
  .tabs button, .serve-tabs button, .seg button, .venue-filter button, .modal-x,
  .q-item .tea, .speed button, .panel-toggle {
    min-width: 48px; min-height: 48px; touch-action: manipulation;
  }
  button.step, .modal-x, .q-item .tea { width: 48px; height: 48px; }
  select, input:not([type='checkbox']):not([type='radio']) { min-height: 48px; font-size: 16px; }
  .queue-head { min-height: 48px; }
  .dock { max-width: calc(100vw - var(--sl, 8px) - var(--sr, 8px)); overflow-x: auto; overscroll-behavior-x: contain; gap: 6px; padding: 6px; scrollbar-width: thin; }
  .dock-group { flex-shrink: 0; gap: 6px; }
  .dock .dock-btn { flex: 0 0 auto; width: 88px; min-width: 88px; height: 62px; padding: 4px 6px; font-size: 12px; gap: 3px; }
  .dock .dock-btn em { display: block; white-space: normal; line-height: 1.1; font-size: 11px; overflow-wrap: anywhere; }
  .dock .dock-btn span { font-size: 22px; }
  .dock .dock-btn.icon { width: 48px; min-width: 48px; }
  .dock .speed { flex-shrink: 0; }
  .dock .speed button { flex-shrink: 0; min-width: 48px; height: 48px; }
  .modal .tabs, .serve-tabs { overflow-x: auto; }
  .modal .tabs button, .serve-tabs button { flex-shrink: 0; }
  .ob-card button, .ob-bubble button, #service-qa button, #service-qa summary { min-height: 48px; }
  #service-qa { max-height: 55dvh !important; }
}
@media (max-height: 500px) {
  :root { --dock-h: 80px; }
  .dock .speed { width: 310px; }
  .queue-panel { top: calc(var(--col-top) + 62px); max-height: calc(100dvh - var(--col-top) - 62px - var(--dock-h) - var(--sb) - 10px); }
}
/* QA controls must not obscure a player's lesson. */
body:has(.ob-cards.open) #service-qa { display: none; }

.companion { margin: 14px 0; padding: 16px; border: 1px solid #e8b45866; border-radius: 16px; background: #e8b4580a; }
.companion p { line-height: 1.5; overflow-wrap: anywhere; }
.companion li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.companion button { min-height: 48px; padding: 10px 16px; white-space: normal; }

/* Keep QA controls reachable without covering the centre of a phone sheet. */
#service-qa:not([open]) { top: auto !important; left: auto !important; right: 8px; bottom: 8px; transform: none !important; padding: 0 !important; }
#service-qa:not([open]) > summary { font-size: 0; min-width: 48px; min-height: 48px; display: grid; place-items: center; }
#service-qa:not([open]) > summary::after { content: "QA"; font: 12px system-ui; }
body:has(#modal-root.open) > #banner { visibility: hidden; }
