/* 하루 1% — 스타일 */
:root {
  color-scheme: light;
  --page: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e7e5df;
  --line-strong: #c3c2b7;
  --grid: #e1e0d9;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-bg: #e8f6e8;
  --warn: #fab219;
  --warn-ink: #7a5000;
  --warn-bg: #fff4da;
  --bad: #d03b3b;
  --bad-ink: #a32222;
  --bad-bg: #fde9e8;
  --pass: #8a8f9c;
  --coffee: #7a4a2a;
  --coffee-bg: #f6ede5;
  --cta: #111111;
  --cta-ink: #ffffff;
  --focus: #2a78d6;
  /* 멤버 색(데이터 시각화 팔레트 슬롯 1~8) + 그 위 글자색 */
  --c0: #2a78d6; --c0-on: #ffffff;
  --c1: #eb6834; --c1-on: #ffffff;
  --c2: #1baf7a; --c2-on: #0b0b0b;
  --c3: #eda100; --c3-on: #0b0b0b;
  --c4: #e87ba4; --c4-on: #0b0b0b;
  --c5: #008300; --c5-on: #ffffff;
  --c6: #6250d6; --c6-on: #ffffff;
  --c7: #e34948; --c7-on: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --line-strong: #4a4a46;
    --grid: #2c2c2a;
    --good-ink: #4cc94c;
    --good-bg: #112811;
    --warn-ink: #f5c04a;
    --warn-bg: #2d2410;
    --bad-ink: #f08080;
    --bad-bg: #2f1515;
    --pass: #9aa0ad;
    --coffee: #d9a57c;
    --coffee-bg: #2a2019;
    --cta: #f0efec;
    --cta-ink: #0b0b0b;
    --c0: #3987e5; --c0-on: #ffffff;
    --c1: #d95926; --c1-on: #ffffff;
    --c2: #199e70; --c2-on: #0b0b0b;
    --c3: #c98500; --c3-on: #0b0b0b;
    --c4: #d55181; --c4-on: #ffffff;
    --c5: #008300; --c5-on: #ffffff;
    --c6: #9085e9; --c6-on: #0b0b0b;
    --c7: #e66767; --c7-on: #0b0b0b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
html.noscroll, html.noscroll body { overflow: hidden; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1 1 0; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 8px; }
.bad-text { color: var(--bad-ink); }
.warn-text { color: var(--warn-ink); }
.icon { flex: none; }

/* ---------- 부팅 / 로딩 ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; gap: 16px; text-align: center; padding: 24px; }
.boot-logo, .auth-logo { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.boot-logo b, .auth-logo b, .brand b { font-weight: 900; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 32px 0; font-size: 14px; }
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 레이아웃 ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(76px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.brand { border: 0; background: none; padding: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.topbar-right { font-size: 14px; color: var(--muted); font-weight: 600; }
.main { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b));
}
.tab {
  flex: 1; max-width: 140px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 12px;
}
.tab.on { color: var(--ink); }
.tab-icon { position: relative; display: inline-flex; }
.tab-badge {
  position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ---------- 카드 / 공통 ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.section-title { margin: 10px 2px 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.section-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 22px 12px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line-strong); }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.hint.good { color: var(--good-ink); }
.quote { margin: 2px 4px 0; color: var(--ink-2); font-size: 13.5px; text-align: center; }
.divider { height: 1px; background: var(--line); margin: 6px 0; }
.footnote { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.link { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.full { width: 100%; }
.btn-primary { background: var(--cta); color: var(--cta-ink); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-poke { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.icon-btn {
  border: 0; background: none; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink-2); flex: none;
}
.icon-btn:active { background: var(--surface-2); }

.cta {
  width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: var(--cta); color: var(--cta-ink);
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.cta:active { transform: translateY(1px); }
.cta-soft { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); box-shadow: none; }

.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 16px; outline: none;
}
.input:focus { border-color: var(--ink); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.field-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.req { display: inline-block; font-size: 11px; font-weight: 800; color: var(--bad-ink); background: var(--bad-bg); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.form-error { color: var(--bad-ink); background: var(--bad-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 4px 0; }
.notice { font-size: 14px; border-radius: 12px; padding: 10px 12px; background: var(--surface-2); margin-bottom: 10px; }
.notice.good { background: var(--good-bg); color: var(--good-ink); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }

.pin-input {
  width: 100%; min-height: 52px; text-align: center; letter-spacing: 0.5em; font-size: 22px; font-weight: 800;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); outline: none; padding: 0 0 0 0.5em;
}
.pin-input::placeholder { color: var(--line-strong); letter-spacing: 0.25em; font-size: 14px; }
.pin-input:focus { border-color: var(--ink); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch-text { display: flex; flex-direction: column; }
.switch-label { font-weight: 700; font-size: 15px; }
.switch-sub { font-size: 12.5px; color: var(--muted); }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line-strong); position: relative; transition: background 0.15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 2px 8px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge-good { background: var(--good-bg); color: var(--good-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-pass { background: var(--surface-2); color: var(--ink-2); }
.me-tag { font-size: 11px; font-weight: 800; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; flex: none; line-height: 1; user-select: none; }

/* ---------- 오늘: 히어로 ---------- */
.hero { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1.5px solid transparent; }
.hero-date { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0; }
.hero-time { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-sub { font-size: 13.5px; color: var(--muted); }
.hero.soon { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.hero.urgent { border-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 70%, var(--surface)); }
.hero.urgent .hero-time { color: var(--bad-ink); }
.hero.calm .hero-time { color: var(--muted); font-size: 30px; }

/* ---------- 오늘: 두 사람 현황 ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo-cell { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; border: 1.5px solid transparent; min-width: 0; }
.duo-cell.done { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.duo-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.duo-name { font-weight: 800; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { align-self: flex-start; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: var(--surface-2); color: var(--ink-2); }
.status-pill.done { background: var(--good-bg); color: var(--good-ink); }
.status-pill.pending { background: var(--warn-bg); color: var(--warn-ink); }
.duo-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.duo-metrics > div { display: flex; flex-direction: column; }
.metric-val { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.metric-val small { font-size: 12px; font-weight: 700; margin-left: 1px; }
.metric-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ---------- 배너 ---------- */
.banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: var(--radius); padding: 14px 16px; font-size: 14px; }
.banner-emoji { font-size: 26px; line-height: 1; }
.banner-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.banner-text b { font-size: 15px; }
.banner-text span { color: inherit; opacity: 0.85; font-size: 13px; }
.banner-coffee { background: var(--coffee-bg); color: var(--coffee); border: 1.5px solid color-mix(in srgb, var(--coffee) 35%, transparent); }
.banner-good { background: var(--good-bg); color: var(--good-ink); }
.banner-info { background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow); }

