/* ============================================================
   portal.css — Provider portal
   Reuses the design-system tokens from base.css. Two-panel editor
   with structured inputs, live preview and a matching Tide
   login flow.
   ============================================================ */

/* The `hidden` attribute must win over component-level display rules.
   Several classes in here (.editor-view → grid, .field-label →
   inline-block, .btn → inline-flex) would otherwise leak through
   `hidden`, causing pre-login chrome and the editor to bleed onto the
   portal landing. */
[hidden] { display: none !important; }

/* --- Shell ---------------------------------------------------------- */
.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    radial-gradient(1100px 620px at 85% -10%, color-mix(in srgb, var(--accent-tint) 75%, transparent), transparent 60%),
    radial-gradient(900px 540px at -10% 35%, color-mix(in srgb, var(--primary-tint) 90%, transparent), transparent 60%),
    var(--bg);
}
.portal-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--primary) 14%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 50% -5%, rgba(0,0,0,0.55), transparent 55%);
  -webkit-mask-image: radial-gradient(ellipse at 50% -5%, rgba(0,0,0,0.55), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.portal-body > *:not(.skip-link) { position: relative; z-index: 1; }

/* Header mirrors the home page's .site-header/.site-brand aesthetic —
   three-column grid with the brand optically centred, no sticky/blur
   chrome, 36px symbol mark from /symbol.svg. Session badge + sign-out
   sit in the right slot and stay hidden until the provider is signed
   in, matching home's empty right gutter. */
.portal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "start brand end";
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-6) 0;
  margin-bottom: var(--space-5);
}

.portal-brand {
  grid-area: brand;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 30, "opsz" 144, "WONK" 0;
  font-weight: var(--fw-semi);
  font-size: 22px;
  letter-spacing: -0.018em;
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
.portal-brand:hover { color: var(--primary); }
.portal-brand:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 2px; }

.portal-brand-dot {
  width: 36px;
  height: 36px;
  flex: none;
  background: url('/symbol.svg') center / contain no-repeat;
  opacity: 0.85;
}

.portal-header-actions {
  grid-area: end;
  justify-self: end;
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--t-meta);
  color: var(--text-dim);
}
.session-badge strong { color: var(--text); font-family: var(--font-mono); font-weight: var(--fw-medium); font-size: 13px; }
.session-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent);
}
.session-timer {
  padding-left: var(--space-2);
  border-left: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: var(--t-micro);
}

/* --- Main ----------------------------------------------------------- */
.portal-main {
  flex: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(var(--space-6), 5vw, var(--space-10)) clamp(var(--space-4), 4vw, var(--space-8)) var(--space-10);
}

.portal-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) clamp(var(--space-4), 4vw, var(--space-8));
  color: var(--text-muted);
  font-size: var(--t-meta);
  text-align: center;
  background: var(--surface);
}

/* ======================================================================
   Login flow
   ====================================================================== */
.login-view {
  display: grid;
  place-items: center;
  padding: var(--space-9) 0 var(--space-11);
  animation: fadeUp var(--dur-med) var(--ease-entrance) both;
}

.login-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-6), 4vw, var(--space-8));
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  font-size: var(--t-display-md);
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.login-lede {
  color: var(--text-dim);
  margin-bottom: var(--space-6);
  font-size: var(--t-body);
}

.login-step { display: flex; flex-direction: column; gap: var(--space-4); }
.login-step[hidden] { display: none; }

.login-submit { align-self: stretch; margin-top: var(--space-2); }

.login-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-top: var(--space-2);
}

.login-error {
  background: color-mix(in srgb, var(--cta) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cta) 28%, transparent);
  color: var(--primary-ink);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--t-meta);
}
.login-error[hidden] { display: none; }

/* --- ABN step ------------------------------------------------------ */
.abn-field { position: relative; }
.abn-field input {
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px var(--space-5);
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-standard), background var(--dur-fast);
}
.abn-field input:focus { border-color: var(--primary); background: var(--surface); }

.field-label {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--fw-semi);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 2px;
}
.field-hint {
  font-size: var(--t-micro);
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.45;
}
.field-optional {
  display: inline-block;
  font-weight: var(--fw-regular);
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: lowercase;
}
.field-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  font-weight: var(--fw-semi);
  font-family: var(--font-mono);
}
.field-lock::before {
  content: "";
  width: 5px; height: 6px;
  border-radius: 1px;
  background: var(--text-muted);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' fill='black'><rect x='1' y='5' width='8' height='6' rx='1'/><path d='M2.5 5V3.5a2.5 2.5 0 0 1 5 0V5' fill='none' stroke='black' stroke-width='1'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' fill='black'><rect x='1' y='5' width='8' height='6' rx='1'/><path d='M2.5 5V3.5a2.5 2.5 0 0 1 5 0V5' fill='none' stroke='black' stroke-width='1'/></svg>") center / contain no-repeat;
}

