:root {
  --bg: #ffffff;
  --fg: #1c2230;
  --muted: #5b6577;
  --border: #e6e8ee;
  --card: #f8f9fc;
  --accent: #5b5bd6;
  --accent-2: #8a63d2;
  --ink: #0e1320;
  --code-bg: #12151f;
  --code-fg: #e7ebf5;
  --radius: 14px;
  --maxw: 1020px;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --sans:
    system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.brand .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--fg);
  text-decoration: none;
}

/* Hero */
.hero {
  background:
    radial-gradient(
      1200px 500px at 80% -10%,
      rgba(138, 99, 210, 0.18),
      transparent
    ),
    radial-gradient(900px 500px at 0% 0%, rgba(91, 91, 214, 0.16), transparent);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 64px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #4a4ac4;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--fg);
  background: #fff;
}

.btn-ghost:hover {
  border-color: #c9cdda;
}

/* Code */
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0;
  box-shadow: 0 18px 40px -24px rgba(20, 20, 60, 0.5);
}

code {
  font-family: var(--mono);
}

:not(pre) > code {
  background: #eef0f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
}

.tok-key {
  color: #8fb6ff;
}
.tok-str {
  color: #b9e08a;
}
.tok-com {
  color: #6b7488;
}
.tok-cmd {
  color: #d7b3ff;
}

/* Sections */
section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}

.section-sub {
  color: var(--muted);
  margin: 0 0 34px;
  max-width: 60ch;
}

/* Two ways */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--card);
}

.panel h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: var(--ink);
}

.panel .tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.panel p {
  color: var(--muted);
  margin: 10px 0 0;
}

/* Feature cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #d3d7e4;
}

.card .ico {
  font-size: 1.4rem;
}

.card h4 {
  margin: 12px 0 6px;
  font-size: 1.02rem;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Pipeline */
.pipe {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.step {
  flex: 1 1 160px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--card);
}

.step b {
  color: var(--ink);
  display: block;
}

.step span {
  color: var(--muted);
  font-size: 0.9rem;
}

.step .mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* Previews */
.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--border);
}

.shot .cap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.shot .cap .mono {
  font-family: var(--mono);
  color: var(--muted);
}

/* Footer */
footer {
  padding: 40px 0 60px;
  color: var(--muted);
}

.foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .hero-grid,
  .duo,
  .shots,
  .compare {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    padding: 48px 0;
  }
  .nav-links .hide-sm {
    display: none;
  }
}

/* Comparison */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Code window chrome */
.win {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
  box-shadow: 0 18px 40px -24px rgba(20, 20, 60, 0.5);
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  background: #0a0d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dots {
  display: inline-flex;
  gap: 6px;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.dots i:nth-child(1) {
  background: #ff5f57;
}
.dots i:nth-child(2) {
  background: #febc2e;
}
.dots i:nth-child(3) {
  background: #28c840;
}

.win-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #8a93ad;
}

.win pre {
  border-radius: 0;
  box-shadow: none;
  border: none;
  margin: 0;
}

.copy-btn {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #aeb6cf;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

/* Hero run line */
.run {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 0.86rem;
  padding-left: 2px;
}

.run-cmd {
  color: var(--accent);
}

.run-out {
  color: var(--muted);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --fg: #e7ebf5;
    --muted: #9aa3bd;
    --border: #232a3b;
    --card: #161b27;
    --ink: #f4f6fc;
  }
  header {
    background: rgba(14, 19, 32, 0.82);
  }
  .card,
  .shot,
  .btn-ghost {
    background: #141a28;
  }
  .card:hover,
  .btn-ghost:hover {
    border-color: #39415a;
  }
  :not(pre) > code {
    background: #20273a;
  }
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chips span {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--card);
}

/* Accessibility / motion */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 5px;
}

section[id],
.hero {
  scroll-margin-top: 76px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card {
    transition: none;
  }
}

