:root {
  color-scheme: light dark;
  --bg: #0b1020;
  --surface: #121a2f;
  --surface-strong: #18223d;
  --text: #edf2ff;
  --muted: #aeb9d5;
  --line: #2a385f;
  --primary: #7da2ff;
  --primary-strong: #9bb7ff;
  --success: #67d7a1;
  --danger: #ff8b96;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(125, 162, 255, 0.18), transparent 32rem),
    var(--bg);
}

button,
input { font: inherit; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header { padding: 54px 0 32px; }

.header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(18, 26, 47, 0.82);
  font-size: 0.82rem;
  white-space: nowrap;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.62fr);
  align-items: start;
  gap: 20px;
  padding-bottom: 30px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 26, 47, 0.9);
  box-shadow: var(--shadow);
}

.builder-panel,
.workflow-panel { padding: 24px; }

.section-heading { margin-bottom: 18px; }

.design-picker {
  display: grid;
  margin: 0 0 30px;
  padding: 0;
  border: 0;
  gap: 14px;
}

.design-option {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: rgba(125, 162, 255, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.design-option:hover {
  border-color: #50699f;
  transform: translateY(-1px);
}

.design-option.is-selected {
  border-color: var(--primary);
  background: rgba(125, 162, 255, 0.11);
}

.design-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.design-option:focus-within {
  outline: 3px solid rgba(125, 162, 255, 0.34);
  outline-offset: 3px;
}

.design-thumbnail {
  position: relative;
  display: grid;
  min-height: 108px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: #f5f7fb;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.thumbnail-classic .thumbnail-hero {
  height: 40px;
  background: linear-gradient(135deg, #172554, #3459d1);
}

.thumbnail-classic .thumbnail-summary {
  height: 20px;
  background: #edf1ff;
}

.thumbnail-lines {
  margin: 10px 12px 12px;
  background: repeating-linear-gradient(to bottom, #cbd3e2 0 3px, transparent 3px 10px);
}

.thumbnail-enhanced {
  grid-template-columns: 27px 1fr;
  background: #eef2f7;
}

.thumbnail-sidebar { background: #172033; }

.thumbnail-page {
  display: grid;
  grid-template-rows: 43px 18px 1fr;
}

.thumbnail-enhanced .thumbnail-hero {
  background: linear-gradient(135deg, #0f2a55, #2862c7);
}

.thumbnail-tags {
  margin: 5px 8px;
  background: repeating-linear-gradient(90deg, #dbe7ff 0 20px, transparent 20px 25px);
}

.thumbnail-enhanced .thumbnail-lines { margin-top: 7px; }

.thumbnail-editorial {
  display: block;
  padding: 10px 12px;
  background: #f7f4ef;
}

.thumbnail-masthead {
  display: block;
  height: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #c8bfae;
}

.thumbnail-editorial-title {
  display: block;
  width: 72%;
  height: 20px;
  margin-bottom: 8px;
  background: #2d2118;
}

.thumbnail-editorial-rule {
  display: block;
  width: 34%;
  height: 3px;
  margin-bottom: 14px;
  background: #b5451b;
}

.thumbnail-columns {
  display: block;
  height: 44px;
  background:
    repeating-linear-gradient(to bottom, #b9afa2 0 2px, transparent 2px 7px),
    linear-gradient(90deg, transparent 48%, #e0d9cc 48% 52%, transparent 52%);
}

.design-copy { min-width: 0; }

.design-name {
  display: block;
  margin-bottom: 6px;
  font-size: 1.06rem;
  font-weight: 850;
}

.design-description {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.selection-badge {
  align-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  color: #061b12;
  background: var(--success);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-2px);
}

.design-option.is-selected .selection-badge { opacity: 1; }

.import-heading { margin-bottom: 16px; }

.drop-zone {
  display: flex;
  min-height: 210px;
  margin-bottom: 16px;
  padding: 28px;
  border: 1.5px dashed #50699f;
  border-radius: 15px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: rgba(125, 162, 255, 0.06);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--primary);
  background: rgba(125, 162, 255, 0.12);
  transform: translateY(-1px);
}

.drop-zone:focus-within {
  outline: 3px solid rgba(125, 162, 255, 0.28);
  outline-offset: 3px;
}

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 50%;
  place-items: center;
  color: #081126;
  background: var(--primary);
  font-size: 1.7rem;
  font-weight: 900;
}

.drop-title {
  margin-bottom: 8px;
  font-size: 1.08rem;
  font-weight: 800;
}

.drop-help {
  max-width: 460px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, border-color 140ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }

.button:focus-visible {
  outline: 3px solid rgba(125, 162, 255, 0.36);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  min-width: 120px;
  color: #071023;
  background: var(--primary);
}

.button-secondary {
  min-width: 120px;
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-strong);
}

.preview-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.status-neutral { color: var(--muted); }

.status-success {
  border-color: rgba(103, 215, 161, 0.45);
  color: var(--success);
  background: rgba(103, 215, 161, 0.08);
}

.status-error {
  border-color: rgba(255, 139, 150, 0.5);
  color: var(--danger);
  background: rgba(255, 139, 150, 0.08);
}

.document-details {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.document-details h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.document-details dl {
  display: grid;
  margin: 0;
  gap: 8px;
}

.document-details dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.document-details dt { color: var(--muted); }

.document-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.workflow-panel {
  position: sticky;
  top: 20px;
}

.workflow-list {
  margin: 18px 0 0;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.workflow-list li + li { margin-top: 8px; }

.example-note {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(125, 162, 255, 0.06);
  font-size: 0.9rem;
  line-height: 1.5;
}

.example-note strong { color: var(--text); }

.site-footer {
  padding: 12px 0 36px;
  color: var(--muted);
  font-size: 0.88rem;
}

.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;
}

@media (max-width: 860px) {
  .header-content { align-items: stretch; flex-direction: column; }
  .version-badge { width: fit-content; }
  .app-layout { grid-template-columns: 1fr; }
  .workflow-panel { position: static; }
}

@media (max-width: 650px) {
  .shell { width: min(100% - 20px, 1120px); }
  .site-header { padding-top: 34px; }
  .builder-panel,
  .workflow-panel { padding: 18px; }
  .design-option { grid-template-columns: 1fr; }
  .design-thumbnail { min-height: 140px; }
  .selection-badge { justify-self: start; }
  .button-row .button { width: 100%; }
}

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