/* 새 기준 · 10번 Olive Table (배경 #FAF9F6 / 보조 #A8A29A / 포인트·글씨 #4B5320)
   간격은 4의 배수, 글자 크기는 11 · 12 · 15 · 18 · 22 · 34 여섯 단계(고딕 작은 글씨만 13). */
:root {
  --bg: #FAF9F6;
  --sub: #A8A29A;
  --point: #4B5320;
  --ink: #4B5320;
  --mute: rgba(75, 83, 32, 0.78);
  --hair: rgba(75, 83, 32, 0.08);
  --wash: rgba(75, 83, 32, 0.08);
  --serif: 'Noto Serif KR', 'Apple SD Gothic Neo', serif;
  --sans: 'IBM Plex Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  /* 숫자용 글꼴에는 한글이 없어서, 한글은 본문 글꼴로 받는다 */
  --mono: 'IBM Plex Mono', 'IBM Plex Sans KR', ui-monospace, monospace;
  color-scheme: light only;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  color: var(--ink); font-family: var(--sans); font-size: 15px;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; text-align: inherit; }
:focus-visible { outline: 2px solid var(--point); outline-offset: 3px; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 600; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 22px; }
svg { display: block; flex: none; }
input::placeholder { color: var(--mute); }
[hidden] { display: none !important; }

.app { max-width: 440px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 28px) 24px 0; }
main { flex: 1; display: flex; flex-direction: column; gap: 24px; outline: none; padding-bottom: 24px; min-width: 0; }

