:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-elev: #0f1520;
  --bg-elev-2: #131c2a;
  --surface: #0a0f18;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --text-muted: #6a7582;
  --edge: rgba(255, 255, 255, 0.08);
  --edge-strong: rgba(255, 255, 255, 0.16);
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.14);
  --accent-strong: #79b8ff;
  --green: #39d353;
  --green-soft: rgba(57, 211, 83, 0.14);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.12);
  --amber: #f5a524;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  background:
    radial-gradient(1100px 550px at 85% -10%, rgba(88, 166, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(57, 211, 83, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

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

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

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--edge);
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-mark {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-accent {
  color: var(--accent);
  animation: caret 1.05s steps(2) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.brand-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.topbar-link:hover {
  color: var(--text);
  border-color: var(--edge-strong);
}

/* Health pill */
.health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: var(--bg-elev);
}

.health-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.health-online {
  color: var(--text);
}
.health-online .health-dot-indicator {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.health-offline .health-dot-indicator {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

/* Layout */
.app-grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: block;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
}

.panel-form {
  padding: 28px;
}

/* Intro */
.form-intro h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  font-weight: 600;
}

.form-intro p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 62ch;
}

/* Step fieldset */
.step {
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  margin: 0 0 14px;
  padding: 20px 20px 18px;
  position: relative;
}

.step-hero {
  border-color: rgba(88, 166, 255, 0.35);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.06), transparent 70%), var(--surface);
}

.step-legend {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.step-index {
  color: var(--accent);
  font-weight: 600;
}

.step-title {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.step-hint {
  color: var(--text-muted);
  font-weight: 400;
}

/* Fields */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.field {
  display: block;
  margin: 0 0 10px;
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: lowercase;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

/* Buttons */
button {
  font: inherit;
  cursor: pointer;
}

.btn-ghost {
  padding: 9px 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-link {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-color: var(--edge-strong);
  text-underline-offset: 3px;
}
.btn-link:hover {
  color: var(--accent);
}

/* Repo row */
.repo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.repo-row input {
  font-family: var(--mono);
  font-size: 13px;
}

.repo-row .btn-ghost {
  padding: 0 18px;
}

.repo-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repo-list:empty {
  display: none;
}

.repo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
}

.repo-chip button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.repo-chip button:hover {
  color: var(--red);
}

/* GitHub preview */
.github-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg-elev-2);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
}

.gh-preview-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
}

.gh-preview-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--bg-elev);
  object-fit: cover;
}

.gh-preview-body {
  min-width: 0;
}

.gh-preview-title {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  margin: 0;
}

.gh-preview-summary {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 10px;
}

.gh-preview-repos {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gh-preview-repo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--surface);
}

.gh-preview-repo-name {
  color: var(--accent);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-preview-repo-meta {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.gh-preview-language-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 1px dashed var(--edge-strong);
  border-radius: 10px;
  padding: 22px 18px;
  background: var(--bg-elev-2);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.04);
  outline: none;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.dropzone-text strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.dropzone-text span {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chip-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-list:empty {
  display: none;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
}

.file-chip .file-size {
  color: var(--text-muted);
}

.file-chip button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.file-chip button:hover {
  color: var(--red);
}

/* Avatar */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-drop {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px dashed var(--edge-strong);
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
  position: relative;
  overflow: hidden;
  color: var(--text-muted);
}
.avatar-drop:hover,
.avatar-drop:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.avatar-filename {
  font-size: 12px;
}

/* Segmented */
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg-elev-2);
  margin-bottom: 14px;
}

