:root {
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFCFA;
  --ink: #15201B;
  --ink-2: #2E3A34;
  --muted: #4A5650;
  --muted-2: #5A6660;
  --line: #E2E5E0;
  --line-2: #EEF0EC;
  --field: #CBD2CD;
  --accent: #0E6B4E;
  --accent-hover: #0A5039;
  --accent-soft: #E6F2EC;
  --on-accent: #FFFFFF;
  --deduct: #A45A12;
  --deduct-bar: #E3A25B;
  --warn-bg: #FFF4E5;
  --warn-ink: #7A4304;
  --head: #F0F2EE;
  --cta: #15201B;
  --cta-ink: #FFFFFF;
  --cta-sub: #C9D3CD;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101614;
    --surface: #18201D;
    --surface-2: #1C2522;
    --ink: #E8EEEA;
    --ink-2: #D2DBD6;
    --muted: #A8B4AE;
    --muted-2: #9AA6A0;
    --line: #2A3531;
    --line-2: #24302C;
    --field: #3A4742;
    --accent: #4CC59A;
    --accent-hover: #6DD6AE;
    --accent-soft: #163329;
    --on-accent: #0B1A14;
    --deduct: #F0A55A;
    --deduct-bar: #C98738;
    --warn-bg: #3A2A12;
    --warn-ink: #F5C98A;
    --head: #1F2925;
    --cta: #22302B;
    --cta-ink: #FFFFFF;
    --cta-sub: #B5C3BC;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101614;
  --surface: #18201D;
  --surface-2: #1C2522;
  --ink: #E8EEEA;
  --ink-2: #D2DBD6;
  --muted: #A8B4AE;
  --muted-2: #9AA6A0;
  --line: #2A3531;
  --line-2: #24302C;
  --field: #3A4742;
  --accent: #4CC59A;
  --accent-hover: #6DD6AE;
  --accent-soft: #163329;
  --on-accent: #0B1A14;
  --deduct: #F0A55A;
  --deduct-bar: #C98738;
  --warn-bg: #3A2A12;
  --warn-ink: #F5C98A;
  --head: #1F2925;
  --cta: #22302B;
  --cta-ink: #FFFFFF;
  --cta-sub: #B5C3BC;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}
a { color: var(--accent); }
@media (hover: hover) { a:hover { color: var(--accent-hover); } }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 880px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
@media (hover: hover) { .logo:hover { color: var(--ink); } }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.logo-text { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; gap: 2px 16px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 10px 0; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tools { border-top: 1px solid var(--line-2); position: relative; }
/* 계산기 목록: 옆으로 더 있으면 가장자리를 흐리게 하고 화살표를 보여준다 */
.tools-arrow { display: none; position: absolute; top: 0; bottom: 0; width: 72px; border: 0; padding: 0 8px; align-items: center; color: var(--on-accent); cursor: pointer; z-index: 1; }
.tools-arrow span { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tools-arrow.t-next { right: 0; justify-content: flex-end; background: linear-gradient(to right, transparent, var(--surface) 55%); }
.tools-arrow.t-prev { left: 0; justify-content: flex-start; background: linear-gradient(to left, transparent, var(--surface) 55%); }
.tools.more-right .tools-arrow.t-next span { animation: nudge 1.2s ease-in-out 0.6s 2; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .tools-arrow span { animation: none !important; } }
.tools.more-right .tools-arrow.t-next, .tools.more-left .tools-arrow.t-prev { display: flex; }
@media (min-width: 760px) { .tools-inner { flex-wrap: wrap; overflow: visible; } .tools-arrow { display: none !important; } }
/* 휴대폰에서는 머리글이 화면을 너무 많이 차지하지 않게 고정하지 않는다 */
@media (max-width: 759px) { .site-header { position: relative; } }
.tools-inner { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.tools-inner::-webkit-scrollbar { display: none; }
.tools a { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
@media (hover: hover) { .tools a:hover { border-color: var(--accent); color: var(--accent); } }
.tools a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.ad { margin-top: 24px; min-height: 90px; text-align: center; }

/* hero */
.hero { padding: 32px 0 20px; }
.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 700; }
.lead { margin: 10px 0 0; font-size: 16px; color: var(--muted); max-width: 680px; }
h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; line-height: 1.35; }
.section { padding-top: 44px; }
.section-desc { margin: 6px 0 18px; color: var(--muted); font-size: 15px; }

/* calculator */
.calc { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calc-form { flex: 1 1 340px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 15px; font-weight: 600; padding: 0; }
.field-label small { font-weight: 400; color: var(--muted-2); font-size: 13px; }
.hint { margin: 0; font-size: 13px; color: var(--muted-2); }
.input-box, .select-box { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 12px; padding: 0 16px; background: var(--surface); }
.input-box:focus-within, .select-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input-box.primary { border: 1.5px solid var(--accent); }
.input-box input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-weight: 600; font-size: 18px; padding: 10px 0; text-align: right; color: var(--ink); background: transparent; font-variant-numeric: tabular-nums; }
.input-box input[type="date"] { text-align: left; font-size: 17px; color-scheme: light dark; }
.input-box.primary input { font-size: 24px; font-weight: 700; padding: 12px 0; }
.input-box .unit { font-size: 15px; font-weight: 600; color: var(--muted); padding-left: 8px; }
.select-box { padding: 0 12px; }
.select-box select { width: 100%; border: 0; outline: none; font: inherit; font-size: 16px; padding: 12px 0; background: transparent; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--field); background: var(--surface); color: var(--ink-2); }
@media (hover: hover) { .chip:hover { border-color: var(--accent); } }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.raise-chips { margin-top: -8px; }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.steppers.one { grid-template-columns: minmax(0, 1fr); }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--field); border-radius: 12px; padding: 2px; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--ink); cursor: pointer; border-radius: 10px; }
@media (hover: hover) { .stepper button:hover { background: var(--line-2); } }
.stepper button:disabled { color: var(--field); cursor: default; background: transparent; }
.stepper output { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg-field { border: 0; margin: 0; padding: 0; }
.seg { display: flex; border: 1px solid var(--field); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.check span { font-size: 15px; font-weight: 600; }
.check small { display: block; font-weight: 400; color: var(--muted-2); font-size: 13px; }
body.is-monthly .mode-annual { display: none; }

.result { flex: 1.3 1 420px; min-width: 0; overflow: hidden; }
.result-top { background: var(--accent-soft); padding: 24px; }
.result-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.result-net { margin: 4px 0 0; font-size: clamp(34px, 5vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-net .won { font-size: 22px; margin-left: 2px; }
.result-sub { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.keep { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 16px; background: var(--surface); }
.bar-net { background: var(--accent); }
.bar-ded { flex: 1; background: var(--deduct-bar); }
.bar-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.result-body { padding: 8px 24px 16px; }
.ded-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ded-row .name { flex: 1; min-width: 0; }
.ded-row .name strong { display: block; font-size: 15px; font-weight: 600; }
.ded-row .name span { font-size: 13px; color: var(--muted-2); }
.ded-row .amt { font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ded-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 4px; font-weight: 700; }
.ded-total .amt { font-size: 18px; color: var(--deduct); font-variant-numeric: tabular-nums; }
.ded-total .amt.good { color: var(--accent); }
.callout { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted-2); line-height: 1.55; }
.mini { margin-top: 12px; }
.mini summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); }
.calc-steps { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.step span { color: var(--muted); }
.step strong { text-align: right; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; align-items: center; gap: 12px; padding: 0 24px 20px; flex-wrap: wrap; }
.share { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .share:hover { border-color: var(--accent); color: var(--accent); } }
.share-msg { font-size: 14px; color: var(--accent); }

/* tables */
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.table-box.flat { border-radius: 10px; margin-top: 12px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
thead tr { background: var(--head); }
th, td { padding: 11px 16px; }
thead th { font-weight: 600; text-align: right; }
thead th:first-child { text-align: left; }
tbody tr { border-top: 1px solid var(--line-2); }
tbody th { text-align: left; font-weight: 600; }
tbody th small { display: block; font-weight: 400; font-size: 12px; color: var(--muted-2); }
tbody td { text-align: right; }
td.ded { color: var(--deduct); }
td.net, tr.strong td, tr.strong th { font-weight: 700; }
td.plus { color: var(--accent); font-weight: 600; }
tbody th a { text-decoration: underline; text-underline-offset: 3px; }
tr.total { border-top: 2px solid var(--field); background: var(--accent-soft); }
tr.total td { color: var(--accent); font-weight: 700; }
.table-left td { text-align: left; color: var(--muted); }
.table-left td:last-child { text-align: right; color: var(--ink); }
.cmp { min-width: 0; font-size: 14px; }
.cmp th, .cmp td { padding: 9px 10px; }
.prose table { min-width: 0; }
.prose .table-box { margin: 12px 0; }
.prose td { text-align: left; }

/* tiles / cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { padding: 18px; }
.tile .k { font-size: 14px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile .d { font-size: 13px; color: var(--muted-2); }
.tile.soft { background: var(--accent-soft); border-color: transparent; }
.tile.soft .k { color: var(--ink-2); }
.tile .v.plain { color: var(--ink); }
.tile .v.ded { color: var(--deduct); }
.tile .v.sm { font-size: 23px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.tool-card strong { font-size: 17px; }
.tool-card span { font-size: 14px; color: var(--muted); }
@media (hover: hover) { .tool-card:hover { border-color: var(--accent); } }
.guide-list { display: flex; flex-direction: column; gap: 10px; }
.guide-item { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.guide-item strong { font-size: 17px; }
.guide-item span { font-size: 14px; color: var(--muted); }
@media (hover: hover) { .guide-item:hover { border-color: var(--accent); } }

/* faq */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.faq details { padding: 16px 20px; }
.faq summary { font-size: 16px; font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* detail & guide */
.crumbs { padding-top: 20px; font-size: 14px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.detail-h1 { margin-top: 16px; font-size: clamp(26px, 4vw, 36px); line-height: 1.3; }
.detail-h1 em { font-style: normal; color: var(--accent); }
.cta { margin-top: 32px; background: var(--cta); color: var(--cta-ink); border-radius: var(--radius); padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta strong { display: block; font-size: 19px; }
.cta span { font-size: 15px; color: var(--cta-sub); }
.cta a { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 12px; background: #fff; color: #15201B; font-weight: 700; text-decoration: none; }
.near { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.near a { display: block; padding: 16px 18px; text-decoration: none; color: var(--ink); }
@media (hover: hover) { .near a:hover { border-color: var(--accent); } }
.near .t { font-size: 15px; font-weight: 600; }
.near .s { font-size: 14px; color: var(--muted); }
.near .s strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.prose { margin: 10px 0 0; color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose h2 { margin: 28px 0 10px; font-size: 22px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.guide .section h2 { font-size: 23px; }
.contact-mail { font-size: 20px; font-weight: 700; }

/* footer */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 36px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted-2); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 16px; }
.foot-cols h2 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.foot-cols a { display: block; padding: 4px 0; font-size: 14px; text-decoration: none; }
@media (hover: hover) { .foot-cols a:hover { text-decoration: underline; } }

@media (max-width: 560px) {
  table { min-width: 0; font-size: 14px; }
  th, td { padding: 10px 12px; }
  .m-hide { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 14px; }
  .tile .v { font-size: 22px; }
  .tile .v.sm { font-size: 18px; }
}
@media (max-width: 480px) {
  .calc-form, .result-top { padding: 20px; }
  .result-body { padding: 4px 20px 12px; }
  .result-actions { padding: 0 20px 18px; }
  h2 { font-size: 22px; }
  .bar-top { padding-top: 10px; }
}

/* 실시간 접속자 */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.live[hidden] { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
@media (max-width: 430px) { .bar-top { gap: 6px; } .brand { gap: 8px; } .logo { gap: 8px; } .logo-text { font-size: 18px; } .live { padding: 3px 8px; font-size: 12px; gap: 5px; } .nav { gap: 2px 10px; font-size: 14px; } }

/* 관리자 실시간 화면 */
.admin-total { font-size: 56px; font-weight: 700; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* 공식 출처 · 소개 문단 */
.intro { margin: 18px 0 0; color: var(--ink-2); font-size: 15px; }
.sources { margin-top: 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.sources h2 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.sources ul { margin: 0 0 8px; padding-left: 18px; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.sources p { margin: 0; font-size: 13px; }

/* 시즌 배너 */
.promo { display: block; text-align: center; text-wrap: balance; padding: 9px 16px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .promo:hover { color: var(--on-accent); text-decoration: underline; } }

/* 긴 입력 폼 묶음 */
.form-group { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.form-group:first-of-type { border-top: 0; padding-top: 0; }
.form-h { margin: 0; font-size: 16px; font-weight: 700; }
details.form-group > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.form-group > summary::-webkit-details-marker { display: none; }
details.form-group > summary::after { content: '+'; font-size: 20px; color: var(--muted); }
details.form-group[open] > summary::after { content: '−'; }
.steppers { flex-wrap: wrap; }
.result-net.minus { color: var(--deduct); }
.tips { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }
.tips-title { margin: 0 0 6px; font-weight: 700; font-size: 15px; color: var(--accent); }
.tips ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* 재방문 기능 */
.profile-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.link-btn { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 13px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.next, .recent { margin-top: 24px; }
.next h2, .recent h2 { font-size: 18px; margin: 0; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.next-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.next-card strong { font-size: 15px; }
.next-card span { font-size: 13px; color: var(--muted); }
@media (hover: hover) { .next-card:hover { border-color: var(--accent); } }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.recent-item { display: inline-flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); min-height: 44px; }
.recent-item span { font-size: 12px; color: var(--muted); }
.recent-item strong { font-size: 14px; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .recent-item:hover { border-color: var(--accent); } }
.install { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* 휴대폰 결과 요약 막대 */
.sticky-result { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; text-align: left; }
.sticky-result[hidden] { display: none; }
.sticky-result span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.sticky-result strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* 다크·라이트 전환 버튼 */
.top-right { display: flex; align-items: center; gap: 6px; }
.theme-btn { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
@media (hover: hover) { .theme-btn:hover { border-color: var(--accent); color: var(--accent); } }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .icon-moon { display: none; }
}
@media (max-width: 430px) { .theme-btn { width: 36px; height: 36px; } .nav .nav-opt { display: none; } }

/* 결과 애니메이션: 체력바처럼 */
.bar { position: relative; }
.bar-net { position: relative; z-index: 2; transition: width .55s cubic-bezier(.22,.8,.3,1); }
.bar-ded { position: relative; z-index: 0; }
.bar-ghost { position: absolute; left: 0; top: 0; bottom: 0; z-index: 1; background: color-mix(in srgb, var(--accent) 45%, #ffffff); border-radius: 6px 0 0 6px; transition: width .7s cubic-bezier(.4,0,.2,1) .35s; }
.bar-ghost.heal { transition: width .25s ease-out; }
.result-net { transition: color .2s; }
.result-net.tick-up { animation: tick-up .65s ease-out; }
.result-net.tick-down { animation: tick-down .65s ease-out; }
@keyframes tick-up { 0% { transform: translateY(0); } 25% { transform: translateY(-3px); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { transform: translateY(0); } }
@keyframes tick-down { 0% { transform: translateX(0); } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-1px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .bar-net, .bar-ghost { transition: none; }
  .result-net.tick-up, .result-net.tick-down { animation: none; }
}

.bar.neutral .bar-ded { background: var(--line); }
.result-top .bar + .bar-legend + .bar, .keep + .bar { margin-top: 14px; }

/* 맨 위로 버튼: 스크롤을 내리면 오른쪽 아래에 나타난다. 결과 요약 막대가 떠 있으면 그 위로 올라간다 */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 7; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s, transform .2s, bottom .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { .to-top:hover { background: var(--accent); color: var(--on-accent); } }
.to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
body.has-sticky .to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none; } }
h1[tabindex="-1"]:focus { outline: none; }

/* 이미지 카드 공유 */
.card-make { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.card-btn { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
@media (hover: hover) { .card-btn:hover { filter: brightness(1.05); color: var(--on-accent); } }
.check.small span { font-size: 14px; }
.card-preview { width: 100%; }
.card-preview img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.card-preview .hint { margin: 8px 0; }
.card-preview a.share { display: inline-block; text-decoration: none; }