/* Embedded interactive demo */
.demo-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 30px 60px -30px rgba(20, 20, 60, 0.5);
}

.demo-topbar {
  background: #0a0d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-topbar .win-name {
  color: #8a93ad;
}

.demo-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #aeb6cf;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
}

.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 560px;
}

.demo-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.demo-col-edit {
  border-right: 1px solid var(--border);
}

.demo-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.demo-bar .win-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.exports {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.theme-select {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 8px;
  cursor: pointer;
}

.mini-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mini-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

#input-filename {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

#editor {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  outline: none;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  tab-size: 2;
}

.status {
  flex: 0 0 auto;
  max-height: 40%;
  overflow: auto;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}

.status.ok {
  color: #1a7f47;
}

.status.bad {
  color: #c0362c;
}

.status .errs {
  margin: 7px 0 0;
  padding-left: 18px;
}

.status .errs li {
  margin: 2px 0;
}

.status .errs code {
  background: rgba(192, 54, 44, 0.12);
  padding: 1px 5px;
  border-radius: 5px;
}

/* Both toolbars share the same shape so they line up across the split:
   a format-tabs row on top, then a controls row (filename/reset on the editor,
   theme/download on the preview). */
.demo-bar-edit,
.demo-bar-prev {
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.bar-controls {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* First item (filename / theme) stays left; the rest group to the right. */
.bar-controls > :first-child {
  margin-right: auto;
}

/* Segmented control: each tab swaps what the frame shows (no auto-download). */
.view-tabs {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.view-tab:hover {
  color: var(--fg);
}

.view-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.download-btn {
  margin-left: auto;
  font-weight: 600;
}

/* The frame holds one stacked view per format; only the active one shows. */
.preview-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.stage-view {
  position: absolute;
  inset: 0;
  display: none;
}

.stage-view.is-active {
  display: block;
}

.stage-view .preview-wrap {
  height: 100%;
}

#pdf-view {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}

.png-wrap {
  height: 100%;
  overflow: auto;
  background: #eef0f5;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#png-view,
#pdf-fallback-img {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 32px -16px rgba(20, 20, 60, 0.45);
}

.code-view {
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: 16px 18px;
  background: #0d1117;
  color: #e6edf3;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
  tab-size: 2;
}

/* Floating action over a code view (e.g. "Compile in Overleaf" on LaTeX). */
.stage-action {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(91, 91, 214, 0.9);
  transition: background 0.15s ease;
}
.stage-action:hover {
  background: #4a4ac4;
}

.stage-busy {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(238, 240, 245, 0.72);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.stage-busy[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.preview-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #eef0f5;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* The page is laid out at a fixed width (so the theme's two-column layout
   shows) and scaled to fit. .page-outer reserves the scaled footprint;
   .page-scale does the transform. */
.page-outer {
  position: relative;
  flex: 0 0 auto;
}

.page-scale {
  position: absolute;
  top: 0;
  left: 0;
  width: 820px;
  transform-origin: top left;
}

#preview {
  display: block;
  width: 820px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 32px -16px rgba(20, 20, 60, 0.45);
}

@media (prefers-color-scheme: dark) {
  .preview-wrap,
  .png-wrap {
    background: #0a0d16;
  }
  .stage-busy {
    background: rgba(10, 13, 22, 0.72);
  }
  .status.ok {
    color: #4ade80;
  }
  .status.bad {
    color: #f87171;
  }
}

@media (max-width: 820px) {
  .demo-split {
    grid-template-columns: 1fr;
    height: auto;
  }
  .demo-col-edit {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  #editor {
    min-height: 300px;
  }
  .preview-stage {
    min-height: 70vh;
  }
}

/* ---- Theme gallery (themes.html) ---- */
.themes-head {
  border-bottom: 1px solid var(--border);
}
.themes-head .section-sub {
  max-width: 60ch;
}

.theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 24px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.theme-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 22px 48px -26px rgba(20, 20, 60, 0.5);
}

/* Each preview is a real résumé page, cropped to a uniform portrait window. */
.theme-shot {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.theme-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}
.theme-card:hover .theme-shot img {
  transform: scale(1.03);
}

.theme-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
}
.theme-name {
  font-weight: 650;
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.theme-by {
  font-size: 0.78rem;
  color: var(--muted);
}

.theme-cta {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 5px 11px;
  opacity: 0;
  transform: translateY(-6px);
  box-shadow: 0 6px 16px -6px rgba(91, 91, 214, 0.7);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}
.theme-card:hover .theme-cta {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 560px) {
  .theme-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

/* ───────────────────────── Résumé wizard ───────────────────────── */
.wz-head {
  background:
    radial-gradient(
      1100px 420px at 85% -20%,
      rgba(138, 99, 210, 0.16),
      transparent
    ),
    radial-gradient(800px 420px at 0% 0%, rgba(91, 91, 214, 0.14), transparent);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 28px;
}
.wz-head .section-title,
.wz-head .section-sub {
  text-align: left;
  margin-left: 0;
}
.wz-head .section-sub {
  max-width: 640px;
}

.wz-section {
  padding: 28px 0 64px;
}
.wz-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 26px;
  align-items: start;
}

/* Form column */
.wz-form-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 20px 50px -34px rgba(20, 20, 60, 0.5);
}
.wz-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.wz-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.wz-step:hover {
  color: var(--fg);
  border-color: #c9cdda;
}
.wz-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.72rem;
}
.wz-step.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.wz-step.is-active .wz-step-n {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.wz-step.is-done .wz-step-n {
  background: #cfe8d8;
  color: #1c7a45;
}

.wz-form {
  padding: 22px 20px 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.wz-intro {
  margin-bottom: 16px;
}
.wz-title {
  font-size: 1.3rem;
  margin: 0 0 4px;
}
.wz-sub {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
}
.wz-subhead {
  font-size: 0.95rem;
  margin: 22px 0 2px;
}
.wz-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 10px;
}
.wz-empty {
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 4px;
}

.wz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.wz-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.wz-field.wz-wide {
  grid-column: 1 / -1;
}
.wz-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.wz-hint {
  font-style: normal;
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--muted);
}
.wz-input {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.wz-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.16);
}
textarea.wz-input {
  resize: vertical;
  line-height: 1.5;
}

