/* 펭그리 계산기 페이지 스타일. build.js 가 src.html 에서 생성합니다 — 직접 고치지 마세요. */
/* Layout concept: 왼쪽 목록 + 오른쪽 계산 영역. 결과는 급여명세서처럼 점선으로 이어진 항목 줄로 보여준다. */
:root {
  --bg: #EDF0EE;
  --surface: #FAFBFA;
  --ink: #13201B;
  --muted: #5A6962;
  --line: #D5DCD8;
  --line-strong: #A9B5AF;
  --accent: #0E6B4D;
  --accent-ink: #FFFFFF;
  --neg: #A63D2A;
  --warn: #7A4E00;
  --warn-bg: #F6EBCF;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1411; --surface: #141E1A; --ink: #E7EEEA; --muted: #93A39B;
    --line: #26342E; --line-strong: #43554C; --accent: #5CC9A0; --accent-ink: #06130E;
    --neg: #F08A74; --warn: #E5B567; --warn-bg: #3A2F14;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1411; --surface: #141E1A; --ink: #E7EEEA; --muted: #93A39B;
  --line: #26342E; --line-strong: #43554C; --accent: #5CC9A0; --accent-ink: #06130E;
  --neg: #F08A74; --warn: #E5B567; --warn-bg: #3A2F14;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; padding-inline: 16px; padding-block: 24px 56px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell { max-width: 1080px; margin: 0 auto; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 20px; }
h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.top p { margin: 4px 0 0; color: var(--muted); }
.top .hint { font-size: 13px; }
.layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 28px; }
#nav { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.ng { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; margin: 14px 0 4px; padding-inline: 10px; }
.ng:first-child { margin-top: 0; }
#nav a { display: block; padding: 8px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; font-weight: 500; }
#nav a:hover { background: var(--line); }
#nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; flex-direction: row; overflow-x: auto; background: var(--bg); margin-inline: -16px; padding: 8px 16px; border-bottom: 1px solid var(--line); gap: 4px; }
  .ng { display: none; }
  #nav a { white-space: nowrap; flex: none; }
}
.panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 20px; align-items: start; }
@media (max-width: 700px) { .panel { grid-template-columns: minmax(0, 1fr); } }
.panel h2 { grid-column: 1 / -1; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.panel .lede { grid-column: 1 / -1; margin: -8px 0 0; color: var(--muted); }
.panel h3.sub { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 16px; border-top: 1px solid var(--line-strong); font-size: 18px; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fl { font-size: 13px; font-weight: 700; color: var(--muted); }
.inp { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); padding-inline: 10px; min-width: 0; }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.inp input, .inp select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 9px 0; outline: none; }
.inp input.money, .inp input[type="number"] { text-align: right; font-family: var(--mono); }
.inp em { font-style: normal; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.seg button { flex: 1; padding: 8px 6px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.mini { font-size: 12.5px; color: var(--muted); margin: -6px 0 0; }
.mini button { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 4px; padding: 3px 8px; font: inherit; font-size: 12.5px; cursor: pointer; margin-left: 4px; }
.slip { background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--ink); border-radius: 0 0 6px 6px; padding: 18px; min-width: 0; }
.slip.empty { color: var(--muted); }
.hl-l { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.hl-v { display: block; font-family: var(--mono); font-size: clamp(24px, 7vw, 34px); font-weight: 600; line-height: 1.2; color: var(--accent); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hl-s { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.lines { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.ln { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.ln span { min-width: 0; }
.ln i { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.ln b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ln.neg b { color: var(--neg); }
.ln.sum { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-strong); font-weight: 700; }
.ln.total { margin-top: 8px; padding-top: 8px; border-top: 3px double var(--ink); font-weight: 800; }
.ln.total b { font-weight: 600; }
.bar { display: flex; height: 10px; margin-top: 14px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; }
.c-net { background: var(--accent); } .c-ins { background: var(--line-strong); } .c-tax { background: var(--neg); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.legend b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.65; }
.warn { margin: 12px 0 0; padding: 8px 10px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }
.tbl { margin-top: 12px; overflow: auto; max-height: 340px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--surface); font-family: var(--sans); font-weight: 700; color: var(--muted); }
details summary { cursor: pointer; margin-top: 14px; font-weight: 700; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.u { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; min-width: 0; }
.u.src { border-color: var(--accent); }
.u span { display: block; font-size: 12.5px; color: var(--muted); }
.u b { display: block; font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
/* 계산기별 설명글. 기본은 펼친 상태이며, open 속성을 지우면 접힌 채로 시작합니다. */
.guide { grid-column: 1 / -1; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.guide > summary { font-size: 17px; font-weight: 700; cursor: pointer; margin: 0; }
.guide > summary::marker { color: var(--muted); }
.guide h4 { margin: 16px 0 5px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.guide p, .guide ul { margin: 0 0 9px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.guide ul { padding-left: 18px; }
.guide li { margin-bottom: 4px; }
.guide li::marker { color: var(--line-strong); }
.guide b { color: var(--ink); font-weight: 700; }
.guide code { font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
footer a { color: var(--ink); }
footer { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 12.5px; color: var(--muted); line-height: 1.7; }
@media (prefers-reduced-motion: no-preference) { .inp, #nav a { transition: border-color 0.12s, background 0.12s; } }

/* 애드센스 광고 자리. 광고 단위를 붙이기 전에는 hidden 상태라 아무 공간도 차지하지 않습니다. */
.adslot { margin: 24px 0; }
.adslot .adbox { max-width: 100%; min-width: 0; overflow: hidden; }
.adslot .ads-h { margin: 0 0 6px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); }
.adslot ins { display: block; }
#p-salary .adslot, #p-sev .adslot, #p-loan .adslot, #p-sav .adslot, #p-goal .adslot,
#p-rent .adslot, #p-age .adslot, #p-disc .adslot, #p-unit .adslot, #p-health .adslot { grid-column: 1 / -1; }

/* 여러 페이지로 나뉘면서 추가된 부분 */
.brand { display: inline-block; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--accent); }
.panel h1 { grid-column: 1 / -1; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }

/* 홈의 계산기 목록 */
.hubsec { margin: 26px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.hubsec:first-child { margin-top: 4px; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 12px; }
.hub a { display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.hub a:hover { border-color: var(--accent); }
.hub b { display: block; font-size: 16.5px; font-weight: 700; margin-bottom: 4px; }
.hub span { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
