/* ════════════════════════════════════════════════════════════════════
   CorpStack — Design system
   Refined April 25, 2026 — premium professional aesthetic
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ─── Color palette — refined ─────────────────────────────────── */
  /* Brand */
  --primary:        #0f2740;   /* deeper navy for stronger presence */
  --primary-700:    #1a3a5c;
  --primary-50:     #f0f4f9;

  /* Accent */
  --accent:         #2563eb;
  --accent-hover:   #1d4ed8;
  --accent-50:      #eff6ff;

  /* Semantic */
  --success:        #047857;
  --success-50:     #ecfdf5;
  --success-200:    #a7f3d0;
  --warning:        #b45309;
  --warning-50:     #fffbeb;
  --warning-200:    #fde68a;
  --danger:         #b91c1c;
  --danger-50:      #fef2f2;
  --danger-200:    #fecaca;
  --info-50:        #eff6ff;
  --info-200:       #bfdbfe;

  /* Neutrals — slate scale */
  --slate-50:       #f8fafc;
  --slate-100:      #f1f5f9;
  --slate-200:      #e2e8f0;
  --slate-300:      #cbd5e1;
  --slate-400:      #94a3b8;
  --slate-500:      #64748b;
  --slate-600:      #475569;
  --slate-700:      #334155;
  --slate-800:      #1e293b;
  --slate-900:      #0f172a;

  /* Surfaces — Wave 3: shifted to a slightly warmer/greyer page bg
   * so white cards visibly pop against it (BC Registry pattern). */
  --bg:             #f1f4f8;
  --bg-subtle:      #fdfdff;
  --card:           #ffffff;
  --border:         var(--slate-200);
  --border-strong:  var(--slate-300);
  --text:           var(--slate-900);
  --text-muted:     var(--slate-500);
  --text-subtle:    var(--slate-400);

  /* Notice palette — Wave 3: yellow for system-wide informational banners,
   * distinct from --info-50 (blue, used for inline factual notes). */
  --notice-50:      #fffaeb;
  --notice-200:     #fcd34d;
  --notice-text:    #713f12;

  /* Layout tokens */
  --radius-sm:      6px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;

  /* Shadows */
  --shadow-xs:      0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:      0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:      0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:      0 10px 24px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);

  /* Typography */
  --font-sans:      -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:      ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  letter-spacing: -0.005em;
}

/* ─── Header ────────────────────────────────────────────────────── */
.header {
  background: var(--primary);
  color: white;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08), 0 1px 8px rgba(15, 23, 42, 0.10);
  position: relative;
}
.header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(37,99,235,0.4) 30%, rgba(37,99,235,0.4) 70%, transparent 100%);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-brand .header-logo {
  height: 38px;
  width: auto;
  display: block;
}
.header-brand-text h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: white;
  letter-spacing: -0.01em;
}
.header-brand-text .subtitle {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.header-brand a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}
.header-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}
.header-nav a:hover { color: white; }
.header-nav .btn {
  background: rgba(255, 255, 255, 0.10);
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.20);
  font-size: 13px;
}
.header-nav .btn:hover { background: rgba(255, 255, 255, 0.18); }

/* ─── Layout containers ────────────────────────────────────────── */
.main-narrow { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 56px 24px; }
.main        { flex: 1; width: 100%; max-width: 800px; margin: 0 auto; padding: 40px 24px; }
.main-wide   { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--slate-400);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--card);
}
.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s, box-shadow 0.12s;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.20);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.30);
}
.btn-secondary {
  background: var(--card);
  color: var(--slate-700);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--slate-400);
  color: var(--slate-900);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-block {
  display: flex;
  width: 100%;
}

/* ─── Alerts (subtle, integrated) ──────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  line-height: 1.55;
}
.alert-error   { background: var(--danger-50);  color: #7f1d1d; border-color: var(--danger-200); }
.alert-success { background: var(--success-50); color: #064e3b; border-color: var(--success-200); }
.alert-info    { background: var(--info-50);    color: #1e3a8a; border-color: var(--info-200); }
.alert-warning { background: var(--warning-50); color: #78350f; border-color: var(--warning-200); }
.alert-hidden  { display: none; }
.alert ul { margin: 6px 0 0 18px; }
.alert ul li { margin-top: 2px; }

/* ─── Footer ───────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ─── Utility ──────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── Filing status badges ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}
.badge-overdue   { background: var(--danger-50);  color: #7f1d1d; border-color: var(--danger-200); }
.badge-due-soon  { background: var(--warning-50); color: #78350f; border-color: var(--warning-200); }
.badge-upcoming  { background: var(--slate-100);  color: var(--slate-600); border-color: var(--border); }
.badge-filed     { background: var(--success-50); color: #064e3b; border-color: var(--success-200); }
.badge-new       { background: var(--info-50);    color: #1e3a8a; border-color: var(--info-200); }
.badge-unknown   { background: var(--slate-100);  color: var(--text-muted); }
.badge-status-active     { background: var(--success-50); color: #047857; }
.badge-status-dissolved  { background: var(--danger-50);  color: #991b1b; }
.badge-status-suspended  { background: var(--warning-50); color: #92400e; }
/* Invite lifecycle badges (distinct from entity status) */
.badge-invite-sent       { background: var(--bg-subtle);  color: var(--slate-700); border-color: var(--border); }
.badge-invite-started    { background: var(--accent-50);  color: var(--accent-hover); border-color: var(--info-200); }

/* ─── Tables ────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
}
.table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.table tbody tr:hover { background: var(--slate-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .col-name { font-weight: 600; color: var(--text); }
.table .col-id { color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; }
.table .col-meta { color: var(--text-muted); font-size: 13px; }

/* ─── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .search { flex: 1; min-width: 220px; max-width: 400px; }
.toolbar .search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>") no-repeat 12px center;
}
.toolbar .search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--card);
  cursor: pointer;
  color: var(--slate-700);
}

/* ─── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.page-header .count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}

/* ─── Dropdown ─────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle { display: inline-flex; align-items: center; gap: 6px; }
.dropdown-toggle::after { content: '▾'; font-size: 10px; opacity: 0.7; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 280px;
  padding: 6px;
  z-index: 50;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 11px 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.dropdown-menu a:hover { background: var(--slate-50); }
.dropdown-menu a strong { display: block; font-weight: 600; margin-bottom: 2px; }
.dropdown-menu a small { display: block; color: var(--text-muted); font-size: 12px; }

/* ─── Empty state ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}
.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════
   MULTI-STEP FORM — Premium redesign
   ════════════════════════════════════════════════════════════════════ */

/* Step indicator: numbered circles connected by lines */
.stepper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.stepper-track {
  display: flex;
  align-items: flex-start;
  position: relative;
}
.stepper-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
  cursor: default;
}
.stepper-step.clickable { cursor: pointer; }
.stepper-step.clickable:hover .stepper-circle {
  border-color: var(--accent);
}
.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: all 0.15s;
}
.stepper-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
  line-height: 1.3;
  max-width: 100px;
  letter-spacing: -0.005em;
}
.stepper-step.completed .stepper-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.stepper-step.completed .stepper-circle::before {
  content: '';
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center;
}
.stepper-step.completed .stepper-circle .stepper-num { display: none; }
.stepper-step.completed .stepper-label { color: var(--success); }
.stepper-step.current .stepper-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.stepper-step.current .stepper-label { color: var(--accent); font-weight: 600; }
/* Connector line */
.stepper-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 1.5px;
  background: var(--border-strong);
  z-index: 1;
}
.stepper-step:last-child::before { display: none; }
.stepper-step.completed::before { background: var(--success); }
@media (max-width: 720px) {
  .stepper-label { display: none; }
  .stepper { padding: 16px; }
  .stepper-step::before { top: 16px; }
}

/* Stepper meta row (status, autosave, etc.) */
.stepper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.stepper-meta .meta-section {
  color: var(--text-muted);
}
.stepper-meta .meta-section strong { color: var(--text); font-weight: 600; }
.savestatus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.savestatus.saving { color: var(--accent); }
.savestatus.saved  { color: var(--success); }
.savestatus.error  { color: var(--danger); }
.savestatus::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Section panel */
.section-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.section-panel h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-panel .section-help {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.55;
}
.section-panel h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 32px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.section-panel h3:first-of-type { margin-top: 0; }

/* Section nav */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-nav-left, .section-nav-right { display: flex; gap: 10px; align-items: center; }

