:root {
  --brand: #2f6f73;
  --brand-dark: #24585c;
  --brand-soft: #e8f1f1;
  --accent: #f39a56;
  --ink: #183235;
  --muted: #596b6e;
  --line: #d7e2e2;
  --surface: #fff;
  --surface-alt: #f5f8f8;
  --danger: #a23b32;
  --danger-soft: #fff0ed;
  --success-soft: #edf7f1;
  --shadow: 0 12px 34px rgba(25, 54, 57, 0.08);
}

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #f5f8f8;
  font-family: "Noto Sans KR", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand-dark); }
.shell { width: min(100% - 24px, 1120px); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 226, 226, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}
.header-inner, .footer-inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .95rem; }
.brand small { color: var(--muted); font-size: .72rem; }
.language-link { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .74rem; font-weight: 800; text-decoration: none; }
.page { display: grid; gap: 16px; padding-block: 24px 48px; }
.intro { display: grid; gap: 7px; align-content: start; }
.eyebrow { margin: 0; color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.05; }
h2 { margin-bottom: 2px; font-size: 1.15rem; }
.lede { margin-bottom: 0; color: #506568; font-size: .95rem; }
.principle-note { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: .8rem; }
.principle-note strong { color: var(--brand-dark); }
.principle-note span { color: var(--muted); }
.workspace, form { display: grid; gap: 10px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #eaf0f0; }
.mode-tab { min-height: 46px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 800; }
.mode-tab.active { color: #fff; background: var(--brand); box-shadow: 0 4px 14px rgba(36, 88, 92, .2); }
.panel, .result-panel, .reference-panel { padding: 14px; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.result-panel { border-left-color: var(--accent); }
.reference-panel { border-left-color: #667eb9; }
.panel-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: .78rem; }
.step-number, .reference-icon { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--brand); font-size: .78rem; font-weight: 800; }
.reference-icon { background: #667eb9; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.field, .method-select, .reference-select { display: grid; gap: 5px; align-content: start; color: var(--ink); font-size: .8rem; font-weight: 750; }
.field > span:first-child, .method-select > span, .reference-select > span { min-height: 1.25rem; }
.field select, .method-select select, .reference-select select { width: 100%; min-height: 44px; padding: 8px 32px 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-weight: 650; }
.input-unit { min-height: 44px; display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.input-unit:focus-within, select:focus-visible { border-color: var(--brand); outline: 3px solid rgba(47, 111, 115, .13); }
.input-unit input { width: 100%; padding: 8px 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; }
.input-unit b, .input-unit i { flex: 0 0 auto; display: flex; align-items: center; padding: 0 9px; border-left: 1px solid var(--line); color: var(--muted); background: var(--surface-alt); font-size: .7rem; font-style: normal; white-space: nowrap; }
.input-unit i { border-right: 1px solid var(--line); border-left: 0; }
.field-hint { min-height: 1.1em; color: var(--muted); font-size: .68rem; font-weight: 500; }
.choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 0 12px; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 5px; font-size: .8rem; font-weight: 800; }
.choice-group label { position: relative; }
.choice-group input { position: absolute; opacity: 0; }
.choice-group span { min-height: 44px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-weight: 800; }
.choice-group input:checked + span { border-color: var(--brand); color: #fff; background: var(--brand); }
.choice-group input:focus-visible + span { outline: 3px solid rgba(47, 111, 115, .16); }
.subpanel { display: grid; gap: 12px; }
.workflow-callout { display: grid; gap: 3px; padding: 10px 12px; border-radius: 11px; color: var(--brand-dark); background: var(--brand-soft); font-size: .78rem; }
.workflow-callout span { color: #4f6669; }
.workflow-callout.suspension { color: #344b84; background: #edf0fa; }
.no-spin, .caution { margin: -4px 0 0; padding: 9px 11px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; color: #76502f; background: #fff6ee; font-size: .76rem; font-weight: 650; }
.method-select { max-width: 440px; }
.validation-message { padding: 10px 12px; border: 1px solid #f0c4bd; border-radius: 11px; color: var(--danger); background: var(--danger-soft); font-size: .82rem; font-weight: 700; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { min-height: 48px; padding: 0 14px; border-radius: 11px; font-weight: 800; }
.btn.primary { border: 1px solid var(--brand); color: #fff; background: var(--brand); }
.btn.secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.result-heading { margin-bottom: 8px; }
.result-heading .eyebrow { margin-bottom: 2px; }
.result-summary { padding: 12px; border-radius: 11px; background: var(--surface-alt); }
.result-summary.ready { color: #1f6547; background: var(--success-soft); }
.result-summary p { margin: 0; font-size: .86rem; font-weight: 700; }
.result-details { display: grid; grid-template-columns: 1fr; gap: 1px; margin: 8px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.result-details div { display: grid; grid-template-columns: minmax(120px, .9fr) 1fr; gap: 8px; padding: 9px 10px; background: #fff; }
.result-details dt { color: var(--muted); font-size: .74rem; }
.result-details dd { margin: 0; font-size: .83rem; font-weight: 800; overflow-wrap: anywhere; }
.result-note { margin-top: 8px; padding: 10px 12px; border: 1px dashed #d7b28f; border-radius: 11px; color: #76502f; background: #fffaf5; font-size: .76rem; }
.reference-select { margin-bottom: 10px; }
.reference-content { color: var(--muted); font-size: .78rem; }
.reference-content > p { margin-bottom: 0; }
.reference-card { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-alt); }
.reference-card + .reference-card { margin-top: 7px; }
.reference-card h3 { margin: 0 0 5px; color: var(--ink); font-size: .9rem; }
.reference-card dl { display: grid; gap: 4px; margin: 0; }
.reference-card dl div { display: grid; grid-template-columns: minmax(100px, .42fr) 1fr; gap: 7px; }
.reference-card dt { color: var(--muted); }
.reference-card dd { margin: 0; color: var(--ink); font-weight: 650; }
.reference-sources { margin: 10px 0 0; padding-left: 18px; }
.reference-sources li + li { margin-top: 4px; }
.reference-warning { margin: 10px 0 0; padding: 9px; border-radius: 9px; color: #76502f; background: #fff6ee; }
.site-footer { padding: 8px 0 20px; color: var(--muted); font-size: .7rem; }
.site-footer a { font-weight: 800; text-decoration: none; }

@media (min-width: 720px) {
  .shell { width: min(100% - 40px, 1120px); }
  .page { grid-template-columns: minmax(220px, .32fr) minmax(0, 1fr); gap: 30px; padding-block: 46px 64px; }
  .intro { position: sticky; top: 92px; }
  h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { min-height: 48px; }
}

@media (min-width: 1020px) {
  .panel, .result-panel, .reference-panel { padding: 18px; }
}
