:root {
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --ink: #101828;
  --muted: #475467;
  --muted-light: #667085;
  --line: #d0d5dd;
  --line-soft: #eaecf0;
  --blue: #175cd3;
  --blue-hover: #1849a9;
  --blue-soft: #eff4ff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --success: #067647;
  --success-soft: #ecfdf3;
  --radius: 4px;
  --font-sans: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }
button, select { min-height: 48px; }
button { cursor: pointer; }

a { color: var(--blue); }

.page-shell {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1200px, calc(100% - 48px));
  min-height: 64px;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-company { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.brand-divider { width: 1px; height: 18px; background: var(--line); }
.brand-product { color: var(--muted); font-size: 14px; }

.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}
.status-dot { display: inline-block; width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 64px;
  padding-block: 72px 48px;
}

.hero-main { min-width: 0; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, p { word-break: keep-all; }

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.16;
  text-wrap: balance;
}

.hero-description {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 24px;
  color: var(--muted-light);
  font-size: 14px;
}
.hero-meta span { display: inline-flex; align-items: center; }
.hero-meta span + span::before { content: ""; width: 1px; height: 12px; margin: 0 12px; background: var(--line); }

.safety-notice {
  display: flex;
  gap: 16px;
  align-self: end;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.safety-icon {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: var(--radius);
}
.safety-icon svg, .empty-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.safety-notice h2 { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.safety-notice p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.assurance-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  list-style: none;
}
.assurance-list li {
  position: relative;
  padding: 14px 16px 14px 38px;
  color: var(--muted);
  font-size: 14px;
}
.assurance-list li::before {
  content: "✓";
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--success);
  font-weight: 700;
}
.assurance-list li + li { border-left: 1px solid var(--line-soft); }

.planner-section {
  padding-block: 64px;
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 48px;
  align-items: end;
  margin-bottom: 32px;
}
.section-intro h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.035em; line-height: 1.25; }
.section-intro > p { margin: 0; color: var(--muted); }
.section-intro.compact { grid-template-columns: 1fr; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.incident-form, .result-panel { min-width: 0; padding: 32px; }
.incident-form { background: var(--surface); border-right: 1px solid var(--line); }
.result-panel { background: var(--surface-subtle); }

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-heading > div { display: flex; gap: 12px; align-items: center; }
.step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.panel-kicker { margin: 0; color: var(--muted-light); font-size: 12px; }
.panel-heading h3 { margin: 1px 0 0; font-size: 20px; letter-spacing: -0.02em; line-height: 1.35; }
.panel-meta, .result-state {
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.result-state { color: var(--blue); background: var(--blue-soft); border-color: #b2ccff; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 24px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 8px; margin: 0 0 20px; }
.field-wide { grid-column: 1 / -1; }
.field-label, .choice-field legend { color: var(--ink); font-size: 14px; font-weight: 600; }

select {
  width: 100%;
  padding: 0 42px 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
select:hover { border-color: #98a2b3; }

.choice-field { padding: 0; border: 0; }
.choices { display: grid; gap: 8px; }
.choices-four { grid-template-columns: repeat(4, 1fr); }
.choices-three { grid-template-columns: repeat(3, 1fr); }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}
.choices span:hover { border-color: #98a2b3; }
.choices input:checked + span { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
.choices input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.primary-action, .secondary-action, .copy-button, .reset-result {
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
}
.primary-action, .copy-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.primary-action:hover, .copy-button:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.secondary-action, .reset-result { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.secondary-action:hover, .reset-result:hover { background: var(--surface-subtle); border-color: #98a2b3; }

.privacy-line { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--muted-light); font-size: 13px; }
.privacy-line .status-dot { width: 7px; height: 7px; }

.empty-result {
  display: grid;
  min-height: 520px;
  place-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
}
.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--muted-light);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty-result h4 { margin: 0 0 8px; font-size: 18px; }
.empty-result p { max-width: 400px; margin: 0; color: var(--muted); font-size: 14px; }

.generated-result { padding-top: 24px; animation: result-in 220ms ease-out both; }
@keyframes result-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.severity-block {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.severity-code {
  display: grid;
  min-height: 72px;
  place-items: center;
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.severity-code.severity-p1 { background: var(--warning); }
.severity-code.severity-p2 { background: var(--blue); }
.severity-label { margin: 0 0 5px; color: var(--danger); font-size: 13px; font-weight: 700; }
.severity-target { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.02em; line-height: 1.4; }
.severity-reason { margin: 0; color: var(--muted); font-size: 14px; }

.result-actions { display: flex; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.response-section { padding: 24px 0; border-bottom: 1px solid var(--line-soft); }
.response-section h4 { margin: 0 0 12px; font-size: 15px; }
.response-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: response-step; }
.response-list li {
  position: relative;
  padding: 12px 0 12px 36px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  counter-increment: response-step;
}
.response-list li::before {
  content: counter(response-step, decimal-leading-zero);
  position: absolute;
  top: 14px;
  left: 0;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 12px;
}
.reference-list a { text-decoration-color: #84adff; text-underline-offset: 3px; }

.method-section { padding-block: 64px 80px; }
.method-list { margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); list-style: none; }
.method-list li { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 24px; }
.method-list li + li { border-top: 1px solid var(--line-soft); }
.method-list > li > span { color: var(--blue); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.method-list h3 { margin: 0 0 6px; font-size: 17px; }
.method-list p { margin: 0; color: var(--muted); }

.site-footer { color: #d0d5dd; background: var(--ink); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; padding-block: 32px; }
.footer-inner p { margin: 0; font-size: 13px; }
.footer-inner strong { color: #fff; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .safety-notice { align-self: auto; }
  .assurance-list { grid-template-columns: 1fr 1fr; }
  .assurance-list li:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .assurance-list li:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .workspace { grid-template-columns: 1fr; }
  .incident-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .empty-result { min-height: 360px; }
}

@media (max-width: 680px) {
  .page-shell, .header-inner { width: min(100% - 32px, 1200px); }
  .header-inner { min-height: 58px; }
  .brand-divider, .brand-product { display: none; }
  .privacy-status span:last-child { display: none; }
  .hero { padding-block: 48px 32px; }
  h1 { font-size: 2.25rem; line-height: 1.2; }
  .hero-description { margin-top: 20px; font-size: 16px; }
  .safety-notice { padding: 20px; }
  .assurance-list { grid-template-columns: 1fr; }
  .assurance-list li + li { border-top: 1px solid var(--line-soft); border-left: 0; }
  .planner-section { padding-block: 48px; }
  .section-intro { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
  .incident-form, .result-panel { padding: 24px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .choices-four { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: column; }
  .primary-action, .secondary-action { width: 100%; }
  .empty-result { min-height: 300px; padding-inline: 12px; }
  .severity-block { grid-template-columns: 64px 1fr; gap: 14px; padding: 16px; }
  .severity-code { min-height: 58px; font-size: 22px; }
  .severity-target { font-size: 17px; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .method-section { padding-block: 48px 64px; }
  .method-list li { grid-template-columns: 40px 1fr; gap: 12px; padding: 20px 16px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