.invite-card { display: flex; flex-direction: column; gap: 8px; }
.invite-title { font-weight: 800; font-size: 16px; }
.invite-box { font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; word-break: break-all; margin: 4px 0 8px; }

.yesterday { padding: 12px 14px; }
.yesterday-head { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.yesterday-row, .day-results { display: flex; flex-wrap: wrap; gap: 8px; }
.yres { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); }
.day-results .yres { padding: 4px 10px; }
.yres.done { background: var(--good-bg); color: var(--good-ink); }
.yres.missed { background: var(--bad-bg); color: var(--bad-ink); }
.yesterday-debt { margin-top: 8px; font-size: 13px; color: var(--coffee); font-weight: 700; }

/* ---------- 피드 ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.entry { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.entry-head { display: flex; align-items: center; gap: 10px; }
.entry-meta { flex: 1; min-width: 0; }
.entry-who { font-weight: 800; font-size: 15px; }
.entry-sub { font-size: 12px; color: var(--muted); }
.tag { font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-text { margin: 0; white-space: pre-wrap; font-size: 15.5px; line-height: 1.6; }
.entry-badges { display: flex; gap: 6px; }
.entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.react { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
.react span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.react.on { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.react-add { color: var(--muted); padding: 0 9px; }
.comment-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; min-height: 34px; padding: 0 4px; }
.comment-btn.on { color: var(--ink); }
.react-picker { display: flex; gap: 4px; background: var(--surface-2); border-radius: 14px; padding: 6px; }
.react-picker button { flex: 1; border: 0; background: none; font-size: 22px; min-height: 42px; border-radius: 10px; }
.react-picker button:active { background: var(--surface); }
.event-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--line); }
.event-time { color: var(--muted); flex: none; }

.photos { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; }
.photos-1 { grid-template-columns: 1fr; }
.photos-2, .photos-4 { grid-template-columns: 1fr 1fr; }
.photos-3 { grid-template-columns: 1fr 1fr 1fr; }
.photo { border: 0; padding: 0; background: var(--surface-2); display: block; aspect-ratio: 1; overflow: hidden; }
.photos-1 .photo { aspect-ratio: auto; max-height: 380px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos-1 .photo img { height: auto; max-height: 380px; }

.comments { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment-body { flex: 1; font-size: 14px; }
.comment-who { font-weight: 800; }
.comment-sub { font-size: 12px; color: var(--muted); }
.comment-form { display: flex; gap: 8px; }
.comment-form .input { min-height: 40px; font-size: 15px; }

/* ---------- 시트 / 다이얼로그 / 뷰어 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s ease-out; }
.overlay-dialog { align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0.6; } }
.sheet { width: 100%; max-width: 560px; max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 6px 16px calc(18px + var(--safe-b)); animation: rise 0.2s ease-out; overscroll-behavior: contain; }
.sheet-dialog { max-width: 380px; border-radius: 20px; padding-bottom: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 6px; position: sticky; top: -6px; background: var(--surface); z-index: 1; }
.sheet-title { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-body { display: flex; flex-direction: column; gap: 10px; }
.confirm-text { margin: 0 0 10px; color: var(--ink-2); white-space: pre-line; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 52px; border: 0; background: var(--surface-2); border-radius: 12px; padding: 0 14px; font-weight: 700; font-size: 15px; text-align: left; }
.menu-item.danger { color: var(--bad-ink); }

.overlay-viewer { background: #000; align-items: stretch; animation: none; }
.viewer { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; touch-action: pan-y pinch-zoom; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; background-size: contain; background-position: center; background-repeat: no-repeat; }
.viewer-close { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; display: grid; place-items: center; }
.viewer-nav { position: absolute; bottom: calc(18px + var(--safe-b)); left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 18px; color: #fff; font-weight: 700; }
.viewer-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; display: grid; place-items: center; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(86px + var(--safe-b)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 520px; background: var(--ink); color: var(--page); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); animation: rise 0.18s ease-out; }
.toast-error { background: var(--bad); color: #fff; }
.toast-good { background: var(--good-ink); color: #fff; }

/* ---------- 작성 ---------- */
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer-text { min-height: 130px; }
.composer-count { text-align: right; font-size: 12px; color: var(--muted); margin-top: -6px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 0 12px; min-height: 36px; font-size: 14px; font-weight: 600; }
.chip.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.tag-input { flex: 1 1 120px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 15px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-item, .picker-add { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; flex: none; }
.picker-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-busy { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.picker-add { border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; }
.picker-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; display: grid; place-items: center; padding: 0; }

/* ---------- 인증/로그인 ---------- */
.auth { min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 16px 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-brand { text-align: center; padding-top: 12px; }
.auth-formula { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.auth-card { display: flex; flex-direction: column; gap: 12px; }
.auth-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.who { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 18px; min-width: 110px; font-weight: 800; }
.who-btn.on { border-color: var(--ink); }

/* ---------- 기록: 히어로 숫자 / 표 / 차트 / 달력 ---------- */
.hero-figure { text-align: center; padding: 20px 16px; }
.hero-figure-label { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.hero-figure-value { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 4px 0; }
.hero-figure-sub { font-size: 14px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare th[scope='row'] { text-align: left; color: var(--ink-2); font-weight: 600; }
.compare thead th { font-weight: 800; }
.compare.small { font-size: 13px; margin-top: 8px; }
.th-who { display: inline-flex; align-items: center; gap: 6px; }

.chart { position: relative; }
.chart-plot { position: relative; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .grid.base { stroke: var(--line-strong); }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.ideal { stroke: var(--line-strong); stroke-width: 1.5; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .muted-label { fill: var(--muted); font-weight: 600; }
.chart-empty { text-align: center; color: var(--muted); padding: 20px 8px; font-size: 14px; }
.chart-empty div { font-size: 30px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.key-line.ideal { background: var(--line-strong); }
.key-box { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.tooltip { position: absolute; top: 0; width: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); font-size: 12.5px; pointer-events: none; }
.tooltip-day { color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.tooltip-row { display: flex; align-items: center; gap: 6px; }

.calendar { display: flex; flex-direction: column; gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-weight: 800; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow div { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-cell { border: 1px solid transparent; background: var(--surface-2); border-radius: 10px; min-height: 52px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cal-cell.blank { background: none; }
.cal-cell.future { background: none; border-color: var(--line); }
.cal-cell.today { border-color: var(--ink); }
.cal-cell.sel { background: var(--ink); color: var(--page); }
.cal-num { font-size: 13px; font-weight: 700; line-height: 1.2; }
.cal-glyphs { display: flex; gap: 2px; }
.glyph { width: 12px; height: 12px; display: inline-block; flex: none; }
.glyph-empty { width: 12px; height: 12px; }
.g-done { fill: var(--good); }
.g-missed { fill: var(--bad); }
.g-pass { fill: var(--pass); }
.g-mark { stroke: #fff; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-today { fill: none; stroke: var(--warn); stroke-width: 1.8; }
.g-plan { fill: none; stroke: var(--pass); stroke-width: 1.5; stroke-dasharray: 2 2; }
.cal-cell.sel .g-mark { stroke: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; }

.tagbars { display: flex; flex-direction: column; gap: 10px; }
.tagbar { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; align-items: center; gap: 8px; font-size: 13.5px; }
.tagbar-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagbar-track { height: 10px; }
.tagbar-fill { height: 10px; display: flex; gap: 2px; }
.tagbar-fill .seg { height: 10px; min-width: 3px; }
.tagbar-fill .seg:last-child { border-radius: 0 4px 4px 0; }
.tagbar-val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* ---------- 커피 ---------- */
.coffee-head { display: flex; flex-direction: column; gap: 8px; }
.coffee-title { font-size: 18px; font-weight: 800; }
.coffee-head p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kpi { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 8px 4px; }
.kpi-val { font-size: 22px; font-weight: 800; }
.kpi-lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.penalty { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid transparent; }
.penalty.owed { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.penalty.sent { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.penalty-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.penalty-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.penalty-who .arrow { color: var(--muted); }
.penalty-names { font-weight: 800; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.penalty-desc { font-size: 14px; color: var(--ink-2); }
.penalty-note { font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.history-list { padding: 4px 14px; }
.closed-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.closed-row:last-child { border-bottom: 0; }

/* ---------- 설정 ---------- */
.settings { display: flex; flex-direction: column; gap: 8px; }
.settings .card-title { margin-bottom: 0; }
.settings p { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.pass-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 4px; }
.pass-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--ink); }
.swatch:disabled { opacity: 0.25; }
.pin-change { border-top: 1px solid var(--line); padding-top: 10px; }
.pin-change summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.pin-grid { display: grid; gap: 8px; margin-top: 8px; }
.meter { height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--c0) 18%, var(--surface-2)); overflow: hidden; }
.meter-fill { height: 100%; background: var(--c0); border-radius: 0 4px 4px 0; }

@media (min-width: 600px) {
  .main { padding-top: 12px; }
  .hero-time { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
