/* 자체 호스팅 폰트 (Noto Sans CJK KR 부분 폰트, SIL OFL) */
@font-face { font-family: 'Noto Sans KR'; font-weight: 400; font-style: normal; font-display: block; src: url(fonts/sans-400.woff) format('woff'); }
@font-face { font-family: 'Noto Sans KR'; font-weight: 500; font-style: normal; font-display: block; src: url(fonts/sans-500.woff) format('woff'); }
@font-face { font-family: 'Noto Sans KR'; font-weight: 600 800; font-style: normal; font-display: block; src: url(fonts/sans-700.woff) format('woff'); }
/* 계산노트 — 공통 스타일. 색은 모두 토큰으로 관리하고 카테고리마다 포인트 색이 바뀝니다. */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #16202A;
  --ink2: #506070;
  --line: #DCE2E9;
  --soft: #EBEFF4;
  --c-fin: #2457D6;
  --c-daily: #4B6584;
  --c-tax: #B4326A;
  --c-estate: #0E7490;
  --c-health: #0B8359;
  --c-elec: #B96600;
  --c-life: #7443C4;
  --c-biz: #5F7A1A;
  --on-accent: #FFFFFF;
  --ok: #12805A;
  --warn: #A86400;
  --bad: #C93636;
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F141A; --surface: #172029; --ink: #E8EDF3; --ink2: #9DABBA; --line: #2A3643; --soft: #1F2A35;
    --c-fin: #7B9DF7; --c-daily: #9DB4CE; --c-tax: #F08CB8; --c-estate: #4CC9E4; --c-health: #3FC893; --c-elec: #F2A646; --c-life: #B793F3; --c-biz: #A9C85A;
    --on-accent: #0E141B; --ok: #3FC893; --warn: #F2A646; --bad: #F07878;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F141A; --surface: #172029; --ink: #E8EDF3; --ink2: #9DABBA; --line: #2A3643; --soft: #1F2A35;
  --c-fin: #7B9DF7; --c-daily: #9DB4CE; --c-tax: #F08CB8; --c-estate: #4CC9E4; --c-health: #3FC893; --c-elec: #F2A646; --c-life: #B793F3; --c-biz: #A9C85A;
  --on-accent: #0E141B; --ok: #3FC893; --warn: #F2A646; --bad: #F07878;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--font);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.page { --accent: var(--ink); }
[hidden] { display: none !important; }
[data-cat="fin"], [data-cat="work"] { --accent: var(--c-fin); }
[data-cat="tax"] { --accent: var(--c-tax); }
[data-cat="estate"] { --accent: var(--c-estate); }
[data-cat="invest"] { --accent: var(--c-fin); }
[data-cat="health"] { --accent: var(--c-health); }
[data-cat="elec"] { --accent: var(--c-elec); }
[data-cat="biz"] { --accent: var(--c-biz); }
[data-cat="game"] { --accent: var(--c-life); }
[data-cat="life"] { --accent: var(--c-daily); }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 24px; } }

/* 헤더 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--c-fin); display: grid; place-items: center; }
.brand i::before { content: ""; width: 12px; height: 2.5px; border-radius: 2px; background: var(--on-accent); box-shadow: 0 -6px 0 var(--on-accent); transform: translateY(3px); }
.nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink2); }
.nav a svg { width: 18px; height: 18px; color: var(--accent); }
.nav a:hover, .nav a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink); }

/* 홈 */
.hero { padding-block: 40px 20px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.25; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; }
.hero p { margin: 0 0 20px; color: var(--ink2); max-width: 36em; }
.search { position: relative; max-width: 560px; }
.search input { width: 100%; height: 56px; padding: 0 18px 0 48px; font-size: 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.search input:focus { border-color: var(--c-fin); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-fin) 18%, transparent); }
.search svg { position: absolute; left: 16px; top: 17px; width: 22px; height: 22px; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.group { padding-block: 36px 8px; }
.group h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 0 0 10px; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); border-bottom: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.group h2 svg { width: 28px; height: 28px; padding: 5px; box-sizing: content-box; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card b { font-size: 1.05rem; letter-spacing: -0.02em; }
.card span { color: var(--ink2); font-size: 14.5px; line-height: 1.55; }
.card .ic { width: 40px; height: 40px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); }
.card .ic svg { width: 22px; height: 22px; }
.none { padding: 32px 0; color: var(--ink2); }

/* 계산기 페이지 */
.crumb { padding-block: 18px 0; font-size: 14px; color: var(--ink2); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.title { padding-block: 8px 4px; }
.title h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4.6vw, 2.2rem); line-height: 1.25; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; }
.title p { margin: 0; color: var(--ink2); max-width: 42em; }
.updated { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--ink2); padding: 3px 10px; border-radius: 999px; background: var(--soft); }