.seg {
  position: relative;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg input:checked + span {
  background: var(--accent-soft);
  color: var(--accent);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Template picker */
.template-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

@media (min-width: 1280px) {
  .template-picker {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tpl-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.tpl-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tpl-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg-elev-2);
  transition: border-color 0.12s ease, background 0.12s ease;
  height: 100%;
}

.tpl-card:hover .tpl-inner {
  border-color: var(--edge-strong);
}

.tpl-card input:checked + .tpl-inner {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.tpl-card input:focus-visible + .tpl-inner {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tpl-swatch {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 4px;
}

/* Editorial — warm cream, serif display, burnt sienna rule */
.tpl-swatch-editorial {
  background: #f6f1e6;
  color: #2a1a0c;
  border: 1px solid #e3d8c0;
  padding: 10px 11px;
}
.tpl-swatch-editorial .mock-eyebrow {
  font-family: "Georgia", "Times New Roman", serif;
  font-style: italic;
  font-size: 6px;
  letter-spacing: 0.18em;
  color: #9c3b0b;
  text-transform: uppercase;
}
.tpl-swatch-editorial .mock-display {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  color: #2a1a0c;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.tpl-swatch-editorial .mock-rule {
  display: block;
  width: 22px;
  height: 2px;
  background: #9c3b0b;
  margin: 5px 0 3px;
}
.tpl-swatch-editorial .mock-small-caps {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 6.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9c3b0b;
  margin-bottom: 4px;
}
.tpl-swatch-editorial .mock-body {
  display: block;
  height: 2px;
  background: rgba(42, 26, 12, 0.35);
  border-radius: 1px;
  margin-top: 3px;
}
.tpl-swatch-editorial .mock-body.short {
  width: 60%;
}

/* Cobalt — blue dossier, chapter markers, content grid */
.tpl-swatch-cobalt {
  background: #ffffff;
  color: #0b2a6b;
  border: 1px solid #dce4fb;
}
.tpl-swatch-cobalt .cob-eyebrow {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.2em;
  color: #2152e4;
  font-weight: 600;
}
.tpl-swatch-cobalt .cob-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0b2a6b;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.tpl-swatch-cobalt .cob-rule {
  display: block;
  height: 1.5px;
  background: #2152e4;
  margin-top: 5px;
  width: 65%;
}
.tpl-swatch-cobalt .cob-tag {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: #2152e4;
  text-transform: uppercase;
  margin-top: 3px;
}
.tpl-swatch-cobalt .cob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 6px;
}
.tpl-swatch-cobalt .cob-cell {
  height: 12px;
  background: #eef2fc;
  border: 1px solid #d6dff9;
  border-radius: 2px;
}
.tpl-swatch-cobalt .cob-cell:nth-child(1) {
  background: #2152e4;
  border-color: #2152e4;
}

/* Aperture — two-column golden-ratio split, sage accent on warm off-white */
.tpl-swatch-aperture {
  background: #FBFAF7;
  color: #2a2924;
  border: 1px solid #e7e3d8;
  padding: 10px;
  display: grid;
  grid-template-columns: 38fr 62fr;
  gap: 8px;
}
.tpl-swatch-aperture .apr-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tpl-swatch-aperture .apr-col-left {
  border-right: 1px solid #e7e3d8;
  padding-right: 6px;
}
.tpl-swatch-aperture .apr-label {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 6px;
  letter-spacing: 0.22em;
  color: #5F7A65;
  text-transform: uppercase;
  font-weight: 600;
}
.tpl-swatch-aperture .apr-rule {
  display: block;
  height: 1px;
  width: 40%;
  background: #5F7A65;
  margin: 1px 0 2px;
}
.tpl-swatch-aperture .apr-name {
  font-family: "Georgia", serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.05;
  color: #2a2924;
  margin-top: 2px;
}
.tpl-swatch-aperture .apr-line {
  display: block;
  height: 1.5px;
  width: 75%;
  background: #d9d3c3;
  border-radius: 1px;
  margin-top: 3px;
}
.tpl-swatch-aperture .apr-line.short {
  width: 50%;
}
.tpl-swatch-aperture .apr-body {
  display: block;
  height: 2px;
  background: #d9d3c3;
  border-radius: 1px;
  margin-top: 3px;
}
.tpl-swatch-aperture .apr-body.short {
  width: 60%;
}

/* Meridian — monochrome single-column, ochre tenure rules in gutter */
.tpl-swatch-meridian {
  background: #ffffff;
  color: #0f0f0f;
  border: 1px solid #e6e6e6;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tpl-swatch-meridian .mer-name {
  font-family: "Georgia", serif;
  font-size: 12px;
  font-weight: 600;
  color: #0f0f0f;
  line-height: 1.1;
}
.tpl-swatch-meridian .mer-underline {
  display: block;
  height: 1.5px;
  width: 30%;
  background: #B48A3E;
  margin-top: 2px;
}
.tpl-swatch-meridian .mer-summary {
  display: block;
  height: 2px;
  background: #ececec;
  border-radius: 1px;
  margin-top: 4px;
}
.tpl-swatch-meridian .mer-summary.short {
  width: 65%;
}
.tpl-swatch-meridian .mer-section {
  font-family: "Georgia", serif;
  font-size: 6.5px;
  letter-spacing: 0.2em;
  color: #5a5a5a;
  text-transform: uppercase;
  margin-top: 6px;
  padding-top: 3px;
  border-top: 1px solid #ececec;
}
.tpl-swatch-meridian .mer-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.tpl-swatch-meridian .mer-rule {
  display: block;
  height: 1.5px;
  background: #B48A3E;
  border-radius: 1px;
}
.tpl-swatch-meridian .mer-rule.long {
  width: 100%;
}
.tpl-swatch-meridian .mer-rule.mid {
  width: 65%;
}
.tpl-swatch-meridian .mer-rule.short {
  width: 35%;
}
.tpl-swatch-meridian .mer-text {
  display: block;
  height: 2px;
  background: #ececec;
  border-radius: 1px;
}

/* Swiss — pure white, black hairlines, mono header, strict grid */
.tpl-swatch-swiss {
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #0a0a0a;
  padding: 0;
  gap: 0;
}
.tpl-swatch-swiss .sw-rule-top,
.tpl-swatch-swiss .sw-rule-bottom {
  display: block;
  height: 1px;
  background: #0a0a0a;
  margin: 0 10px;
}
.tpl-swatch-swiss .sw-rule-top {
  margin-top: 8px;
}
.tpl-swatch-swiss .sw-rule-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
}
.tpl-swatch-swiss .sw-meta {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 6px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0a0a0a;
}
.tpl-swatch-swiss .sw-heading {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  color: #0a0a0a;
  letter-spacing: -0.02em;
  padding: 6px 10px 0;
}
.tpl-swatch-swiss .sw-line {
  display: block;
  height: 1.5px;
  background: #0a0a0a;
  margin: 5px 10px 0;
  border-radius: 0;
}
.tpl-swatch-swiss .sw-line.short {
  width: calc(55% - 10px);
}

/* Dev — terminal mockup */
.tpl-swatch-dev {
  background: #0d1117;
  color: var(--green);
  border: 1px solid rgba(57, 211, 83, 0.35);
  padding: 0;
  gap: 0;
}
.tpl-swatch-dev .dev-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.tpl-swatch-dev .dev-bar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #484f58;
}
.tpl-swatch-dev .dev-bar-dot:nth-child(1) {
  background: #ff5f56;
}
.tpl-swatch-dev .dev-bar-dot:nth-child(2) {
  background: #ffbd2e;
}
.tpl-swatch-dev .dev-bar-dot:nth-child(3) {
  background: #27c93f;
}
.tpl-swatch-dev .dev-bar-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 6.5px;
  color: #8b949e;
  letter-spacing: 0.04em;
}
.tpl-swatch-dev .dev-line {
  display: block;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.4;
  padding: 0 8px;
  margin-top: 3px;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpl-swatch-dev .dev-line:first-of-type {
  margin-top: 5px;
}
.tpl-swatch-dev .dev-prompt {
  color: var(--green);
  margin-right: 4px;
}
.tpl-swatch-dev .dev-out {
  color: #8b949e;
}
.tpl-swatch-dev .dev-tag {
  display: inline-block;
  padding: 1px 4px;
  margin-right: 3px;
  border-radius: 2px;
  font-size: 6.5px;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
}
.tpl-swatch-dev .dev-tag:nth-child(2) {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(57, 211, 83, 0.3);
}
.tpl-swatch-dev .dev-tag:nth-child(3) {
  color: #f78166;
  background: rgba(247, 129, 102, 0.12);
  border-color: rgba(247, 129, 102, 0.35);
}

.template-hint {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding: 6px 10px;
  border: 1px dashed rgba(88, 166, 255, 0.35);
  border-radius: 6px;
  background: var(--accent-soft);
}

.tpl-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.tpl-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.tpl-card-dev {
  position: relative;
}

.tpl-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(57, 211, 83, 0.3);
}

