/* 수현의 캘린더 — 연보라 포인트 + 맑은 카테고리 색, KoPub 돋움 */
:root {
  --bg: #FAF9FF;
  --surface: #FFFFFF;
  --surface-2: #F1EFFA;
  --ink: #1E1B2E;
  --ink-2: #4A4760;
  --muted: #8A86A0;
  --line: #EAE7F4;
  --line-strong: #D9D5EA;
  --accent: #7B6FD6;          /* 연보라 포인트 */
  --accent-ink: #FFFFFF;
  --lav: #7B6FD6;
  --lav-soft: rgba(123, 111, 214, .12);
  --red: #E5484D;
  --sat: #3E7BFA;
  --shadow: 0 10px 30px rgba(40, 32, 90, .10), 0 2px 6px rgba(40, 32, 90, .06);

  /* 카테고리 */
  --c-work: #3A5BD9;
  --c-appoint-general: #F2A33A;
  --c-appoint-book: #8BC34A;
  --c-appoint-important: #F0506E;
  --c-health-clinic: #A08BF7;
  --c-health-counsel: #D9A0F5;

  /* 기록 표시 */
  --g-prn: #E0A458;
  --g-pill: #6E6A86;
  --g-insomnia: #4A4760;
  --g-ex: #14B8A6;
  --g-st: #8FCB9B;
  --panic: 214, 120, 120;     /* 공황 수치 배경색(RGB) */
  --pk: 1;

  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141320;
  --surface: #1C1B2B;
  --surface-2: #26243A;
  --ink: #EDEBF7;
  --ink-2: #BDB9D3;
  --muted: #8C88A6;
  --line: #2C2A40;
  --line-strong: #3A3752;
  --accent: #A99CF5;
  --accent-ink: #141320;
  --lav: #B3A8F7;
  --lav-soft: rgba(169, 156, 245, .16);
  --red: #FF6B6F;
  --sat: #7FA5FF;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --c-work: #6F8BF0;
  --c-appoint-general: #F5B55E;
  --c-appoint-book: #A4D36A;
  --c-appoint-important: #F77991;
  --c-health-clinic: #B9A8FA;
  --c-health-counsel: #E3B6F8;
  --g-prn: #E8B878;
  --g-pill: #A9A4C8;
  --g-insomnia: #BDB9D3;
  --g-ex: #2DD4BF;
  --g-st: #A6DDB0;
  --panic: 236, 120, 130;
  --pk: .6;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "KoPubWorld Dotum", "KoPubWorldDotum", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.5; letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ───── 잠금 화면 ───── */
.lock {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
}
.lock-brand { font-size: 13px; letter-spacing: .24em; color: var(--muted); text-transform: uppercase; }
.lock-title { font-size: 22px; font-weight: 700; margin: 10px 0 28px; }
.lock-dots { display: flex; gap: 14px; margin-bottom: 14px; }
.lock-dots span { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-2); transition: background .15s; }
.lock-dots span.on { background: var(--ink); border-color: var(--ink); }
.lock-msg { height: 20px; font-size: 13px; color: var(--red); margin-bottom: 18px; }
.lock-msg.hint { color: var(--muted); }
.lock.shake .lock-dots { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; }
.keypad button { height: 64px; border-radius: 50%; font-size: 24px; font-weight: 400; }
.keypad button:active { background: var(--surface-2); }
.keypad .k-sub { font-size: 14px; color: var(--muted); }

