/* FIKA — Nordic minimal, soft depth */

:root {
  --paper: #f7edd2;        /* butter-cream app background */
  --paper-2: #f1e2bd;
  --card: #fdf8ec;         /* raised surfaces */
  --linen: #f0e4c8;
  --ink: #4a3f33;
  --ink-soft: #9a8a6e;
  --walnut: #a9845a;
  --walnut-soft: #c9a36a;
  --clay: #d9876a;         /* accent */
  --clay-deep: #c4714f;
  --sage: #9eb585;
  --sage-deep: #86996f;
  --bad: #cf7a62;
  --gold: #e9c178;
  --edge: rgba(138, 112, 90, 0.45);
  --shadow-soft: 0 8px 18px rgba(107, 84, 60, 0.13), 0 2px 4px rgba(107, 84, 60, 0.08);
  --shadow-lift: 0 14px 30px rgba(107, 84, 60, 0.18), 0 3px 7px rgba(107, 84, 60, 0.10);
  --shadow-inset: inset 0 2px 5px rgba(107, 84, 60, 0.16);
  --serif: "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --sans: "Baloo 2", ui-rounded, -apple-system, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  background: var(--paper-2);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.5) 0 2.5px, transparent 3px),
    radial-gradient(circle at 72% 64%, rgba(255,255,255,0.45) 0 2px, transparent 2.5px),
    radial-gradient(120% 70% at 50% -10%, #faf1d9 0%, var(--paper) 55%, #efdfb6 100%);
  background-size: 90px 90px, 70px 70px, 100% 100%;
  max-width: 540px;
  margin: 0 auto;
  overflow: hidden;
}

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s;
  padding-top: env(safe-area-inset-top);
}
.screen.active { display: flex; opacity: 1; }

.hidden { display: none !important; }
.dim { opacity: 0.45; }

/* ---------- title ---------- */

.title-inner, .intro-inner {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  width: 100%;
}
#title-logo { width: min(52vw, 210px); }
.logo-svg { width: 100%; height: auto; }

.title-inner h1 {
  font-family: var(--serif);
  font-weight: 800;
  color: var(--ink);
  font-size: clamp(48px, 15vw, 74px);
  line-height: 0.95;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(138, 112, 90, 0.25);
}
.tagline {
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

/* ---------- day intro ---------- */

.intro-sun { color: var(--clay); font-size: 13px; letter-spacing: 6px; }
.ribbon {
  font-family: var(--serif);
  font-weight: 800;
  color: var(--ink);
  font-size: clamp(38px, 11vw, 54px);
  padding: 6px 0 10px;
  position: relative;
}
.ribbon::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 56px; height: 3px;
  border-radius: 2px;
  background: var(--clay);
}
.ribbon-wrap { display: flex; justify-content: center; margin: 2px 0 16px; }
.panel-inner .ribbon { font-size: 30px; }