/* Repeatable cards */
.wz-sub {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wz-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  padding: 12px 13px 14px;
}
.wz-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wz-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.wz-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.wz-remove:hover {
  color: #d23b3b;
  background: rgba(210, 59, 59, 0.1);
}
.wz-card .wz-grid {
  grid-template-columns: 1fr 1fr;
}
.wz-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  border: 1px dashed var(--border);
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.wz-add:hover {
  border-color: var(--accent);
  background: rgba(91, 91, 214, 0.05);
}
.wz-add-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
}

/* Footer nav */
.wz-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.wz-foot .btn {
  cursor: pointer;
}
.wz-status {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
}
.wz-status.ok {
  color: #1c7a45;
}
.wz-status.warn {
  color: #9a6a00;
}
.wz-status.bad {
  color: #c23b3b;
}
.wz-next.is-hidden,
#wz-next.is-hidden {
  visibility: hidden;
}

/* Finish step */
.wz-finish {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 4px;
}
.wz-finish .btn {
  cursor: pointer;
}
.wz-finish .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview column */
.wz-preview-col {
  position: sticky;
  top: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 50px -34px rgba(20, 20, 60, 0.5);
}
.wz-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  background: var(--ink);
  border-bottom: 1px solid #000;
}
.wz-preview-bar .win-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #aab2c5;
}
.wz-preview-bar .dots i {
  width: 11px;
  height: 11px;
}
.wz-preview-stage {
  height: calc(70vh + 12px);
  min-height: 460px;
}
.wz-preview-wrap {
  position: relative;
  height: 100%;
  overflow: auto;
  background: #eef0f5;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.wz-page-outer {
  position: relative;
  flex: 0 0 auto;
}
.wz-page-scale {
  position: absolute;
  top: 0;
  left: 0;
  width: 820px;
  transform-origin: top left;
}
#wz-preview {
  display: block;
  width: 820px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 32px -16px rgba(20, 20, 60, 0.45);
}
.wz-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}
.wz-preview-empty[hidden] {
  display: none;
}
.wz-preview-empty-ico {
  font-size: 2.4rem;
  margin-bottom: 6px;
}
.wz-preview-empty p {
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .wz-preview-wrap {
    background: #0a0d16;
  }
}

