@import url("https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy/subsets/Paperlogy-dynamic-subset.css");

/* ───────── 토큰 ───────── */
:root {
  --orange: #FF7A1A;
  --orange-press: #F0640B;
  --orange-ink: #B34700;      /* 밝은 바탕 위 오렌지 글씨 (대비 5.5:1) */
  --orange-soft: #FFE6D1;
  --espresso: #2B1B12;
  --roast: #6B3F26;
  --paper: #FFFBF6;
  --surface: #FFFFFF;
  --surface-2: #FFF4EA;
  --line: #F1E2D3;
  --text: #2B1B12;
  --muted: #7A6455;           /* 대비 5.5:1 */
  --water: #2F8FEA;
  --water-soft: #D6EBFF;
  --good: #23864C;
  --warn: #B77A00;
  --bad: #D33A3F;
  --glass: rgba(255, 251, 246, .74);
  --glass-line: rgba(255, 255, 255, .7);
  --shadow-1: 0 1px 2px rgba(43, 27, 18, .06), 0 2px 8px rgba(43, 27, 18, .05);
  --shadow-2: 0 8px 28px rgba(107, 63, 38, .16);
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-xl: 32px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Paperlogy", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #17100B;
  --surface: #221810;
  --surface-2: #2C1F15;
  --line: #3A2A1E;
  --text: #FFF3E8;
  --muted: #C2A897;
  --orange-ink: #FF9A4D;
  --orange-soft: #43260F;
  --water: #5DB0FF;
  --water-soft: #16324D;
  --good: #4CC27F;
  --warn: #E9B23F;
  --bad: #FF6B6F;
  --glass: rgba(34, 24, 16, .72);
  --glass-line: rgba(255, 255, 255, .08);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ───────── 바탕 ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: #F6E7D8; color: var(--text);
  font-family: var(--font); font-weight: 450; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  word-break: keep-all; overflow-wrap: anywhere;
}
:root[data-theme="dark"] body { background: #0E0906; }
button, input, select, textarea { font: inherit; color: inherit; }
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: 16px !important; } } /* 아이폰: 16px보다 작으면 누를 때 화면이 확대된다 */
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 8px; }

