/* Baloo 2 (SIL Open Font License, see LICENSES/Baloo2-OFL.txt): Latin, Latin extended and Vietnamese */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("baloo2-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("baloo2-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("baloo2-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
:root {
  --display: "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --bg: #FBF7F1; --surface: #FFFFFF; --surface-2: #F4EEE4; --tile: #F3ECE1;
  --ink: #2B2520; --ink-2: #6B6157; --ink-3: #958A7E; --line: #E7DED1; --line-2: #D7CCBC;
  --accent: #2F7D4F; --accent-ink: #FFFFFF; --accent-soft: #E3F1E8;
  --good: #2F7D4F; --good-soft: #E3F1E8;
  --warn: #8F5600; --warn-soft: #FFF0D2;
  --bad: #B3261E; --bad-soft: #FDE7E4;
  --info: #1F5FA0; --info-soft: #E5F0FB;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(43, 37, 32, .06), 0 6px 18px rgba(43, 37, 32, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191715; --surface: #24211E; --surface-2: #2E2A26; --tile: #37322C;
    --ink: #F3EEE7; --ink-2: #BFB5A9; --ink-3: #8F867C; --line: #38332D; --line-2: #4A443C;
    --accent: #5CB883; --accent-ink: #0E1B13; --accent-soft: #1E3A2A;
    --good: #5CB883; --good-soft: #1E3A2A; --warn: #F0B44C; --warn-soft: #3A2E17;
    --bad: #FF8A7A; --bad-soft: #3D201C; --info: #8EC0F0; --info-soft: #1C2E42;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
.app.wide { max-width: 1120px; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); padding-top: calc(18px + env(safe-area-inset-top)); }
h1 { font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
h2 { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.2; margin: 22px 0 8px; color: var(--ink-2); }
h3 { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; margin: 0 0 6px; }
.btn, .mode b, .score-big, .tab { font-family: var(--display); }
p { margin: 6px 0; }
.muted { color: var(--ink-2); }
.fine { font-size: 13px; color: var(--ink-3); }
.err { color: var(--bad); font-size: 14px; min-height: 1px; margin: 6px 0 0; }
.ok-text { color: var(--good); font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack > * + * { margin-top: 10px; }
.ico { display: block; flex: 0 0 auto; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none; }
a.btn { color: inherit; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
@media (pointer: coarse) { #admin .btn.small { min-height: 40px; } }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--info); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field small.hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
.field.bad input { border-color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.note { background: var(--info-soft); color: var(--info); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad-note { background: var(--bad-soft); color: var(--bad); margin: 6px 0 12px; text-align: left; }
/* practice doesn't count time: no draining bar on its tickets */
.screen.game.practice .tk-bar { display: none; }

/* start screen banner: the name over the front counter, with the cook */
.hero { position: relative; margin: 8px 0 16px; padding: 14px 14px 12px; border-radius: 18px; border: 2px solid #5E3F24; background: #E8D9C0 repeating-conic-gradient(#E8D9C0 0 25%, #DECAA9 0 50%) 0 0 / 36px 36px; color: #2B211B; overflow: hidden; box-shadow: 0 4px 0 rgba(60, 35, 15, .2); }
.hero-text h1 { margin: 0; font-size: 32px; line-height: 1; color: #2B211B; }
.hero-text p { margin: 2px 0 10px; font-family: var(--display); font-size: 15px; font-weight: 600; color: #6E4423; }
.hero-scene { display: flex; align-items: flex-end; gap: 6px; }
.hero-line { flex: 1 1 auto; min-width: 0; pointer-events: none; }
.hero-line .line { justify-content: start; }
.hero-chef { flex: 0 0 auto; width: 54px; height: 54px; margin-bottom: -4px; }
.hero-chef .chef-svg { display: block; width: 100%; height: 100%; }
.hero.kiosk { border-color: #2F5F63; background: #DCEFF0 repeating-conic-gradient(#DCEFF0 0 25%, #CDE5E6 0 50%) 0 0 / 36px 36px; }
.hero.kiosk .hero-text p { color: #2F5F63; }
.hero.kiosk .krow { border-color: #2F5F63; background: linear-gradient(#FBF8F2, #EEE7DB 60%, #E6DDCD); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -8px 0 #9FBDB9, 0 3px 0 rgba(20, 50, 55, .2); }

/* brand, top bar */
.brand { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
.brand h1 { margin: 0; }
.brand p { margin: 0; color: var(--ink-2); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.toplinks { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.toplinks .btn { min-height: 36px; padding: 6px 10px; font-size: 14px; }

/* tabs */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tab { border: 0; background: transparent; border-radius: 9px; min-height: 40px; font-weight: 600; color: var(--ink-2); }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* start screen */
.stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.station { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.station.on { border: 2px solid var(--accent); padding: 9px 11px; background: var(--accent-soft); }
.station .st-ico { display: flex; flex: 0 0 auto; padding: 3px; border-radius: 12px; background: var(--tile); }
.station .st-ico .ico + .ico { margin-left: -9px; }
.station .st-txt { min-width: 0; }
.station b { display: block; font-size: 16px; line-height: 1.15; }
.station small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.modes { display: grid; gap: 8px; }
.mode { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.mode b { display: block; font-size: 16px; }
.mode small { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 1px; }
.mode.on { border: 2px solid var(--accent); padding: 11px 13px; background: var(--accent-soft); }
.mode .mode-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--tile); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.actions { display: grid; gap: 8px; margin-top: 18px; }

/* ---------- game: a top-down kitchen ---------- */
/* the scene keeps its daylight colours in dark mode too */
.screen.game {
  color-scheme: light;
  --bg: #FBF7F1; --surface: #FFFFFF; --surface-2: #F4EEE4; --tile: #F3ECE1;
  --ink: #2B2520; --ink-2: #6B6157; --ink-3: #958A7E; --line: #E7DED1; --line-2: #D7CCBC;
  --accent: #2F7D4F; --accent-ink: #FFFFFF; --accent-soft: #E3F1E8; --good: #2F7D4F; --good-soft: #E3F1E8;
  --warn: #8F5600; --warn-soft: #FFF0D2; --bad: #B3261E; --bad-soft: #FDE7E4; --info: #1F5FA0; --info-soft: #E5F0FB;
  --outline: #2B211B;
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
  padding: 0 10px calc(8px + env(safe-area-inset-bottom)); padding-top: env(safe-area-inset-top);
  font-family: var(--display); color: var(--ink);
  background: #E8D9C0 repeating-conic-gradient(#E8D9C0 0 25%, #DECAA9 0 50%) 0 0 / 44px 44px;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.screen.game.kiosk { background: #DCEFF0 repeating-conic-gradient(#DCEFF0 0 25%, #CDE5E6 0 50%) 0 0 / 44px 44px; }
.screen.game.kiosk .krow:not(.trow), .kiosk-stage .krow:not(.trow) { border-color: #2F5F63; background: linear-gradient(#FBF8F2, #EEE7DB 60%, #E6DDCD); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -8px 0 #9FBDB9, 0 3px 0 rgba(20, 50, 55, .2); }
.screen.game.kiosk .prep { border-color: #2F5F63; background: linear-gradient(#FBF8F2, #EFE8DC 60%, #E8DFD0); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -9px 0 #9FBDB9, 0 4px 0 rgba(20, 50, 55, .2); }
.screen.game.kiosk .g-table { background: rgba(47, 95, 99, .1); }
.screen.game.kiosk .well .tag, .kiosk-stage .well .tag { border-color: #2F5F63; }
/* the kitchen is laid out for an upright phone */
@media (orientation: landscape) and (max-height: 520px) {
  .screen.game::before { content: "Turn your phone upright to play"; position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: #2B3B40; color: #FFF4E2; font: 800 22px/1.2 var(--display); text-align: center; }
}
.g-top { position: relative; flex: 0 0 auto; margin: 0 -10px; padding: 6px 10px 6px; background: linear-gradient(#36494F, #2B3B40); box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.g-top::after { content: ""; position: absolute; left: 8px; right: 8px; top: 56px; height: 6px; border-radius: 3px; background: linear-gradient(#E6EBEE, #95A2A9); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* heads-up bar */
.hud { display: flex; align-items: center; gap: 7px; height: 40px; color: #FFF4E2; }
.hud-btn { flex: 0 0 auto; min-width: 40px; height: 36px; padding: 0 11px; border-radius: 12px; border: 2px solid #131B1E; background: #4D6168; color: #FFF4E2; font: 800 15px/1 var(--display); box-shadow: 0 3px 0 #131B1E; display: inline-flex; align-items: center; justify-content: center; }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #131B1E; }
.hud-btn.danger { background: #C9503C; }
.hud-btn.snd { padding: 0; }
.hud-btn.snd .mute, .hud-btn.snd.off .waves { display: none; }
.hud-btn.snd.off .mute { display: inline; }
.hud-btn.snd.off { background: #3A474C; color: #A9B6BB; }
.hud-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-title small { display: block; font-size: 12px; font-weight: 600; opacity: .78; overflow: hidden; text-overflow: ellipsis; }
.hud-clock { flex: 0 0 auto; min-width: 62px; height: 36px; padding: 0 9px; border-radius: 12px; border: 2px solid #131B1E; background: #FFF4E2; color: #2B3B40; font-size: 19px; font-weight: 800; line-height: 32px; text-align: center; box-shadow: 0 3px 0 #131B1E; font-variant-numeric: tabular-nums; }
.hud-clock:empty { display: none; }
.hud-clock.low { background: #FFD3C8; color: #B42F1E; animation: lowPulse 1s ease-in-out infinite; }
.hud-coins { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px 0 5px; border-radius: 999px; border: 2px solid #131B1E; background: #FFF4E2; color: #2B3B40; font-size: 18px; font-weight: 800; box-shadow: 0 3px 0 #131B1E; font-variant-numeric: tabular-nums; }
.hud-coins b { display: inline-block; min-width: 2ch; text-align: right; }
.hud-coins b.bump { animation: bump .35s ease; }
.coin { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 2px solid #7A5208; background: radial-gradient(circle at 35% 30%, #FFF2AE 0 16%, #F6C343 42%, #D3951B 78%); }

/* order tickets hanging from the rail */
.orders { position: relative; z-index: 1; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 12px 2px 5px; min-height: 96px; scrollbar-width: none; }
.orders::-webkit-scrollbar { display: none; }
.tk { flex: 0 0 auto; position: relative; width: 146px; min-height: 78px; display: flex; flex-direction: column; padding: 0 0 9px; text-align: left; border-radius: 10px; border: 2px solid #131B1E; background: #FFFBF1; color: var(--ink); box-shadow: 0 3px 0 #131B1E; overflow: hidden; font-family: var(--display); }
.tk:only-child { width: min(100%, 330px); }
.tk-band { display: flex; align-items: center; gap: 5px; padding: 2px 7px; background: var(--band, #7B6A5A); color: #FFFFFF; font-size: 12px; font-weight: 800; line-height: 1.35; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.tk-band .ico { width: 17px; height: 17px; border-radius: 5px; background: rgba(255, 255, 255, .9); padding: 1px; }
.tk-no { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tk-time { font-variant-numeric: tabular-nums; }
.tk-name { display: block; padding: 3px 8px 0; font-size: 15px; font-weight: 800; line-height: 1.08; }
.tk .chips { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 7px 0; }
.tk .chip { font-size: 11.5px; font-weight: 700; padding: 0 7px; line-height: 1.55; background: #EFE6D6; color: #5C5046; }
.tk .chip.add { background: #DDF0D7; color: #2F6B2A; }
.tk .chip.remove { background: #FBE0DB; color: #A82C1F; }
.tk .chip.allergy { background: #C9302C; color: #FFFFFF; }
.tk-note { font-size: 11.5px; color: #7B6E62; align-self: center; }
.tk-steps { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 7px 0; }
.tk-steps .ts { position: relative; display: inline-flex; padding: 1px; border-radius: 6px; background: #F3EBDD; }
.tk-steps .ts.ok { background: #DDF0D7; }
.tk-steps .ts.ok .ico { opacity: .35; }
.tk-steps .ts.ok::after { content: "✓"; position: absolute; right: -2px; bottom: -4px; color: #2F7D4F; font-size: 13px; font-weight: 800; text-shadow: 0 0 2px #FFFFFF; }
.tk-steps .ts i { position: absolute; right: -3px; top: -5px; font-style: normal; font-size: 10px; font-weight: 800; color: #7A4A00; }
.tk-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0, 0, 0, .1); }
.tk-bar i { display: block; height: 100%; width: 100%; background: #5DB54B; transition: width .25s linear, background-color .25s; }
.tk.on { box-shadow: 0 0 0 3px #FFC93C, 0 3px 0 #131B1E; }
.tk.late { border-color: #B42F1E; }
.tk.late .tk-band { background: #B42F1E; }
.tk.late .tk-time { animation: blink 1s step-end infinite; }
.tk.fresh { animation: tkIn .42s cubic-bezier(.2, .9, .3, 1.25) both; }
.rail-empty { flex: 1; text-align: center; color: #D5E0E3; padding: 24px 0; font-size: 15px; font-weight: 800; }

/* the line: counter rows of pans (also used by the admin layout editor) */
.k-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.g-kitchen { flex: 0 0 auto; display: flex; justify-content: center; padding-top: 4px; }
.line { --row-chrome: 17px; --row-gap: 4px; display: grid; gap: var(--row-gap); justify-content: center; font-family: var(--display); }
.krow { position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cell, 60px)); grid-auto-rows: var(--cell, 60px); column-gap: 3px; height: calc(var(--cell, 60px) + var(--row-chrome)); padding: 3px 4px calc(var(--row-chrome) - 7px); border: 2px solid #5E3F24; border-radius: 11px; background: linear-gradient(#F0C78F, #E2B176 60%, #DBA66A); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -8px 0 #A8723C, 0 3px 0 rgba(60, 35, 15, .22); }
.well { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 9px; background: none; color: var(--ink); font: inherit; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.well:focus-visible { outline: 3px solid #1F5FA0; outline-offset: 1px; }
.well .pan { position: absolute; left: 1px; right: 1px; top: 1px; bottom: 8px; border-radius: 8px; border: 2px solid #5F6B74; background: linear-gradient(#F9FBFC, #C7D0D7); box-shadow: inset 0 3px 4px rgba(30, 40, 50, .33), inset 0 -2px 0 rgba(255, 255, 255, .6); transition: transform .08s; }
.well:active .pan { transform: translateY(1px); }
.well .heap { position: absolute; left: 1px; top: 1px; width: calc(100% - 2px); height: calc(100% - 6px); pointer-events: none; overflow: visible; }
.well .tag { position: absolute; left: 2px; right: 2px; bottom: 0; display: flex; align-items: center; justify-content: center; min-height: 15px; max-height: 26px; padding: 1px 2px; border-radius: 5px; border: 1.5px solid #5E3F24; background: #FFFCF4; color: #2B211B; text-align: center; overflow: hidden; pointer-events: none; }
.well .tag > span { display: block; max-width: 100%; font-size: 11px; font-weight: 700; line-height: 1.02; overflow-wrap: normal; word-break: normal; }
.well.wide .tag > span { font-size: 11.5px; }
.line.tagless .tag { display: none; }
/* small phones: a narrow label strip, so the pans keep their names */
.line.compact .well .tag { min-height: 11px; max-height: 13px; padding: 0 1px; border-width: 1px; border-radius: 4px; }
.line.compact .well .tag > span { font-size: 9.5px; line-height: 1; white-space: nowrap; }
.line.compact .well .pan { bottom: 6px; }
.tabletop.compact .well .tag { min-height: 11px; max-height: 13px; padding: 0 1px; border-width: 1px; border-radius: 4px; }
.tabletop.compact .well .tag > span { font-size: 9px; line-height: 1; white-space: nowrap; }
/* rush tickets are narrow: tighter text keeps the rail short, so the kitchen keeps its size */
.screen.game.rush .tk-name { font-size: 13.5px; line-height: 1.05; }
.screen.game.rush .tk .chips { gap: 2px; padding: 3px 6px 0; }
.screen.game.rush .tk .chip { font-size: 10.5px; line-height: 1.4; padding: 0 5px; }
.line.tagless .well .pan { bottom: 1px; }
.well.s-hot .pan { border-color: #8E3A20; background: linear-gradient(#FFF4EC, #EBC8B5); box-shadow: inset 0 3px 4px rgba(110, 40, 10, .33), 0 0 0 2px #E8643B; }
.well.s-cold .pan { border-color: #2F5F85; background: linear-gradient(#F4FAFF, #C6DDEE); box-shadow: inset 0 3px 4px rgba(20, 60, 100, .28), 0 0 0 2px #86B7DF; }
.well.s-dry .pan { border-color: #6E4423; background: linear-gradient(#D7A66A, #B98448); box-shadow: inset 0 3px 5px rgba(60, 30, 10, .45); }
.well.s-tools .pan { border: 2px dashed rgba(94, 63, 36, .5); background: rgba(255, 255, 255, .2); box-shadow: none; }
.steam { position: absolute; left: 0; right: 0; top: -9px; height: 16px; pointer-events: none; }
.steam i { position: absolute; bottom: 0; width: 11px; height: 15px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)); opacity: 0; animation: steam 2.8s ease-in infinite; }
.steam i:first-child { left: 20%; }
.steam i:last-child { left: 58%; animation-delay: 1.4s; }
.well.hint { z-index: 1; }
/* the pan to use next in Learn: a green ring (not the cold pans' blue) and an arrow, steady
   on their own so they stay when the phone asks for less motion; only the pulse moves */
.well.hint .pan { box-shadow: 0 0 0 3px #15A04A, 0 0 0 7px rgba(21, 160, 74, .35); animation: wellGlow 1s ease-in-out infinite; }
.well.hint::after { content: ""; position: absolute; left: 50%; top: -8px; margin-left: -7px; border-style: solid; border-width: 9px 7px 0; border-color: #15A04A transparent transparent; z-index: 3; pointer-events: none; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)); }
.well.hint .heap { animation: wellBob 1s ease-in-out infinite; }
.well.held .pan, .well.lifted .pan { box-shadow: 0 0 0 3px #FFC93C, inset 0 3px 4px rgba(0, 0, 0, .3); }
.well.lifted .heap { opacity: .5; }
.well.mark-no .heap, .well.mark-allergy .heap { opacity: .38; }
.well.mark-no .pan::after, .well.mark-allergy .pan::after { content: ""; position: absolute; left: 8%; right: 8%; top: 44%; height: 3px; border-radius: 2px; background: #C9302C; transform: rotate(-28deg); }
.well .sticker { position: absolute; top: 2px; right: 1px; z-index: 1; padding: 0 5px; border-radius: 6px; border: 1.5px solid #5A1410; background: #C9302C; color: #FFFFFF; font-size: 10px; font-weight: 800; line-height: 1.45; text-transform: uppercase; transform: rotate(7deg); pointer-events: none; }

/* the tabletop on the prep counter: bottles and shakers standing on it */
.g-table { flex: 0 0 auto; display: flex; justify-content: center; padding: 3px 4px 4px; border-radius: 10px; background: rgba(110, 68, 35, .13); box-shadow: inset 0 2px 3px rgba(60, 35, 15, .2); }
.tabletop { --row-chrome: 17px; display: grid; gap: 3px; justify-content: center; font-family: var(--display); }
.krow.trow { grid-template-columns: repeat(var(--cols), var(--tcell-w, var(--tcell, 52px))); grid-auto-rows: calc(var(--tcell, 52px) + var(--row-chrome)); height: calc(var(--tcell, 52px) + var(--row-chrome)); padding: 0 2px; border: 0; border-radius: 8px; background: none; box-shadow: none; }
.well.bottle .pan { left: 0; right: 0; top: 0; bottom: calc(var(--row-chrome) - 3px); border: 0; border-radius: 10px; background: none; box-shadow: none; }
.well.bottle .heap { height: calc(100% - 2px); }
.well.bottle .tag > span { white-space: nowrap; }
.well.bottle.hint .pan, .well.bottle.held .pan, .well.bottle.lifted .pan, .well.bottle.selected .pan { background: rgba(255, 255, 255, .35); }
.tabletop.tagless { --row-chrome: 3px !important; }
.tabletop.tagless .tag { display: none; }
.tabletop.tagless .well .pan { bottom: 0; }
.ke-stage .tabletop { margin: 0 auto; }

/* the floor in front of the line, with the cook */
.g-floor { position: relative; z-index: 6; flex: 1 0 36px; min-height: 36px; pointer-events: none; }
.chef { position: absolute; left: 0; top: 50%; width: 52px; height: 52px; margin: -27px 0 0 -26px; transition: transform .3s cubic-bezier(.3, .7, .4, 1); will-change: transform; }
.chef-svg { display: block; width: 100%; height: 100%; }
.chef.walk .chef-svg { animation: waddle .3s ease-in-out; }
.chef .held { position: absolute; left: 100%; top: -8px; width: 38px; height: 38px; margin-left: -12px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #131B1E; background: #FFFBF1; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); animation: pop .2s ease-out; }

/* the prep counter: cutting board and the pass */
.prep { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; height: var(--prep-h, 170px); padding: 6px 6px 13px; border: 2px solid #5E3F24; border-radius: 14px; background: linear-gradient(#F0C78F, #E2B176 60%, #DBA66A); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -9px 0 #A8723C, 0 4px 0 rgba(60, 35, 15, .22); }
.prep-row { flex: 1 1 auto; min-height: 0; display: flex; gap: 6px; }
.g-board { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 12px; border: 2px solid #6E4423; background: linear-gradient(#E6ECEF, #CDD6DC); overflow: hidden; touch-action: none; cursor: pointer; box-shadow: 0 3px 0 rgba(60, 35, 15, .3); outline: none; }
.g-board[data-kind="bread"], .g-board[data-kind="paper"] { background: linear-gradient(135deg, #F2DAB2, #E3C391); }
.g-board:focus-visible { box-shadow: 0 0 0 3px #1F5FA0, 0 3px 0 rgba(60, 35, 15, .3); }
.g-board.waiting { animation: boardWait 1s ease-in-out infinite; }
.g-board.drop-ready { box-shadow: 0 0 0 3px rgba(45, 127, 211, .75), 0 3px 0 rgba(60, 35, 15, .3); }
.g-board.over { box-shadow: 0 0 0 5px #5DB54B, 0 3px 0 rgba(60, 35, 15, .3); }
.g-board.shake { animation: shake .3s ease; }
.g-bsvg { position: absolute; inset: 0; }
.g-bsvg svg { display: block; width: 100%; height: 100%; }
.bd-grain { stroke: rgba(122, 86, 40, .14); stroke-width: 2.2; }
.bd-sheen { stroke: rgba(255, 255, 255, .6); stroke-width: 3; }
.bd-ph { font: 700 15px var(--display); fill: rgba(70, 52, 30, .55); }
.bd-ph.on-light { fill: rgba(60, 72, 84, .62); }
.g-steps { position: absolute; left: 7px; top: 6px; z-index: 2; max-width: calc(100% - 14px); padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, .82); color: #6F6458; font-size: 12px; font-weight: 600; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.g-steps::-webkit-scrollbar { display: none; }
.g-steps i { font-style: normal; margin: 0 4px; color: #A69A8C; }
.g-steps .done { color: #2F7D4F; }
.g-steps .cur { color: #2B2520; font-weight: 800; }
.g-hint { position: absolute; left: 50%; bottom: 6px; z-index: 2; transform: translateX(-50%); width: max-content; max-width: calc(100% - 14px); padding: 2px 12px; border-radius: 999px; border: 2px solid #133D66; background: #1F5FA0; color: #FFFFFF; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.toast { position: absolute; left: 50%; top: 4px; z-index: 5; transform: translateX(-50%); width: max-content; max-width: 94%; padding: 7px 12px; border-radius: 12px; border: 2px solid var(--outline); font-size: 14px; font-weight: 700; line-height: 1.25; text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); pointer-events: none; }
.chef .held.left { left: auto; right: 100%; margin-left: 0; margin-right: -12px; }
.toast.bad { background: #C9302C; color: #FFFFFF; }
.toast.good { background: #3F9A4A; color: #FFFFFF; }
.toast.warn { background: #FFF0D2; color: #7A4A00; }
.toast.info { background: #E8F1FB; color: #17487A; }
#app-toast { position: fixed; top: calc(10px + env(safe-area-inset-top)); z-index: 40; max-width: min(94vw, 520px); }
#app-toast.under-hud { top: calc(58px + env(safe-area-inset-top)); }
.pass { position: relative; flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding-bottom: 6px; border-radius: 10px; border: 2px solid #3E4A51; background: linear-gradient(#DDE4E8, #A9B5BD); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); overflow: hidden; }
.pass .lamp { position: absolute; left: 0; right: 0; top: 0; height: 45%; background: linear-gradient(rgba(255, 153, 51, .8), rgba(255, 153, 51, 0)); }
.pass .bell { position: relative; width: 34px; height: 28px; transform-origin: 50% 85%; }
.pass.ding .bell { animation: ding .55s ease; }
.pass.ding .lamp { animation: lampFlash .55s ease; }
.pass-label { position: relative; font-size: 11px; font-weight: 800; color: #2B3B40; }
.g-bsvg .pc.new { animation: land .34s cubic-bezier(.2, .9, .3, 1.25) both; transform-box: fill-box; transform-origin: 50% 50%; }
.g-bsvg .pour.new { animation: pourIn .42s ease-out both; transform-box: fill-box; transform-origin: 50% 100%; }
.g-bsvg .sm.new { animation: smear .42s ease-out; }
.g-bsvg .fx.anim-wrap { animation: wrapIn .36s ease-out both; transform-box: fill-box; transform-origin: 0% 50%; }
.g-bsvg .fx.anim-lid { animation: lidIn .38s cubic-bezier(.2, .9, .3, 1.15) both; }
.g-bsvg .fx.anim-box { animation: boxIn .34s ease-out both; transform-box: fill-box; transform-origin: 50% 0%; }
.g-bsvg .fx.anim-cover { animation: land .34s ease-out both; transform-box: fill-box; transform-origin: 50% 50%; }
.g-bsvg .logs.anim-roll > g { animation: rollIn .42s ease-out both; transform-box: fill-box; transform-origin: 50% 50%; }
.g-bsvg.serve-out svg { animation: serveOut .29s ease-in forwards; }
.g-bsvg.serve-in svg { animation: serveIn .26s ease-out both; }

/* things that float above the game: the dragged item, score pops, the tutorial hand */
.g-fx { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 40; width: 72px; display: flex; flex-direction: column; align-items: center; pointer-events: none; will-change: transform; font-family: var(--display); }
.drag-ghost .gh-ico { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #2B211B; background: rgba(255, 251, 241, .94); box-shadow: 0 9px 14px rgba(0, 0, 0, .3); }
.drag-ghost .gh-name { margin-top: 3px; max-width: 130px; padding: 1px 8px; border-radius: 999px; background: #2B211B; color: #FFF4E2; font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-ghost.fly { transition: transform .24s ease, opacity .24s ease; }
.drag-ghost.shake .gh-ico { animation: shake .3s ease; border-color: #C9302C; }
.pop { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); color: #FFD34D; font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1; white-space: nowrap; -webkit-text-stroke: 1.5px #2B211B; text-shadow: 0 3px 0 #2B211B; animation: popUp .9s ease-out forwards; }
.pop.good { color: #8BE36A; }
.pop.bad { color: #FF6B57; }
.pop.warn { color: #FFB13B; }
.pop.big { font-size: 27px; }
.tut-hand { position: absolute; left: 0; top: 0; width: 46px; height: 46px; opacity: 0; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); animation: tutDrag 2.1s ease-in-out infinite; }
.tut-hand.still { animation: none; opacity: 1; transform: translate(var(--x0), var(--y0)) scale(.86); }
.g-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(20, 16, 12, .5); }
.sheet { width: 100%; max-width: 540px; max-height: 85vh; overflow: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px; border: 2px solid var(--outline); background: var(--surface); box-shadow: 0 4px 0 rgba(0, 0, 0, .3); font-family: var(--font); }
.sheet h3 { font-family: var(--display); font-size: 24px; line-height: 1.1; }

.rc-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
/* the Start button stays in reach at the bottom of the screen */
.actions.start-bar { position: sticky; bottom: 0; z-index: 2; margin-left: -4px; margin-right: -4px; padding: 14px 4px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0, 0, 0, 0), var(--bg) 22px); }

/* start screen: offline and upload status */
.status-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; }
.pill-s { font-size: 12.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill-s.ok { background: var(--good-soft); color: var(--good); }
.pill-s.warn { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; font-size: 12.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); line-height: 1.35; }
.chip.add { background: var(--good-soft); color: var(--good); }
.chip.remove { background: var(--bad-soft); color: var(--bad); }
.chip.allergy { background: var(--bad); color: #FFFFFF; }
.mlist { margin: 8px 0 0; padding: 0; list-style: none; }
.mlist li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; font-size: 14.5px; }
.mlist li:first-child { border-top: 0; }
.mlist .n { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-height: 720px) {
  .screen.game { gap: 4px; }
  .g-top { padding: 4px 10px 4px; }
  .hud { height: 36px; }
  .hud-btn, .hud-clock, .hud-coins { height: 32px; }
  .hud-clock { line-height: 28px; font-size: 17px; }
  .hud-title { font-size: 15px; }
  .hud-title small { font-size: 10.5px; line-height: 1.15; } /* smaller, but the mode still shows */
  .g-top::after { top: 48px; }
  .orders { min-height: 76px; padding: 10px 2px 4px; }
  .tk { min-height: 60px; padding-bottom: 7px; }
  .tk-name { font-size: 14px; }
  .line, .tabletop { --row-chrome: 12px; --row-gap: 3px; }
  .krow { padding-top: 2px; }
  .krow.trow { padding-top: 0; }
  .g-floor { flex-basis: 26px; min-height: 26px; }
  .chef { width: 44px; height: 44px; margin: -23px 0 0 -22px; }
  /* the aisle is narrow here: the held thing sits beside the cook's middle, not above its
     head, so it doesn't cover the names of the pans on the bottom row */
  .chef .held { width: 30px; height: 30px; top: 50%; margin-top: -15px; margin-left: -8px; }
  .chef .held.left { margin-left: 0; margin-right: -8px; }
  .chef .held svg { width: 20px; height: 20px; }
  .prep { padding: 5px 5px 11px; }
}

/* summary and stats */
.score-big { font-size: 52px; font-weight: 800; line-height: 1; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.stars svg { width: 60px; height: 60px; display: block; }
.stars path { fill: var(--surface-2); stroke: var(--line-2); }
.stars .on path { fill: #F6C343; stroke: #7A5208; }
.stars .on { animation: starIn .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.stars .on:nth-child(2) { animation-delay: .15s; }
.stars .on:nth-child(3) { animation-delay: .3s; }
.stars-note { text-align: center; margin: 0 0 6px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat small { display: block; color: var(--ink-2); font-size: 13px; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { border-top: 1px solid var(--line); padding: 9px 0; }
.tlist li:first-child { border-top: 0; }
.tlist .t-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.tlist .t-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.okmark { color: var(--good); font-weight: 800; }
.badmark { color: var(--bad); font-weight: 800; }
.mastery { display: grid; gap: 6px; }
.m-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.m-row .nm { flex: 1; min-width: 0; }
.pips { display: inline-flex; gap: 3px; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.pip.on { background: var(--good); }
.sync { font-size: 13.5px; margin-top: 10px; }

/* recipe cards */
.rc-format { margin-top: 20px; }
.rc-item { padding: 12px 0; border-top: 1px solid var(--line); }
.rc-item:first-of-type { border-top: 0; }
.rc-phase { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.rc-phase .pn { width: 74px; flex: 0 0 auto; font-size: 12.5px; color: var(--ink-3); padding-top: 6px; font-weight: 600; }
.rc-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-step { display: inline-flex; align-items: center; gap: 3px; background: var(--surface-2); border-radius: 999px; padding: 2px 9px 2px 3px; font-size: 13px; }
.rc-step em { font-style: normal; font-weight: 700; color: var(--accent); margin-left: 4px; font-size: 12.5px; }
.rc-step.rc-pick { display: inline-block; padding: 3px 10px; border-radius: 12px; line-height: 1.35; }
.rc-note { margin: 2px 0 0; }
.rc-opts { margin-top: 10px; }
.card-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.card-tabs .tab { flex: 1 1 auto; padding: 0 12px; }
.m-station { margin: 14px 0 6px; font-size: 15px; }
.rc-any { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }

@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes land { 0% { opacity: 0; transform: translateY(-24px) scale(1.18); } 70% { opacity: 1; transform: translateY(2px) scale(.97); } 100% { opacity: 1; transform: none; } }
@keyframes smear { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes wrapIn { from { opacity: .3; transform: scaleX(.04); } to { opacity: 1; transform: none; } }
@keyframes lidIn { from { opacity: 0; transform: translateY(-70px); } to { opacity: 1; transform: none; } }
@keyframes boxIn { from { opacity: .3; transform: scaleY(.08); } to { opacity: 1; transform: none; } }
@keyframes rollIn { from { opacity: 0; transform: scaleX(.75) scaleY(2.2); } to { opacity: 1; transform: none; } }
@keyframes pourIn { from { opacity: .5; transform: scaleY(0); } to { opacity: 1; transform: none; } }
@keyframes serveOut { to { opacity: 0; transform: translateX(70%) scale(.8); } }
@keyframes serveIn { from { opacity: 0; transform: translateX(-35%); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px) scale(.5); } 35% { opacity: .9; } 100% { opacity: 0; transform: translateY(-12px) scale(1.4); } }
@keyframes wellBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wellGlow { 0%, 100% { box-shadow: 0 0 0 3px #15A04A, 0 0 0 6px rgba(21, 160, 74, .35); } 50% { box-shadow: 0 0 0 3px #15A04A, 0 0 0 11px rgba(21, 160, 74, 0); } }
@keyframes waddle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) translateY(-2px); } 75% { transform: rotate(9deg) translateY(-2px); } }
@keyframes boardWait { 0%, 100% { box-shadow: 0 0 0 3px #FFC93C, 0 3px 0 rgba(60, 35, 15, .3); } 50% { box-shadow: 0 0 0 7px rgba(255, 201, 60, .45), 0 3px 0 rgba(60, 35, 15, .3); } }
@keyframes ding { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 40% { transform: rotate(13deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
@keyframes lampFlash { 0%, 100% { opacity: 1; } 30% { opacity: .35; } }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); } 18% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes tutDrag { 0% { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(1); } 10% { opacity: 1; } 22% { transform: translate(var(--x0), var(--y0)) scale(.86); } 70% { opacity: 1; transform: translate(var(--x1), var(--y1)) scale(.86); } 85%, 100% { opacity: 0; transform: translate(var(--x1), var(--y1)) scale(1); } }
@keyframes tkIn { from { opacity: 0; transform: translateY(-34px) rotate(-7deg); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes lowPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes starIn { from { opacity: 0; transform: scale(0) rotate(-45deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .chef { transition: none; }
  .well.hint .heap, .well.hint .pan, .steam i, .chef.walk .chef-svg, .hud-coins b.bump, .hud-clock.low, .g-board.shake, .g-board.waiting, .drag-ghost.shake .gh-ico,
  .tk.fresh, .tk.late .tk-time, .pass.ding .bell, .pass.ding .lamp, .stars .on,
  .g-bsvg .pc.new, .g-bsvg .pour.new, .g-bsvg .sm.new, .g-bsvg .fx, .g-bsvg .logs > g, .g-bsvg.serve-in svg, .g-bsvg.serve-out svg { animation: none !important; }
  .steam { display: none; }
  .pop { animation: popFade .9s linear forwards; }
  .drag-ghost.fly { transition: opacity .15s linear; }
}
@keyframes popFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* admin */
.admin { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.admin-tabs .tab { flex: 0 0 auto; padding: 0 16px; background: var(--surface-2); }
.admin-tabs .tab.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t.versions tr.on td { background: var(--good-soft); }
table.t.versions td { vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t th.num { text-align: right; }
table.t td .rate { display: inline-block; min-width: 3.2em; font-variant-numeric: tabular-nums; }
table.t td .rate + .bar { display: inline-block; vertical-align: middle; width: calc(100% - 3.6em); min-width: 50px; }
/* on a narrow screen the name stays in view while a wide table scrolls sideways */
@media (max-width: 720px) {
  table.t.sticky1 th:first-child, table.t.sticky1 td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  table.t.sticky1 td:first-child { background: var(--surface); }
  table.t.sticky1 tr.click:hover td:first-child { background: var(--surface-2); }
}
.admin-tabs .tab-gap { flex: 1 1 0; min-width: 0; }
.admin-tabs .tab.dl { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.admin-tabs .tab.dl::before { content: '\2193'; margin-right: 6px; font-weight: 700; }
#admin-msg { margin: -8px 0 12px; min-height: 0; }
#admin-msg:empty { display: none; }
.detail .msg { margin: 6px 0 0; font-size: 14px; }
.detail .msg:empty { display: none; }
.detail .msg .btn { margin-left: 6px; }
.newpass { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; user-select: all; }
.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.admin { background: var(--info-soft); color: var(--info); }
.pill.off { background: var(--bad-soft); color: var(--bad); }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--good); }
.editor { width: 100%; min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); white-space: pre; tab-size: 2; }
.errlist { margin: 8px 0 0; padding-left: 18px; color: var(--bad); font-size: 14px; }
.detail { margin-top: 16px; }
.two { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } }

/* admin: kitchen layout editor */
.btn:disabled { opacity: .45; cursor: default; }
.ke-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.ke-cols { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-right: 6px; }
.ke-cols b { min-width: 2ch; text-align: center; font-size: 18px; }
.ke-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) { .ke-main { grid-template-columns: minmax(0, 1fr) 290px; align-items: start; } }
.ke-stage { position: relative; padding: 14px 8px 12px; border-radius: 16px; background: #E8D9C0 repeating-conic-gradient(#E8D9C0 0 25%, #DECAA9 0 50%) 0 0 / 44px 44px; overflow-x: auto; }
.ke-newrow { margin: 10px auto 0; max-width: 420px; padding: 10px; border: 2px dashed rgba(94, 63, 36, .45); border-radius: 11px; text-align: center; color: #6E4423; font-weight: 600; font-size: 13.5px; }
.ke-newrow.on { background: rgba(93, 181, 75, .22); border-color: #3F9A4A; }
.ke-marker { position: absolute; z-index: 5; width: 5px; border-radius: 3px; background: #1F5FA0; box-shadow: 0 0 0 2px #FFFFFF; pointer-events: none; }
.krow.over { box-shadow: 0 0 0 3px #C9302C, inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -8px 0 #A8723C; }
.well.selected .pan { box-shadow: 0 0 0 3px #1F5FA0, inset 0 3px 4px rgba(0, 0, 0, .3); }
.gap-slot { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0; border: 2px dashed rgba(94, 63, 36, .5); border-radius: 8px; background: rgba(255, 255, 255, .25); color: #7A5A3A; font: 600 11px var(--display); cursor: grab; touch-action: none; }
.gap-slot.selected { border: 2px solid #1F5FA0; }
@media (min-width: 900px) { .ke-side { position: sticky; top: 10px; } }
.ke-who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ke-who b { display: block; font-size: 16px; }
.ke-who small { color: var(--ink-2); }
.ke-gapico { width: 40px; height: 40px; flex: 0 0 auto; border: 2px dashed var(--line-2); border-radius: 8px; }
.ke-ctl { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.ke-ctl > span { width: 52px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ke-ctl b { min-width: 2ch; text-align: center; font-size: 17px; }
.ke-side .btn.block { margin-top: 8px; }
.ke-tips { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.ke-tips li + li { margin-top: 6px; }
.ke-shelf { display: flex; flex-wrap: wrap; gap: 8px; min-height: 64px; padding: 10px; border: 2px dashed var(--line-2); border-radius: 14px; }
.ke-shelf.on { border-color: var(--accent); background: var(--accent-soft); }
.ke-tile { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; cursor: grab; touch-action: none; }
.ke-tile span { font-size: 14px; font-weight: 600; line-height: 1.15; }
.ke-tile small { display: block; font-size: 11.5px; font-weight: 700; color: var(--bad); }
.ke-tile.needed { border-color: var(--bad); }
.ke-tile.selected { box-shadow: 0 0 0 2px var(--info); }
.ke-tile.lifted, .gap-slot.lifted { opacity: .4; }

/* admin: the organizer */
.org-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.org-head h2 { margin: 0; }
.org-head .fine { margin: 2px 0 0; }
.org-ok { color: var(--good); font-weight: 650; }
.org-warn { color: var(--warn); font-weight: 650; }
.org-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 12px 0 14px; padding: 6px; border-radius: 14px; background: var(--surface-2); }
.org-step { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 12px 4px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 650; }
.org-step .n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 800; }
.org-step.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.org-step.on .n { background: var(--accent); color: var(--accent-ink); }
.org-step .b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.org-step .b.ok { background: var(--good-soft); color: var(--good); }
.org-step .b.warn { background: var(--warn-soft); color: var(--warn); }
.org-step .b.bad { background: var(--bad-soft); color: var(--bad); }
.org-arrow { color: var(--ink-3); font-weight: 700; }
@media (max-width: 640px) {
  .org-steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .org-steps::-webkit-scrollbar { display: none; }
  .org-arrow { display: none; }
  .org-step { flex: 0 0 auto; padding-right: 9px; }
}
.org-note { margin-bottom: 12px; }
.org-body .muted { max-width: 760px; }
.org-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.org-h { margin: 18px 0 8px; font-size: 16px; }
.org-card .org-h:first-child { margin-top: 0; }
.org-sub { margin: 14px 0 6px; font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.org-grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.org-grid3 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 640px) { .org-grid2 { grid-template-columns: 1fr 1fr; } .org-grid3 { grid-template-columns: 1fr 1fr 2fr; } }
.org-grow { flex: 1 1 auto; min-width: 0; }
.org-add { margin-top: 8px; }
.org-next { display: flex; justify-content: flex-end; margin: 18px 0 6px; }
.field select { width: 100%; min-height: 46px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; color: var(--ink); }
.btn.tiny { min-height: 30px; min-width: 30px; padding: 2px 7px; font-size: 13px; border-radius: 9px; }
/* stations */
.org-station { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.org-st-ico { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
.org-st-main { flex: 1 1 240px; min-width: 0; }
.org-st-main .field { margin-top: 0; }
.org-st-act { display: flex; gap: 6px; flex-wrap: wrap; }
.org-seg { display: inline-flex; margin-top: 10px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.org-seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; color: var(--ink-2); }
.org-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* station pills */
.org-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.org-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 14px 4px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-weight: 650; }
.org-pill.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 3px 13px 3px 7px; }
/* menu: item list and editor */
.org-menu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 900px) { .org-menu { grid-template-columns: 280px minmax(0, 1fr); } .org-list { position: sticky; top: 10px; } }
.org-list .org-card { padding: 10px; max-height: calc(100vh - 40px); overflow: auto; }
.org-cat { margin: 10px 4px 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--ink-3); text-transform: uppercase; }
.org-cat:first-child { margin-top: 2px; }
.org-li { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.org-li:hover { background: var(--surface-2); }
.org-li.on { background: var(--accent-soft); color: var(--accent); }
.org-li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-list .btn.block { margin-top: 10px; }
.org-item-top { display: flex; gap: 14px; align-items: flex-start; }
.org-item-top .field:first-child { margin-top: 0; }
.org-bigico { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 82px; padding: 8px 4px 6px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--tile); color: var(--ink-2); }
.org-bigico small { font-size: 11.5px; font-weight: 650; }
.org-bigico:hover { border-color: var(--accent); }
.org-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.org-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 3px 12px 3px 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); }
.org-chip small { display: block; margin-left: 4px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.org-chip.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 2px 11px 2px 5px; }
.org-chip.add { padding-left: 12px; border-style: dashed; color: var(--accent); font-weight: 700; }
.org-chip.small { min-height: 30px; font-size: 13px; }
.org-chip:disabled { opacity: .45; }
.org-looks .org-chip { padding-left: 12px; }
.org-stepcard { margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.org-stephead { display: flex; align-items: center; gap: 8px; }
.org-stepno { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; }
.org-stepname { flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; font-weight: 700; }
.org-line-btns { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.org-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 8px; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.org-line-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 200px; }
.org-line-amt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-thing { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; font-weight: 700; color: var(--ink); text-align: left; }
.org-thing:hover { background: var(--surface-2); }
.org-thing.small { font-size: 14px; border: 1px solid var(--line-2); padding: 2px 10px 2px 4px; }
.org-amt { display: inline-flex; align-items: center; gap: 4px; }
.org-amt input { min-height: 32px; padding: 4px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; }
.org-amt input[type="number"] { width: 46px; text-align: center; }
.org-amt .org-unit { width: 78px; }
.org-amt .org-note-in { width: 140px; }
.org-pickbadge { padding: 2px 8px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 12px; font-weight: 800; }
.org-picklabel { width: 120px; min-height: 32px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 700; }
.org-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.org-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 3px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.org-tag button { border: 0; background: transparent; color: var(--ink-3); padding: 0 4px; font-size: 12px; min-height: 26px; }
.org-stepadd { margin-top: 8px; gap: 6px; flex-wrap: wrap; }
.org-empty { margin: 8px 2px 0; }
.org-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.org-opt select, .org-inline select { min-height: 34px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; }
.org-opt-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.org-inline input { min-height: 32px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; color: var(--ink); }
.org-optlabel { width: 150px; }
.org-pct { width: 58px; text-align: right; }
.org-color input { width: 48px; height: 34px; padding: 2px; }
.org-item-act { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }
/* space and place */
.org-space { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 900px) { .org-space { grid-template-columns: 300px minmax(0, 1fr); } }
.org-size { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-weight: 600; }
.org-stepper { display: inline-flex; align-items: center; gap: 8px; }
.org-stepper b { min-width: 2ch; text-align: center; font-size: 18px; }
.org-stage { position: relative; padding: 12px 8px; border-radius: 16px; background: #E8D9C0 repeating-conic-gradient(#E8D9C0 0 25%, #DECAA9 0 50%) 0 0 / 44px 44px; overflow-x: auto; }
.org-stage.kiosk-stage { background: #DCEFF0 repeating-conic-gradient(#DCEFF0 0 25%, #CDE5E6 0 50%) 0 0 / 44px 44px; }
.org-area-label { margin: 2px 4px 6px; font: 800 14px var(--display); color: #5E3F24; }
.org-area-label small { font-weight: 600; color: #8A6A4A; margin-left: 6px; }
.org-area-label:not(:first-child) { margin-top: 14px; }
.org-tablewrap { display: flex; justify-content: center; padding: 6px 4px; border-radius: 12px; border: 2px solid #5E3F24; background: linear-gradient(#F0C78F, #E2B176); }
.kiosk-stage .org-tablewrap { border-color: #2F5F63; background: linear-gradient(#FBF8F2, #EEE7DB); }
.gap-slot.free { border: 1.5px dashed rgba(94, 63, 36, .28); background: rgba(255, 255, 255, .12); cursor: default; }
.org-stage .krow { min-height: calc(var(--cell, 60px) + var(--row-chrome, 17px)); }
.org-stage .krow.trow { min-height: calc(var(--tcell, 52px) + var(--row-chrome, 17px)); }
.org-more { margin-top: 10px; }
.org-stage .well .tag > span { font-size: 12px; }
/* publish */
.org-big { font-size: 18px; font-weight: 750; margin: 0 0 8px; }
.org-problems { list-style: none; margin: 0 0 10px; padding: 0; }
.org-problems li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--bad); }
.org-problems li:first-child { border-top: 0; }
.org-tips { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.org-tips li + li { margin-top: 4px; }
.org-check { display: flex; gap: 8px; align-items: center; font-size: 14.5px; font-weight: 600; }
.org-check input { width: 20px; height: 20px; }
.org-pubrow { margin-top: 14px; gap: 8px; flex-wrap: wrap; }
/* modals */
.org-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30, 24, 18, .45); }
.org-modal { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 20px)); max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px); display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); overflow: hidden; }
.org-mhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.org-mhead h3 { margin: 0; font-size: 18px; }
.org-search { margin: 4px 16px 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 16px; }
.org-mscroll { flex: 1 1 auto; overflow: auto; padding: 4px 16px 14px; }
.org-mfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.org-picgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.org-pic { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 12px; font-weight: 600; line-height: 1.15; color: var(--ink); text-align: center; }
.org-pic:hover { border-color: var(--accent); background: var(--accent-soft); }
.org-pic.on { border: 2px solid var(--accent); background: var(--accent-soft); }
.org-pic.off { opacity: .4; }
.org-pic em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.org-chgrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.org-modal .org-item-top { margin-top: 6px; }

/* ---------- organizer: floor plan ---------- */
.org-ftools { display: flex; flex-wrap: wrap; margin: 6px 0 14px; }
.org-ftools button[disabled] { opacity: .45; }
.org-floor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.org-fpanel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.org-fpanel > p { margin: 0; }
.org-fpanel .org-h { margin-top: 0; }
.org-fpanel .org-seg { margin-top: 0; flex-wrap: wrap; }
.org-fseg { display: flex; flex-wrap: wrap; }
.org-fseg button { padding: 0 10px; font-size: 13.5px; }
.org-fmapbox { position: sticky; top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #FFFDF9; box-shadow: var(--shadow); }
.org-fmapbox.placing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#org-fmap svg { display: block; width: 100%; height: auto; max-height: 78vh; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--display); }
#org-fmap svg.tool-shape, #org-fmap svg.tool-walls, #org-fmap svg.tool-doors, #org-fmap svg.tool-rooms { cursor: crosshair; }
#org-fmap svg.tool-things .fp-thing, #org-fmap svg.tool-doors .fp-door { cursor: grab; }
#org-fmap .fp-corner, #org-fmap .fp-plus { cursor: move; }
#org-fmap .fp-plus:hover circle { fill: #EEEDFE; }
.fp .fp-label { pointer-events: none; }
.fp .fp-halo { paint-order: stroke; stroke: #FBF6EE; stroke-width: 0.14px; stroke-linejoin: round; }
.org-fmsg { position: absolute; z-index: 4; left: 16px; right: 16px; top: 14px; display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid #B8CDE6; background: #E8F1FB; color: #17324F; font-size: 14px; font-weight: 600; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.org-fmsg-x { flex: none; margin: -4px -6px -4px auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 20px; line-height: 1; }
@media (max-width: 560px) {
  .org-fmsg { left: 8px; right: 8px; top: 8px; padding: 5px 6px 5px 9px; font-size: 12.5px; font-weight: 600; }
  .org-fmsg-x { width: 26px; height: 26px; font-size: 18px; }
}
.org-ferr { margin: 0; padding: 8px 12px 8px 28px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.org-fshift { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.org-fshift span { margin-right: 4px; }
.org-fsmall { display: none; margin: -4px 0 8px; }
@media (max-width: 860px) { .org-fsmall { display: block; } }
.org-fsize { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 600; }
.org-stepper { display: inline-flex; align-items: center; gap: 4px; }
.org-stepper b { min-width: 26px; text-align: center; }
.org-fbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.org-fsel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.org-finsp { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
.org-finsp .field { margin: 0; }
.org-finsp-h { display: flex; align-items: center; gap: 10px; }
.org-finsp-h b { font-size: 16px; }
.org-flist { display: flex; flex-direction: column; gap: 2px; }
.org-fli { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.org-fli:hover { background: var(--surface-2); }
.org-fli.on { background: var(--accent-soft); color: var(--accent); }
.org-fli i { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid rgba(0, 0, 0, .18); }
.org-fli small { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.org-fli small.warn { color: var(--warn); }
.org-fadd select { flex: 1; min-height: 40px; }
.org-fgroup h4 { margin: 10px 0 6px; font-size: 13px; color: var(--ink-2); text-transform: none; }
.org-ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 5px; }
.org-ftile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.12; text-align: center; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.org-ftile .ico { width: 24px; height: 24px; }
.org-ftile:hover { border-color: var(--accent); }
.org-ftile.on { border-color: var(--accent); background: var(--accent-soft); }
.org-ftile.station { border-color: #AFA9EC; background: #F6F5FF; }
.org-ftile.placed { opacity: .5; cursor: default; }
.org-ftile small { font-size: 10.5px; color: var(--ink-3); }
.org-ftrace { padding-top: 6px; border-top: 1px dashed var(--line); }
.org-ftrace h4 { margin: 4px 0; font-size: 14px; }
.org-ftrace p { margin: 0 0 6px; }
.org-filebtn { display: inline-flex; align-items: center; cursor: pointer; }
@media (max-width: 860px) {
  .org-floor { grid-template-columns: 1fr; }
  .org-fmapbox { position: relative; order: -1; } /* still the frame for the message shown on the map */
}

/* ---------- shop tour ---------- */
.station.tour-card { border-style: dashed; }
.screen.tour { padding-bottom: 24px; }
.tr-top { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.tr-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tr-title b { font-family: var(--display); font-size: 19px; }
.tr-title small { color: var(--ink-2); font-size: 13px; }
.tr-score { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; color: var(--ink-2); }
.tr-score b { min-width: 44px; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 17px; }
.tr-card { margin-bottom: 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.tr-card.ok { border-color: #2E8B57; background: #EEF8F1; }
.tr-card.bad { border-color: #D9483B; background: #FDF0EE; }
.tr-ask { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.tr-q { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-family: var(--display); font-size: 24px; line-height: 1.12; }
.tr-q .ico { flex: none; }
.tr-center { justify-content: center; text-align: center; }
.tr-line { margin: 6px 0 0; font-size: 14.5px; }
.tr-fb { margin: 8px 0; font-weight: 700; font-size: 15px; }
.tr-fb.ok { color: #23764A; }
.tr-fb.bad { color: #B3261E; }
.tr-card .btn { margin-top: 2px; }
/* a steady card: the map under it doesn't jump as the text changes */
.tr-card.tr-find .tr-q { min-height: 2.3em; }
.tr-card.tr-find .tr-q b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-fbrow { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 6px; }
.tr-fbrow .tr-fb { flex: 1; margin: 0; }
.tr-fbrow .tr-fb:not(.ok):not(.bad) { color: var(--ink-3); font-weight: 600; }
.tr-fbrow .btn { flex: none; margin: 0; }
.tr-card.tr-info { height: 9.6em; overflow-y: auto; }
.tr-turned { margin: 4px 0 0; text-align: center; }
/* a phone on its side: the card beside the map */
@media (orientation: landscape) and (max-height: 520px) {
  .screen.tour { display: grid; grid-template-columns: minmax(220px, 38%) 1fr; grid-template-rows: auto 1fr auto; column-gap: 12px; align-items: start; }
  .screen.tour .tr-top { grid-column: 1; grid-row: 1; }
  .screen.tour .tr-card { grid-column: 1; grid-row: 2; }
  .screen.tour .tr-actions { grid-column: 1; grid-row: 3; }
  .screen.tour .tr-map { grid-column: 2; grid-row: 1 / span 3; }
  .screen.tour .tr-turned { display: none; }
  .screen.tour .tr-map svg { max-height: calc(100vh - 52px); } /* (beats the general rule below; room for the page's padding) */
  .app.tour-on { max-width: none; }
  .tr-card.tr-info { height: auto; max-height: calc(100vh - 150px); }
}
.tr-done .actions { margin-top: 12px; }
.tr-map { padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: #FFFDF9; }
.tr-map svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 220px); margin: 0 auto; font-family: var(--display); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.tr-actions { margin-top: 12px; }
@media (prefers-color-scheme: dark) {
  .tr-card.ok { background: #16301f; }
  .tr-card.bad { background: #3a1a17; }
  .tr-map, .org-fmapbox { background: #FFFDF9; }
}
