 :root {
  color-scheme: dark;
  --bg: #07142c;
  --bg-soft: #0c1e42;
  --panel: #10295a;
  --panel-2: #153873;
  --panel-3: #1b4d91;
  --text: #ffffff;
  --muted: #c7dcff;
  --border: #3b71bb;
  --primary: #28e0c2;
  --primary-hover: #67f4dc;
  --primary-ink: #03241f;
  --accent: #7d6cff;
  --accent-hot: #ff4fa3;
  --sunrise: #ffbd3d;
  --danger: #ff7a8a;
  --danger-bg: #4a1730;
  --success: #43f087;
  --warning-bg: #3a2c06;
  --warning-border: #e5a91f;
  --warning-text: #fff2bd;
  --assistant: #0d2855;
  --user: #1c3f82;
  --code-bg: #041025;
  --focus: #ffe66d;
  --shadow: 0 22px 70px rgba(0, 8, 35, 0.36);
  --radius: 18px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(40, 224, 194, 0.24), transparent 26%),
    radial-gradient(circle at 90% 6%, rgba(255, 79, 163, 0.20), transparent 24%),
    radial-gradient(circle at 78% 88%, rgba(125, 108, 255, 0.22), transparent 28%),
    linear-gradient(145deg, #081834 0%, #0b2450 48%, #101b45 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  background: var(--focus);
  color: #111;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { top: 16px; }

.app-shell {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  padding: 20px;
}

.chat-shell { padding-bottom: 40px; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 10px 0 18px;
  margin-bottom: 18px;
}

.brand-block h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0.035em;
}

.brand-block > p:last-child,
.topbar p { margin: 7px 0 0; color: var(--muted); }

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-hover);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a,
.link-button {
  color: var(--muted);
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.site-nav a:hover,
.link-button:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.status-dot {
  width: 11px;
  height: 11px;
  display: inline-block;
  border-radius: 999px;
  background: #7d8794;
  box-shadow: 0 0 0 4px rgba(125, 135, 148, 0.12);
}
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(82, 210, 115, 0.12); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 116, 108, 0.12); }
.status-dot.unknown { background: #8d99a7; }

.privacy-warning,
.privacy-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.privacy-warning { font-weight: 700; }
.privacy-banner { display: grid; gap: 8px; }
.privacy-banner summary { cursor: pointer; font-weight: 700; }
.privacy-banner p { margin: 8px 0 0; }

.controls,
.card,
.composer,
.access-panel,
.welcome-panel,
.workflow-panel,
.selected-claim-panel {
  background: rgba(21, 31, 43, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.controls,
.card,
.composer,
.welcome-panel,
.selected-claim-panel { padding: 18px; margin-bottom: 18px; }

.controls h2,
.card h2,
.composer h2,
.welcome-panel h2 { margin: 0 0 12px; line-height: 1.2; }
.controls h3, .card h3 { margin-top: 18px; }

.access-panel { margin-bottom: 18px; overflow: hidden; }
.access-panel > summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.025);
}
.access-content { padding: 0 18px 18px; }

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  background: var(--code-bg);
  color: var(--text);
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
input::placeholder, textarea::placeholder { color: #8e9bad; opacity: 1; }
textarea { resize: vertical; min-height: 104px; }
select { min-height: 46px; }

button {
  min-height: 44px;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
}
button:hover { background: var(--panel-3); }
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 850;
}
button.primary:hover { background: var(--primary-hover); }
button.quiet { background: transparent; }
button.danger { color: #fff; background: var(--danger-bg); border-color: var(--danger); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-button { min-width: 44px; padding: 5px 12px; font-size: 1.5rem; }

.invite-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto auto;
  gap: 9px;
  align-items: end;
}

.hint,
.keyboard-hint,
.character-count {
  color: var(--muted);
  font-size: 0.86rem;
}
.hint { margin: 8px 0 0; }
.keyboard-hint { margin: 12px 0 0; }
.character-count { white-space: nowrap; }

kbd, code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  color: #d7e2ef;
}