/* --- Confirm email step ------------------------------------------- */
.confirm-providerline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.confirm-label {
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  font-weight: var(--fw-semi);
}
.confirm-providerline strong {
  font-family: var(--font-display); font-size: 20px; color: var(--text);
}
.confirm-abn { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); letter-spacing: 0.05em; }

.confirm-prompt { color: var(--text-dim); margin-top: var(--space-3); }
.confirm-email {
  font-size: 22px;
  font-weight: var(--fw-semi);
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  padding: var(--space-3) var(--space-4);
  background: var(--primary-tint);
  border-radius: var(--radius-md);
  word-break: break-all;
}

/* --- Code step ----------------------------------------------------- */
.code-prompt { color: var(--text-dim); }
.code-prompt span { color: var(--text); font-family: var(--font-mono); }
.code-field input {
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px var(--space-5);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.45em;
  text-align: center;
  color: var(--text);
}
.code-field input:focus { border-color: var(--primary); background: var(--surface); }

/* ======================================================================
   Editor view
   ====================================================================== */
.editor-view { display: grid; gap: var(--space-7); animation: fadeUp var(--dur-med) var(--ease-entrance) both; }

.editor-intro {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-5);
  position: relative;
}
.editor-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}
.editor-eyebrow-rule {
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}
.editor-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  font-weight: var(--fw-semi);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--text);
  margin: 0;
}
.editor-title em {
  font-style: italic;
  font-weight: var(--fw-semi);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  color: var(--primary);
  padding-right: 0.02em;
}
.editor-lede {
  color: var(--text-dim);
  max-width: 58ch;
  font-size: var(--t-body-lg);
  line-height: 1.6;
}
.editor-status {
  font-size: var(--t-meta);
  color: var(--text-muted);
  min-height: 20px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* --- Section card -------------------------------------------------- */
.ed-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-6), 3.2vw, var(--space-8));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 1px 2px rgba(11, 42, 60, 0.04),
    0 18px 44px -28px rgba(11, 42, 60, 0.18);
  position: relative;
  transition: box-shadow var(--dur-med) var(--ease-standard), transform var(--dur-med) var(--ease-standard);
}
.ed-section.ed-step--shown {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 2px 4px rgba(11, 42, 60, 0.05),
    0 30px 70px -36px rgba(11, 42, 60, 0.28);
}

.ed-section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(var(--space-5), 3vw, var(--space-7));
  align-items: baseline;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.ed-section-num {
  display: inline-flex;
  align-items: baseline;
  width: auto;
  height: auto;
  min-width: 64px;
  padding: 0 clamp(var(--space-4), 3vw, var(--space-6)) 0 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: var(--fw-semi);
  font-style: italic;
  font-size: clamp(48px, 5.2vw, 68px);
  letter-spacing: -0.045em;
  line-height: 1;
  border-right: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  align-self: center;
  position: relative;
}
.ed-section-num::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}
.ed-section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: var(--fw-semi);
  font-size: clamp(22px, 2.2vw, 28px);
  color: var(--text);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.ed-section-sub {
  font-size: var(--t-body);
  color: var(--text-dim);
  max-width: 60ch;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .ed-section-head {
    grid-template-columns: 1fr;
    row-gap: var(--space-3);
    padding-bottom: var(--space-4);
  }
  .ed-section-num {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
    padding: 0 0 var(--space-3) 0;
    font-size: 42px;
  }
}

/* --- Grid ---------------------------------------------------------- */
.ed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-5);
}
.ed-field { display: flex; flex-direction: column; gap: 6px; }
.ed-field--wide { grid-column: 1 / -1; }

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