/* Form layouts */
.form-row { display: grid; gap: 14px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-3-tight { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 640px) {
  .form-row-2, .form-row-3, .form-row-3-tight { grid-template-columns: 1fr; }
  .section-panel { padding: 24px 20px; }
  .main { padding: 24px 16px; }
}

/* Radio / checkbox tiles */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--card);
}
.radio-option:hover { border-color: var(--slate-400); }
.radio-option input { margin: 0; cursor: pointer; }
.radio-option.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-hover);
}

/* Equal-size variant: each option takes equal width and same min-height,
 * so cards line up uniformly regardless of content length. Used for
 * the Company Structure choice (Limited / ULC / CCC) and similar. */
.radio-group-equal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.radio-group-equal .radio-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  min-height: 100px;
  width: auto;
}
.radio-group-equal .radio-option-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.radio-group-equal .radio-option.selected .radio-option-head {
  color: var(--accent-hover);
}
.radio-group-equal .radio-option-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 24px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--slate-700);
}
.checkbox-row input { cursor: pointer; }

/* Province checkbox grid */
.prov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
}
.prov-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--card);
  transition: all 0.12s;
}
.prov-grid label:hover { border-color: var(--slate-400); }
.prov-grid label.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-hover);
}
.prov-grid input { display: none; }

/* Flag-style province grid (Section 1 jurisdiction picker) */
.prov-grid-flag {
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}
.prov-grid-flag .prov-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--slate-700);
  background: var(--card);
  transition: all 0.15s ease;
}
.prov-grid-flag .prov-card:hover {
  border-color: var(--slate-400);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 39, 64, 0.06);
}
.prov-grid-flag .prov-card.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-hover);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.prov-grid-flag .prov-card.prov-home {
  border-color: var(--accent);
  background: var(--accent-50);
}
.prov-grid-flag .prov-flag {
  display: block;
  width: 32px;
  height: 22px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15, 39, 64, 0.15);
  line-height: 0;
}
.prov-grid-flag .prov-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.prov-grid-flag .prov-abbrev {
  font-size: 12.5px;
  letter-spacing: 0.08em;
}
.prov-grid-flag .prov-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Repeatable rows */
.repeatable-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
}
.repeatable-row .row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.repeatable-row .row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.005em;
}
.repeatable-row .btn-remove {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
}
.repeatable-row .btn-remove:hover {
  background: var(--danger-50);
  border-color: var(--danger);
}
.btn-add-row {
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  color: var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.12s;
}
.btn-add-row:hover {
  border-color: var(--accent);
  background: var(--accent-50);
  border-style: solid;
}

/* Inline help tooltip */
.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--slate-300);
  color: white;
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  transition: background 0.12s;
}
.help:hover { background: var(--slate-500); }
.help[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--slate-900);
  color: white;
  font-size: 12px;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: var(--radius);
  white-space: normal;
  width: 280px;
  z-index: 100;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}

/* ─── AI feedback ─────────────────────────────────────────────── */
.ai-feedback { margin-top: 12px; }
.ai-feedback:empty { display: none; }
.ai-feedback-row {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.005em;
}
.ai-feedback-row::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.ai-good       { background: var(--success-50); color: #064e3b; border: 1px solid var(--success-200); }
.ai-good::before    { content: '✓'; background: var(--success); color: white; }
.ai-warn       { background: var(--warning-50); color: #78350f; border: 1px solid var(--warning-200); }
.ai-warn::before    { content: '!'; background: #d97706; color: white; }
.ai-bad        { background: var(--danger-50);  color: #7f1d1d; border: 1px solid var(--danger-200); }
.ai-bad::before     { content: '✕'; background: var(--danger); color: white; }
.ai-info, .ai-thinking {
  background: var(--accent-50);
  color: #1e40af;
  border: 1px solid var(--info-200);
  font-style: italic;
  font-weight: 500;
}
.ai-thinking::before { content: '◌'; background: var(--accent); color: white; animation: spin 1.6s linear infinite; }
.ai-error { background: var(--slate-100); color: var(--text-muted); border: 1px solid var(--border); font-size: 12px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.ai-confidence { font-weight: 400; opacity: 0.7; font-size: 12px; }
.ai-struct {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.ai-struct-piece {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--card);
  font-weight: 500;
}
.ai-struct-piece.has {
  background: var(--success-50);
  color: #047857;
  border-color: var(--success-200);
}
.ai-struct-piece.missing {
  background: var(--slate-50);
  color: var(--text-muted);
  border-color: var(--border);
  border-style: dashed;
}
.ai-issues { list-style: none; padding: 0; margin: 10px 0 0; }
.ai-issues li {
  padding: 6px 12px;
  margin-top: 4px;
  border-radius: var(--radius);
  font-size: 12.5px;
  border-left: 3px solid;
  font-weight: 500;
}
.ai-issue-error { background: var(--danger-50);  color: #7f1d1d; border-color: var(--danger); }
.ai-issue-warn  { background: var(--warning-50); color: #78350f; border-color: #d97706; }
.ai-issue-info  { background: var(--accent-50);  color: #1e40af; border-color: var(--accent); }
.ai-tip {
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--warning-50), #fef3c7);
  border: 1px solid var(--warning-200);
  border-radius: var(--radius);
  font-size: 13px;
  color: #78350f;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.ai-tip::before {
  content: '💡';
  flex-shrink: 0;
  font-size: 14px;
}

/* Subtle confirmation/info line under an AI feedback header — used for
 * "ID image saved on file" style affordances. */
.ai-feedback-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
  letter-spacing: 0.005em;
}
.ai-feedback-meta-warn {
  color: var(--notice-text);
}

/* ─── Structure cards (share structure picker) ─────────────────── */
.structure-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.structure-card {
  display: block;
  padding: 18px 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--card);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  position: relative;
}
.structure-card:hover {
  border-color: var(--slate-400);
  box-shadow: var(--shadow-xs);
}
.structure-card input[type="radio"] {
  position: absolute;
  top: 18px;
  right: 18px;
  margin: 0;
}
.structure-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-50), var(--card));
  box-shadow: 0 0 0 1px var(--accent);
}
.structure-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding-right: 28px;
}
.structure-card-header strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.005em;
}
.structure-card-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 8px;
  background: var(--success);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.structure-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ─── Share class table (preview, mirrors firm questionnaire) ──── */
.share-class-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.share-class-table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.3;
}
.share-class-table th.num-col { text-align: center; }
.share-class-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.share-class-table td.num-col { text-align: center; color: var(--text-muted); }
.share-class-table tbody tr:not(.rights-row):last-child td { border-bottom: 1px solid var(--border); }
.share-class-table .show-rights-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share-class-table .show-rights-link:hover { text-decoration: underline; }
.share-class-table .rights-row td.rights-text {
  background: var(--slate-50);
  color: var(--slate-700);
  font-style: italic;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ─── Review block ─────────────────────────────────────────────── */
.review-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 14px;
  background: var(--bg-subtle);
}
.review-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.review-block-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.06em;
  margin: 0;
  padding: 0;
  border: none;
}
.review-edit {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s ease;
}
.review-edit:hover {
  background: var(--accent-50);
  border-color: var(--accent);
}
.review-list {
  display: grid;
  grid-template-columns: minmax(180px, max-content) 1fr;
  gap: 6px 16px;
  font-size: 13.5px;
}
.review-list dt {
  color: var(--text-muted);
  font-weight: 500;
}
.review-list dd { color: var(--text); margin: 0; }
.review-list dd em { color: var(--text-subtle); font-style: normal; }
.review-subblock {
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px dashed var(--border);
}
.review-subblock:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT — Stripe Atlas / Linear-style
   ════════════════════════════════════════════════════════════════════ */

.form-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
}

@media (max-width: 880px) {
  .form-shell { grid-template-columns: 1fr; }
}

.form-sidebar {
  padding: 32px 24px 32px 32px;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 880px) {
  .form-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
}

