/* ============================================================
   Dream Home Designer — component classes
   Ported from design_handoff_dream_home/styles.css.
   Token references rely on tokens.css (loaded first).
   ============================================================ */

/* Reset just enough for our scoped surfaces; we don't override the
   project's Bootstrap reset globally. */
.hd-scope { font-family: var(--font-ui); color: var(--text); background: var(--bg); }

/* ── Typography helpers ───────────────────────────────────────── */
.display        { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.display-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono           { font-family: var(--font-mono); font-feature-settings: 'ss01'; }
.eyebrow        { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-subtle); font-weight: 500; }
.tabular        { font-variant-numeric: tabular-nums; }

/* ── Button ───────────────────────────────────────────────────── */
.btn-hd {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}
.btn-hd:active            { transform: translateY(1px); }
.btn-hd-primary           { background: var(--primary); color: #fff; box-shadow: var(--shadow-clay); }
.btn-hd-primary:hover     { background: var(--primary-hover); color: #fff; }
.btn-hd-secondary         { background: var(--bg-elev); color: var(--text); border-color: var(--border-strong); }
.btn-hd-secondary:hover   { background: var(--cream-100); }
.btn-hd-ghost             { background: transparent; color: var(--text); }
.btn-hd-ghost:hover       { background: var(--cream-100); }
.btn-hd-dark              { background: var(--ink-900); color: var(--cream-50); }
.btn-hd-dark:hover        { background: var(--ink-800); color: var(--cream-50); }
.btn-hd-sm                { padding: 6px 10px; font-size: 12px; }
.btn-hd-lg                { padding: 12px 20px; font-size: 14px; }

/* ── Inputs ───────────────────────────────────────────────────── */
.input-hd, .textarea-hd, .select-hd {
  font-family: var(--font-ui);
  font-size: 13px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-hd:focus, .textarea-hd:focus, .select-hd:focus {
  border-color: var(--clay-400);
  box-shadow: 0 0 0 3px var(--clay-100);
}
.label-hd { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
/* Red asterisk used in labels next to required fields. */
.hd-field-required { color: var(--clay-600); margin-left: 2px; }
/* <select> styled like .input-hd. The browser default arrow is fine
   here; we just ensure padding-right leaves room for it. */
.hd-select { appearance: auto; padding-right: 28px; }
.hd-select:disabled, .input-hd:disabled {
  background: var(--cream-100);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Card ─────────────────────────────────────────────────────── */
.card-hd {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

/* ── Pill / Tag ───────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--cream-100);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill-clay  { background: var(--clay-100);  color: var(--clay-700);  border-color: var(--clay-200); }
.pill-olive { background: var(--olive-100); color: var(--olive-600); border-color: var(--olive-100); }
.pill-gold  { background: var(--gold-100);  color: var(--gold-500);  border-color: var(--gold-100); }
.pill-rose  { background: var(--rose-100);  color: var(--rose-500);  border-color: var(--rose-100); }
.pill-dark  { background: var(--ink-900);   color: var(--cream-50);  border-color: var(--ink-900); }

/* ── Status dots ─────────────────────────────────────────────── */
.dot       { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-live  { background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,0.18); animation: hd-pulse 2s infinite; }
.dot-warn  { background: var(--gold-500); }
.dot-error { background: var(--rose-500); }

@keyframes hd-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(76,175,80,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(76,175,80,0.06); }
}

/* ── Layout primitives ───────────────────────────────────────── */
.hd-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
  background: var(--cream-50);
}
.hd-shell > main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Contain content on large/ultrawide displays (17"+ / 1440px+) so the
     topbar and page content don't sprawl edge-to-edge. Centred within the
     1fr track; no effect below 1600px where 100% wins. */
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}

.hd-maintenance-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--gold-100);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--r-md);
  background: #fff8e6;
  color: var(--ink-800);
  font-size: 13px;
  line-height: 1.45;
}
.hd-maintenance-banner > svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--gold-500);
}
.hd-maintenance-banner strong {
  font-weight: 700;
}
.hd-maintenance-banner a {
  color: var(--clay-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 720px) {
  .hd-maintenance-banner {
    margin: 10px 12px 0;
  }
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.hd-sidebar {
  background: var(--cream-100);
  border-right: 1px solid var(--border);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.hd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 8px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.hd-brand-mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--ink-900); color: var(--cream-50);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hd-brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.hd-brand-name { font-size: 16px; letter-spacing: -0.01em; }
.hd-brand-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-subtle);
}

.hd-nav { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.hd-nav-section { display: flex; flex-direction: column; gap: 2px; }
.hd-nav-label {
  padding: 0 10px 4px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--text-subtle);
}
.hd-nav-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 7px 10px !important;
  border-radius: var(--r-md);
  color: var(--text-muted) !important;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}
.hd-nav-link:hover {
  background: var(--bg-elev);
  color: var(--text) !important;
}
.hd-nav-link.is-active {
  background: var(--clay-100);
  color: var(--clay-700) !important;
}
.hd-nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}

.hd-userbox {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-top: auto;
}
.hd-userbox-gear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--cream-50);
  color: var(--text-muted);
  text-decoration: none;
}
.hd-userbox-gear:hover { color: var(--text); border-color: var(--border-strong); }
.hd-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--clay-500);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.hd-userbox-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-userbox-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hd-userbox-sub {
  font-size: 10.5px; color: var(--text-subtle);
}

/* ── Topbar ──────────────────────────────────────────────────── */
.hd-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-wrap: wrap;
}
.hd-topbar-titleblock { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hd-crumb { display: inline-flex; align-items: center; gap: 6px; }
.hd-crumb-sep { opacity: 0.6; }
.hd-page-title {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
}
.hd-page-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.hd-topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-top: 4px;
}
.hd-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  background: var(--cream-100);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  min-width: 280px;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s;
}
.hd-search:focus-within {
  background: var(--bg-elev);
  border-color: var(--border-strong);
}
.hd-search input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  min-width: 0;
}
.hd-search input::placeholder { color: var(--text-subtle); }
.hd-search kbd {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-subtle);
}
.hd-icon-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-icon-btn:hover { background: var(--cream-100); color: var(--text); }
.hd-icon-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--clay-500);
  border: 1.5px solid var(--bg-elev);
}
.hd-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--clay-50);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}
.hd-credits:hover { background: var(--clay-100); color: var(--clay-700); }
.hd-credits .tabular { font-weight: 600; }

.hd-page  { padding: 28px 32px; flex: 1; }
.hd-eyebrow { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-subtle); font-weight: 500; }

.hd-stack-2  { display: flex; flex-direction: column; gap: 4px; }
.hd-stack-3  { display: flex; flex-direction: column; gap: 8px; }
.hd-stack-4  { display: flex; flex-direction: column; gap: 14px; }
.hd-row      { display: flex; gap: 14px; align-items: center; }
.hd-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── Striped placeholders for empty image slots ─────────────── */
.stripe-placeholder {
  background: repeating-linear-gradient(135deg, var(--cream-100) 0 12px, var(--cream-150) 12px 24px);
}
.stripe-placeholder-clay {
  background: repeating-linear-gradient(135deg, var(--clay-50) 0 12px, var(--clay-100) 12px 24px);
}

/* ── Focus ring (only inside the home_design scope so we don't
       fight Bootstrap globally) ────────────────────────────── */
.hd-scope *:focus-visible { outline: 2px solid var(--clay-400); outline-offset: 2px; }

/* ── Divider helpers ─────────────────────────────────────────── */
.divider   { height: 1px; background: var(--border); width: 100%; }
.divider-v { width: 1px; background: var(--border); align-self: stretch; }

/* ── Onboarding two-column layout ────────────────────────────── */
.hd-onboard {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .hd-onboard { grid-template-columns: 1fr; }
}

/* ── Hero (left) — sunset art on top, olive copy below ──────── */
.hd-hero {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto;
  grid-template-columns: 1fr;
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-height: 620px;
  background: #3a4a26;
}
@media (max-width: 720px) {
  .hd-hero { min-height: auto; }
}
.hd-hero-art {
  position: relative;
  background: linear-gradient(180deg, #f4d4be 0%, #eaa789 45%, #d97e5f 75%, #c4674c 100%);
  display: block;
  overflow: hidden;
  min-height: 280px;
}
.hd-hero-illustration {
  width: 100%;
  height: 100%;
  display: block;
}
/* When the hero illustration is a real photo (vs. inline SVG) it must
   fill the container without distortion. */
img.hd-hero-illustration {
  object-fit: cover;
  object-position: center;
  min-height: 280px;
}
.hd-hero-copy {
  background: #3a4a26;
  color: var(--cream-50);
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.hd-hero-copy::before { content: none; }
.hd-hero-label {
  color: rgba(251, 247, 241, 0.7) !important;
  font-size: 10px;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}
.hd-hero-headline {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  color: var(--cream-50);
  max-width: 30ch;
}
.hd-hero-headline em { color: #e9a48a; font-style: italic; font-weight: 400; }
.hd-hero-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(251, 247, 241, 0.78);
  max-width: 38ch;
}

/* ── Signup card (right) ─────────────────────────────────────── */
.hd-signup {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.hd-signup-progress {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.hd-signup-progress-seg {
  height: 4px;
  border-radius: 999px;
  background: var(--cream-200);
  position: relative;
}
.hd-signup-progress-seg.is-current { background: var(--clay-500); }
.hd-signup-progress-seg.is-done { background: var(--clay-300); }

.hd-signup-step {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--clay-600) !important;
}
.hd-signup-title {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hd-oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hd-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-oauth-btn:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-oauth-mark {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hd-mpesa { color: #0a8a3a; }

.hd-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 4px 0;
}
.hd-divider::before,
.hd-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hd-form { display: flex; flex-direction: column; gap: 12px; }
.hd-field { display: flex; flex-direction: column; gap: 4px; }
.hd-field-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.hd-field-hint {
  font-size: 10px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}
.hd-field .input-hd {
  border-radius: var(--r-pill);
  padding: 10px 14px;
  border-color: var(--border-strong);
}

.hd-roles { border: 0; padding: 0; margin: 4px 0 2px; }
.hd-roles legend {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.hd-role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 540px) {
  .hd-role-grid { grid-template-columns: repeat(4, 1fr); }
}
.hd-role { position: relative; cursor: pointer; }
.hd-role input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}
.hd-role span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.hd-role:hover span { background: var(--cream-100); color: var(--text); }
.hd-role input:checked + span {
  background: var(--clay-100);
  color: var(--clay-700);
  border-color: var(--clay-300);
  font-weight: 500;
}
.hd-role input:focus-visible + span { outline: 2px solid var(--clay-400); outline-offset: 2px; }

.hd-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 4px 2px;
}
.hd-consent input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--clay-500);
  width: 14px; height: 14px;
}
.hd-consent a { color: var(--clay-700); text-decoration: underline; text-underline-offset: 2px; }
.hd-consent a:hover { color: var(--clay-600); }

.hd-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--r-pill);
  background: var(--clay-500);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-clay);
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.hd-cta:hover { background: var(--clay-600); }
.hd-cta:active { transform: translateY(1px); }

