:root {
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #111827;
  background: #fbfbfd;
  font-synthesis: none;
  --navy: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #fff;
  --soft: #f4f3ff;
  --primary: #6375f4;
  --primary-dark: #4c5ed7;
  --focus: #6375f4;
  --danger: #b43c4d;
  --footer: #11172b;
  --shadow: 0 18px 45px rgba(62, 72, 130, .12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--surface); color: var(--text); line-height: 1.65; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.container { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: -70px; left: 14px; padding: 10px 14px; border: 2px solid var(--navy); background: #fff; font-weight: 800; }
.skip-link:focus { top: 12px; }
.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; }
.eyebrow { margin: 0 0 7px; color: #596bea; font-size: .78rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, strong { color: var(--navy); }

.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid #ececf2; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 16px rgba(30, 41, 59, .04); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; }
.brand strong { font-size: 1.24rem; font-weight: 900; line-height: 1; letter-spacing: -.045em; }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.site-header nav a { padding: 8px 10px; border-radius: 7px; color: #475569; font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-header nav a:hover { background: #f3f2ff; color: #4657d2; }

.hero { padding: 68px 0 34px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(2.55rem, 8vw, 4.3rem); line-height: 1.08; letter-spacing: -.06em; }
.hero p:last-child { max-width: 680px; margin: 16px auto 0; color: var(--muted); font-size: 1.04rem; }
.tool-section { padding: 22px 0 78px; }
.tool-shell { padding: 28px; border: 1px solid #e3e4ed; border-radius: 22px; background: #f8f8fc; box-shadow: 0 12px 38px rgba(40, 48, 91, .07); }

.drop-zone { display: grid; min-height: 230px; place-items: center; padding: 28px; border: 2px dashed #c9ccef; border-radius: 16px; background: #fff; text-align: center; transition: border-color .2s, background .2s; }
.drop-zone.is-dragging { border-color: var(--primary); background: #f2f3ff; }
.drop-zone.is-busy { opacity: .62; pointer-events: none; }
.drop-zone-inner { display: grid; justify-items: center; }
.drop-icon { display: grid; width: 54px; height: 64px; place-items: center; margin-bottom: 14px; border: 2px solid #b7bcf5; border-radius: 8px; background: #f2f3ff; color: #4c5ed7; font-size: .82rem; font-weight: 900; }
.drop-copy strong { font-size: 1.18rem; }
.drop-copy p { margin: 5px 0 16px; color: var(--muted); font-size: .9rem; }
.drop-zone.has-pages { min-height: 0; padding: 18px 20px; text-align: left; }
.drop-zone.has-pages .drop-zone-inner { width: 100%; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; justify-items: stretch; }
.drop-zone.has-pages .drop-icon { width: 42px; height: 50px; margin: 0; font-size: .68rem; }
.drop-zone.has-pages .drop-copy p { margin: 1px 0 0; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: linear-gradient(135deg, #7b6ff0, #4f72ea); color: #fff; }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #6f63e2, #4565d9); }
.button-secondary { border-color: #dfe1ea; background: #fff; color: var(--navy); }
.button-secondary:hover:not(:disabled) { background: #f5f5fa; }
.button:disabled { cursor: not-allowed; opacity: .46; }

.editor { margin-top: 20px; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.editor-heading strong { font-size: 1.2rem; }
.editor-heading p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 11px; border: 1px solid #e1e3ef; border-radius: 12px; background: #fff; }
.select-all { display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: .86rem; font-weight: 800; cursor: pointer; }
.select-all input, .page-select input { width: 17px; height: 17px; accent-color: var(--primary); }
.selection-count { color: var(--muted); font-size: .82rem; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.selection-actions button { min-height: 36px; padding: 6px 10px; border: 1px solid #dfe1ea; border-radius: 7px; background: #fff; color: #46516c; font-size: .78rem; font-weight: 800; cursor: pointer; }
.selection-actions button:hover:not(:disabled) { border-color: #b9befb; background: #f4f4ff; }
.selection-actions button.danger { color: var(--danger); }
.selection-actions button:disabled { cursor: not-allowed; opacity: .38; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; margin-top: 14px; }
.page-card { display: flex; min-width: 0; flex-direction: column; padding: 12px; border: 1px solid #e0e2eb; border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(40, 48, 91, .04); cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s; }
.page-card:hover { border-color: #bfc4f7; box-shadow: 0 9px 24px rgba(67, 76, 145, .09); }
.page-card.is-selected { border-color: #8d98f5; box-shadow: 0 0 0 2px #e6e8ff; }
.page-card.is-dragging { opacity: .45; transform: scale(.98); }
.page-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-select { display: inline-flex; align-items: center; gap: 6px; color: #3e4863; font-size: .78rem; font-weight: 850; cursor: pointer; }
.drag-hint { color: #8a90a1; font-size: .68rem; }
.page-preview { display: grid; height: 238px; place-items: center; margin-top: 9px; overflow: hidden; border: 1px solid #e6e7ed; border-radius: 9px; background: #eef0f5; }
.page-preview.thumbnail-error::after { content: "미리보기를 만들지 못했습니다"; padding: 20px; color: var(--muted); font-size: .76rem; text-align: center; }
.page-thumbnail { display: block; max-width: 180px; max-height: 215px; border: 1px solid #d6d8df; background: #fff; box-shadow: 0 4px 11px rgba(30, 35, 52, .13); transition: transform .18s; }
.page-info { display: grid; min-width: 0; margin-top: 10px; }
.page-info strong { font-size: .92rem; }
.page-info small { overflow: hidden; color: var(--muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.page-actions { display: grid; grid-template-columns: repeat(4, minmax(34px, 1fr)) auto; gap: 5px; margin-top: 9px; }
.page-action { min-width: 0; min-height: 35px; padding: 4px 7px; border: 1px solid #dfe1ea; border-radius: 7px; background: #fff; color: #46516c; font-size: .79rem; font-weight: 850; cursor: pointer; }
.page-action:hover:not(:disabled) { border-color: #b9befb; background: #f4f4ff; }
.page-action-remove { color: var(--danger); }
.page-action:disabled { cursor: not-allowed; opacity: .32; }

.empty-state { margin: 14px 0 0; padding: 24px; border: 1px solid #e5e6ee; border-radius: 12px; background: #fff; color: var(--muted); text-align: center; font-size: .9rem; }
.tool-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.status { margin: 13px 0 0; color: #4f5871; font-size: .88rem; }
.result-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 18px; padding: 22px; border: 1px solid #cfd3fb; border-radius: 15px; background: #f1f2ff; }
.result-panel h2 { margin: 0; font-size: 1.2rem; }
.result-panel p { margin: 3px 0 0; color: #5c6581; font-size: .88rem; }

.feature-section, .info-section, .faq-section { padding: 76px 0; border-top: 1px solid #ececf2; }
.feature-section h2, .info-section h2, .faq-section h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.2rem); letter-spacing: -.04em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.feature-grid article { min-height: 145px; padding: 22px; border: 1px solid #e6e6ef; border-radius: 15px; background: #fff; }
.feature-grid strong { font-size: 1.03rem; }
.feature-grid p { margin: 7px 0 0; color: var(--muted); font-size: .88rem; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 28px 0 0; list-style: none; counter-reset: steps; }
.step-grid li { display: grid; gap: 8px; min-height: 150px; padding: 24px; border: 1px solid #e6e6ef; border-radius: 16px; background: #fff; counter-increment: steps; }
.step-grid li::before { content: counter(steps); display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #eef0ff; color: #4c5ed7; font-size: .82rem; font-weight: 900; }
.step-grid strong { font-size: 1.04rem; }
.step-grid span { color: var(--muted); font-size: .9rem; }
.use-card { margin-top: 14px; padding: 20px 22px; border: 1px solid #dfe1fb; border-radius: 14px; background: #f7f7ff; }
.use-card p { margin: 5px 0 0; color: #596179; font-size: .9rem; }
.faq-list { display: grid; gap: 10px; margin-top: 28px; }
.faq-list details { border: 1px solid #e6e6ef; border-radius: 12px; background: #fff; }
.faq-list summary { padding: 17px 19px; color: var(--navy); font-weight: 800; cursor: pointer; }
.faq-list p { margin: 0; padding: 0 19px 18px; color: var(--muted); }
.ad-slot { min-height: 90px; margin-block: 24px; }

.site-footer { border-top: 1px solid var(--line); background: var(--footer); color: #dce1f2; padding: 38px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.footer-inner strong { color: #fff; }
.footer-inner p { margin: 5px 0; color: #aeb6ce; font-size: .86rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-inner a { color: #dce1f2; font-size: .84rem; }
.footer-inner small { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid #323a55; color: #909ab8; }
.consent { position: fixed; z-index: 40; right: 18px; bottom: 18px; width: min(470px, calc(100% - 36px)); padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.consent p { margin: 0 0 13px; font-size: .9rem; }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; }
.consent button { min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--navy); font-weight: 800; cursor: pointer; }
.consent button:last-child { border-color: var(--primary); background: var(--primary); color: #fff; }

.policy-shell { width: min(800px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 82px; }
.policy-shell h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -.045em; }
.policy-shell h2 { margin: 34px 0 9px; font-size: 1.25rem; }
.policy-shell p, .policy-shell li { color: #4b5563; }
.policy-meta { color: var(--muted); font-size: .86rem; }
.contact-card { margin-top: 30px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.contact-card a { color: var(--primary-dark); font-weight: 800; }
.not-found { display: grid; min-height: 70vh; place-items: center; padding: 24px; text-align: center; }
.not-found div { max-width: 560px; }
.not-found h1 { margin: 4px 0; font-size: clamp(2rem, 7vw, 3.5rem); }
.not-found p { color: var(--muted); }

@media (max-width: 820px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .step-grid { grid-template-columns: 1fr; }
  .step-grid li { min-height: 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner small { grid-column: auto; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 22px, 1120px); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 7px; padding-block: 11px; }
  .brand-mark { width: 32px; height: 32px; }
  .site-header nav { width: 100%; overflow-x: auto; }
  .site-header nav a { white-space: nowrap; }
  .hero { padding-top: 48px; }
  .tool-shell { padding: 11px; }
  .drop-zone { min-height: 190px; padding: 20px 12px; }
  .drop-zone.has-pages { padding: 13px; }
  .drop-zone.has-pages .drop-zone-inner { grid-template-columns: 40px minmax(0, 1fr); }
  .drop-zone.has-pages .button { grid-column: 1 / -1; width: 100%; }
  .editor-heading { align-items: flex-start; flex-direction: column; }
  .editor-heading .button { width: 100%; }
  .selection-toolbar { align-items: flex-start; }
  .selection-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; margin-left: 0; }
  .selection-actions button { min-width: 0; }
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .page-preview { height: 270px; }
  .page-thumbnail { max-width: 195px; max-height: 245px; }
  .tool-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tool-actions .button { width: 100%; }
  .tool-actions .button-primary { grid-column: 1 / -1; }
  .result-panel { align-items: stretch; flex-direction: column; }
  .result-panel .button { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 0; }
  .feature-section, .info-section, .faq-section, .tool-section { padding-bottom: 56px; }
  .footer-inner nav { flex-direction: column; gap: 7px; }
  .consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .consent button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
