/* ---------- tokens ---------- */
:root{
  --bg:#f7f8fa; --surface:#ffffff; --surface-2:#f2f4f7;
  --text:#14171f; --muted:#5b6472; --line:#e3e7ee;
  --accent:#2563eb; --accent-soft:#eef3ff; --accent-ink:#1d4ed8;
  --good:#0f766e; --warn:#b45309;
  --radius:14px; --shadow:0 1px 2px rgba(16,24,40,.06),0 8px 24px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0f1115; --surface:#171a21; --surface-2:#1f232c;
    --text:#e8eaf0; --muted:#9aa4b4; --line:#2a2f3a;
    --accent:#6ea0ff; --accent-soft:#1a2335; --accent-ink:#9dbcff;
    --good:#4fd1c5; --warn:#f0b45a;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.3);
  }
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:"Pretendard","Apple SD Gothic Neo","Malgun Gothic",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:16px; line-height:1.65; letter-spacing:-.01em;
}
.wrap{width:100%; max-width:760px; margin:0 auto; padding:0 18px}
a{color:var(--accent-ink); text-decoration:none}
a:hover{text-decoration:underline}
.skip{position:absolute; left:-9999px}
.skip:focus{left:8px; top:8px; background:var(--surface); padding:8px 12px; border-radius:8px; z-index:99}

/* ---------- header ---------- */
.site-header{background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20}
.header-inner{display:flex; align-items:center; gap:16px; min-height:56px; flex-wrap:wrap}
.brand{display:flex; align-items:center; gap:8px; color:var(--text); font-weight:700; letter-spacing:-.02em}
.brand:hover{text-decoration:none}
.brand-mark{display:grid; place-items:center; width:26px; height:26px; border-radius:8px; background:var(--accent); color:#fff; font-weight:800; font-size:15px}
.top-nav{display:flex; gap:4px; overflow-x:auto; margin-left:auto; scrollbar-width:none}
.top-nav::-webkit-scrollbar{display:none}
.top-nav a{white-space:nowrap; font-size:14px; color:var(--muted); padding:6px 10px; border-radius:999px}
.top-nav a:hover{background:var(--surface-2); color:var(--text); text-decoration:none}
.top-nav a[aria-current="page"]{background:var(--accent-soft); color:var(--accent-ink); font-weight:600}

/* ---------- page head ---------- */
.page-head{padding:28px 0 4px}
.page-head h1{margin:0 0 8px; font-size:27px; line-height:1.3; letter-spacing:-.03em}
.page-head p{margin:0; color:var(--muted); font-size:15px}
.crumb{font-size:13px; color:var(--muted); margin:0 0 10px}
.crumb a{color:var(--muted)}

/* ---------- card / form ---------- */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; margin:18px 0}
.field{margin:0 0 15px}
.field:last-child{margin-bottom:0}
.field label{display:block; font-size:14px; font-weight:600; margin-bottom:6px}
.hint{font-size:12.5px; color:var(--muted); margin:5px 0 0}
.control{display:flex; align-items:center; gap:8px}
input[type=text],input[type=number],select{
  width:100%; padding:11px 12px; font-size:16px; font-family:inherit; color:var(--text);
  background:var(--surface-2); border:1px solid var(--line); border-radius:10px; appearance:none;
}
input[type=text]:focus,input[type=number]:focus,select:focus{outline:2px solid var(--accent); outline-offset:1px; background:var(--surface)}
.suffix{font-size:14px; color:var(--muted); flex:none}
.seg{display:flex; gap:6px; flex-wrap:wrap}
.seg input{position:absolute; opacity:0; width:0; height:0}
.seg label{display:inline-block; margin:0; padding:8px 13px; font-size:14px; font-weight:500; border:1px solid var(--line); border-radius:999px; background:var(--surface-2); cursor:pointer}
.seg input:checked + label{background:var(--accent-soft); border-color:var(--accent); color:var(--accent-ink); font-weight:600}
.seg input:focus-visible + label{outline:2px solid var(--accent); outline-offset:2px}
.quick{display:flex; gap:6px; flex-wrap:wrap; margin-top:7px}
.quick button{font:inherit; font-size:12.5px; padding:4px 9px; border-radius:999px; border:1px solid var(--line); background:transparent; color:var(--muted); cursor:pointer}
.quick button:hover{background:var(--surface-2); color:var(--text)}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:480px){ .row2{grid-template-columns:1fr} }

