/* CidrPlan — one stylesheet. No external fonts, no images beyond the two brand PNGs. */

:root {
  --wrap: 1120px;
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo",
          "Malgun Gothic", "Noto Sans KR", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --bg2: #0e1428;
  --panel: #141b2f;
  --panel2: #1b2440;
  --text: #eef2fb;
  --muted: #aab5cd;
  --line: #29334d;
  --line2: #38436a;
  --brand: #8fb0ff;
  --brand-ink: #0a1024;
  --accent: #f0b45c;
  --ok: #58d0a4;
  --warn: #ffb4a2;
  --shadow: 0 18px 40px rgba(0, 0, 0, .38);
  --code-bg: #0a1024;
  --hit: #3a2a12;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f7f5f0;
  --bg2: #efece4;
  --panel: #ffffff;
  --panel2: #f4f2ec;
  --text: #151a23;
  --muted: #4d5666;
  --line: #d9d4c9;
  --line2: #c3bdaf;
  --brand: #1f47b8;
  --brand-ink: #ffffff;
  --accent: #8a5a08;
  --ok: #146b4c;
  --warn: #a33a24;
  --shadow: 0 14px 30px rgba(23, 26, 33, .10);
  --code-bg: #f1eee6;
  --hit: #fdf1dc;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin: 0 auto; }

.skip {
  position: absolute; left: 10px; top: -60px; z-index: 60;
  background: var(--panel); color: var(--text); padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--line2); text-decoration: none;
}
.skip:focus { top: 10px; }

/* header */
.site-head { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-sym { display: block; width: 26px; height: 26px; }
.brand-sym-light { display: none; }
html[data-theme="light"] .brand-sym-dark { display: none; }
html[data-theme="light"] .brand-sym-light { display: block; }
.brand-word { letter-spacing: -.02em; font-size: 17px; }
.brand-prod { font-size: 15px; color: var(--muted); font-weight: 600; padding-left: 8px; border-left: 1px solid var(--line2); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.head-link { color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.head-link:hover { color: var(--brand); }
.langs { display: flex; gap: 3px; align-items: center; }
.langs a { font-size: 13px; text-decoration: none; color: var(--muted); padding: 5px 7px; border-radius: 7px; border: 1px solid transparent; }
.langs a:hover { color: var(--text); border-color: var(--line2); }
.langs a[aria-current="page"] { color: var(--text); border-color: var(--line2); background: var(--panel2); font-weight: 700; }
.icon-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line2);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.i-sun { display: none; }
html[data-theme="light"] .i-sun { display: block; }
html[data-theme="light"] .i-moon { display: none; }

/* hero */
.hero { padding: 44px 0 22px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 11px;
}
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.13; letter-spacing: -.025em; margin: 16px 0 14px; }
.hero .lead { font-size: clamp(16px, 1.5vw, 18.5px); color: var(--muted); max-width: 66ch; margin: 0 0 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 26px; padding: 22px 0 0; margin: 0; }
.stats li { min-width: 120px; }
.stats b { display: block; font-size: 21px; letter-spacing: -.02em; }
.stats span { font-size: 13.5px; color: var(--muted); }

/* buttons and panels */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: var(--brand-ink); border: 1px solid transparent;
  border-radius: 10px; padding: 11px 16px; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.panel, .section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin: 18px 0; box-shadow: var(--shadow); }
.panel > h2, .section > h2 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.015em; }
.panel .sub, .section .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }
.panel h3 { font-size: 16.5px; margin: 22px 0 10px; }
.panel h3:first-of-type { margin-top: 16px; }
h3.mini { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0 0 4px; font-size: 21px; }
.badge { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px; border: 1px solid var(--line2); color: var(--muted); }
.badge.b4 { color: var(--brand); border-color: var(--brand); }
.badge.b6 { color: var(--accent); border-color: var(--accent); }