/* --- Inputs -------------------------------------------------------- */
.ed-input, .ed-select, .ed-textarea {
  width: 100%;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: var(--t-body);
  color: var(--text);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
}
.ed-input:hover, .ed-select:hover, .ed-textarea:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--surface);
}
.ed-input:focus, .ed-select:focus, .ed-textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent),
    0 1px 0 rgba(255,255,255,0.5) inset;
  outline: none;
}
.ed-input--locked {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--surface-2) 60%, var(--surface)) 0 8px,
      color-mix(in srgb, var(--surface-2) 85%, var(--surface)) 8px 10px
    );
  cursor: not-allowed;
  color: var(--text-dim);
  border-style: solid;
  border-color: color-mix(in srgb, var(--border) 90%, transparent);
}
.ed-textarea { resize: vertical; min-height: 96px; font-family: inherit; }

.ed-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='%235F7E93' stroke-width='2' d='m5 8 5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.raw-echo {
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.raw-echo:empty::before { content: '—'; opacity: 0.4; }

.field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.field-toggle input { accent-color: var(--primary); }

/* --- Char counter -------------------------------------------------- */
.char-count { font-variant-numeric: tabular-nums; }

/* --- Logo ---------------------------------------------------------- */
.logo-row {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: clamp(var(--space-5), 4vw, var(--space-8));
  align-items: stretch;
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border-strong));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 200px at 15% 0%, color-mix(in srgb, var(--primary-tint) 65%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface-2) 40%, var(--surface));
  position: relative;
}
.logo-row::before {
  content: "Drop an image anywhere, or choose a file";
  position: absolute;
  top: -10px;
  left: var(--space-5);
  padding: 2px 10px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.logo-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 240px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border-strong) 45%, transparent);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 16px 40px -24px rgba(11, 42, 60, 0.35),
    0 2px 4px rgba(11, 42, 60, 0.05);
}
.logo-tile::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 1px dashed color-mix(in srgb, var(--border-strong) 55%, transparent);
  pointer-events: none;
  opacity: 0.6;
}
.logo-preview {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #fff;
  position: relative;
  z-index: 1;
}
.logo-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: var(--t-micro);
  font-weight: var(--fw-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.logo-empty svg {
  width: 36px; height: 36px;
  color: color-mix(in srgb, var(--primary) 55%, var(--text-muted));
  stroke-width: 1.5;
}
.logo-actions {
  display: flex; flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-2) 0;
}
.logo-actions::before {
  content: "Specifications";
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}
.logo-actions #logoHint {
  display: grid;
  gap: 8px;
  padding: 0;
  font-size: var(--t-meta);
  line-height: 1.55;
  color: var(--text-dim);
}
.logo-upload-label { align-self: flex-start; }
.logo-btn-row { display: inline-flex; gap: var(--space-2); align-items: center; }
.logo-spec {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-3);
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  font-size: var(--t-meta);
  color: var(--text-dim);
  line-height: 1.4;
}
.logo-spec:first-child { border-top: 0; padding-top: 0; }
.logo-spec strong {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .logo-row { grid-template-columns: 1fr; }
  .logo-tile { max-width: 200px; justify-self: start; }
}

/* --- Phone picker -------------------------------------------------- */
.phone-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.phone-type { flex: 0 0 auto; width: 160px; }
.phone-parts {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-family: var(--font-mono);
}
.phone-parts[hidden] { display: none; }
.phone-parts .ed-input,
.phone-parts .ed-select {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-align: center;
  width: 64px;
  min-width: 0;
}
.phone-parts .ed-input:focus { background: var(--surface); border-radius: var(--radius-sm); }
.phone-parts .phone-area { width: 130px; text-align: left; }
.phone-parts .phone-prefix-sel { width: 90px; text-align: left; }
.phone-prefix {
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0 2px 0 4px;
  font-weight: var(--fw-semi);
}
.phone-digit { letter-spacing: 0.08em !important; }

/* --- Chips --------------------------------------------------------- */
.chips-field { display: flex; flex-direction: column; gap: var(--space-3); }
.chips-selected {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 40px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  background: var(--primary-tint);
  color: var(--primary-ink);
  border-radius: var(--radius-pill);
  font-size: var(--t-meta);
  font-weight: var(--fw-medium);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.chip-remove {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: var(--fw-bold);
  border: 0;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.chip-remove:hover { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.chip-empty {
  font-size: var(--t-meta);
  color: var(--text-muted);
  padding: 8px 0;
}

.chips-input-row { position: relative; z-index: 60; }
.chips-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex; flex-direction: column;
  gap: 2px;
}
.chips-suggestions[hidden] { display: none; }
.chip-suggestion {
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: var(--t-meta);
  color: var(--text);
  background: transparent;
  border: 0; cursor: pointer;
}
.chip-suggestion:hover,
.chip-suggestion[aria-selected="true"] {
  background: var(--primary-tint); color: var(--primary-ink);
}
.chip-suggestion mark { background: transparent; color: var(--primary); font-weight: var(--fw-semi); }
.chip-suggestions-empty {
  padding: 14px; color: var(--text-muted); font-size: var(--t-meta); text-align: center;
}

/* --- Outlets ------------------------------------------------------- */
.outlets-list { display: flex; flex-direction: column; gap: var(--space-5); margin-bottom: var(--space-5); }
.outlets-list:empty { display: none; }

.outlet-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: clamp(var(--space-4), 2.5vw, var(--space-5));
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast);
}
.outlet-card[data-hidden="true"] {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn-tint) 35%, var(--surface));
}