.hd-signin {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.hd-signin a {
  color: var(--clay-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.hd-signin a:hover { color: var(--clay-600); }

@media (max-width: 720px) {
  .hd-topbar { padding: 18px 20px; }
  .hd-page { padding: 20px; }
  .hd-search { min-width: 0; flex: 1; }
  .hd-shell { grid-template-columns: 1fr; }
  .hd-sidebar { position: static; height: auto; }
}

/* =============================================================
   Workspace dashboard (logged-in)
   ============================================================= */
.hd-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

/* ── Hero card: welcome (left) + illustration (right) ───────── */
.hd-ws-hero {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  min-height: 320px;
}
@media (max-width: 900px) {
  .hd-ws-hero { grid-template-columns: 1fr; }
}

/* ── Welcome (left half) ────────────────────────────────────── */
.hd-ws-welcome {
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--cream-50) 0%, var(--cream-50) 60%, var(--clay-50) 100%);
}
.hd-ws-welcome-label {
  color: var(--clay-700) !important;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  margin-bottom: 2px;
}
.hd-ws-headline {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 28ch;
}
.hd-ws-headline em {
  color: var(--clay-600);
  font-style: italic;
  font-weight: 400;
}
.hd-ws-sub {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 56ch;
}
.hd-ws-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.hd-cta-inline {
  width: auto;
  padding: 11px 20px;
  font-size: 13px;
  text-decoration: none;
}
.hd-btn-soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.hd-btn-soft:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.hd-link-quiet:hover { color: var(--text); }

/* ── Illustration (right half) ──────────────────────────────── */
.hd-ws-art {
  position: relative;
  overflow: hidden;
  background: var(--clay-100);
  min-height: 320px;
}
.hd-ws-art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* `img.hd-ws-art-svg` inherits the absolute fill above; this just
   makes the photo crop nicely at any aspect ratio. */
img.hd-ws-art-svg {
  object-fit: cover;
  object-position: center;
}
.hd-ws-tags {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(31, 26, 20, 0.78);
  color: var(--cream-50);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.hd-ws-tag-sep { opacity: 0.55; }

/* ── Stats: 4-up horizontal row ─────────────────────────────── */
.hd-ws-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .hd-ws-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .hd-ws-stats-row { grid-template-columns: 1fr; }
}
.hd-stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.hd-stat-icon {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: var(--cream-100);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-stat-value {
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 2px;
}
.hd-stat-foot {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hd-stat-delta-up { color: #4f7a3a; font-weight: 500; }
.hd-stat-pending { color: var(--gold-500); font-weight: 500; }

/* ── Recent activity ───────────────────────────────────────── */
.hd-ws-recent {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.hd-ws-recent-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.hd-ws-recent-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.hd-ws-recent-tools { display: flex; gap: 8px; }
.hd-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-chip-btn:hover { background: var(--cream-100); color: var(--text); border-color: var(--border-strong); }

.hd-project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .hd-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .hd-project-grid { grid-template-columns: 1fr; } }

.hd-project-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.hd-project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* "New project" card */
.hd-project-new {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  background:
    repeating-linear-gradient(135deg, var(--clay-50) 0 12px, var(--clay-100) 12px 24px);
  border: 1.5px dashed var(--clay-300);
  gap: 8px;
}
.hd-project-new-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--clay-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: var(--shadow-clay);
}
.hd-project-new .hd-project-title { font-size: 17px; color: var(--text); }
.hd-project-new .hd-project-meta { font-size: 11.5px; color: var(--text-muted); max-width: 22ch; }

/* Existing-project cards */
.hd-project-art {
  position: relative;
  aspect-ratio: 240 / 160;
  overflow: hidden;
}
.hd-project-art > svg { width: 100%; height: 100%; display: block; }
.hd-project-art > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.hd-project-status {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}
.hd-project-status--rose  { background: var(--rose-100);  color: var(--rose-500);  border-color: var(--rose-100); }
.hd-project-status--gold  { background: var(--gold-100);  color: var(--gold-500);  border-color: var(--gold-100); }
.hd-project-status--olive { background: var(--olive-100); color: var(--olive-600); border-color: var(--olive-100); }
.hd-project-status--clay  { background: var(--clay-100);  color: var(--clay-700);  border-color: var(--clay-200); }

.hd-project-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-project-body .hd-project-title {
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hd-project-body .hd-project-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.hd-project-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* =============================================================
   Wizard (3-column shell: rail · form · live brief)
   ============================================================= */
.hd-screen-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--cream-100);
  border: 1px solid var(--border);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hd-screen-id-sep { opacity: 0.55; }

.hd-wizard {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1200px) {
  .hd-wizard { grid-template-columns: 220px minmax(0, 1fr); }
  .hd-wiz-aside { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 800px) {
  .hd-wizard { grid-template-columns: 1fr; }
  .hd-wiz-aside { grid-template-columns: 1fr; }
}

/* ── Left rail ──────────────────────────────────────────────── */
.hd-wiz-rail {
  background: var(--cream-100);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hd-wiz-rail-head { display: flex; flex-direction: column; gap: 8px; }
.hd-wiz-rail-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.18;
}
.hd-wiz-steplist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hd-wiz-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--text-muted);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.hd-wiz-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cream-150);
  color: var(--text-subtle);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-wiz-step-label { font-weight: 400; }
.hd-wiz-step.is-active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.hd-wiz-step.is-active .hd-wiz-step-num {
  background: var(--clay-500);
  color: #fff;
  box-shadow: var(--shadow-clay);
}
.hd-wiz-step.is-active .hd-wiz-step-label { font-weight: 500; }
.hd-wiz-step.is-done .hd-wiz-step-num {
  background: var(--olive-100);
  color: var(--olive-600);
}
.hd-wiz-step.is-done .hd-wiz-step-label { color: var(--text); }

.hd-ai-assist {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.hd-ai-assist-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-700);
  font-weight: 500;
}
.hd-ai-assist-body {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ── Center form ────────────────────────────────────────────── */
.hd-wiz-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}
.hd-wiz-form-head { display: flex; flex-direction: column; gap: 8px; }
.hd-wiz-form-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.hd-wiz-error {
  background: var(--rose-100);
  color: var(--rose-500);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  border: 1px solid var(--rose-100);
}

.hd-wiz-form .hd-field { display: flex; flex-direction: column; gap: 6px; }
.hd-wiz-form .hd-field .label-hd {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: 0;
}
.hd-wiz-form .hd-field .input-hd {
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 13.5px;
  border-color: var(--border-strong);
}
.hd-wiz-form .hd-field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hd-wiz-form .hd-field-hint {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}
.hd-wiz-form .hd-field-error {
  font-size: 11.5px;
  color: var(--rose-500);
}

.hd-field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* ── Wizard "house" step — sections + feature cards ────────────
   Used by _step_house.html for grouping room-requirements and the
   additional-features checkbox grid into visually-separated cards. */
.hd-house-section {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.hd-house-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0;
}
.hd-house-section-icon { color: #2563eb; flex-shrink: 0; }

/* Wizard Continue button — overrides the global ``.hd-cta`` clay
   colour to blue so the affordance reads as a "Next →" navigation
   action rather than a primary destructive/commit action. Scoped to
   ``.hd-wiz-foot`` so the marketing/onboarding ``.hd-cta`` (clay)
   keeps its existing colour. */
.hd-wiz-foot .hd-cta {
  background: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.hd-wiz-foot .hd-cta:hover {
  background: #1d4ed8;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.36);
}
.hd-wiz-foot .hd-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* Bump the program-step house-type select so it reads as the primary
   structural choice on the page. Targets only the top-level field
   (direct ``.hd-field`` child of the wizard form's ``.hd-stack-4``),
   so the plot-step country/city selects — nested inside an
   ``.hd-field-grid-2`` — keep their compact size. */
.hd-wiz-form .hd-stack-4 > .hd-field > select.hd-select,
.hd-wiz-form .hd-stack-4 > .hd-field > .input-hd.hd-select {
  font-size: 15px;
  padding: 14px 36px 14px 14px;
  font-weight: 500;
}
.hd-house-section-icon--accent { color: #2563eb; }
.hd-house-section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

/* ── Feature checkbox cards ────────────────────────────────────
   Native <input type="checkbox"> rendered by Django's
   CheckboxSelectMultiple, hidden visually but kept accessible. The
   .hd-feature-card label flips style when its inner checkbox is
   :checked — using `:has()` (modern browsers) for the parent and a
   sibling-selector fallback baked in. */
.hd-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 720px) {
  .hd-feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .hd-feature-grid { grid-template-columns: 1fr; }
}
.hd-feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 8px 10px 8px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.08s;
}
.hd-feature-card:hover {
  border-color: var(--olive-500);
  background: var(--cream-50);
}
.hd-feature-card:active { transform: translateY(1px); }
/* Hide the native checkbox visually but keep it focusable. */
.hd-feature-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.hd-feature-card-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  background: var(--bg-elev);
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-feature-card-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
/* Selected state — uses the bright-green palette for consistency
   with the design picker's "selected" signal. */
.hd-feature-card:has(input[type="checkbox"]:checked) {
  border-color: var(--olive-600);
  background: var(--olive-100);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.hd-feature-card:has(input[type="checkbox"]:checked) .hd-feature-card-mark {
  background: var(--olive-600);
  border-color: var(--olive-600);
  color: var(--cream-50);
}
.hd-feature-card:has(input[type="checkbox"]:checked) .hd-feature-card-label {
  color: var(--olive-500);
}
.hd-feature-card:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

/* ── Radio cards (style step) ──────────────────────────────────
   Single-select sibling of .hd-feature-card. The native radio is
   visually hidden but kept focusable; the label flips style when
   :checked, using the bright-green selection colour shared with the
   design picker. */
.hd-radio-grid {
  display: grid;
  gap: 10px;
}
.hd-radio-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .hd-radio-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .hd-radio-grid--3 { grid-template-columns: 1fr; } }

.hd-radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 8px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.08s;
}
.hd-radio-card:hover {
  border-color: var(--olive-500);
  background: var(--cream-50);
}
.hd-radio-card:active { transform: translateY(1px); }
/* Hide the native radio visually but keep it focusable. */
.hd-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.hd-radio-card-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  background: var(--bg-elev);
  transition: background 0.15s, border-color 0.15s;
}
.hd-radio-card-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
/* Selected state — same bright-green palette as the feature cards
   and the design picker so the entire wizard speaks one selection
   language. */
.hd-radio-card:has(input[type="radio"]:checked) {
  border-color: var(--olive-600);
  background: var(--olive-100);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.hd-radio-card:has(input[type="radio"]:checked) .hd-radio-card-mark {
  background: var(--olive-600);
  border-color: var(--olive-600);
  box-shadow: inset 0 0 0 3px var(--bg-elev);
}
.hd-radio-card:has(input[type="radio"]:checked) .hd-radio-card-label {
  color: var(--olive-500);
}
.hd-radio-card:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

/* ── Generation-quality cards (review step) ───────────────────
   Two-column layout (Standard / Premium). Premium is locked
   server-side for plans below Business; the locked variant uses a
   dashed border + lock icon + Upgrade CTA. */
.hd-quality-section { padding-top: 18px; }
.hd-quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* Stack only on real phone widths — keep the cards inline on the
   wizard's narrow centre column (which is well under 720px). */
@media (max-width: 460px) { .hd-quality-grid { grid-template-columns: 1fr; } }

.hd-quality-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.hd-quality-card:hover { border-color: var(--olive-500); background: var(--cream-50); }
.hd-quality-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.hd-quality-card-mark {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  background: var(--bg-elev);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.hd-quality-card-lock {
  flex-shrink: 0;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.hd-quality-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hd-quality-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.hd-quality-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.hd-quality-card-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hd-quality-card-pill--included {
  background: var(--text);
  color: var(--cream-50);
}
.hd-quality-card-cta {
  align-self: flex-start;
  padding: 6px 14px;
  border: 1.4px solid #2563eb;
  border-radius: 8px;
  background: var(--bg-elev);
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.hd-quality-card-cta:hover {
  background: #2563eb;
  color: var(--cream-50);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Selected / locked / available variants */
.hd-quality-card:has(input[type="radio"]:checked) {
  border-color: var(--olive-600);
  background: var(--olive-100);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.hd-quality-card:has(input[type="radio"]:checked) .hd-quality-card-mark {
  background: var(--olive-600);
  border-color: var(--olive-600);
  box-shadow: inset 0 0 0 3px var(--bg-elev);
}
.hd-quality-card--locked {
  border-style: dashed;
  background: transparent;
  cursor: not-allowed;
}
.hd-quality-card--locked:hover {
  border-color: var(--border-strong);
  background: transparent;
}
.hd-quality-card--locked input[type="radio"]:disabled { cursor: not-allowed; }

/* ── Generate button (review step) ────────────────────────────
   Blue primary action with magic-wand icon and a "Uses N Credit"
   badge tucked on the right. Overrides the wizard-foot blue rule
   only because of the badge layout — the button itself is wider
   to fit the inline pill. */
.hd-cta-generate {
  position: relative;
  padding-left: 22px;
  padding-right: 14px;
  gap: 10px;
}
.hd-cta-generate-icon { color: currentColor; flex-shrink: 0; }
.hd-cta-generate-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--cream-50);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
}

/* ── Dual-handle range slider (budget step) ────────────────────
   Two <input type="range"> inputs absolutely positioned over a
   shared visual track. The .hd-range-fill segment between the two
   handles is repainted by JS on every input. The inputs themselves
   are styled transparent so the visible thumb sits on the track.
   We use ``pointer-events: none`` on the input track and
   ``pointer-events: auto`` on the WebKit / Moz thumb pseudo-elements
   so the thumb directly above another thumb stays grabbable. */
.hd-range {
  position: relative;
  height: 56px;
  margin-top: 6px;
}
.hd-range-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--text-muted);
  padding-bottom: 12px;
}
.hd-range-readout-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hd-range-readout-values {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.hd-range-readout-sep { color: var(--text-subtle); margin: 0 6px; }

.hd-range-track {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 38px;
  height: 6px;
  background: var(--cream-200);
  border-radius: 999px;
  overflow: hidden;
}
.hd-range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2563eb;
  border-radius: 999px;
}

/* Both range inputs sit on the same horizontal line, fully overlapping.
   Make the track invisible (the visible track is .hd-range-track) and
   keep only the thumb visible + interactive. */
.hd-range-handle {
  position: absolute;
  left: 0;
  right: 0;
  top: 32px;
  width: 100%;
  height: 18px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none; /* track is non-interactive */
  margin: 0;
  padding: 0;
}
.hd-range-handle:focus { outline: none; }

/* WebKit thumb */
.hd-range-handle::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto; /* let the user grab the thumb directly */
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2563eb;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  transition: box-shadow 0.15s, transform 0.08s;
}
.hd-range-handle::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18);
}
.hd-range-handle:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.32);
}
.hd-range-handle:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.04); }

/* Firefox thumb */
.hd-range-handle::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2563eb;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  transition: box-shadow 0.15s, transform 0.08s;
}
.hd-range-handle::-moz-range-thumb:hover {
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18);
}
.hd-range-handle:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.32);
}
.hd-range-handle:active::-moz-range-thumb { cursor: grabbing; transform: scale(1.04); }

/* Hide the WebKit / Firefox default tracks — we draw our own. */
.hd-range-handle::-webkit-slider-runnable-track { background: transparent; height: 6px; }
.hd-range-handle::-moz-range-track { background: transparent; height: 6px; }

