:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #66645e;
  --line: #e3e0d8;
  --accent: #1f6f5c;
  --accent-soft: #e3f1ec;
  --hl: #fff3c4;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161715;
    --surface: #1f201e;
    --text: #ecebe6;
    --muted: #a3a29b;
    --line: #34352f;
    --accent: #5cc4a6;
    --accent-soft: #1f3530;
    --hl: #4a4220;
  }
}
* { 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, sans-serif;
  line-height: 1.75;
  font-size: 17px;
  word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--surface); font-size: 16px; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.crumbs { font-size: 14px; color: var(--muted); margin: 20px 0 0; }
.crumbs a { color: var(--muted); }

.content { padding: 8px 0 24px; }
.content h1 { font-size: 30px; line-height: 1.35; margin: 20px 0 12px; letter-spacing: -0.02em; }
.content h2 { font-size: 22px; margin: 40px 0 10px; letter-spacing: -0.01em; }
.content h3 { font-size: 18px; margin: 28px 0 8px; }
.lead { font-size: 18px; color: var(--muted); margin-top: 0; }
.updated { font-size: 14px; color: var(--muted); margin-top: 40px; }

.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--accent-soft); font-weight: 700; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tr.hit td { background: var(--hl); font-weight: 700; }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tool h2 { margin-top: 0; font-size: 20px; }
.tool-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.tool label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--muted); flex: 1 1 160px; }
.tool select, .tool input {
  font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
.tool select:focus, .tool input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.result { margin-top: 16px; padding: 16px; border-radius: 10px; background: var(--accent-soft); }
.result .big { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.result .sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 14px; }

.tool > label { margin-bottom: 12px; }
.tool textarea { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; resize: vertical; }
.out-table th { text-align: left; background: transparent; position: static; font-size: 14px; white-space: normal; min-width: 120px; }
.out-table td { text-align: left; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .out-table tr { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--line); }
  .out-table tr:last-child { border-bottom: none; }
  .out-table th { grid-column: 1 / -1; padding-bottom: 0; border-bottom: none; }
  .out-table td { border-bottom: none; }
  .out-table td:last-child { width: auto; }
}
.out-table td:last-child { width: 1%; text-align: right; }
.out-table code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; }
.out-table .hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.copy { font: inherit; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; white-space: nowrap; }
.copy:hover { background: var(--accent); color: var(--surface); }
.sub.warn { color: var(--text); background: var(--hl); padding: 8px 10px; border-radius: 8px; }
.form-mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; font-size: 15px; }
.form-mock div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.form-mock div:last-child { border-bottom: none; }
.form-mock span:first-child { color: var(--muted); }
.form-mock span:last-child { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 16px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-size: 17px; margin-bottom: 4px; }
.card span { font-size: 14px; color: var(--muted); }

.note { border-left: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; color: var(--text); }

.related { border-top: 1px solid var(--line); padding: 8px 0 24px; }
.related h2 { font-size: 18px; }
.related ul { padding-left: 20px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; margin-top: 32px; color: var(--muted); font-size: 15px; }
.site-footer a { color: var(--muted); }
.small { font-size: 13px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .content h1 { font-size: 25px; }
  .result .big { font-size: 28px; }
}