.outlet-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.outlet-card-title {
  display: flex; align-items: center; gap: var(--space-3);
  flex: 1 1 auto; min-width: 0;
}
.outlet-card-index {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: var(--fw-semi);
  font-size: 13px;
  flex: 0 0 auto;
}
.outlet-name {
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  font-size: 18px;
  padding: 8px 12px;
}
.outlet-card-chrome { display: inline-flex; align-items: center; gap: var(--space-2); }
.outlet-delete {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.outlet-delete:hover {
  color: var(--cta);
  border-color: color-mix(in srgb, var(--cta) 40%, transparent);
  background: color-mix(in srgb, var(--cta) 8%, transparent);
}

.outlet-card-body { display: grid; gap: var(--space-5); }
.outlet-fieldset {
  border: 0;
  padding: 0;
}
.outlet-fs-legend {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: var(--fw-semi);
  margin-bottom: var(--space-2);
}

.outlet-address-grid {
  display: grid;
  grid-template-columns: 120px 140px 1fr 180px;
  gap: var(--space-3);
}
.outlet-address-grid .ed-field { min-width: 0; }
.outlet-address-grid .ed-field:nth-child(5) { grid-column: 1 / 3; }
.outlet-address-grid .ed-field:nth-child(6) { grid-column: 3 / 4; }
.outlet-address-grid .ed-field:nth-child(7) { grid-column: 4 / 5; }
@media (max-width: 720px) {
  .outlet-address-grid { grid-template-columns: 1fr 1fr; }
  .outlet-address-grid .ed-field,
  .outlet-address-grid .ed-field--wide { grid-column: span 1 !important; }
  .outlet-address-grid .ed-field:nth-child(3) { grid-column: 1 / -1 !important; }
  .outlet-address-grid .ed-field:nth-child(5) { grid-column: 1 / -1 !important; }
}

/* Highlight a required address field that's still unset (Type is the
   common culprit — the parser leaves it empty for single-token street
   names and the user needs to pick one before Save is meaningful). */
.outlet-address-grid .ed-select[data-role="type"]:has(option[value=""]:checked) {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
  background-color: color-mix(in srgb, var(--warn-tint) 28%, var(--surface));
  color: var(--warn);
}
.outlet-address-grid .ed-select[data-role="type"]:has(option[value=""]:checked):focus {
  border-color: var(--primary);
  background-color: var(--surface);
  color: var(--text);
}

[data-role="geocode-hint"] {
  min-height: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}
[data-role="geocode-hint"].match-exact { color: var(--success); }
[data-role="geocode-hint"].match-postcode { color: var(--warn); }
[data-role="geocode-hint"].match-none { color: var(--cta); }

/* --- Hours ---------------------------------------------------------
   Grid-based rows. A single card wraps the whole week; rows separate
   visually via hairlines and a soft highlight when the day is open.
   The time picker is a segmented pill with an arrow divider that the
   user reads left-to-right. Copy button on the right lets one day's
   configured hours propagate to every other open day. */
.hours-grid {
  display: grid;
  grid-template-columns: 1fr;
  background: color-mix(in srgb, var(--surface-2) 35%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.hours-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  transition: background var(--dur-fast) var(--ease-standard);
}
.hours-row:first-child { border-top: 0; }
.hours-row:has(input:checked) {
  background: var(--surface);
}

.hours-day {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.hours-day input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs, 4px);
  border: 1.5px solid color-mix(in srgb, var(--border-strong) 60%, transparent);
  background: var(--surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.hours-day input:hover { border-color: var(--primary); }
.hours-day input:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.hours-day input:checked::after {
  content: "";
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m3 7 3 3 5-6'/></svg>") center/contain no-repeat;
}
.hours-day input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.hours-day-name {
  color: var(--text-dim);
  font-weight: var(--fw-medium);
  font-size: var(--t-body);
  transition: color var(--dur-fast);
  font-variant-numeric: tabular-nums;
}
.hours-row:has(input:checked) .hours-day-name {
  color: var(--text);
  font-weight: var(--fw-semi);
}

/* Times pill — segmented from / arrow / to. */
.hours-times {
  display: inline-flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--surface-2) 80%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius-pill);
  overflow: hidden;
  justify-self: end;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.hours-times .hours-select {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 30px 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-semi);
  color: var(--text);
  width: auto;
  min-width: 128px;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.hours-times .hours-select:hover { background: color-mix(in srgb, var(--primary-tint) 45%, transparent); }
.hours-times .hours-select:focus {
  background: var(--surface);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  box-shadow: none;
}
.hours-dash {
  display: inline-grid;
  place-items: center;
  width: 32px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 15px;
  background: color-mix(in srgb, var(--primary-tint) 50%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.hours-closed {
  color: var(--text-muted);
  font-size: var(--t-meta);
  font-style: italic;
  justify-self: end;
  padding-right: 4px;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
}

.hours-copy {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-fast), background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  justify-self: end;
}
.hours-row:has(input:checked) .hours-copy { opacity: 1; }
.hours-copy:hover {
  background: var(--primary-tint);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  color: var(--primary);
}
.hours-copy.is-copied {
  background: var(--success-tint);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 24%, transparent);
}

.hours-row:has(input:checked) .hours-closed { display: none; }
.hours-row:not(:has(input:checked)) .hours-times,
.hours-row:not(:has(input:checked)) .hours-copy { display: none; }

@media (max-width: 640px) {
  .hours-row { grid-template-columns: 120px 1fr; }
  .hours-copy { grid-column: 2; justify-self: end; }
  .hours-times .hours-select { min-width: 100px; padding-left: 12px; padding-right: 26px; }
}

.outlets-add { align-self: flex-start; margin-bottom: var(--space-8); }
.outlets-add:disabled { opacity: 0.5; cursor: not-allowed; }

.outlets-bulk-notice {
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px dashed color-mix(in srgb, var(--border-strong) 60%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
  color: var(--text);
}
.outlets-bulk-notice-lede {
  margin: 0 0 var(--space-2);
  font-weight: var(--fw-semi);
}
.outlets-bulk-notice-body { margin: 0; color: var(--text-muted); line-height: 1.55; }
.outlets-bulk-notice-link { color: var(--primary); text-decoration: underline; }

/* ======================================================================
   Wizard — progress strip + step show/hide
   ====================================================================== */

/* Progress strip — numbered circles connected by a track. The active step
   gets a filled disc + ring, completed steps get a checkmark, future steps
   stay hollow. The connecting line lives behind the circles via ::before
   on the OL so we don't have to wire one between every pair of <li>s. */
.wiz-progress {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(clamp(var(--space-4), 4vw, var(--space-8)) * -1);
  padding: var(--space-4) clamp(var(--space-4), 4vw, var(--space-8)) var(--space-3);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  --progress: 0%;
}
/* Progress fill — CSS-driven by which step carries .wiz-step--active.
   No JS change needed; JS already toggles that class. */
.wiz-steps:has(li:nth-child(1) .wiz-step--active) { --progress: 0%; }
.wiz-steps:has(li:nth-child(2) .wiz-step--active) { --progress: 20%; }
.wiz-steps:has(li:nth-child(3) .wiz-step--active) { --progress: 40%; }
.wiz-steps:has(li:nth-child(4) .wiz-step--active) { --progress: 60%; }
.wiz-steps:has(li:nth-child(5) .wiz-step--active) { --progress: 80%; }
.wiz-steps:has(li:nth-child(6) .wiz-step--active) { --progress: 100%; }

.wiz-steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: var(--space-2);
}
.wiz-steps::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  height: 2px;
  background: color-mix(in srgb, var(--border-strong) 55%, transparent);
  border-radius: 2px;
  z-index: 0;
}
.wiz-steps::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 17px;
  height: 2px;
  width: calc((100% - 34px) * var(--progress, 0%) / 100%);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  z-index: 0;
  transition: width var(--dur-slow) var(--ease-tide);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent);
}
.wiz-step {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  transition: color var(--dur-fast);
  min-width: 0;
}
.wiz-step:hover { color: var(--text-dim); }
.wiz-step:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 6px; }
.wiz-step-bullet {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--border-strong) 55%, transparent);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: var(--fw-semi);
  font-size: 14px;
  transition: background var(--dur-med) var(--ease-tide), border-color var(--dur-med) var(--ease-tide), color var(--dur-fast), box-shadow var(--dur-med) var(--ease-tide), transform var(--dur-med) var(--ease-tide);
}
.wiz-step-label {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wiz-step--complete { color: var(--text-dim); }
.wiz-step--complete .wiz-step-bullet {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 14px;
}
.wiz-step--active { color: var(--primary); }
.wiz-step--active .wiz-step-bullet {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.05);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--primary) 14%, transparent),
    0 8px 20px -8px color-mix(in srgb, var(--primary) 60%, transparent);
}