/* Submit */
.submit-block {
  margin-top: 20px;
}

.primary {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--accent) 0%, #3d8bff 100%);
  color: #06101a;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: filter 0.12s ease, transform 0.06s ease;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.3), 0 8px 24px -10px rgba(88, 166, 255, 0.6);
}
.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}
.primary:active:not(:disabled) {
  transform: translateY(1px);
}
.primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.load-last-btn {
  width: 100%;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary[aria-busy="true"] .primary-arrow {
  animation: spin 1s linear infinite;
}

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

/* Progress */
.progress {
  list-style: none;
  padding: 14px 16px;
  margin: 14px 0 0;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--edge-strong);
  box-shadow: 0 0 0 2px transparent;
  flex-shrink: 0;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.progress-step.active {
  color: var(--accent);
  opacity: 1;
}
.progress-step.active .progress-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 1.1s ease-in-out infinite;
}

.progress-step.done {
  color: var(--green);
  opacity: 1;
}
.progress-step.done .progress-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: none;
}

.progress-step.failed {
  color: var(--red);
  opacity: 1;
}
.progress-step.failed .progress-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

.inline-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  background: var(--red-soft);
  color: var(--red);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
}

/* How it works */
.how-it-works {
  margin-top: 28px;
  border-top: 1px solid var(--edge);
  padding-top: 20px;
}