/* When the max handle is dragged near the min handle, ensure the
   one above stays grabbable. The "max" handle layered last in DOM
   wins z-index by default; lift the active one above its sibling. */
.hd-range-handle--min { z-index: 2; }
.hd-range-handle--max { z-index: 3; }
.hd-range-handle--min:focus-visible,
.hd-range-handle--min:active { z-index: 4; }
/* Lock the label-row to a uniform two-line height so a long hint that
   wraps in one cell doesn't push its input lower than the input next
   to it. Earlier we tried ``margin-top: auto`` on the inputs to anchor
   them to the bottom of each cell, but when one cell grows because an
   error message renders below its input, ``align-items: stretch``
   stretches the sibling cell too and the bottom-anchored input drifts
   down with it. Reserving the worst-case label height up front sidesteps
   the whole stretch dance — inputs sit at the same y in both cells,
   regardless of whether errors render below either of them. */
.hd-field-grid-2 > .hd-field > .hd-field-row {
  min-height: 36px;
  align-items: flex-start;
}
@media (max-width: 540px) { .hd-field-grid-2 { grid-template-columns: 1fr; } }

/* ── Plot-shape radio cards ─────────────────────────────────── */
.hd-shape-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hd-shape-fieldset legend {
  padding: 0;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-weight: 500;
}
.hd-shape-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) { .hd-shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hd-shape { position: relative; cursor: pointer; }
.hd-shape input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.hd-shape-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 10px 14px;
  border-radius: var(--r-md);
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.hd-shape-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}
.hd-shape-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.hd-shape:hover .hd-shape-card { background: var(--cream-100); }
.hd-shape input:checked + .hd-shape-card {
  background: var(--clay-50);
  border-color: var(--clay-400);
  box-shadow: 0 0 0 3px var(--clay-100);
}
.hd-shape input:checked + .hd-shape-card .hd-shape-label { color: var(--clay-700); font-weight: 600; }
.hd-shape input:focus-visible + .hd-shape-card { outline: 2px solid var(--clay-400); outline-offset: 2px; }

/* ── Optional callout ──────────────────────────────────────── */
.hd-callout {
  background: var(--cream-100);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-callout strong { color: var(--text); font-weight: 600; }
.hd-callout em { color: var(--text-muted); font-style: italic; }

/* ── Form footer ───────────────────────────────────────────── */
.hd-wiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Right aside: starting design + live brief + estimated time ──────────────── */
.hd-wiz-aside { display: flex; flex-direction: column; gap: 14px; }
.hd-livebrief, .hd-est, .hd-pickeddesign {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* ── Starting design panel (above Live brief) ──────────────────
   Renders when the user came in via the design picker; carries the
   selected house photo + title + type + specs from session. */
.hd-pickeddesign-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* Full-width pill-style "Change Design" button at the bottom of the
   starting-design panel. Replaces the earlier small underlined link
   in the header — design called for a more prominent, button-shaped
   affordance with a refresh icon and bold blue label. */
.hd-pickeddesign-change-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #2563eb;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.hd-pickeddesign-change-btn:hover {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.hd-pickeddesign-change-btn:active {
  transform: translateY(1px);
}
.hd-pickeddesign-change-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.hd-pickeddesign-change-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.hd-pickeddesign-photo {
  position: relative;
  margin-top: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--cream-100);
  aspect-ratio: 4 / 3;
}
.hd-pickeddesign-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Type tag overlaid on the bottom-left of the photo (mirrors the
   ``.type-badge`` pattern used on the design-picker grid). Keeps the
   panel compact by not consuming a separate text row below the title. */
.hd-pickeddesign-type-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.hd-pickeddesign-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
}
.hd-pickeddesign-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.hd-pickeddesign-specs {
  font-size: 12.5px;
  color: var(--text-muted);
}
/* Green "Selected Design" pill with check icon — confirms which
   starting design is feeding the brief. Uses the bright-green token
   (var(--olive-100/600)) shared with the design picker's selection
   state for consistency. */
.hd-pickeddesign-selected {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 5px 12px;
  background: var(--olive-100);
  color: var(--olive-500);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.hd-pickeddesign-selected svg { color: var(--olive-600); flex-shrink: 0; }
/* Subtle horizontal divider between the design info block and the
   "Change Design" button below. */
.hd-pickeddesign-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0 0;
}

.hd-livebrief-title {
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2px;
}
.hd-livebrief-sub { font-size: 12.5px; color: var(--text-muted); }
.hd-plotdiagram {
  position: relative;
  margin-top: 14px;
  background: var(--cream-100);
  border-radius: var(--r-md);
  padding: 18px 26px 18px 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hd-plotdiagram > svg { width: 100%; max-width: 180px; height: auto; display: block; }
.hd-plotdiagram-w, .hd-plotdiagram-h {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}
.hd-plotdiagram-w { top: 6px; left: 50%; transform: translateX(-50%); }
.hd-plotdiagram-h { left: 14px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; }

/* ── Live brief — inline variant ──────────────────────────────
   Used inside the form column (between the last form field and the
   Back/Continue footer) instead of stacked in the right rail.
   Title/sub block sits left, the plot diagram sits right. */
.hd-livebrief--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}
.hd-livebrief--inline .hd-livebrief-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.hd-livebrief--inline .hd-livebrief-title { margin-top: 0; }
.hd-plotdiagram--inline {
  margin-top: 0;
  padding: 8px 22px 8px 30px;
  flex-shrink: 0;
  width: 220px;
  max-width: 260px;
}
/* Landscape modifier — rectangle's longer dimension on the x-axis.
   The SVG now uses a 320×200 viewBox so we size it wider but shorter
   than the previous portrait variant; container width grows so the
   diagram doesn't shrink too small inside the inline strip. */
.hd-plotdiagram--inline > svg { max-width: 180px; }
.hd-plotdiagram--landscape > svg { max-width: 180px; }
@media (max-width: 720px) {
  .hd-livebrief--inline { flex-direction: column; align-items: stretch; }
  .hd-plotdiagram--inline { width: auto; padding: 14px 26px 14px 38px; }
  .hd-plotdiagram--inline > svg { max-width: 220px; }
}

/* Horizontal break between the inline live brief and the
   Back/Continue footer. */
.hd-wiz-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.hd-est-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hd-est-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.hd-est-list li:first-child { border-top: 1px solid var(--border); }
.hd-est-list li > .mono { color: var(--text); font-weight: 500; }
.hd-est-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 6px;
  font-size: 13px;
  font-weight: 500;
}
.hd-est-total > .mono { color: var(--clay-700); font-weight: 600; }
.hd-est-credits {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.hd-est-credits strong { color: var(--clay-700); font-weight: 600; }

/* =============================================================
   Upload existing input
   ============================================================= */
.hd-upload {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1000px) {
  .hd-upload { grid-template-columns: 1fr; }
}

/* ── Main card with dropzone ───────────────────────────────── */
.hd-upload-main {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.hd-upload-title {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.hd-upload-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 70ch;
}

/* ── Dropzone ──────────────────────────────────────────────── */
.hd-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 38px 24px 24px;
  background: var(--clay-50);
  border: 1.5px dashed var(--clay-300);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.hd-dropzone:hover {
  background: var(--clay-100);
  border-color: var(--clay-400);
}
.hd-dropzone-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--clay-200);
  color: var(--clay-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm);
}
.hd-dropzone-text {
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hd-dropzone-formats {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}
.hd-dropzone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.hd-dropzone-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.hd-dropzone-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ── Right aside ───────────────────────────────────────────── */
.hd-upload-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hd-accept, .hd-privacy {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.hd-accept-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hd-accept-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.hd-accept-item:first-child { border-top: 0; padding-top: 4px; }
.hd-accept-item:last-child  { padding-bottom: 0; }
.hd-accept-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--cream-100);
  color: var(--clay-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  flex-shrink: 0;
}
.hd-accept-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-accept-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-accept-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ── Privacy callout ───────────────────────────────────────── */
.hd-privacy-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.hd-privacy-head > svg { color: var(--olive-600); }
.hd-privacy-body {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── Upload transition states ──────────────────────────────── */
.hd-dropzone.is-dragover {
  background: var(--clay-100);
  border-color: var(--clay-500);
}
.hd-dropzone.is-uploading {
  background: var(--clay-100);
  border-style: solid;
  border-color: var(--clay-400);
  pointer-events: none;
}
.hd-dropzone.is-uploading .hd-dropzone-icon {
  animation: hd-pulse-clay 1.2s ease-in-out infinite;
}
@keyframes hd-pulse-clay {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199, 90, 50, 0.35); }
  50%      { box-shadow: 0 0 0 10px rgba(199, 90, 50, 0); }
}

/* =============================================================
   Plan extraction (post-upload)
   ============================================================= */
.hd-extract {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .hd-extract { grid-template-columns: 1fr; }
}

/* ── Canvas card ───────────────────────────────────────────── */
.hd-extract-canvas-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hd-extract-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
  flex-wrap: wrap;
}
.hd-extract-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-extract-filename {
  font-size: 11.5px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hd-extract-tools { display: inline-flex; gap: 6px; }
.hd-icon-btn--sm { width: 28px; height: 28px; }

/* ── Canvas surface ────────────────────────────────────────── */
.hd-extract-canvas {
  position: relative;
  background: var(--cream-50);
  aspect-ratio: 800 / 540;
  width: 100%;
}
.hd-extract-canvas > svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Floating room-label tags ──────────────────────────────── */
.hd-room-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-sm);
  background: var(--ink-900);
  color: var(--cream-50);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(31, 26, 20, 0.18);
  pointer-events: none;
}
.hd-room-tag::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1.5px solid var(--ink-900);
  box-shadow: 0 4px 8px rgba(31, 26, 20, 0.12);
}
.hd-room-dot {
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 1;
}
.hd-room-name { font-weight: 500; }
.hd-room-area {
  font-size: 10.5px;
  color: rgba(251, 247, 241, 0.7);
  letter-spacing: 0.01em;
}