.form-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.form-sidebar-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Vertical stepper */
.vstepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}
.vstep {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
  cursor: default;
  text-decoration: none;
  color: inherit;
}
.vstep.clickable { cursor: pointer; }
.vstep-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  z-index: 2;
  transition: all 0.15s;
  position: relative;
}
.vstep::before {
  content: '';
  position: absolute;
  left: 12.25px;
  top: 30px;
  bottom: -8px;
  width: 1.5px;
  background: var(--border-strong);
  z-index: 1;
}
.vstep:last-child::before { display: none; }
.vstep.completed .vstep-marker {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.vstep.completed .vstep-marker::before {
  content: '';
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center;
}
.vstep.completed .vstep-num { display: none; }
.vstep.completed::before { background: var(--success); }
.vstep.current .vstep-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.vstep-body { padding-top: 3px; min-width: 0; flex: 1; }
.vstep-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-700);
  margin: 0;
  line-height: 1.4;
}
.vstep.completed .vstep-label { color: var(--text); }
.vstep.current .vstep-label { color: var(--primary); font-weight: 600; }
.vstep:hover.clickable .vstep-label { color: var(--accent); }
.vstep-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar-savestatus {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-savestatus .savestatus {
  font-size: 12px;
}

.form-content {
  padding: 40px 48px;
  max-width: 760px;
  width: 100%;
}

@media (max-width: 880px) {
  .form-content { padding: 24px 24px 40px; }
}

.form-content .section-panel {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
  margin-bottom: 32px;
}

/* ─── Wave 3 — Typography reset ───────────────────────────────────
 * h2 is the page-level title (one per section, lives outside subcards).
 * h3 is a real subheading inside a subcard, no longer an uppercase label.
 * h4 is a sub-sub-grouping inside dense sections. */
.form-content .section-panel h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.form-content .section-panel .section-help {
  font-size: 15px;
  color: var(--slate-600);
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 720px;
}

.form-content .section-panel h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--slate-800);
  letter-spacing: -0.005em;
  margin: 0 0 16px;
  text-transform: none;
  border-bottom: none;
  padding-bottom: 0;
}

.form-content .section-panel h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  letter-spacing: 0;
  margin: 16px 0 8px;
}

.form-content .section-panel .section-panel h3 {
  /* Within a subcard, first h3 has no top margin */
  margin-top: 0;
}

.form-content .section-nav {
  background: var(--card);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(15, 39, 64, 0.05);
  position: sticky;
  bottom: 16px;
  z-index: 10;
  margin-top: 16px;
}
/* Buttons inside the sticky nav are slightly more compact than default */
.form-content .section-nav .btn {
  padding: 8px 16px;
  font-size: 13.5px;
}
/* Add bottom padding to the section panel so its last fields don't sit
 * directly under the sticky nav as the user scrolls */
.form-content .section-panel {
  padding-bottom: 32px;
}

/* Trust footer */
.trust-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 24px;
  margin-top: 0;
}
.trust-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.trust-badges {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.trust-badge::before {
  content: '';
  width: 14px;
  height: 14px;
  display: inline-block;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}
.trust-badge.lock::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2' ry='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>");
}

/* AI Generate button — used for name suggestions, etc. */
.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.12s, transform 0.05s;
  letter-spacing: -0.005em;
}
.btn-ai:hover { opacity: 0.92; }
.btn-ai:active { transform: translateY(1px); }
.btn-ai:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ai::before {
  content: '✨';
  font-size: 12px;
}

/* AI suggestions list */
.ai-suggestions {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.04));
  border: 1px solid rgba(139, 92, 246, 0.20);
  border-radius: var(--radius);
}
.ai-suggestions-title {
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.ai-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-size: 13.5px;
  color: var(--text);
}
.ai-suggestion:hover {
  border-color: var(--accent);
  background: var(--accent-50);
}
.ai-suggestion-use {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Drag-drop zone for address upload */
.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  margin-bottom: 12px;
}
.drop-zone:hover { border-color: var(--accent); background: var(--accent-50); }
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-50); }
.drop-zone-icon {
  margin-bottom: 8px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drop-zone-icon svg { display: block; }
.drop-zone-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
}
.drop-zone-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Post-submission celebration */
.celebration-card {
  background: linear-gradient(135deg, var(--success-50) 0%, #ecfdf5 100%);
  border: 1px solid var(--success-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}
.celebration-card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #064e3b;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.celebration-card p {
  font-size: 15px;
  color: #065f46;
  margin-bottom: 0;
  line-height: 1.6;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
}
.timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 28px;
  bottom: -14px;
  width: 1.5px;
  background: var(--border);
  z-index: 0;
}
.timeline-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-item.done .timeline-marker {
  background: var(--success);
  border-color: var(--success);
}
.timeline-item.done .timeline-marker::before {
  content: '';
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center;
}
.timeline-item.done::before { background: var(--success); }
.timeline-item.current .timeline-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25); }
}
.timeline-content {
  flex: 1;
  min-width: 0;
}
.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.timeline-item.done .timeline-title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.timeline-item.current .timeline-title { color: var(--primary); }
.timeline-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   Wave A — Section 2 upgrades:
   Multi-choice name generator card, OrgBook live results,
   "Verify availability" panel.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Name generator card (replaces inline AI suggestion button) ─── */
.namegen-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: 12px 0 24px;
  background: linear-gradient(135deg, #fafbff 0%, #f4f7fc 100%);
}
.namegen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.namegen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.namegen-controls input[type="text"] {
  flex: 1 1 200px;
  min-width: 160px;
}
.namegen-controls select {
  width: auto;
  flex: 0 0 auto;
  min-width: 110px;
}
.namegen-controls .btn-ai {
  flex: 0 0 auto;
}

/* Multi-choice suggestion row — different from old single-Use row */
.ai-suggestion-multi {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
}
.ai-suggestion-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-suggestion-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ai-suggestion-rationale {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.ai-suggestion-style {
  display: inline-block;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-top: 2px;
}
.ai-suggestion-style.style-punchy      { background: #fef3c7; color: #92400e; }
.ai-suggestion-style.style-descriptive { background: #dbeafe; color: #1e40af; }
.ai-suggestion-style.style-surname     { background: #ede9fe; color: #5b21b6; }
.ai-suggestion-style.style-coined      { background: #fce7f3; color: #9d174d; }
.ai-suggestion-style.style-geographic  { background: #d1fae5; color: #065f46; }

/* Pre-checked AI suggestions — colour-coded by OrgBook verdict */
.ai-suggestion-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ai-suggestion-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 3px;
}
.ai-suggestion-status.status-clear {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-200);
}
.ai-suggestion-status.status-caution {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-200);
}
.ai-suggestion-status.status-conflict {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-200);
}
.ai-suggestion.ai-suggestion-conflict {
  opacity: 0.6;
  border-color: var(--danger-200);
}
.ai-suggestion.ai-suggestion-conflict .ai-suggestion-name {
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.ai-suggestion.ai-suggestion-caution {
  border-color: var(--warning-200);
}
.ai-suggestion.ai-suggestion-clear {
  border-left: 3px solid var(--success);
}

.ai-suggestion-actions {
  display: flex;
  gap: 6px;
  align-self: flex-end;
}
.btn-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.02em;
}
.btn-pill:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-50);
}
.ai-suggestions-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