.welcome-panel {
  display: grid;
  gap: 18px;
  background: linear-gradient(145deg, rgba(30, 67, 108, 0.78), rgba(21, 31, 43, 0.98));
}
.welcome-panel p { color: var(--muted); max-width: 760px; }

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.starter-card {
  display: grid;
  gap: 5px;
  min-height: 96px;
  text-align: left;
  align-content: center;
  background: rgba(7, 14, 22, 0.52);
}
.starter-card strong { font-size: 1.02rem; }
.starter-card span { color: var(--muted); font-weight: 500; }

.chat {
  min-height: 260px;
  max-height: 68vh;
  overflow-y: auto;
  background: rgba(7, 12, 18, 0.68);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  scroll-padding-bottom: 24px;
}

.empty-chat {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
  color: var(--muted);
}
.empty-chat strong { color: var(--text); font-size: 1.1rem; }

.message-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 16px;
  overflow: hidden;
  background: var(--assistant);
}
.message-card.user { margin-left: 12%; border-color: rgba(77, 156, 255, 0.64); background: var(--user); }
.message-card.assistant { margin-right: 5%; }
.message-card.error-message { border-color: var(--danger); }

.message-meta {
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 8px 12px;
}
.message-card.user .message-meta { background: rgba(77, 156, 255, 0.22); color: #fff; }

.message-text {
  padding: 14px 16px;
  overflow-wrap: anywhere;
}
.message-text > :first-child { margin-top: 0; }
.message-text > :last-child { margin-bottom: 0; }
.message-text h2 { margin: 22px 0 8px; font-size: 1.35rem; }
.message-text h3 { margin: 19px 0 7px; font-size: 1.16rem; }
.message-text h4, .message-text h5 { margin: 16px 0 6px; font-size: 1.02rem; }
.message-text p { margin: 0 0 10px; }
.message-text ul, .message-text ol { margin: 8px 0 13px; padding-left: 24px; }
.message-text li { margin: 5px 0; }
.message-text blockquote { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--primary); background: rgba(0, 0, 0, 0.18); }

.message-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 10px;
}
.message-actions button { min-height: 34px; padding: 6px 10px; font-size: 0.82rem; }

.message-details-wrap {
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.message-details-wrap summary { cursor: pointer; padding: 10px 12px; font-size: 0.82rem; font-weight: 750; }
.message-details {
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
}

.sticky-composer {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.composer-heading-row,
.composer-lower,
.dialog-header,
.dialog-actions,
.workspace-toolbar,
.selected-claim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.composer-heading-row h2 { margin: 0; }
.composer-lower { align-items: flex-end; margin-top: 10px; }
.composer-actions,
.button-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.send-button { min-width: 150px; }
.turnstile-panel { min-height: 70px; flex: 1; }
#turnstileWidget { max-width: 100%; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 14px 2px 0;
}

.help-dialog {
  width: min(700px, calc(100% - 28px));
  max-height: 86vh;
  overflow: auto;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}
.help-dialog::backdrop { background: rgba(3, 7, 11, 0.78); }
.dialog-header, .dialog-actions { padding: 16px 18px; }
.dialog-header { border-bottom: 1px solid var(--border); }
.dialog-header h2 { margin: 0; }
.dialog-actions { border-top: 1px solid var(--border); justify-content: flex-end; }
.help-content { padding: 18px; }
.help-steps { padding-left: 24px; }
.help-steps li { margin-bottom: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(520px, calc(100% - 32px));
  background: #eff7ff;
  color: #07111e;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 750;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Veteran workspace */
.dashboard-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 9px;
  margin-bottom: 16px;
  background: rgba(11, 17, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}
.dashboard-nav button { white-space: nowrap; min-height: 40px; padding: 7px 11px; }

.selected-claim-panel { border-color: rgba(77, 156, 255, 0.58); }
.selected-claim-row { align-items: end; }
.selected-claim-row > div:first-child { flex: 1; }
.selected-claim-summary { color: var(--muted); margin: 10px 0 0; }

.claims-grid,
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.claim-card,
.intel-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.025);
  overflow-wrap: anywhere;
}
.claim-card.selected { border: 2px solid var(--primary); background: rgba(77, 156, 255, 0.09); }
.claim-card h3 { margin: 0 0 7px; }
.claim-card p { margin: 5px 0; color: var(--muted); }
.claim-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0; }
.pill { border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px; font-size: 0.82rem; background: rgba(255,255,255,0.05); }
.intel-card.full { grid-column: 1 / -1; }
.intel-card.priority { border-width: 2px; }
.intel-card h3 { margin: 0 0 9px; }
.intel-list { padding-left: 20px; }
.intel-list li { margin-bottom: 10px; }