/* Step show/hide. The ed-step class only flips visibility — all sections
   stay in the DOM so values, listeners and chip widgets keep their state
   when you flick between steps. */
.ed-step { display: none; }
.ed-step.ed-step--shown { display: block; animation: fadeIn var(--dur-med) var(--ease-entrance) both; }

/* On small screens collapse the labels under the bullets to dots only,
   and let users scroll horizontally if absolutely needed. */
@media (max-width: 640px) {
  .wiz-steps { gap: 4px; }
  .wiz-step-label { display: none; }
}

/* ======================================================================
   Live preview panel (iframe)
   ====================================================================== */
.ed-preview-panel {
  margin-top: var(--space-8);
  background:
    radial-gradient(600px 320px at 90% 0%, color-mix(in srgb, var(--accent-tint) 65%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary-tint) 55%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius-2xl);
  padding: clamp(var(--space-6), 3.2vw, var(--space-8));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 30px 80px -40px rgba(11, 42, 60, 0.22);
  position: relative;
}
@keyframes liveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
.ed-preview-head {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  max-width: 80%;
}
.ed-preview-head code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: color-mix(in srgb, var(--primary-tint) 70%, var(--surface));
  color: var(--primary-ink);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.ed-preview-status {
  font-size: var(--t-micro);
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-height: 16px;
}
.ed-preview-status.is-loading::before {
  content: '↻ ';
  animation: spin 0.9s linear infinite;
  display: inline-block;
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.preview-iframe-wrap {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--border-strong) 60%, transparent);
  overflow: hidden;
  min-height: 560px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 24px 60px -32px rgba(11, 42, 60, 0.35),
    0 2px 6px rgba(11, 42, 60, 0.06);
}
.preview-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 10px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 85%, var(--surface)), var(--surface-2));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
}
.preview-chrome-dots {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}
.preview-chrome-dots i {
  display: block;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
  opacity: 0.55;
}
.preview-chrome-dots i:nth-child(1) { background: #FF6057; opacity: 0.85; }
.preview-chrome-dots i:nth-child(2) { background: #FEBC2E; opacity: 0.85; }
.preview-chrome-dots i:nth-child(3) { background: #28C840; opacity: 0.85; }
.preview-chrome-url {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.preview-chrome-url svg { color: var(--success); flex: 0 0 auto; }
.preview-chrome-path { color: var(--text-muted); }
.preview-iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: var(--bg);
}
@media (max-width: 720px) {
  .preview-iframe { height: 560px; }
}

/* --- Old DOM preview ------------------------------------------------ */
.ed-preview {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-tint) 60%, var(--surface)), var(--surface));
}
.preview-frame {
  background: var(--bg-grad-2);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.preview-frame::before {
  content: "Preview";
  position: absolute; top: 10px; right: 14px;
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); font-weight: var(--fw-semi);
}