/* ── Action toolbar ────────────────────────────────────────── */
.hd-extract-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-action:hover { background: var(--cream-100); color: var(--text); }
.hd-action--primary {
  background: var(--clay-500);
  color: #fff;
  border-color: var(--clay-500);
  box-shadow: var(--shadow-clay);
}
.hd-action--primary:hover { background: var(--clay-600); border-color: var(--clay-600); color: #fff; }
.hd-action--quiet {
  margin-left: auto;
  color: var(--text-subtle);
  border-color: var(--border);
}
.hd-action--quiet:hover { color: var(--rose-500); border-color: var(--rose-100); background: var(--rose-100); }

/* ── Right rail ────────────────────────────────────────────── */
.hd-extract-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Scale-calibration alert (gold) */
.hd-scale-alert {
  background: var(--gold-100);
  border: 1px solid var(--gold-100);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hd-scale-alert-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.hd-scale-alert-head > svg { color: var(--gold-500); }
.hd-scale-alert-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-scale-alert-actions { display: flex; gap: 8px; margin-top: 4px; }

.hd-btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: var(--cream-50);
  font-size: 12px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.hd-btn-dark:hover { background: var(--ink-800); color: var(--cream-50); }
.hd-btn-soft--sm { padding: 7px 14px; font-size: 12px; }

/* Extraction summary */
.hd-summary {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hd-summary-list { margin: 0; padding: 0; display: flex; flex-direction: column; }
.hd-summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.hd-summary-list > div:first-child { border-top: 0; padding-top: 4px; }
.hd-summary-list dt { color: var(--text-muted); margin: 0; }
.hd-summary-list dd { margin: 0; color: var(--text); font-weight: 500; }
.hd-summary-warn { color: var(--clay-700) !important; }

/* Vision Agent warnings */
.hd-warnings {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hd-warnings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-warnings-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hd-warnings-list li:first-child { border-top: 0; padding-top: 4px; }
.hd-warning-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.hd-warning-dot--warn  { background: var(--gold-500); }
.hd-warning-dot--error { background: var(--rose-500); }

/* Confirm CTA — full-width */
.hd-cta-block {
  width: 100%;
  padding: 13px 18px;
  text-decoration: none;
}

/* =============================================================
   Compare options (three-card scorecard)
   ============================================================= */
.hd-compare {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Status bar ────────────────────────────────────────────── */
.hd-cmp-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: var(--r-xl);
  background: var(--cream-100);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.hd-cmp-status-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hd-cmp-status-headline {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hd-cmp-status-time { color: var(--clay-600); font-weight: 500; font-style: normal; }
.hd-cmp-status-actions { display: inline-flex; align-items: center; gap: 8px; }

/* ── Option-card grid ──────────────────────────────────────── */
.hd-cmp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 1100px) { .hd-cmp-grid { grid-template-columns: 1fr; } }

.hd-opt-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.hd-opt-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hd-opt-card.is-recommended {
  border-color: var(--clay-400);
  box-shadow: 0 0 0 3px var(--clay-100), var(--shadow-md);
}

/* ── Card art (floor plan thumb + eyebrow + recommended badge) ── */
.hd-opt-art {
  position: relative;
  background: var(--cream-50);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.hd-opt-eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-700);
  margin-bottom: 8px;
}
.hd-opt-card.is-recommended .hd-opt-eyebrow { color: var(--olive-600); }
.hd-opt-rec {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-fp-thumb {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.hd-fp-thumb > svg { width: 100%; height: auto; display: block; aspect-ratio: 360 / 240; }

/* ── Card body ─────────────────────────────────────────────── */
.hd-opt-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.hd-opt-tier {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 600;
}
.hd-opt-tier--clay  { color: var(--clay-700); }
.hd-opt-tier--olive { color: var(--olive-600); }
.hd-opt-tier--gold  { color: var(--gold-500); }

.hd-opt-name {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.hd-opt-tagline {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hd-opt-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 6px;
}
.hd-opt-stats > div { display: flex; flex-direction: column; gap: 2px; }
.hd-opt-stats dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0;
}
.hd-opt-stats dd {
  margin: 0;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ── Cost range box ────────────────────────────────────────── */
.hd-opt-cost {
  background: var(--clay-50);
  border: 1px solid var(--clay-100);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-opt-cost > .hd-eyebrow { color: var(--clay-700); font-size: 10px; letter-spacing: 0.18em; }
.hd-opt-cost-range {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.hd-opt-cost-foot {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ── Highlights list ───────────────────────────────────────── */
.hd-opt-highlights {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-opt-highlights li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.hd-opt-highlights li > svg { color: var(--olive-500); flex-shrink: 0; }

/* ── Footer (Open + more) ──────────────────────────────────── */
.hd-opt-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-opt-open {
  text-decoration: none;
  padding: 11px 18px;
  font-size: 13.5px;
}
.hd-opt-more {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hd-opt-more:hover { background: var(--cream-100); color: var(--text); }

/* ── Side-by-side scorecard ────────────────────────────────── */
.hd-cmp-scorecard {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hd-cmp-scorecard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
}
.hd-cmp-scorecard-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.hd-cmp-scorecard-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hd-cmp-table-wrap { overflow-x: auto; }
.hd-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hd-cmp-table th,
.hd-cmp-table td {
  padding: 14px 22px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.hd-cmp-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--bg-elev);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.hd-cmp-table thead th.is-recommended { color: var(--clay-700); }
.hd-cmp-table tbody th {
  font-weight: 500;
  color: var(--text);
  width: 38%;
}
.hd-cmp-table tbody td { color: var(--text); font-weight: 500; }
.hd-cmp-table tbody td.is-recommended {
  background: var(--clay-50);
  color: var(--clay-700);
}
.hd-cmp-table tbody tr:last-child th,
.hd-cmp-table tbody tr:last-child td { border-bottom: 0; }

/* =============================================================
   Floor-plan editor
   ============================================================= */
.hd-fp-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1200px) { .hd-fp-editor { grid-template-columns: 1fr; } }

/* ── Left stage (toolbar + canvas + foot) ──────────────────── */
.hd-fp-stage {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Toolbar */
.hd-fp-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-wrap: wrap;
}
.hd-fp-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--cream-100);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}
.hd-fp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hd-fp-tab:hover { color: var(--text); }
.hd-fp-tab.is-active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.hd-fp-toggles { display: inline-flex; gap: 6px; }
.hd-fp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-fp-toggle:hover { background: var(--cream-100); color: var(--text); border-color: var(--border-strong); }
.hd-fp-toggle.is-on {
  background: var(--cream-100);
  color: var(--text);
  border-color: var(--border-strong);
}
.hd-fp-toggle.is-on > svg { color: var(--clay-600); }

.hd-fp-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  margin-left: auto;
}
.hd-fp-zoom-btn {
  width: 24px; height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
}
.hd-fp-zoom-btn:hover { background: var(--cream-100); color: var(--text); }
.hd-fp-zoom-value {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 0 4px;
  min-width: 36px;
  text-align: center;
}

.hd-fp-meta-actions { display: inline-flex; align-items: center; gap: 6px; }

/* ── Canvas surface ────────────────────────────────────────── */
.hd-fp-canvas {
  position: relative;
  background: var(--cream-50);
  aspect-ratio: 940 / 600;
}
.hd-fp-canvas-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hd-fp-canvas-head {
  position: absolute;
  top: 18px;
  left: 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
  pointer-events: none;
}
.hd-fp-canvas-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay-700);
  font-weight: 600;
}
.hd-fp-canvas-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.hd-fp-compass {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
}
.hd-fp-compass > svg { display: block; }

.hd-fp-canvas-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.hd-fp-canvas-foot-r { color: var(--text-muted); }

/* ── Right rail: room schedule ─────────────────────────────── */
.hd-fp-rail {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 130px);
  overflow: hidden;
}
.hd-fp-rail-head {
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.hd-fp-rail-title { font-size: 18px; letter-spacing: -0.01em; margin: 0; }

.hd-fp-rail-search {
  display: flex;
  gap: 8px;
  padding: 12px 14px 8px;
  align-items: center;
}
.hd-search--rail {
  flex: 1;
  min-width: 0;
  padding: 7px 10px 7px 12px;
  background: var(--cream-50);
}
.hd-search--rail input { font-size: 12.5px; }

.hd-fp-rooms {
  list-style: none;
  margin: 0;
  padding: 0 6px 8px;
  overflow-y: auto;
  flex: 1;
}
.hd-fp-room {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin: 1px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.hd-fp-room:hover { background: var(--cream-50); }
.hd-fp-room.is-active {
  background: var(--clay-100);
  border: 1px solid var(--clay-200);
  margin: 0;
}
.hd-fp-room-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-fp-room-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-fp-room-meta {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.hd-fp-room-note {
  font-size: 11px;
  font-style: italic;
  color: var(--text-subtle);
}
.hd-fp-room.is-active .hd-fp-room-name,
.hd-fp-room.is-active .hd-fp-room-area { color: var(--clay-700); }
.hd-fp-room-area {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.hd-fp-rail-foot {
  border-top: 1px solid var(--border);
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--cream-50);
}
.hd-fp-rail-foot-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.hd-fp-rail-foot-strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

/* =============================================================
   3D & Renders viewer
   ============================================================= */
.hd-renders {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1200px) { .hd-renders { grid-template-columns: 1fr; } }

/* ── Stage card ────────────────────────────────────────────── */
.hd-rd-stage {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hd-rd-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-wrap: wrap;
}
.hd-fp-tab--dark.is-active {
  background: var(--ink-900);
  color: var(--cream-50);
  box-shadow: 0 4px 12px rgba(31, 26, 20, 0.18);
}
.hd-rd-tools { display: inline-flex; gap: 6px; margin-left: auto; }

/* ── Hero canvas ───────────────────────────────────────────── */
.hd-rd-canvas {
  position: relative;
  background: var(--cream-100);
  aspect-ratio: 940 / 540;
}
.hd-rd-canvas-svg { width: 100%; height: 100%; display: block; }
.hd-rd-watermark {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: rgba(31, 26, 20, 0.78);
  color: var(--cream-50);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* ── Thumbnail strip ───────────────────────────────────────── */
.hd-rd-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
@media (max-width: 720px) {
  .hd-rd-thumbs { grid-template-columns: repeat(3, 1fr); }
}
.hd-rd-thumb {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--cream-50);
  padding: 0;
  cursor: pointer;
  aspect-ratio: 160 / 100;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hd-rd-thumb:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.hd-rd-thumb.is-active {
  border-color: var(--clay-500);
  box-shadow: 0 0 0 2px var(--clay-100);
}
.hd-rd-thumb > svg { width: 100%; height: 100%; display: block; }

.hd-rd-newangle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--cream-400);
  border-radius: var(--r-md);
  background: var(--cream-50);
  color: var(--text-muted);
  cursor: pointer;
  aspect-ratio: 160 / 100;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-rd-newangle:hover {
  background: var(--cream-100);
  border-color: var(--clay-300);
  color: var(--text);
}
.hd-rd-newangle-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.hd-rd-newangle-label { font-size: 11px; letter-spacing: 0.01em; }

/* ── Right rail ────────────────────────────────────────────── */
.hd-rd-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Active render card */
.hd-rd-active {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.hd-rd-active-title {
  margin: 4px 0 0;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.hd-rd-active-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.hd-rd-props {
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-rd-props > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.hd-rd-props > div:first-child { border-top: 0; padding-top: 6px; }
.hd-rd-props dt { color: var(--text-muted); margin: 0; }
.hd-rd-props dd { margin: 0; color: var(--text); font-weight: 500; }

/* Tweaks card */
.hd-rd-tweaks {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hd-rd-tweaklist {
  list-style: none;
  margin: 4px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-rd-tweaklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.hd-rd-tweaklist li:first-child { border-top: 0; padding-top: 4px; }
.hd-rd-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-rd-select:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-rd-select > svg { color: var(--text-subtle); }

.hd-rd-rerender {
  margin-top: 8px;
  width: 100%;
  padding: 13px 18px;
  font-size: 13.5px;
}

/* "Open in 3D" card */
.hd-rd-3d {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hd-rd-3d-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.hd-rd-3d-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--clay-500);
  box-shadow: 0 0 0 3px var(--clay-100);
}
.hd-rd-3d-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-rd-3d-cta {
  align-self: stretch;
  justify-content: center;
  padding: 9px 16px;
  font-size: 12.5px;
  margin-top: 4px;
  text-decoration: none;
}

/* =============================================================
   Interactive 3D viewer
   ============================================================= */
.hd-3d {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1200px) { .hd-3d { grid-template-columns: 1fr; } }

/* ── Stage (dark viewport card) ────────────────────────────── */
.hd-3d-stage {
  background: var(--ink-900);
  border: 1px solid var(--ink-800);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hd-3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(15, 12, 8, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.hd-3d-tb-left { display: inline-flex; align-items: center; gap: 12px; }
.hd-3d-glb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--cream-50);
  font-weight: 500;
}
.hd-3d-glb-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.18);
}
.hd-3d-stats {
  font-size: 10.5px;
  color: rgba(251, 247, 241, 0.5);
  letter-spacing: 0.04em;
}
.hd-3d-tb-right { display: inline-flex; gap: 4px; }
.hd-3d-tb-btn {
  width: 28px; height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(251, 247, 241, 0.7);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hd-3d-tb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream-50);
}

/* ── Viewport (3D canvas surface) ──────────────────────────── */
.hd-3d-viewport {
  position: relative;
  aspect-ratio: 940 / 600;
  background: #0c0a07;
}
.hd-3d-canvas { width: 100%; height: 100%; display: block; }
.hd-3d-gizmo {
  position: absolute;
  top: 14px;
  left: 18px;
  pointer-events: none;
}
.hd-3d-gizmo > svg { display: block; }

/* ── Navigation cube — 3×3 grid bottom-right ───────────────── */
.hd-3d-navcube {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-auto-rows: 26px;
  gap: 3px;
  padding: 6px;
  border-radius: var(--r-md);
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hd-3d-nc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-50);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.hd-3d-nc:hover { background: rgba(255, 255, 255, 0.14); }
.hd-3d-nc--ghost { background: transparent; pointer-events: none; }
.hd-3d-nc--label { font-size: 9.5px; padding: 0 4px; }
.hd-3d-nc--center {
  background: var(--clay-500);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hd-3d-nc--center:hover { background: var(--clay-600); }

/* ── Sun-time scrubber ─────────────────────────────────────── */
.hd-3d-scrubber {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--ink-900);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.hd-3d-play {
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-50);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hd-3d-play:hover { background: rgba(255, 255, 255, 0.14); }
.hd-3d-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
}
.hd-3d-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: var(--clay-500);
}
.hd-3d-track-knob {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--clay-500);
  box-shadow: 0 0 0 4px rgba(199, 90, 50, 0.18);
  transform: translate(-50%, -50%);
}
.hd-3d-scrub-label {
  font-size: 11px;
  color: rgba(251, 247, 241, 0.7);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Right rail ────────────────────────────────────────────── */
.hd-3d-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-3d-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* Display toggles */
.hd-3d-toggles {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-3d-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text);
}
.hd-3d-toggle-label { letter-spacing: -0.005em; }

.hd-3d-toggle-switch {
  position: relative;
  width: 32px;
  height: 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--cream-300);
  cursor: pointer;
  transition: background 0.18s;
  padding: 0;
}
.hd-3d-toggle-switch.is-on { background: var(--clay-500); }
.hd-3d-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: 0 1px 3px rgba(31, 26, 20, 0.18);
  transition: left 0.18s;
}
.hd-3d-toggle-switch.is-on .hd-3d-toggle-thumb { left: 16px; }

/* Sun-study sliders */
.hd-3d-sun-loc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 6px;
}
.hd-3d-slider-row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "label value" "track track";
  gap: 4px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.hd-3d-slider-row:first-of-type { border-top: 0; padding-top: 4px; }
.hd-3d-slider-label { grid-area: label; font-size: 12.5px; color: var(--text); }
.hd-3d-slider-value {
  grid-area: value;
  text-align: right;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}
.hd-3d-slider {
  grid-area: track;
  position: relative;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--cream-150);
  margin: 8px 6px 4px;
}
.hd-3d-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: var(--clay-500);
}
.hd-3d-slider-knob {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--clay-500);
  box-shadow: 0 0 0 4px var(--clay-100);
  transform: translate(-50%, -50%);
}

/* Material presets — 4×2 swatch grid */
.hd-3d-mat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.hd-3d-mat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.hd-3d-mat-chip {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  border: 1px solid;
  box-shadow: 0 2px 6px rgba(31, 26, 20, 0.07);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hd-3d-mat:hover .hd-3d-mat-chip {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 26, 20, 0.12);
}
.hd-3d-mat-name {
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Action row (.glb / Render) */
.hd-3d-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hd-3d-glb-btn {
  justify-content: center;
  padding: 11px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
}
.hd-3d-render-btn {
  width: auto;
  padding: 11px 16px;
  font-size: 13px;
  text-decoration: none;
}

/* =============================================================
   Bill of Quantities (BOQ)
   ============================================================= */
.hd-boq {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Top summary: 4 stat cells ─────────────────────────────── */
.hd-boq-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 22px 28px;
  background: var(--cream-100);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
@media (max-width: 900px) {
  .hd-boq-summary { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
}
.hd-boq-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 18px;
  border-left: 1px solid var(--border);
}
.hd-boq-stat:first-child { border-left: 0; padding-left: 0; }
.hd-boq-stat-value {
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.hd-boq-stat-value--sm { font-size: 26px; }
.hd-boq-stat-value--clay { color: var(--clay-600); }
.hd-boq-stat-foot {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ── Body grid: table | rail ───────────────────────────────── */
.hd-boq-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-boq-body { grid-template-columns: 1fr; } }

/* ── BOQ table card ────────────────────────────────────────── */
.hd-boq-table-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hd-boq-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
}
.hd-boq-table-title {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.hd-boq-export { display: inline-flex; align-items: center; gap: 6px; }

/* ── Table itself ──────────────────────────────────────────── */
.hd-boq-table-wrap { overflow-x: auto; }
.hd-boq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.hd-boq-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-boq-col-code  { width: 56px; }
.hd-boq-col-num   { text-align: right; width: 64px; }
.hd-boq-col-unit  { text-align: left;  width: 60px; }
.hd-boq-col-total { text-align: right; width: 130px; }

.hd-boq-table tbody tr { border-bottom: 1px solid var(--border); }
.hd-boq-table tbody tr:last-child { border-bottom: 0; }
.hd-boq-table tbody td {
  padding: 12px 22px;
  vertical-align: middle;
  color: var(--text);
}
.hd-boq-table .hd-boq-col-num   { text-align: right; }
.hd-boq-table .hd-boq-col-total { text-align: right; font-weight: 500; color: var(--text); }
.hd-boq-table .hd-boq-col-unit  { text-align: left; color: var(--text-muted); }

/* Section header rows */
.hd-boq-section-row {
  background: var(--cream-50);
}
.hd-boq-section-row td {
  padding: 13px 22px !important;
  font-weight: 600;
  color: var(--text);
  background: var(--cream-50);
}
.hd-boq-section-row td:first-child {
  color: var(--clay-700);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.hd-boq-section-name { font-size: 13px; }
.hd-boq-section-total { text-align: right; color: var(--text); font-size: 12.5px; }

/* Item rows */
.hd-boq-item-code {
  color: var(--text-subtle);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* Footer totals: subtotal · contingency · grand total */
.hd-boq-table tfoot tr { border-top: 1px solid var(--border); }
.hd-boq-table tfoot td { padding: 14px 22px; vertical-align: middle; }

.hd-boq-subtotal-row td {
  background: var(--ink-900);
  color: #f6e9d4;
  font-weight: 600;
  font-size: 13px;
}
.hd-boq-subtotal-row .hd-boq-col-total { color: #f6e9d4; }

.hd-boq-contingency-row td {
  background: var(--cream-50);
  color: var(--text);
  font-size: 13px;
}

.hd-boq-grandtotal-row td {
  background: var(--clay-500);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.hd-boq-grandtotal-row .hd-boq-col-total { color: #fff; }

/* ── Right rail ────────────────────────────────────────────── */
.hd-boq-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-boq-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* Cost-breakdown bars */
.hd-boq-bars {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-boq-bar-row { display: flex; flex-direction: column; gap: 4px; }
.hd-boq-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text);
}
.hd-boq-bar-head > .mono { color: var(--text-muted); font-weight: 500; }
.hd-boq-bar {
  position: relative;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--cream-150);
  overflow: hidden;
}
.hd-boq-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
}
.hd-boq-bar-fill--clay  { background: var(--clay-500); }
.hd-boq-bar-fill--olive { background: var(--olive-500); }
.hd-boq-bar-fill--rose  { background: var(--rose-500); }
.hd-boq-bar-fill--gold  { background: var(--gold-500); }

/* Assumptions list */
.hd-boq-assumptions {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hd-boq-assumptions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-boq-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay-500);
  margin-top: 7px;
  flex-shrink: 0;
}

/* Concept-estimate disclaimer (gold tinted callout) */
.hd-boq-disclaimer {
  background: var(--gold-100);
  border: 1px solid var(--gold-100);
  border-radius: var(--r-xl);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-boq-disc-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
}
.hd-boq-disc-head > svg { color: var(--gold-500); }
.hd-boq-disc-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-boq-disc-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  color: var(--clay-700);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.hd-boq-disc-cta:hover { color: var(--clay-600); text-decoration: underline; }

/* =============================================================
   Workflow run timeline
   ============================================================= */
.hd-wf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-wf { grid-template-columns: 1fr; } }

/* ── Left stage: header + step list ────────────────────────── */
.hd-wf-stage {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px 22px;
}

.hd-wf-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.hd-wf-title {
  margin: 2px 0 0;
  font-size: 21px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hd-wf-title-sep { color: var(--text-subtle); }
.hd-wf-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--olive-100);
  color: var(--olive-600);
  border: 1px solid var(--olive-100);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-wf-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--olive-500);
  box-shadow: 0 0 0 3px rgba(95, 122, 62, 0.18);
  animation: hd-wf-pulse 1.6s ease-in-out infinite;
}
@keyframes hd-wf-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(95, 122, 62, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(95, 122, 62, 0.06); }
}
.hd-wf-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ── Step list ─────────────────────────────────────────────── */
.hd-wf-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.hd-wf-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 7px;
  width: 1.5px;
  background: var(--border-strong);
}
.hd-wf-step {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  padding: 12px 0 12px 0;
}
.hd-wf-step-dot {
  position: relative;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cream-300);
  margin-top: 4px;
  z-index: 1;
  border: 3px solid var(--bg-elev);
  box-sizing: content-box;
  margin-left: 0;
  transform: translateX(-3px);
}
.hd-wf-step--done    .hd-wf-step-dot { background: var(--olive-500); }
.hd-wf-step--running .hd-wf-step-dot {
  background: var(--gold-500);
  animation: hd-wf-pulse-gold 1.4s ease-in-out infinite;
}
.hd-wf-step--pending .hd-wf-step-dot { background: var(--rose-500); }
@keyframes hd-wf-pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 146, 58, 0.42); }
  50%      { box-shadow: 0 0 0 6px rgba(200, 146, 58, 0); }
}

