:root {
  --navy: #11253d;
  --blue: #176b87;
  --blue-dark: #0f526b;
  --blue-soft: #eaf6f8;
  --green: #23836f;
  --orange: #e6762f;
  --red: #cc3d3d;
  --ink: #172230;
  --muted: #667587;
  --line: #dce4e9;
  --surface: #f5f8fa;
  --white: #fff;
  --shadow: 0 18px 48px rgba(21, 49, 72, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif; line-height: 1.6; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.section-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(220,228,233,.85); backdrop-filter: blur(12px); }
.header-inner { width: min(1240px, calc(100% - 40px)); min-height: 72px; margin: auto; display: flex; align-items: center; gap: 48px; }
.logo { font-size: 24px; font-weight: 900; letter-spacing: -.8px; color: var(--navy); }
.logo span { color: var(--orange); }
.main-nav { display: flex; align-self: stretch; align-items: center; gap: 30px; }
.main-nav a { position: relative; color: #536274; font-size: 14px; font-weight: 650; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { color: var(--blue); }
.main-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -25px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.menu-button { display: none; margin-left: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 7px 12px; }

.hero { padding: 72px 0 38px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: 1.7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; color: var(--navy); font-size: clamp(34px, 5vw, 50px); line-height: 1.2; letter-spacing: -2px; }
.hero-description { max-width: 730px; margin-bottom: 24px; color: var(--muted); font-size: 17px; }
.safety-notice { display: inline-flex; align-items: flex-start; gap: 12px; max-width: 850px; padding: 13px 18px; border: 1px solid #cce5e7; border-radius: 10px; color: #37606d; background: #f0faf9; font-size: 13px; }
.safety-notice strong { color: var(--green); white-space: nowrap; }

.setup-section, .results-section { margin-bottom: 48px; padding: 38px; border: 1px solid #e2e9ed; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.section-heading.compact { margin-top: 32px; }
.section-heading h2 { margin-bottom: 3px; color: var(--navy); font-size: 21px; letter-spacing: -.5px; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.step-number { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; color: #fff; background: var(--blue); font-size: 12px; font-weight: 800; }
.divider { height: 1px; margin: 36px 0; background: #e8edef; }

.drop-zone { display: flex; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #b9ccd4; border-radius: 15px; outline: none; background: #f9fcfd; transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.upload-icon { display: grid; width: 52px; height: 52px; margin-bottom: 14px; place-items: center; border-radius: 15px; color: var(--blue); background: var(--blue-soft); }
.upload-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { margin-bottom: 2px; font-size: 17px; }
.drop-zone > span:not(.file-select-button) { color: #9aa6b0; font-size: 12px; }
.file-select-button { margin: 9px 0 12px; padding: 8px 18px; border: 1px solid var(--blue); border-radius: 9px; color: var(--blue); background: #fff; font-size: 13px; font-weight: 750; }
.drop-zone small { color: #8795a2; }
.file-info { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-badge { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 10px; color: #fff; background: var(--red); font-size: 11px; font-weight: 850; }
.file-details { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-details span { color: var(--muted); font-size: 12px; }
.text-button { border: 0; background: none; font-size: 13px; font-weight: 700; }
.text-button.danger { color: var(--red); }
.error-message { margin: 10px 0 0; color: var(--red); font-size: 13px; }

.size-options { display: grid; margin: 0; padding: 0; border: 0; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.size-card { position: relative; cursor: pointer; }
.size-card input { position: absolute; opacity: 0; }
.size-card span { display: flex; min-height: 86px; flex-direction: column; justify-content: center; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: .2s; }
.size-card span::after { content: ""; position: absolute; top: 15px; right: 15px; width: 15px; height: 15px; border: 1px solid #afbbc4; border-radius: 50%; }
.size-card strong { font-size: 15px; }
.size-card small { color: var(--muted); }
.size-card input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.size-card input:checked + span::after { border: 4px solid var(--blue); background: #fff; }
.size-card input:focus-visible + span { outline: 3px solid rgba(23,107,135,.2); }
.custom-size { display: flex; gap: 16px; margin-top: 16px; padding: 18px; border-radius: 12px; background: var(--surface); }
.custom-size label { flex: 1; color: #52606f; font-size: 13px; font-weight: 700; }
.custom-size label > span { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted); font-weight: 500; }
.custom-size input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
.custom-size input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,135,.1); }
.size-caption { margin: 12px 0 25px; color: #85919c; font-size: 12px; }
.primary-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 12px; padding: 15px 24px; border: 0; border-radius: 11px; color: #fff; background: var(--blue); font-weight: 800; transition: background .2s, transform .2s; }
.primary-button:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; color: #98a4ae; background: #e5e9ec; }
.analysis-progress { display: flex; align-items: center; gap: 13px; margin-top: 14px; padding: 13px 16px; border: 1px solid #cce1e7; border-radius: 10px; color: var(--blue-dark); background: #f2fafb; }
.analysis-progress div { display: flex; flex-direction: column; }
.analysis-progress strong { font-size: 13px; }
.analysis-progress span:not(.progress-spinner) { color: var(--muted); font-size: 11px; }
.progress-spinner { width: 22px; height: 22px; flex: 0 0 22px; border: 3px solid #c9e2e8; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.analysis-message { margin: 14px 0 0; padding: 12px 14px; border-radius: 9px; font-size: 13px; }
.analysis-message.error { border: 1px solid #edc4c4; color: #9f3030; background: #fff3f3; }
.analysis-message.warning { border: 1px solid #efdbb1; color: #815b12; background: #fff9eb; }
.error-detail { margin-top: 8px; padding: 10px 13px; border: 1px solid #e5caca; border-radius: 9px; color: #794141; background: #fffafa; font-size: 11px; }
.error-detail summary { cursor: pointer; font-weight: 750; }
.error-detail pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-family: Consolas, monospace; font-size: 10px; }

.results-section { scroll-margin-top: 95px; }
.results-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.results-intro h2 { margin-bottom: 5px; color: var(--navy); font-size: 28px; }
.results-intro p:last-child { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.demo-badge { padding: 6px 11px; border-radius: 20px; color: var(--orange); background: #fff2e9; font-size: 12px; font-weight: 800; }
.result-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1.05fr) minmax(370px, .95fr); gap: 32px; }
.form-panel { padding-right: 32px; border-right: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.panel-title h3 { margin: 0; color: var(--navy); font-size: 17px; }
.panel-title span { color: var(--muted); font-size: 11px; }
.field-group { margin-bottom: 22px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.field-heading label, .field-label { font-size: 13px; font-weight: 800; }
.status { padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 800; }
.status-check { color: var(--green); background: #e9f6f2; }
.status-needed { color: var(--orange); background: #fff1e7; }
.field-group input, .field-group textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; outline: none; resize: vertical; }
.field-group input:focus, .field-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,135,.1); }
.field-group ::placeholder { color: #a2adb6; }
.pictogram-selector { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px dashed #c6d1d8; border-radius: 10px; background: #fafcfd; }
.pictogram-placeholder { display: grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; color: #c83b3b; border: 2px solid #d96666; font-size: 28px; transform: rotate(45deg); }
.pictogram-placeholder + div strong { font-size: 13px; }
.pictogram-selector p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.preview-panel { position: sticky; top: 100px; }
.warning-label { overflow: hidden; border: 3px solid #202020; color: #111; background: #fff; }
.preview-product { min-height: 64px; padding: 15px; border-bottom: 2px solid #202020; font-size: 24px; font-weight: 900; text-align: center; word-break: break-word; }
.preview-pictograms { display: flex; min-height: 112px; align-items: center; justify-content: center; padding: 16px; border-bottom: 1px solid #333; }
.ghs-placeholder { display: flex; width: 78px; height: 78px; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #d76b6b; color: #a44; transform: rotate(45deg); }
.ghs-placeholder > * { transform: rotate(-45deg); }
.ghs-placeholder span { font-size: 12px; font-weight: 800; }
.ghs-placeholder small { font-size: 8px; }
.preview-signal { min-height: 48px; padding: 8px 14px; border-bottom: 1px solid #333; font-size: 21px; font-weight: 950; text-align: center; }
.preview-copy { display: grid; grid-template-columns: 1fr 1fr; }
.preview-copy section { min-height: 160px; padding: 13px; border-bottom: 1px solid #333; }
.preview-copy section + section { border-left: 1px solid #333; }
.preview-copy strong, .preview-supplier strong { display: block; margin-bottom: 7px; font-size: 11px; }
.preview-copy p, .preview-supplier p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 11px; line-height: 1.5; }
.preview-supplier { min-height: 78px; padding: 12px 14px; }
.empty-value { color: #8a8a8a; }
.preview-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.diagnostics-section { margin-top: 32px; padding: 20px; border: 1px solid #dce6ea; border-radius: 12px; background: #f8fbfc; }
.diagnostics-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.diagnostics-heading > div { display: flex; align-items: center; gap: 9px; }
.diagnostics-heading h3 { margin: 0; color: var(--navy); font-size: 15px; }
.development-label { padding: 3px 7px; border-radius: 5px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 850; }
.diagnostic-status { padding: 4px 9px; border-radius: 14px; font-size: 10px; font-weight: 800; }
.diagnostic-status.normal { color: var(--green); background: #e9f6f2; }
.diagnostic-status.warning { color: #815b12; background: #fff1d5; }
.diagnostic-summary { display: grid; margin: 0; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.diagnostic-summary div { padding: 12px; border: 1px solid #e1e8ec; border-radius: 9px; background: #fff; }
.diagnostic-summary dt { color: var(--muted); font-size: 10px; }
.diagnostic-summary dd { margin: 2px 0 0; color: var(--navy); font-size: 14px; font-weight: 850; }
.page-lengths { margin-top: 14px; }
.page-lengths > strong { font-size: 11px; }
.page-lengths ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 0; padding: 0; list-style: none; }
.page-lengths li { padding: 5px 8px; border: 1px solid #dce5e9; border-radius: 6px; color: #566675; background: #fff; font-size: 10px; }
.raw-text-section { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.secondary-button { display: flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: #fff; font-size: 13px; font-weight: 800; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.secondary-button span { transition: transform .2s; }
.secondary-button[aria-expanded="true"] span { transform: rotate(180deg); }
.raw-text-panel { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.raw-text-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.raw-text-heading strong { color: var(--navy); font-size: 14px; }
.raw-text-heading span, .raw-text-panel > p { color: var(--muted); font-size: 11px; }
.raw-text-panel > p { margin: 5px 0 12px; }
.raw-text-panel pre { max-height: 440px; margin: 0; padding: 16px; overflow: auto; border: 1px solid #d5dde2; border-radius: 8px; color: #2d3945; background: #fff; font-family: Consolas, "Noto Sans Mono", monospace; font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 320px; padding: 12px 16px; border-radius: 9px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: none; }
footer { margin-top: 70px; padding: 26px 0; color: #b7c3cf; background: var(--navy); }
footer .section-shell { display: flex; align-items: center; gap: 16px; }
footer strong { color: #fff; }
footer span { font-size: 12px; }
footer small { margin-left: auto; }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; min-height: 64px; }
  .menu-button { display: block; }
  .main-nav { display: none; width: 100%; padding: 0 0 18px; flex-direction: column; align-items: flex-start; gap: 13px; }
  .main-nav.open { display: flex; }
  .main-nav a.active::after { display: none; }
  .size-options { grid-template-columns: repeat(2, 1fr); }
  .result-layout { grid-template-columns: 1fr; }
  .form-panel { padding-right: 0; border-right: 0; }
  .preview-panel { position: static; }
}

@media (max-width: 560px) {
  .section-shell, .header-inner { width: min(100% - 28px, 1180px); }
  .hero { padding-top: 46px; }
  h1 { font-size: 34px; letter-spacing: -1.3px; }
  .hero-description { font-size: 15px; }
  .safety-notice { flex-direction: column; gap: 2px; }
  .setup-section, .results-section { padding: 22px 18px; border-radius: 14px; }
  .drop-zone { min-height: 220px; padding: 20px; text-align: center; }
  .size-options { grid-template-columns: 1fr 1fr; }
  .size-card span { padding: 12px; }
  .custom-size { flex-direction: column; }
  .results-intro { align-items: flex-start; gap: 12px; }
  .diagnostics-heading, .diagnostics-heading > div { align-items: flex-start; flex-direction: column; }
  .diagnostic-summary { grid-template-columns: 1fr; }
  .demo-badge { flex: 0 0 auto; }
  .preview-copy { grid-template-columns: 1fr; }
  .preview-copy section + section { border-left: 0; }
  footer .section-shell { align-items: flex-start; flex-direction: column; gap: 3px; }
  footer small { margin-left: 0; }
}