/* forms */
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
.fld > span:first-child { font-weight: 600; letter-spacing: .01em; }
.fld.grow { flex: 1 1 260px; }
input[type="text"], input[type="number"], select, textarea {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line2);
  border-radius: 9px; padding: 10px 12px; font-size: 15px; font-family: var(--mono);
  min-width: 0; width: 100%;
}
textarea { resize: vertical; line-height: 1.6; }
select { font-family: inherit; }
input[aria-invalid="true"] { border-color: var(--warn); }
.calc-bar, .split-bar, .export-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.calc-bar { margin-bottom: 10px; }
.split-bar, .export-bar { margin-bottom: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line2);
  border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button {
  background: transparent; color: var(--text); border: 0; padding: 9px 13px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.err { color: var(--warn); font-size: 14px; margin: 8px 0 0; }
.ok-msg { color: var(--ok); font-size: 14px; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }
.swipe-hint { display: none; }
.noscript { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 12px; font-size: 14px; margin: 12px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 14px; }

/* tables */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 8px; }
.split > * { min-width: 0; }
.panel.v6 .split { grid-template-columns: minmax(0, 1fr); }
.panel.v6 .split > div:first-child { max-width: 760px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
table.kv { table-layout: fixed; }
table.kv th, table.kv td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14.5px; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }
table.kv th { color: var(--muted); font-weight: 600; width: 44%; }
table.kv td.val { font-family: var(--mono); font-size: 14px; word-break: break-all; }
table.grid th, table.grid td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
table.grid thead th { background: var(--panel2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.num { color: var(--muted); font-variant-numeric: tabular-nums; }
table.grid tr.out td { color: var(--warn); }
table.grid tr.hit td { background: var(--hit); }
table.grid td.mono, table.grid th { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-sm {
  display: inline-block; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 7px; font-size: 12px; font-family: var(--mono);
  margin: 2px 3px 2px 0; white-space: nowrap;
}
.range-note { display: none; }
.warn-tag { font-size: 11.5px; color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.col-summary { font-size: 14.5px; color: var(--text); margin: 12px 0 0 !important; }
.leftover-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 12px; font-size: 13px; }

/* code */
pre.code-out {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-family: var(--mono); font-size: 13px; line-height: 1.55;
  overflow-x: auto; white-space: pre; margin: 0; color: var(--text);
  min-height: 84px;
}
pre.code-out.tall { min-height: 132px; }
code { font-family: var(--mono); font-size: .93em; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 4px; overflow-wrap: anywhere; }
pre code { background: none; border: 0; padding: 0; }

/* overlap list */
.pair-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 7px; }
.pair-item { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.pair-txt { font-family: var(--mono); font-size: 13.5px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line2); white-space: nowrap; }
.tag.t-hit { background: var(--accent); color: var(--brand-ink); border-color: transparent; font-weight: 700; }
.tag.t-ok { color: var(--muted); }

/* how / faq / guides */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 6px; }
.step { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.step b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.step span { color: var(--muted); font-size: 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; }
.faq p { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; }
.grid-links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.grid-links li { min-width: 0; }
.grid-links a {
  display: block; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 14px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px;
}
.grid-links a:hover { border-color: var(--brand); }
.grid-links small { display: block; color: var(--muted); font-weight: 400; font-size: 13.5px; margin-top: 4px; line-height: 1.55; }

/* guide pages */
.crumbs { font-size: 13.5px; color: var(--muted); margin: 4px 0 14px; }
.crumbs a { color: var(--muted); }
.guide-body { max-width: 80ch; }
.guide-body h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.guide-meta { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.guide-body h2 { font-size: 21px; margin: 30px 0 10px; letter-spacing: -.012em; }
.guide-body h3 { font-size: 17px; margin: 22px 0 8px; }
.guide-body p { margin: 0 0 13px; overflow-wrap: break-word; }
.guide-body ul, .guide-body ol { margin: 0 0 14px; padding-left: 22px; }
.guide-body li { margin: 4px 0; }
.guide-body table { margin: 6px 0 18px; font-size: 14.5px; }
.guide-body table th, .guide-body table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.guide-body table thead th { background: var(--panel2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.guide-body pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  font-family: var(--mono); font-size: 13px; line-height: 1.55; overflow-x: auto; margin: 6px 0 18px;
}
.note { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: var(--muted); }
.cta-box { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 16px; margin: 22px 0; }
.cta-box p { margin: 0 0 10px; font-size: 14.5px; color: var(--muted); }
.srcList { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 14px; }
.srcList a { color: var(--brand); }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 22px; padding: 22px 0 34px; font-size: 13.5px; color: var(--muted); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--brand); }

@media (max-width: 720px) {
  .head-inner { flex-wrap: wrap; row-gap: 2px; padding: 6px 0; min-height: 0; }
  .head-tools { order: 2; flex: 1 1 100%; margin-left: 0; justify-content: space-between; gap: 8px; }
  .panel, .section { padding: 16px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .head-inner { gap: 10px; }
  .hero { padding: 30px 0 12px; }
  .stats { gap: 18px; }
  .stats li { min-width: 104px; }
  .guide-body table { display: block; overflow-x: auto; }
  .swipe-hint { display: block; }
  .cloud-table { table-layout: fixed; width: 100%; }
  .cloud-table th:first-child, .cloud-table td:first-child { width: 30%; }
  .cloud-table th:nth-child(2), .cloud-table td:nth-child(2) { width: 46%; }
  .cloud-table th:nth-child(3), .cloud-table td:nth-child(3) { width: 24%; }
  .cloud-table thead th { white-space: normal; }
  .cloud-table .chips { display: block; }
  .cloud-table .chip-sm { display: block; white-space: normal; overflow-wrap: anywhere; max-width: 100%; margin: 0 0 3px; }
  .cloud-table th:last-child, .cloud-table td:last-child { display: none; }
  .cloud-table th, .cloud-table td { padding: 7px 7px; }
  .range-note { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
  .chip-sm { font-size: 11px; padding: 1px 5px; }
}

/* ---------------------------------------------------------- UpsCalc additions */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 14px 0 4px; }
.field-grid .fld input[type="number"], .field-grid .fld select { font-size: 15px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: auto; }
.assume { color: var(--muted); font-size: 14px; padding-left: 20px; margin: 10px 0 0; }
.assume li { margin: 6px 0; }
.cmp-table th, .cmp-table td { padding: 8px 10px; font-size: 14px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp-table td:not(:first-child) { font-family: var(--mono); }
.dev-table { table-layout: fixed; min-width: 540px; }
.dev-table th, .dev-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dev-table th:nth-child(1) { width: 40%; }
.dev-table th:nth-child(2) { width: 19%; }
.dev-table th:nth-child(3) { width: 13%; }
.dev-table th:nth-child(4) { width: 18%; }
.dev-table th:nth-child(5), .dev-table td:nth-child(5) { width: 42px; text-align: center; }
.dev-table input[type="text"], .dev-table input[type="number"] { padding: 6px 8px; font-size: 14px; }
.dev-table .dev-sub { font-family: var(--mono); text-align: right; }
.row-del {
  background: transparent; color: var(--muted); border: 1px solid var(--line2);
  border-radius: 7px; width: 28px; height: 28px; line-height: 1; font-size: 16px; cursor: pointer;
}
.row-del:hover { color: var(--warn); border-color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.range-note { display: block; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.status-note { margin-top: 10px; }
@media (max-width: 700px) {
  .dev-table { min-width: 480px; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Coupang Partners slot (canonical: loancalc/nhis studio.css) ---------- */
.coupang-slot{margin:24px 0}
.coupang-slot>div{max-width:740px;margin:0 auto;overflow:hidden;border-radius:var(--r-md,12px)}
.coupang-slot iframe{display:block;max-width:100%;border:0}
.coupang-note{margin-top:8px;color:var(--ink-3,var(--muted2,#6b6257));font-size:.8125rem;line-height:1.6;text-align:center}