.workflow-panel,
.developer-details {
  margin: 0 0 16px;
  overflow: clip;
}
.workflow-panel > summary,
.developer-details > summary {
  cursor: pointer;
  padding: 16px 18px;
  font-size: 1.03rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.025);
}
.workflow-panel > .controls,
.developer-details > .controls { border: 0; border-top: 1px solid var(--border); border-radius: 0; margin: 0; box-shadow: none; }

.grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.message-text,
.copy-output,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre.message-text,
pre:not(.message-details) {
  background: var(--assistant);
  color: var(--text);
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 520px;
  overflow: auto;
}

.error { color: var(--danger); font-weight: 800; }
.copy-output { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; margin-top: 10px; display: none; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .topbar { align-items: flex-start; }
  .header-actions { justify-items: start; }
  .site-nav { justify-content: flex-start; }
  .starter-grid, .grid, .form-grid { grid-template-columns: 1fr; }
  .invite-row { grid-template-columns: 1fr auto; }
  .invite-row .primary, .invite-row .quiet { grid-column: auto; }
  .composer-lower, .selected-claim-row { align-items: stretch; flex-direction: column; }
  .composer-actions { width: 100%; }
  .composer-actions button { flex: 1 1 auto; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .app-shell { padding: 12px; }
  .topbar { flex-direction: column; gap: 14px; }
  .header-actions { width: 100%; }
  .site-nav { width: 100%; }
  .status-panel { padding-left: 8px; }
  .invite-row { grid-template-columns: 1fr 1fr; }
  .invite-row input { grid-column: 1 / -1; }
  .starter-grid { grid-template-columns: 1fr; }
  .chat { max-height: 62vh; padding: 8px; }
  .message-card.user, .message-card.assistant { margin-left: 0; margin-right: 0; }
  .sticky-composer { bottom: 4px; padding: 14px; }
  .composer-heading-row { align-items: flex-start; }
  .composer-actions button { flex: 1 1 100%; }
  .claims-grid, .intelligence-grid { grid-template-columns: 1fr; }
  .dashboard-nav { margin-left: -4px; margin-right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Step 18B - Veteran journey ladder */
.journey-page { overflow: hidden; }
.journey-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
}

.journey-sidebar {
  position: relative;
  z-index: 60;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(13, 43, 91, 0.97), rgba(7, 25, 57, 0.99)),
    var(--bg-soft);
  border-right: 1px solid rgba(103, 244, 220, 0.28);
  box-shadow: 18px 0 55px rgba(0, 8, 35, 0.30);
  scrollbar-width: thin;
}

.sidebar-brand {
  position: relative;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(199, 220, 255, 0.18);
}
.sidebar-brand h1 { margin: 0; font-size: 2.35rem; line-height: 1; letter-spacing: .05em; }
.sidebar-brand > p:not(.eyebrow) { margin: 8px 0 14px; color: var(--muted); }
.eyebrow.bright { color: var(--primary); }
.sidebar-status { color: #e8f5ff; }
.mobile-menu-close { display: none; position: absolute; right: 0; top: 0; }

.journey-progress {
  display: grid;
  gap: 3px;
  margin: 18px 8px 12px;
  padding: 11px 13px;
  border: 1px solid rgba(40, 224, 194, 0.35);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(40, 224, 194, 0.12), rgba(125, 108, 255, 0.12));
}
.journey-progress span { color: var(--primary); font-size: .68rem; font-weight: 900; letter-spacing: .14em; }
.journey-progress strong { font-size: .98rem; }

.journey-ladder { display: grid; gap: 5px; }
.journey-step {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
}
.journey-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 49px;
  height: 15px;
  width: 2px;
  background: rgba(103, 244, 220, 0.22);
}
.journey-step:hover { color: #fff; background: rgba(255, 255, 255, 0.07); border-color: rgba(199, 220, 255, 0.16); }
.journey-step.active {
  color: #fff;
  border-color: rgba(40, 224, 194, 0.72);
  background: linear-gradient(110deg, rgba(40, 224, 194, 0.20), rgba(125, 108, 255, 0.24));
  box-shadow: 0 9px 24px rgba(1, 12, 37, 0.26);
}
.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(125, 108, 255, 0.38);
  border: 1px solid rgba(199, 220, 255, 0.30);
  font-size: .78rem;
  font-weight: 900;
}
.journey-step.active .step-number { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.journey-step strong, .journey-step small { display: block; }
.journey-step strong { font-size: .91rem; line-height: 1.15; }
.journey-step small { margin-top: 3px; color: inherit; opacity: .75; font-size: .72rem; line-height: 1.15; }
.sidebar-actions { display: grid; gap: 7px; margin: 16px 6px 0; padding-top: 14px; border-top: 1px solid rgba(199, 220, 255, 0.16); }
.sidebar-link { width: 100%; min-height: 42px; display: grid; place-items: center; color: #fff; text-decoration: none; background: rgba(255,255,255,.06); border: 1px solid rgba(199,220,255,.18); border-radius: 10px; }
.sidebar-link:hover { background: rgba(40,224,194,.13); border-color: rgba(40,224,194,.48); }

.journey-main {
  height: 100vh;
  overflow-y: auto;
  padding: 28px clamp(20px, 4vw, 64px) 36px;
  scroll-behavior: smooth;
}
.journey-mobile-header { display: none; }
.journey-panel { width: min(1040px, 100%); margin: 0 auto; animation: panel-arrive .28s ease-out; }
.journey-panel.active { display: block; }
@keyframes panel-arrive { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.welcome-hero {
  min-height: 390px;
  display: grid;
  align-content: center;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid rgba(103, 244, 220, .36);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 189, 61, .24), transparent 23%),
    radial-gradient(circle at 88% 92%, rgba(255, 79, 163, .26), transparent 30%),
    linear-gradient(135deg, rgba(20, 69, 139, .94), rgba(35, 31, 101, .96));
  box-shadow: 0 30px 100px rgba(3, 10, 39, .46);
  overflow: hidden;
}
.welcome-hero h2 { max-width: 840px; margin: 8px 0 16px; font-size: clamp(2.35rem, 5.8vw, 5.05rem); line-height: .99; letter-spacing: -.045em; }
.hero-copy { max-width: 790px; color: #e0ecff; font-size: clamp(1.05rem, 1.6vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.large-button { min-height: 54px; padding: 13px 20px; font-size: 1rem; }
button.secondary { color: #fff; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.10); }
button.secondary:hover { background: rgba(255,255,255,.18); }

.promise-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.promise-grid article, .start-guidance, .access-card, .privacy-card, .guided-form, .record-priority-grid article, .action-card-grid button, .tracker-form, .decision-split article {
  border: 1px solid rgba(199, 220, 255, .22);
  background: linear-gradient(145deg, rgba(15, 48, 103, .92), rgba(12, 31, 73, .94));
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.promise-grid article { padding: 20px; }
.promise-grid article > span { color: var(--sunrise); font-size: .75rem; font-weight: 900; letter-spacing: .12em; }
.promise-grid h3 { margin: 7px 0; font-size: 1.25rem; }
.promise-grid p { margin: 0; color: var(--muted); }
.start-guidance { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: center; padding: 24px 28px; }
.start-guidance h3 { margin: 0 0 7px; font-size: 1.45rem; }
.start-guidance p { color: var(--muted); margin: 0; }
.where-to-start-list { margin: 0; padding-left: 22px; }
.where-to-start-list li { margin: 8px 0; }

.panel-heading { margin-bottom: 20px; padding: 8px 4px; }
.panel-heading.compact { margin-bottom: 12px; }
.panel-heading h2 { max-width: 850px; margin: 4px 0 10px; font-size: clamp(2rem, 4.4vw, 3.8rem); line-height: 1.04; letter-spacing: -.035em; }
.panel-heading p:last-child { max-width: 820px; color: var(--muted); font-size: 1.06rem; }
.access-card, .guided-form, .tracker-form { padding: 22px; margin-bottom: 16px; }
.privacy-card { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 20px 22px; }
.privacy-card h3 { margin: 0 0 6px; }
.privacy-card p { color: var(--muted); margin: 4px 0; }
.privacy-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-ink); background: var(--primary); font-size: 1.4rem; font-weight: 950; }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.quick-start-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.quick-start { min-height: 42px; color: #fff; border-color: rgba(40,224,194,.42); background: rgba(40,224,194,.10); }
.quick-start:hover { background: rgba(40,224,194,.19); }
.journey-panel .chat { max-height: 58vh; }
.journey-panel .sticky-composer { background: rgba(10, 34, 78, .96); border-color: rgba(40,224,194,.35); }

.guided-form { display: grid; gap: 13px; }
.guided-form label { margin-top: 2px; }
.guided-form > button.primary { justify-self: start; min-width: 240px; margin-top: 5px; }
.local-file-import { padding: 15px; border: 1px dashed rgba(40,224,194,.46); border-radius: 13px; background: rgba(40,224,194,.06); }
.local-file-import input { margin-top: 8px; }
.file-status { color: var(--primary-hover); font-weight: 700; margin-top: 8px; }

.record-priority-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 0 0 16px; }
.record-priority-grid article { padding: 17px; }
.record-priority-grid span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-ink); background: var(--sunrise); font-weight: 900; }
.record-priority-grid strong { display: block; margin: 10px 0 5px; }
.record-priority-grid p { margin: 0; color: var(--muted); font-size: .88rem; }