.calc { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-block: 20px 0; align-items: start; }
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
@media (min-width: 720px) { .panel { padding: 24px; } }
.panel > h2 { margin: 0 0 16px; font-size: 1rem; color: var(--ink2); font-weight: 600; }
.fields { display: grid; gap: 18px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .lbl { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.inp { position: relative; }
.inp input, .field select, .field input[type="date"], .field input[type="time"] {
  width: 100%; height: 54px; padding: 0 16px; font-size: 18px; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
.inp input { padding-right: 52px; text-align: right; }
.inp .unit { position: absolute; right: 16px; top: 0; height: 54px; display: grid; place-items: center; color: var(--ink2); pointer-events: none; font-size: 15px; }
.field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%); background-position: calc(100% - 20px) 24px, calc(100% - 14px) 24px; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.hint { min-height: 1.4em; margin-top: 4px; font-size: 13.5px; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.help { margin-top: 4px; font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg label { flex: 1; min-width: 0; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 51px; padding: 0 10px; text-align: center; font-weight: 500; font-size: 16px; line-height: 1.3; }
.seg label + label span { border-left: 1.5px solid var(--line); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -3px; }
.actions { margin-top: 20px; display: flex; gap: 10px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); }

.side { display: grid; gap: 20px; min-width: 0; }
.result { border-top: 4px solid var(--accent); padding-top: 20px; }
@media (min-width: 900px) { .result { position: sticky; top: 16px; } }
.r-label { font-size: 15px; color: var(--ink2); font-weight: 500; }
.r-value { margin-top: 2px; font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.r-sub { margin-top: 2px; font-size: 14px; color: var(--ink2); }
.status { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.status.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.status.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, var(--surface)); }
.status.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.rows { margin: 16px 0 0; padding: 0; }
.rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rows dt { color: var(--ink2); }
.rows dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rows .total dt { color: var(--ink); font-weight: 600; }
.rows .total dd { font-weight: 800; }
.notes { margin: 14px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink2); line-height: 1.55; }
.notes li + li { margin-top: 4px; }
.empty { padding: 24px 4px; color: var(--ink2); }
.bar { display: flex; height: 14px; margin-top: 16px; border-radius: 7px; overflow: hidden; background: var(--soft); }
.bar i { display: block; height: 100%; }
.legend { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sw); }
.b0 { --sw: var(--accent); background: var(--accent); }
.b1 { --sw: color-mix(in srgb, var(--ink) 55%, var(--surface)); background: var(--sw); }
.b2 { --sw: color-mix(in srgb, var(--ink) 35%, var(--surface)); background: var(--sw); }
.b3 { --sw: color-mix(in srgb, var(--ink) 20%, var(--surface)); background: var(--sw); }
.gauge { margin-top: 18px; }
.g-track { position: relative; display: flex; gap: 3px; padding-top: 12px; }
.g-seg { flex: 1; height: 12px; border-radius: 4px; background: var(--soft); }
.g-seg.on { background: var(--accent); }
.g-pin { position: absolute; top: 0; width: 0; height: 0; margin-left: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--ink); }
.g-labels { display: flex; gap: 3px; margin-top: 6px; }
.g-labels span { flex: 1; min-width: 0; text-align: center; font-size: 12px; line-height: 1.3; color: var(--ink2); }
.g-labels span.on { color: var(--ink); font-weight: 700; }

/* 광고 자리. 실제 애드센스 코드가 들어가면 점선 표시는 사라집니다. */
.ad { margin-block: 24px; min-height: 100px; display: grid; place-items: center; text-align: center; overflow: hidden; }
.ad--preview { border: 1.5px dashed var(--line); border-radius: 12px; color: var(--ink2); font-size: 13px; background: color-mix(in srgb, var(--soft) 55%, transparent); }
.ad--mid { min-height: 250px; }
.ad--side { min-height: 250px; margin: 0; display: none; }
@media (min-width: 900px) { .ad--side { display: grid; } }

/* 설명 글 */
.article { max-width: 760px; margin-block: 8px 24px; }
.article h2 { margin: 36px 0 10px; font-size: 1.35rem; line-height: 1.35; letter-spacing: -0.025em; text-wrap: balance; }
.article h3 { margin: 24px 0 6px; font-size: 1.05rem; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 1.3em; }
.article li { margin-bottom: 6px; }
.formula { margin: 0 0 16px; padding: 14px 16px; background: var(--soft); border-radius: 12px; font-size: 15.5px; line-height: 1.8; overflow-x: auto; font-variant-numeric: tabular-nums; }
.formula b { font-weight: 700; }
.tbl { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: var(--soft); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 4px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1.2; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; padding-inline: 4px; color: var(--ink2); }
.related { margin-block: 8px 0; }
.related h2 { margin: 24px 0 12px; font-size: 1.15rem; }