.hd-wf-step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hd-wf-step-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hd-wf-step-agent {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
  font-weight: 500;
  text-transform: uppercase;
}
.hd-wf-step-time {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hd-wf-step-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
.hd-wf-step--pending .hd-wf-step-msg { color: var(--text-muted); }
.hd-wf-step-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 3px 10px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--clay-50);
  color: var(--clay-700);
  border: 1px solid var(--clay-100);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* ── Right rail ────────────────────────────────────────────── */
.hd-wf-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-wf-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* Queue health rows */
.hd-wf-queues { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.hd-wf-queue {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.hd-wf-queue:first-child { border-top: 0; padding-top: 4px; }
.hd-wf-queue-name { color: var(--text); letter-spacing: 0.01em; }
.hd-wf-queue-depth { color: var(--text); font-weight: 500; }
.hd-wf-queue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.hd-wf-queue-dot--ok    { background: var(--olive-500); }
.hd-wf-queue-dot--warn  { background: var(--gold-500); }
.hd-wf-queue-dot--error { background: var(--rose-500); }

/* Cost & retries stats */
.hd-wf-stats { margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.hd-wf-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.hd-wf-stats > div:first-child { border-top: 0; padding-top: 4px; }
.hd-wf-stats dt { color: var(--text-muted); margin: 0; }
.hd-wf-stats dd { margin: 0; color: var(--text); font-weight: 500; }
.hd-wf-stats-muted { color: var(--text-muted); }
.hd-wf-stats-note { font-size: 10.5px; color: var(--text-subtle); font-weight: 400; }

/* Restart button */
.hd-wf-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-wf-restart:hover { background: var(--cream-100); border-color: var(--border-strong); }
.hd-wf-restart > svg { color: var(--clay-600); }

.hd-wf-review-cta {
  text-decoration: none;
  width: 100%;
  padding: 13px 18px;
  font-size: 13.5px;
}

/* =============================================================
   Professional review
   ============================================================= */
.hd-rv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-rv { grid-template-columns: 1fr; } }

/* ── Left stage ────────────────────────────────────────────── */
.hd-rv-stage {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hd-rv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.hd-rv-title {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.hd-rv-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.hd-rv-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--clay-500);
  box-shadow: 0 0 0 3px rgba(199, 90, 50, 0.18);
  animation: hd-wf-pulse 1.6s ease-in-out infinite;
}

/* ── Body: markup canvas | comments ────────────────────────── */
.hd-rv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .hd-rv-body { grid-template-columns: 1fr; } }

.hd-rv-markup { display: flex; flex-direction: column; gap: 8px; }
.hd-rv-markup-canvas {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hd-rv-markup-canvas .hd-fp-thumb { border: 0; border-radius: 0; }
.hd-rv-markup-canvas .hd-fp-thumb > svg { aspect-ratio: 360 / 220; }
.hd-rv-markup-eyebrow {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-700);
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}
.hd-rv-markup-sub {
  position: absolute;
  top: 22px;
  left: 12px;
  font-size: 9px;
  color: var(--text-muted);
  z-index: 2;
  pointer-events: none;
}
.hd-rv-markup-compass { position: absolute; top: 8px; right: 10px; z-index: 2; pointer-events: none; }

/* Numbered markers placed over the markup */
.hd-rv-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(31, 26, 20, 0.28);
  border: 2px solid var(--cream-50);
  z-index: 3;
  pointer-events: none;
}
.hd-rv-marker--clay  { background: var(--clay-500); }
.hd-rv-marker--gold  { background: var(--gold-500); }
.hd-rv-marker--rose  { background: var(--rose-500); }
.hd-rv-marker--olive { background: var(--olive-500); }

/* ── Comment list ──────────────────────────────────────────── */
.hd-rv-comments { display: flex; flex-direction: column; gap: 8px; }
.hd-rv-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hd-rv-comment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-rv-comment--clay  { border-left: 4px solid var(--clay-500); }
.hd-rv-comment--gold  { border-left: 4px solid var(--gold-500); }
.hd-rv-comment--rose  { border-left: 4px solid var(--rose-500); }
.hd-rv-comment--olive { border-left: 4px solid var(--olive-500); }
.hd-rv-comment-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
}
.hd-rv-comment--clay  .hd-rv-comment-num { background: var(--clay-500); }
.hd-rv-comment--gold  .hd-rv-comment-num { background: var(--gold-500); }
.hd-rv-comment--rose  .hd-rv-comment-num { background: var(--rose-500); }
.hd-rv-comment--olive .hd-rv-comment-num { background: var(--olive-500); }
.hd-rv-comment-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hd-rv-comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-rv-comment-author { font-size: 11.5px; color: var(--text-muted); }
.hd-rv-comment-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

/* Severity tags */
.hd-rv-sev {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.hd-rv-sev--must     { background: var(--clay-100);  color: var(--clay-700);  }
.hd-rv-sev--should   { background: var(--gold-100);  color: var(--gold-500);  }
.hd-rv-sev--consider { background: var(--cream-150); color: var(--text-muted);}
.hd-rv-sev--good     { background: var(--olive-100); color: var(--olive-600); }

/* ── Review timeline (horizontal stepper) ──────────────────── */
.hd-rv-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.hd-rv-tl-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) { .hd-rv-tl-steps { grid-template-columns: repeat(3, 1fr); } }
.hd-rv-tl-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--text);
}
.hd-rv-tl-step::before {
  content: "";
  position: absolute;
  left: 14px; right: -12px;
  top: 5px;
  height: 1.5px;
  background: var(--cream-300);
}
.hd-rv-tl-step:last-child::before { display: none; }
.hd-rv-tl-step--done::before { background: var(--olive-500); }
.hd-rv-tl-step--active::before { background: var(--cream-300); }
.hd-rv-tl-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cream-300);
  border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1.5px var(--cream-300);
}
.hd-rv-tl-step--done .hd-rv-tl-dot {
  background: var(--olive-500);
  box-shadow: 0 0 0 1.5px var(--olive-500);
}
.hd-rv-tl-step--active .hd-rv-tl-dot {
  background: var(--clay-500);
  box-shadow: 0 0 0 1.5px var(--clay-500), 0 0 0 5px rgba(199, 90, 50, 0.18);
}
.hd-rv-tl-name { font-weight: 500; }
.hd-rv-tl-step--pending .hd-rv-tl-name { color: var(--text-subtle); }
.hd-rv-tl-stamp {
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hd-rv-tl-step--pending .hd-rv-tl-stamp { color: var(--text-subtle); }
.hd-rv-tl-note {
  font-size: 10.5px;
  color: var(--clay-700);
  font-weight: 500;
}

/* ── Right rail ────────────────────────────────────────────── */
.hd-rv-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-rv-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* Reviewer card */
.hd-rv-reviewer-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; }
.hd-rv-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--clay-500);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.hd-rv-reviewer-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-rv-reviewer-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.hd-rv-reviewer-sub { font-size: 11.5px; color: var(--text-muted); }
.hd-rv-reviewer-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.hd-rv-reviewer-rating .mono { color: var(--text); font-weight: 500; }
.hd-rv-reviewer-rating-sep { color: var(--text-subtle); }