/* ─── OrgBook live name check feedback ────────────────────────────── */
.orgbook-feedback { margin-top: 8px; }
.orgbook-status {
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--slate-50);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.orgbook-thinking::before { content: '⟳'; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.orgbook-error { background: var(--danger-50); color: var(--danger); }

.orgbook-card {
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-top: 4px;
  border: 1px solid var(--border);
  background: var(--card);
}
.orgbook-card.orgbook-clear     { border-color: var(--success-200); background: var(--success-50); }
.orgbook-card.orgbook-caution   { border-color: var(--warning-200); background: var(--warning-50); }
.orgbook-card.orgbook-conflict  { border-color: var(--danger-200);  background: var(--danger-50); }

.orgbook-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.orgbook-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.7);
}
.orgbook-clear    .orgbook-icon { color: var(--success); }
.orgbook-caution  .orgbook-icon { color: var(--warning); }
.orgbook-conflict .orgbook-icon { color: var(--danger); }
.orgbook-card-head strong { font-size: 13.5px; }
.orgbook-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}
.orgbook-matches {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.orgbook-match {
  background: rgba(255,255,255,0.65);
  padding: 8px 10px;
  border-radius: var(--radius);
  border-left: 3px solid var(--slate-300);
}
.orgbook-match.match-high   { border-left-color: var(--danger); }
.orgbook-match.match-medium { border-left-color: var(--warning); }
.orgbook-match.match-low    { border-left-color: var(--slate-400); }
.match-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}
.match-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: rgba(15, 39, 64, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.match-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.match-tag-exact { background: var(--danger); color: #fff; }
.match-tag-sub { background: var(--warning); color: #fff; }
.match-tag-warn { background: var(--warning); color: #fff; }
.match-link {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.match-link:hover { text-decoration: underline; }
.orgbook-source {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 39, 64, 0.08);
}
.orgbook-source a { color: var(--accent); text-decoration: none; }
.orgbook-source a:hover { text-decoration: underline; }

/* ─── Verify availability panel ───────────────────────────────────── */
.verify-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--bg-subtle);
  margin-bottom: 16px;
}
.verify-head {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.verify-head input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}
.verify-head .btn {
  flex: 0 0 auto;
}
.verify-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}
.verify-results { margin-top: 14px; }
.verify-results:empty { display: none; }

.verify-section {
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.verify-section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.verify-section-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: var(--accent-50);
  border: 1px solid var(--info-200);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.verify-note-prominent {
  /* Informational caption — quiet, neutral grey. Not an error/warning.
   * The "Manual check" tag next to the section title carries the cue. */
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0 10px 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.verify-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.verify-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
}
.verify-row-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}
.verify-row-name code {
  font-family: inherit;
  background: rgba(15, 39, 64, 0.05);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 12.5px;
}
.verify-row-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.verify-row.verify-good {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-200);
}
.verify-row.verify-bad {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-200);
}
.verify-row.verify-unknown {
  background: var(--slate-50);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.verify-row.verify-link {
  background: var(--card);
  border: 1px solid var(--border);
}
.verify-row.verify-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.verify-row.verify-link a:hover { text-decoration: underline; }
.verify-row.verify-error {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-200);
  font-style: italic;
}
.verify-row-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--accent-50);
  border-radius: var(--radius);
}
.verify-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ─── CIPO trademark conflict card (Wave A.1) ──────────────────────── */
.tm-card {
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.tm-card.tm-clear    { border-color: var(--success-200); background: var(--success-50); }
.tm-card.tm-caution  { border-color: var(--warning-200); background: var(--warning-50); }
.tm-card.tm-conflict { border-color: var(--danger-200);  background: var(--danger-50); }

.tm-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tm-card-head strong { font-size: 13.5px; }
.tm-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.tm-matches {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tm-match {
  background: rgba(255,255,255,0.65);
  padding: 8px 10px;
  border-radius: var(--radius);
  border-left: 3px solid var(--slate-300);
}
.tm-match.tm-match-high   { border-left-color: var(--danger); }
.tm-match.tm-match-medium { border-left-color: var(--warning); }
.tm-match.tm-match-low    { border-left-color: var(--slate-400); }

.tm-match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tm-match .match-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.tm-applicant {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}
.tm-nice {
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(15, 39, 64, 0.08);
  color: var(--slate-700);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.tm-source {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 39, 64, 0.08);
}

/* ─── Live CIPO check button (Path 3c) ────────────────────────────── */
.tm-livecheck {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  border: 1px dashed rgba(15, 39, 64, 0.18);
}
.tm-livecheck-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.tm-livecheck-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}
.btn-cipo-live {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent-hover);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}
.btn-cipo-live:hover {
  background: var(--accent-50);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.btn-cipo-live.copied {
  background: var(--success-50);
  border-color: var(--success);
  color: var(--success);
  cursor: default;
  transform: none;
}

/* ─── Wave 3: Trademark matches "show more" disclosure ────────────── */
.tm-matches-more {
  margin-top: 8px;
}
.tm-matches-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 12px;
  border: 1px solid var(--info-200);
  background: var(--accent-50);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
}
.tm-matches-more > summary::-webkit-details-marker { display: none; }
.tm-matches-more > summary::before {
  content: '▾';
  font-size: 10px;
  transition: transform 0.15s ease;
}
.tm-matches-more[open] > summary::before { transform: rotate(180deg); }
.tm-matches-more > summary:hover {
  background: var(--info-100);
  border-color: var(--accent);
}
.tm-matches-more .tm-matches { margin-top: 8px; }

/* When the verdict is "clear", the disclosure is a reassurance, not a warning —
 * use a subtler grey treatment instead of the blue accent. */
.orgbook-clear-disclosure > summary {
  color: var(--slate-700);
  background: var(--bg-subtle);
  border-color: var(--border);
  font-weight: 500;
}
.orgbook-clear-disclosure > summary:hover {
  background: var(--slate-100);
  border-color: var(--slate-700);
}

/* ─── Wave 3: Live-CIPO check row outside the trademark card ─────── */
.tm-livecheck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.tm-livecheck-text {
  font-size: 12.5px;
  color: var(--slate-600);
  line-height: 1.5;
  flex: 1;
}
@media (max-width: 640px) {
  .tm-livecheck-row { flex-direction: column; align-items: stretch; }
}

/* ════════════════════════════════════════════════════════════════════
   Wave B — Section 0 (Founder & ID) + live fee estimator
   ════════════════════════════════════════════════════════════════════ */

/* ─── ID upload drop-zone (variant of address upload) ─────────────── */
.drop-zone-id {
  border: 2px dashed var(--accent);
  background: linear-gradient(135deg, #f0f6ff 0%, #ebf2fc 100%);
  padding: 22px 18px;
}
.drop-zone-id:hover, .drop-zone-id.dragover {
  border-color: var(--accent-hover);
  background: linear-gradient(135deg, #e6efff 0%, #d9e7fa 100%);
}
.drop-zone-id .drop-zone-icon {
  margin-bottom: 10px;
}
.drop-zone-id .drop-zone-icon svg {
  width: 36px;
  height: 36px;
}
/* While AI is reading the ID, dim and stripe the upload zone */
.drop-zone-id.extracting {
  pointer-events: none;
  opacity: 0.7;
  background-image: linear-gradient(135deg, #f0f6ff 25%, #ebf2fc 25%, #ebf2fc 50%, #f0f6ff 50%, #f0f6ff 75%, #ebf2fc 75%, #ebf2fc);
  background-size: 24px 24px;
  animation: extracting-stripe 1s linear infinite;
}
@keyframes extracting-stripe {
  0%   { background-position: 0 0; }
  100% { background-position: 24px 24px; }
}

/* Locked-fields visual state during ID extraction */
.section-panel.extracting-id input:disabled,
.section-panel.extracting-id select:disabled {
  background: var(--slate-50);
  color: var(--text-muted);
  cursor: wait;
  opacity: 0.85;
}
.extract-hint {
  display: block;
  font-size: 11.5px;
  font-weight: normal;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* ─── Generic button-loading state with inline spinner ──────────── */
.btn-loading {
  cursor: wait;
  opacity: 0.85;
}
.btn .spinner,
.btn-loading .spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spinner-rotate 0.7s linear infinite;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ─── Verify availability loading card (replaces small loading row) */
.verify-loading-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--accent-50) 0%, #e6efff 100%);
  border: 1px solid var(--info-200);
  border-radius: var(--radius-lg);
  margin-top: 6px;
}
.verify-loading-spinner {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent-50);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
  margin-top: 2px;
}
.verify-loading-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.verify-loading-phases {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.verify-loading-phases .phase-active {
  display: block;
}
.verify-loading-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Live fee estimator (sidebar component, collapsible) ──────────── */
.fee-estimator {
  margin: 16px 0 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.fee-estimator-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.fee-estimator-summary::-webkit-details-marker { display: none; }
.fee-estimator-summary::after {
  content: '▾';
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
  transition: transform 0.15s ease;
}
.fee-estimator[open] .fee-estimator-summary::after {
  transform: rotate(180deg);
}
.fee-estimator-summary:hover {
  background: rgba(15, 39, 64, 0.03);
}
.fee-estimator-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}
.fee-estimator-total {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-hover);
  letter-spacing: -0.01em;
}
.fee-estimator-body {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.fee-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.4;
}
.fee-row .fee-label {
  flex: 1;
  padding-right: 8px;
}
.fee-row .fee-amount {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  white-space: nowrap;
  font-weight: 500;
}
.fee-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}
.fee-total span:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--accent-hover);
}
.fee-note {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 8px;
}

/* Fee groups (government vs legal) — separated for clarity */
.fee-group {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.fee-group:first-of-type {
  border-top: none;
  padding-top: 0;
}
.fee-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.fee-group-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.fee-group-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.fee-group-subtotal span:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--slate-700);
}

/* ════════════════════════════════════════════════════════════════════
   Wave 4 — Restricted-word cards under name analysis (BC Registry-style)
   ════════════════════════════════════════════════════════════════════ */