/* ---------- result ---------- */
.result{background:linear-gradient(180deg,var(--accent-soft),var(--surface)); border:1px solid var(--line); border-radius:var(--radius); padding:22px 20px; margin:18px 0; text-align:center}
.result .label{font-size:14px; color:var(--muted); margin:0}
.result .big{font-size:34px; font-weight:800; letter-spacing:-.04em; margin:6px 0 2px; line-height:1.2; word-break:keep-all}
.result .sub{font-size:14px; color:var(--muted); margin:0}
.result .big .unit{font-size:20px; font-weight:700; margin-left:2px}
table.detail{width:100%; border-collapse:collapse; font-size:14.5px; margin-top:4px}
table.detail th,table.detail td{padding:10px 2px; border-bottom:1px solid var(--line); text-align:right}
table.detail th{text-align:left; font-weight:500; color:var(--muted)}
table.detail tr:last-child th,table.detail tr:last-child td{border-bottom:0}
table.detail tr.total th,table.detail tr.total td{font-weight:700; color:var(--text); border-top:2px solid var(--line)}
table.detail td.neg{color:var(--warn)}
.scroll-x{overflow-x:auto; -webkit-overflow-scrolling:touch}
.scroll-x table{min-width:420px}
.actions{display:flex; gap:8px; justify-content:center; margin-top:14px; flex-wrap:wrap}
.btn{font:inherit; font-size:14px; font-weight:600; padding:9px 16px; border-radius:10px; border:1px solid var(--line); background:var(--surface); color:var(--text); cursor:pointer}
.btn:hover{background:var(--surface-2)}
.btn-primary{background:var(--accent); border-color:var(--accent); color:#fff}
.btn-primary:hover{filter:brightness(1.07); background:var(--accent)}

/* ---------- article ---------- */
.article{margin:26px 0}
.article h2{font-size:20px; letter-spacing:-.03em; margin:28px 0 10px}
.article h3{font-size:16.5px; margin:20px 0 6px}
.article p,.article li{color:var(--text); font-size:15.5px}
.article ul,.article ol{padding-left:20px}
.article li{margin:4px 0}
.article table{width:100%; border-collapse:collapse; font-size:14.5px; margin:12px 0}
.article th,.article td{border:1px solid var(--line); padding:8px 10px; text-align:left}
.article th{background:var(--surface-2); font-weight:600}
.note{background:var(--surface-2); border-left:3px solid var(--accent); border-radius:0 10px 10px 0; padding:12px 14px; font-size:14.5px; color:var(--muted); margin:14px 0}
details.faq{border-bottom:1px solid var(--line); padding:12px 0}
details.faq summary{cursor:pointer; font-weight:600; font-size:15.5px; list-style:none}
details.faq summary::-webkit-details-marker{display:none}
details.faq summary::before{content:"Q  "; color:var(--accent); font-weight:800}
details.faq p{margin:8px 0 0; color:var(--muted); font-size:15px}

/* ---------- index ---------- */
.hero{padding:40px 0 10px; text-align:center}
.hero h1{font-size:30px; letter-spacing:-.035em; margin:0 0 8px}
.hero p{color:var(--muted); margin:0; font-size:15.5px}
.cat{margin:26px 0 0}
.cat h2{font-size:15px; color:var(--muted); font-weight:600; margin:0 0 10px; letter-spacing:.02em}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px}
.tile{display:block; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:15px 16px; box-shadow:var(--shadow)}
.tile:hover{text-decoration:none; border-color:var(--accent)}
.tile strong{display:block; color:var(--text); font-size:15.5px; letter-spacing:-.02em}
.tile span{display:block; color:var(--muted); font-size:13px; margin-top:3px}

/* ---------- related / ads ---------- */
.related{margin:26px 0}
.related h2{font-size:16px; margin:0 0 10px}
.related ul{list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px}
.related a{display:block; padding:11px 13px; background:var(--surface); border:1px solid var(--line); border-radius:10px; font-size:14.5px}
.related a:hover{border-color:var(--accent); text-decoration:none}
.ad{margin:22px 0; min-height:1px; text-align:center}

/* ---------- footer ---------- */
.site-footer{border-top:1px solid var(--line); background:var(--surface); margin-top:40px; padding:24px 0 40px}
.foot-links{display:flex; flex-wrap:wrap; gap:6px 14px; font-size:13.5px; margin:0 0 14px}
.foot-links a{color:var(--muted)}
.disclaimer{font-size:12.5px; color:var(--muted); margin:0 0 10px; line-height:1.6}
.copy{font-size:12.5px; color:var(--muted); margin:0}
.rate-note{font-size:12.5px; color:var(--muted); text-align:center; margin:-8px 0 0}