/* Package contents list */
.hd-rv-package {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-rv-package li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text);
}
.hd-rv-package li:first-child { border-top: 0; padding-top: 4px; }
.hd-rv-package li > svg { color: var(--clay-600); flex-shrink: 0; }

/* Cost breakdown list */
.hd-rv-cost {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-rv-cost li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.hd-rv-cost li:first-child { border-top: 0; padding-top: 4px; }
.hd-rv-cost li > .mono { color: var(--text); font-weight: 500; }
.hd-rv-cost-total {
  font-weight: 600;
  color: var(--text) !important;
  border-top: 1px solid var(--border-strong) !important;
  padding-top: 10px !important;
  margin-top: 2px;
}
.hd-rv-cost-total > .mono { color: var(--clay-700); font-size: 13px; }

/* Action buttons */
.hd-rv-apply {
  width: 100%;
  padding: 13px 18px;
  font-size: 13.5px;
  text-decoration: none;
}
.hd-rv-msg {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-rv-msg:hover { background: var(--cream-100); border-color: var(--cream-400); }

/* =============================================================
   Share / public preview
   ============================================================= */
.hd-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-share { grid-template-columns: 1fr; } }

/* ── Left stage ────────────────────────────────────────────── */
.hd-sh-stage {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hd-sh-head { display: flex; flex-direction: column; gap: 6px; }
.hd-sh-title {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.hd-sh-section { display: flex; flex-direction: column; gap: 10px; }
.hd-sh-section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hd-sh-section-label {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
}
.hd-sh-hint {
  font-size: 10.5px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

/* ── Visibility radio cards ────────────────────────────────── */
.hd-sh-vis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) { .hd-sh-vis-grid { grid-template-columns: 1fr; } }
.hd-sh-vis { position: relative; cursor: pointer; }
.hd-sh-vis input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.hd-sh-vis-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  transition: background 0.15s, border-color 0.15s;
}
.hd-sh-vis:hover .hd-sh-vis-card { background: var(--cream-100); }
.hd-sh-vis input:checked + .hd-sh-vis-card {
  background: var(--clay-50);
  border-color: var(--clay-400);
  box-shadow: 0 0 0 3px var(--clay-100);
}
.hd-sh-vis-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-sh-vis input:checked + .hd-sh-vis-card .hd-sh-vis-name { color: var(--clay-700); }
.hd-sh-vis-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Public link row ───────────────────────────────────────── */
.hd-sh-link-row { display: flex; gap: 8px; }
.hd-sh-link-input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--cream-50);
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.hd-sh-link-input:focus { border-color: var(--clay-400); box-shadow: 0 0 0 3px var(--clay-100); }

/* ── Toggle list ───────────────────────────────────────────── */
.hd-sh-toggles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-sh-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.hd-sh-toggle-row:first-child { border-top: 0; padding-top: 4px; }
.hd-sh-toggle-label { letter-spacing: -0.005em; }

/* ── Expires dropdown ──────────────────────────────────────── */
.hd-sh-expires {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.hd-sh-expires:hover { background: var(--cream-100); }
.hd-sh-expires > svg { color: var(--text-subtle); }

/* ── WhatsApp CTA ──────────────────────────────────────────── */
.hd-sh-whatsapp {
  width: 100%;
  padding: 13px 18px;
  font-size: 13.5px;
}

/* ── Right rail: live public preview window ────────────────── */
.hd-sh-preview-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 28px;
}
.hd-sh-preview-label {
  letter-spacing: 0.18em;
  color: var(--text-subtle);
}

.hd-sh-window {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.hd-sh-window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--ink-900);
  border-bottom: 1px solid var(--ink-800);
}
.hd-sh-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.hd-sh-dot:nth-child(1) { background: #c75a32; }
.hd-sh-dot:nth-child(2) { background: #c8923a; }
.hd-sh-dot:nth-child(3) { background: #6f8348; }
.hd-sh-window-url {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: rgba(251, 247, 241, 0.7);
  letter-spacing: 0.02em;
}

.hd-sh-window-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-sh-preview-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
}
.hd-sh-preview-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.hd-sh-preview-canvas {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.hd-sh-preview-canvas .hd-fp-thumb { border: 0; border-radius: 0; }
.hd-sh-preview-canvas .hd-fp-thumb > svg { aspect-ratio: 360 / 220; }
.hd-sh-preview-canvas-eyebrow {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-700);
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}
.hd-sh-preview-canvas-sub {
  position: absolute;
  top: 22px;
  left: 12px;
  font-size: 9px;
  color: var(--text-muted);
  z-index: 2;
  pointer-events: none;
}
.hd-sh-preview-compass { position: absolute; top: 8px; right: 10px; z-index: 2; pointer-events: none; }

.hd-sh-watermark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(31, 26, 20, 0.78);
  color: var(--cream-50);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hd-sh-preview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.hd-sh-preview-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--cream-50);
  border: 1px solid var(--border);
}
.hd-sh-preview-card-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

/* =============================================================
   Reports & exports
   ============================================================= */
.hd-rx {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Top: 4 format cards ───────────────────────────────────── */
.hd-rx-formats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .hd-rx-formats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .hd-rx-formats { grid-template-columns: 1fr; } }

.hd-rx-fmt {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.hd-rx-fmt:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.hd-rx-fmt-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--cream-100);
  color: var(--clay-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.hd-rx-fmt-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.hd-rx-fmt-name {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.hd-rx-fmt-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hd-rx-fmt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.hd-rx-fmt-price {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hd-rx-fmt-price--clay  { color: var(--clay-600); }
.hd-rx-fmt-price--olive { color: var(--olive-600); }
.hd-rx-fmt-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.hd-rx-fmt-cta:hover { color: var(--clay-700); }
.hd-rx-fmt-cta > svg { transition: transform 0.15s; }
.hd-rx-fmt-cta:hover > svg { transform: translateX(2px); }

/* ── Recent exports card ───────────────────────────────────── */
.hd-rx-recent-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hd-rx-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
}

/* ── Table ─────────────────────────────────────────────────── */
.hd-rx-recent-wrap { overflow-x: auto; }
.hd-rx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.hd-rx-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-rx-col-num    { text-align: right; width: 80px; }
.hd-rx-col-actions{ width: 72px; }
.hd-rx-col-file   { min-width: 280px; }

.hd-rx-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.hd-rx-table tbody tr:last-child { border-bottom: 0; }
.hd-rx-table tbody tr:hover { background: var(--cream-50); }
.hd-rx-table tbody td {
  padding: 13px 22px;
  vertical-align: middle;
  color: var(--text);
}
.hd-rx-cell-muted { color: var(--text-muted); }
.hd-rx-table .hd-rx-col-num { text-align: right; color: var(--text); }

.hd-rx-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hd-rx-file-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--cream-100);
  color: var(--clay-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-rx-file-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.hd-rx-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--cream-100);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
}

.hd-rx-cost {
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-rx-cost--clay  { color: var(--clay-700); }
.hd-rx-cost--olive { color: var(--olive-600); }

.hd-rx-actions {
  white-space: nowrap;
  text-align: right;
}
.hd-rx-action {
  width: 28px; height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hd-rx-action:hover { background: var(--cream-100); color: var(--text); }
.hd-rx-action + .hd-rx-action { margin-left: 2px; }

/* =============================================================
   Professional marketplace
   ============================================================= */
.hd-mp {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Hero strip ────────────────────────────────────────────── */
.hd-mp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--cream-50) 0%, var(--cream-100) 60%, var(--clay-50) 100%);
  flex-wrap: wrap;
}
.hd-mp-hero-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 70ch; }
.hd-mp-hero-eyebrow { color: var(--clay-700) !important; }
.hd-mp-hero-title {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.18;
}
.hd-mp-hero-title em { color: var(--clay-600); font-style: italic; font-weight: 400; }
.hd-mp-hero-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 80ch;
}
.hd-mp-hero-actions { display: inline-flex; align-items: center; gap: 10px; }

/* ── 2x2 card grid ─────────────────────────────────────────── */
.hd-mp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) { .hd-mp-grid { grid-template-columns: 1fr; } }

.hd-mp-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.hd-mp-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ── Card head: avatar · identity · fee ────────────────────── */
.hd-mp-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: flex-start;
}
.hd-mp-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--clay-100);
  color: var(--clay-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.hd-mp-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-mp-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-mp-verified { color: var(--olive-500); }
.hd-mp-credential {
  font-size: 12px;
  color: var(--text-muted);
}
.hd-mp-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.hd-mp-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hd-mp-rating .mono { color: var(--text); font-weight: 500; }
.hd-mp-meta-muted { color: var(--text-subtle); }
.hd-mp-meta-sep { color: var(--text-subtle); }
.hd-mp-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hd-mp-loc > svg { color: var(--clay-600); }

.hd-mp-fee {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  text-align: right;
  flex-shrink: 0;
}
.hd-mp-fee-value {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.1;
}
.hd-mp-fee-foot {
  font-size: 10.5px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

/* ── Tags row ──────────────────────────────────────────────── */
.hd-mp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-mp-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--cream-100);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ── Card footer ───────────────────────────────────────────── */
.hd-mp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.hd-mp-response {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.hd-mp-response > svg { color: var(--text-subtle); }
.hd-mp-card-actions { display: inline-flex; align-items: center; gap: 12px; }
.hd-mp-profile-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.hd-mp-profile-link:hover { color: var(--clay-700); text-decoration: underline; }
.hd-mp-card-foot .hd-btn-dark {
  font-size: 12.5px;
  padding: 8px 16px;
}

/* =============================================================
   Notifications inbox
   ============================================================= */
.hd-nx {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-nx { grid-template-columns: 1fr; } }

/* ── Inbox card ────────────────────────────────────────────── */
.hd-nx-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hd-nx-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-wrap: wrap;
}
.hd-nx-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.hd-nx-tab:hover { background: var(--cream-100); color: var(--text); }
.hd-nx-tab.is-active {
  background: var(--ink-900);
  color: var(--cream-50);
}
.hd-nx-tab-n { letter-spacing: 0.02em; opacity: 0.85; }
.hd-nx-tab.is-active .hd-nx-tab-n { color: var(--cream-50); }

/* ── Item list ─────────────────────────────────────────────── */
.hd-nx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-nx-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  transition: background 0.12s;
}
.hd-nx-item:last-child { border-bottom: 0; }
.hd-nx-item.is-unread { background: var(--clay-50); }
.hd-nx-item:hover { background: var(--cream-100); }
.hd-nx-item.is-unread:hover { background: var(--clay-100); }

.hd-nx-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-nx-icon--spark  { color: var(--clay-600); }
.hd-nx-icon--review { color: var(--olive-600); }
.hd-nx-icon--image  { color: var(--clay-600); }
.hd-nx-icon--warn   { color: var(--gold-500); border-color: var(--gold-100); background: var(--gold-100); }
.hd-nx-icon--coin   { color: var(--olive-600); }
.hd-nx-icon--people { color: var(--clay-600); }
.hd-nx-icon--shield { color: var(--text-muted); }

.hd-nx-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-nx-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-nx-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.hd-nx-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-subtle);
  white-space: nowrap;
}
.hd-nx-ago { letter-spacing: 0.01em; }
.hd-nx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay-500);
  box-shadow: 0 0 0 2px var(--clay-100);
}

.hd-nx-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Right rail ────────────────────────────────────────────── */
.hd-nx-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Quick actions (light card) */
.hd-nx-quick-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hd-nx-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.hd-nx-quick:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-nx-quick > svg { color: var(--text-muted); flex-shrink: 0; }