/* --- Preview card (mirrors public search card) -------------------- */
.prev-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: grid;
  gap: var(--space-4);
}
.prev-card-head {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.prev-logo {
  width: 72px; height: 72px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  flex: 0 0 auto;
  display: grid; place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
.prev-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.prev-logo-placeholder {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--fw-semi);
  color: var(--primary);
}
.prev-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: var(--fw-semi);
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}
.prev-meta {
  font-size: var(--t-meta);
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.prev-summary {
  color: var(--text-dim);
  font-size: var(--t-body);
  line-height: 1.6;
}

.prev-actions {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
}
.prev-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-size: var(--t-meta);
  font-weight: var(--fw-semi);
  border: 1px solid var(--border);
  text-decoration: none;
}

.prev-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); font-weight: var(--fw-semi);
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.prev-services { display: flex; flex-wrap: wrap; gap: 6px; }
.prev-services span {
  background: var(--accent-tint);
  color: var(--accent-deep);
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: var(--t-micro);
  font-weight: var(--fw-medium);
}

.prev-outlet {
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-2);
  display: grid; gap: 6px;
}
.prev-outlet:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prev-outlet-name { font-weight: var(--fw-semi); color: var(--text); }
.prev-outlet-address { color: var(--text-dim); font-size: var(--t-meta); }
.prev-outlet-hours { color: var(--text-muted); font-size: var(--t-micro); font-family: var(--font-mono); }