.action-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.action-card-grid button { min-height: 170px; display: grid; align-content: center; gap: 8px; padding: 24px; text-align: left; color: #fff; }
.action-card-grid button:hover { border-color: var(--primary); transform: translateY(-2px); background: linear-gradient(145deg, rgba(28, 88, 171, .96), rgba(42, 42, 120, .96)); }
.action-card-grid strong { font-size: 1.22rem; }
.action-card-grid span { color: var(--muted); }

.packet-checklist { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0 0 18px; }
.packet-checklist label { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid rgba(199,220,255,.20); border-radius: 12px; background: rgba(15,48,103,.72); }
.packet-checklist input { width: 20px; height: 20px; }

.tracker-form { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 1fr auto; gap: 10px; align-items: end; }
.tracker-form > div { display: grid; gap: 6px; }
.tracker-list { display: grid; gap: 10px; }
.tracker-card { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 17px 19px; border: 1px solid rgba(199,220,255,.22); border-radius: 15px; background: rgba(13, 40, 85, .86); }
.tracker-card h3 { margin: 1px 0 5px; }
.tracker-card p { margin: 3px 0; color: var(--muted); }
.tracker-stage { color: var(--primary) !important; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.empty-tracker { min-height: 150px; display: grid; place-content: center; text-align: center; gap: 5px; color: var(--muted); border: 1px dashed rgba(199,220,255,.24); border-radius: 15px; }
.empty-tracker strong { color: #fff; }

.decision-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.decision-split article { padding: 25px; }
.decision-split article > span { font-size: .74rem; font-weight: 950; letter-spacing: .14em; }
.decision-split h3 { margin: 8px 0; font-size: 1.6rem; }
.decision-split li { margin: 7px 0; }
.decision-split button { margin-top: 10px; }
.grant-card { border-color: rgba(67,240,135,.48) !important; }
.grant-card > span { color: var(--success); }
.denial-card { border-color: rgba(255,122,138,.50) !important; }
.denial-card > span { color: var(--danger); }

.journey-footer { width: min(1040px,100%); display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 30px auto 0; padding: 18px 2px 0; color: var(--muted); border-top: 1px solid rgba(199,220,255,.18); font-size: .86rem; }
.sidebar-backdrop { display: none; }
.menu-button { color: #fff; background: rgba(40,224,194,.12); border-color: rgba(40,224,194,.42); }

/* Vibrant global controls */
button.primary { box-shadow: 0 10px 25px rgba(40,224,194,.18); }
input, textarea, select { background: rgba(3, 20, 50, .88); border-color: rgba(91, 137, 202, .74); }
input:hover, textarea:hover, select:hover { border-color: rgba(103,244,220,.62); }
.message-card.assistant { border-color: rgba(40,224,194,.25); }
.message-card.user { border-color: rgba(125,108,255,.72); background: linear-gradient(145deg, #173b80, #2e367f); }

@media (max-width: 1080px) {
  .journey-app { grid-template-columns: 280px minmax(0,1fr); }
  .promise-grid, .record-priority-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tracker-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tracker-form button { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .journey-page { overflow: auto; }
  .journey-app { display: block; }
  .journey-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(340px, 90vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .journey-sidebar.open { transform: translateX(0); }
  .mobile-menu-close { display: inline-grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(0,8,35,.72); backdrop-filter: blur(3px); }
  .journey-main { height: auto; min-height: 100vh; overflow: visible; padding: 14px 16px 28px; }
  .journey-mobile-header { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px; margin: -4px 0 14px; border: 1px solid rgba(199,220,255,.20); border-radius: 12px; background: rgba(8,28,64,.92); backdrop-filter: blur(14px); }
  .welcome-hero { min-height: 350px; padding: 32px 24px; }
  .promise-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .start-guidance { grid-template-columns: 1fr; gap: 12px; }
  .action-card-grid { grid-template-columns: 1fr; }
  .action-card-grid button { min-height: 120px; }
  .decision-split { grid-template-columns: 1fr; }
  .tracker-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .journey-main { padding: 10px 10px 24px; }
  .compact-status { display: none; }
  .journey-mobile-header { justify-content: flex-start; }
  .welcome-hero { min-height: 410px; padding: 28px 20px; border-radius: 20px; }
  .welcome-hero h2 { font-size: clamp(2.25rem, 12vw, 3.45rem); }
  .hero-actions { display: grid; }
  .hero-actions button { width: 100%; }
  .promise-grid, .record-priority-grid, .packet-checklist, .tracker-form { grid-template-columns: 1fr; }
  .promise-grid article { padding: 17px; }
  .panel-heading h2 { font-size: 2.25rem; }
  .access-card, .guided-form, .tracker-form { padding: 16px; }
  .journey-panel .sticky-composer { bottom: 3px; }
  .journey-footer { flex-direction: column; align-items: flex-start; }
}


/* Step 18C unified workspace and discovery */
.promise-grid .promise-wide { grid-column: 1 / -1; }
.legacy-link { border-color: rgba(255, 201, 71, 0.55); color: #ffe69a; }
.legacy-button { border-color: rgba(255, 201, 71, 0.65); color: #fff3bf; }
.discovery-principles,
.workspace-launcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.discovery-principles article,
.workspace-launcher button,
.workspace-state-card,
.workspace-frame-shell,
.classification-key {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(54, 105, 255, 0.11), rgba(40, 224, 194, 0.06));
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.discovery-principles article { padding: 18px; }
.discovery-principles article strong,
.discovery-principles article span,
.workspace-launcher button strong,
.workspace-launcher button span { display: block; }
.discovery-principles article span,
.workspace-launcher button span { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.discovery-form { margin-top: 18px; }
.wrap-actions { flex-wrap: wrap; }
.classification-key { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; }
.classification-key span { color: var(--muted); }
.classification-key strong { color: var(--text); }
.workspace-state-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; }
.workspace-state-card p { margin: 6px 0 0; color: var(--muted); }
.workspace-state-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.workspace-launcher button { text-align: left; padding: 18px; min-height: 112px; }
.workspace-launcher button:hover { transform: translateY(-2px); border-color: var(--primary); }
.workspace-frame-shell { overflow: hidden; margin-top: 18px; }
.workspace-frame-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 16px; background: rgba(5, 15, 35, 0.72); border-bottom: 1px solid var(--border); }
.workspace-frame-toolbar a { color: #ffe69a; font-weight: 800; }
#workspaceFrame { width: 100%; min-height: 74vh; border: 0; background: var(--bg); }
.workspace-frame-placeholder { min-height: 280px; display: grid; place-content: center; text-align: center; gap: 8px; padding: 28px; color: var(--muted); }
.workspace-frame-placeholder strong { color: var(--text); font-size: 1.15rem; }
.legacy-explanation { margin-top: 16px; }
.legacy-return-banner { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; gap: 14px; padding: 10px 18px; background: linear-gradient(90deg, #1f5cff, #6d3cff); color: white; font-weight: 800; }
.legacy-return-banner a { color: white; }
.redirect-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #20397a, #071127 60%); }
.redirect-card { width: min(720px, 100%); padding: 34px; border-radius: 24px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); text-align: center; }
@media (max-width: 900px) {
  .discovery-principles, .workspace-launcher { grid-template-columns: 1fr 1fr; }
  .workspace-state-card { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .discovery-principles, .workspace-launcher { grid-template-columns: 1fr; }
  .workspace-frame-toolbar { align-items: flex-start; flex-direction: column; }
  #workspaceFrame { min-height: 68vh; }
  .legacy-return-banner { position: static; flex-direction: column; }
}


/* Compact, readable Legacy workspace density for large displays */
.legacy-dashboard-page {
  font-size: 14.5px;
  line-height: 1.45;
}
.legacy-dashboard-page .app-shell {
  width: min(1040px, 100%);
  padding: 14px 18px 28px;
}
.legacy-dashboard-page .legacy-return-banner {
  font-size: .88rem;
}
.legacy-dashboard-page .topbar {
  gap: 14px;
  padding: 7px 0 12px;
  margin-bottom: 12px;
}
.legacy-dashboard-page .brand-block h1,
.legacy-dashboard-page .topbar h1 {
  font-size: clamp(1.55rem, 2.1vw, 1.95rem);
}
.legacy-dashboard-page .brand-block > p:last-child,
.legacy-dashboard-page .topbar p { margin-top: 4px; }
.legacy-dashboard-page .dashboard-nav {
  gap: 5px;
  padding: 6px;
  margin-bottom: 11px;
}
.legacy-dashboard-page .dashboard-nav button,
.legacy-dashboard-page .dashboard-nav a {
  min-height: 38px;
  padding: 6px 9px;
  font-size: .91rem;
}
.legacy-dashboard-page .privacy-banner {
  padding: 9px 12px;
  margin-bottom: 11px;
}
.legacy-dashboard-page .controls,
.legacy-dashboard-page .card,
.legacy-dashboard-page .composer,
.legacy-dashboard-page .welcome-panel,
.legacy-dashboard-page .selected-claim-panel {
  padding: 12px 14px;
  margin-bottom: 11px;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 8, 35, .24);
}
.legacy-dashboard-page .controls h2,
.legacy-dashboard-page .card h2,
.legacy-dashboard-page .composer h2,
.legacy-dashboard-page .welcome-panel h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}
.legacy-dashboard-page label { margin: 9px 0 4px; }
.legacy-dashboard-page input,
.legacy-dashboard-page textarea,
.legacy-dashboard-page select {
  padding: 8px 10px;
  border-radius: 8px;
}
.legacy-dashboard-page textarea { min-height: 76px; }
.legacy-dashboard-page select { min-height: 40px; }
.legacy-dashboard-page button {
  min-height: 40px;
  padding: 7px 11px;
  border-radius: 8px;
}
.legacy-dashboard-page .claims-grid,
.legacy-dashboard-page .intelligence-grid {
  gap: 9px;
  margin-top: 9px;
}
.legacy-dashboard-page .claim-card,
.legacy-dashboard-page .intel-card { padding: 10px 12px; }
.legacy-dashboard-page .claim-card-actions { margin-top: 8px; }
.legacy-dashboard-page .pill-row { margin: 6px 0; }
.legacy-dashboard-page .intel-list li { margin-bottom: 6px; }
.legacy-dashboard-page .workflow-panel,
.legacy-dashboard-page .developer-details { margin-bottom: 10px; }
.legacy-dashboard-page .workflow-panel > summary,
.legacy-dashboard-page .developer-details > summary {
  padding: 11px 14px;
  font-size: .96rem;
}
.legacy-dashboard-page pre.message-text,
.legacy-dashboard-page pre:not(.message-details) {
  padding: 10px;
  max-height: 430px;
  font-size: .91rem;
  line-height: 1.42;
}
@media (max-width: 620px) {
  .legacy-dashboard-page { font-size: 16px; }
  .legacy-dashboard-page .app-shell { padding: 10px; }
}
