/* Portfolio Builder — app chrome styles. See DESIGN.md for the token rationale. */

/**
 * Builder chrome tokens — light by default (matches the reference design:
 * near-monochrome white/black/gray, green reserved exclusively for status
 * dots like LIVE/Saved/Active), with a full dark variant under
 * [data-theme="dark"]. Which one applies on load is decided by
 * theme-init.js (inlined in <head>, before first paint, to avoid a flash
 * of the wrong theme) — it follows the OS preference unless the person
 * has manually toggled, in which case that choice is remembered.
 *
 * Portfolio templates (see templates.css) are a completely separate
 * palette system and are unaffected by any of this.
 */
:root {
  --paper: #F5F5F3;
  --surface: #FFFFFF;
  --surface-muted: #EFEFEC;
  --ink: #16181D;
  --ink-soft: #52565D;
  --line: #E3E2DE;
  --accent: #16181D;
  --accent-contrast: #FFFFFF;
  --live: #16A34A;
  --success: #16A34A;
  --error: #DC2626;

  --radius: 8px;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0B0D10;
  --surface: #16181D;
  --surface-muted: #1D2027;
  --ink: #F2F2F0;
  --ink-soft: #9BA0AA;
  --line: #2A2D33;
  --accent: #F2F2F0;
  --accent-contrast: #0B0D10;
  --live: #34D399;
  --success: #34D399;
  --error: #F87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---- Loading skeleton -----------------------------------------------------
   Doesn't make anything actually faster — Apps Script's own latency is the
   real floor — but a shimmering placeholder that roughly previews the
   coming layout reads as "working," not "stuck," during that wait. */

.skeleton-line {
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--line) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.4s ease-in-out infinite;
  border-radius: var(--radius);
  height: 14px;
  margin-bottom: 10px;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line { animation: none; background: var(--surface-muted); }
}

/* ---- Theme toggle button ------------------------------------------------ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---- Status dot / mono meta text ---------------------------------------- */

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 6px;
  vertical-align: 1px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Site topbar (landing page) ----------------------------------------- */

.site-topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
}

.site-topbar .brand {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
}

/* ---- Brand marks ----------------------------------------------------------
   Two distinct monograms, deliberately different shapes so "the product"
   and "the person who built it" never read as the same thing at a glance:
   .brand-mark (PB, rounded square) is the product identity, used in every
   topbar/rail. .creator-mark (LM, circle) is Lloyds Musau's identity, used
   only in the small creator-credit touches — footer, About panel. Both use
   theme-aware CSS variables (unlike favicon.svg, a separate file with no
   access to this page's CSS, which is fixed-color by necessity). */

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  margin-right: 8px;
}

.creator-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-tagline {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 2px 0 0 34px;
}

.version-badge {
  margin-left: 8px;
  font-size: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

.topbar-nav {
  display: flex;
  gap: 20px;
  flex: 1;
}

.topbar-nav a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
}

.topbar-nav a:hover { color: var(--ink); }

/* ---- Landing / hero ---------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 128px 0 76px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center -1px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

/* Anchored off to one corner, not a blob centered directly behind the
   headline — kept purely decorative (aria-hidden) and GPU-cheap: only
   transform/opacity animate, nothing that triggers layout or paint. */
.hero-glow {
  position: absolute;
  top: -220px;
  right: -180px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, var(--ink-soft) 0%, transparent 70%);
  opacity: 0.12;
  filter: blur(70px);
  pointer-events: none;
  animation: heroGlowDrift 12s ease-in-out infinite alternate;
}

@keyframes heroGlowDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-36px, 28px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
}

.hero .wrap { position: relative; z-index: 1; }

.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
  max-width: 1080px;
}

.hero-left h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.1;
  margin: 16px 0 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-left > p {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 28px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--surface);
}

/* ---- Preview document mockup card ---------------------------------------- */

.preview-doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  margin-bottom: 28px;
}