/* ───── 앱 셸 ───── */
.app { max-width: 1240px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(96px + var(--safe-b)); }
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: calc(10px + var(--safe-t)) 16px 10px; border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 8px; }
.brand { font-size: 12px; letter-spacing: .18em; color: var(--muted); font-weight: 700; flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:active, .icon-btn:hover { background: var(--surface-2); }
.title-row { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-right: auto; display: flex; align-items: baseline; gap: 8px; }
.title small { font-size: 15px; font-weight: 400; color: var(--muted); }
.today-btn { font-size: 13px; font-weight: 700; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; margin-right: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.views { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }

/* 배너 */
.banners { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.banner {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
}
.banner .b-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--c-health-clinic); flex: none; }
.banner .b-main { flex: 1; min-width: 0; }
.banner .b-t { font-size: 14px; font-weight: 700; }
.banner .b-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.dchip {
  flex: none; display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px;
  padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.dchip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.dchip.lav b { color: var(--lav); }

/* ───── 월 보기 ───── */
.month-wrap { padding: 8px 8px 0; }
.wk-head { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-align: center; padding: 6px 0; }
.wk-head .sat { color: var(--sat); } .wk-head .sun { color: var(--red); }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); }
.mc {
  position: relative; min-height: 84px; min-width: 0; padding: 5px 3px 14px; text-align: left;
  border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.mc[data-p] { background: rgba(var(--panic), calc(var(--pa) * var(--pk))); }
.mc[data-p="1"] { --pa: .07; } .mc[data-p="2"] { --pa: .13; } .mc[data-p="3"] { --pa: .2; } .mc[data-p="4"] { --pa: .28; } .mc[data-p="5"] { --pa: .38; }
.mc.other { opacity: .38; }
.mc-top { display: flex; align-items: center; gap: 3px; min-height: 22px; }
.mc-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.mc-n.red { color: var(--red); } .mc-n.sat { color: var(--sat); }
.mc.today .mc-n { background: var(--accent); color: var(--accent-ink); }
.mc.sel { box-shadow: inset 0 0 0 1.5px var(--lav); border-radius: 12px; }
.mc-sp { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mc-sp.red { color: var(--red); }
.mc-it {
  font-size: 10.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: clip;
  display: flex; align-items: center; gap: 3px; padding: 0 1px; color: var(--ink);
}
.mc-it::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--muted)); }
.mc-it.bd, .mc-it.an { color: var(--lav); }
.mc-it.bd::before, .mc-it.an::before, .mc-it.plain::before { display: none; }
.mc-it.plain { color: var(--muted); }
.mc-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
.mc-g { position: absolute; left: 4px; right: 3px; bottom: 4px; display: flex; gap: 2.5px; }
.gd { width: 5px; height: 5px; border-radius: 50%; background: var(--g); }
.gd.ring { background: none; box-shadow: inset 0 0 0 1.4px var(--g); }

