/* 쩜삼이 — 삼쩜삼캠퍼스(3o3campus.co.kr) 톤에 맞춘 디자인 토큰
   로고: 파랑 #0C65E5 · 남색 #033663 · 주황 쩜 #FFA800 / 서체: Pretendard + 숫자 Poppins / 아이콘: Material Symbols */
:root {
  --brand: #0C65E5; --brand-ink: #033663; --dot: #FFA800;
  --blue: #237AF2; --blue-2: #3A88F4; --blue-bg: #F3F8FF; --blue-bg2: #E9F2FF; --blue-tag: #DAE9FF; --blue-tag2: #B7D3FB; --blue-tag-ink: #064D98;
  --coral: #E4604F; --coral-bg: #FDEEEC; --orange-bg: #FFF4DE;
  --ink: #141618; --ink-2: #2B2F34; --ink-3: #3A4047; --muted: #606A76; --muted-2: #949DA8; --line: #F0F1F2; --line-2: #E3E6E9;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F8F9;
  --good: #16A34A; --warn: #D97706; --danger: #E4604F;
  --accent: var(--blue); --accent-ink: #FFFFFF; --text: var(--ink); --band: rgba(35, 122, 242, .14);
  --r-sm: 6px; --r: 12px; --r-lg: 20px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.6; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }
.num, .kpi, .wallet-chip b, .pack .c, .ledger .d, .card .v, #w-bal { font-family: Poppins, "Pretendard Variable", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ms { font-family: "Material Symbols Rounded"; font-weight: 500; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; vertical-align: middle; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; font-variation-settings: "FILL" 0, "wght" 500, "opsz" 24; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- 헤더 (로고 + 탭) ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1024px; margin: 0 auto; padding: 14px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.wordmark { font-size: 24px; font-weight: 900; color: var(--brand); letter-spacing: -0.04em; line-height: 1; position: relative; padding-right: 8px; }
.wordmark .dot { position: absolute; right: 0; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.by { font-size: 12px; color: var(--muted); font-weight: 500; }
@media (max-width: 420px) { .by { display: none; } }
.wallet-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 0;
  background: var(--blue-bg2); color: var(--blue); font-weight: 700; font-size: 13px; }
.wallet-chip b { font-size: 13px; font-weight: 600; }
.wallet-chip small { font-size: 12px; font-weight: 700; }
.wallet-chip.low { background: var(--coral-bg); color: var(--coral); }
.coin { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); flex: none; }
.tabs { max-width: 1024px; margin: 0 auto; }
.tabs-inner { display: flex; gap: 22px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 0 12px; font-size: 15px; font-weight: 500; color: var(--ink-3); white-space: nowrap; position: relative; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 700; }
.tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }

/* ---------- 첫 화면 ---------- */
main { flex: 1; width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 20px; }
.welcome { padding: 20px 0 32px; }
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); min-height: 280px; padding: 36px 40px;
  background: linear-gradient(120deg, #0C65E5 0%, #3A88F4 62%, #6FAAF7 100%); color: #fff; display: flex; align-items: center; }
.hero::after { content: ""; position: absolute; right: -20px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.hero-copy { position: relative; z-index: 1; max-width: 60%; }
.hero-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .18); margin-bottom: 14px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(26px, 4.2vw, 36px); line-height: 1.3; font-weight: 700; letter-spacing: -0.03em; }
.hero p { margin: 0 0 20px; font-size: 15px; opacity: .88; }
.hero-link { border: 0; background: none; color: #fff; font-weight: 600; font-size: 15px; padding: 0; display: inline-flex; align-items: center; gap: 2px; }
.hero-link:hover { text-decoration: underline; }
.hero-av { position: absolute; right: 36px; bottom: -8px; width: 230px; height: 230px; z-index: 1; }
@media (max-width: 640px) {
  .hero { padding: 26px 22px 140px; min-height: 0; align-items: flex-start; }
  .hero-copy { max-width: 100%; }
  .hero-av { right: 12px; width: 150px; height: 150px; }
}
.quick { display: flex; justify-content: center; gap: clamp(20px, 6vw, 56px); padding: 28px 0 8px; }
.qt { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; width: 76px; }
.qi { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; line-height: 1.15; text-align: center; letter-spacing: -0.03em; transition: transform .15s; }
.qt:hover .qi { transform: translateY(-2px); }
.qi .ms { font-size: 26px; }
.qi-blue { background: var(--blue); } .qi-orange { background: var(--dot); } .qi-coral { background: var(--coral); } .qi-navy { background: var(--brand-ink); }
.ql { font-size: 13px; color: var(--ink-3); line-height: 1.35; text-align: center; }
.sec { padding-top: 36px; }
.sec-label { display: flex; align-items: center; gap: 6px; color: var(--brand); font-size: 15px; font-weight: 700; }
.sec-label .ms { font-size: 20px; }
.sec h2 { margin: 6px 0 16px; font-size: clamp(20px, 3vw, 24px); line-height: 1.4; font-weight: 700; letter-spacing: -0.03em; }
.qcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .qcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .qcards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 0 20px 4px; } .qcard { flex: 0 0 72%; scroll-snap-align: start; } }
.qcard { border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; padding: 0; text-align: left; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.qcard:hover { box-shadow: 0 8px 24px rgba(20, 22, 24, .08); transform: translateY(-2px); }
.qcard-top { display: block; padding: 18px 16px; min-height: 104px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.4; letter-spacing: -0.03em; }
.tone-blue { background: var(--blue); } .tone-coral { background: var(--coral); } .tone-navy { background: var(--brand-ink); } .tone-orange { background: #F59E0B; }
.qcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.qcard-desc { font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-sm); background: var(--blue-tag2); color: var(--blue-tag-ink); }
.tag-soft { background: var(--blue-tag); color: var(--blue); }
.tag-book { background: var(--dot); color: #fff; }
.theta-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-radius: var(--r); background: var(--blue-bg); }
.theta-card p { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 44em; }
.theta-card .theta-src { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 640px) { .theta-card { flex-direction: column; align-items: stretch; } }

/* ---------- 버튼 ---------- */
.primary, .secondary, .danger { min-height: 44px; padding: 0 18px; border-radius: var(--r); font-weight: 700; border: 1px solid transparent; font-size: 15px; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--brand); }
.primary:disabled { background: var(--line-2); color: var(--muted-2); cursor: not-allowed; }
.secondary { background: var(--blue-bg); color: var(--blue); }
.secondary:hover { background: var(--blue-bg2); }
.danger { background: #fff; border-color: var(--line-2); color: var(--coral); }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font-size: inherit; }
.icon { width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; font-size: 0; }
.icon::before { content: "close"; font-family: "Material Symbols Rounded"; font-size: 24px; }
.icon:hover { background: var(--surface-2); }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 14px; color: var(--ink-2); text-align: left; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.lg { border-radius: var(--r); padding: 12px 14px; min-height: 48px; }

/* ---------- 대화 ---------- */
.chat { max-width: 760px; margin: 0 auto; padding: 20px 0 24px; }
.log { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: flex-start; }
.row.user { justify-content: flex-end; }
.bubble { max-width: min(560px, 86%); padding: 12px 16px; border-radius: 16px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.65; }
.row.user .bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.row.bot .bubble { background: var(--surface-2); color: var(--ink); border-top-left-radius: 4px; }
.row.bot .bubble b { color: var(--brand-ink); }
.row.bot.refused .bubble, .row.bot.blocked .bubble { background: var(--orange-bg); }
.avatar { display: inline-block; border-radius: 50%; background: var(--blue-bg2); overflow: hidden; flex: none; }
.avatar.xs { width: 34px; height: 34px; }
.bot-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: min(620px, 88%); }
.bot-col .bubble { max-width: 100%; }
.status { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; min-height: 34px; }
.status .dots { display: inline-flex; gap: 3px; }
.status .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: blink 1.2s infinite; }
.status .dots i:nth-child(2) { animation-delay: .15s; } .status .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 70%, 100% { opacity: .2; } 35% { opacity: 1; } }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.src { font-size: 12px; font-weight: 600; border: 0; background: var(--blue-tag); color: var(--blue); border-radius: var(--r-sm); padding: 4px 8px; min-height: 28px; }
.src b { color: var(--blue-tag-ink); margin-right: 4px; font-family: Poppins, sans-serif; }
.src-detail { font-size: 13px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--ink-3); }
.src-detail a { color: var(--blue); word-break: break-all; }
.meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; height: 30px; padding: 0 8px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.fb .ms { font-size: 16px; }
.fb[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.charge { font-size: 12px; color: var(--muted); font-weight: 600; }
.charge.free { color: var(--good); }
.more-btn { font-size: 12px; font-weight: 700; min-height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--blue-bg2); color: var(--blue); }
.followups { display: flex; flex-wrap: wrap; gap: 6px; }
.memchip { align-self: flex-start; font-size: 12px; color: var(--ink-3); background: var(--orange-bg); border-radius: var(--r-sm); padding: 4px 10px; }
.memchip button { color: var(--blue); background: none; border: 0; padding: 0 0 0 6px; font-size: 12px; font-weight: 700; }
.calc-cta { align-self: flex-start; min-height: 36px; font-size: 14px; }