.how-it-works h2 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 500;
}

.how-it-works ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.how-it-works .mono {
  font-family: var(--mono);
  color: var(--accent);
  margin-right: 10px;
  font-size: 12px;
}

/* Preview panel */
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.preview-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.preview-header h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-sub {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.preview-frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 580px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-stage {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

#cv-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px;
  height: 1123px;
  border: 0;
  display: block;
  background: #fff;
  transform-origin: top left;
}

.preview-empty {
  position: absolute;
  inset: 0;
  background: var(--surface);
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.preview-empty[hidden] {
  display: none;
}

.preview-empty-mark {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--bg-elev-2);
}

.preview-empty p {
  margin: 0;
  font-size: 13px;
  max-width: 32ch;
}

/* Download row */
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 7px 14px;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.pill:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }
  .topbar-link {
    display: none;
  }
  .app-grid {
    padding: 16px;
  }
  .panel-form {
    padding: 18px;
  }
  .step {
    padding: 16px;
  }
  .form-intro h1 {
    font-size: 22px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .template-picker {
    grid-template-columns: 1fr 1fr;
  }
  .github-preview {
    grid-template-columns: 48px 1fr;
  }
  .gh-preview-avatar {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 420px) {
  .template-picker {
    grid-template-columns: 1fr;
  }
}

/* ───────────────────────────────────────────────────────────────────── */
/* Editor page                                                            */
/* ───────────────────────────────────────────────────────────────────── */

.brand-link {
  color: inherit;
  text-decoration: none;
  border: 0;
}
.brand-link:hover .brand-mark {
  color: var(--accent);
}

.editor-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--bg-elev);
}

.editor-grid {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: grid;
  grid-template-columns: minmax(360px, 600px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 16px;
  border-right: 1px solid var(--edge);
  margin-right: 4px;
}

.topbar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: lowercase;
}

