:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: #1d1d1f;
  background: #fbf7ef;
  font-size: 18px;
  line-height: 1.65;
  --green-900: #294943;
  --green-800: #3f675c;
  --green-700: #527d70;
  --green-100: #dce9d7;
  --green-50: #f1f6ee;
  --ink: #263b3a;
  --muted: #65716d;
  --line: #e4ded3;
  --paper: #ffffff;
  --warning: #8a4b08;
  --warning-bg: #fff5df;
  --danger: #a12c2c;
  --danger-bg: #fff0f0;
  --shadow: 0 16px 44px rgba(81, 67, 46, 0.085);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  word-break: keep-all;
  overflow-wrap: break-word;
  background:
    radial-gradient(circle at 9% 2%, rgba(224,239,211,.45), transparent 25rem),
    radial-gradient(circle at 91% 9%, rgba(242,222,183,.36), transparent 27rem),
    #fbf7ef;
  letter-spacing: -.006em;
}
button, input, select, textarea { font: inherit; word-break: keep-all; overflow-wrap: normal; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 4px solid #f0b429;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: #fff;
  color: var(--green-900);
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { top: 16px; }

.site-header { color: var(--ink); background: linear-gradient(180deg, rgba(255,252,246,.98), rgba(249,244,234,.94)); border-bottom: 1px solid #e6ddce; }
.header-inner {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  min-height: 250px;
  padding: 22px 0 18px;
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(390px, 1fr);
  position: relative;
  align-items: center;
  gap: 24px;
}
.header-copy-block { grid-column: 1; grid-row: 1; align-self: start; padding-top: 10px; position: relative; z-index: 2; }
.brand-lockup {
  width: fit-content;
  margin: 0 0 10px;
  color: #62564d;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-logo { width: 194px; height: 26px; display: block; background: #62564d; -webkit-mask: url("/static/assets/middleton-official-logo.png") center/contain no-repeat; mask: url("/static/assets/middleton-official-logo.png") center/contain no-repeat; }
.brand-divider { width: 1px; height: 24px; background: rgba(98,86,77,.38); }
.brand-lockup strong { font-size: 1.08rem; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.brand-lockup:hover strong { color: #3f3026; }
.header-art { position: absolute; right: 0; bottom: 0; z-index: 0; width: min(66%, 760px); min-width: 0; border-radius: 0 30px 30px 0; overflow: hidden; pointer-events: none; }
.header-art img { width: 100%; height: 250px; object-fit: contain; object-position: right bottom; display: block; border-radius: 0 30px 30px 0; mix-blend-mode: multiply; }
.header-actions { grid-column: 1; grid-row: 1; align-self: end; justify-self: start; margin-bottom: 4px; position: relative; z-index: 2; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; color: var(--green-700); font-size: .82rem; font-weight: 900; letter-spacing: .09em; }
.eyebrow.dark { color: var(--green-700); }
h1, h2, h3, h4, p { word-break: keep-all; overflow-wrap: break-word; }
h1 { margin: 0; color: #62564d; font-family: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif; font-size: clamp(2rem, 3.45vw, 2.65rem); line-height: 1.25; letter-spacing: -.04em; opacity: .94; }
.header-copy { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }
.health {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid #b8ded5;
  border-radius: 999px;
  color: #145b50;
  background: #ecf9f5;
  font-weight: 800;
  font-size: .9rem;
}
.health.is-ok::before { content: "●"; margin-right: 8px; color: #1aa681; }
.llm-consult-link { min-height: 46px; padding: 9px 17px; border: 1px solid #d2bea0; border-radius: 999px; color: #70583e; background: rgba(255,249,239,.94); text-decoration: none; font-size: .88rem; font-weight: 900; display: inline-flex; align-items: center; gap: 9px; box-shadow: 0 4px 12px rgba(104,78,45,.08); }
.llm-consult-link:hover { color: #fff; border-color: #80684d; background: #80684d; }

.page-shell { width: min(1180px, calc(100% - 36px)); margin: -2px auto 56px; position: relative; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.step-tab {
  min-height: 88px;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.step-tab:last-child { border-right: 0; }
.step-tab span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7ecea;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
}
.step-tab strong { font-size: 1rem; }
.step-tab.is-active { color: var(--green-900); background: #ecf9f6; }
.step-tab.is-active span { color: #fff; background: var(--green-700); }

.page-message {
  margin: 22px 0 0;
  padding: 16px 20px;
  border: 2px solid var(--green-700);
  border-radius: 12px;
  background: var(--green-50);
  font-weight: 800;
}
.page-message.error { border-color: var(--danger); color: #721c1c; background: var(--danger-bg); }

.step-panel, .recent-section {
  scroll-margin-top: 18px;
  margin-top: 22px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.step-panel[data-step="1"] { position: relative; overflow: hidden; }
.step-panel[data-step="1"]::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -85px;
  width: 520px;
  height: 210px;
  background: url("/static/assets/silvercare-hero-v1.png") right center / cover no-repeat;
  opacity: .16;
  pointer-events: none;
  mask-image: linear-gradient(to left, #000 48%, transparent 100%);
}
.step-panel[data-step="1"] > * { position: relative; z-index: 1; }
.section-heading { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.section-heading h2, .recent-heading h2 { margin: 0; color: var(--green-900); font-family: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.3; letter-spacing: -.025em; }
.section-heading p { margin: 8px 0 0; color: var(--muted); }
.step-number {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: .8rem;
  font-weight: 900;
}

.document-tools { margin-bottom: 26px; display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(330px, .75fr); gap: 24px; align-items: end; }
.search-box { display: block; margin: 0; }
.search-box span, .field-title, label { font-weight: 800; }
.search-box input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin-top: 8px;
  padding: 12px 18px 12px 54px;
  border: 2px solid #a8bbb6;
  border-radius: 16px;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23135f54' stroke-width='2.5'%3E%3Ccircle cx='10.5' cy='10.5' r='7.5'/%3E%3Cpath d='m16 16 6 6'/%3E%3C/svg%3E") no-repeat 18px center;
  font-size: 1.05rem;
}
.filter-block { margin: 0; }
.field-title { margin: 0 0 10px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.category-button {
  height: 52px;
  min-height: 52px;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #3f5751;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.category-button.is-active { border-color: var(--green-700); color: #fff; background: var(--green-700); }
.result-count { margin-bottom: 10px; color: var(--muted); font-size: .9rem; }
.document-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.document-card-shell { position: relative; min-width: 0; }
.document-card {
  width: 100%;
  min-height: 104px;
  padding: 15px 16px 42px;
  border: 2px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.card-sample-button { position: absolute; right: 13px; bottom: 13px; min-height: 36px; padding: 6px 11px; border: 1px solid #8da9a1; border-radius: 999px; color: #3f675c; background: rgba(255,255,255,.96); font-size: .78rem; font-weight: 900; cursor: pointer; }
.card-sample-button:hover { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.document-card:hover { border-color: #91ad85; background: #fffdf8; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(83,91,62,.08); }
.document-card.is-selected { border-color: var(--green-700); background: linear-gradient(135deg, #f4f8ef, #fffdf8); box-shadow: inset 0 0 0 1px var(--green-700), 0 10px 25px rgba(78,108,85,.08); }
.document-check {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 2px solid #9eb2ad;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}
.document-card.is-selected .document-check { border-color: var(--green-700); background: var(--green-700); }
.document-card-copy { min-width: 0; display: grid; gap: 2px; }
.document-card-copy strong { font-size: 1rem; line-height: 1.4; word-break: keep-all; overflow-wrap: normal; }
.document-card-copy small { color: var(--muted); font-size: .82rem; }

.step-actions { margin-top: 30px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.step-actions.align-end { justify-content: flex-end; }
.button {
  min-height: 56px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.button.primary { color: #fff; background: linear-gradient(135deg, #668d7c, #3e6d61); box-shadow: 0 8px 20px rgba(62,109,97,.22); }
.button.primary:hover { background: var(--green-900); transform: translateY(-1px); }
.button.secondary { border-color: #9bada9; color: var(--green-900); background: #fff; }
.button.large { min-height: 66px; padding-inline: 32px; font-size: 1.08rem; }
.button:disabled { opacity: .65; cursor: wait; }

.card { margin-top: 16px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.card h3 { margin: 0; font-size: 1.18rem; }
.help-text { margin: 5px 0 18px; color: var(--muted); font-size: .9rem; }
.required-mark { color: var(--danger); font-size: .78rem; font-weight: 900; }
.optional { padding: 2px 8px; border-radius: 999px; color: var(--muted); background: #e8eeec; font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid label, .extra-card label { display: flex; flex-direction: column; gap: 7px; }
.form-grid .span-two { grid-column: 1 / -1; }
label small { color: var(--muted); font-weight: 500; font-size: .8rem; }
input, select, textarea {
  width: 100%;
  min-height: 56px;
  padding: 11px 14px;
  border: 2px solid #aebfba;
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #72837f; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); }
.question-card { background: #f3fbf8; border-color: #c6e5dd; }
.question-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.question-heading-row .help-text { margin-bottom: 18px; }
.sample-button { flex: 0 0 auto; min-height: 52px; border-color: #6f86b7; color: #334d82; background: #fff; }
.sample-button::before { content: "보기"; padding: 2px 7px; border-radius: 999px; color: #fff; background: #5d74a7; font-size: .7rem; }
.routine-default-notice { margin: 0 0 16px; padding: 15px 17px; border: 2px solid #4f9a7e; border-radius: 12px; background: #fff; color: #174f3d; }
.routine-default-notice strong, .routine-default-notice span { display: block; }
.routine-default-notice span { margin-top: 3px; color: #496a61; }
.question-list { display: grid; gap: 16px; }
.question-item { display: block; padding: 18px; border: 1px solid #c3d9d3; border-radius: 12px; background: #fff; }
.question-label { margin-bottom: 9px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.question-label b {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-700);
  display: inline-grid;
  place-items: center;
  font-size: .85rem;
}
.optional-questions { margin-top: 6px; border: 2px solid #9fbab2; border-radius: 12px; background: #f8fbfa; }
.optional-questions > summary { padding: 18px; color: var(--green-800); font-weight: 900; cursor: pointer; }
.optional-questions > summary span { display: block; margin-top: 3px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.optional-questions > div { padding: 0 14px 14px; display: grid; gap: 14px; }
.standalone-label { display: block; margin-bottom: 2px; }
.note-card textarea { margin-top: 5px; }
.extra-card summary { font-weight: 900; cursor: pointer; }
.extra-card summary span { color: var(--muted); font-size: .8rem; }
.extra-card[open] summary { margin-bottom: 16px; }

.loading-card, .empty-state { padding: 34px; border: 2px dashed #b9c9c5; border-radius: 14px; background: #fafcfb; text-align: center; }
.empty-state strong { font-size: 1.1rem; }
.empty-state p { margin: 6px 0 0; color: var(--muted); }
.spinner { width: 24px; height: 24px; margin-right: 8px; border: 3px solid #bdd5cf; border-top-color: var(--green-700); border-radius: 50%; display: inline-block; vertical-align: middle; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.missing-guide { margin-bottom: 16px; padding: 18px 20px; border: 2px solid; border-radius: 12px; }
.missing-guide strong { font-size: 1.05rem; }
.missing-guide p { margin: 3px 0 0; }
.missing-guide ul { margin: 8px 0 14px; padding-left: 24px; }
.missing-guide.is-complete { border-color: #55a987; color: #174f3d; background: #eaf8f2; }
.missing-guide.has-missing { border-color: #e0aa57; color: #704008; background: var(--warning-bg); }
.warning-button { min-height: 48px; border-color: #ae690f; color: #754000; background: #fff; }
.preview-card { margin-top: 0; background: #fff; }
.preview-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid #deE7e4; }
.preview-title-row h3 { font-size: 1.4rem; }
.format-notice { margin: 16px 0 0; padding: 14px 16px; border: 2px solid #b7c8c3; border-radius: 10px; background: #f7f9f8; }
.format-notice strong, .format-notice span { display: block; }
.format-notice span { margin-top: 3px; color: var(--muted); }
.format-notice.is-legal { border-color: #2e8468; background: #eaf8f2; color: #174f3d; }
.official-form-preview { margin: 18px 0 0; padding: 20px; border: 2px solid #6e91c8; border-radius: 16px; background: #f5f8ff; }
.official-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.official-preview-heading h4 { margin: 0; font-size: 1.15rem; }
.official-preview-heading > span { flex: 0 0 auto; padding: 6px 11px; border-radius: 999px; color: #304d7d; background: #e0e9f8; font-size: .78rem; font-weight: 900; }
.official-preview-notice { margin: 10px 0 16px; color: #344965; font-weight: 750; }
.official-pdf-frame { width: 100%; height: 660px; border: 1px solid #aab9cf; border-radius: 10px; background: #fff; }
.official-preview-actions { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.official-extra-assets { margin-top: 12px; }
.official-extra-assets summary { color: #334d82; font-weight: 900; cursor: pointer; }
.official-extra-assets div { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.official-extra-assets a { color: #334d82; font-weight: 800; }
.official-preview-error { display: grid; gap: 4px; color: #7b2b2b; }
.preview-section-heading { margin: 22px 0 10px; font-size: 1.05rem; }
.status-badge { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; color: #17523e; background: #d9f2e7; font-size: .82rem; font-weight: 900; }
.status-badge.needs-review { color: #744008; background: #ffedc8; }
.people-summary { margin: 20px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.people-summary div { padding: 12px 16px; background: #f8faf9; }
.people-summary dt { color: var(--muted); font-size: .82rem; font-weight: 700; }
.people-summary dd { margin: 2px 0 0; font-weight: 900; }
.preview-sections { display: grid; gap: 12px; }
.preview-section { padding: 17px 18px; border-left: 5px solid var(--green-700); border-radius: 4px 10px 10px 4px; background: #f5f9f7; }
.preview-section h4 { margin: 0 0 5px; color: var(--green-800); font-size: 1rem; }
.preview-section p { margin: 0; white-space: pre-wrap; }
.preview-section .missing-content { color: #854b08; font-weight: 800; }
.preview-section.is-empty { border-color: #d89f49; background: var(--warning-bg); }
.preview-narrative {
  border-left-width: 0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(41, 73, 67, 0.14);
  border: 1px solid var(--green-100);
}
.preview-narrative h4 {
  margin: 0;
  padding: 14px 20px 13px;
  color: #f1f6ee;
  font-size: 1.02rem;
  letter-spacing: 0.2px;
  background: linear-gradient(105deg, var(--green-900), var(--green-700));
}
.preview-narrative h4::before {
  content: "확인된 사실만 반영 · 미들턴 LLM 서술";
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: none;
  opacity: 0.78;
  margin-bottom: 3px;
}
.preview-narrative p {
  margin: 0;
  padding: 15px 20px;
  white-space: pre-wrap;
  font-size: 1.03rem;
  line-height: 1.85;
  color: var(--ink);
  text-align: justify;
}
.preview-narrative p + p { padding-top: 0; }
.review-note { margin: 18px 0 0; color: var(--muted); font-size: .87rem; }
.final-actions { margin: 20px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.download-area:not(:empty) { margin-top: 24px; }
.download-card { padding: clamp(22px, 4vw, 32px); border: 2px solid #b9ded5; border-radius: 24px; background: #f3fbf8; display: flex; gap: 20px; align-items: flex-start; }
.download-card.needs-check { border-color: #d99c43; background: var(--warning-bg); }
.download-icon { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: var(--green-700); display: grid; place-items: center; font-size: 1.45rem; font-weight: 900; }
.needs-check .download-icon { background: #b76c10; }
.download-copy { flex: 1; }
.download-copy h3, .download-card h3 { margin: 0; font-size: 1.3rem; }
.download-copy > p:not(.eyebrow) { margin: 5px 0 16px; color: var(--muted); }
.download-primary { width: 100%; min-height: 66px; color: #fff; background: var(--green-700); font-size: 1.05rem; }
.main-downloads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.main-downloads .button { width: 100%; height: 100%; text-align: center; }
.view-document { min-height: 66px; border-color: #79bbae; color: var(--green-900); background: #fff; }
.format-download { min-height: 66px; border-color: #9db8c7; color: #234d63; background: #fff; }
.hwp-download { border-width: 3px; }
.hwpx-download { border-width: 3px; border-color: #8d79b5; color: #4f3d77; background: #fff; }
.other-downloads { margin-top: 14px; font-size: .9rem; }
.other-downloads summary { width: fit-content; padding: 8px 0; color: var(--green-800); font-weight: 900; cursor: pointer; }
.other-downloads div { display: flex; gap: 10px 18px; flex-wrap: wrap; padding: 10px 0; }
.other-downloads a { color: var(--green-800); font-weight: 800; }

.rare-documents { grid-column: 1 / -1; margin-top: 18px; border: 2px solid #b8c8c3; border-radius: 14px; background: #f7f9f8; }
.rare-documents > summary { padding: 20px; display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; }
.rare-documents > summary strong { font-size: 1.05rem; }
.rare-documents > summary span { color: var(--muted); }
.rare-document-list { padding: 0 18px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.recent-section { background: #f9fbfa; }
.recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.text-button { min-height: 48px; border-color: var(--line); color: var(--green-800); background: #fff; }
.history-list { display: grid; gap: 10px; }
.history-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.history-card strong { font-size: 1.02rem; }
.history-card p { margin: 2px 0; color: var(--muted); font-size: .82rem; }
.history-card span { color: #536b65; font-size: .8rem; }
.history-download { flex: 0 0 auto; min-height: 48px; padding: 8px 16px; color: #fff; background: var(--green-700); }
.history-wait { flex: 0 0 auto; padding: 8px 12px; border-radius: 8px; background: var(--warning-bg); }
.history-empty { padding: 22px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }

footer { padding: 24px 18px 38px; color: #657873; text-align: center; font-size: .83rem; }
footer p { margin: 2px; }

.time-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border: 2px solid var(--green-100); border-radius: 14px; background: var(--green-50); }
.time-range label { margin: 0; }
.time-range p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }

.sample-dialog { width: min(980px, calc(100% - 28px)); max-height: 92vh; padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: #f5f1e9; box-shadow: 0 24px 90px rgba(0,0,0,.25); }
.sample-dialog::backdrop { background: rgba(28,34,38,.52); backdrop-filter: blur(3px); }
.sample-dialog-header { position: sticky; top: 0; z-index: 2; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sample-dialog-header h2 { margin: 0; font-size: 1.45rem; }
.dialog-close { min-width: 64px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; color: #3b4549; background: #eef1f2; font-size: 1rem; font-weight: 800; cursor: pointer; }
.sample-body { padding: 22px 24px; }
.sample-warning { padding: 16px 18px; border: 2px solid #d19a3f; border-radius: 14px; color: #71440b; background: #fff5df; }
.sample-warning strong, .sample-warning span { display: block; }
.sample-warning span { margin-top: 4px; }
.sample-situation { margin: 18px 0; }
.sample-paper { position: relative; width: min(100%, 760px); min-height: 880px; margin: 20px auto 0; padding: 42px 38px 36px; border: 1px solid #c7c1b8; color: #202a2a; background: #fff; box-shadow: 0 14px 38px rgba(55,45,35,.13); }
.sample-paper-header { position: relative; padding-bottom: 22px; border-bottom: 3px double #303b3a; text-align: center; }
.sample-paper-header p { margin: 0 0 7px; color: #505b59; font-size: .82rem; text-align: right; }
.sample-paper-header h3 { margin: 0; font-family: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif; font-size: 1.55rem; letter-spacing: .08em; }
.sample-paper-header span { position: absolute; left: 0; top: 0; padding: 6px 10px; border: 2px solid #ad644f; color: #9b513d; transform: rotate(-5deg); font-size: .78rem; font-weight: 900; }
.sample-paper-meta { width: 100%; margin-top: 18px; border-collapse: collapse; table-layout: fixed; }
.sample-paper-meta th, .sample-paper-meta td { padding: 10px 11px; border: 1px solid #596361; text-align: left; vertical-align: top; }
.sample-paper-meta th { width: 16%; background: #f1f3ef; font-size: .84rem; }
.sample-paper-meta td { width: 34%; font-weight: 750; }
.sample-values { margin: 18px 0 0; display: grid; border-top: 1px solid #596361; border-left: 1px solid #596361; }
.sample-row { min-height: 58px; padding: 0; border-right: 1px solid #596361; border-bottom: 1px solid #596361; background: #fff; display: grid; grid-template-columns: minmax(145px, 28%) 1fr; }
.sample-row dt { margin: 0; padding: 12px; color: #273332; background: #f1f3ef; display: flex; align-items: center; font-size: .82rem; font-weight: 800; }
.sample-row dd { margin: 0; padding: 12px 14px; display: flex; align-items: center; font-weight: 850; white-space: pre-wrap; }
.sample-paper-signature { margin-top: 28px; padding-top: 16px; border-top: 1px solid #747c7a; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: .86rem; }
.sample-paper-signature span:last-child { grid-column: 2; }
.sample-official-actions { width: min(100%, 760px); margin: 16px auto 0; padding: 16px; border: 1px solid #9fb2c5; border-radius: 12px; background: #eef4fa; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sample-official-actions strong { flex: 1 1 100%; }
.sample-copy-note { margin: 16px 0 0; color: var(--muted); }
.sample-dialog-actions { position: sticky; bottom: 0; padding: 16px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 버튼·탭·배지의 짧은 문구는 단어가 중간에서 나뉘지 않도록 한 줄로 표시합니다. */
.step-tab strong,.category-button,.card-sample-button,.button,.status-badge,.health,.llm-consult-link,
.dialog-close,.history-download,.warning-button,.sample-button,.other-downloads summary{
  white-space:nowrap;
  word-break:keep-all;
  overflow-wrap:normal;
}
.document-card-copy,.document-card-copy strong{min-width:0}

/* 일반 노트북: 장식은 유지하고 작업영역 밀도를 낮춥니다. */
@media (max-width: 1180px) and (min-width: 901px) {
  .header-inner { grid-template-columns: minmax(350px, 1fr) minmax(350px, 1fr); }
  .header-art { right: 0; width: min(65%, 680px); }
  .header-art img { height: 240px; }
  .page-shell, .header-inner { width: min(100% - 32px, 1080px); }
}

/* 태블릿: 상단 그림을 제목 아래로 보내고 입력·다운로드는 2열로 유지합니다. */
@media (max-width: 900px) and (min-width: 761px) {
  .header-inner { grid-template-columns: 1fr; min-height: 285px; }
  .header-copy-block { grid-column: 1; grid-row: 1; align-self: start; }
  .header-art { right: 0; bottom: 0; width: 610px; min-width: 0; opacity: .62; }
  .header-art img { height: 225px; object-fit: contain; }
  .header-actions { grid-column: 1; grid-row: 1; align-self: end; justify-self: start; margin-bottom: 10px; }
  .document-list, .rare-document-list { grid-template-columns: 1fr; }
  .form-grid { gap: 14px; }
  .official-pdf-frame { height: 560px; }
  .document-tools { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .main-downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 휴대폰: 한 손 조작을 위해 선택·입력·다운로드를 모두 한 열로 배치합니다. */
@media (max-width: 760px) {
  :root { font-size: 17px; }
  .header-inner { width: min(100% - 24px, 680px); min-height: 300px; padding-top: 18px; display: grid; grid-template-columns: 1fr; align-items: start; gap: 10px; }
  .header-copy-block { grid-column: 1; grid-row: 1; }
  .brand-lockup { gap: 8px; margin-bottom: 9px; }
  .brand-logo { width: 158px; height: 22px; }
  .brand-divider { height: 21px; }
  .brand-lockup strong { font-size: .98rem; }
  .header-art { right: -10px; bottom: 0; width: 430px; min-width: 0; opacity: .42; }
  .header-art img { height: 190px; object-fit: contain; object-position: right bottom; }
  .header-actions { grid-column: 1; grid-row: 1; align-self: end; justify-self: start; margin: 0 0 12px; gap: 7px; }
  .health, .llm-consult-link { min-height: 42px; padding: 7px 11px; font-size: .76rem; }
  .header-art, .header-art img { border-radius: 0 18px 18px 0; }
  .header-copy { max-width: 30rem; }
  .document-tools { grid-template-columns: 1fr; gap: 18px; }
  .page-shell { width: min(100% - 22px, 1180px); }
  .steps { border-radius: 12px; }
  .step-tab { min-height: 74px; padding: 8px 4px; flex-direction: column; gap: 3px; }
  .step-tab span { width: 29px; height: 29px; }
  .step-tab strong { font-size: .78rem; }
  .step-panel, .recent-section { padding: 20px 15px; border-radius: 14px; }
  .section-heading { gap: 9px; }
  .step-number { padding: 4px 8px; }
  .document-list, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .document-card { min-height: 100px; padding: 14px 14px 42px; }
  .step-actions, .final-actions { display: grid; grid-template-columns: 1fr; }
  .step-actions .button, .final-actions .button { width: 100%; }
  .step-actions .primary, .final-actions .primary { order: -1; }
  .people-summary { grid-template-columns: 1fr; }
  .preview-title-row { flex-direction: column; }
  .download-card { flex-direction: column; }
  .download-primary { width: 100%; }
  .main-downloads, .rare-document-list { grid-template-columns: 1fr; }
  .history-card { align-items: stretch; flex-direction: column; }
  .history-download { width: 100%; }
  .time-range { grid-template-columns: 1fr; }
  .time-range p { grid-column: auto; }
  .question-heading-row, .official-preview-heading { flex-direction: column; }
  .sample-button { width: 100%; }
  .official-pdf-frame { height: 480px; }
  .official-preview-actions, .sample-dialog-actions, .sample-identity { grid-template-columns: 1fr; }
  .sample-dialog-header, .sample-body, .sample-dialog-actions { padding-left: 16px; padding-right: 16px; }
  .sample-paper { min-height: 0; padding: 30px 16px 24px; }
  .sample-paper-header h3 { font-size: 1.25rem; }
  .sample-paper-meta th, .sample-paper-meta td { padding: 8px 7px; font-size: .82rem; }
  .sample-row { grid-template-columns: 112px 1fr; }
  .sample-row dt, .sample-row dd { padding: 10px 9px; }
  .sample-paper-signature { grid-template-columns: 1fr; }
  .sample-paper-signature span:last-child { grid-column: auto; }
}

/* 2026-07-18: 제목과 기능 배지를 서로 다른 행에 두어 겹침을 방지합니다. */
.header-inner {
  min-height: 286px;
  grid-template-rows: auto auto;
  align-content: stretch;
}
.header-copy-block { grid-column: 1; grid-row: 1; align-self: start; }
.header-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: start;
  margin: 14px 0 0;
  max-width: 100%;
}
.header-art {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.55) 16%, #000 32%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.55) 16%, #000 32%, #000 100%);
}
.brand-lockup,.brand-logo{background-color:transparent}
.brand-logo{background:#62564d}
@media(max-width:900px){
  .header-inner{min-height:330px;grid-template-rows:auto auto}
  .header-actions{grid-column:1;grid-row:2;align-self:end;margin:12px 0 0}
}
@media(max-width:760px){
  .header-inner{min-height:310px}
  .header-actions{grid-row:2;align-self:start;margin-top:12px}
  .header-art{-webkit-mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.45) 24%,#000 52%);mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.45) 24%,#000 52%)}
  button,input,select,summary,.card-sample-button,.history-download,.text-button{min-height:44px}
}

/* 작은 휴대폰: 글씨는 유지하고 장식·여백만 줄입니다. */
@media (max-width: 480px) {
  :root { font-size: 16.5px; }
  h1 { font-size: 2rem; }
  .header-inner { min-height: 320px; }
  .header-art { right: -8px; width: 400px; }
  .header-art img { height: 175px; }
  .step-panel[data-step="1"]::before { width: 300px; height: 150px; opacity: .1; }
  .step-tab strong { font-size: .72rem; }
  .step-tab span { width: 27px; height: 27px; }
  .step-panel, .recent-section { margin-top: 14px; padding: 18px 13px; }
  .card { padding: 17px 14px; }
  .document-card { padding: 13px 12px 42px; }
  .official-form-preview { padding: 14px 12px; }
  .official-pdf-frame { height: 390px; }
}

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

.session-locked{position:relative}.session-locked:after{content:"로그인 정보에서 자동 입력";display:block;margin-top:5px;color:#567166;font-size:.92rem;font-weight:750}.session-locked input,.session-locked select{background:#f3f6f4!important;color:#344b43!important;opacity:1!important}

@media print {
  .site-header, .steps, .step-actions, .final-actions, .recent-section, footer { display: none !important; }
  .page-shell, .step-panel { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
}