.preview-doc-head {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.preview-doc-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.preview-doc-body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.preview-doc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.preview-doc-name { font-weight: 600; font-size: 16px; margin: 0; }
.preview-doc-title { font-size: 13px; color: var(--ink-soft); margin: 2px 0 0; }

.preview-doc-block {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.preview-doc-label {
  font-size: 10px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.preview-doc-role { font-size: 13px; margin: 0; }
.preview-doc-role .mono { color: var(--ink-soft); }

.preview-doc-skills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Trust list + footer -------------------------------------------------- */

.trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.trust-list svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--success);
}

.trust-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.trust-footer-inner {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 11px;
  color: var(--ink-soft);
}

/* ---- Auth panel (now inline in hero-right) --------------------------- */

.hero-right {
  display: grid;
  gap: 0;
  position: sticky;
  top: 24px;
}

.panel-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.panel-head-row h2 { margin: 0; }

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-right { position: static; margin-top: 8px; }
}

@media (max-width: 640px) {
  .hero { padding: 88px 0 56px; }
  .hero-left h1 { font-size: 30px; }
  .hero-glow { width: 360px; height: 360px; top: -140px; right: -120px; }
  .topbar-nav { display: none; }
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.panel h2 {
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 4px;
}

.panel .sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 20px;
}

.about-panel .sub { margin-bottom: 10px; font-weight: 600; color: var(--ink); }

.about-blurb {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 16px;
}

.about-contact {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.about-contact a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: var(--surface-muted);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

button.primary {
  width: 100%;
  padding: 11px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

button.primary:hover { background: color-mix(in srgb, var(--accent) 82%, var(--ink)); }
button.primary:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

.toggle-row {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.toggle-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.status-msg {
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

.status-msg.error { color: var(--error); }
.status-msg.success { color: var(--success); }

.hidden { display: none !important; }

/* ---- Wizard / editor ----------------------------------------------------- */

.wizard-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 0;
}

.wizard-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wizard-header .brand {
  font-weight: 600;
  font-size: 15px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.step-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.step-pill.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 600;
}

.step-pill.active .status-dot { background: var(--accent-contrast); opacity: 0.6; }

.step-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.step-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.step-indicator {
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.step-content .step-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 28px;
}

/* ---- Card-style field sections (About step, Contact's profile half,
   Design step) — one continuous bordered card, thin dividers between
   each field group, tracked mono labels with an optional right-aligned
   tag, and an optional helper caption under the input. */

.editor-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 28px;
}

.editor-field-section {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.editor-field-section:last-child { border-bottom: none; }

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.field-helper {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

/* ---- Square avatar upload (About step) ----------------------------------- */

.avatar-upload-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.avatar-square {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-soft);
  overflow: hidden;
}

.avatar-square img { width: 100%; height: 100%; object-fit: cover; }

.avatar-actions { display: flex; gap: 8px; margin-bottom: 8px; }

.chip-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.chip-btn-dark { background: var(--accent); color: var(--accent-contrast); border: none; }
.chip-btn-light { background: none; color: var(--ink); border: 1px solid var(--line); }

.avatar-url-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-muted);
  margin-top: 2px;
}

.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: var(--surface-muted);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.field-check input { width: auto; }

.item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.item-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.item-status {
  font-size: 12px;
  color: var(--ink-soft);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--error);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.add-item-btn {
  background: none;
  border: 1px dashed var(--line);
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  padding: 12px;
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
}

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

.wizard-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 80px;
  border-top: 1px solid var(--line);
  max-width: 640px;
}