/* 푸터 */
.foot { margin-top: 48px; padding-block: 28px; border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink2); }
.foot .wrap { display: grid; gap: 12px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot p { margin: 0; max-width: 46em; }
.legal { max-width: 760px; padding-block: 28px; }
.legal h1 { font-size: 1.8rem; letter-spacing: -0.03em; margin: 0 0 12px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 모바일: 결과를 화면 아래에 고정 */
.mini { display: none; }
@media (max-width: 899px) {
  .mini {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 3px solid var(--accent);
    box-shadow: 0 -6px 20px color-mix(in srgb, var(--ink) 10%, transparent);
    text-decoration: none; min-height: 64px;
  }
  .mini[hidden] { display: none !important; }
  .mini span { font-size: 13px; color: var(--ink2); line-height: 1.3; }
  .mini b { display: block; font-size: 1.35rem; line-height: 1.25; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .mini em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
  .has-mini { padding-bottom: 76px; }
}

/* 결과 해석용 기준표 (계산기 바로 아래) */
.quick { margin-block: 20px 0; }
.quick > h2 { margin: 0 0 14px; font-size: 1.05rem; letter-spacing: -0.02em; }
.quick-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.quick-grid > div { min-width: 0; }
.quick .cap { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.quick .tbl { margin: 0; }
.quick .help { margin: 14px 0 0; }
.tbl tr.hl td { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--ink); font-weight: 700; }
.caution { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--soft); }

/* 홈: 즐겨찾기 별표, 자주 찾는 계산기 */
.card-wrap { position: relative; display: flex; min-width: 0; }
.card-wrap .card { flex: 1; padding-right: 56px; }
.fav { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); cursor: pointer; }
.fav:hover { background: var(--soft); }
.fav svg { width: 22px; height: 22px; }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; font-size: 15px; }
.pop span { color: var(--ink2); font-weight: 500; }
.pop a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 11%, var(--surface)); color: var(--ink); text-decoration: none; font-weight: 500; }
.pop a:hover { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.mrow { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; min-width: 0; }
.mt { flex: none; font-size: 13px; font-weight: 700; color: var(--ink2); min-width: 52px; }
.mlist { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 0; }
.mlist::-webkit-scrollbar { display: none; }
.mchip { flex: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; white-space: nowrap; }
#mine { margin: 4px 0 18px; }
#mine:empty { margin: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.btn.sm svg { width: 18px; height: 18px; color: var(--accent); }
.btn.sm[aria-pressed="true"] svg { fill: currentColor; }
.share-url { flex: 1 1 100%; max-width: 460px; height: 44px; padding: 0 14px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--surface); font-size: 15px; }

/* 금액 빠른 입력 */
.qadd { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qadd button { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.qadd button:hover { border-color: var(--accent); color: var(--accent); }
.qadd button.clr { color: var(--ink2); font-weight: 500; }

.trust { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.trust li { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line, rgba(127,127,127,.22)); color: var(--ink2); font-size: 15px; line-height: 1.5; }
.trust b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }

/* 홈 카드: 가로형 컴팩트 */
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.card-wrap .card { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 1px; align-items: center; padding: 12px 52px 12px 14px; border-radius: 12px; }
.card-wrap .card .ic { grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; }
.card-wrap .card b { font-size: 1.02rem; line-height: 1.3; }
.card-wrap .card > span:last-child { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-wrap .fav { top: 50%; transform: translateY(-50%); right: 4px; }

.top .wrap { position: relative; }
.theme { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); cursor: pointer; }
.theme:hover { background: var(--soft); color: var(--ink); }
@media (min-width: 720px) { .theme { top: 50%; transform: translateY(-50%); right: 20px; } }

.legal .meta { color: var(--ink2); font-size: 14px; margin-top: -4px; }
.legal h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.legal ul { padding-left: 1.2em; line-height: 1.7; }
.legal li { margin: 4px 0; }
.legal .tbl { margin: 8px 0; }
.legal .help { color: var(--ink2); font-size: 14px; margin: 6px 0 0; }
.sources { margin-top: 28px; }
.sources h2 { margin-top: 0; }
.sources .tbl th, .sources .tbl td, .legal .tbl th, .legal .tbl td { white-space: normal; word-break: keep-all; vertical-align: top; padding: 10px 12px; font-size: 14.5px; line-height: 1.5; }
.sources .tbl td:first-child, .legal .tbl td:first-child { min-width: 5.5em; font-weight: 600; }

/* 헤더: 홈 버튼 + 검색 */
.home { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--ink2); margin-left: -12px; }
.home:hover { background: var(--soft); color: var(--ink); }
.hsearch { position: relative; flex: 1 1 220px; max-width: 360px; min-width: 0; }
.hs-box { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink2); }
.hs-box:focus-within { border-color: var(--accent); }
.hs-box svg { width: 18px; height: 18px; flex: none; }
.hs-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.hs-pop { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 8px; max-height: 70vh; overflow-y: auto; }
.hs-pop[hidden], .hs-pop li[hidden], .hs-pop em[hidden], .hs-pop .hs-hot[hidden], .hs-none[hidden] { display: none; }
.hs-hot { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; margin-left: auto; padding: 2px 7px; border-radius: 999px; background: #FDE8EC; color: #C2185B; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
:root[data-theme="dark"] .hs-hot { background: #4A1D2C; color: #FF8FB1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hs-hot { background: #4A1D2C; color: #FF8FB1; } }
.hs-h { margin: 4px 8px 6px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.hs-pop ol { list-style: none; margin: 0; padding: 0; }
.hs-pop li a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15.5px; }
.hs-pop li a:hover, .hs-pop li.on a { background: var(--soft); }
.hs-pop em { font-style: normal; width: 18px; text-align: right; font-weight: 700; color: var(--accent); font-size: 14px; }
.hs-ic svg { width: 18px; height: 18px; color: var(--accent); display: block; }
.hs-none { margin: 10px 8px; color: var(--ink2); font-size: 14px; }
@media (max-width: 719px) { .nav { order: 6; } .hsearch { order: 5; flex: 1 1 0; max-width: none; } .top .wrap { padding-right: 60px; column-gap: 8px; } .hs-box { height: 40px; padding: 0 10px; gap: 6px; } .hs-box input { font-size: 15px; } }

/* 홈 히어로 */
#home .hero { position: relative; margin-top: 16px; padding: 36px 20px 24px; border-radius: 20px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c-fin) 14%, var(--surface)) 0%, var(--surface) 60%); border: 1px solid var(--line); }
#home .hero h1 em { font-style: normal; color: var(--c-fin); }
#home .hero { display: grid; gap: 22px; }
.hero-new { padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); }
.hero-new h2 { margin: 0 0 8px; font-size: 0.95rem; font-weight: 700; color: var(--ink2); }
.hero-new ul { list-style: none; margin: 0; padding: 0; }
.hero-new li + li { border-top: 1px solid var(--line); }
.hero-new a { display: flex; flex-direction: column; gap: 2px; padding: 10px 2px; text-decoration: none; color: var(--ink); }
.hero-new a b { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }
.hero-new a span { font-size: 0.8rem; color: var(--ink2); }
.hero-new a:hover b { color: var(--c-fin); text-decoration: underline; }
@media (min-width: 900px) { #home .hero { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: center; } }
#home .hero p { margin-bottom: 18px; }
#home .hsearch.big { max-width: 560px; flex: none; }
#home .hsearch.big .hs-box { height: 54px; padding: 0 16px; border-radius: 14px; box-shadow: 0 2px 10px rgba(20,40,80,.07); }
#home .hsearch.big .hs-box svg { width: 22px; height: 22px; }
#home .hsearch.big .hs-box input { font-size: 17px; }
#home .chips { margin-top: 18px; }
@media (min-width: 720px) { #home .hero { padding: 48px 40px 32px; } }
/* 카드: 설명은 한 줄만 */
.card-wrap .card > span:last-child { -webkit-line-clamp: 1; }
.card-wrap .card { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-wrap .card:hover { box-shadow: 0 6px 18px rgba(20,40,80,.08); }
.group { padding-block: 28px 4px; }
.group h2 { font-size: 1.1rem; }

.card-wrap .card > span:last-child { display: none; }
.card-wrap .card { grid-template-rows: auto; min-height: 60px; }
.card-wrap .card .ic { grid-row: 1; }
.card-wrap .card b { font-size: 1.05rem; }

#home .hero { padding-bottom: 32px; }
html { scroll-behavior: smooth; }
.group { scroll-margin-top: 16px; }

/* 즐겨찾기: 눈에 띄는 상자 */
#mine { margin: 18px 0 4px; }
#mine .mrow { flex-direction: column; align-items: stretch; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, #F5B301 12%, var(--surface)); border: 1px solid color-mix(in srgb, #F5B301 40%, var(--line)); }
#mine .mt { font-size: 15px; color: var(--ink); }
#mine .mt::first-letter { color: #E0A100; }
#mine .mlist { flex-wrap: wrap; overflow: visible; gap: 8px; }
#mine .mchip { font-size: 15px; padding: 9px 14px; }

.group h3.sub { margin: 22px 0 10px; padding-left: 10px; font-size: 1.05rem; font-weight: 700; color: var(--ink); border-left: 4px solid var(--accent); line-height: 1.2; }
.group h3.sub:first-of-type { margin-top: 0; }

/* 폰: 메뉴를 가로로 밀지 않고 줄바꿈해서 전부 보여 줌 */
@media (max-width: 719px) {
  .nav { flex-wrap: wrap; overflow: visible; gap: 4px 2px; margin-inline: -6px; padding-inline: 0; width: 100%; order: 6; }
  .nav a { min-height: 40px; padding: 0 10px; font-size: 15px; gap: 6px; }
  .top .wrap { row-gap: 6px; padding-block: 8px 10px; }
}
@media (max-width: 719px) {
  .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-inline: 0; }
  .nav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 2px; border-radius: 12px; font-size: 13.5px; line-height: 1.25; text-align: center; background: var(--soft); }
  .nav a svg { width: 20px; height: 20px; }
}
.foot p a { color: inherit; }

.foot .tm { font-size: 12.5px; opacity: .75; }

.field textarea { width: 100%; min-height: 160px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--accent, var(--c-fin)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, var(--c-fin)) 18%, transparent); }