.restricted-words {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--warning-50);
  border: 1px solid var(--warning-200);
  border-radius: var(--radius);
}
.restricted-words-head {
  font-size: 12.5px;
  color: #713f12;
  margin-bottom: 8px;
  line-height: 1.5;
}
.restricted-word-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--warning);
  color: #fff;
  padding: 1px 8px;
  border-radius: 3px;
  margin: 0 2px;
}
.restricted-word-detail {
  background: #fff;
  border: 1px solid var(--warning-200);
  border-radius: var(--radius);
  margin-top: 6px;
  overflow: hidden;
}
.restricted-word-detail[open] {
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.10);
}
.restricted-word-detail summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--slate-700);
  transition: background 0.12s;
}
.restricted-word-detail summary::-webkit-details-marker { display: none; }
.restricted-word-detail summary:hover { background: var(--warning-50); }
.restricted-word-icon {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}
.restricted-word-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.restricted-word-authority {
  flex: 1;
  font-size: 12.5px;
  color: var(--slate-700);
}
.restricted-word-toggle {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}
.restricted-word-detail[open] .restricted-word-toggle::after { content: ''; }
.restricted-word-detail[open] .restricted-word-toggle {
  /* Replace 'Read more ▾' with 'Read less ▴' when open */
  position: relative;
  font-size: 0;
}
.restricted-word-detail[open] .restricted-word-toggle::before {
  content: 'Read less ▴';
  font-size: 11.5px;
}
.restricted-word-body {
  padding: 0 12px 12px 38px;
  font-size: 12.5px;
  color: var(--slate-700);
  line-height: 1.55;
  border-top: 1px solid var(--warning-200);
  padding-top: 10px;
}
.restricted-word-statute {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.restricted-word-action {
  color: var(--text);
}

/* ════════════════════════════════════════════════════════════════════
   Professional Corporation banner (in Company Section, on nature_of_business)
   ════════════════════════════════════════════════════════════════════ */

.pc-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fffaeb 0%, #fef3c7 100%);
  border: 1px solid var(--warning-200);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
}
.pc-banner-icon {
  font-size: 28px;
  line-height: 1;
  flex: 0 0 auto;
}
.pc-banner-body {
  flex: 1;
}
.pc-banner-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #713f12;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.pc-banner-summary {
  font-size: 13px;
  color: var(--slate-700);
  line-height: 1.55;
  margin-bottom: 10px;
}
.pc-banner-section {
  margin-top: 10px;
  font-size: 12.5px;
}
.pc-banner-section-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.pc-banner-section ul {
  margin: 4px 0 0 18px;
  padding: 0;
  color: var(--slate-700);
  line-height: 1.55;
}
.pc-banner-section li {
  margin-bottom: 3px;
}
.pc-banner-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(180, 83, 9, 0.18);
}

/* ════════════════════════════════════════════════════════════════════
   Wave 3 — BC Registry-aesthetic design polish
   ════════════════════════════════════════════════════════════════════ */

/* ─── .subcard — white card on grey, BC Registry containment pattern ─
 * Wrap each logical subsection of a form section in a .subcard so the
 * form reads as grouped chunks instead of one undifferentiated wall.
 * Section h2 + section-help live OUTSIDE subcards (page-title style).
 * Subsection h3 lives inside, top of the card.                      */
.subcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.subcard:last-child { margin-bottom: 0; }
.subcard > h3:first-child { margin-top: 0; }
.subcard > .section-help {
  margin: -8px 0 16px;
  font-size: 13.5px;
  color: var(--slate-600);
}

/* Optional accent variants for non-standard subcards */
.subcard.subcard-accent {
  border-left: 4px solid var(--accent);
}
.subcard.subcard-success {
  border-left: 4px solid var(--success);
}
.subcard.subcard-quiet {
  background: var(--bg-subtle);
}

/* Tighter padding on mobile */
@media (max-width: 640px) {
  .subcard { padding: 18px 20px; }
}

/* ─── .status-hero — BC Registry's centered status badge pattern ────
 * Used for milestone moments: review-section header, post-submission
 * celebration. Big centered chip + h2 + one-line summary.            */
.status-hero {
  text-align: center;
  padding: 36px 24px 28px;
  margin-bottom: 16px;
}
.status-hero .badge-large {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 1px solid;
}
.status-hero .badge-large .badge-icon {
  font-size: 16px;
  line-height: 1;
}
.status-hero .badge-large.attention {
  background: var(--notice-50);
  color: var(--notice-text);
  border-color: var(--notice-200);
}
.status-hero .badge-large.ready {
  background: var(--success-50);
  color: var(--success);
  border-color: var(--success-200);
}
.status-hero .badge-large.in-progress {
  background: var(--accent-50);
  color: var(--accent-hover);
  border-color: var(--info-200);
}
.status-hero .badge-large.error {
  background: var(--danger-50);
  color: var(--danger);
  border-color: var(--danger-200);
}
.status-hero h2 {
  margin: 18px 0 6px !important;
  font-size: 30px !important;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.status-hero p {
  font-size: 15.5px;
  color: var(--slate-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ─── Yellow notice banner (system-wide info) ───────────────────────
 * Wave 3: distinct from .alert-info (blue, inline factual notes).
 * Used at the very top of a section for "you should know" copy. */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: var(--notice-50);
  border: 1px solid var(--notice-200);
  border-left: 4px solid var(--notice-200);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--notice-text);
  line-height: 1.55;
  margin-bottom: 16px;
}
.notice-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  margin-top: 1px;
}
.notice strong { color: var(--text); }

/* ─── Sticky bottom-nav (Wave 3 polish: tighter, less visually heavy) */
.form-content .section-nav {
  background: var(--card);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(15, 39, 64, 0.05);
  position: sticky;
  bottom: 10px;
  z-index: 10;
  margin-top: 18px;
  min-height: 0;
}
.form-content .section-nav .btn {
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
}
.form-content .section-nav .btn-primary {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
}
.section-nav-progress {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.section-nav-progress strong { color: var(--slate-700); }

/* ─── Header right-side actions (Wave 3 polish) ─────────────────────
 * The form pages put save status + Save & continue later + Exit in the
 * header so the sidebar can stay focused on navigation + fees. */
.header-nav-form {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-save-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-save-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.header-save-status.saving::before { background: var(--warning, #f59e0b); animation: pulse-saving 1.4s infinite; }
.header-save-status.saved::before { background: var(--success); }
.header-save-status.error::before { background: var(--danger); }
.header-save-status.error { color: var(--danger); }
@keyframes pulse-saving {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.header-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  text-decoration: none;
}
.header-nav-link:hover { color: var(--text); text-decoration: underline; }
.btn-compact {
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}

/* ─── Breadcrumb bar (BC Registry-style trail) ──────────────────────
 * Sits between the global header and the form-shell. Reads as
 * Dashboard › New BC incorporation › Step N of M — Section title. */
.breadcrumb-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
}
.breadcrumb-inner {
  max-width: 1320px;
  margin: 0 auto;
}
.breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb li { line-height: 1.4; }
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep {
  color: var(--slate-400);
  font-size: 13px;
  user-select: none;
}
.breadcrumb-current {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.breadcrumb-step-num {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.breadcrumb-step-title {
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.breadcrumb-file-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .breadcrumb-bar { padding: 8px 16px; }
  .breadcrumb { font-size: 12px; gap: 6px; }
  .breadcrumb-step-num { font-size: 10px; }
}

/* ─── Province chips (Wave 3: simpler than the flag grid) ──────────
 * One-line pills with abbreviation + full name; BC pre-selected as
 * "Home" with a small tag. Drops the flag SVGs entirely — they were
 * pretty but added visual weight without function. */
.prov-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.prov-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  color: var(--slate-700);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.prov-chip:hover {
  border-color: var(--slate-400);
  background: var(--bg-subtle);
}
.prov-chip.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-hover);
}
.prov-chip.prov-home:not(.selected) {
  border-style: dashed;
}
.prov-chip input { display: none; }
.prov-chip-flag {
  display: inline-flex;
  width: 22px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15, 39, 64, 0.18);
  flex: 0 0 auto;
  line-height: 0;
}
.prov-chip-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.prov-chip-abbrev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 1px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--bg-subtle);
  color: var(--slate-700);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.prov-chip.selected .prov-chip-abbrev {
  background: var(--card);
  color: var(--accent-hover);
  border-color: var(--info-200);
}
.prov-chip-name {
  font-size: 13px;
  flex: 1;
}
.prov-chip-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
}
@media (max-width: 640px) {
  .prov-chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ─── Section-panel re-layout for subcards ──────────────────────────
 * Wave 3: panel is now a vertical stack of section-title + .subcard*.
 * Removes the previous transparent-everything treatment.             */
.form-content .section-panel {
  border: none;
  box-shadow: none;
  padding: 0 0 32px;
  background: transparent;
  margin-bottom: 16px;
}
.form-content .section-panel > h2,
.form-content .section-panel > .section-help {
  /* Section title + help live OUTSIDE the cards, on page bg */
  padding: 0 4px;
}

/* Visually-hidden label (for accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Name formula box (BC name structure primer) ──────────────────── */
.name-formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--accent-50);
  color: var(--accent-hover);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin: 8px 0 14px;
  text-align: center;
  letter-spacing: 0.01em;
  border: 1px solid var(--info-200);
}
.name-formula-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--slate-700);
  line-height: 1.7;
}
.name-formula-list li { margin-bottom: 4px; }
.name-formula-list strong { color: var(--text); }