.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.muted { color: var(--mute); }
.t11 { font-size: 11px; } .t12 { font-size: 12px; } .t18 { font-size: 18px; }
.meta { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.head { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.base { align-items: baseline; }
.grow { flex: 1; min-width: 0; }
.g4 { gap: 4px; } .g8 { gap: 8px; } .g12 { gap: 12px; } .g16 { gap: 16px; }

.topline { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; min-height: 20px; }
.back { width: 44px; height: 44px; margin: -12px 0 -12px -18px; display: flex; align-items: center; justify-content: center; }
.icon { fill: none; stroke: var(--point); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.link { height: 44px; margin: -12px 0; display: inline-flex; align-items: center; font-family: var(--sans); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { text-decoration-style: dotted; }

/* 아래 메뉴 */
.dock { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0 calc(env(safe-area-inset-bottom) + 24px); background: var(--bg); }
.tabs { flex: 1; display: flex; }
.tabs button { flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 15px; color: var(--mute); }
.tabs button::after { content: ''; width: 16px; height: 2px; }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 500; }
.tabs button[aria-current="page"]::after { background: var(--point); }
.add { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--point); display: flex; align-items: center; justify-content: center; }
.add path { stroke: var(--bg); stroke-width: 1.5; fill: none; }

/* 오늘의 잔 */
.dial { position: relative; width: 262px; height: 262px; align-self: center; }
.dial .face { position: absolute; inset: 31px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.dial h1 { max-width: 184px; word-break: keep-all; }
.dial .empty h1 { font-size: 22px; }
.dial .tick { stroke: var(--sub); stroke-width: 2.4; }
.dial .tick.on { stroke: var(--point); }
.dial .big { font-family: var(--mono); font-size: 22px; }

.band { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--sub); border-bottom: 1px solid var(--sub); }
.band + .band { border-top: none; margin-top: -24px; }
.stat { display: flex; flex-direction: column; gap: 4px; flex: none; }
.stat b { font-family: var(--mono); font-size: 15px; font-weight: 400; }
.stat .now { font-weight: 500; }
.timebtn { height: 20px; font-family: var(--mono); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.timeinput { width: 96px; height: 28px; border: none; border-bottom: 1px solid var(--point); background: none; font-family: var(--mono); font-size: 15px; padding: 0; }
.scrollx { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scrollx::-webkit-scrollbar { display: none; }
.fade-r { -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
.pages { margin-left: auto; display: flex; }
.pages button { width: 16px; height: 44px; display: flex; align-items: center; justify-content: center; }
.pages i { width: 6px; height: 6px; border-radius: 50%; background: var(--sub); }
.pages [aria-current="true"] i { background: var(--point); }

.pill { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--sub); font-size: 15px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.pill[aria-pressed="true"], .pill.on { border: 1.5px solid var(--point); background: var(--point); color: var(--bg); font-weight: 500; }
.pill.line { border-color: var(--point); }
.pill.dashed { border: 1px dashed var(--point); }
.pill .icon { stroke: currentColor; }

/* 목록 줄 */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--hair); }
.listhead { display: flex; justify-content: space-between; align-items: center; min-height: 28px; padding-bottom: 4px; border-bottom: 1px solid var(--sub); }
.tearow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.tearow .name { display: flex; align-items: baseline; gap: 8px; min-height: 44px; flex: none; max-width: 55%; }
.tearow .name .serif { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { display: flex; align-items: center; flex-direction: row-reverse; overflow-x: auto; scrollbar-width: none; margin-right: -3px; min-width: 0; padding: 0 3px; }
.dots::-webkit-scrollbar { display: none; }
.dots.fade { -webkit-mask-image: linear-gradient(to left, #000 70%, transparent); mask-image: linear-gradient(to left, #000 70%, transparent); }
.dot { width: 18px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.dot[aria-current="true"] svg { outline: 1.5px solid var(--point); outline-offset: 0; border-radius: 50%; }

/* 한 잔 기록 · 찻잎 등록 */
.idx { display: flex; border-bottom: 1px solid var(--hair); }
.idx button { flex: 1; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: var(--mute); white-space: nowrap; }
.idx button::after { content: ''; width: 16px; height: 2px; }
.idx button[aria-pressed="true"] { color: var(--ink); font-weight: 500; }
.idx button[aria-pressed="true"]::after { background: var(--point); }
.teachips { gap: 8px; margin-right: -24px; padding-right: 24px; }
.teachip { flex: none; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--sub); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; font-size: 14px; line-height: 1.2; white-space: nowrap; }
.teachip small { font-family: var(--mono); font-size: 10px; color: var(--mute); }
.teachip[aria-pressed="true"] { border: 1.5px solid var(--point); background: var(--point); color: var(--bg); }
.teachip[aria-pressed="true"] small { color: rgba(250, 249, 246, 0.85); }
.teachip .g { font-family: var(--mono); font-size: 11px; border-bottom: 1px solid currentColor; }
.teachip input { width: 40px; height: 18px; border: none; border-bottom: 1px solid var(--bg); background: none; color: var(--bg); font-family: var(--mono); font-size: 11px; padding: 0; }

.rate { border-bottom: 1px solid var(--hair); }
.rate > div { display: flex; justify-content: space-between; align-items: center; margin: 0 -10px 0 -22px; }
.rate button { width: 56px; height: 56px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); min-width: 0; }
.field input, .bare { height: 44px; width: 100%; border: none; border-bottom: 1px solid var(--sub); border-radius: 0; background: none; color: var(--ink); font-size: 15px; padding: 12px 0 0; }
.bare { padding-top: 12px; }
.bare.title, .field input.title { font-family: var(--serif); font-size: 18px; border-bottom: 1.5px solid var(--point); padding-top: 8px; }
.pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pairs button { height: 84px; border-radius: 12px; border: 1px solid var(--sub); font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pairs button[aria-pressed="true"], .two button[aria-pressed="true"] { border: 1.5px solid var(--point); background: var(--wash); font-weight: 500; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.two button { height: 48px; border-radius: 12px; border: 1px solid var(--sub); text-align: center; }
.more { flex: none; height: 44px; margin: -8px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--sub); border-bottom: 1px solid var(--sub); }
.swatches { display: flex; justify-content: space-between; }
.swatches button { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.swatches i { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--sub); }
.swatches [aria-pressed="true"] { border: 1.5px solid var(--point); }
.swatches [aria-pressed="true"] i { width: 30px; height: 30px; }
.primary { width: 100%; height: 56px; border-radius: 28px; background: var(--point); color: var(--bg); font-weight: 500; text-align: center; }
.primary:disabled { background: none; border: 1px solid var(--sub); color: var(--mute); cursor: default; }
.foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.thumb { flex: none; border-radius: 12px; border: 1px dashed var(--point); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; overflow: hidden; background-size: cover; background-position: center; }
.thumb.has { border: 1px solid var(--sub); }
.thumb.pkg { width: 96px; height: 132px; }
.photo { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--sub); }

/* 기록 보기 */
.cup { position: relative; height: 260px; margin: 0 -24px; overflow: hidden; }
.cup svg { position: absolute; right: 0; top: 0; touch-action: manipulation; }
.cup .txt { position: absolute; left: 24px; top: 0; bottom: 0; max-width: 52%; display: flex; flex-direction: column; justify-content: center; gap: 8px; pointer-events: none; }
.cup h1 { word-break: keep-all; }
.kv { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.kv > .meta { width: 56px; flex: none; }
.kv > :last-child { flex: 1; min-width: 0; }
.infs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.inf { height: 28px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--sub); font-family: var(--mono); font-size: 12px; }
.inf[aria-pressed="true"] { background: var(--point); border-color: var(--point); color: var(--bg); }

/* 서랍 */
.seg { display: flex; align-items: baseline; gap: 16px; }
.seg button { font-family: var(--serif); font-size: 22px; color: var(--mute); min-height: 44px; }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.stockrow { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; width: 100%; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(75, 83, 32, 0.12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--point); }
.seat { display: flex; align-items: center; gap: 12px; min-height: 56px; width: 100%; padding: 8px 0; }
.seat .when { width: 40px; flex: none; }
.empty { padding: 24px 0; color: var(--mute); line-height: 1.6; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 104px); transform: translate(-50%, 8px); max-width: 320px; padding: 12px 16px; border-radius: 12px; background: var(--point); color: var(--bg); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.liquor { transform-origin: 300px 130px; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

input:focus-visible { outline: none; border-bottom-color: var(--point); box-shadow: 0 1px 0 var(--point); }

/* 저장 단추는 스크롤해도 화면 아래에 머문다 */
.foot.stick { position: sticky; bottom: 0; z-index: 2; margin-bottom: -24px; padding: 12px 0 calc(env(safe-area-inset-bottom) + 24px); background: var(--bg); border-top: 1px solid var(--hair, rgba(75,83,32,0.08)); }

#dial .face { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