/* ---------- 입력창 ---------- */
.composer { position: sticky; bottom: 0; z-index: 15; background: linear-gradient(to top, #fff 78%, rgba(255, 255, 255, 0)); padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); }
.composer-inner { max-width: 760px; margin: 0 auto; }
.tierbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tiers { display: inline-flex; gap: 4px; }
.tiers button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 0 10px; min-height: 32px; font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.tiers button b { font-family: Poppins, sans-serif; font-weight: 600; margin-left: 4px; font-size: 12px; }
.tiers button[aria-checked="true"] { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); font-weight: 700; }
.tier-hint { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .tiers button { padding: 0 7px; } .tier-hint { width: 100%; } }
#ask-form { display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 16px; padding: 6px 6px 6px 16px; transition: border-color .15s; }
#ask-form:focus-within { border-color: var(--blue); }
#ask { flex: 1; border: 0; outline: 0; resize: none; background: none; color: var(--ink); font: inherit; font-size: 15.5px; padding: 9px 0; max-height: 160px; }
.send, .stop { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.send .ms, .stop .ms { font-size: 22px; }
.stop { background: var(--ink); }
.fine { font-size: 11.5px; color: var(--muted-2); text-align: center; margin: 8px auto 0; max-width: 60em; line-height: 1.5; }

/* ---------- 시트 (계산기·기억·지갑) ---------- */
.sheet { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; border-left: 1px solid var(--line-2); box-shadow: -12px 0 40px rgba(20, 22, 24, .08); display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -0.03em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 22px 28px; }
.sheet-foot { border-top: 1px solid var(--line); padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; background: #fff; }
.foot-btns { display: flex; gap: 8px; } .foot-btns > * { flex: 1; }
@media (max-width: 640px) { .sheet { width: 100%; border-left: 0; } }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; font-size: 13px; color: var(--brand); margin-bottom: 2px; }
.field { padding: 8px 0; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--ink-2); }
.field label small { font-weight: 400; color: var(--muted); }
.field .ctl { display: flex; align-items: center; gap: 12px; }
.field input[type=range] { flex: 1; accent-color: var(--blue); height: 28px; }
.field .numbox { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: #fff; min-width: 112px; }
.field .numbox:focus-within { border-color: var(--blue); }
.field .numbox input { width: 72px; border: 0; background: none; color: var(--ink); font: 600 15px Poppins, sans-serif; text-align: right; padding: 8px 4px; font-variant-numeric: tabular-nums; outline: 0; }
.field .numbox span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.adv summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); padding: 8px 0; min-height: 40px; display: flex; align-items: center; }