@media (max-width: 860px) {
  .wz-shell {
    grid-template-columns: 1fr;
  }
  .wz-preview-col {
    position: static;
    order: -1;
  }
  .wz-preview-stage {
    height: 52vh;
  }
  .wz-form {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .wz-grid,
  .wz-card .wz-grid {
    grid-template-columns: 1fr;
  }
}

/* ──────────────── Full-screen "Try it" editor (try.html) ──────────────── */
.try-main {
  height: calc(100dvh - 60px);
  padding: 14px 16px 16px;
  display: flex;
}
.demo-full {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}
.demo-full .demo-split {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* "Open full editor" / "Guided wizard" pill in a demo's dark title bar. */
.demo-expand {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #cdd4e6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.demo-expand:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 760px) {
  .try-main {
    height: auto;
    padding: 12px;
  }
  .demo-full .demo-split {
    height: auto;
  }
}

/* ──────────── Wizard: example/clear actions + Finish exports ──────────── */
.wz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px 0;
}
.wz-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px;
}
.wz-export {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.wz-export:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.wz-export-ico {
  color: var(--accent);
  font-weight: 700;
}
.wz-open {
  cursor: pointer;
  margin: 4px 0;
}

/* Page-break guides in the live preview — show where A4 pages split. */
.page-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.page-guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(91, 91, 214, 0.6);
}
.page-guide span {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-100%);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  color: #fff;
  background: rgba(91, 91, 214, 0.9);
  border-radius: 5px 5px 0 0;
  padding: 3px 8px;
}

/* "1 page" / "2 pages" indicator in the preview toolbar. */
.page-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.page-badge:empty {
  display: none;
}

/* "Featured" ribbon on gallery thumbnails. */
.theme-shot {
  position: relative;
}
.theme-star {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  padding: 3px 9px;
  box-shadow: 0 4px 12px -4px rgba(91, 91, 214, 0.7);
}

/* Download-only export panes (DOCX). */
.export-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 32px;
  background: #eef0f5;
}
.export-ico {
  font-size: 3rem;
}
.export-card h3 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}
.export-card p {
  max-width: 400px;
  color: var(--muted);
  margin: 0 0 10px;
}
.export-card .btn {
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .export-card {
    background: #0a0d16;
  }
}

/* Import-a-résumé dialog (GitHub gist / username / URL). */
.import-dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  max-width: 460px;
  width: calc(100vw - 40px);
  box-shadow: 0 30px 70px -30px rgba(20, 20, 60, 0.6);
  color: var(--fg);
}
.import-dialog::backdrop {
  background: rgba(14, 19, 32, 0.45);
}
.import-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.import-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
.import-status {
  min-height: 18px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}
.import-status.bad {
  color: #c23b3b;
}
.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.import-actions .btn {
  cursor: pointer;
}

/* Linter "Review" line under a valid status. */
.review {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(20, 30, 60, 0.16);
  color: var(--muted);
  font-weight: 400;
}
.review strong {
  color: var(--fg);
}
.review-list {
  margin-top: 5px;
}
.review-list li.lvl-warn {
  color: #9a6a00;
}
.review-list li.lvl-tip {
  color: var(--muted);
}