#intro-info {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}
.intro-new {
  display: inline-block;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  border-radius: 999px;
  padding: 8px 18px;
  margin-top: 8px;
  box-shadow: var(--shadow-soft);
}
.intro-new::before { content: 'new — '; color: var(--clay); text-transform: uppercase; font-size: 10px; letter-spacing: 2px; }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--edge);
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-soft), inset 0 2px 0 rgba(255,255,255,0.85), inset 0 -3px 0 rgba(138,112,90,0.14);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}
.btn:active, .btn.pressed { transform: translateY(1.5px); box-shadow: 0 4px 10px rgba(62,50,38,0.10); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-big { font-size: 16px; padding: 16px 38px; min-width: 220px; }
.btn-wide { width: 100%; }
.btn-primary {
  background: linear-gradient(to bottom, #e29879, var(--clay-deep));
  color: #fdf6ef;
  text-shadow: 0 1.5px 0 rgba(138,80,55,0.4);
  box-shadow: var(--shadow-soft), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(138,80,55,0.3);
}
.btn-secondary { background: linear-gradient(to bottom, #a3b69b, var(--sage-deep)); color: #f6f8f4; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.btn-warn { background: linear-gradient(to bottom, #e3c68f, #cfa861); color: #4a3c25; }
.btn-serve { background: linear-gradient(to bottom, #a3b69b, var(--sage-deep)); color: #f6f8f4; font-size: 17px; letter-spacing: 1px; }
.btn-confirm {
  background: linear-gradient(to bottom, #a7bb9d, var(--sage-deep));
  color: #f6f8f4;
  font-size: 17px; letter-spacing: 0.5px;
  text-shadow: 0 1.5px 0 rgba(70,100,70,0.35);
  box-shadow: var(--shadow-soft), inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -3px 0 rgba(80,110,80,0.3);
  animation: throb 0.9s infinite alternate;
}
.btn-drop {
  background: linear-gradient(to bottom, #d28a67, var(--clay-deep));
  color: #fbf7f2;
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 17px 60px;
  width: 100%;
  animation: throb 0.8s infinite alternate;
}
@keyframes throb { from { transform: scale(1); } to { transform: scale(1.03); } }

.icon-btn {
  width: 42px; height: 42px;
  border: 2px solid var(--edge);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
}
.icon-btn .icon-svg { width: 22px; height: 22px; }
.icon-svg { width: 100%; height: 100%; display: block; }

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

#hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  z-index: 5;
}
.hud-chip {
  background: var(--card);
  border: 2px solid var(--edge);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}
.hud-chip.money { color: var(--sage-deep); }
.hud-clockbox { flex: 1; text-align: center; color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.hud-clocktrack {
  height: 4px; border-radius: 2px;
  background: var(--linen);
  overflow: hidden; margin-top: 3px;
  box-shadow: var(--shadow-inset);
}
#hud-clockfill {
  height: 100%; width: 100%;
  background: var(--clay);
  transform-origin: left;
  transform: scaleX(0);
}
.hud-holds { display: flex; gap: 5px; }
.hold-slot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--linen);
  box-shadow: var(--shadow-inset);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.hold-slot .icon-svg { width: 15px; height: 15px; opacity: 0.4; }
.hold-slot.full { background: var(--clay); color: #fbf7f2; box-shadow: var(--shadow-soft); }
.hold-slot.full .icon-svg { opacity: 1; }

/* ---------- station panels ---------- */

#station-panels {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.station-panel {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.station-panel.active { display: flex; }

/* floating header chips over the full-bleed scene */
.station-head { position: relative; z-index: 7; padding: 12px 16px 0; pointer-events: none; }
.station-head h2 {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.2px;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(255, 250, 240, 0.95), 0 1px 2px rgba(255, 250, 240, 0.9);
}
.station-head .hint {
  display: block;
  width: fit-content;
  max-width: 94%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 3px;
  text-shadow: 0 1px 6px rgba(255, 250, 240, 0.95);
  min-height: 0;
}
.station-head .note { color: var(--clay-deep); }

/* floating control dock over the counter */
.station-controls {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  margin-top: auto;
  padding: 10px 14px 12px;
}
#panel-build .station-controls { margin-top: 0; }
.control-note {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-shadow: 0 1px 6px rgba(255, 250, 240, 0.9);
  padding: 4px 12px;
  margin: 0 auto;
}

/* ---------- illustrated scenes ---------- */

.scene-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f7e8c3;
}
.scene-wrap .scene-svg, .scene-host, .scene-overlays { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-host .scene-svg { position: absolute; inset: 0; }
.scene-front-svg { pointer-events: none; z-index: 3; }
.scene-overlays { z-index: 5; }
.scene-wrap.dim .scene-svg, .scene-host.dim { opacity: 0.5; }
.scene-actors {
  position: absolute; left: 2%; right: 2%; bottom: 24%;
  display: flex; justify-content: center; align-items: flex-end; gap: 3%;
  z-index: 2;
}
/* one guest at a time — make them a clear, bigger focal point */
.scene-actors .cust-slot { width: 46%; max-width: 184px; }
.bubble-layer {
  position: absolute; left: 10px; right: 10px; top: 86px;
  z-index: 8;
  pointer-events: none;
}
.bubble-layer .speech-bubble { pointer-events: auto; margin: 0; }
/* ---------- 3D counter overlays (order station) ---------- */
.order-3d { background: transparent; pointer-events: none; }
.station-head.floaty { pointer-events: none; }
.greet-prompt {
  position: absolute; left: 0; right: 0; bottom: 20px;
  display: flex; justify-content: center; z-index: 8;
  pointer-events: none;
}
.greet-prompt .queue-empty, .greet-btn { pointer-events: auto; }
.greet-btn {
  font-family: var(--sans);
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(180deg, #e0936f, var(--clay-deep));
  border: none; border-radius: 999px;
  padding: 13px 26px;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  animation: gentle-throb 1.8s ease-in-out infinite;
}
@keyframes gentle-throb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.order-3d .bubble-layer { top: auto; bottom: 16px; }

/* bean picker inside the order bubble */
.bean-pick { margin: 8px 0 4px; text-align: left; }
.bean-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); }
.bean-row { display: flex; gap: 6px; margin-top: 6px; }
.bean-chip {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 7px 8px; border-radius: 12px;
  border: 2px solid var(--edge); background: var(--card);
  font-family: var(--sans); text-align: left; cursor: pointer;
}
.bean-chip.on { border-color: var(--sage-deep); background: rgba(158, 181, 133, 0.18); box-shadow: var(--shadow-soft); }
.bean-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: var(--shadow-inset); }
.bean-name { font-size: 12px; font-weight: 800; color: var(--ink); }
.bean-pref { color: var(--clay); }
.bean-notes { font-size: 9px; color: var(--ink-soft); line-height: 1.15; }

#roast-crackles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#roast-zones { position: absolute; inset: 0; z-index: 5; }
.scene-overlays { padding-top: 84px; }

/* milk-bar cup that fills as you steam & pour */
.cup-overlay {
  position: absolute; left: 40%; top: 33%;
  width: 28%; max-width: 140px;
  z-index: 6; pointer-events: none;
}
.cup-overlay.hidden { display: none; }
.latte-cup-svg { width: 100%; height: auto; display: block;
  filter: drop-shadow(0 6px 10px rgba(62,50,38,0.18)); }

.scene-zone {
  position: absolute;
  background: transparent;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.scene-zone:active { background: rgba(201, 127, 93, 0.10); }
.full-zone { inset: 0; width: 100%; height: 100%; border-radius: 0; touch-action: none; }

/* draggable equipment */
.drag-el {
  position: absolute;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 6px 8px rgba(62, 50, 38, 0.18));
  transition: transform 0.12s;
}
.drag-el.grabbed { cursor: grabbing; transform: scale(1.06); }
.drag-el .drag-svg { width: 100%; height: auto; display: block; pointer-events: none; }
.kettle-el.tilt { transform: rotate(-16deg) scale(1.06); }

.dock-zone {
  position: absolute;
  border: 2.5px dashed rgba(110, 86, 68, 0.45);
  border-radius: 16px;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  font-size: 11px; font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  touch-action: none;
}
.dock-zone.hot { border-color: var(--clay); background: rgba(201, 127, 93, 0.12); color: var(--clay-deep); }
.press-zone { background: rgba(201, 127, 93, 0.10); }

.pour-stream {
  position: absolute;
  width: 4px; height: 13%;
  border-radius: 2px;
  background: #aed0de;
  opacity: 0.85;
  pointer-events: none;
  z-index: 4;
}

/* pour-over digital scale readout (grams → target) */
.scale-readout {
  position: absolute; left: 50%; top: 60%;
  transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  background: #33403a; color: #bfe4bd;
  font-family: var(--serif); font-weight: 800;
  font-size: 16px; letter-spacing: 0.4px;
  padding: 4px 14px; border-radius: 10px;
  border: 2px solid #2a342f;
  box-shadow: var(--shadow-soft), inset 0 1px 3px rgba(0,0,0,0.45);
  white-space: nowrap;
}
.scale-readout b { font-size: 21px; color: #eaffe6; }
.scale-tgt { font-size: 12px; opacity: 0.72; font-weight: 600; margin-left: 2px; }
.scale-readout.on {
  background: #2f6b3a; color: #eaffe6;
  border-color: #3f9e46;
  box-shadow: 0 0 0 2px rgba(116, 196, 110, 0.5), var(--shadow-soft);
}

/* brew bar: pick an order, then pick a method */
.brew-orders { display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; }
.brew-order-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--edge); border-radius: 16px;
  padding: 7px 12px; font-family: var(--sans); cursor: pointer; box-shadow: var(--shadow-soft);
}
.brew-order-card:active { transform: scale(0.99); }
.boc-cust { width: 40px; height: 44px; flex: none; }
.boc-cust .cust-svg { width: 100%; height: 100%; }
.boc-info { flex: 1; display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.boc-info b { font-size: 15px; color: var(--ink); }
.boc-info small { font-size: 12px; color: var(--ink-soft); }
.boc-go { font-size: 20px; color: var(--clay-deep); font-weight: 800; }

.brew-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.brew-method {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--card); border: 2px solid var(--edge); border-radius: 16px;
  padding: 12px 8px; cursor: pointer; font-family: var(--sans); box-shadow: var(--shadow-soft);
}
.brew-method b { font-size: 15px; color: var(--ink); }
.brew-method small { font-size: 11px; color: var(--ink-soft); }
.brew-method:active { transform: scale(0.97); }
.brew-back { margin-top: 2px; }

/* AeroPress: steep timer + draggable plunger */
.steep-readout {
  position: absolute; left: 50%; top: 17%; transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  background: #33403a; color: #bfe4bd; font-family: var(--serif); font-weight: 800;
  font-size: 15px; padding: 4px 14px; border-radius: 10px; border: 2px solid #2a342f;
  box-shadow: var(--shadow-soft), inset 0 1px 3px rgba(0,0,0,0.45); white-space: nowrap;
}
.steep-readout b { font-size: 20px; color: #eaffe6; }
.steep-readout.on { background: #2f6b3a; color: #eaffe6; border-color: #3f9e46; box-shadow: 0 0 0 2px rgba(116,196,110,0.5), var(--shadow-soft); }
.press-handle {
  position: absolute; left: 38%; width: 24%; height: 9%; top: 12%;
  background: #2e2a25; border-radius: 8px 8px 4px 4px; box-shadow: var(--shadow-soft);
  z-index: 6; cursor: grab; touch-action: none;
  display: flex; align-items: center; justify-content: center;
  color: #f3ead6; font-size: 11px; font-weight: 700; letter-spacing: 1px;
}
.press-meter {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  width: 54%; height: 10px; background: rgba(255,252,245,0.85); border-radius: 999px;
  box-shadow: var(--shadow-inset); overflow: hidden; z-index: 6;
}
.press-bar { height: 100%; width: 0; background: linear-gradient(90deg, #9ec98c, #6fae5a); border-radius: 999px; }

.bloom-ring, .steep-ring {
  position: absolute;
  left: 27%; top: 46%;
  width: 16%; aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--clay);
  opacity: 0.85;
  pointer-events: none;
  z-index: 4;
}
.steep-ring { left: 36%; top: 51%; width: 17%; border-color: rgba(110,86,68,0.3); }
.steep-ring span {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 3px solid var(--clay);
  transform: scale(0);
}

/* light floating status (no boxy block) for the pull */
.pour-status {
  position: absolute; left: 0; right: 0; top: 30%;
  text-align: center; z-index: 6; pointer-events: none;
  font-family: var(--serif); font-weight: 700; font-size: 16px;
  letter-spacing: 0.3px; color: var(--ink-soft);
  text-shadow: 0 1px 6px rgba(255, 250, 240, 0.9);
}
.pour-status.good { color: #2f8e3a; }
.pour-status.over { color: var(--bad); }
.btn.hold-pour { touch-action: none; }
.btn.hold-pour.held { transform: scale(0.97); filter: brightness(0.96); }

/* milk steaming — big, clear horizontal meters with a green target zone */
.milk-meters {
  position: absolute; left: 14px; right: 14px; top: 78px;
  display: flex; flex-direction: column; gap: 10px; z-index: 6;
  pointer-events: none;
}
.milk-meters.hidden { display: none; }
.mtr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mtr-label {
  font-family: var(--serif); font-weight: 700; font-size: 12px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft);
}
.mtr-check, .mtr-tier { font-weight: 800; font-size: 12px; color: var(--sage-deep); opacity: 0; transition: opacity 0.15s; }
.mtr.inzone .mtr-check { opacity: 1; }
.mtr-tier { opacity: 1; color: var(--clay-deep); text-transform: capitalize; }
.mtr-bar {
  position: relative; height: 16px; border-radius: 999px;
  background: rgba(255, 252, 245, 0.85);
  box-shadow: var(--shadow-inset);
  overflow: hidden;
}
.mtr-zone {
  position: absolute; top: 0; bottom: 0;
  background: rgba(158, 181, 133, 0.45);
  border-left: 2px solid rgba(95, 144, 121, 0.6);
  border-right: 2px solid rgba(95, 144, 121, 0.6);
}
.mtr-zone.art-zone { background: rgba(217, 135, 106, 0.4); border-color: rgba(196, 113, 79, 0.6); }
.mtr-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7c9a0, #d39b6f);
  transition: width 0.08s linear;
}
.mtr-fill.art { background: linear-gradient(90deg, #f0dcc0, #d9876a); }
.mtr.inzone .mtr-fill { background: linear-gradient(90deg, #9ec98c, #6fae5a); }

/* dial-in plate (espresso) */
.dial-plate {
  position: absolute;
  background: rgba(251, 249, 244, 0.92);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 10px 12px 12px;
  backdrop-filter: blur(3px);
}
.dial-label {
  display: block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.dial-track {
  position: relative;
  height: 26px;
  border-radius: 13px;
  background: var(--linen);
  box-shadow: var(--shadow-inset);
  touch-action: none;
}
.dial-window {
  position: absolute; top: 0; bottom: 0;
  background: rgba(148, 169, 140, 0.55);
  border-radius: 13px;
}
.dial-knob {
  position: absolute;
  top: 50%;
  width: 30px; height: 30px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(to bottom, #fbf9f4, #e7e1d4);
  box-shadow: 0 3px 8px rgba(62,50,38,0.25), inset 0 1.5px 0 #ffffff;
  pointer-events: none;
}
.dial-knob::after {
  content: '';
  position: absolute;
  left: 50%; top: 5px;
  width: 3px; height: 9px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--clay);
}

/* pass holding chips */
#pass-list { position: relative; z-index: 7; margin-top: auto; padding: 0 12px; }
.pass-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0 8px;
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  background: rgba(251, 249, 244, 0.92);
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  touch-action: none;
}
.pass-chip .pc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--linen); }
.pass-chip.ready { color: var(--ink); }
.pass-chip.ready .pc-dot { background: var(--sage); }
.pass-chip:not(.ready) { opacity: 0.7; pointer-events: none; }
.pass-chip.pressed { transform: translateY(1.5px); }

/* ---------- gauges (roast profile, milk) ---------- */

.thermo-overlay {
  position: absolute;
  top: 16%; right: 8px; bottom: 40%;
  width: 44px;
  z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.thermo-track, .gauge-track {
  position: relative;
  flex: 1;
  width: 100%;
  border-radius: 999px;
  background: rgba(251, 249, 244, 0.9);
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  overflow: hidden;
}
.thermo-band {
  position: absolute; left: 0; right: 0;
  background: rgba(148, 169, 140, 0.6);
  display: flex; align-items: center; justify-content: center;
  transition: bottom 0.2s, height 0.2s;
}
.thermo-band span {
  font-size: 8px; font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
}
.thermo-mark {
  position: absolute;
  left: 3px; right: 3px;
  bottom: 0;
  height: 5px;
  border-radius: 3px;
  background: var(--clay);
  z-index: 2;
}
.gauge-tag {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(251, 249, 244, 0.9);
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: var(--shadow-soft);
}
/* roastery: temperature readout + roast-level labels */
.roast-temp {
  font-family: var(--serif); font-weight: 800; font-size: 12px;
  color: #eaffe6; background: #33403a;
  border: 1.5px solid #2a342f; border-radius: 8px;
  padding: 2px 7px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.roast-lvl {
  position: absolute; right: 100%; margin-right: 5px;
  font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--ink-soft);
  white-space: nowrap;
}
.rl-light { bottom: 1%; }
.rl-med { bottom: 47%; }
.rl-dark { bottom: 91%; }

/* batch freshness meter */
.fresh-meter { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.fresh-tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); }
.fresh-track { flex: 1; height: 10px; background: #e7e0cd; border-radius: 999px; box-shadow: var(--shadow-inset); overflow: hidden; }
.fresh-fill { height: 100%; background: linear-gradient(90deg, #a9dc6e, #7cc04a); border-radius: 999px; transition: width 0.2s; }
.fresh-meter.low .fresh-fill { background: linear-gradient(90deg, #e8b86a, #d98a4e); }

.gauges-overlay {
  position: absolute;
  top: 17%; right: 8px; bottom: 28%;
  display: flex; gap: 8px;
  z-index: 6;
}
.gauge { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 38px; }
.gauge-band {
  position: absolute; left: 0; right: 0;
  background: rgba(148, 169, 140, 0.55);
  z-index: 2;
}
.gauge-fill {
  position: absolute; inset: 0;
  transform-origin: bottom;
  transform: scaleY(0);
}
.gauge-fill.temp { background: linear-gradient(to top, var(--gold), var(--clay), var(--bad)); }
.gauge-fill.foam { background: linear-gradient(to top, #ece7dc, #fdfcf9); }

/* ---------- float text, tags, recipe card ---------- */

#float-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.float-text {
  position: absolute;
  font-size: 20px; font-weight: 700;
  color: var(--ink);
  text-align: center;
  background: var(--card);
  border-radius: 20px;
  padding: 12px 22px;
  box-shadow: var(--shadow-lift);
  animation: float-up 1.6s ease-out forwards;
}
.float-text .tip { color: var(--sage-deep); }
.float-text.great { box-shadow: var(--shadow-lift), 0 0 0 3px var(--gold); }
@keyframes float-up {
  0% { transform: translateY(20px) scale(0.85); opacity: 0; }
  15% { transform: translateY(0) scale(1.03); opacity: 1; }
  75% { transform: translateY(-20px); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

.tagpills { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 6px 0 10px; }
.tagpill {
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--linen);
  color: var(--ink-soft);
}
.tagpill.clay { background: var(--clay); color: #fbf7f2; }
.tagpill.walnut { background: var(--walnut); color: #f4efe8; }
.tagpill.linen { background: var(--linen); color: #6b6155; font-style: italic; }

.recipe-card { text-align: center; }
.rc-title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 28px;
  color: var(--ink);
}
.rc-sub {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--clay);
  margin: 2px 0 12px;
}
.rc-row { display: flex; align-items: center; gap: 12px; }
.rc-art {
  flex: 0 0 38%;
  background: var(--paper);
  border-radius: 16px;
  padding: 10px 8px;
  box-shadow: var(--shadow-inset);
}
.rc-art .drink-svg { width: 100%; height: auto; }
.rc-side { flex: 1; display: flex; flex-direction: column; align-items: center; }
.rc-for { display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.rc-for .cust-svg { width: 44px; height: 48px; }
.rc-blurb { font-size: 13px; font-style: italic; color: var(--ink-soft); margin: 10px 0 8px; }
.rc-steps { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 13px; color: var(--ink-soft); }
.rc-step.done { color: var(--sage-deep); }

/* ---------- ticket strip ---------- */

#ticket-strip {
  display: flex;
  gap: 8px;
  padding: 8px 14px 10px;
  overflow-x: auto;
  touch-action: pan-x;
  min-height: 64px;
  align-items: stretch;
  scrollbar-width: none;
}
#ticket-strip::-webkit-scrollbar { display: none; }
.strip-empty { color: var(--ink-soft); font-size: 12px; margin: auto; }

.mini-ticket {
  flex: 0 0 auto;
  font-family: var(--sans);
  background: var(--card);
  border: 2px solid var(--edge);
  border-left: 4px solid var(--ring, var(--sage));
  border-radius: 12px;
  padding: 6px 11px;
  text-align: left;
  display: flex; flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.mini-ticket.sel { box-shadow: var(--shadow-soft), 0 0 0 2.5px var(--clay); }
.mt-name { font-weight: 700; font-size: 12px; color: var(--ink); }
.mt-drink { font-size: 11px; color: var(--ink-soft); }
.mt-drink em { color: var(--clay-deep); font-style: normal; }
.mt-steps { display: flex; gap: 3px; margin-top: 4px; }
.tstep {
  font-size: 9px; font-weight: 700;
  width: 15px; height: 15px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--linen); color: var(--ink-soft);
}
.tstep.done { background: var(--sage); color: #fff; }

/* ---------- tab bar ---------- */

#tabbar {
  display: flex;
  background: var(--card);
  border-top: 2px solid var(--edge);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px rgba(107, 84, 60, 0.10);
}
.tab-btn {
  flex: 1;
  position: relative;
  background: none; border: none;
  color: #b3a895;
  font-family: var(--sans);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.5px;
  padding: 10px 0 9px;
  min-height: 58px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  touch-action: manipulation;
}
.tab-btn .icon-svg { width: 24px; height: 24px; }
.tab-btn.active { color: var(--clay-deep); }
.tab-btn { color: #c2ae8b; }
.tab-btn.active::after {
  content: ''; position: absolute; top: 0; left: 32%; right: 32%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--clay);
}
.badge {
  position: absolute;
  top: 5px; right: calc(50% - 22px);
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--clay);
  color: #fff; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---------- summary & shop ---------- */

.panel-inner {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px;
}
.panel-inner h2 { color: var(--ink); margin-bottom: 12px; font-family: var(--serif); font-weight: 800; }
.screen-footer { padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }

.sum-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: 16px;
  padding: 9px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-soft);
}
.sum-avatar { width: 36px; height: 40px; flex: 0 0 auto; }
.sum-avatar .cust-svg { width: 100%; height: 100%; }
.sum-info { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.sum-info small { color: var(--ink-soft); }
.sum-cash { font-weight: 700; text-align: right; display: flex; flex-direction: column; }
.sum-cash .tip { color: var(--sage-deep); font-weight: 500; font-size: 12px; }
.sum-none { color: var(--ink-soft); padding: 20px 0; text-align: center; }

.stars { display: inline-flex; gap: 1px; }
.star { width: 14px; height: 14px; display: inline-block; }
.star.on { color: var(--gold); }
.star.off { color: var(--linen); }

.sum-totals {
  margin-top: 16px;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.sum-totals > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.sum-totals .tip { color: var(--sage-deep); }
.sum-totals .bad { color: var(--bad); }
.sum-totals .grand { border-top: 1.5px solid var(--linen); margin-top: 6px; padding-top: 11px; font-size: 16px; font-weight: 700; }

.shop-title { display: flex; align-items: center; justify-content: space-between; }
.shop-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: 18px;
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}
.shop-card.maxed { opacity: 0.6; box-shadow: none; }
.shop-icon { width: 36px; height: 36px; color: var(--walnut); flex: 0 0 auto; }
.shop-info { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.shop-info b { font-size: 14px; }
.shop-info small { color: var(--ink-soft); font-size: 12px; }
.lvlrow { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.lv-badge {
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(180deg, #fbdd92, #e9c178);
  border-radius: 999px;
  padding: 2px 9px;
  color: #8a5e2b;
  box-shadow: var(--shadow-soft);
}
.lvlbar {
  position: relative;
  flex: 1; max-width: 130px; height: 10px;
  background: #e7e0cd;
  border-radius: 999px;
  box-shadow: var(--shadow-inset);
  overflow: hidden;
  display: inline-block;
}
.lvlbar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(180deg, #a9dc6e, #7cc04a);
}
/* segment notches over the bar (reference style) */
.lvlbar::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 13px, rgba(255,253,247,0.9) 13px 16px);
  pointer-events: none;
}
.btn-buy { background: var(--linen); font-size: 14px; padding: 11px 15px; box-shadow: var(--shadow-soft); }
.shop-max { font-weight: 700; font-size: 11px; letter-spacing: 1px; color: var(--sage-deep); }

/* ---------- overlays, modal, toasts ---------- */

.overlay {
  position: absolute; inset: 0;
  background: rgba(46, 42, 38, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.overlay-card {
  background: var(--card);
  border: 2.5px solid var(--edge);
  border-radius: 26px;
  padding: 28px 24px;
  width: 100%; max-width: 330px;
  display: flex; flex-direction: column; gap: 11px;
  text-align: center;
  align-items: stretch;
  box-shadow: var(--shadow-lift);
}
.overlay-card h2 { font-family: var(--serif); font-weight: 800; color: var(--ink); }
.overlay-card .icon-btn { align-self: center; }
#modal-buttons { display: flex; gap: 10px; justify-content: center; }
.modal-msg { font-size: 15px; line-height: 1.5; }

#toasts {
  position: absolute;
  top: calc(60px + env(safe-area-inset-top));
  left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  font-size: 13px; font-weight: 600;
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: var(--shadow-lift);
  animation: pop-in 0.25s;
  transition: opacity 0.4s, transform 0.4s;
  max-width: 85%;
  text-align: center;
}
.toast.good { background: var(--sage-deep); color: #f6f8f4; }
.toast.bad { background: var(--bad); color: #fdf6f3; }
.toast.out { opacity: 0; transform: translateY(-8px); }

@keyframes pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- rotate overlay ---------- */

#rotate-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--paper);
  color: var(--ink);
  z-index: 100;
  text-align: center;
  font-size: 18px;
  line-height: 1.7;
}
#rotate-overlay p { margin: auto; }
@media (orientation: landscape) and (max-height: 500px) {
  #rotate-overlay { display: flex; }
}

/* ---------- summary reward cards + upgrade detail (reference meta screens) ---------- */

.lvlup-burst {
  text-align: center;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 8px;
  margin-top: 2px;
  animation: pop-in 0.4s;
}
.reward-row { display: flex; gap: 9px; justify-content: center; margin: 4px 0 14px; }
.reward-card {
  flex: 1; max-width: 110px;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: 16px;
  box-shadow: var(--shadow-soft), inset 0 2px 0 rgba(255,255,255,0.8);
  padding: 10px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: pop-in 0.35s;
}
.reward-card b { font-size: 16px; color: var(--ink); }
.reward-card small { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); }
.rw-icon { width: 26px; height: 26px; color: var(--gold); }
.rw-icon.sage { color: var(--sage-deep); }
.rw-icon.clay { color: var(--clay); }
.sum-lost { text-align: center; font-size: 12px; color: var(--bad); margin-bottom: 8px; }

.shop-card { width: 100%; text-align: left; font-family: var(--sans); cursor: pointer; }
.shop-price {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 14px;
  background: linear-gradient(180deg, #fbe7b2, #f0cd86);
  border: none;
  border-radius: 999px;
  padding: 8px 14px 8px 24px;
  color: #8a5e2b;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.shop-price::before {
  content: ''; position: absolute; left: 8px; top: 50%;
  width: 11px; height: 11px; margin-top: -5.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c4, #e3a93f);
  box-shadow: inset 0 0 0 1.5px #cf983a;
}
.shop-price.dim { opacity: 0.5; }

.upgrade-detail { position: relative; }
.lv-badge.float {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  background: var(--gold);
  border: 2px solid var(--edge);
  font-size: 12px;
  padding: 4px 10px;
}
.ud-stage {
  background:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,0.65) 0 3px, transparent 3.5px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.55) 0 2.5px, transparent 3px),
    radial-gradient(circle at 62% 78%, rgba(255,255,255,0.5) 0 2px, transparent 2.5px),
    linear-gradient(170deg, #cfdcc0, #b9cba6);
  background-size: 70px 70px, 90px 90px, 60px 60px, 100% 100%;
  border: 2.5px solid var(--edge);
  border-radius: 18px;
  padding: 6px;
  box-shadow: var(--shadow-inset);
}
.portrait-svg { width: 64%; height: auto; display: block; margin: 0 auto; }
.ud-name { font-family: var(--serif); font-weight: 800; font-size: 21px; color: var(--ink); margin: 10px 0 8px; }
.ud-stats { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.stat-row { display: flex; align-items: center; gap: 9px; }
.stat-label { flex: 0 0 44%; text-align: right; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.lvlbar.big { max-width: none; flex: 1; height: 10px; border: 1.5px solid var(--edge); }