.prev-empty { color: var(--text-muted); font-style: italic; font-size: var(--t-meta); }

/* --- Editor actions footer ----------------------------------------
   Welded to the active step card as its own footer: same surface,
   shared hairline, flat top corners so the card + bar read as one
   continuous sheet. Sticks to viewport bottom so Save stays reachable
   while the user scrolls; the top-edge shadow only asserts itself
   once the bar detaches from the card below it. */
.editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 10px 10px 10px 18px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-top-color: color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 -10px 24px -18px rgba(11, 42, 60, 0.18),
    0 18px 40px -24px rgba(11, 42, 60, 0.22);
}
/* Merge the currently-shown step with the action bar that follows it:
   drop the card's bottom corners so the two pieces form one shape.
   Hidden sibling steps don't take layout space, so the shown step
   always sits immediately above the bar. */
.ed-section.ed-step--shown {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Back/Next — quiet segmented pair. Borders dropped so the two read as one
   control divided by a hairline, with a shared tonal hover wash. */
#wizBackBtn,
#wizNextBtn {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  min-height: 32px;
  padding: 0 14px;
  box-shadow: none;
}
#wizNextBtn { color: var(--accent-deep); }
#wizBackBtn:hover:not(:disabled),
#wizNextBtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-tint) 55%, transparent);
  border-color: transparent;
  color: var(--accent-deep);
  transform: none;
  box-shadow: none;
}
#wizBackBtn:disabled { color: var(--text-muted); opacity: 0.4; }
#wizBackBtn svg,
#wizNextBtn svg { opacity: 0.85; }

/* Hairline between Back and Next — stitches them into one segmented nav. */
#wizBackBtn + #wizNextBtn { position: relative; }
#wizBackBtn + #wizNextBtn::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
}

/* Right cluster — "Revert to base" and "Discard" as quiet text links, so the
   coral Save CTA is clearly the primary action. Revert-to-base leads the
   cluster and carries the margin-left:auto that pushes everything right. */
#revertToBaseBtn {
  margin-left: auto;
  background: transparent;
  border-color: transparent;
  color: var(--warn);
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  min-height: 32px;
  padding: 0 12px;
  gap: 6px;
  box-shadow: none;
}
#revertToBaseBtn svg { opacity: 0.85; }
#revertToBaseBtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--warn-tint) 55%, transparent);
  border-color: transparent;
  color: var(--warn);
  transform: none;
  box-shadow: none;
}

#revertBtn {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  min-height: 32px;
  padding: 0 12px;
  box-shadow: none;
}
#revertBtn:hover:not(:disabled) {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transform: none;
}
#revertBtn:disabled { opacity: 0.35; }

/* Save — the one button that should feel earned. */
#saveBtn {
  margin-left: 4px;
  min-height: 38px;
  padding: 0 20px;
  font-size: var(--t-meta);
  font-weight: var(--fw-semi);
  letter-spacing: 0.005em;
  gap: 8px;
}
#saveBtn svg { width: 14px; height: 14px; stroke-width: 2.4; opacity: 0.9; }
#saveBtn:disabled {
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 1;
}

/* Unsaved-changes status — sits at the far left when present. */
.editor-dirty {
  font-size: 10.5px;
  color: var(--warn);
  font-weight: var(--fw-semi);
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 2px;
}
.editor-dirty::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 28%, transparent);
  animation: liveDot 1.6s ease-in-out infinite;
}
.editor-dirty[hidden] { display: none; }

