/* 똑셈 스타일
   콘셉트: 결과는 영수증처럼 똑 떨어지게, 브랜드는 빨간 인주 도장 "똑".
   색은 아래 토큰만 쓴다. 둥근 정도는 위계에 따라: 입력칸 10px, 묶음 14px, 영수증 4px. */
:root {
  --paper: #f2f4f0;
  --card: #ffffff;
  --slip: #fffefa;
  --ink: #1e2a2b;
  --ink-2: #536160;
  --line: #d6ddd8;
  --seal: #c8352e;
  --green: #1d6b5c;
  --green-soft: #e1eee9;
  --mark: #fff1b8;
  --warn: #8a4b00;
  --warn-soft: #fff3df;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161c1b;
    --card: #1d2524;
    --slip: #222b2a;
    --ink: #e8eeeb;
    --ink-2: #a3b0ad;
    --line: #33403e;
    --seal: #e0574f;
    --green: #6cc7b4;
    --green-soft: #1f3530;
    --mark: #4a4120;
    --warn: #f0b45c;
    --warn-soft: #33281a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }
main { padding-bottom: 48px; }

/* ---------- 머리글 */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.seal {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--seal); color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), inset 0 0 0 3.5px var(--seal);
  transform: rotate(-8deg);
}
.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.cats::-webkit-scrollbar { display: none; }
.cats a { text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.cats a:hover { color: var(--ink); background: var(--card); }
.cats a[aria-current="page"] { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
  .top-in { gap: 0; padding-top: 10px; }
  .cats { margin: 4px -20px 0; padding: 0 14px 8px; width: calc(100% + 40px); }
}

/* ---------- 제목 */
.crumb { display: flex; gap: 8px; font-size: 14px; color: var(--ink-2); padding-top: 20px; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.calc-head { padding: 12px 0 20px; max-width: 46em; }
.calc-head h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 10px; }
.lead { margin: 0; color: var(--ink-2); font-size: 17px; }

/* ---------- 계산기 배치 */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.calc-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .calc-grid { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; }
  .result { position: sticky; top: 16px; }
}
.calc-form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.field { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.field[hidden] { display: none; }
.field > label, .field > legend { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px; padding: 0; }
.inp-wrap { position: relative; }
.inp {
  width: 100%; height: 52px; padding: 0 44px 0 14px; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; appearance: none;
}
select.inp { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; font-size: 16px; }
input[type="date"].inp { padding-right: 14px; }
.inp:hover { border-color: var(--ink-2); }
.inp:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 15px; pointer-events: none; }
.kor { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); min-height: 1em; }
.kor:empty { display: none; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.quick button:hover { border-color: var(--ink-2); }
.help { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 10px; flex-wrap: wrap; }
.seg label { flex: 1 1 0; min-width: max-content; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 9px 10px; border-radius: 7px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); margin: 0; }