.wizard-footer button {
  padding: 10px 20px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.wizard-footer .btn-back {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
}

.wizard-footer .btn-next {
  background: var(--accent);
  border: none;
  color: var(--accent-contrast);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.template-option {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: var(--surface);
}

.template-option.selected { border-color: var(--accent); }
.template-option strong { display: block; font-size: 14px; margin-bottom: 4px; }
.template-option span { font-size: 12px; color: var(--ink-soft); }

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.swatch.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---- Dashboard ------------------------------------------------------------ */

.dash-shell {
  display: flex;
  min-height: 100vh;
}

.dash-rail {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
}

.dash-rail .brand {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 32px;
  display: block;
}

.dash-rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-rail nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.dash-rail nav button.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.dash-rail .logout-link {
  margin-top: auto;
  align-self: flex-start;
}

/* ---- Creator credit (rail footer) -----------------------------------------
   Deliberately small and last-in-flow — a signature, not a banner. Sits
   below Log out, so it's never the first or most prominent thing in the
   rail, and never competes with the actual nav items above it. */

.rail-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.rail-footer-product {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 2px;
}

.rail-footer-credit {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0;
}

.rail-footer-credit a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

.rail-footer-credit a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink-soft);
}

.dash-content {
  flex: 1;
  padding: 48px 40px;
  max-width: 760px;
}

.dash-content h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