/* 목록 카드와 제목을 조금 더 작게 (계산기 입력·결과 글씨는 그대로) */
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.card-wrap .card { min-height: 50px; padding: 8px 46px 8px 12px; border-radius: 11px; column-gap: 10px; }
.card-wrap .card .ic { width: 32px; height: 32px; border-radius: 9px; }
.card-wrap .card .ic svg { width: 18px; height: 18px; }
.card-wrap .card b { font-size: 0.94rem; }
.card-wrap .fav { width: 40px; height: 40px; }
.card-wrap .fav svg { width: 18px; height: 18px; }
.group { padding-block: 28px 2px; }
.group h2 { font-size: 1.25rem; margin-bottom: 12px; padding-bottom: 8px; }
.group h2 svg { width: 24px; height: 24px; padding: 4px; }
.group h3.sub { font-size: 0.98rem; margin: 18px 0 8px; }
.related .card { padding: 12px 14px; }
.related .card b { font-size: 0.98rem; }
.related .card > span:last-child { font-size: 13px; }
.card-wrap .card { grid-template-columns: 32px 1fr; padding-right: 38px; }
.card-wrap .fav { width: 36px; right: 2px; }
.card-wrap .card b { font-size: 0.92rem; letter-spacing: -0.03em; }
@media (max-width: 600px) { .card-wrap .card b { font-size: 0.98rem; } .card-wrap .card { min-height: 54px; } }