details.adv { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 12px; }
details.adv summary { cursor: pointer; font-size: 15px; font-weight: 700; color: var(--green); list-style: none; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::after { content: "+"; margin-left: 6px; }
details.adv[open] summary::after { content: "−"; }
.adv-body { padding-top: 14px; }
.form-foot { display: flex; justify-content: flex-end; }
.text-btn { background: none; border: 0; padding: 4px 0; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-btn:hover { color: var(--ink); }

/* ---------- 결과: 영수증 */
.headline { font-size: 21px; line-height: 1.45; font-weight: 600; margin: 4px 0 16px; letter-spacing: -0.01em; }
.headline b { font-weight: 800; font-size: 1.12em; }
.headline.warn { color: var(--ink-2); font-weight: 500; font-size: 17px; }
.receipt {
  position: relative; background: var(--slip); border-radius: 4px 4px 0 0; padding: 18px 20px 20px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(30, 42, 43, .08), 0 0 0 1px var(--line);
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px;
  background:
    linear-gradient(135deg, var(--slip) 6px, transparent 0) 0 0 / 12px 10px repeat-x,
    linear-gradient(225deg, var(--slip) 6px, transparent 0) 0 0 / 12px 10px repeat-x;
}
.receipt dl { margin: 0; padding-right: 56px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.row dt { color: var(--ink-2); font-size: 15px; }
.row dd { margin: 0; text-align: right; font-weight: 600; }
.row dd small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-2); margin-top: 2px; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 12px; }
.total span { font-weight: 700; }
.total strong { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.stamp {
  position: absolute; top: 12px; right: 14px; width: 46px; height: 46px; display: grid; place-items: center;
  border: 2.5px solid var(--seal); border-radius: 50%; color: var(--seal); font-weight: 800; font-size: 19px;
  transform: rotate(-14deg); opacity: .85; pointer-events: none;
  animation: press .38s cubic-bezier(.2, 1.4, .5, 1) .2s both;
}
#out[data-ready] .stamp { animation: none; }
@keyframes press { from { transform: rotate(-14deg) scale(1.7); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .85; } }
.warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.note { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.detail-note { font-size: 15px; margin: 4px 0 12px; }
.tbl { overflow-x: auto; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl caption { text-align: left; font-weight: 700; padding: 12px 14px 4px; font-size: 15px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.hl td { background: var(--mark); font-weight: 700; }
details.more { margin: 8px 0; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--green); padding: 6px 0; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--card); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- 해설 */
.explain { max-width: 680px; margin-top: 40px; }
.explain h2 { font-size: 21px; letter-spacing: -0.02em; margin: 32px 0 8px; }
.explain p { line-height: 1.8; margin: 0 0 12px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }
.asof { font-size: 13.5px; color: var(--ink-2); margin-top: 20px; }
.ad { margin: 28px 0; min-height: 120px; }

/* ---------- 목록 */
.block { margin-top: 44px; }
.block h2 { font-size: 20px; letter-spacing: -0.02em; margin: 0 0 12px; }
.block h2 a { text-decoration: none; }
.block h2 a:hover { text-decoration: underline; }
.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 24px; }
.item { display: block; text-decoration: none; padding: 12px 0 14px; border-top: 2px solid var(--ink); height: 100%; }
.item-t { display: block; font-weight: 700; font-size: 17px; }
.item-d { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.item:hover .item-t { text-decoration: underline; text-underline-offset: 3px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { display: inline-block; text-decoration: none; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
.chips a:hover { border-color: var(--ink); }

/* ---------- 홈 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 36px 0 8px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; padding-top: 56px; } }
.hero h1 { font-size: clamp(32px, 6.4vw, 54px); line-height: 1.15; letter-spacing: -0.045em; font-weight: 800; margin: 0 0 14px; }
.hero .lead { max-width: 30em; margin-bottom: 22px; }
.search { position: relative; margin-bottom: 14px; }
.search .inp { border: 2px solid var(--ink); padding-right: 14px; font-weight: 500; }
.q-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(30, 42, 43, .12); }
.q-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.q-results a:hover, .q-results a:focus { background: var(--paper); }
.q-results span { color: var(--ink-2); font-weight: 400; font-size: 14px; }
.q-results .none { padding: 10px 12px; color: var(--ink-2); }
.demo { margin: 14px 0 0; }
.demo .stamp { top: -18px; right: 16px; background: var(--slip); }
.demo label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; padding-right: 56px; }
.demo .total { margin-top: 16px; }
.demo .total strong { font-size: clamp(24px, 4vw, 30px); }
.demo .text-btn { display: inline-block; margin-top: 10px; }
.personas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.personas a { display: block; height: 100%; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.personas a:hover { border-color: var(--ink); }
.p-name { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.p-who { display: block; color: var(--seal); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.p-list { display: block; color: var(--ink-2); font-size: 14px; }

/* ---------- 상황별 모음: 순서가 있는 목록 */
.steps { list-style: none; counter-reset: step; margin: 8px 0 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--seal); color: var(--seal); display: grid; place-items: center; font-weight: 800; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 52px; bottom: -8px; border-left: 2px dashed var(--line); }
.steps a { display: block; text-decoration: none; padding: 14px 0 22px; }
.step-t { display: block; font-size: 18px; font-weight: 800; }
.step-d { display: block; color: var(--ink-2); margin-top: 2px; }
.steps a:hover .step-t { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 하단 고정 요약 바 (모바일) */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); }
.sticky button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; border-radius: 12px; background: var(--ink); color: var(--paper); padding: 14px 18px; font-weight: 800; font-size: 17px; cursor: pointer; }
.sticky-go { font-size: 14px; font-weight: 600; opacity: .8; }
@media (min-width: 900px) { .sticky { display: none !important; } }

/* ---------- 바닥글 */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--ink-2); }
.foot-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot-name { font-weight: 800; color: var(--ink); font-size: 17px; margin: 0; }
.foot p { margin: 4px 0; }
.foot-h { font-weight: 700; color: var(--ink); }
.foot nav a { display: block; text-decoration: none; padding: 3px 0; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.biz { margin-top: 20px !important; }
.small { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  * { scroll-behavior: auto !important; }
}
@media print {
  .top, .foot, .share, .ad, .sticky, .block, .explain, .crumb { display: none !important; }
  body { background: #fff; }
}