/* --- Toast --------------------------------------------------------- */
.portal-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: var(--t-meta);
  font-weight: var(--fw-semi);
  animation: fadeUp var(--dur-med) var(--ease-entrance) both;
}
.portal-toast.toast-success { background: var(--success); color: #fff; }
.portal-toast.toast-error   { background: var(--cta);     color: #fff; }
.portal-toast[hidden] { display: none; }

/* --- Small-screen editor ------------------------------------------ */
@media (max-width: 640px) {
  .portal-header {
    padding: var(--space-5) var(--space-4) 0;
    margin-bottom: var(--space-3);
    gap: var(--space-2);
  }
  .portal-brand { font-size: 19px; gap: 10px; }
  .portal-brand-dot { width: 32px; height: 32px; }
  .session-badge { padding: 4px 10px; }
  .session-timer { display: none; }
  .editor-actions {
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .editor-dirty { order: -1; flex-basis: 100%; text-align: center; margin: 0 0 6px 0; }
}

/* ============================================================
   SupportFinder design-system refinements (portal)
   Appended to win on cascade over historical component rules.
   ============================================================ */

/* Portal brand mark uses the same Deep Ocean serif as consumer shell. */
.portal-brand {
  color: var(--deep-600);
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
[data-theme="dark"] .portal-brand { color: var(--deep-200); }

.portal-brand-dot { opacity: 1; }

/* Login card — the design system treats this as a modal-weight surface:
   white surface, 24px radius, shadow-lg, tight measure. */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-family: var(--font-display);
  color: var(--deep-700);
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72, "SOFT" 50;
}
[data-theme="dark"] .login-title { color: var(--text); }

/* Editor title stack — Fraunces + Lagoon eyebrow, consistent with consumer. */
.editor-title {
  font-family: var(--font-display);
  color: var(--deep-700);
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
}
[data-theme="dark"] .editor-title { color: var(--text); }

.editor-eyebrow {
  color: var(--lagoon-500);
  font-family: var(--font-body);
  font-size: var(--t-micro);
  font-weight: var(--fw-semi);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[data-theme="dark"] .editor-eyebrow { color: var(--lagoon-300); }

/* Section headings inside the editor use the Fraunces family.
   Section numbers get a Lagoon-tinted pill so they read as secondary
   accent, not primary noise. */
.ed-section-title {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  color: var(--deep-700);
  letter-spacing: -0.015em;
}
[data-theme="dark"] .ed-section-title { color: var(--text); }

.ed-section-num {
  background: var(--lagoon-50);
  color: var(--lagoon-600);
  border-radius: var(--radius-pill);
}
[data-theme="dark"] .ed-section-num {
  background: rgba(58, 175, 169, 0.14);
  color: var(--lagoon-200);
}

/* Wizard progress bullet uses Lagoon for active, Deep Ocean for complete. */
.wiz-step--active .wiz-step-bullet {
  background: var(--lagoon-400);
  color: #fff;
  box-shadow: 0 0 0 4px var(--lagoon-50);
}
.wiz-step--complete .wiz-step-bullet {
  background: var(--deep-600);
  color: #fff;
}
[data-theme="dark"] .wiz-step--active .wiz-step-bullet {
  box-shadow: 0 0 0 4px rgba(58, 175, 169, 0.18);
}

/* Inputs — 12px radius, subtle border, teal focus ring on focus. */
.ed-input,
.ed-select,
.ed-textarea {
  border-radius: var(--radius-md);
  border-color: var(--border);
  background: var(--surface);
}
.ed-input:focus,
.ed-select:focus,
.ed-textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring-primary);
  outline: none;
}

/* Chips use Lagoon tint for the selected/accepted state. */
.chip {
  background: var(--lagoon-50);
  color: var(--lagoon-700);
  border: 1px solid var(--lagoon-200);
  border-radius: var(--radius-pill);
}
[data-theme="dark"] .chip {
  background: rgba(58, 175, 169, 0.14);
  color: var(--lagoon-200);
  border-color: var(--lagoon-600);
}

/* Success toast uses semantic green; error keeps Deep Ocean primary
   palette through --cta so the fatal state still reads as branded,
   not red-alert. If a project wants red errors, swap the --cta var
   below to var(--danger-500). */
.portal-toast.toast-error { background: var(--danger-500); color: #fff; }

/* Editor preview panel — thin border + fog-100 frame, not hard shadow. */
.ed-preview-panel,
.preview-chrome {
  border-color: var(--border-subtle, var(--border));
  border-radius: var(--radius-lg);
}

/* Session badge — Lagoon accent dot replaces old "live" green. */
.session-badge .session-dot {
  background: var(--lagoon-400);
  box-shadow: 0 0 0 3px rgba(58, 175, 169, 0.22);
}