.dash-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 28px;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.draft { background: var(--line); color: var(--ink-soft); }
.status-pill.published { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.summary-item .label {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.summary-item .value {
  font-size: 15px;
  font-weight: 600;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.action-row button {
  padding: 10px 18px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.action-row .btn-primary { background: var(--accent); border: none; color: var(--accent-contrast); }
.action-row .btn-secondary { background: none; border: 1px solid var(--line); color: var(--ink); transition: border-color 0.15s ease; }
.action-row .btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.action-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.checklist-heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.checklist-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.checklist li:last-child { border-bottom: none; }

.checklist .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}

.checklist li.done .dot { background: var(--success); }

.checklist a {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.stub-panel {
  padding: 8px 0 40px;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 46ch;
}

/* ---- Dashboard preview modal ---------------------------------------------- */

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 36, 44, 0.6);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.preview-modal-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-modal-tabs {
  display: flex;
  gap: 4px;
}

.preview-modal-tabs button {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.preview-modal-tabs button.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.preview-modal-close {
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
}

.preview-modal-close:hover {
  background: color-mix(in srgb, var(--ink) 82%, var(--paper));
}

.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 20px;
  display: flex;
  justify-content: center;
}

/* ---- Shared browser-chrome frame ------------------------------------------
   Used around both the dashboard's preview modal and the editor's live
   preview pane — a plain, generic browser-window convention (colored
   traffic-light dots + a fake URL bar), not tied to any specific browser
   or OS brand. Purely decorative realism; the actual content sits in the
   plain white card inside it. */

.browser-chrome {
  width: 100%;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  height: fit-content;
  transition: max-width 0.15s ease;
}

.browser-chrome-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #F0F0EE;
  border-bottom: 1px solid #E3E2DE;
}

.browser-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.browser-dot-red { background: #FF5F57; }
.browser-dot-yellow { background: #FEBC2E; }
.browser-dot-green { background: #28C840; }

.browser-url-bar {
  margin-left: 10px;
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #E3E2DE;
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6B7078;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-frame {
  background: #fff;
  padding: 40px;
  width: 100%;
}

.preview-modal.tablet-width .browser-chrome { max-width: 640px; }
.preview-modal.mobile-width .browser-chrome { max-width: 390px; }
.preview-modal.mobile-width .preview-modal-frame { padding: 28px 20px; }

/* Below 1024px (phone + tablet), the rail is fully replaced by the bottom
   tab bar — not reformatted into a horizontal strip. Desktop (>=1024px)
   keeps the rail and never shows the bottom bar. */

.bottom-tab-bar { display: none; }

@media (max-width: 1023px) {
  .dash-shell { flex-direction: column; }
  .dash-rail { display: none; }
  .dash-content { padding: 24px 16px 88px; }

  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-tab-bar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 10px 4px 8px;
    cursor: pointer;
    position: relative;
  }

  .bottom-tab-bar button svg { width: 20px; height: 20px; }
  .bottom-tab-bar button.active { color: var(--ink); }
}

@media (max-width: 640px) {
  .dash-content { padding: 20px 14px 88px; }
}

.nav-badge {
  display: none;
}

.nav-badge:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.nav-badge-tab:not(:empty) {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  margin-left: 0;
}

/* ---- Editor: split form/preview shell ------------------------------------ */

.editor-tabs {
  display: none;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.editor-tabs button {
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.editor-tabs button.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.editor-shell {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: none;
  padding: 0;
}

.editor-form-pane {
  flex: 0 0 42%;
  max-width: 640px;
  padding: 0 24px;
}

.editor-form-pane .step-content {
  padding-top: 40px;
}

.editor-preview-pane {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border-left: 1px solid var(--line);
  padding: 40px 32px;
  min-height: calc(100vh - 130px);
  position: sticky;
  top: 0;
}

.preview-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.preview-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  color: var(--ink-soft);
  margin: 0;
}

#editorBrowserChrome {
  max-width: 620px;
}

.editor-preview-pane.device-tablet #editorBrowserChrome { max-width: 500px; }
.editor-preview-pane.device-mobile #editorBrowserChrome { max-width: 340px; }

.preview-surface {
  background: #fff;
  padding: 36px;
  min-height: 400px;
}

.editor-preview-pane.device-mobile .preview-surface { padding: 24px 18px; }

.preview-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 12px 0 0;
}



@media (max-width: 900px) {
  .editor-tabs { display: flex; }
  .editor-shell { flex-direction: column; }
  .editor-form-pane { flex: 1 1 auto; max-width: none; width: 100%; }
  .editor-preview-pane { width: 100%; border-left: none; border-top: 1px solid var(--line); position: static; min-height: auto; }
  .editor-preview-pane.mobile-hidden,
  .editor-form-pane.mobile-hidden { display: none; }
}

/* ---- Enquiries panel ------------------------------------------------------ */

.enquiry-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}

.enquiry-tabs button {
  flex: 1;
  border: none;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px;
  cursor: pointer;
  border-right: 1px solid var(--line);
}

.enquiry-tabs button:last-child { border-right: none; }
.enquiry-tabs button.active { background: var(--accent); color: var(--accent-contrast); }
.enquiry-tabs button span { margin-left: 4px; font-weight: 400; }

.enquiry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  position: relative;
}

.enquiry-card.unread { border-left: 3px solid var(--ink); }

.enquiry-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.enquiry-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.enquiry-avatar.unread { background: var(--accent); color: var(--accent-contrast); }

.enquiry-card-head { flex: 1; min-width: 0; }

.enquiry-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.enquiry-name .status-dot { margin-left: 4px; margin-right: 0; }

.enquiry-email {
  color: var(--ink-soft);
  font-size: 12px;
  margin: 2px 0 0;
}

.enquiry-time {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.enquiry-subject {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 4px;
}

.enquiry-message {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.enquiry-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.enquiry-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
}

.enquiry-tag-inbound { background: var(--surface-muted); color: var(--ink); }
.enquiry-tag .status-dot { margin-right: 5px; }

.enquiry-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.enquiry-actions .chip-btn { padding: 6px 12px; font-size: 12px; }
.enquiry-actions .enquiry-action-error { flex-basis: 100%; margin-top: 6px; font-size: 12px; }

.relay-banner {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.relay-banner strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}

.relay-banner p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---- Support (Account panel) ---------------------------------------------- */

.support-history {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.support-history-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.support-history-empty {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.support-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.support-item:last-child { border-bottom: none; }

.support-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.support-item-time {
  font-size: 11px;
  color: var(--ink-soft);
}

.support-item-body {
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-item-status {
  font-size: 12px;
  color: var(--success);
  margin: 0;
}

.support-item-status.failed { color: var(--error); }