/* ─── Eligibility list (BC Registry-style requirements list) ───────── */
.eligibility-list {
  margin: 4px 0 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--slate-700);
  line-height: 1.7;
}
.eligibility-list li { margin-bottom: 4px; }
.eligibility-list strong { color: var(--text); }

/* ─── Subcard section title (h4 inside subcard for nested sections) ── */
.subcard-section-title {
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
}
.subcard-section-title:first-child { margin-top: 4px; }

/* ─── Explainer row (cost/most-pick/renewal stat blocks) ───────────── */
.explainer-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 4px 0 14px;
}
@media (max-width: 640px) {
  .explainer-row { grid-template-columns: 1fr; }
}
.explainer-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.explainer-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.explainer-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ─── Structure preview (nested under structure-cards in subcard) ─── */
.structure-preview {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ─── .choice-cards / .choice-card — selectable description cards ───
 * Used where two side-by-side options each need a small description AND a
 * radio selection. Replaces the previous double-pattern (description grid +
 * separate radio-group) with a single click-to-select card. */
.choice-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 640px) {
  .choice-cards { grid-template-columns: 1fr; }
}
.choice-card {
  position: relative;
  display: block;
  cursor: pointer;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.choice-card:hover {
  border-color: var(--accent);
  background: var(--accent-50);
}
.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.choice-card-head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.choice-card-price {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-hover);
  white-space: nowrap;
}
.choice-card-example {
  font-size: 12.5px;
  color: var(--accent-hover);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 6px;
}
.choice-card-desc {
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.55;
}

/* ─── Inline Yes/No radios for side-by-side questions ─────────────── */
.radio-group-inline {
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
}
.radio-group-inline .radio-option {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 8px 12px;
  justify-content: center;
}

/* When two form-groups sit side-by-side in a form-row-2 and one or both
 * have radio-group-inline at the bottom, the radio rows often misalign
 * because the labels/hints above them are different lengths. This makes
 * each cell a flex column and pushes the radio-group to the bottom, so
 * the buttons line up across columns. Safe for cells without radios — the
 * margin-top: auto rule has no effect when the selector doesn't match. */
.form-row-2 > .form-group {
  display: flex;
  flex-direction: column;
}
.form-row-2 > .form-group > .radio-group {
  margin-top: auto;
}

/* ─── Locked input state (during AI generation) ───────────────────── */
.input-locked {
  background: var(--slate-100) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ─── Inline link-style action button ─────────────────────────────── */
.btn-link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-50);
  border: 1px solid var(--info-200);
  color: var(--accent-hover);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.12s ease;
}
.btn-link-action::before {
  content: '↪';
  font-size: 13px;
}
.btn-link-action:hover {
  background: var(--info-100);
  border-color: var(--accent);
}

/* ─── Inline field error + invalid-state form-group highlight ─────── */
.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border-color: var(--danger) !important;
  background: var(--danger-50) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.field-invalid > label {
  color: var(--danger);
}
.field-invalid .radio-group {
  outline: 2px solid var(--danger-200);
  outline-offset: 4px;
  border-radius: var(--radius);
}
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
  margin-top: 6px;
  line-height: 1.4;
}
.field-error::before {
  content: '⚠';
  font-size: 13px;
  flex: 0 0 auto;
}

/* ─── Top-of-section error summary (shown above the panel) ────────── */
.section-alert.alert-error {
  background: var(--danger-50);
  border: 1px solid var(--danger-200);
  border-left: 4px solid var(--danger);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}
.error-summary-head {
  font-size: 14px;
  color: var(--danger);
  margin-bottom: 6px;
}
.error-summary-list {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--slate-700);
}
.error-summary-list li { margin-bottom: 2px; }
.error-summary-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.error-summary-list a:hover { text-decoration: underline; }

/* ─── Processing times link (BC government live page) ─────────────── */
.processing-times-link {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.processing-times-link a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.processing-times-link a:hover { text-decoration: underline; }
.processing-times-link-meta,
.processing-times-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ════════════════════════════════════════════════════════════════════
   Dashboard v2 — drafts section, file numbers, delete actions, modal
   ════════════════════════════════════════════════════════════════════ */

.dashboard-section {
  margin-bottom: 32px;
}
.dashboard-section-head {
  margin-bottom: 12px;
}
.dashboard-section-head h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.dashboard-section-head h3 .count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}
.dashboard-section-help {
  font-size: 13px;
  margin: 4px 0 0 0;
}

/* ─── File-number chip (clickable to inline-edit) ─────────────── */
.col-file-number {
  white-space: nowrap;
  width: 1%;
}
.file-number-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--slate-700);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}
.file-number-chip:hover {
  background: var(--accent-50);
  border-color: var(--info-200);
  color: var(--accent-hover);
}

/* ─── Row actions (delete buttons, resume button) ─────────────── */
.col-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.col-actions .btn-tiny {
  font-size: 11.5px;
  padding: 5px 10px;
  margin-right: 6px;
}
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  vertical-align: middle;
  transition: all 0.12s ease;
}
.row-action:hover {
  background: var(--danger-50);
  color: var(--danger);
  border-color: var(--danger-200);
}

/* ─── Confirmation modal ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 64, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  max-width: 460px;
  width: calc(100% - 40px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 39, 64, 0.25);
}
.modal h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.modal p {
  margin: 0 0 18px 0;
  font-size: 14px;
  color: var(--slate-700);
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── File-number column header tweaks ─────────────────────────── */
.table th.col-actions { width: 1%; }
.table th:first-child { width: 1%; white-space: nowrap; }

/* Doc-count chip on the entities row */
.col-doc-count { white-space: nowrap; width: 1%; text-align: center; }
.doc-count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--accent-50);
  border: 1px solid var(--info-200);
}

/* Step label column (drafts table) */
.col-step {
  font-size: 13px;
  color: var(--slate-700);
}

/* ─── Phase 7: Invite client modal + page-header actions ────────── */
.page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.modal-wide {
  max-width: 560px;
}
.modal-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.55;
}
.invite-form .form-group {
  margin-bottom: 14px;
}
.invite-form input[type="text"],
.invite-form input[type="email"],
.invite-form select,
.invite-form textarea {
  width: 100%;
}
.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.invite-link-row input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.alert-success {
  background: var(--success-50);
  border: 1px solid var(--success-200);
  color: #14532d;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
}

