:root {
  color-scheme: dark;
  --bg: #1e3932;
  --ink: #fff;
  --muted: #c6d1cc;
  --line: rgba(255,255,255,.16);
  --accent: #00a862;
  --on: #fff;
  --card: #16302a;
  --fill: #142822;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(ellipse 88% 42% at 50% 200px, rgba(255,255,255,.075), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { display: block; border-radius: 50%; }
.brand img.ring { animation: ring .6s ease; }
@keyframes ring {
  0% { transform: rotate(0); }
  20% { transform: rotate(18deg); }
  40% { transform: rotate(-16deg); }
  60% { transform: rotate(10deg); }
  100% { transform: rotate(0); }
}
h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; padding: 0;
  background-image: linear-gradient(var(--ink), var(--ink));
  -webkit-mask: url(/assets/menu.svg) center / 22px 22px no-repeat;
  mask: url(/assets/menu.svg) center / 22px 22px no-repeat;
}
.icon-btn[hidden] { display: none; }
.nav-streak {
  position: absolute; top: 8px; right: 10px; z-index: 21;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--accent); color: var(--on);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  pointer-events: none;
}
.nav-streak[hidden] { display: none; }
.drawer {
  position: absolute; top: 64px; right: 12px; z-index: 30;
  width: min(280px, calc(100vw - 24px));
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 16px 36px rgba(4,20,16,.45);
}
.drawer[hidden] { display: none !important; }
.drawer .btn { width: 100%; }
.drawer .btn.on {
  background: var(--accent);
  color: var(--on);
  box-shadow: 0 6px 16px rgba(0,168,98,.32);
}
.add input, #shop, #shop-name, #webhook, #tea-find, .line input {
  width: 100%; border: 1px solid var(--line); background: var(--fill); color: var(--ink);
  border-radius: 16px; padding: 12px 14px; min-height: 44px; caret-color: var(--ink);
}
input::placeholder { color: var(--muted); opacity: 1; }
main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}
main:has(#dock) {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.panel, .add { display: flex; flex-direction: column; gap: 8px; }
.line button, .add button, .btn.ghost, .queue-row button {
  min-height: 44px; border-radius: 22px; border: 1px solid transparent;
  background: var(--card); padding: 10px 16px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 14px rgba(4,20,16,.28);
}
.chip.on {
  background: var(--accent); color: var(--on); border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0,168,98,.32);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chips.shelves .chip { flex: 0 1 auto; }
.chip, .btn { scroll-margin: 80px; }
.chip {
  min-height: 44px; min-width: 44px; flex: 1 1 46%;
  border-radius: 22px; border: 1px solid transparent;
  background: var(--card); padding: 10px 16px; font-weight: 600; text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 14px rgba(4,20,16,.22);
}
.btn {
  min-height: 48px; border: 0; border-radius: 24px; padding: 14px 16px;
  background: var(--accent); color: var(--on); font-weight: 700;
  box-shadow: 0 8px 18px rgba(0,168,98,.3);
}
.btn.ghost { color: var(--ink); }
.btn.ghost { background: var(--card); box-shadow: 0 4px 12px rgba(4,20,16,.28); }
.chip:active, .btn:active { transform: translateY(1px); }
.bellbar {
  background: var(--bg);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.preview { min-height: 20px; margin-bottom: 8px; font-weight: 700; }
.btn.bell { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; }
.btn.bell img { display: block; width: 22px; height: 22px; }
#tea-find { width: 100%; margin: 0 0 8px; }
.tea-row { flex-wrap: wrap; }
.tea-row[hidden], .pick[hidden], .cat[hidden], .menu-cat[hidden], .text-btn[hidden], #dock-build[hidden], #dock-temp[hidden], .letters[hidden], .sheet[hidden], .recents[hidden], .stage-note[hidden], .stage-name[hidden] { display: none !important; }
.line { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.line span { flex: 1; font-weight: 700; }
.line button, .add button { flex: 0 0 auto; }

.block {
  border: 1px solid transparent;
  border-radius: 22px;
  margin: 0 0 14px;
  overflow: visible;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(4,20,16,.28);
}
.block h2 {
  margin: 0;
  padding: 14px 16px 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background: transparent;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
}
.block-body { padding: 12px 14px 14px; }
.cat.cat-follow { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--line); }
.cat-name {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.picks { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; text-align: left;
  border-radius: 16px; border: 1px solid transparent;
  background: var(--fill); padding: 12px 14px; font-weight: 600;
}
.pick-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; min-width: 0; }
.pick-note { font-weight: 500; font-size: 13px; color: var(--muted); }
.pick em {
  font-style: normal; font-weight: 600; font-size: 12px;
  letter-spacing: 0; text-transform: none; color: var(--muted);
}
.pick.on {
  background: var(--fill);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.pick.on em { color: var(--muted); }
.sublabel { margin: 12px 0 8px; font-size: 13px; font-weight: 700; }
.sublabel:first-child { margin-top: 0; }
.block .line input, .block #shop-name, .block #webhook { width: auto; flex: 1; min-width: 0; }
.block .tea-row input[data-field="name"] { flex: 1 1 160px; min-width: 140px; }
.block .tea-row input[data-field="category"] { flex: 1 1 96px; min-width: 96px; }
.block .tea-row input[data-field="note"] { flex: 1 1 100%; }
.tea-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.block #shop-name, .block #webhook { width: 100%; }
.hook-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.hook-actions .btn { flex: 1; }
.status { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
pre.sent {
  margin: 10px 0 0; padding: 10px; background: var(--fill); border-radius: 12px;
  overflow: auto; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.queue-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.queue-row:first-child { border-top: 0; padding-top: 0; }
.queue-main { flex: 1; min-width: 0; }
.queue-drink b { display: block; font-weight: 700; }
.queue-drink b + b { font-weight: 500; }
.queue-main span { color: var(--muted); font-size: 13px; }
.queue-main .mark { color: var(--accent); font-size: 12px; margin-right: 6px; }
.empty { margin: 0; color: var(--muted); }
.toast {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15; display: flex; justify-content: center;
  padding: 0 16px; opacity: 0; pointer-events: none;
  background: transparent; box-shadow: none;
}
.toast.show { opacity: 1; }
.toast p {
  margin: 0; min-width: 0; max-width: min(480px, 100%);
  display: flex; flex-direction: column; align-items: center;
  background: var(--accent); color: var(--on); border-radius: 20px;
  padding: 12px 16px; font-weight: 700; text-align: center; line-height: 1.35;
  box-shadow: 0 8px 18px rgba(0,168,98,.3);
}
.toast .lead { font-size: 15px; }
.toast .ticket { display: block; }
.toast .mark { margin-right: 4px; }
.toast .bit { white-space: nowrap; }
.party {
  position: fixed; inset: 0; z-index: 14;
  width: 100%; height: 100%;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .party { display: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.finder {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg);
  padding-bottom: 8px;
}
body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  background: rgba(0,0,0,.5);
}
.sheet-card {
  width: min(520px, 100%);
  height: 92dvh;
  overflow: auto;
  background: var(--bg);
  border: 0;
  border-radius: 28px 28px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 40px rgba(4,20,16,.5);
}
.find-row { display: flex; gap: 8px; align-items: center; }
.find-row input { flex: 1; min-width: 0; }
.text-btn {
  border: 0; background: transparent; color: var(--accent);
  font-weight: 700; min-height: 44px; padding: 0 2px;
}
.meta { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.chips.rail {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 8px;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips.rail::-webkit-scrollbar { display: none; }
.chips.rail .chip { flex: 0 0 auto; }
.chips.rail .n { margin-left: 6px; font-size: 12px; font-weight: 700; opacity: .72; }
.letters {
  display: flex; gap: 2px; overflow-x: auto; margin: 0 0 8px;
  scrollbar-width: none;
}
.letters::-webkit-scrollbar { display: none; }
.letters button {
  flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px;
  border: 0; border-radius: 16px; background: transparent;
  padding: 0; font-size: 12px; font-weight: 700; color: var(--accent);
}
.letters button:disabled { color: var(--line); }
.menu-save {
  position: sticky; bottom: 0; z-index: 12;
  background: var(--bg);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.bday {
  flex: 0 0 auto;
  height: 22px;
  margin: 0 0 8px;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Liberation Serif", Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
}
.dock {
  --stage: calc(100dvh - 68px - 8px - 16px - 30px - env(safe-area-inset-bottom));
  --lift: 104px;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
  flex: 1 1 auto;
  padding: 0;
}
.dock-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: var(--stage);
  padding-bottom: var(--lift);
  pointer-events: none;
}
.dock-hero .stage-name,
.dock-hero .stage-note {
  position: absolute;
  left: 16px;
  right: 16px;
  margin: 0;
  pointer-events: auto;
  text-align: center;
}
.dock-hero .stage-name { top: calc(var(--stage) / 2 + 93px - var(--lift) / 2); }
.dock-hero .stage-note { top: calc(var(--stage) / 2 + 140px - var(--lift) / 2); }
#dock-build { position: relative; z-index: 1; }
.glass { width: 232px; height: auto; display: block; color: rgba(255,255,255,.92); }
.glass .liquid { fill: color-mix(in srgb, var(--brew, #c4a36a) calc(100% - var(--sweet, 0%)), #f6f1e6); opacity: 1; transition: fill .3s ease, opacity .25s ease; }
.glass[data-milk="1"] .liquid { fill: color-mix(in srgb, var(--brew, #c4a36a) calc(42% - var(--sweet, 0%) * 0.5), #f3e6c4); }
.glass.empty .liquid,
.glass.empty .glint { opacity: 0; }
.glass:not(.empty) .floor { opacity: 0; }
.glass .glint { fill: #fff; opacity: .42; transition: opacity .25s ease; }
.glass .foam { opacity: 0; transition: opacity .25s ease; }
.glass[data-foam="1"] .foam { opacity: 1; }
.glass .foam ellipse { fill: #f4eee4; }
.glass .foam .hi { fill: #fff; opacity: .8; }
.glass .ice { opacity: 0; transition: opacity .25s ease; }
.glass[data-temp="iced"] .ice { opacity: 1; }
.glass .ice .ft { fill: rgba(255,255,255,.97); }
.glass .ice .fl { fill: rgba(214,232,238,.92); }
.glass .ice .fr { fill: rgba(176,208,220,.84); }
.glass .saucer { opacity: 0; }
.glass.saucer .saucer { opacity: 1; }
.glass .steam { opacity: 0; }
.glass[data-temp="hot"] .steam { opacity: 1; }
.glass .steam path.hi { display: none; }
.glass.steam-hi .steam path:not(.hi) { display: none; }
.glass.steam-hi[data-temp="hot"] .steam path.hi { display: inline; }
.glass .steam path {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
  animation: steam 2.6s ease-in-out infinite;
}
.glass .steam path:nth-child(2) { animation-delay: .35s; }
.glass .steam path:nth-child(3) { animation-delay: .7s; }
.glass .dust { opacity: 0; transition: opacity .25s ease; }
.glass[data-top="1"] .dust { opacity: 1; }
.glass .dust circle { fill: var(--dust, #f0e2c0); }
@keyframes steam {
  0% { transform: translateY(3px); opacity: .15; }
  40% { opacity: .8; }
  100% { transform: translateY(-7px); opacity: 0; }
}
.stage-name {
  border: 0; background: transparent; padding: 0 12px;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Liberation Serif", Georgia, serif;
  font-size: 32px; font-weight: 500; letter-spacing: 0;
  text-align: center; line-height: 1.2;
}
.dock.quiet .stage-name { color: var(--muted); }
.store-head { justify-content: space-between; margin-bottom: 8px; }
.store-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.store-balance { margin: 4px 0 0; text-align: center; font-size: 48px; font-weight: 700; line-height: 1; }
.store-unit, .store-served, .store-next, .store-hint { margin: 4px 0 10px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.store-streak { margin: 12px 0 4px; text-align: center; font-size: 15px; font-weight: 600; }
.store-feature, .store-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border-radius: 16px; padding: 12px;
  margin: 8px 0;
}
.store-feature b { display: block; font-size: 16px; }
.store-feature span, .store-price { color: var(--muted); font-weight: 700; }
.store-name { flex: 1; font-weight: 700; }
.store-row .btn, .store-feature .btn { flex: 0 0 auto; min-width: 96px; }
.store-group { margin-top: 16px; }
.store-group h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.store-group .store-hint { text-align: left; margin: 0 0 4px; }
.glass.steam-hi .steam path:nth-child(5) { animation-delay: .35s; }
.glass.steam-hi .steam path:nth-child(6) { animation-delay: .7s; }
.stage-note { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; }
.recents { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; max-width: 420px; }
.recents button {
  border: 0; background: transparent; color: var(--muted);
  font-weight: 500; min-height: 36px; padding: 4px 0;
}
.dock .chips { flex-wrap: wrap; justify-content: center; margin: 0; }
.dock .chip {
  flex: 0 1 auto;
  min-height: 44px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 15px;
  background: var(--card);
  border-color: transparent;
  color: var(--ink);
}
.dock .chip.on {
  background: var(--accent);
  color: var(--on);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0,168,98,.34);
}
#dock-build {
  width: 100%;
  margin-top: calc(160px - var(--stage) / 2 - var(--lift) / 2);
  margin-bottom: 16px;
}
.opt { width: 100%; padding-top: 14px; }
.opt-k { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.dock .opt-k { text-align: center; }
.opt .chips + .chips { margin-top: 8px; }
.dock .btn.bell {
  position: sticky; bottom: 0; z-index: 5;
  width: 100%;
  margin-top: auto;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,168,98,.34);
}
.dock.quiet .btn.bell {
  position: absolute;
  left: 50%;
  top: calc(var(--stage) / 2 + 109px - var(--lift) / 2);
  bottom: auto;
  height: auto;
  transform: translateX(-50%);
  width: min(280px, 100%);
  margin-top: 0;
  z-index: 2;
}
.dock:not(.quiet) .dock-hero {
  min-height: 0;
  padding: 0;
  justify-content: flex-start;
}
.dock:not(.quiet) .stage-name,
.dock:not(.quiet) .stage-note {
  position: static;
  left: auto;
  right: auto;
}
.dock:not(.quiet) #dock-build {
  margin-top: 0;
  margin-bottom: 8px;
}
.dock:not(.quiet) .opt { padding-top: 8px; }
.dock:not(.quiet) .btn.bell {
  position: static;
  margin-top: auto;
}
@media (max-height: 760px) {
  .dock:not(.quiet) .glass { width: 168px; }
  .dock:not(.quiet) .dock-hero { gap: 4px; }
  .dock:not(.quiet) .opt { padding-top: 4px; }
  .dock:not(.quiet) .stage-name { font-size: 28px; }
}