/* 결과 */
.result { margin: 2px 0 8px; padding: 18px; border-radius: var(--r); background: var(--blue-bg); }
.result-more { margin-top: 8px; }
.form-title { font-size: 15px; margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 700; }
.form-title small { font-weight: 400; font-size: 12px; display: block; margin-top: 2px; color: var(--muted); }
.skeleton { color: var(--muted); padding: 24px 0; text-align: center; }
.kpi-label { font-size: 14px; color: var(--ink-3); }
.kpi { font-size: clamp(28px, 7vw, 34px); font-weight: 700; line-height: 1.2; margin: 4px 0; color: var(--brand-ink); }
.kpi-sub { font-size: 13px; color: var(--ink-3); }
.verdict { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-sm); margin: 6px 0 4px; }
.verdict.ok { background: #DCF5E5; color: #0F7A3A; }
.verdict.short { background: var(--coral); color: #fff; }
.chart { width: 100%; height: auto; margin: 12px 0 4px; background: #fff; border-radius: 10px; }
.chart text { fill: var(--muted); font-size: 11px; font-family: Poppins, Pretendard, sans-serif; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.card { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; }
.card.base { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.card h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.card .v { font-weight: 600; font-size: 15px; color: var(--ink); }
.card .s { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .cards { grid-template-columns: 1fr; } }
table.sens { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sens th, table.sens td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.sens th { color: var(--muted); font-weight: 600; }
table.sens th:first-child, table.sens td:first-child { text-align: left; }
.assume { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.field-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.field-note.warn { color: #B45309; font-weight: 600; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex: none; }

/* 기억 */
.toggles { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: transform .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.mem-list h3 { font-size: 13px; color: var(--brand); margin: 18px 0 6px; font-weight: 700; }
.mem-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 6px; font-size: 14px; }
.mem-item button { border: 0; background: none; color: var(--muted-2); min-width: 32px; min-height: 32px; border-radius: 8px; }
.mem-item button:hover { color: var(--coral); background: #fff; }
.mem-empty { color: var(--muted); font-size: 14px; padding: 16px 0; }
.mem-edit textarea { width: 100%; min-height: 64px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; padding: 8px 10px; }
.mem-actions { display: flex; gap: 8px; margin: 16px 0 8px; } .mem-actions > * { flex: 1; }

/* 지갑 */
.wallet-bal { padding: 18px; border-radius: var(--r); background: var(--blue-bg); }
.wallet-bal .kpi { display: flex; align-items: baseline; gap: 6px; }
.wallet-bal .kpi small { font-size: 15px; font-weight: 700; color: var(--blue); font-family: Pretendard, sans-serif; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 12px; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 104px; }
.pack:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(20, 22, 24, .06); }
.pack .c { font-weight: 700; font-size: 20px; color: var(--brand-ink); }
.pack .p { font-size: 14px; font-weight: 700; color: var(--ink); }
.pack .u { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .packs { grid-template-columns: 1fr; } .pack { min-height: 0; } }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ledger .d { font-weight: 600; white-space: nowrap; }
.ledger .d.plus { color: var(--blue); }
.ledger .m small { display: block; color: var(--muted); font-size: 12px; }
.pay-summary { background: var(--blue-bg); border-radius: 10px; padding: 12px 14px; }
.pay-summary b { font: 700 20px Poppins, sans-serif; color: var(--brand-ink); }
.pay-methods { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* 모달 · 토스트 */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(20, 22, 24, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(440px, 100%); background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 20px 60px rgba(20, 22, 24, .18); display: flex; flex-direction: column; gap: 12px; }
.modal-card h2 { margin: 0 0 2px; font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.modal-card p { margin: 0; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.field-inline input, .field-inline select, .field-inline textarea { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); min-height: 44px; }
.field-inline input:focus, .field-inline select:focus, .field-inline textarea:focus { border-color: var(--blue); outline: 0; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.notice { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); }
.survey-opts { display: flex; flex-direction: column; gap: 6px; }
.survey-opts .chip[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 내 연금 진단 */
.diag-intro { font-size: 14px; color: var(--ink-3); background: var(--blue-bg); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; line-height: 1.6; }
.diag-intro b { color: var(--brand-ink); }
.diag-age { max-width: 160px; margin-bottom: 12px; }
.d-accounts { display: flex; flex-direction: column; gap: 10px; }
.d-acct { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px 12px; background: #fff; }
.d-acct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-acct-head select { font: inherit; font-weight: 700; font-size: 15px; border: 0; background: none; color: var(--brand); padding: 4px 0; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 6px; }
@media (max-width: 420px) { .d-grid { grid-template-columns: 1fr; } }
.d-in { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.d-in .numbox { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; }
.d-in .numbox:focus-within { border-color: var(--blue); }
.d-in .numbox input { width: 100%; border: 0; outline: 0; background: none; font: 600 15px Poppins, sans-serif; text-align: right; padding: 8px 4px; color: var(--ink); }
.d-in .numbox span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.d-in.d-check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); grid-column: 1 / -1; }
.d-in.d-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.d-add { margin: 10px 0 4px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
.d-result { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.d-card { border-radius: var(--r); background: var(--blue-bg); padding: 16px; }
.d-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--brand-ink); }
.d-line { margin: 4px 0; font-size: 14px; color: var(--ink-2); }
.d-sub { margin: 2px 0; font-size: 12px; color: var(--muted); font-family: Poppins, Pretendard, sans-serif; }
.d-bar { position: relative; display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: #fff; margin: 8px 0; }
.d-bar span { display: block; height: 100%; }
.d-bar span + span { border-left: 2px solid #fff; }
.d-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.d-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-3); }
.d-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.d-risk { margin-top: 10px; }
.d-risk-head { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.d-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-sm); background: var(--blue-tag); color: var(--blue); }
.d-status.near { background: var(--orange-bg); color: #9A6100; }
.d-status.over { background: var(--coral-bg); color: var(--coral); }
.d-rules summary { cursor: pointer; font-size: 13px; color: var(--blue); font-weight: 600; padding: 4px 0; }
.d-rules p { margin: 4px 0; }
.d-go { margin-top: 4px; }

/* v0.2: controls and compact selection */
.choice-grid { display:flex;flex-wrap:wrap;gap:8px;margin:8px 0; }
.choice-grid button { min-height:44px;border:1px solid var(--line-2);border-radius:6px;background:white;padding:8px 12px;font:inherit; }
.choice-grid button[aria-pressed="true"] { background:var(--blue-bg2);border-color:var(--brand);color:var(--brand-ink); }
#onboard fieldset { border:0;padding:0;margin:14px 0;min-width:0; }
.modal-card { max-height:calc(100dvh - 32px);overflow-y:auto; }
input,select,textarea { max-width:100%;min-width:0; }
button:focus-visible,a:focus-visible { outline:2px solid var(--brand);outline-offset:3px; }

.task-section { margin:24px 0; } .task-section h2 { font-size:18px; }
.task-card { border:1px solid var(--line-2);border-radius:12px;padding:16px;margin:10px 0;animation:task-appear .15s ease-out; }
.task-card h3 { font-size:15px;margin:0; } .task-card p { margin:6px 0; }
.task-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:10px; }
.task-actions button,.task-more { min-height:44px; } @keyframes task-appear { from { opacity:.5 } to { opacity:1 } }

.notify-bell { margin-left:auto;position:relative;min-width:44px;min-height:44px; }
.notify-bell::before,#embed-close::before { content:none; }
.continue-box { margin:12px 0; }.continue-box p { margin:6px 0; }.continue-btn { min-height:44px; }
#embed-close,.v02-sheet .icon { min-width:44px;min-height:44px; }
#notify-badge { position:absolute;right:0;top:0;border-radius:6px;background:var(--coral);color:white;font-size:11px;padding:1px 4px; }
.calendar-year { color:var(--brand-ink);margin-top:24px; } .calendar-item { border-bottom:1px solid var(--line-2);padding:14px 0;overflow-wrap:anywhere; }
.calendar-item h3 { font-size:15px; } .calendar-item p { margin:8px 0; } .calendar-item button,.v02-sheet button,#notify-settings button { min-height:44px; }
#notify-settings { background:var(--blue-bg);padding:16px;border-radius:12px;margin-bottom:20px; }

.memory-tabs { display:flex;gap:12px;border-bottom:1px solid var(--line-2);margin-bottom:20px; }
.memory-tabs button { background:none;border:0;min-height:44px;font:inherit;padding:8px 16px; }
.memory-tabs [aria-selected="true"] { border-bottom:2px solid var(--brand);color:var(--brand);font-weight:700; }
.activity-item { border-bottom:1px solid var(--line-2);padding:14px 0;overflow-wrap:anywhere; }
.activity-item h4 { display:inline;margin-left:8px;font-size:14px; } .activity-item button { min-height:44px;display:block; } .activity-item a { display:block; }
#activity-panel>a { display:inline-flex;align-items:center;min-height:44px; }

.tool-item { padding:16px 0;border-bottom:1px solid var(--line-2); }.tool-item h4 { margin:0; }.tool-item button,.tools-entry { min-height:44px;margin-top:12px; }.tool-item .tag { margin-right:12px; }

.embed-disclaimer { padding:8px 12px;background:var(--orange-bg);font-size:12px;text-align:center; }
body.embed .top-inner { min-height:52px; }.embed .by,.embed .wallet-chip,.embed .notify-bell { display:none; }
.embed .brand { order:1; }.embed #embed-close { order:2;margin-left:auto; }
.embed .hero { padding-top:16px;padding-bottom:16px;min-height:180px; }.embed .hero h1 { font-size:26px; }.embed .hero-av { max-width:120px; }
.embed-diag { width:100%;min-height:48px;margin-top:16px; }.tabs-inner { overflow-x:auto;max-width:100%; }.tab { flex-shrink:0; }
@media(max-width:420px){.top-inner{gap:8px}.by{font-size:10px}.wordmark{font-size:23px}.wallet-chip{padding:6px 8px}.notify-bell{flex-shrink:0}#main{min-width:0}.modal-card{width:calc(100vw - 24px)}.task-card{overflow-wrap:anywhere}}
@media(max-width:640px){.embed .hero { padding-bottom:110px; }.embed .hero-av { width:120px;height:120px; }}

/* ---------- 에이전트 ---------- */
.agent-intro { font-size: 14px; color: var(--ink-3); background: var(--blue-bg); border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; line-height: 1.6; }
.agent-goals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.agent-goals .chip { border-radius: var(--r); padding: 12px 14px; min-height: 48px; }
.agent-form { display: flex; gap: 8px; }
.agent-form input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 12px; font: inherit; }
.agent-tools { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.agent-tool { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.agent-tool .ms { font-size: 18px; color: var(--blue); }
.agent-tool.locked { color: var(--muted); background: var(--surface-2); }
.agent-tool.locked .ms { color: var(--muted-2); }
.agent-tool .lv { margin-left: auto; }
.lv { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lv-fact { background: var(--blue-bg2); color: var(--blue-tag-ink); }
.lv-approve { background: var(--orange-bg); color: #8A5300; }
.lv-licensed { background: var(--coral-bg); color: #B23A2B; }
.agent-card { flex: 1; max-width: min(620px, 92%); background: #fff; border: 1px solid var(--line-2); border-radius: 16px; border-top-left-radius: 4px; padding: 14px 16px; }
.agent-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.agent-badge { font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-ink); padding: 2px 8px; border-radius: 999px; }
.agent-plan { margin: 0 0 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); font-size: 13.5px; color: var(--ink-3); }
.agent-plan ol { margin: 4px 0 0; padding-left: 20px; }
.agent-plan li { margin: 2px 0; }
.agent-plan .agent-plan-title { color: var(--ink); }
.agent-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.agent-step { border-left: 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); animation: agent-in .25s ease-out; }
.agent-step p { margin: 4px 0 0 26px; color: var(--ink-3); line-height: 1.55; }
.agent-step-top { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.agent-step-top .ms { font-size: 20px; color: var(--good); }
.agent-step-top .lv { margin-left: auto; }
.agent-step.st-locked .ms, .agent-step.st-denied .ms { color: var(--muted-2); }
.agent-step.st-error .ms { color: var(--danger); }
.agent-now { margin: 10px 0 0; }
.agent-now::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); margin-right: 6px; animation: agent-pulse 1s infinite; }
.agent-ask { margin-top: 10px; padding: 12px; border: 1px solid #F5D08A; background: var(--orange-bg); border-radius: var(--r); }
.agent-ask p { margin: 0 0 6px; }
.agent-ask-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-final { margin-top: 12px; max-width: none; background: var(--blue-bg); }
.agent-foot { margin: 8px 0 0; }
@keyframes agent-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes agent-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .agent-step, .agent-now::before { animation: none; } }
#agent-msg:empty { display: none; }