/* Daily digest (dark card) */
.hd-nx-digest {
  background: var(--ink-900);
  color: var(--cream-50);
  border-radius: var(--r-xl);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-md);
}
.hd-nx-digest-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-100);
  font-weight: 500;
}
.hd-nx-digest-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(251, 247, 241, 0.72);
}
.hd-nx-digest-cta {
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--cream-50);
  color: var(--ink-900);
  border: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.hd-nx-digest-cta:hover { background: #fff; }

/* =============================================================
   Settings (Teams & Roles)
   ============================================================= */
.hd-st {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1000px) { .hd-st { grid-template-columns: 1fr; } }

/* ── Settings rail (inside-the-page nav) ───────────────────── */
.hd-st-rail {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}
.hd-st-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.hd-st-link:hover { background: var(--cream-100); color: var(--text); }
.hd-st-link.is-active {
  background: var(--clay-100);
  color: var(--clay-700);
}
.hd-st-link-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── Content card ──────────────────────────────────────────── */
.hd-st-content {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hd-st-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.hd-st-title {
  margin: 2px 0 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hd-st-placeholder {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.hd-st-placeholder a { color: var(--clay-700); }

/* ── Members table ─────────────────────────────────────────── */
.hd-st-table-wrap { overflow-x: auto; }
.hd-st-members,
.hd-st-perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.hd-st-members thead th,
.hd-st-perm-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-st-col-member { width: 38%; }
.hd-st-col-role   { width: 160px; }
.hd-st-col-num    { width: 90px; text-align: left; }
.hd-st-col-actions { width: 48px; }

.hd-st-members tbody tr,
.hd-st-perm-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.hd-st-members tbody tr:last-child,
.hd-st-perm-table tbody tr:last-child { border-bottom: 0; }
.hd-st-members tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  color: var(--text);
}
.hd-st-cell-muted { color: var(--text-muted); }

/* Member identity cell */
.hd-st-member { display: inline-flex; align-items: center; gap: 12px; }
.hd-st-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.hd-st-member-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-st-member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-st-member-email {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Role select pill */
.hd-st-role-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 140px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-st-role-select:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-st-role-select > svg { color: var(--text-subtle); }

.hd-st-actions { white-space: nowrap; text-align: right; }
.hd-st-row-more {
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hd-st-row-more:hover { background: var(--cream-100); color: var(--text); }

/* ── Role permissions matrix ───────────────────────────────── */
.hd-st-perm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.hd-st-col-cap { width: 38%; text-align: left !important; }
.hd-st-perm-table thead th { text-align: center; }
.hd-st-perm-table thead th:first-child { text-align: left; }
.hd-st-perm-table tbody th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text);
}
.hd-st-perm-cell {
  padding: 12px 16px;
  text-align: center;
  vertical-align: middle;
}
.hd-st-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--olive-600);
}
.hd-st-dash {
  color: var(--cream-400);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Audit list (lightweight) */
.hd-st-audit {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-st-audit li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.hd-st-audit li:last-child { border-bottom: 0; }

/* =============================================================
   Plans & credits (billing)
   ============================================================= */
.hd-bl {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hd-bl-plans-head { display: flex; flex-direction: column; gap: 6px; }
.hd-bl-plans-title {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hd-bl-plans-title em { color: var(--clay-600); font-style: italic; font-weight: 400; }

/* ── Plan-card grid (4-up) ─────────────────────────────────── */
.hd-bl-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .hd-bl-plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .hd-bl-plans { grid-template-columns: 1fr; } }

.hd-bl-plan {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.hd-bl-plan:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.hd-bl-plan.is-highlight {
  border-color: var(--clay-400);
  box-shadow: 0 0 0 3px var(--clay-100), var(--shadow-md);
}

.hd-bl-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hd-bl-popular {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hd-bl-plan-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}
.hd-bl-plan-amount {
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hd-bl-plan-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.hd-bl-plan-tagline {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.hd-bl-plan-features {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.hd-bl-plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
}
.hd-bl-plan-features li > svg { color: var(--olive-500); flex-shrink: 0; }

.hd-bl-plan-cta {
  margin-top: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hd-bl-plan-cta--primary {
  background: var(--clay-500);
  color: #fff;
  border: 1px solid var(--clay-500);
  box-shadow: var(--shadow-clay);
}
.hd-bl-plan-cta--primary:hover { background: var(--clay-600); border-color: var(--clay-600); }
.hd-bl-plan-cta--outline {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.hd-bl-plan-cta--outline:hover { background: var(--cream-100); border-color: var(--cream-400); }

/* ── Bottom row: packs · wallet ────────────────────────────── */
.hd-bl-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) { .hd-bl-bottom { grid-template-columns: 1fr; } }

.hd-bl-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.hd-bl-card-head { display: flex; flex-direction: column; gap: 4px; }
.hd-bl-card-title {
  margin: 2px 0 0;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hd-bl-card-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Pack tiles */
.hd-bl-pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) { .hd-bl-pack-grid { grid-template-columns: repeat(2, 1fr); } }
.hd-bl-pack {
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.hd-bl-pack:hover {
  background: var(--clay-50);
  border-color: var(--clay-400);
  transform: translateY(-1px);
}
.hd-bl-pack-icon { color: var(--clay-600); }
.hd-bl-pack-credits {
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 2px;
}
.hd-bl-pack-price {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hd-bl-pack-bonus {
  display: inline-flex;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--olive-100);
  color: var(--olive-600);
  font-size: 10.5px;
  font-weight: 500;
}

/* Pay row */
.hd-bl-pay-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hd-bl-pay-mpesa {
  width: auto;
  padding: 10px 18px;
  font-size: 13px;
  text-decoration: none;
}
.hd-bl-pay-alt {
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-bl-pay-alt:hover { background: var(--cream-100); border-color: var(--cream-400); }

/* ── Wallet card ───────────────────────────────────────────── */
.hd-bl-wallet { gap: 10px; }
.hd-bl-wallet-balance {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.hd-bl-wallet-value {
  font-size: 44px;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text);
}
.hd-bl-wallet-unit {
  font-size: 14px;
  color: var(--text-muted);
}
.hd-bl-wallet-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.hd-bl-progress {
  position: relative;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--cream-150);
  margin-top: 6px;
}
.hd-bl-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: var(--clay-500);
}
.hd-bl-progress-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Recent transactions */
.hd-bl-tx-head { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.hd-bl-tx {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-bl-tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.hd-bl-tx-row:last-child { border-bottom: 0; }
.hd-bl-tx-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-bl-tx-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.hd-bl-tx-stamp {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.01em;
}
.hd-bl-tx-delta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hd-bl-tx-delta--spend  { color: var(--text); }
.hd-bl-tx-delta--credit { color: var(--olive-600); }

/* =============================================================
   Admin · platform health
   ============================================================= */
.hd-ad {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── 6-stat strip ──────────────────────────────────────────── */
.hd-ad-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 18px 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 1100px) { .hd-ad-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .hd-ad-stats { grid-template-columns: repeat(2, 1fr); } }
.hd-ad-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 22px;
  border-left: 1px solid var(--border);
  min-width: 0;
}
.hd-ad-stat:first-child { border-left: 0; }
@media (max-width: 1100px) { .hd-ad-stat:nth-child(3n+1) { border-left: 0; } }
@media (max-width: 600px)  { .hd-ad-stat:nth-child(2n+1) { border-left: 0; } }

.hd-ad-stat-value {
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.hd-ad-stat-value--clay { color: var(--clay-600); }
.hd-ad-stat-foot {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hd-ad-stat-foot--olive { color: var(--olive-600); }

/* ── Body grid: runs | rail ────────────────────────────────── */
.hd-ad-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-ad-body { grid-template-columns: 1fr; } }

/* ── Workflow-runs card ────────────────────────────────────── */
.hd-ad-runs-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hd-ad-runs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
}
.hd-ad-runs-title {
  margin: 2px 0 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.hd-ad-table-wrap { overflow-x: auto; }
.hd-ad-runs {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.hd-ad-runs thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.hd-ad-col-id      { width: 80px; }
.hd-ad-col-num     { text-align: right; width: 80px; }
.hd-ad-col-actions { width: 80px; text-align: right; }

.hd-ad-runs tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.hd-ad-runs tbody tr:last-child { border-bottom: 0; }
.hd-ad-runs tbody tr:hover { background: var(--cream-50); }
.hd-ad-runs tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  color: var(--text);
}
.hd-ad-runs .hd-ad-col-num { text-align: right; }

.hd-ad-id { color: var(--text); font-weight: 500; }
.hd-ad-cell-strong { font-weight: 500; }
.hd-ad-cell-muted { color: var(--text-muted); }

/* Status pills */
.hd-ad-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-ad-status--ok       { background: var(--cream-100); color: var(--text-muted); border: 1px solid var(--border); }
.hd-ad-status--running  { background: var(--clay-100);  color: var(--clay-700);   border: 1px solid var(--clay-200); }
.hd-ad-status--retrying { background: var(--olive-100); color: var(--olive-600);  border: 1px solid var(--olive-100); }
.hd-ad-status--failed   { background: var(--rose-100);  color: var(--rose-500);   border: 1px solid var(--rose-100); }

.hd-ad-actions { white-space: nowrap; text-align: right; }
.hd-ad-retry {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hd-ad-retry:hover { background: var(--cream-100); border-color: var(--cream-400); }
.hd-ad-row-more {
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hd-ad-row-more:hover { background: var(--cream-100); color: var(--text); }

/* ── Right rail ────────────────────────────────────────────── */
.hd-ad-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-ad-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

/* Queue depth bars */
.hd-ad-queues {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hd-ad-queue { display: flex; flex-direction: column; gap: 4px; }
.hd-ad-queue-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.hd-ad-queue-name { color: var(--text); letter-spacing: 0.01em; }
.hd-ad-queue-depth { color: var(--text-muted); }
.hd-ad-queue-bar {
  position: relative;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--cream-150);
  overflow: hidden;
}
.hd-ad-queue-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
}
.hd-ad-queue-fill--olive { background: var(--olive-500); }
.hd-ad-queue-fill--gold  { background: var(--gold-500); }
.hd-ad-queue-fill--rose  { background: var(--rose-500); }

/* Suspicious uploads */
.hd-ad-suspect {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-ad-suspect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
}
.hd-ad-suspect-row:first-child { border-top: 0; padding-top: 4px; }
.hd-ad-suspect-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-ad-suspect-file {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.hd-ad-suspect-meta {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.01em;
}
.hd-ad-suspect-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hd-ad-suspect-state--rose  { background: var(--rose-100);  color: var(--rose-500);  border: 1px solid var(--rose-100); }
.hd-ad-suspect-state--olive { background: var(--olive-100); color: var(--olive-600); border: 1px solid var(--olive-100); }

/* =============================================================
   Edge cases & error states
   (reusable banner + system gallery)
   ============================================================= */

/* ── Reusable card ─────────────────────────────────────────── */
.hd-ec {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 16px 18px 18px;
  border-radius: var(--r-xl);
  border: 1px solid transparent;
  transition: box-shadow 0.18s, transform 0.18s;
}
.hd-ec:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.hd-ec--warning {
  background: var(--gold-100);
  border-color: #ecdca6;
}
.hd-ec--error {
  background: var(--clay-100);
  border-color: var(--clay-200);
}
.hd-ec--success {
  background: var(--olive-100);
  border-color: #cdd5b1;
}

.hd-ec-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.hd-ec--warning .hd-ec-icon { background: var(--gold-500); color: #fff; }
.hd-ec--error   .hd-ec-icon { background: var(--clay-500); color: #fff; }
.hd-ec--success .hd-ec-icon { background: var(--olive-500); color: #fff; }

.hd-ec-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hd-ec-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.hd-ec-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-700);
}
.hd-ec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.hd-ec-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.hd-ec-btn--primary {
  background: var(--clay-500);
  color: #fff;
  border-color: var(--clay-500);
}
.hd-ec-btn--primary:hover { background: var(--clay-600); border-color: var(--clay-600); color: #fff; }
.hd-ec-btn--ghost {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
}
.hd-ec-btn--ghost:hover { background: var(--cream-100); }

.hd-ec-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 4px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.hd-ec-link:hover { color: var(--clay-700); text-decoration: underline; }

.hd-ec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--ink-600);
  opacity: 0.78;
}
.hd-ec-tag-sep { opacity: 0.6; }

/* Inline preview banner (renders above the page) */
.hd-edge-banner {
  margin-bottom: 14px;
}

/* ── System gallery page ───────────────────────────────────── */
.hd-ec-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hd-ec-page-head { display: flex; flex-direction: column; gap: 6px; }
.hd-ec-page-title {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hd-ec-page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 80ch;
}

.hd-ec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) { .hd-ec-grid { grid-template-columns: 1fr; } }

/* =============================================================
   Mobile companion (showcase gallery)
   ============================================================= */
.hd-mob {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hd-mob-head { display: flex; flex-direction: column; gap: 6px; }
.hd-mob-title {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hd-mob-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 80ch;
}

.hd-mob-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 18px;
  align-items: start;
}
@media (max-width: 1100px) { .hd-mob-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .hd-mob-grid { grid-template-columns: 1fr; } }

.hd-mob-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.hd-mob-cell figcaption {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ── Phone frame ───────────────────────────────────────────── */
.hd-mob-phone {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 280 / 580;
  background: var(--cream-50);
  border: 7px solid var(--ink-900);
  border-radius: 36px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hd-mob-phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 18px;
  border-radius: 12px;
  background: var(--ink-900);
  z-index: 5;
}
.hd-mob-status {
  position: absolute;
  top: 12px;
  left: 22px;
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--ink-900);
  z-index: 6;
}
.hd-mob-screen {
  flex: 1;
  padding: 36px 14px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Generic helpers */
.hd-mob-eyebrow {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
}
.hd-mob-section-label { margin-top: 4px; }

/* ── Home screen ───────────────────────────────────────────── */
.hd-mob-h-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.hd-mob-h-head > div { display: flex; flex-direction: column; gap: 1px; }
.hd-mob-h-title {
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
  margin-top: 2px;
}
.hd-mob-h-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--clay-200);
}

.hd-mob-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--clay-500);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-clay);
}
.hd-mob-cta--bottom { margin-top: auto; }

.hd-mob-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hd-mob-stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.hd-mob-stat-v { font-size: 22px; line-height: 1; color: var(--text); }

.hd-mob-projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-mob-projects li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.hd-mob-thumb {
  width: 28px; height: 22px;
  border-radius: 3px;
  background: var(--cream-200);
}
.hd-mob-thumb--clay  { background: linear-gradient(135deg, #f3c8b4 50%, #1f1a14 50%); }
.hd-mob-thumb--olive { background: linear-gradient(135deg, #dfe2cd 50%, #1f1a14 50%); }
.hd-mob-thumb--peach { background: linear-gradient(135deg, #fae0d3 50%, #a04032 50%); }
.hd-mob-thumb--cream { background: linear-gradient(135deg, #f6efe4 50%, #cabaa0 50%); }
.hd-mob-thumb--olive-soft { background: linear-gradient(135deg, #dfe2cd 50%, #5a6b3a 50%); }

.hd-mob-p-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hd-mob-p-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.hd-mob-p-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-muted);
}
.hd-mob-pdot {
  width: 5px; height: 5px;
  border-radius: 50%;
}
.hd-mob-pdot--rose  { background: var(--rose-500); }
.hd-mob-pdot--gold  { background: var(--gold-500); }
.hd-mob-pdot--olive { background: var(--olive-500); }
.hd-mob-chev { color: var(--text-subtle); font-size: 14px; line-height: 1; }

/* Bottom tab bar */
.hd-mob-tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 6px 4px 8px;
}
.hd-mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 8.5px;
  color: var(--text-subtle);
}
.hd-mob-tab.is-active { color: var(--clay-700); }

/* ── New-project step ──────────────────────────────────────── */
.hd-mob-back-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hd-mob-back {
  font-size: 16px;
  color: var(--text);
  line-height: 1;
}
.hd-mob-back-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.hd-mob-back-sub {
  display: block;
  font-size: 9.5px;
  color: var(--text-muted);
}
.hd-mob-more { margin-left: auto; color: var(--text-muted); }

.hd-mob-stepper { display: flex; gap: 4px; margin-top: 4px; }
.hd-mob-stepbar {
  flex: 1;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--cream-200);
}
.hd-mob-stepbar.is-on { background: var(--clay-500); }
.hd-mob-step-label { margin-top: 4px; }

.hd-mob-q {
  margin: 4px 0 0;
  font-size: 16px;
  letter-spacing: -0.005em;
  text-align: center;
  line-height: 1.2;
}
.hd-mob-stepper-num {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.hd-mob-step-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--clay-500);
  color: #fff;
  border: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.hd-mob-step-val {
  font-size: 24px;
  text-align: center;
  color: var(--text);
}

.hd-mob-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.hd-mob-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  font-size: 9.5px;
  color: var(--text-muted);
}
.hd-mob-tag.is-on {
  background: var(--clay-100);
  color: var(--clay-700);
  border-color: var(--clay-200);
}

/* ── Compare options ───────────────────────────────────────── */
.hd-mob-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}
.hd-mob-opt {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hd-mob-opt.is-recommended {
  border-color: var(--clay-400);
  box-shadow: 0 0 0 2px var(--clay-100);
}
.hd-mob-opt-thumb {
  width: 100%;
  height: 56px;
  border-radius: 4px;
  background: var(--cream-200);
  margin-bottom: 4px;
}
.hd-mob-opt-rec {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  font-size: 8px;
  font-weight: 600;
  border: 1px solid var(--clay-200);
}
.hd-mob-opt-name {
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.hd-mob-opt-price {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
}
.hd-mob-opt-spec {
  font-size: 9px;
  color: var(--text-muted);
}
.hd-mob-opt-tier--olive { color: var(--olive-600) !important; }
.hd-mob-opt-tier--gold  { color: var(--gold-500) !important; }

/* ── Plan/3D/etc pill tabs ─────────────────────────────────── */
.hd-mob-piltabs { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.hd-mob-piltab {
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--cream-100);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.hd-mob-piltab.is-active {
  background: var(--ink-900);
  color: var(--cream-50);
}
.hd-mob-plan-canvas {
  position: relative;
  flex: 1;
  margin-top: 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 16px, var(--cream-200) 16px 17px),
    repeating-linear-gradient(90deg, transparent 0 16px, var(--cream-200) 16px 17px),
    var(--cream-50);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.hd-mob-plan-fill {
  position: absolute;
  border: 1.5px solid var(--ink-900);
}
.hd-mob-plan-fill--clay  { background: var(--clay-200); }
.hd-mob-plan-fill--olive { background: var(--olive-100); }
.hd-mob-plan-fill--cream { background: var(--cream-150); }

/* ── BOQ summary ───────────────────────────────────────────── */
.hd-mob-boq-total {
  background: var(--ink-900);
  color: var(--cream-50);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}
.hd-mob-boq-total-label { color: rgba(251, 247, 241, 0.6); }
.hd-mob-boq-total-value {
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--cream-50);
}
.hd-mob-boq-total-foot {
  font-size: 9px;
  color: rgba(251, 247, 241, 0.6);
}
.hd-mob-boq-rows {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hd-mob-boq-rows li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text);
}
.hd-mob-boq-rows li:first-child { border-top: 0; }

/* ── Generating ────────────────────────────────────────────── */
.hd-mob-progress {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--cream-200);
  margin-top: 4px;
}
.hd-mob-progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--clay-500);
}
.hd-mob-runlist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-mob-runlist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text);
}
.hd-mob-rdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cream-300);
  flex-shrink: 0;
}
.hd-mob-runlist li.is-done .hd-mob-rdot    { background: var(--olive-500); }
.hd-mob-runlist li.is-running .hd-mob-rdot { background: var(--gold-500); }
.hd-mob-runlist li.is-pending { color: var(--text-subtle); }

/* =============================================================
   Global mobile shell (sidebar drawer + tighter topbar)
   ============================================================= */
.hd-mobile-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 8px;
}
.hd-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 20, 0.45);
  z-index: 50;
}

@media (max-width: 900px) {
  .hd-shell {
    grid-template-columns: 1fr;
    position: relative;
  }

  .hd-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .hd-shell.is-drawer-open .hd-sidebar { transform: translateX(0); }
  .hd-shell.is-drawer-open .hd-mobile-backdrop { display: block; }

  .hd-mobile-toggle { display: inline-flex; }

  /* Topbar: stack title + tools, tighten paddings */
  .hd-topbar {
    padding: 14px 16px;
    gap: 10px;
  }
  .hd-page-title { font-size: 22px; }
  .hd-page-sub   { font-size: 12px; }
  .hd-topbar-tools {
    gap: 6px;
    flex-wrap: wrap;
  }
  .hd-search { display: none; }
  .hd-screen-id { display: none; }
  .hd-credits {
    padding: 6px 10px;
    font-size: 11px;
  }
  .hd-icon-btn { width: 30px; height: 30px; }
  .hd-page { padding: 16px; }
}

@media (max-width: 540px) {
  .hd-topbar { padding: 12px 14px; }
  .hd-page-title { font-size: 19px; }
  .hd-page { padding: 14px; }
  .hd-credits > span:last-child { display: none; }
}

/* ─────────── Workspace snapshot (appended) ─────────── */
.hd-ws-snapshot {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hd-snap-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 340px);
  grid-template-rows: auto auto;
  gap: 18px;
}