/* ─── Phase 7b: Notifications bell + panel ───────────────────── */
.notif-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
}
.notif-bell:hover { background: rgba(255,255,255,0.18); }
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  border: 2px solid var(--primary, #0f2740);
}
.notif-panel {
  position: absolute;
  top: 64px;
  right: 24px;
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(15, 39, 64, 0.15);
  z-index: 90;
}
.notif-panel-head {
  position: sticky;
  top: 0;
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-body { padding: 4px 0; }
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-subtle); }
.notif-item.is-unread {
  background: var(--accent-50);
}
.notif-item.is-unread:hover { background: var(--info-100); }
.notif-subject {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.notif-body {
  font-size: 12.5px;
  color: var(--slate-600);
  line-height: 1.45;
  margin-bottom: 4px;
}
.notif-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* ─── Phase 7c: Privacy disclosure callout ─────────────────────── */
.privacy-disclosure {
  font-size: 12.5px;
  color: var(--slate-700);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 0 0 14px;
  line-height: 1.55;
}
.privacy-disclosure strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   Phase 8 — Entity detail page
   ════════════════════════════════════════════════════════════════════ */

.entity-detail {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

/* Page header card with file number + status + actions */
.entity-header-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.entity-header-eyebrow {
  margin-bottom: 6px;
}
.entity-header-name {
  margin: 0 0 12px 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.entity-header-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.meta-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--slate-700);
}
.meta-pill-muted { color: var(--text-muted); font-style: italic; }
.entity-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Two-column grid: main content left, audit feed right */
.entity-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}
@media (max-width: 1024px) {
  .entity-detail-grid { grid-template-columns: 1fr; }
}
.entity-detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.entity-detail-side {
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

/* Each section card */
.entity-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.entity-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.entity-section .table-wrapper {
  margin: 0 -8px;
}
.entity-section .table th,
.entity-section .table td {
  font-size: 13px;
}
.entity-section .cell-address,
.entity-section .cell-rights {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.45;
}
.entity-section .empty-row {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Audit feed (right rail) */
.audit-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.audit-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.audit-item:last-child { border-bottom: none; }
.audit-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex: 0 0 auto;
}
.audit-body { flex: 1; min-width: 0; }
.audit-headline {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}
.audit-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 4px;
  text-transform: capitalize;
}

/* ════════════════════════════════════════════════════════════════════
   Phase 9 — Document generation modal
   ════════════════════════════════════════════════════════════════════ */
.gen-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}
.gen-docs-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.gen-docs-item:hover { border-color: var(--accent); background: var(--accent-50); }
.gen-docs-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg-subtle);
}
.gen-docs-item input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }
.gen-docs-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.gen-docs-item-desc {
  font-size: 12.5px;
  color: var(--slate-600);
  margin-top: 2px;
  line-height: 1.4;
}
.gen-docs-item-warn {
  font-size: 12px;
  color: var(--notice-text);
  margin-top: 4px;
  font-style: italic;
}

.gen-docs-progress {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--slate-700);
  line-height: 1.55;
}
.gen-progress-line { padding: 2px 0; }
.gen-progress-meta { color: var(--text-muted); font-size: 11.5px; }
.gen-progress-error { color: var(--danger); font-weight: 500; }
.gen-docs-progress code {
  font-size: 11.5px;
  background: var(--card);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ─── Generated documents list (entity page) ─────────────────────── */
.entity-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.entity-section-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.entity-section-link:hover { text-decoration: underline; }
.package-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.package-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--bg-subtle);
}
.package-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.package-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.package-title strong {
  font-size: 13.5px;
  color: var(--text);
}
.package-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.package-warn {
  font-size: 12px;
  color: var(--notice-text);
  font-weight: 500;
  cursor: help;
}
.package-manifest {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--slate-700);
}
.package-manifest > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.package-manifest > summary:hover { text-decoration: underline; }
.package-manifest ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}
.package-manifest li {
  margin-bottom: 2px;
}
.package-manifest code {
  font-size: 11.5px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Storage path under each package — small monospace line */
.package-path {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}
.package-path code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* ─── Documents folder browser (Phase 9a soft-folders) ─────────── */

/* Top-level entity folders + entity sub-folders share the same grid */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.folder-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  min-height: 100px;
}
.folder-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(15, 39, 64, 0.08);
  transform: translateY(-1px);
}
.folder-card.is-deleted { opacity: 0.55; }
.folder-card.is-empty { opacity: 0.7; }
.folder-card-icon {
  font-size: 32px;
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
}
.folder-card-body {
  flex: 1;
  min-width: 0;
}
.folder-card-eyebrow { margin-bottom: 6px; }
.folder-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
  word-break: break-word;
}
.folder-card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.folder-card-desc {
  font-size: 12px;
  color: var(--slate-600);
  margin-top: 6px;
  line-height: 1.4;
}

/* Individual file rows inside a category view */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.file-row:hover { border-color: var(--slate-400); }
.file-icon {
  font-size: 20px;
  flex: 0 0 auto;
}
.file-meta {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.file-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Entity-page Documents section — by-category file list */
.entity-docs-categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.entity-docs-category {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}
.entity-docs-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin: 0;
  font-size: 13.5px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.12s;
}
.entity-docs-cat-head:hover {
  background: rgba(0, 0, 0, 0.025);
}
.entity-docs-category.is-collapsed .entity-docs-cat-head {
  border-radius: var(--radius-md);
}
.cat-chevron {
  display: inline-block;
  font-size: 11px;
  color: var(--slate-500, #64748b);
  transition: transform 0.18s ease;
  transform: rotate(0deg);
  width: 10px;
}
.entity-docs-category.is-collapsed .cat-chevron {
  transform: rotate(-90deg);
}
.cat-title { flex: 1; min-width: 0; }
.cat-count {
  font-size: 12px;
  color: var(--slate-500, #64748b);
  flex-shrink: 0;
}
.entity-docs-cat-body {
  padding: 0 14px 12px;
  overflow: hidden;
  max-height: 5000px;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.18s ease;
  opacity: 1;
}
.entity-docs-category.is-collapsed .entity-docs-cat-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}
.entity-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.entity-docs-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.entity-docs-file .file-meta { flex: 1; min-width: 0; }

/* ─── Documents page (firm-wide document store) ─────────────────── */
.docs-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--slate-700);
  margin-bottom: 16px;
}
.docs-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.docs-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.docs-group.is-deleted { opacity: 0.6; }
.docs-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.docs-group-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.docs-group-name:hover {
  color: var(--accent);
  text-decoration: underline;
}
.docs-group .package-item {
  margin-top: 10px;
}
.docs-group .package-item:first-of-type {
  margin-top: 0;
}

/* ─── Phase 7f: Inline file-number editing input ──────────────── */
.file-number-edit {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  width: 110px;
  padding: 1px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  outline: none;
  background: #fff;
}

/* ════════════════════════════════════════════════════════════════════
   Phase 9a-bis — AI Document Editing UI
   ──────────────────────────────────────────────────────────────────── */

/* Per-file action group on the entity Documents section */
.entity-docs-file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Version chip on edited document file names */
.version-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-50);
  color: var(--accent);
  border: 1px solid var(--accent-200, var(--accent));
  border-radius: 10px;
  vertical-align: middle;
}