.app {
  position: relative; max-width: 480px; min-height: 100dvh; margin: 0 auto;
  background: var(--paper); overflow-x: clip;
}
@media (min-width: 560px) {
  body { background: radial-gradient(1200px 700px at 20% 0%, #FFD3AE, transparent 60%), radial-gradient(900px 600px at 100% 100%, #FFC79A, transparent 55%), #F6E7D8; }
  :root[data-theme="dark"] body { background: radial-gradient(1000px 600px at 20% 0%, #3A1E0B, transparent 60%), #0E0906; }
  .app { box-shadow: 0 0 0 1px rgba(43,27,18,.06), 0 30px 80px rgba(107,63,38,.18); }
}

.view { padding: calc(var(--safe-t) + 18px) 20px calc(var(--tab-h) + var(--safe-b) + 36px); min-height: 100dvh; }
.view.enter { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ───────── 머리 ───────── */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.top h1 { font-size: 24px; font-weight: 850; }
.top .sub { color: var(--muted); font-size: 13px; }
.top .grow { flex: 1; min-width: 0; }
.back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-1); flex: none; }
.back svg { width: 20px; height: 20px; }
.hello { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.hello .momo { flex: none; margin-bottom: -4px; }
.hello h1 { font-size: 22.5px; }
.hello p { color: var(--muted); font-size: 13px; }

/* ───────── 저울 칩 ───────── */
.scale-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.scale-chip i { width: 9px; height: 9px; border-radius: 50%; background: #C9B8AA; }
.scale-chip[data-state="virtual"] i { background: var(--water); }
.scale-chip[data-state="bookoo"] i { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.scale-chip[data-state="connecting"] i { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ───────── 입력 ───────── */
.search { position: relative; margin: 6px 0 12px; }
.search input {
  width: 100%; height: 48px; border-radius: var(--r-m); border: 1.5px solid var(--line);
  background: var(--surface); padding: 0 16px 0 44px; font-size: 15px; outline: none;
  transition: border-color .15s;
}
.search input:focus { border-color: var(--orange); }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 10px 14px; font-size: 15px; outline: none; transition: border-color .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ───────── 칩 ───────── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 16px; padding: 2px 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface);
  border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background .18s, color .18s, border-color .18s, transform .2s var(--spring);
}
.chip[aria-pressed="true"] { background: var(--espresso); color: #FFF3E8; border-color: var(--espresso); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--orange); color: var(--espresso); border-color: var(--orange); }
.chip:active { transform: scale(.95); }

/* ───────── 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 750; font-size: 15.5px; white-space: nowrap;
  background: var(--orange); color: var(--espresso);
  box-shadow: 0 6px 18px rgba(255, 122, 26, .35), inset 0 -2px 0 rgba(0,0,0,.08);
  transition: transform .22s var(--spring), background .15s, box-shadow .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.96); background: var(--orange-press); }
.btn.wide { width: 100%; }
.btn.dark { background: var(--espresso); color: #FFF3E8; box-shadow: 0 6px 18px rgba(43,27,18,.25); }
:root[data-theme="dark"] .btn.dark { background: #FFF3E8; color: var(--espresso); }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.btn.small { height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.link { color: var(--orange-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.wx-chip { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity .2s; }
.wx-chip svg { width: 18px; height: 18px; color: var(--orange-ink, var(--text)); }
.wx-chip.busy { opacity: .55; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn svg { width: 22px; height: 22px; }

/* ───────── 오늘의 한 잔 ───────── */
.feature {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px;
  padding: 20px; border-radius: var(--r-l); margin-bottom: 22px; overflow: hidden;
  background: var(--orange); color: var(--espresso); text-align: left; width: 100%;
  box-shadow: 0 14px 34px rgba(255, 122, 26, .32);
  transition: transform .25s var(--spring);
}
.feature:active { transform: scale(.98); }
.feature::before {
  content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%);
}
.feature small { font-size: 12px; font-weight: 700; opacity: .8; }
.feature h2 { font-size: 21.5px; margin: 2px 0 10px; }
.feature .specs span { background: rgba(43, 27, 18, .1); }
.feature .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 800; font-size: 14px; }
.feature .momo { margin: 0 -6px -8px 0; filter: drop-shadow(0 6px 8px rgba(43,27,18,.2)); }

/* ───────── 스펙 묶음 ───────── */
.specs { display: flex; flex-wrap: wrap; gap: 6px; }
.specs span {
  display: inline-flex; align-items: baseline; gap: 4px; height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--surface-2); font-size: 12px; font-weight: 600; line-height: 28px;
}
.specs b { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ───────── 레시피 카드 ───────── */
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 10px; }
.section-h h2 { font-size: 16.5px; }
.section-h small { color: var(--muted); font-size: 12px; }
.list { display: grid; gap: 10px; }
.card {
  position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 10px 14px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1);
  text-align: left; width: 100%; transition: transform .22s var(--spring), box-shadow .2s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card:active { transform: scale(.98); }
.card .badge {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--orange-soft); color: var(--orange-ink);
}
.card .badge svg { width: 30px; height: 30px; }
.card .badge.iced { background: var(--water-soft); color: var(--water); }
.card h3 { font-size: 15.5px; font-weight: 750; margin-bottom: 2px; }
.card .by { font-size: 12px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .meta em { font-style: normal; color: var(--muted); font-weight: 500; }
.star { width: 44px; height: 44px; display: grid; place-items: center; color: #CDB9A8; transition: transform .3s var(--spring), color .2s; }
.star svg { width: 24px; height: 24px; }
.star[aria-pressed="true"] { color: var(--orange); }
.star[aria-pressed="true"] svg { fill: currentColor; }
.star.pop { transform: scale(1.3); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.tag.mine { background: var(--orange-soft); color: var(--orange-ink); }
.more-btn { width: 100%; height: 48px; border-radius: var(--r-m); border: 1.5px dashed var(--line); color: var(--muted); font-weight: 650; margin-top: 4px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* ───────── 빈 화면 ───────── */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 12px; }
.empty h2 { font-size: 17.5px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 30ch; text-wrap: balance; }
.empty .btn { margin-top: 8px; }

/* ───────── 패널 ───────── */
.panel { background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow-1); margin-bottom: 14px; }
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kv div { background: var(--surface-2); border-radius: 12px; padding: 10px 8px; text-align: center; min-width: 0; }
.kv.k2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .kv.k2 { grid-template-columns: repeat(4, 1fr); } }
.kv small { display: block; }
.kv b { display: block; font-size: clamp(14px, 4.1vw, 17.5px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; letter-spacing: -.02em; }
.kv small { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ───────── 레시피 상세 ───────── */
.detail-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-bottom: 16px; }
.detail-hero h1 { font-size: 24px; }
.detail-hero p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.dose { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); font-size: 20.5px; font-weight: 700; box-shadow: var(--shadow-1); }
.stepper button:active { transform: scale(.92); }
.stepper output { min-width: 74px; text-align: center; font-weight: 800; font-size: 17.5px; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 10px 0; align-items: start; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline .t { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--orange-ink); font-size: 14px; padding-top: 1px; }
.timeline .w { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.timeline .w small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; }
.timeline .l b { font-weight: 750; }
.timeline .l p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notes { font-size: 13.5px; color: var(--muted); }
.notes li { margin: 4px 0; }
.sticky-cta {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  width: min(440px, calc(100% - 40px)); z-index: 30; display: flex; gap: 10px;
}
.sticky-cta .btn:first-child { flex: 1; }

/* ───────── 유리 탭바 ───────── */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b)); width: min(456px, calc(100% - 20px)); height: var(--tab-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 26px;
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  box-shadow: 0 10px 34px rgba(107, 63, 38, .18), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .35s var(--ease), opacity .25s;
}
.tabbar.hide { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.tabbar button {
  position: relative; z-index: 1; height: 100%; display: grid; place-items: center; align-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 650; color: var(--muted); transition: color .2s;
}
.tabbar button svg { width: 24px; height: 24px; transition: transform .35s var(--spring); }
.tabbar button[aria-current="page"] { color: var(--espresso); }
:root[data-theme="dark"] .tabbar button[aria-current="page"] { color: var(--espresso); }
.tabbar button[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.tabbar .pill {
  position: absolute; z-index: 0; top: 8px; left: 0; height: calc(100% - 16px); border-radius: 18px;
  background: var(--orange); box-shadow: 0 4px 14px rgba(255,122,26,.45), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .45s var(--spring), width .45s var(--spring), opacity .2s;
}
.tabbar .plus svg { width: 30px; height: 30px; padding: 3px; border-radius: 50%; background: var(--espresso); color: #FFF3E8; }
:root[data-theme="dark"] .tabbar .plus svg { background: #FFF3E8; color: var(--espresso); }

/* ───────── 바텀시트 ───────── */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(43, 27, 18, .38); opacity: 0; transition: opacity .25s; }
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 81; left: 50%; bottom: 0; width: min(480px, 100%); max-height: 92dvh;
  transform: translate(-50%, 100%); transition: transform .42s var(--ease);
  background: var(--paper); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(43,27,18,.2);
  display: flex; flex-direction: column;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet .sheet-body { overflow-y: auto; padding: 8px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
.sheet h2 { font-size: 18.5px; margin: 6px 0 14px; }
.menu { display: grid; gap: 8px; }
.menu button {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left;
  padding: 12px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .2s var(--spring);
}
.menu button:active { transform: scale(.98); }
.menu .mi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-ink); }
.menu .mi svg { width: 24px; height: 24px; }
.menu b { display: block; font-weight: 750; }
.menu small { color: var(--muted); font-size: 12px; }
.menu .danger b { color: var(--bad); }

/* ───────── 토스트 ───────── */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  transform: translate(-50%, 20px); opacity: 0; max-width: calc(100% - 40px);
  background: var(--espresso); color: #FFF3E8; padding: 12px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow-2); pointer-events: none;
  transition: transform .35s var(--spring), opacity .2s; display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast button { pointer-events: auto; color: var(--orange); font-weight: 800; }

/* ───────── 추출 화면 ───────── */
.brew {
  --paper: #FFFBF6; --surface: #FFFFFF; --surface-2: #FFF1E4; --line: #F1E2D3; --text: #2B1B12; --muted: #6E5646;
  --orange-ink: #B34700; --orange-soft: #FFE6D1; --water: #1F7FE0; --water-soft: #D6EBFF; --bad: #C2272D;
  --shadow-1: 0 1px 2px rgba(43, 27, 18, .06), 0 2px 8px rgba(43, 27, 18, .05);
  color-scheme: light;
  position: fixed; inset: 0; z-index: 60; background: var(--orange); color: var(--espresso);
  display: flex; flex-direction: column; max-width: 480px; margin: 0 auto;
  padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 16px);
  animation: brewIn .45s var(--ease) both; overflow-y: auto;
}
@keyframes brewIn { from { clip-path: circle(0 at 50% 92%); } to { clip-path: circle(150% at 50% 92%); } }
.brew-top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brew-top .grow { flex: 1; min-width: 0; text-align: center; font-weight: 750; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brew .round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(43,27,18,.1); flex: none; }
.brew .round svg { width: 22px; height: 22px; }
.brew .scale-chip { background: rgba(255,255,255,.35); box-shadow: none; height: 36px; }
.brew-stage { flex: 1; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 6px 0; }
.ring-wrap { position: relative; width: min(78vw, 330px); aspect-ratio: 1; }
.ring-wrap canvas { width: 100%; height: 100%; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; pointer-events: none; }
.ring-center .momo { margin-bottom: 2px; }
.ring-center .big { font-size: clamp(37px, 12vw, 50px); font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring-center .big small { font-size: .42em; font-weight: 750; margin-left: 2px; }
.ring-center .clock { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .8; margin-top: 4px; }
.say { min-height: 76px; text-align: center; display: grid; align-content: center; gap: 4px; }
.say h2 { font-size: 22.5px; font-weight: 850; }
.say p { font-size: 14.5px; font-weight: 550; opacity: .85; }
.say .count { font-variant-numeric: tabular-nums; }
.flow-meter { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.flow-meter span { background: rgba(255,255,255,.32); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flow-meter span.hot { background: var(--espresso); color: #FFE3CC; }
.brew-steps { display: flex; gap: 6px; justify-content: center; }
.brew-steps i { width: 26px; height: 6px; border-radius: 3px; background: rgba(43,27,18,.18); transition: background .3s, width .35s var(--spring); }
.brew-steps i.done { background: var(--espresso); }
.brew-steps i.now { background: #fff; width: 40px; }
.brew-bottom { display: grid; gap: 10px; }
.brew .btn { box-shadow: none; }
.brew .btn.dark, :root[data-theme="dark"] .brew .btn.dark { background: var(--espresso); color: #FFF3E8; }
.brew .btn.light { background: rgba(255,255,255,.4); color: var(--espresso); }
.pour-btn {
  position: relative; height: 64px; border-radius: 999px; background: var(--espresso); color: #FFF3E8;
  font-weight: 800; font-size: 16px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .2s var(--spring);
}
.pour-btn::before { content: ""; position: absolute; inset: 0; background: var(--water); transform: scaleY(0); transform-origin: bottom; transition: transform .25s var(--ease); }
.pour-btn.on { transform: scale(.97); }
.pour-btn.on::before { transform: scaleY(1); }
.pour-btn span { position: relative; }
.rate { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; }
.rate input { flex: 1; accent-color: var(--espresso); height: 32px; }
.prep-card { width: 100%; background: rgba(255,251,246,.92); color: var(--espresso); border-radius: var(--r-l); padding: 20px; display: grid; gap: 12px; }
.prep-card h2 { font-size: 19.5px; }
.prep-card p { font-size: 13.5px; color: #6E5646; }
.prep-card .weigh { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-weight: 850; font-size: 43px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.prep-card .weigh small { font-size: 16.5px; font-weight: 700; color: #6E5646; }
.prep-card .field input, .prep-card .field select { background: #fff; color: var(--espresso); border-color: #F1E2D3; }
.prep-card .field > span { color: #6E5646; }
.prep-dots { display: flex; gap: 6px; justify-content: center; }
.prep-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(43,27,18,.2); }
.prep-dots i.on { background: var(--espresso); }
.done-card { width: 100%; background: var(--paper); color: var(--text); border-radius: var(--r-l); padding: 20px; display: grid; gap: 14px; }
.score { display: flex; align-items: center; gap: 14px; }
.score-ring { --v: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--orange) calc(var(--v) * 1%), var(--surface-2) 0); }
.score-ring b { width: 66px; height: 66px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-size: 22.5px; font-weight: 850; font-variant-numeric: tabular-nums; }
.score h2 { font-size: 18.5px; }
.score p { color: var(--muted); font-size: 13px; }
.rating { display: flex; gap: 4px; }
.rating button { width: 44px; height: 44px; display: grid; place-items: center; color: #D9C6B6; transition: transform .25s var(--spring), color .15s; }
.rating button svg { width: 30px; height: 30px; }
.rating button.on { color: var(--orange); }
.rating button.on svg { fill: currentColor; }
.rating button:active { transform: scale(1.2); }
.taste { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.taste button { height: 44px; border-radius: 12px; background: var(--surface-2); font-weight: 650; font-size: 13px; transition: background .15s; }
.taste button[aria-pressed="true"] { background: var(--espresso); color: #FFF3E8; }
.scale-test { margin-top: 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; background: var(--orange-soft); border-radius: 14px; padding: 12px 14px; }
.scale-test b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.scale-test span { margin-left: 3px; font-weight: 600; }
.scale-test small { grid-column: 1 / -1; font-size: 11px; line-height: 1.5; color: var(--muted); word-break: break-all; }
.scale-test small[data-ok="0"] { color: var(--bad); }
.advice { display: flex; gap: 10px; align-items: flex-start; background: var(--orange-soft); border-radius: 14px; padding: 12px; font-size: 13.5px; }
.advice .momo { flex: none; }

/* ───────── 그래프 ───────── */
.chart { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* ───────── 기록 ───────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stats div { background: var(--surface); border-radius: var(--r-m); padding: 14px 12px; box-shadow: var(--shadow-1); }
.stats b { display: block; font-size: 22.5px; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stats small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.log-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); width: 100%; text-align: left; }
.mini-score { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: 16px; font-variant-numeric: tabular-nums; background: conic-gradient(var(--orange) calc(var(--v) * 1%), var(--surface-2) 0); position: relative; }
.mini-score::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.mini-score span { position: relative; z-index: 1; }
.log-card h3 { font-size: 14.5px; font-weight: 750; }
.log-card p { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-card .stars { color: var(--orange); font-size: 12px; letter-spacing: 1px; }
.day-h { font-size: 12.5px; font-weight: 750; color: var(--muted); margin: 18px 0 8px; }

/* ───────── 원두 ───────── */
.bean-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); width: 100%; text-align: left; }
.bean-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bean-card h3 { font-size: 16px; font-weight: 800; }
.bean-card .from { color: var(--muted); font-size: 12.5px; }
.rest { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.rest.r0 { background: var(--surface-2); color: var(--muted); }
.rest.r1 { background: #FFF1C9; color: #8A5A00; }
.rest.r2 { background: #DDF5E6; color: #1E6B40; }
.rest.r3 { background: var(--orange-soft); color: var(--orange-ink); }
.rest.r4 { background: #F3E6E6; color: #8C3B3E; }
:root[data-theme="dark"] .rest.r1 { background: #3D3110; color: #F2CB65; }
:root[data-theme="dark"] .rest.r2 { background: #123222; color: #7DDCA4; }
:root[data-theme="dark"] .rest.r4 { background: #3A1C1D; color: #F2A0A3; }
.gauge { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.gauge i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--roast), var(--orange)); transition: width .6s var(--ease); }
.bean-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ───────── 입자 분석 ───────── */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 14px; margin-bottom: 16px; position: relative; }
.seg button { position: relative; z-index: 1; height: 38px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: color .2s; }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg .seg-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-1); transition: transform .4s var(--spring), width .4s var(--spring); }
.drop { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line); border-radius: var(--r-l); background: var(--surface); }
.drop.over { border-color: var(--orange); background: var(--orange-soft); }
.drop p { color: var(--muted); font-size: 13px; text-wrap: balance; }
.only-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .only-mouse { display: inline; } }
.drop .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.howto { margin-top: 16px; }
.howto summary { font-weight: 750; cursor: pointer; padding: 8px 0; list-style: none; display: flex; justify-content: space-between; }
.howto summary::after { content: "+"; font-size: 18.5px; color: var(--muted); transition: transform .25s var(--spring); }
.howto[open] summary::after { transform: rotate(45deg); }
.howto ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.howto li { margin: 6px 0; }
.howto b { color: var(--text); }
.cornerbox { position: relative; border-radius: var(--r-m); overflow: hidden; background: #000; touch-action: none; user-select: none; }
.cornerbox img, .cornerbox canvas { width: 100%; height: auto; display: block; }
.cornerbox svg.quad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; touch-action: none; cursor: grab; }
.handle::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,122,26,.75); box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.handle.drag::before { inset: 8px; }
.loupe { position: absolute; width: 96px; height: 96px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.4); pointer-events: none; display: none; background-repeat: no-repeat; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.hist { width: 100%; height: 170px; display: block; }
.verdict { display: flex; gap: 12px; align-items: center; }
.verdict b { font-size: 20.5px; font-weight: 850; }
.verdict p { color: var(--muted); font-size: 13px; }
.scale-bar { position: relative; height: 34px; margin: 6px 0 2px; }
.scale-bar .track { position: absolute; left: 0; right: 0; top: 12px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #4B2A17, #8A5434, #C98A55, #F2C08F, #FBE3C4); }
.scale-bar .mark { position: absolute; top: 0; width: 4px; height: 34px; margin-left: -2px; border-radius: 2px; background: var(--orange); box-shadow: 0 0 0 2px var(--paper); transition: left .6s var(--spring); }
.scale-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); }
.check input { width: 22px; height: 22px; accent-color: var(--orange); }

/* ───────── 걸음 편집 ───────── */
.step-edit { display: grid; grid-template-columns: 80px 80px 1fr 40px; gap: 6px; align-items: center; margin-bottom: 6px; }
.step-edit input { height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 8px; font-size: 14px; width: 100%; outline: none; }
.step-edit input:focus { border-color: var(--orange); }
.step-head { display: grid; grid-template-columns: 80px 80px 1fr 40px; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 650; margin-bottom: 4px; }

/* ───────── 설정 ───────── */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 700; }
.set-row > .btn, .set-row > span:last-child { flex: none; }
.set-row small { display: block; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: #D9C9BB; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--orange); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--orange); outline-offset: 2px; }
.footer { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 26px; }
.footer .momo { margin: 0 auto 6px; }

/* ───────── 모모 ───────── */
.momo { overflow: visible; }
.momo .m-shadow { fill: #2B1B12; opacity: .12; }
.momo .m-face { fill: #1B0F08; stroke: #1B0F08; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.momo .m-face circle, .momo .m-face ellipse { stroke: none; }
.momo .m-face path { fill: none; }
:root[data-theme="dark"] .momo .m-body { filter: drop-shadow(0 0 1.2px rgba(255, 214, 180, .45)); } /* 어두운 바탕에서 검은 테두리가 묻히지 않게 */
.momo .m-face .m-blush { fill: #FFB4BC; stroke: none; }
.momo .m-fx * { transform-box: fill-box; transform-origin: center; }
.momo .m-wk-open { animation: wkOpen 3s infinite; }
.momo .m-wk-shut { opacity: 0; animation: wkShut 3s infinite; }
@keyframes wkOpen { 0%, 52%, 86%, 100% { opacity: 1; } 56%, 82% { opacity: 0; } }
@keyframes wkShut { 0%, 52%, 86%, 100% { opacity: 0; } 56%, 82% { opacity: 1; } }
.momo .m-drop { fill: #2F8CFF; stroke: #1B0F08; stroke-width: 2; animation: fxDrip 1.8s ease-in-out infinite; }
@keyframes fxDrip { 50% { transform: translateY(2.5px); } }
.momo .m-z { font-family: var(--font); font-weight: 800; fill: #1B0F08; opacity: 0; animation: zz 2.4s infinite; }
:root[data-theme="dark"] .momo .m-z { fill: #FFE7D2; }
.momo .m-z2 { animation-delay: .5s; }
.momo .m-z3 { animation-delay: 1s; }
@keyframes zz { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.momo .m-heart { fill: #F2303C; stroke: #1B0F08; stroke-width: 1.8; stroke-linejoin: round; animation: fxHeart 2.6s ease-out infinite; }
@keyframes fxHeart { 0% { opacity: 0; transform: translateY(4px) scale(.4); } 15% { opacity: 1; transform: translateY(0) scale(1); } 68% { opacity: 1; transform: translateY(-22px) scale(1); } 76%, 100% { opacity: 0; transform: translateY(-24px) scale(1.6); } }
.momo .m-popdots { fill: #F2303C; opacity: 0; animation: fxPop 2.6s ease-out infinite; }
@keyframes fxPop { 0%, 68% { opacity: 0; transform: scale(.3); } 76% { opacity: 1; transform: scale(1); } 90%, 100% { opacity: 0; transform: scale(1.5); } }
.momo .m-star { fill: #FFEA00; stroke: #1B0F08; stroke-width: 1.4; stroke-linejoin: round; animation: fxTwinkle 1.6s ease-in-out infinite; }
@keyframes fxTwinkle { 0%, 100% { opacity: .25; transform: scale(.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(25deg); } }
.momo .m-burst { fill: none; stroke: #1B0F08; stroke-width: 2.6; stroke-linecap: round; animation: fxBurst 1.4s ease-out infinite; }
:root[data-theme="dark"] .momo .m-burst { stroke: #FFE7D2; }
@keyframes fxBurst { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .momo .m-fx * { animation: none !important; } .momo .m-z { opacity: 1; } .momo .m-wk-open { animation: none !important; opacity: 0; } .momo .m-wk-shut { animation: none !important; opacity: 1; } }
.momo .m-body { transform-origin: 60px 100px; }
.momo.bob .m-body { animation: bob 3.2s ease-in-out infinite; }
.momo.bob .m-shadow { animation: shadow 3.2s ease-in-out infinite; transform-origin: 60px 106px; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }
@keyframes shadow { 50% { transform: scaleX(.88); opacity: .08; } }
.momo .m-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.momo.m-pop .m-body { animation: pop .5s var(--spring); }
@keyframes pop { 30% { transform: scale(1.08, .92); } 60% { transform: scale(.97, 1.04); } }

/* ───────── 시작 화면 ───────── */
.splash { position: fixed; inset: 0; z-index: 200; background: var(--orange); display: grid; place-items: center; transition: opacity .4s, visibility .4s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash .momo { animation: splashIn .7s var(--spring) both; }
@keyframes splashIn { from { transform: translateY(30px) scale(.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