.topbar-select {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  min-width: 160px;
  max-width: 240px;
  transition: border-color 0.12s ease;
}

.topbar-select:hover {
  border-color: var(--edge-strong);
}

.topbar-select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-ghost.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.editor-form-panel {
  padding: 22px 22px 30px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  position: sticky;
  top: 68px;
}

.editor-form-header h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.editor-form-sub {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.editor-loading {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px 0;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-section {
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.editor-section[open] {
  background: var(--bg-elev-2);
}

.section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-family: var(--mono);
  color: var(--text);
}

.section-summary::-webkit-details-marker {
  display: none;
}

.section-caret {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.12s ease;
  width: 10px;
}

.editor-section[open] > .section-summary .section-caret {
  transform: rotate(90deg);
  color: var(--accent);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.section-sub {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.section-body {
  padding: 6px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--edge);
}

.section-divider {
  height: 1px;
  background: var(--edge);
  margin: 10px 0;
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.field-narrow input {
  max-width: 80px;
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
}

.field-check input {
  width: auto;
  margin: 0;
}

.mono-input {
  font-family: var(--mono);
  font-size: 13px;
}

.string-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.string-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.row-remove {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--bg-elev-2);
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.row-remove:hover {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.35);
}

.object-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.object-list-entry {
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.object-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--edge);
}

.object-list-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.object-list-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-entry-btn {
  align-self: flex-start;
  padding: 6px 12px;
}

.template-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.template-radio {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.template-radio input {
  display: none;
}

.template-radio-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.template-radio-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.template-radio input:checked ~ .template-radio-title,
.template-radio input:checked + .template-radio-title {
  color: var(--accent);
}

.template-radio:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.photo-section {
  gap: 8px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--edge);
}

.photo-empty {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 14px;
  border: 1px dashed var(--edge-strong);
  border-radius: 8px;
}

/* Editor preview column */
.editor-preview-panel {
  padding: 14px;
  position: sticky;
  top: 68px;
  height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex: 0 0 auto;
}

.editor-preview-header h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.preview-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.entitlement-note {
  margin: -2px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}

.btn-secondary {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--bg-elev-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--edge-strong);
  background: var(--surface);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.job-match-card {
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
}

.job-match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-match-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.job-match-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.job-match-field {
  margin: 0;
}

.job-match-field textarea:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.job-match-status {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--edge);
  background: var(--bg-elev-2);
  color: var(--text-dim);
}

.job-match-status[data-state="success"] {
  color: var(--green);
  border-color: rgba(57, 211, 83, 0.24);
  background: var(--green-soft);
}

.job-match-status[data-state="working"] {
  color: var(--accent-strong);
  border-color: rgba(88, 166, 255, 0.24);
  background: var(--accent-soft);
}

.job-match-status[data-state="error"] {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.24);
  background: var(--red-soft);
}