/* AI edit modal — layer choice (Field vs Text) */
.ai-edit-layer-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-edit-layer-option {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ai-edit-layer-option:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: var(--accent-50);
}
.ai-edit-layer-option:has(input[type="radio"]:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}
.ai-edit-layer-option input[type="radio"] {
  margin: 4px 0 0 0;
}
.ai-edit-layer-title { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.ai-edit-layer-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* AI proposal review */
.ai-proposal-summary {
  margin-bottom: 12px;
}
.ai-conf-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
}
.ai-conf-high { background: var(--success-50); color: #064e3b; border: 1px solid var(--success-200); }
.ai-conf-med  { background: var(--warning-50); color: #78350f; border: 1px solid var(--warning-200); }
.ai-conf-low  { background: var(--danger-50);  color: #7f1d1d; border: 1px solid var(--danger-200); }

/* List of proposed changes — checkable */
.ai-changes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px 0;
}
.ai-change-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ai-change-row:hover { border-color: var(--accent); }
.ai-change-row:has(input:checked) { background: var(--accent-50); border-color: var(--accent); }
.ai-change-row input[type="checkbox"] { margin: 4px 0 0 0; flex-shrink: 0; }
.ai-change-detail { flex: 1; min-width: 0; }
.ai-change-label  { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.ai-change-diff   {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
}
.ai-change-old   { background: var(--danger-50);  color: #7f1d1d; padding: 2px 6px; border-radius: 4px; text-decoration: line-through; text-decoration-color: rgba(127,29,29,0.4); }
.ai-change-new   { background: var(--success-50); color: #064e3b; padding: 2px 6px; border-radius: 4px; }
.ai-change-arrow { color: var(--text-muted); }
.ai-change-reason {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Layer-2 paragraph redline */
.ai-redline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.ai-redline-old {
  background: var(--danger-50);
  color: #7f1d1d;
  padding: 6px 9px;
  border-radius: 4px;
  border-left: 3px solid var(--danger);
  text-decoration: line-through;
  text-decoration-color: rgba(127,29,29,0.5);
}
.ai-redline-new {
  background: var(--success-50);
  color: #064e3b;
  padding: 6px 9px;
  border-radius: 4px;
  border-left: 3px solid var(--success, #10b981);
}
.ai-redline-context {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--slate-50, #f8fafc);
  border-radius: 4px;
}

/* Cost line */
.ai-cost-line { text-align: right; }

/* Final toggle — quiet checkbox-style control on each draft / final document */
.finalize-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.finalize-toggle:hover { border-color: var(--accent); color: var(--text); }
.finalize-toggle input[type="checkbox"] { margin: 0; cursor: pointer; }
.finalize-toggle input[type="checkbox"]:disabled { cursor: not-allowed; }
.finalize-toggle.is-final {
  background: var(--success-50, #ecfdf5);
  border-color: var(--success-200, #a7f3d0);
  color: #064e3b;
  font-weight: 600;
}
.finalize-toggle.is-busy { opacity: 0.6; cursor: wait; }

/* Bulk-download toolbar (documents.html category view) */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.bulk-select-all input { margin: 0; cursor: pointer; }
.bulk-count { font-size: 12px; }
.bulk-toolbar-actions { margin-left: auto; }

/* Per-row checkbox column on the documents.html file list */
.file-cb {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  padding: 4px;
  cursor: pointer;
}
.file-cb input[type="checkbox"] { margin: 0; cursor: pointer; }

/* E-signature status pill (Phase 10) */
.esig-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--warning-50);
  color: #78350f;
  border: 1px solid var(--warning-200);
  border-radius: 12px;
}

/* v6: status chips inline next to file name */
.status-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  vertical-align: middle;
}
.status-chip-final {
  background: var(--success-50, #ecfdf5);
  color: #064e3b;
  border: 1px solid var(--success-200, #a7f3d0);
}
.status-chip-awaiting {
  background: var(--warning-50);
  color: #78350f;
  border: 1px solid var(--warning-200);
}

/* ─── Phase 11: Name Reservation card ──────────────────────────── */
.nr-card {
  background: linear-gradient(180deg, #eff6ff 0%, #f5f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 18px 22px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.nr-card-empty {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
}
.nr-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px dashed #bfdbfe;
}
.nr-card-head h4 {
  margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 700; color: #1e3a8a;
  display: flex; align-items: center; gap: 10px;
}
.nr-card-sub { margin-top: 4px; font-size: 12.5px; color: #475569; }
.nr-paths {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.nr-intake-preview {
  background: #fff; border: 1px solid #cbd5e1; border-radius: var(--radius);
  padding: 14px 18px; font-size: 13.5px; color: #0f172a;
}
.nr-intake-preview strong { color: #1e3a8a; }
.nr-intake-preview code {
  background: #eff6ff; padding: 2px 8px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-weight: 600;
  color: #1e3a8a;
}
.nr-path {
  background: #fff; border: 1px solid #cbd5e1; border-radius: var(--radius);
  padding: 14px 16px;
}
.nr-path strong { display: block; margin-bottom: 6px; color: #0f172a; font-size: 14px; }
.nr-path p { margin: 0 0 12px; font-size: 12.5px; color: #475569; line-height: 1.5; }
@media (max-width: 760px) { .nr-paths { grid-template-columns: 1fr; } }

/* Candidate cards */
.nr-candidates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.nr-candidate {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: var(--radius);
  padding: 12px 14px; transition: border 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.nr-candidate:hover { border-color: #93c5fd; }
.nr-candidate.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #f0f7ff;
}
.nr-candidate-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nr-candidate-name { font-weight: 700; font-size: 14px; color: #0f172a; }
.nr-likelihood {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  letter-spacing: 0.5px;
}
.nr-likelihood-high   { background: #dcfce7; color: #14532d; }
.nr-likelihood-medium { background: #fef3c7; color: #78350f; }
.nr-likelihood-low    { background: #fee2e2; color: #7f1d1d; }
.nr-candidate-rationale { font-size: 12.5px; color: #475569; line-height: 1.45; }
.nr-candidate-notes {
  font-size: 11.5px; color: #92400e; background: #fef3c7;
  padding: 6px 10px; border-radius: 4px;
}
.nr-collisions {
  font-size: 11.5px; color: #7f1d1d; background: #fee2e2;
  padding: 6px 10px; border-radius: 4px; line-height: 1.6;
}
.nr-collisions strong { display: block; margin-bottom: 2px; }
.nr-collision { display: block; }
.nr-collision em { color: #991b1b; font-size: 11px; }
.nr-no-collisions { font-size: 11.5px; color: #14532d; }
.nr-candidate-actions { margin-top: 4px; }
@media (max-width: 760px) { .nr-candidates { grid-template-columns: 1fr; } }

/* Pending / approved / rejected detail */
.nr-pending, .nr-approved, .nr-rejected {
  background: #fff; border: 1px solid #cbd5e1; border-radius: var(--radius);
  padding: 14px 16px;
}
.nr-pending-row {
  display: flex; gap: 10px; align-items: baseline; padding: 6px 0;
  font-size: 13px; border-bottom: 1px solid #f1f5f9;
}
.nr-pending-row:last-child { border-bottom: none; }
.nr-pending-row .text-muted { min-width: 160px; flex-shrink: 0; }
.nr-pending-help {
  margin-top: 12px; padding: 10px 12px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 4px;
  font-size: 12.5px; color: #78350f; line-height: 1.5;
}

.nr-actions-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed #cbd5e1;
}

/* ─── v14: Active envelope summary card ──────────────────────────── */
.envelopes-card {
  background: linear-gradient(180deg, #fffbed 0%, #fff7df 100%);
  border: 1px solid #f3d684;
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  margin: 4px 0 20px;
  box-shadow: 0 2px 8px rgba(243, 214, 132, 0.18);
}
.envelopes-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(243, 214, 132, 0.7);
}
.envelopes-card-head h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #7a5b18;
}
.envelopes-card-sub {
  margin-top: 3px;
  font-size: 12px;
  color: #8a6e2e;
}
.envelopes-card-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-danger-tiny {
  border-color: #fecaca !important;
  color: #991b1b !important;
}
.btn-danger-tiny:hover:not(:disabled) {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
}
.envelopes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.envelope-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(243, 214, 132, 0.85);
  border-radius: var(--radius);
  overflow: hidden;
}
.envelope-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(243, 214, 132, 0.45);
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}
.envelope-meta { flex: 1; min-width: 0; }
.envelope-title {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.envelope-role {
  font-weight: 700;
  color: #4a3105;
  text-transform: capitalize;
  font-size: 14px;
}
.envelope-doc-count {
  font-size: 11.5px;
  color: #8a6e2e;
  font-weight: 500;
}
.envelope-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--warning-50);
  color: #78350f;
  border: 1px solid var(--warning-200);
}
.envelope-status-in_progress {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.envelope-sub {
  font-size: 12px;
  color: #6b7280;
}
.envelope-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.envelope-doc-list {
  list-style: none;
  margin: 0;
  padding: 6px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.envelope-doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 4px;
  border-radius: 4px;
  font-size: 13px;
}
.envelope-doc-row:hover {
  background: #fffaf0;
}
.envelope-doc-icon {
  font-size: 14px;
  color: #8a6e2e;
}
.envelope-doc-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.envelope-doc-name:hover {
  color: var(--accent);
  text-decoration: underline;
}
.envelope-doc-size {
  font-size: 11.5px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* v6: bulk-action menu (popup) */
.bulk-actions-wrapper {
  position: relative;
  display: inline-block;
}
.bulk-actions-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 39, 64, 0.18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bulk-action-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}
.bulk-action-item:hover {
  background: var(--accent-50);
}
.bulk-action-item.bulk-action-danger {
  color: var(--danger);
}
.bulk-action-item.bulk-action-danger:hover {
  background: var(--danger-50);
}

/* Modal with sticky footer — keeps action buttons visible when the
   doc list is long (e.g. Generate Documents with 7+ items) */
.modal-with-sticky-footer {
  display: flex;
  flex-direction: column;
  padding: 0;          /* zero — children manage padding */
  max-height: calc(100vh - 80px);
}
.modal-scroll-body {
  overflow-y: auto;
  padding: 24px 28px 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-sticky-footer {
  position: sticky;
  bottom: 0;
  background: var(--card);
  padding: 14px 28px 18px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 16px -8px rgba(15, 39, 64, 0.08);
  margin-top: 0;
  z-index: 1;
}