/* 계산 저장·비교 */
.sv-act { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sv-act .help { margin: 0; flex: 1 1 100%; font-size: 13px; }
.saved { margin-top: 16px; }
.saved > h2 .help { font-weight: 400; margin-left: 8px; }
.sv-list { list-style: none; margin: 0; padding: 0; }
.sv-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.sv-list li:first-child { border-top: 0; padding-top: 0; }
.sv-pick { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.sv-pick input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.sv-pick span { min-width: 0; line-height: 1.5; }
.sv-pick em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-pick small { display: block; color: var(--ink2); font-size: 13px; margin-top: 2px; word-break: keep-all; }
.sv-btns { display: flex; gap: 8px; margin: 8px 0 0 34px; flex-wrap: wrap; }
.sv-btns .btn.sm { min-height: 40px; font-size: 14px; padding: 0 12px; }
.sv-msg { min-height: 1.4em; margin-top: 8px; font-size: 14px; color: var(--accent); }
.sv-h { margin: 12px 0 8px; font-size: 1rem; }
.sv-scroll { overflow-x: auto; }
.sv-tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.sv-tbl th, .sv-tbl td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.sv-tbl thead th { color: var(--ink2); font-weight: 600; border-top: 0; }
.sv-tbl tbody th { text-align: left; font-weight: 500; color: var(--ink2); }
.sv-tbl tr.main td, .sv-tbl tr.main th { font-weight: 800; color: var(--ink); }
.sv-chg { margin-top: 10px; }
@media (max-width: 560px) {
  .sv-tbl { font-size: 13px; table-layout: fixed; }
  .sv-tbl th, .sv-tbl td { padding: 8px 3px; word-break: keep-all; overflow-wrap: anywhere; }
  .sv-tbl th:first-child { width: 29%; }
  .sv-btns { margin-left: 0; }
}
@media (max-width: 560px) {
  .sv-tbl { font-size: 12.5px; }
  .sv-tbl td { white-space: nowrap; letter-spacing: -0.02em; }
  .sv-tbl th:first-child { width: 26%; }
}

/* 저장·비교: 작게, 계산기 아래 전체 폭 */
.sv-act { margin-top: 12px; padding-top: 12px; }
.sv-act .btn.sm { min-height: 40px; font-size: 14px; padding: 0 12px; }
.saved { margin-top: 20px; padding: 16px 18px; }
.saved > h2 { margin-bottom: 10px; font-size: .95rem; }
.sv-list li { padding: 8px 0; display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sv-pick { flex: 1 1 260px; }
.sv-pick small { font-size: 12.5px; }
.sv-btns { margin: 0; flex: none; }
.sv-btns .btn.sm { min-height: 36px; font-size: 13.5px; padding: 0 10px; }
@media (max-width: 560px) { .sv-btns { margin-left: 34px; } }
@media (min-width: 900px) { .sv-tbl { max-width: 760px; } }

.rows .sec { border-top: 2px solid var(--line); padding-top: 12px; margin-top: 4px; }
.rows .sec dt { font-weight: 700; color: var(--ink); }
@media (min-width: 900px) { .result { max-height: calc(100vh - 32px); overflow-y: auto; } }

/* 문의 안내창 */
.ct-back { position: fixed; inset: 0; z-index: 100; background: rgba(10, 16, 22, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ct-back[hidden] { display: none; }
.ct-box { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.ct-box h2 { margin: 0 0 8px; font-size: 1.15rem; }
.ct-box p { margin: 0 0 14px; color: var(--ink2); font-size: 15px; line-height: 1.6; }
.ct-addr { padding: 12px 14px; background: var(--soft); border-radius: 10px; font-weight: 700; font-size: 16px; text-align: center; word-break: break-all; user-select: all; }
.ct-btns { display: grid; gap: 8px; margin-top: 14px; }
.ct-btns .btn { width: 100%; justify-content: center; text-align: center; text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }
.ct-msg { min-height: 1.4em; margin-top: 10px; font-size: 14px; color: var(--accent); }
.ct-close { width: 100%; margin-top: 4px; background: transparent; }

/* 홈 개편: 색 있는 히어로, 새 계산기 3개, 분류 타일 */
#home .hero { background:
  radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--c-estate) 20%, transparent) 0%, transparent 70%),
  radial-gradient(70% 100% at 0% 0%, color-mix(in srgb, var(--c-fin) 22%, transparent) 0%, transparent 70%),
  var(--surface); }
#home .hero h1 em { background: linear-gradient(90deg, var(--c-fin), var(--c-estate)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-pop, .hero-gov { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.hero-pop > span, .hero-gov > span { flex: none; font-size: 0.8rem; font-weight: 700; color: var(--ink2); min-width: 4.6em; }
.hero-pop a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.hero-pop a:hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.hero-gov a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 0.82rem; text-decoration: none; color: var(--ink2); background: var(--soft); }
.hero-gov a::after { content: "↗"; margin-left: 4px; font-size: 0.75em; }
.hero-gov a:hover { color: var(--ink); text-decoration: underline; }
.hero-new { padding: 14px 14px 8px; background: var(--surface); box-shadow: 0 6px 22px rgba(20,40,80,.08); }
.hero-new h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.95rem; color: var(--ink); }
.hero-new h2 em { font-style: normal; font-size: 0.68rem; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #fff; background: var(--c-tax); }
.hero-new li + li { border-top: 0; }
.hero-new a { flex-direction: row; align-items: center; gap: 10px; padding: 8px 8px; margin-bottom: 6px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border-left: 4px solid var(--accent); }
.hero-new a i { display: flex; flex: none; color: var(--accent); }
.hero-new a i svg { width: 18px; height: 18px; }
.hero-new a b { flex: 1; min-width: 0; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-new a time { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--accent); }
.hero-new a:hover { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.hero-new a:hover b { color: var(--ink); text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,40,80,.1); }
.tile i { grid-row: 1 / 3; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--accent); }
.tile i svg { width: 20px; height: 20px; }
.tile b { font-size: 0.98rem; font-weight: 700; line-height: 1.2; }
.tile span { font-size: 0.78rem; color: var(--ink2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile i { color: #0E141B; } }
:root[data-theme="dark"] .tile i { color: #0E141B; }

@media (max-width: 719px) { .hero-gov { display: none; } }

@media (max-width: 719px) { .hero-gov { display: block; } }

/* 테스트·연습 도구 (CPS, 반응 속도, 타자) */
.calc.tool { display: block; }
.tool-panel { display: grid; gap: 16px; padding: 20px; }
.t-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.t-row > span { font-weight: 700; color: var(--ink2); font-size: 0.9rem; }
.t-seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.t-seg button { min-height: 44px; padding: 0 16px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.t-seg button:last-child { border-right: 0; }
.t-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.t-pad { width: 100%; min-height: 220px; padding: 20px; border: 0; border-radius: 16px; font: inherit; font-size: 1.15rem; font-weight: 700; line-height: 1.5; color: #fff; background: var(--c-fin); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: background .1s; }
.t-pad.idle { background: var(--c-fin); }
.t-pad.run { background: var(--c-estate); }
.t-pad.done { background: var(--c-health); }
.t-pad.wait { background: var(--bad); }
.t-pad.go { background: var(--ok); }
.t-pad.early { background: var(--c-elec); }
:root[data-theme="dark"] .t-pad, :root[data-theme="dark"] .t-seg button[aria-pressed="true"] { color: #0E141B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-pad, :root:not([data-theme="light"]) .t-seg button[aria-pressed="true"] { color: #0E141B; } }
.t-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.t-stats > div { padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.t-stats span { display: block; font-size: 0.78rem; color: var(--ink2); }
.t-stats b { display: block; margin-top: 2px; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.t-note { margin: 0; font-size: 0.88rem; color: var(--ink2); }
.t-lead { margin: 0; font-weight: 600; }
.tool-panel .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-target { padding: 16px 18px; border-radius: 12px; background: var(--soft); font-size: 1.2rem; line-height: 1.7; font-weight: 600; word-break: keep-all; }
.tt-input { width: 100%; min-height: 54px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.1rem; }
.tt-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tt-res { display: none; }
.tt-res.show { display: grid; gap: 10px; }

/* 분류 접기 */
.group h2 { padding: 0; }
.gtoggle { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 0 0 10px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.gtoggle .gname { flex: 1; }
.gtoggle .chev { width: 10px; height: 10px; margin-right: 6px; border-right: 2.5px solid var(--muted, #6b7280); border-bottom: 2.5px solid var(--muted, #6b7280); transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; }
.group.collapsed .gtoggle .chev { transform: rotate(-45deg); }
.group.collapsed .gbody { display: none; }
#list.is-active .group.collapsed .gbody { display: block; }
.gtoggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero-tools { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }


/* 공식 사이트 링크: 카드 없이 작은 글씨 */
.gov-links { margin-top: 28px; padding: 0 2px; }
.gov-links h2 { display: inline; margin: 0 8px 0 0; font-size: 0.8rem; font-weight: 600; color: var(--ink2); }
.gov-links div { display: inline; }
.gov-links a { display: inline-block; padding: 6px 8px 6px 0; font-size: 0.8rem; text-decoration: none; color: var(--ink2); }
.gov-links a::after { content: "↗"; margin-left: 2px; font-size: 0.8em; }
.gov-links a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 719px) { .nav { grid-template-columns: repeat(3, 1fr); } }

.foot-install { justify-self: start; }
.app-btn { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; min-height: 44px; text-align: left; font-weight: 700; }
.app-btn .app-ico { width: 32px; height: 32px; flex: none; border-radius: 8px; }
.app-btn .app-txt { display: flex; flex-direction: column; line-height: 1.25; }
.app-btn .app-txt b { font-size: 15px; font-weight: 800; }
.app-btn .app-txt small { font-size: 12.5px; font-weight: 500; color: var(--ink2); }
.app-btn[hidden] { display: none; }
.foot-install[hidden] { display: none; }

@media (max-width: 640px) { .hs-pop { left: auto; right: 0; width: min(310px, calc(100vw - 32px)); } .hs-pop li a b { flex: 1; min-width: 0; } }

/* 모바일 메뉴 (옆에서 나오는 목록) */
.menu-btn { display: none; width: 44px; height: 44px; margin-left: -8px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); place-items: center; cursor: pointer; }
.drawer-back, .drawer { display: none; }
@media (max-width: 719px) {
  .menu-btn { display: grid; }
  .page:not(#home) .top .nav { display: none; }
  .drawer-back { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(10, 16, 22, .5); opacity: 0; transition: opacity .2s; }
  .drawer-back[hidden] { display: none; }
  .drawer-back.open { opacity: 1; }
  .drawer { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 91; width: min(300px, 84vw); background: var(--surface); color: var(--ink); box-shadow: 8px 0 30px rgba(0, 0, 0, .2); transform: translateX(-102%); transition: transform .22s ease; overflow-y: auto; visibility: hidden; padding: 12px 14px 20px; }
  .drawer.open { transform: translateX(0); visibility: visible; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
  .drawer-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
  .drawer-nav { display: flex; flex-direction: column; margin-top: 6px; }
  .drawer-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 16px; font-weight: 600; }
  .drawer-nav a:active { background: var(--soft); }
  .drawer-nav svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
  .drawer-h { margin: 14px 10px 4px; font-size: 13px; color: var(--ink2); font-weight: 700; }
  .drawer-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
  .drawer-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-size: 13.5px; }
  .drawer-sub a { color: var(--ink2); }
  html.no-scroll, html.no-scroll body { overflow: hidden; }
  .top .wrap { padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-back { transition: none; } }

/* 메뉴 안 분야 펼치기 + 스크롤해도 보이는 메뉴 버튼 */
.menu-fab { display: none; }
@media (max-width: 719px) {
  .dcat { border-radius: 12px; }
  .dcat summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: 12px; cursor: pointer; list-style: none; font-size: 16px; font-weight: 600; color: var(--ink); }
  .dcat summary::-webkit-details-marker { display: none; }
  .dcat summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(45deg); transition: transform .15s; }
  .dcat[open] summary::after { transform: rotate(-135deg); }
  .dcat summary svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
  .dcat summary:active { background: var(--soft); }
  .dcat ul { list-style: none; margin: 0 0 6px 20px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
  .dcat li a { display: flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500; }
  .dcat li a:active { background: var(--soft); }
  .dcat .dsub { margin: 8px 8px 2px; font-size: 12.5px; font-weight: 700; color: var(--ink2); }
  .menu-fab { position: fixed; top: 10px; left: 10px; z-index: 80; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .18s, transform .18s; }
  .menu-fab.show { opacity: 1; pointer-events: auto; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .menu-fab { transition: none; } .dcat summary::after { transition: none; } }
@media (hover: hover) and (pointer: fine) { [data-install] { display: none !important; } }

.sv-tbl.wide { min-width: 460px; table-layout: auto; }
@media (max-width: 560px) { .sv-tbl.wide { min-width: 520px; } .sv-tbl.wide th:first-child { width: auto; } }

.sv-name { font: inherit; font-weight: 800; width: 11em; max-width: 100%; padding: 2px 6px; margin: -2px 0; border: 1px dashed var(--line); border-radius: 6px; background: transparent; color: var(--ink); }
.sv-name:hover { border-color: var(--ink2); }
.sv-name:focus { border: 1px solid var(--accent); outline: none; background: var(--surface); }

/* 홈 히어로: 검색줄(공유하기), 인기 칩 한 줄, 최근 본 계산기 */
.hero-row { display: flex; align-items: center; gap: 10px; max-width: 640px; }
#home .hero-row .hsearch.big { flex: 1 1 auto; min-width: 0; max-width: 560px; }
.hero-share { flex: none; }
.hero-pop { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 640px; }
.hero-pop::-webkit-scrollbar { display: none; }
.hero-pop > span { min-width: 0; }
.hero-pop a { flex: none; white-space: nowrap; }
.hero-tools:has(> .app-btn[hidden]:only-child) { display: none; }
.hero-side { display: grid; gap: 10px; align-content: center; min-width: 0; }
.hero-rec { padding: 10px 14px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.hero-rec h2 { margin: 0 0 6px; font-size: 0.82rem; font-weight: 700; color: var(--ink2); }
.hero-rec div { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-rec a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--soft); }
.hero-rec a:hover { text-decoration: underline; }
@media (max-width: 560px) { .hero-share span { display: none; } .hero-share { padding: 0 12px; } }
#home .hero > * { min-width: 0; }
@media (max-width: 719px) { #home .hero-row .hsearch.big { order: 0; flex: 1 1 0; } #home .hero { grid-template-columns: minmax(0, 1fr); } }

/* 헤더 즐겨찾기 버튼 + 목록 창 */
.favbtn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -18px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); cursor: pointer; }
.favbtn svg { width: 21px; height: 21px; }
.favbtn:hover, .favbtn[aria-expanded="true"] { background: var(--soft); color: var(--ink); }
.fav-pop { position: absolute; z-index: 60; top: calc(100% - 4px); left: 0; width: min(340px, calc(100vw - 24px)); max-height: min(70vh, 460px); overflow-y: auto; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(20,40,80,.18); }
.fav-pop[hidden] { display: none; }
.fav-pop h2 { margin: 0 0 6px; font-size: 0.85rem; font-weight: 700; color: var(--ink2); }
.fav-pop h2 + ul + h2 { margin-top: 14px; }
.fav-pop ul { list-style: none; margin: 0; padding: 0; }
.fav-pop li a { display: block; padding: 10px 6px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; text-decoration: none; color: var(--ink); }
.fav-pop li a:hover { background: var(--soft); }
.fav-pop p { margin: 0; font-size: 0.9rem; color: var(--ink2); line-height: 1.5; }
@media (max-width: 719px) { .favbtn { margin-left: -6px; } .fav-pop { left: 12px; } }

/* 즐겨찾기 창: 구역 구분선·줄 구분선·별 버튼 */
.fav-pop { padding: 0; overflow-x: hidden; }
.fav-pop h2 { margin: 0; padding: 10px 16px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--ink); font-size: 0.82rem; }
.fav-pop h2 + ul + h2 { margin-top: 0; border-top: 1px solid var(--line); }
.fav-pop > p { padding: 14px 16px; }
.fav-pop li { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 10px; border-top: 1px solid var(--line); }
.fav-pop li:first-child { border-top: 0; }
.fav-pop li a { flex: 1; min-width: 0; padding: 13px 6px; }
.pf { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink2); cursor: pointer; }
.pf:hover { background: var(--soft); }
.pf[aria-pressed="true"] { color: var(--accent); }
.pf[aria-pressed="true"] svg { fill: currentColor; }

/* 즐겨찾기 창: 분야 색(왼쪽 띠·아이콘·옅은 배경)과 분야 이름 */
.fav-pop h2 { background: var(--ink); color: var(--surface); border-bottom: 0; }
.fav-pop h2 + ul + h2 { border-top: 0; }
.fav-pop li { gap: 8px; padding: 0 6px 0 0; margin: 6px 8px; border: 0; border-left: 5px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.fav-pop li:first-child { margin-top: 8px; }
.fav-pop li:last-child { margin-bottom: 8px; }
.fav-pop li:hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.fav-pop .pi { display: flex; flex: none; margin-left: 10px; color: var(--accent); }
.fav-pop .pi svg { width: 20px; height: 20px; }
.fav-pop li a { padding: 9px 2px; line-height: 1.3; }
.fav-pop li a small { display: block; margin-top: 1px; font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.fav-pop .pf { color: var(--accent); }
.fav-pop .pf:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* 즐겨찾기 창: 더 옅게 */
.fav-pop h2 { background: var(--soft); color: var(--ink2); border-bottom: 1px solid var(--line); }
.fav-pop h2 + ul + h2 { border-top: 1px solid var(--line); }
.fav-pop li { border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.fav-pop li:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.fav-pop .pi { opacity: .85; }
.fav-pop li a small { opacity: .9; font-weight: 600; }

/* 즐겨찾기 창: 글씨·카드 작게, 5개 이상이면 두 줄(2열) */
.fav-pop li { margin: 5px 8px; }
.fav-pop li a { padding: 7px 2px; font-size: 0.88rem; }
.fav-pop li a small { font-size: 0.7rem; }
.fav-pop .pi { margin-left: 8px; }
.fav-pop .pi svg { width: 17px; height: 17px; }
.pf { width: 34px; height: 34px; }
.pf svg { width: 17px; height: 17px; }
.fav-pop.wide { width: min(540px, calc(100vw - 24px)); }
.fav-pop ul.two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.fav-pop ul.two li, .fav-pop ul.two li:first-child, .fav-pop ul.two li:last-child { margin: 0; padding-right: 2px; gap: 4px; }
.fav-pop ul.two .pi { margin-left: 6px; }
.fav-pop ul.two li a { font-size: 0.82rem; line-height: 1.25; }

/* 즐겨찾기 창 최종: 흰 바탕, 분야 색은 아이콘 칸에만, 이름 한 줄(…), 별은 검정 */
.fav-pop li, .fav-pop li:first-child, .fav-pop li:last-child { margin: 0; padding: 0 4px 0 10px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; gap: 10px; min-height: 48px; }
.fav-pop ul:not(.two) li:first-child { border-top: 0; }
.fav-pop li:hover { background: var(--soft); }
.fav-pop .pi, .fav-pop ul.two .pi { margin: 0; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; opacity: 1; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.fav-pop .pi svg { width: 18px; height: 18px; }
.fav-pop li a, .fav-pop ul.two li a { padding: 12px 0; font-size: 0.9rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-pop .pf, .pf[aria-pressed="true"] { color: var(--ink); }
.fav-pop .pf:hover { background: var(--soft); }
.fav-pop ul.two { gap: 0 10px; padding: 0 6px 6px; }
.fav-pop ul.two li, .fav-pop ul.two li:first-child, .fav-pop ul.two li:last-child { padding: 0 2px 0 4px; gap: 8px; }
.fav-pop ul.two li:nth-child(-n+2) { border-top: 0; }
.fav-pop ul.two li a { font-size: 0.86rem; }
.fav-pop ul.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fav-pop li { min-width: 0; }

/* 소개·약관·개인정보처리방침: 문서형(작은 글씨, 얇은 강조) */
.legal { max-width: 800px; font-size: 14.5px; line-height: 1.8; color: var(--ink); }
.legal h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.legal h2 { font-size: 1rem; font-weight: 700; margin: 26px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); letter-spacing: -0.01em; }
.legal h1 + .meta + h2, .legal h1 + .meta + p { border-top: 0; }
.legal h3 { font-size: 0.94rem; font-weight: 700; margin: 16px 0 4px; }
.legal p { margin: 6px 0; }
.legal ul { line-height: 1.8; }
.legal li { margin: 2px 0; }
.legal b { font-weight: 500; }
.legal .meta { font-size: 13px; }
.legal .tbl th, .legal .tbl td { font-size: 13px; padding: 8px 10px; }
.legal .tbl td:first-child { font-weight: 500; }

/* 404 홈 버튼 */
.legal a.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 20px;text-decoration:none}