.hd-snap-feature,
.hd-snap-activity,
.hd-snap-tip,
.hd-snap-freshness {
  border-radius: 14px;
  border: 1px solid var(--ink-300);
  background: #fdfaf3;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.hd-snap-feature {
  grid-column: 1;
  grid-row: 1;
  padding: 0;
  overflow: hidden;
}
.hd-snap-feature-art { background: var(--clay-100); }
.hd-snap-feature-art svg { display: block; width: 100%; height: auto; }
.hd-snap-feature-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 320 / 220;
}
.hd-snap-feature-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.hd-snap-feature-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hd-snap-feature-title { font-size: 18px; line-height: 1.2; margin: 0; }
.hd-snap-feature-meta { color: var(--text-muted); font-size: 12px; margin: 0; }
.hd-snap-feature-stamp {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-subtle); font-size: 12px; margin: 0;
}

.hd-status-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  background: var(--gold-100); color: var(--gold-500);
}
.hd-status-pill.gold { background: var(--gold-100); color: var(--gold-500); }

.hd-snap-activity {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.hd-snap-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.hd-snap-title { font-size: 18px; line-height: 1.2; margin: 0; }
.hd-snap-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.hd-snap-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--ink-300);
}
.hd-snap-item:first-child { border-top: 0; }
.hd-snap-avatar {
  flex: 0 0 28px; width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--clay-100); color: var(--clay-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.hd-snap-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hd-snap-item-text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.hd-snap-item-text strong { color: var(--ink-900); font-weight: 600; }
.hd-snap-item-text em { font-style: normal; color: var(--clay-600); }
.hd-snap-item-time { color: var(--text-subtle); font-size: 11px; }

.hd-snap-tip {
  grid-column: 3;
  grid-row: 1;
  background: var(--ink-900);
  color: #f6e9d4;
  border-color: var(--ink-900);
  gap: 10px;
}
.hd-snap-tip-label { color: #d8c9af; }
.hd-snap-tip-copy { font-size: 16px; line-height: 1.35; margin: 0; color: #f6e9d4; }
.hd-snap-tip-copy .display-italic { color: #f3c8b4; }
.hd-snap-tip-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: #fae0d3;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 12px; font-weight: 500; text-decoration: none;
  transition: background .15s ease;
}
.hd-snap-tip-cta:hover { background: rgba(255,255,255,0.14); }

.hd-snap-freshness {
  grid-column: 3;
  grid-row: 2;
  gap: 8px;
}
.hd-freshness-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; }
.hd-freshness-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--ink-300);
  font-size: 13px;
}
.hd-freshness-row:first-child { border-top: 0; }
.hd-freshness-region { color: var(--text); }
.hd-freshness-state { color: var(--text-subtle); font-size: 11px; }
.hd-freshness-stale .hd-freshness-state { color: var(--clay-600); }
.hd-freshness-flag { color: var(--clay-600); font-weight: 600; }

/* Floating tag-cloud nav (rendered on every home_design page via base.html) */
.hd-tagcloud {
  position: sticky;
  bottom: 16px;
  z-index: 40;
  margin: 28px auto 8px;
  width: fit-content;
  max-width: min(1100px, calc(100% - 32px));
  pointer-events: none;
}
.hd-tagcloud-inner {
  pointer-events: auto;
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--ink-300);
  background: rgba(253, 250, 243, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 6px 24px rgba(31, 26, 20, 0.10), 0 1px 2px rgba(31, 26, 20, 0.06);
}
.hd-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px; line-height: 1; color: var(--text-muted);
  white-space: nowrap; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.hd-tag:hover { background: var(--clay-50); color: var(--text); }
.hd-tag.is-active { background: var(--ink-900); color: #fae0d3; }
.hd-tag.is-active:hover { background: var(--ink-800); color: #fae0d3; }
.hd-tag svg { flex: 0 0 13px; }

.hd-tagcloud-collapse {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; color: var(--text-subtle); cursor: pointer;
  margin-left: 2px;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.hd-tagcloud-collapse:hover { background: var(--clay-50); color: var(--text); }

.hd-tagcloud.is-collapsed .hd-tagcloud-inner > .hd-tag { display: none; }
.hd-tagcloud.is-collapsed .hd-tagcloud-inner {
  padding: 6px;
  border-radius: 999px;
}
.hd-tagcloud.is-collapsed .hd-tagcloud-collapse {
  margin: 0;
  width: 30px; height: 30px;
  background: var(--ink-900); color: #fae0d3;
}
.hd-tagcloud.is-collapsed .hd-tagcloud-collapse svg { transform: rotate(180deg); }

/* Make sure page content doesn't sit underneath the floating bar */
.hd-page { padding-bottom: 56px; }

/* Tablet sizes: cloud wraps to 3-5 rows, so the full pill (999px) becomes a
   tall stadium that bleeds over content at the rounded corners. Switch to a
   softer rounded rectangle and reserve more vertical room on the page. */
@media (min-width: 721px) and (max-width: 1100px) {
  .hd-tagcloud {
    bottom: 14px;
    max-width: calc(100% - 24px);
  }
  .hd-tagcloud-inner {
    border-radius: 22px;
    padding: 8px 10px;
    gap: 4px;
  }
  .hd-tagcloud.is-collapsed .hd-tagcloud-inner { border-radius: 999px; }
  .hd-page { padding-bottom: 180px; }
}

@media (max-width: 720px) {
  .hd-tagcloud { bottom: 10px; max-width: calc(100% - 16px); }
  .hd-tagcloud-inner { padding: 6px 8px; gap: 3px; border-radius: 18px; }
  .hd-tagcloud.is-collapsed .hd-tagcloud-inner { border-radius: 999px; }
  .hd-tag { padding: 6px 10px; font-size: 11.5px; }
  .hd-page { padding-bottom: 200px; }
}

@media (max-width: 1100px) {
  .hd-snap-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hd-snap-feature { grid-column: 1; grid-row: 1; }
  .hd-snap-tip { grid-column: 2; grid-row: 1; }
  .hd-snap-activity { grid-column: 1 / -1; grid-row: 2; }
  .hd-snap-freshness { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 720px) {
  .hd-snap-grid { grid-template-columns: 1fr; }
  .hd-snap-feature,
  .hd-snap-tip,
  .hd-snap-activity,
  .hd-snap-freshness { grid-column: 1; }
  .hd-snap-feature { grid-row: auto; }
  .hd-snap-tip { grid-row: auto; }
  .hd-snap-activity { grid-row: auto; }
  .hd-snap-freshness { grid-row: auto; }
}
