/* ── 테마 ──
   minimal: A 미니멀 (전체 밝게)
   gallery: A+C 갤러리 (앱은 밝게, 그라인더 액자와 다이얼 화면만 어둡게) */
:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --text: #121212;
  --muted: #8C8B86;
  --line: #EAE8E2;
  --soft: #F1F0EC;
  --primary: #121212;
  --primary-ink: #FAFAF7;
  --accent: #C2410C;
  --num: #121212;
  --grind: #121212;
  --frame: #FFFFFF;
  --frame-line: var(--line);
  --mat: #F3F2EE;
  --label: #121212;
  --bar: #121212;
  --bar-prev: #D6D4CE;
  --danger: #B42318;
  --radius: 16px;
  --tabbar-h: 64px;
  color-scheme: light;
}
:root[data-theme="gallery"] {
  --bg: #F6F5F1;
  --line: #E7E5DF;
  --soft: #EFEDE8;
  --primary: #141416;
  --primary-ink: #F2EFEA;
  --accent: #D6A468;
  --grind: #B7834A;
  --frame: #141416;
  --frame-line: #141416;
  --mat: radial-gradient(110% 90% at 50% 25%, #2b2b2f 0%, #141416 75%);
  --label: #F2EFEA;
}
/* 갤러리 테마의 다이얼 화면은 전체를 어둡게 */
:root[data-theme="gallery"] body[data-page="dial"] {
  --bg: #0D0D0E;
  --surface: #17171A;
  --text: #F2EFEA;
  --muted: #8B8882;
  --line: #2A2A2E;
  --soft: #1F1F23;
  --num: #D6A468;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Pretendard Variable", Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  transition: background .25s;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

#view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}
.page { display: flex; flex-direction: column; gap: 16px; animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.stack { display: flex; flex-direction: column; gap: 10px; }

.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
/* 앱 이름은 MyCoffeeLog 표기 그대로 */
.eyebrow.brandmark { text-transform: none; letter-spacing: .1em; font-size: 11px; font-weight: 600; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.page-head .center-title { font-size: 17px; flex: 1; text-align: center; }
.head-title { flex: 1; text-align: center; min-width: 0; }
.head-title .title { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn, .icon-btn-spacer {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card p { margin: 0 0 12px; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; background: var(--soft); transition: transform .1s, opacity .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.stacked { flex-direction: column; gap: 0; min-height: 58px; padding: 8px 18px; }
.btn.stacked small { font-weight: 400; font-size: 12px; opacity: .7; }
.row-actions { display: flex; gap: 8px; }
.row-actions > * { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 8px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--text); margin-bottom: 12px; }
.empty p { margin: 0 0 20px; }

/* ── 홈: 액자 갤러리 ── */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.frame {
  display: block; background: var(--frame); padding: 10px; border-radius: 4px;
  border: 1px solid var(--frame-line); transition: transform .15s;
}
:root[data-theme="gallery"] .frame:not(.add) { box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
.frame:active { transform: scale(.98); }
.mat { background: var(--mat); aspect-ratio: 1; display: grid; place-items: center; border-radius: 2px; }
.mat svg { width: 86%; height: 86%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.mat .product { width: 100%; height: 100%; display: grid; place-items: center; }
.mat .product svg { width: 100%; height: 94%; filter: none; }
/* 이미지 그림은 밝은 배경에 맞춰 그려져 있어서 두 테마 모두 밝은 액자 안쪽을 쓴다 */
.mat:has(.product.image) { background: #F3F2EE; }
.mat .product.image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.label { padding: 10px 2px 2px; color: var(--label); }
.label .brand { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.label .model { font-size: 13px; font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label .value { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.label .value b { font-size: 26px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
:root[data-theme="gallery"] .label .value b { color: var(--accent); font-weight: 400; }
.label .value small { font-size: 11px; color: var(--muted); }
.frame.add {
  background: transparent; border: 1px dashed var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; min-height: 140px;
}

/* ── 다이얼 화면 ── */
.dial-page { gap: 4px; }
.readout { text-align: center; margin-top: 8px; }
.readout b { font-size: 84px; font-weight: 200; letter-spacing: -.045em; line-height: 1.05; color: var(--num); }
.readout .unit { font-size: 15px; color: var(--muted); margin-left: 4px; }
.readout small { display: block; font-size: 12px; color: var(--muted); min-height: 18px; }
.face { width: min(290px, 78vw); aspect-ratio: 1; margin: 18px auto 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.face.side { width: min(320px, 86vw); aspect-ratio: 300 / 240; cursor: ew-resize; }
.face:active { cursor: grabbing; }
.face svg { width: 100%; height: 100%; display: block; }
.face .rot, .mat .rot { transform-origin: 150px 150px; transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
.face.dragging .rot { transition: none; }
.steppers { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--soft); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.round-btn:active { transform: scale(.94); }
.diff { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; min-height: 20px; }
.diff b { color: var(--text); }
.dial-link { text-align: center; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; margin-top: 6px; }

/* ── 레시피 목록 ── */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; color: var(--muted);
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; border: 0 !important; background: transparent !important; min-height: 44px; outline: none; color: var(--text); box-shadow: none !important; padding: 0 !important; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--muted); }
.chip.on { color: var(--text); border-color: var(--text); font-weight: 600; }
.recipe-item { display: flex; gap: 12px; align-items: center; }
.ri-main { flex: 1; min-width: 0; }
.ri-bean { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-meta { font-size: 13px; color: var(--muted); }
.ri-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ri-grind { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; max-width: 42%; }
.ri-grind .num { font-size: 28px; font-weight: 300; letter-spacing: -.03em; line-height: 1; color: var(--grind); }
.ri-grind .unit, .ri-gname { font-size: 11px; color: var(--muted); }
.ri-gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── 레시피 카드 ── */
.recipe-card { display: flex; flex-direction: column; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.rc-title { min-width: 0; }
.rc-title h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; overflow-wrap: anywhere; }
.rc-grind { text-align: right; flex: none; }
.rc-grind b { font-size: 44px; font-weight: 300; letter-spacing: -.04em; line-height: 1; color: var(--grind); }
.rc-grind .u { font-size: 11px; color: var(--muted); margin-left: 3px; }
.rc-grind small { display: block; font-size: 11px; color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.specs div { padding: 10px 0; min-width: 0; }
.specs div:nth-child(n+4) { border-top: 1px solid var(--line); }
.specs dt { font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.specs dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pour-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 20px 0 8px; flex-wrap: wrap; }
.pour-head b { font-size: 13px; }
.pour-head > span { font-size: 11px; color: var(--muted); display: flex; gap: 10px; }
.lg { display: inline-block; width: 10px; height: 6px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.lg.now { background: var(--bar); }
.lg.prev { background: var(--bar-prev); }
.pours { list-style: none; margin: 0; padding: 0; }
.pour { display: grid; grid-template-columns: 38px 32px 1fr 52px; gap: 8px; align-items: center; min-height: 40px; }
.p-time { font-size: 12px; color: var(--muted); }
.p-label { font-size: 13px; font-weight: 700; }
.p-bar { position: relative; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.p-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.p-bar .prev { left: 0; background: var(--bar-prev); }
.p-bar .now { background: var(--bar); }
.p-g { text-align: right; line-height: 1.1; }
.p-g b { display: block; font-size: 15px; font-weight: 700; }
.p-g small { font-size: 11px; color: var(--muted); }
.pour.end { border-top: 1px dashed var(--line); margin-top: 4px; }
.pour.end .p-label { color: var(--muted); grid-column: 2 / -1; }
.memo { margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--line); white-space: pre-wrap; }

/* ── 폼 ── */
.form { display: flex; flex-direction: column; gap: 12px; }
.form .card { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
input:not([type="radio"]):not([type="file"]):not([type="checkbox"]):not([type="range"]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--text); }
input[readonly] { background: var(--soft); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.top-gap { margin-top: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; margin: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 4px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.step-head, .step { display: grid; grid-template-columns: 62px 70px 1fr 36px; gap: 6px; align-items: center; }
.step-head { font-size: 11px; color: var(--muted); padding: 0 2px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step input { padding: 8px !important; min-height: 42px !important; text-align: center; }
.step .icon-btn { width: 36px; height: 36px; }
.step .icon-btn svg { width: 18px; height: 18px; }
.with-unit { position: relative; }
.with-unit input { padding-right: 24px !important; }
.with-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.summary { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.summary:empty { display: none; }
.summary b { color: var(--text); font-size: 16px; }

/* ── 설정 ── */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.theme-pick label { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.theme-pick label:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick b { font-size: 14px; margin-top: 6px; }
.theme-pick small { font-size: 11px; color: var(--muted); }
.icon-pick { display: flex; gap: 10px; margin: 6px 0 8px; }
.icon-pick label { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.icon-pick label:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick img { border-radius: 22.4%; box-shadow: 0 0 0 1px var(--line); }
.icon-pick b { font-size: 13px; }
.swatch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: 44px; padding: 4px; border-radius: 8px; background: #F6F5F1; border: 1px solid #E7E5DF; }
.swatch i { border-radius: 3px; }
.swatch.minimal i { background: #fff; border: 1px solid #E7E5DF; }
.swatch.gallery i { background: radial-gradient(circle at 50% 30%, #2b2b2f, #141416); }
.switch-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.switch-row input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch-row input:checked { background: var(--primary); }
.switch-row input:checked::after { transform: translateX(18px); }

/* ── 대화상자, 토스트 ── */
dialog.sheet { border: 0; border-radius: 20px; padding: 20px; width: min(360px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .4); }
dialog.sheet h3 { font-size: 16px; margin-bottom: 12px; }
.big-input { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.big-input input { font-size: 32px !important; font-weight: 600; text-align: center; }
.big-input span { color: var(--muted); flex: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 10px); opacity: 0; transition: .25s;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 하단 탭 ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current] { color: var(--text); font-weight: 700; }

@media (max-width: 360px) {
  .specs { grid-template-columns: repeat(2, 1fr); }
  .specs div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .readout b { font-size: 72px; }
}
@media (hover: hover) {
  .card.recipe-item:hover { border-color: var(--text); }
}

/* ── 시간 선택 버튼 ── */
.time-btn {
  width: 100%; min-height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); font-size: 16px; font-variant-numeric: tabular-nums; cursor: pointer; text-align: center;
}
.time-btn.empty { color: var(--muted); }
.time-btn:active { background: var(--soft); }
.time-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.time-range > span { color: var(--muted); }
.time-range .time-btn { min-height: 46px; }

/* ── 휠 시간 선택 (아이폰 스타일) ── */
/* 아이폰처럼 화면 아래쪽에 붙어서 올라온다 */
dialog.wheel-sheet { width: min(380px, calc(100% - 24px)); margin: auto auto calc(env(safe-area-inset-bottom) + 12px); }
.wheels { position: relative; display: flex; justify-content: center; align-items: center; gap: 4px; height: 220px; margin: 4px 0 16px; }
.wheel { position: relative; width: 110px; height: 220px; }
.wheel-list {
  height: 220px; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none;
  padding: 88px 0; box-sizing: border-box; perspective: 600px; outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-item {
  height: 44px; line-height: 44px; text-align: center; scroll-snap-align: center;
  font-size: 26px; font-variant-numeric: tabular-nums; cursor: pointer; transform-origin: center; user-select: none;
}
.wheel-unit { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }
.wheel-band {
  position: absolute; left: 8px; right: 8px; top: 50%; height: 44px; transform: translateY(-50%);
  background: var(--soft); border-radius: 10px; pointer-events: none;
}
.wheel-colon { position: relative; font-size: 24px; font-weight: 600; color: var(--muted); }
.wheels > .wheel, .wheels > .wheel-colon { z-index: 1; }

/* ── 공유 창 ── */
dialog.share-sheet { width: min(420px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; }
dialog.share-sheet > * + * { margin-top: 12px; }
.share-preview { position: relative; display: grid; place-items: center; min-height: 200px; background: var(--soft); border-radius: 12px; padding: 12px; }
.share-preview img { display: block; max-width: 100%; max-height: 46vh; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.share-preview img:not([src]) { display: none; }
.share-preview [data-loading] { position: absolute; }

/* ── 레시피 카드 머리 버튼, 완료 줄 ── */
.head-actions { display: flex; gap: 4px; }
.pour.end .p-end { grid-column: 1 / -1; display: flex; gap: 12px; align-items: baseline; }
.pour.end .p-end .p-label { color: var(--muted); }

/* ── 원두 탭 ── */
.ribbon { display: inline-flex; height: 6px; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.ribbon i { flex: 1; min-width: 20px; }
.bean-item { display: flex; gap: 12px; align-items: center; }
.bean-blob { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.bean-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bean-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bean-meta { font-size: 12px; color: var(--muted); }
.bean-notes { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; font-size: 12px; }
.bean-notes span { display: inline-flex; align-items: center; gap: 4px; }
.bean-notes i, .note-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.bean-score { font-size: 24px; font-weight: 300; letter-spacing: -.03em; color: var(--grind); flex: none; }
.bean-score small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.bean-score.big { font-size: 32px; }

.bean-detail { display: flex; flex-direction: column; }
.bean-title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 8px; overflow-wrap: anywhere; }
.bean-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.radar-card { padding: 8px 8px 12px; }
.radar { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.sub-title { font-size: 13px; font-weight: 700; margin: 18px 0 6px; }
.flavor-list { list-style: none; margin: 0; padding: 0; }
.flavor-list li { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.flavor-ic { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid; display: grid; place-items: center; font-size: 20px; flex: none; }
.flavor-list b { display: block; font-size: 15px; }
.flavor-list small { font-size: 12px; }
.info-table { display: grid; grid-template-columns: 54px 1fr; gap: 8px 10px; font-size: 14px; margin: 0; }
.info-table dt { color: var(--muted); }
.info-table dd { margin: 0; font-weight: 600; }
.vis-note { margin: 16px 0 0; }
.row-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 600; }
.bean-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.bean-link svg { width: 15px; height: 15px; }

/* 원두 평가 입력 */
.score-row { display: grid; grid-template-columns: 38px 1fr 24px; gap: 10px; align-items: center; font-size: 14px; }
.score-row b, .total-out { color: var(--grind); text-align: right; }
.total-out { font-size: 28px; font-weight: 300; letter-spacing: -.02em; }
.total-out small { font-size: 12px; color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--soft); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--soft); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: #C9A06A; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.link-btn { border: 0; background: none; color: var(--grind); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 0; }
.note-row { display: flex; flex-wrap: wrap; gap: 6px; cursor: pointer; }
.note-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); cursor: pointer; }
.note-chip.on { color: var(--text); border-color: var(--text); font-weight: 600; }
.note-chip .x { font-weight: 400; color: var(--muted); }
.note-chip.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.seg.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg-3 span { font-size: 13px; padding: 8px 4px; }

/* 맛 고르기 창 (플레이버 휠) */
dialog.flavor-sheet { width: min(420px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow-y: auto; padding: 14px 16px 18px; }
.flavor-head { display: flex; justify-content: space-between; align-items: center; }
.flavor-head b { font-size: 16px; }
.flavor-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; margin: 6px 0 10px; }
.flavor-picked .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.flavor-wheel-wrap { display: flex; justify-content: center; }
.flavor-wheel { width: 100%; max-width: 330px; height: auto; display: block; touch-action: manipulation; }
.flavor-notes { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.flavor-notes .note-row { margin-top: 8px; }

/* 설정: 공개 범위 기본값 */
.vis-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; font-size: 15px; }
.vis-row select { width: auto; min-height: 38px; padding: 6px 10px; }

/* 원두 평가: 사용한 레시피 고르기 */
.recipe-pick { display: flex; flex-direction: column; gap: 6px; }
.recipe-opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.recipe-opt input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 0; }
.recipe-opt > span { display: flex; flex-direction: column; min-width: 0; }
.recipe-opt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-opt small { font-size: 12px; }
.recipe-opt:has(input:checked) { border-color: var(--text); }
.bean-link + .bean-link { margin-left: 8px; }

/* HOT / ICE */
.type-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }
.type-badge.hot { background: #FBE9DF; color: #C2410C; }
.type-badge.ice { background: #E3EEFB; color: #2F6FED; }
.eyebrow .type-badge { letter-spacing: .08em; }
.seg.brew-type span { font-size: 14px; }

/* 계정, 로그인 */
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.notice { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.agree { gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.check span { flex: 1; }
.check a { font-size: 13px; color: var(--muted); }
.check.all { font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.account-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 8px; }
.account-row b { display: block; font-size: 16px; }
.account-row small { color: var(--muted); font-size: 13px; word-break: break-all; }
.sync-state { font-size: 13px; color: var(--muted); }
.sync-state.error { color: var(--danger); }
.account-actions { margin-top: 8px; }
.legal h2 { font-size: 15px; margin: 18px 0 6px; }
.legal h2:first-child { margin-top: 0; }
.legal p { font-size: 14px; line-height: 1.65; }
.btn.social { gap: 8px; }
.btn.social svg { width: 20px; height: 20px; }
.btn.social.kakao { background: #FEE500; color: rgba(0, 0, 0, .85); border-color: #FEE500; }
.btn.social.google { background: #fff; color: #1F1F1F; border-color: #DADCE0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 2px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-box { display: flex; flex-direction: column; gap: 8px; }
.social-box:not(:has(.social:not([hidden]))) { display: none; }

/* 소셜: 프로필, 탐색 */
.avatar { display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: none; border-radius: 50%; background: var(--soft); color: var(--text); font-weight: 700; border: 1px solid var(--line); }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.md { width: 44px; height: 44px; font-size: 17px; }
.avatar.lg { width: 76px; height: 76px; font-size: 30px; }
.author { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: inherit; }
.author b { font-size: 14px; }
.author small { color: var(--muted); font-size: 12px; }
.author-wrap { margin-bottom: 10px; }
.rc-title .author { margin-top: 8px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 8px; }
.ph-name h1 { font-size: 22px; font-weight: 700; margin: 0; }
.ph-name small { color: var(--muted); font-size: 14px; }
.ph-bio { margin: 0; font-size: 14px; }
.ph-stats { display: flex; gap: 20px; justify-content: center; font-size: 12px; color: var(--muted); }
.ph-stats span { display: flex; flex-direction: column; align-items: center; }
.ph-stats b { font-size: 17px; color: var(--text); }
.profile-head .btn { max-width: 320px; }
.gear-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.static { cursor: default; display: inline-flex; align-items: center; color: var(--text); }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top-list a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: inherit; }
.top-list .rank { font-weight: 800; width: 18px; color: var(--grind); }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-main small { color: var(--muted); font-size: 12px; }
.top-list .bean-score { font-size: 20px; }
.person-row { display: flex; align-items: center; gap: 12px; color: inherit; }
.pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item { display: flex; flex-direction: column; gap: 6px; }
.fi-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fi-head small { font-size: 12px; white-space: nowrap; }
.empty-feed h2 { margin-bottom: 6px; }
.guest-wrap { position: relative; }
.guest-blur { filter: blur(5px); opacity: .7; pointer-events: none; user-select: none; display: flex; flex-direction: column; gap: 14px; }
.guest-cta { position: absolute; left: 0; right: 0; top: 40px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.handle-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding-left: 12px; }
.handle-input i { font-style: normal; color: var(--muted); }
.handle-input input { flex: 1; border: 0 !important; box-shadow: none !important; background: transparent !important; padding-left: 4px !important; }
.handle-status { font-size: 12px; min-height: 16px; color: var(--muted); }
.handle-status.ok { color: #15803D; }
.handle-status.bad { color: var(--danger); }
.me-link { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.me-link > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
.ph-stats a { display: flex; flex-direction: column; align-items: center; color: inherit; }
.ph-stats .muted-num { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.6; }
.person-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.source-link { display: inline-flex; margin: 6px 8px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.notice.small { font-size: 13px; margin-top: 10px; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; }
.rank-item .rank { width: 22px; flex: none; font-size: 18px; font-weight: 800; color: var(--grind); padding-top: 34px; text-align: center; }
.rank-item .feed-item { flex: 1; min-width: 0; }
.imports { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 그라인더로 찾기 */
.dist-card { display: flex; flex-direction: column; gap: 12px; }
.dist-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dist-summary > div { background: var(--soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.dist-summary small { width: 100%; font-size: 11px; color: var(--muted); }
.dist-summary b { font-size: 28px; font-weight: 300; letter-spacing: -.03em; color: var(--grind); line-height: 1.1; }
.dist-summary span { font-size: 12px; color: var(--muted); }
.dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dist li { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.d-label { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.d-bar { height: 12px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.d-bar i { display: block; height: 100%; background: var(--text); border-radius: 6px; min-width: 4px; opacity: .75; }
.d-n { font-size: 12px; color: var(--muted); min-width: 20px; }
.dist li.mine .d-label, .dist li.mine .d-n { color: var(--text); font-weight: 700; }
.dist li.mine .d-bar i { background: var(--accent); opacity: 1; }
.people-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 6px; }
.people-scroll::-webkit-scrollbar { display: none; }
.person-card { flex: none; width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-align: center; }
.person-card b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card small { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card .reason { color: var(--grind); }
a.chip { display: inline-flex; align-items: center; color: var(--text); }

/* 프로필 QR */
.profile-share { text-align: center; }
.qr-box { width: 220px; height: 220px; margin: 8px auto 4px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.qr-box svg { width: 200px; height: 200px; }
.qr-name { margin: 6px 0 0; }
.qr-url { margin: 2px 0 6px; font-size: 12px; color: var(--muted); word-break: break-all; }
.profile-share .row-actions { margin: 10px 0 8px; }

/* 커뮤니티 */
.community-head { display: flex; align-items: center; gap: 8px; }
.community-head .chips { flex: 1; min-width: 0; margin-right: 0; padding-right: 0; }
.write-btn { flex: none; gap: 4px; }
.write-btn svg { width: 16px; height: 16px; }
.sort-row { display: flex; gap: 14px; margin: 2px 0 4px; }
.sort-btn { border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.sort-btn.on { color: var(--text); font-weight: 700; }
.post-row { display: flex; flex-direction: column; gap: 4px; color: inherit; }
.pr-top { display: flex; gap: 6px; align-items: center; }
.board-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--soft); font-size: 11px; font-weight: 700; color: var(--text); }
.board-tag.question { background: #E8F0FE; color: #1D4ED8; }
.board-tag.recipe { background: #FDF0E6; color: #B45309; }
.board-tag.gear { background: #ECFDF3; color: #047857; }
.solved { font-size: 11px; font-weight: 700; color: #047857; }
.attach-tag, .hidden-tag { font-size: 11px; color: var(--muted); }
.hidden-tag { color: var(--danger); }
.pr-title { font-size: 15px; }
.pr-excerpt { margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.post { display: flex; flex-direction: column; gap: 10px; }
.post-title { font-size: 21px; font-weight: 700; line-height: 1.35; margin: 4px 0 0; }
.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post-body { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.7; }
.helpful-btn { align-self: flex-start; min-height: 38px; gap: 6px; }
.helpful-btn.on, .c-btn.on { color: var(--accent); border-color: var(--accent); }
.hidden-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: #FEF3F2; color: var(--danger); font-size: 12px; }
.attachment { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }
.att-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.board-seg { grid-template-columns: repeat(4, 1fr); }
.board-seg span { font-size: 14px; padding: 8px 4px; }
textarea { width: 100%; resize: vertical; font: inherit; line-height: 1.6; }

/* 댓글 */
.comments { display: flex; flex-direction: column; gap: 4px; }
.thread { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; flex-direction: column; gap: 4px; }
.comment.reply { margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--line); }
.comment.accepted { background: #ECFDF3; border-radius: 12px; padding: 10px; }
.accepted-badge { align-self: flex-start; font-size: 11px; font-weight: 700; color: #047857; }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.c-head small { font-size: 11px; white-space: nowrap; }
.c-body { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.c-actions { display: flex; gap: 4px; align-items: center; }
.c-btn { border: 1px solid transparent; background: none; font-size: 12px; color: var(--muted); padding: 4px 8px; border-radius: 999px; cursor: pointer; }
.c-btn.more { margin-left: auto; font-size: 16px; line-height: 1; }
.c-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.c-form.reply { margin: 0 0 0 22px; }
.c-form-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* 아래에서 올라오는 선택지 */
.action-sheet h3 { font-size: 15px; text-align: center; margin: 0 0 10px; }
.as-list { display: flex; flex-direction: column; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.as-item { border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 15px; font-size: 15px; color: var(--text); cursor: pointer; }
.as-item:last-child { border-bottom: 0; }
.as-item.danger { color: var(--danger); }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; margin-bottom: 10px; }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); }
.pick-item small { color: var(--muted); font-size: 12px; }

/* 설정 링크, 운영자 */
.link-list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); }
.link-list a { padding: 12px 0; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--line); }
.link-list a:last-child { border-bottom: 0; }
.report-card { display: flex; flex-direction: column; gap: 6px; }
.rp-top { display: flex; align-items: center; gap: 8px; }
.rp-top small { margin-left: auto; }
.rp-body { margin: 0; font-size: 13px; white-space: pre-wrap; background: var(--soft); border-radius: 10px; padding: 8px 10px; }

/* 추천, 인증 배지 */
.vbadge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 999px; background: #E8F0FE; color: #1D4ED8; font-size: 10px; font-weight: 700; white-space: nowrap; }
.ph-name .vbadge { margin: 4px auto 2px; height: 22px; font-size: 12px; }
.ph-name { display: flex; flex-direction: column; align-items: center; }
.reason-tag { font-size: 11px; font-weight: 600; color: var(--grind); white-space: nowrap; }
.rec-note { margin: 10px 0 0; }
.center-link { display: block; margin: 12px auto 0; }
.name-suggest { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.name-suggest small { font-size: 11px; color: var(--muted); }
.ns-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ns-chips .chip { min-height: 30px; padding: 0 12px; color: var(--text); background: var(--surface); }
.ns-chips .chip i { font-style: normal; margin-left: 6px; font-size: 11px; color: var(--muted); }
.sub-title + p.muted.small { margin-top: -12px; margin-bottom: 0; }
/* 계정 줄: 버튼 글자는 한 줄로, 긴 이메일은 말줄임 */
/* 버튼 윗선을 닉네임 글자 윗선에 맞춘다 */
.account-row .btn.small { flex: none; white-space: nowrap; align-self: flex-start; margin-top: -3.8px; }
.account-row .me-link { flex: 1; min-width: 0; }
.account-row .me-link small { display: block; }
/* 이메일: 아이디와 같은 줄에서 시작해서 버튼 아래까지 쓴다 */
.account-row { flex-wrap: wrap; row-gap: 0; }
.account-row .me-email { flex-basis: 100%; padding-left: 54px; margin-top: -2.4px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 닉네임, 아이디, 이메일 줄 간격을 살짝 좁게 */
.account-row .me-link b { line-height: 1.35; }
.account-row .me-link small, .account-row .me-email { line-height: 1.35; }