.month-layout { display: grid; gap: 0; }
@media (min-width: 960px) {
  .month-layout { grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
  .mc { min-height: 112px; padding: 6px 6px 16px; }
  .mc-it { font-size: 12px; }
  .mc-sp { font-size: 11px; }
  .month-layout .daypanel { margin-top: 26px; padding-top: 0; }
}

/* 날짜 상세 패널 */
.daypanel { padding: 18px 16px 8px; }
.dp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dp-date { font-size: 19px; font-weight: 700; }
.dp-sp { font-size: 12.5px; color: var(--muted); }
.dp-sp .red { color: var(--red); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.card-h button { letter-spacing: 0; font-weight: 700; color: var(--ink-2); font-size: 13px; }
.ev-list { display: flex; flex-direction: column; }
.ev-row { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 9px 0; border-top: 1px solid var(--line); width: 100%; }
.ev-row:first-child { border-top: 0; padding-top: 2px; }
.ev-time { width: 46px; flex: none; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev-time small { display: block; color: var(--muted); font-size: 11px; }
.ev-bar { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--c); flex: none; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-weight: 700; font-size: 14.5px; }
.ev-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.empty { color: var(--muted); font-size: 13.5px; padding: 4px 0; }

.rec-label { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.panic-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.panic-scale button {
  height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(var(--panic), var(--a));
}
.panic-scale button.on { border-color: rgb(var(--panic)); box-shadow: inset 0 0 0 1.5px rgb(var(--panic)); color: var(--ink); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.tg {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 400;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
}
.tg i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); opacity: .35; }
.tg.on { border-color: var(--g); background: color-mix(in srgb, var(--g) 12%, transparent); font-weight: 700; }
.tg.on i { opacity: 1; }
.sub-gap { height: 12px; }

.memo-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.memo-item:first-child { border-top: 0; padding-top: 0; }
.memo-item p { margin: 0; flex: 1; white-space: pre-wrap; font-size: 14px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; flex: none; margin-top: 1px; }
.tag.clinic { color: var(--c-health-clinic); background: color-mix(in srgb, var(--c-health-clinic) 14%, transparent); }
.tag.counsel { color: var(--c-health-counsel); background: color-mix(in srgb, var(--c-health-counsel) 18%, transparent); }
:root[data-theme="light"] .tag.counsel { color: #7A6FAE; }
.x-btn { color: var(--muted); padding: 2px 4px; }
.memo-add { display: flex; gap: 6px; margin-top: 10px; align-items: flex-end; }
.memo-add textarea.inp { flex: 1; min-height: 46px; height: 46px; max-height: 160px; padding: 11px 13px; resize: vertical; }
.mini-seg { display: inline-flex; gap: 4px; margin-top: 10px; }
.mini-seg button { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.mini-seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ───── 주/일 보기 (시간 격자) ───── */
.wsum { display: flex; gap: 6px; padding: 10px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.wsum::-webkit-scrollbar { display: none; }
.wsum .stat { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font-size: 12px; color: var(--muted); }
.wsum .stat b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tg-wrap { padding: 4px 8px 0; }
.tg-head, .tg-allday { display: grid; grid-template-columns: 40px repeat(var(--cols), 1fr); }
.tg-head { position: sticky; top: var(--top-h, 140px); z-index: 6; background: var(--bg); border-bottom: 1px solid var(--line); }
.tg-head .h { text-align: center; padding: 6px 0 4px; font-size: 11px; color: var(--muted); font-weight: 700; }
.tg-head .h b { display: block; font-size: 16px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; margin: 2px auto 0; }
.tg-head .h.today b { background: var(--accent); color: var(--accent-ink); }
.tg-head .h.red, .tg-head .h.red b { color: var(--red); }
.tg-head .h.today.red b { color: var(--accent-ink); }
.tg-head .h.sat b { color: var(--sat); }
.tg-head .h .p { display: block; height: 3px; margin: 3px 6px 0; border-radius: 2px; background: rgba(var(--panic), var(--pa, 0)); }
.tg-allday { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 26px; }
.tg-allday .lbl { font-size: 10px; color: var(--muted); padding: 6px 4px 0 0; text-align: right; }
.tg-allday .c { padding: 3px 1px; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-left: 1px solid var(--line); }
.tg-body { position: relative; display: grid; grid-template-columns: 40px repeat(var(--cols), 1fr); }
.tg-hours { position: relative; }
.tg-hours div { position: absolute; right: 6px; font-size: 10.5px; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.tg-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tg-line.half { border-top-style: dashed; opacity: .7; }
.tg-col.today { background: var(--lav-soft); }
.tg-ev {
  position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 3px 5px; overflow: hidden; text-align: left;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  font-size: 11.5px; line-height: 1.25; border-radius: 8px;
}
.tg-ev b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 4px; vertical-align: 1px; }
.tg-ev b { font-weight: 700; display: block; }
.tg-wrap.multi .tg-ev { padding: 3px 3px; font-size: 10.5px; }
.tg-wrap.multi .tg-ev b::before { display: none; }
.tg-wrap.multi .tg-ev b { white-space: nowrap; overflow: hidden; text-overflow: clip; word-break: keep-all; }
.tg-ev span { color: var(--ink-2); font-size: 10.5px; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--red); z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.day-tools { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; gap: 8px; }
.day-rec { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.day-rec .pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 400; }
.day-rec .pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--g); }

/* ───── 연 보기 ───── */
.year-wrap { padding: 12px 16px; }
.year-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0 0 10px; flex-wrap: wrap; }
.year-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 14px; }
@media (min-width: 700px) { .ygrid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .ygrid { grid-template-columns: repeat(6, 1fr); } }
.ym-h { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ym { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.yd { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); position: relative; }
.yd.blank { background: none; }
.yd.today { box-shadow: 0 0 0 1.5px var(--accent); }
.y-summary { margin-top: 18px; font-size: 13px; color: var(--muted); }
.y-summary b { color: var(--ink); }

/* ───── 시트(모달) ───── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(12, 14, 18, .38); animation: fade .18s ease; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--bg); border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + var(--safe-b));
  animation: up .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow);
}
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; max-height: 86vh; }
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 4px auto 10px; }
.sh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sh-title { font-size: 18px; font-weight: 700; flex: 1; }
.btn {
  height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { border: 1px solid var(--line-strong); }
.btn.danger { color: var(--red); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; }
.field { margin-bottom: 14px; }
.field > label, .flabel { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
.inp, textarea.inp, select.inp {
  width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 0 13px; font-size: 15.5px; outline: none;
}
textarea.inp { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick { position: relative; margin-bottom: 16px; }
.quick .inp { height: 52px; padding-left: 42px; background: var(--surface); border-color: var(--lav); font-size: 16px; }
.quick svg { position: absolute; left: 13px; top: 16px; color: var(--lav); }
.quick-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 14px; font-weight: 400;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip.on { border-color: var(--c, var(--ink)); background: color-mix(in srgb, var(--c, var(--ink)) 12%, transparent); font-weight: 700; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 15px; }
.sw { width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw.on { background: var(--accent); }
:root[data-theme="dark"] .sw.on::after { background: var(--accent-ink); }
.sw.on::after { transform: translateX(18px); }
.loc-row { display: flex; gap: 6px; }
.loc-row .inp { flex: 1; }
.map-btn { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: #03A94D; font-weight: 800; font-size: 15px; }
.actions { display: flex; gap: 8px; margin-top: 18px; }
.actions .btn.primary { flex: 1; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.li:first-child { border-top: 0; }
.li .li-main { flex: 1; min-width: 0; }
.li .li-sub { font-size: 12.5px; color: var(--muted); }
.li .chev { color: var(--muted); }
.li svg.i { color: var(--ink-2); }
.sec-h { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .1em; margin: 20px 4px 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-box .k { font-size: 12px; color: var(--muted); }
.stat-box .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-box .v small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.dist { display: flex; gap: 6px; align-items: flex-end; height: 70px; margin: 6px 0 4px; }
.dist div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.dist span { width: 100%; border-radius: 6px 6px 2px 2px; background: rgb(var(--panic)); min-height: 2px; }
.period { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }

.search-res .li { align-items: flex-start; }
.search-res .ev-bar { margin-top: 7px; }
mark { background: var(--lav-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* FAB */
.fab {
  position: fixed; right: max(18px, calc((100vw - 1240px) / 2 + 18px)); bottom: calc(22px + var(--safe-b)); z-index: 30;
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.fab svg.i { width: 26px; height: 26px; stroke-width: 2; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 14px; padding: 10px 16px; border-radius: 12px; z-index: 120;
  transition: all .2s; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-flag { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--lav); border: 1px solid var(--lav); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }

/* 결제일 */
.mc-pay { margin-left: auto; flex: none; font-size: 10px; font-weight: 700; color: var(--muted); padding-right: 2px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pay-row:first-of-type { border-top: 0; padding-top: 2px; }
.pay-w { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.pay-main { flex: 1; min-width: 0; font-size: 14.5px; }
.pay-main small { display: block; font-size: 12px; color: var(--muted); }
.pay-row b, .li b.num { font-size: 14px; }