.editor-preview-frame {
  flex: 1 1 auto;
  min-height: 0;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

@media (max-width: 1100px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-form-panel,
  .editor-preview-panel {
    position: static;
    max-height: none;
  }
  .editor-preview-frame {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .editor-grid {
    padding: 14px;
    gap: 14px;
  }
  .editor-form-panel {
    padding: 16px;
  }
  .editor-preview-panel {
    padding: 12px;
  }
  .field-grid-2,
  .field-grid-3,
  .template-radios {
    grid-template-columns: 1fr;
  }
  .preview-header-actions,
  .job-match-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ─────────────────────────────────────────── */
/* Pay button                                   */
/* ─────────────────────────────────────────── */

.btn-pay {
  padding: 9px 16px;
  background: linear-gradient(180deg, var(--accent) 0%, #3d8bff 100%);
  color: #06101a;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.3), 0 4px 16px -6px rgba(88, 166, 255, 0.55);
  white-space: nowrap;
}
.btn-pay:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-pay:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────── */
/* Download success banner                      */
/* ─────────────────────────────────────────── */

.download-success {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  background: var(--green-soft);
  border: 1px solid rgba(57, 211, 83, 0.25);
  border-radius: 8px;
  flex: 0 0 auto;
  margin: 0 0 4px;
}

.download-success[hidden] {
  display: none;
}

.download-success-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

.download-success-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.download-success-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.55;
}

.download-success-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ─────────────────────────────────────────── */
/* Payment modal                               */
/* ─────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  background: var(--bg-elev);
  border: 1px solid var(--edge-strong);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(88, 166, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.branch-version-sheet {
  max-width: 480px;
}

.modal-intro {
  margin-bottom: 24px;
}

.modal-title-main {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-help-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.modal-form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-actions-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--edge);
}

.modal-submit-btn {
  flex: 1;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--edge);
}

.modal-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.modal-brand-mark {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.modal-brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-body {
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-amount-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.modal-amount {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-amount-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.modal-features {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.modal-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.modal-feature-icon {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-divider {
  height: 1px;
  background: var(--edge);
  margin: 0 -20px;
}

.mock-card-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-payment-notice {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 6px;
  letter-spacing: 0.01em;
}

.modal-pay-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
}

.modal-footer {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--edge);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.modal-guarantee {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin: 0;
}

.modal-footer-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* ─────────────────────────────────────────── */
/* Pricing section                             */
/* ─────────────────────────────────────────── */

.pricing-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.pricing-card {
  background: var(--bg-elev);
  border: 1px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
}

.pricing-card-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pricing-title {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.02em;
}

.pricing-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.pricing-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.pricing-cadence {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pricing-features li span {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─────────────────────────────────────────── */
/* Footer / about section                      */
/* ─────────────────────────────────────────── */

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-section {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: start;
  padding: 24px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--edge);
  border-radius: 12px;
}

.about-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(88, 166, 255, 0.22) 100%);
  border: 1px solid rgba(88, 166, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-quote {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0;
  padding: 0;
  border: 0;
  font-style: italic;
}

.about-contact {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.footer-legal {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  padding: 0 0 8px;
}

@media (max-width: 560px) {
  .about-section {
    grid-template-columns: 1fr;
  }
  .about-avatar {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .pricing-card-body {
    padding: 18px 18px;
  }
  .pricing-price {
    font-size: 28px;
  }
}

.topbar-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.account-prompt-sheet {
  max-width: 34rem;
}

.account-prompt-copy h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
  line-height: 1.25;
}

.account-prompt-copy p {
  margin: 0;
  color: rgba(25, 31, 46, 0.74);
}

.account-prompt-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.account-prompt-link {
  text-decoration: none;
}

.branch-version-sheet {
  max-width: 42rem;
}

.branch-version-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth-shell,
.workspace-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.auth-panel,
.workspace-panel {
  padding: 1.5rem;
}

.auth-intro h1,
.workspace-intro h1 {
  margin: 0 0 0.5rem;
}

.auth-intro p,
.workspace-intro p {
  margin: 0;
  color: rgba(25, 31, 46, 0.72);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-card {
  padding: 1.25rem;
  border: 1px solid rgba(25, 31, 46, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 0.9rem;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.workspace-roots {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.workspace-root-card {
  border: 1px solid rgba(25, 31, 46, 0.1);
  border-radius: 1rem;
  padding: 1.1rem;
  background: rgba(255, 255, 255, 0.72);
}

.workspace-root-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.workspace-root-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.workspace-root-meta,
.workspace-version-meta,
.workspace-variant-empty {
  color: rgba(25, 31, 46, 0.64);
  font-size: 0.92rem;
}

.workspace-version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.workspace-version-card {
  padding: 0.95rem;
  border-radius: 0.9rem;
  background: rgba(250, 247, 243, 0.85);
  border: 1px solid rgba(25, 31, 46, 0.08);
}

.workspace-version-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.workspace-version-link,
.workspace-variant-link {
  color: inherit;
  text-decoration: none;
}

.workspace-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.workspace-variant-link {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(25, 31, 46, 0.08);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}
