:root {
  color-scheme: dark;
  --bg: #07080d;
  --bg-elevated: #0c0e14;
  --panel: rgba(18, 21, 32, 0.82);
  --panel-border: rgba(99, 120, 200, 0.22);
  --text: #f4f4f8;
  --muted: #9ca3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --ring-good: #34d399;
  --ring-warn: #fbbf24;
  --ring-bad: #fb7185;
  --ring-neutral: #64748b;
  --hero-glow: rgba(56, 189, 248, 0.12);
  --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sticky-offset: 12px;
  --sticky-max-height: calc(100vh - 210px);
  --radius-card: 18px;
  --radius-pill: 999px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --elevation-soft: 0 12px 28px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.mono-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
  pointer-events: none;
}

.container {
  width: min(1480px, 94vw);
  margin: 28px auto 56px;
  padding-bottom: 300px;
  display: grid;
  gap: 14px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  text-decoration: none;
  z-index: 20;
}
.skip-link:focus {
  top: 12px;
}

.bg-blur {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.28;
  pointer-events: none;
  z-index: -1;
}
.bg1 { background: #4f46e5; top: -140px; left: -100px; }
.bg2 { background: #0ea5e9; top: 22%; right: -140px; }
.bg3 { background: #a855f7; bottom: -140px; left: 32%; }

.card {
  background: linear-gradient(155deg, rgba(28, 32, 48, 0.92) 0%, rgba(14, 16, 26, 0.88) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    var(--elevation-soft);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Card entrance animation */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container > *,
.layout-2 > *,
.layout-quick-tools > *,
.layout-onboarding-presets > * {
  animation: card-enter 0.5s var(--ease-out-expo) both;
}
.container > :nth-child(2) { animation-delay: 0.04s; }
.container > :nth-child(3) { animation-delay: 0.08s; }
.container > :nth-child(4) { animation-delay: 0.12s; }
.container > :nth-child(5) { animation-delay: 0.16s; }
.container > :nth-child(n+6) { animation-delay: 0.2s; }

/* Shimmer loading skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease infinite;
  border-radius: 8px;
  min-height: 1em;
}
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-line:last-child { width: 60%; }
.skeleton-block { height: 80px; border-radius: 12px; }

.hidden { display: none !important; }

.job-progress-wrap {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.job-progress-wrap progress {
  flex: 1;
  min-width: 120px;
  max-width: 360px;
  height: 0.5rem;
}

.auth-supabase-block {
  margin-top: 0.5rem;
}

.auth-supabase-row {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.auth-manual-jwt {
  margin-top: 0.35rem;
}

.auth-manual-jwt summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
}

.auth-manual-jwt summary.manual-jwt-summary--hidden {
  display: none;
}

.hero {
  padding: 24px;
}
.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  grid-template-areas: "main aside";
  gap: 1rem 1.75rem;
  align-items: start;
  position: relative;
  overflow: hidden;
}
.hero-shell::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: min(55%, 420px);
  height: 140%;
  background: radial-gradient(ellipse at center, var(--hero-glow), transparent 70%);
  pointer-events: none;
}
.hero-main {
  grid-area: main;
  position: relative;
  z-index: 1;
}
.hero-aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
}
.hero-actions a.btn {
  text-decoration: none;
}
.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.72rem, 2.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f8fafc;
  text-wrap: balance;
}
.eyebrow {
  color: #9bc8ff;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0;
}
.hero-chart {
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75) 0%, rgba(8, 12, 24, 0.9) 100%);
  padding: 12px 14px 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.hero-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 100px;
}
.hero-chart-line {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
}
.hero-chart-dot {
  filter: drop-shadow(0 0 4px rgba(224, 231, 255, 0.8));
  animation: hero-dot-pulse 2.8s ease-in-out infinite;
}
@keyframes hero-dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.hero-chart-caption {
  display: block;
  margin-top: 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}
.hero-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.hero-kpi {
  border-radius: 14px;
  border: 1px solid rgba(100, 116, 180, 0.28);
  background: rgba(10, 14, 28, 0.65);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 78px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.hero-kpi:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}
.hero-kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.hero-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e0e7ff;
  line-height: 1.2;
}
.hero-kpi-hint {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.85);
  margin-top: auto;
}
.hero-kpi[data-kpi="signals"] {
  border-top: 2px solid rgba(56, 189, 248, 0.45);
}
.hero-kpi[data-kpi="pending"] {
  border-top: 2px solid rgba(251, 191, 36, 0.45);
}
.hero-kpi[data-kpi="watchlist"] {
  border-top: 2px solid rgba(167, 139, 250, 0.45);
}
.field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #c9d7ff;
}

.section-nav {
  position: sticky;
  top: 10px;
  z-index: 10;
  padding: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.95) 0%, rgba(14, 16, 26, 0.88) 100%);
  pointer-events: none;
}
.screen-switch {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
  pointer-events: auto;
}
.screen-switch-btn {
  border: 1px solid rgba(141, 165, 231, 0.3);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #dbe6ff;
  background: rgba(12, 19, 37, 0.66);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.screen-switch-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(141, 165, 231, 0.55);
  background: rgba(40, 55, 100, 0.42);
}
.screen-switch-btn[aria-selected="true"] {
  border-color: rgba(122, 141, 255, 0.8);
  background: rgba(64, 84, 180, 0.38);
  color: #fff;
}
.screen-context {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.screen-context-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.screen-context-copy strong {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c7d2fe;
}
.screen-context-copy p {
  margin: 0;
}
.screen-context-hint {
  font-size: 0.74rem;
}
.screen-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.health-ribbon {
  position: sticky;
  top: 8px;
  z-index: 14;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}
@media (max-width: 900px) {
  .health-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.health-tile {
  --gauge: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(82, 91, 120, 0.45);
  background: rgba(8, 11, 22, 0.55);
  min-height: 72px;
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.2s ease;
}
.health-tile:hover {
  transform: translateY(-1px);
}
.health-tile[data-state="good"] {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.2) 0%, rgba(8, 11, 22, 0.55) 100%);
}
.health-tile[data-state="warn"] {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.2) 0%, rgba(8, 11, 22, 0.55) 100%);
}
.health-tile[data-state="bad"] {
  border-color: rgba(251, 113, 133, 0.4);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.22) 0%, rgba(8, 11, 22, 0.55) 100%);
}
.health-tile[data-state="neutral"] {
  border-color: rgba(100, 116, 139, 0.35);
}
.health-ring {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(
    var(--ring-color, var(--ring-neutral)) calc(var(--gauge, 0) * 360deg),
    rgba(255, 255, 255, 0.06) 0
  );
  position: relative;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.2) inset;
}
.health-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(10, 12, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.health-tile[data-state="good"] .health-ring {
  --ring-color: var(--ring-good);
}
.health-tile[data-state="warn"] .health-ring {
  --ring-color: var(--ring-warn);
}
.health-tile[data-state="bad"] .health-ring {
  --ring-color: var(--ring-bad);
}
.health-tile[data-state="neutral"] .health-ring {
  --ring-color: var(--ring-neutral);
}
.health-tile-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.health-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.health-badge {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border: 1px solid rgba(82, 82, 91, 0.55);
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-green-900 { background: rgba(6, 78, 59, 0.68); color: #d1fae5; }
.bg-red-900 { background: rgba(127, 29, 29, 0.68); color: #fee2e2; }
.bg-slate-900 { background: rgba(51, 65, 85, 0.55); color: #e2e8f0; }

.blockers-alert {
  padding: 12px 16px;
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(69, 10, 20, 0.58);
}
.blockers-alert strong {
  color: #ffe4e6;
}
.section-nav a {
  text-decoration: none;
  color: #dbe6ff;
  border: 1px solid rgba(141, 165, 231, 0.28);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  padding: 7px 12px;
  background: rgba(12, 19, 37, 0.66);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  pointer-events: auto;
}
.section-nav a:hover {
  border-color: rgba(141, 165, 231, 0.55);
  background: rgba(40, 55, 100, 0.45);
  transform: translateY(-1px);
}
.section-nav a.active {
  border-color: rgba(122, 141, 255, 0.8);
  background: rgba(64, 84, 180, 0.38);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.action-center {
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-left: 3px solid rgba(56, 189, 248, 0.5);
}
.action-center-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.25);
  position: relative;
}
.action-center-icon::before,
.action-center-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(224, 231, 255, 0.85);
}
.action-center-icon::before {
  width: 18px;
  height: 3px;
  top: 12px;
}
.action-center-icon::after {
  width: 14px;
  height: 3px;
  top: 20px;
  opacity: 0.65;
}
.action-center-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.action-center strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c7d2fe;
  font-weight: 700;
}
.action-center p { margin: 0; }
.action-center.info {
  border-left-color: rgba(56, 189, 248, 0.65);
}
.action-center.info .action-center-icon {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(14, 165, 233, 0.12));
}
.action-center.success {
  border-left-color: rgba(52, 211, 153, 0.7);
}
.action-center.success .action-center-icon {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.1));
  border-color: rgba(52, 211, 153, 0.35);
}
.action-center.success .action-center-icon::before,
.action-center.success .action-center-icon::after {
  background: #6ee7b7;
}
.action-center.warn {
  border-left-color: rgba(251, 191, 36, 0.75);
}
.action-center.warn .action-center-icon {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
  border-color: rgba(251, 191, 36, 0.35);
}
.action-center.warn .action-center-icon::before,
.action-center.warn .action-center-icon::after {
  background: #fcd34d;
}
.action-center.error {
  border-left-color: rgba(251, 113, 133, 0.75);
}
.action-center.error .action-center-icon {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.2), rgba(244, 63, 94, 0.12));
  border-color: rgba(251, 113, 133, 0.35);
}
.action-center.error .action-center-icon::before {
  width: 16px;
  height: 16px;
  top: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #fca5a5;
}
.action-center.error .action-center-icon::after {
  width: 2px;
  height: 8px;
  top: 15px;
  background: #fca5a5;
  border-radius: 1px;
}

.muted { color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 10px;
}
.stat { padding: 16px; display: grid; gap: 8px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.validation-steps {
  margin-top: 2px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(10, 16, 34, 0.5);
}
.validation-steps summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: #cbd8ff;
}
.validation-steps-list {
  margin: 8px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
}
.validation-steps-list li {
  font-size: 0.76rem;
  color: #d8e3ff;
}

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

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 20px 20px 10px;
}
.section-title h2 { margin: 0; font-size: 1.1rem; }
.section-title h3 { margin: 0; font-size: 0.95rem; }
.section-title--with-action { align-items: center; }

.btn-clear-pending {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(170, 185, 240, 0.28);
  background: rgba(80, 102, 174, 0.22);
  color: #e8eeff;
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.15s ease;
}
.btn-clear-pending:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.45);
  transform: translateY(-1px);
}
.btn-clear-pending:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.scan-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-wrap { overflow: auto; padding: 0 14px 16px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid rgba(170, 185, 240, 0.12);
  padding: 11px 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
  vertical-align: middle;
}
th { color: #bfd0ff; font-weight: 600; }
thead th {
  position: sticky;
  top: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(17, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1;
}
tbody tr {
  transition: background 0.2s ease;
}
tbody tr:hover { background: rgba(80, 102, 174, 0.16); }
tbody tr:last-child td {
  border-bottom-color: rgba(170, 185, 240, 0.08);
}

/* Numeric alignment for dense data tables */
#scanSection table :is(th:nth-child(3), th:nth-child(4), th:nth-child(5), th:nth-child(6), th:nth-child(7)),
#scanSection table :is(td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7)),
#portfolioSection table :is(th:nth-child(2), th:nth-child(3), th:nth-child(4), th:nth-child(5)),
#portfolioSection table :is(td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5)),
#quickCheckSection table :is(th:nth-child(2), td:nth-child(2)),
#simpleMain table :is(th:nth-child(2), td:nth-child(2)),
#performancePanel .performance-outcomes-wrap table :is(th:nth-child(3), th:nth-child(4), th:nth-child(6)),
#performancePanel .performance-outcomes-wrap table :is(td:nth-child(3), td:nth-child(4), td:nth-child(6)),
#learningPanel table thead tr th:nth-child(2),
#learningPanel table tbody tr td:nth-child(2),
#learningPanel table thead tr th:nth-child(4),
#learningPanel table tbody tr td:nth-child(4) {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn {
  border: none;
  border-radius: 11px;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: white;
  transition: transform 0.15s var(--ease-spring), opacity 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }
.btn.primary { background: linear-gradient(135deg, #6366f1, #3b82f6); box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35); }
.btn.secondary { background: linear-gradient(135deg, #0ea5e9, #14b8a6); box-shadow: 0 2px 12px rgba(14, 165, 233, 0.2); }
.btn.secondary:hover { box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3); }
.btn.good { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 2px 12px rgba(34, 197, 94, 0.2); }
.btn.bad { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 2px 12px rgba(244, 63, 94, 0.2); }
.btn.small { padding: 7px 10px; font-size: 0.8rem; }
.approve-btn { background: linear-gradient(135deg, #10b981, #059669); }
.reject-btn { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* Pulse animation for primary CTA */
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25); }
  50% { box-shadow: 0 2px 20px rgba(99, 102, 241, 0.45), 0 0 40px rgba(99, 102, 241, 0.1); }
}
.btn.primary.pulse { animation: btn-pulse 2.5s ease-in-out infinite; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 11px;
  width: fit-content;
}
.pill.good { background: rgba(34, 197, 94, 0.18); color: #9ef2bd; }
.pill.bad { background: rgba(239, 68, 68, 0.2); color: #fecaca; }
.pill.warn { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.pill.neutral { background: rgba(125, 144, 196, 0.2); color: #dbe6ff; }
.pill.info { background: rgba(59, 130, 246, 0.2); color: #bfdbfe; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 16px 12px;
}
.chip {
  border-radius: 999px;
  border: 1px solid rgba(164, 184, 242, 0.25);
  padding: 6px 10px;
  font-size: 0.76rem;
  color: #d5e2ff;
  background: rgba(54, 76, 140, 0.26);
}
.strategy-badge {
  text-transform: capitalize;
}

.callout {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.3);
  padding: 10px;
  background: rgba(14, 24, 48, 0.6);
}
.callout.warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}
.callout.bad {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}
.callout.good {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.inline-form {
  display: flex;
  gap: 12px;
  padding: 0 18px 14px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form.compact {
  padding: 0;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}
input {
  flex: 1 1 150px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(8, 14, 31, 0.6);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}
select {
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(8, 14, 31, 0.6);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  margin-left: 6px;
}
input:focus-visible,
select:focus-visible,
.btn:focus-visible,
.report-tab:focus-visible,
.section-nav a:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.95);
  outline-offset: 2px;
}

.code-block {
  margin: 0 18px 18px;
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(5, 10, 24, 0.8);
  padding: 12px;
  max-height: 380px;
  overflow: auto;
  color: #d4e1ff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.code-block.chat-log {
  max-height: 220px;
  white-space: pre-wrap;
  font-size: 0.88rem;
}
#reportOutput { display: none; }

.report-visual {
  margin: 0 18px 18px;
  display: grid;
  gap: 10px;
}
.report-empty {
  border: 1px dashed rgba(130, 153, 221, 0.35);
  border-radius: 12px;
  padding: 16px;
  color: var(--muted);
  background: rgba(10, 16, 32, 0.45);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}
.report-kpi {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  background: rgba(10, 16, 34, 0.6);
  padding: 10px;
}
.report-kpi .label {
  color: var(--muted);
  font-size: 0.75rem;
}
.report-kpi .value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
}
.report-section {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.3);
  background: rgba(10, 16, 36, 0.62);
  padding: 12px;
}
.report-section h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
}
.report-section .subtle {
  color: var(--muted);
  font-size: 0.84rem;
}
.report-bullets {
  margin: 0;
  padding-left: 18px;
  color: #d6e0ff;
}
.report-bullets li {
  margin-bottom: 6px;
  line-height: 1.4;
}
.report-text {
  white-space: pre-wrap;
  color: #d6e0ff;
  line-height: 1.35;
}
.report-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  font-size: 0.68rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(71, 85, 105, 0.35);
  color: #dbe6ff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-badge.inferred {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}
.report-callout {
  margin: 8px 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.35);
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #dbe6ff;
}
.report-callout.warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.3);
  color: #fde68a;
}
.report-claim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.report-claim-grid > div {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.24);
  background: rgba(9, 16, 35, 0.48);
  padding: 8px;
}
.ic-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.ic-snapshot-grid > div {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.24);
  background: rgba(9, 16, 35, 0.44);
  padding: 8px;
}
.report-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.report-table-wrap {
  padding: 0;
  margin-top: 8px;
}
.report-scenario-table th,
.report-scenario-table td {
  font-size: 0.82rem;
}
.report-scenario-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.report-scenario-kpis > div {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.22);
  background: rgba(14, 22, 45, 0.45);
  padding: 8px;
}

/* ------------------------------------------------------------------
 * Institutional Report (IR) document layout
 * Used by the Full Report visual renderer and the dossier preview.
 * ------------------------------------------------------------------ */
.ir-document {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 4px 14px;
  color: #e8eefb;
  font-family: var(--font-sans);
  line-height: 1.55;
}
.ir-cover {
  border-radius: 14px;
  border: 1px solid rgba(130, 153, 221, 0.32);
  background: linear-gradient(160deg, rgba(20, 30, 64, 0.82), rgba(10, 16, 36, 0.82));
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ir-cover-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8aa1d6;
}
.ir-cover-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.005em;
  color: #f4f7ff;
}
.ir-cover-ticker {
  color: #c4d0eb;
  font-weight: 500;
  font-size: 1.1rem;
  margin-left: 4px;
}
.ir-cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 0.85rem;
  color: #cbd6f0;
}
.ir-cover-meta strong {
  color: #f4f7ff;
}
.ir-cover-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.ir-cover-cell {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: rgba(8, 14, 32, 0.72);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ir-cover-cell-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8aa1d6;
}
.ir-cover-cell-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f4f7ff;
}
.ir-rec-long { color: #4ade80; }
.ir-rec-short { color: #fb7185; }
.ir-rec-pass { color: #fbbf24; }
.ir-cover-quote {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 0.86rem;
  color: #cbd6f0;
  border-top: 1px dashed rgba(130, 153, 221, 0.28);
  padding-top: 10px;
}

.ir-section {
  border-radius: 14px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: rgba(10, 16, 36, 0.72);
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ir-section-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(130, 153, 221, 0.18);
  padding-bottom: 8px;
}
.ir-section-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #8aa1d6;
}
.ir-section-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #f4f7ff;
}
.ir-section-subtitle {
  font-size: 0.83rem;
  color: #95a4c5;
}
.ir-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ir-paragraph {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  color: #dfe6f7;
}
.ir-subhead {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #95a4c5;
  margin-top: 6px;
}

.ir-kv-table,
.ir-data-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(130, 153, 221, 0.22);
  background: rgba(8, 14, 32, 0.5);
  font-size: 0.86rem;
}
.ir-kv-table th,
.ir-kv-table td,
.ir-data-table th,
.ir-data-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(130, 153, 221, 0.14);
}
.ir-kv-table tr:last-child th,
.ir-kv-table tr:last-child td,
.ir-data-table tbody tr:last-child td {
  border-bottom: none;
}
.ir-kv-table th {
  width: 38%;
  color: #b6c2e3;
  font-weight: 500;
  background: rgba(14, 22, 45, 0.55);
}
.ir-kv-table td {
  color: #f0f4ff;
  font-variant-numeric: tabular-nums;
}
.ir-kv-table.compact th,
.ir-kv-table.compact td {
  padding: 6px 10px;
  font-size: 0.82rem;
}
.ir-data-table th {
  background: rgba(14, 22, 45, 0.6);
  color: #b6c2e3;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ir-data-table td {
  color: #e8eefb;
}
.ir-data-table td.right,
.ir-data-table th.right {
  text-align: right;
}
.ir-data-table td.center,
.ir-data-table th.center {
  text-align: center;
}
.ir-data-table tbody tr:nth-child(even) td {
  background: rgba(10, 16, 36, 0.4);
}

/* Dossier preview: reuses document layout with relaxed spacing */
.ir-dossier-preview {
  padding: 24px 30px 32px;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #fcfdff;
  color: #0f172a;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 10px 26px rgba(2, 8, 23, 0.2);
  line-height: 1.7;
  letter-spacing: 0.003em;
}
.ir-dossier-preview .ir-h3 {
  font-size: 1.62rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0b1530;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.22);
  padding-bottom: 10px;
}
.ir-dossier-preview .ir-h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin: 20px 0 6px;
  letter-spacing: -0.005em;
  border-left: 3px solid rgba(30, 64, 175, 0.55);
  padding-left: 10px;
}
.ir-dossier-preview .ir-h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 12px 0 4px;
  text-transform: none;
  letter-spacing: 0.01em;
}
.ir-dossier-preview .ir-paragraph {
  font-size: 1rem;
  line-height: 1.76;
  color: #1e293b;
  margin: 9px 0;
}
.ir-dossier-preview .report-bullets {
  margin: 8px 0 12px 22px;
  color: #1e293b;
}
.ir-dossier-preview .report-bullets li {
  margin: 0 0 6px;
}
.ir-dossier-preview .ir-divider {
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.18);
  margin: 18px 0 20px;
  position: relative;
}
.ir-dossier-preview .ir-divider::after {
  content: "◆";
  position: absolute;
  left: 50%;
  top: -0.62rem;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: rgba(30, 64, 175, 0.72);
  background: #f8fafc;
  padding: 0 8px;
}
.ir-dossier-preview .ir-data-table,
.ir-dossier-preview .ir-kv-table {
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #ffffff;
}
.ir-dossier-preview .ir-data-table th,
.ir-dossier-preview .ir-kv-table th {
  background: #eef2ff;
  color: #1f2937;
}
.ir-dossier-preview .ir-data-table td,
.ir-dossier-preview .ir-kv-table td {
  color: #111827;
}
.ir-dossier-preview .ir-data-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}
.ir-dossier-preview .ir-inline-code {
  background: #eef2ff;
  border-color: rgba(99, 102, 241, 0.25);
  color: #1e293b;
}
.ir-dossier-preview .ir-cite {
  color: #1d4ed8;
  font-size: 0.7em;
  font-weight: 600;
  margin-left: 1px;
}
.ir-dossier-preview .ir-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ir-inline-code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  background: rgba(8, 14, 32, 0.6);
  border: 1px solid rgba(130, 153, 221, 0.2);
  color: #d4e1ff;
}

@media (max-width: 1120px) {
  .ir-cover-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .ir-cover { padding: 14px 16px; }
  .ir-section { padding: 14px 14px 16px; }
  .ir-cover-strip {
    grid-template-columns: 1fr;
  }
  .ir-cover-title { font-size: 1.3rem; }
  .ir-data-table th,
  .ir-data-table td,
  .ir-kv-table th,
  .ir-kv-table td {
    padding: 6px 9px;
    font-size: 0.8rem;
  }
}

.compare-meta {
  padding: 0 18px 8px;
  font-size: 0.85rem;
}
.compare-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 8px;
}
.compare-headline,
.compare-narrative,
.compare-changes {
  margin: 0 18px 10px;
}
.compare-headline-card {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(20, 30, 58, 0.72);
}
.compare-lead {
  font-size: 1rem;
  line-height: 1.45;
  color: #ecf2ff;
  margin-bottom: 6px;
}
.compare-narrative-card {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(12, 20, 42, 0.72);
}
.compare-paragraph {
  margin: 8px 0;
  color: #dbe6ff;
  line-height: 1.55;
}
.compare-changes-card {
  border-color: rgba(130, 153, 221, 0.35);
  background: rgba(11, 19, 38, 0.72);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#secCompareSection {
  background: #020617;
  border-color: rgba(148, 163, 184, 0.24);
}
.mgmt-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 18px 10px;
}
.mgmt-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.58) 0%, rgba(2, 6, 23, 0.72) 100%);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  padding: 12px;
  box-shadow: 0 14px 34px rgba(1, 6, 20, 0.5), inset 0 1px 0 rgba(148, 163, 184, 0.08);
}
.mgmt-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mgmt-card-title-row h4,
.mgmt-card h4 {
  margin: 0;
}
.mgmt-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.62);
}
.saydo-timeline {
  position: relative;
  display: grid;
  gap: 10px;
}
.saydo-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.7) 0%, rgba(244, 63, 94, 0.55) 100%);
}
.saydo-node {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}
.saydo-node-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 6px;
  border: 2px solid rgba(11, 16, 32, 0.95);
}
.saydo-node-dot.good { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2); }
.saydo-node-dot.neutral { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18); }
.saydo-node-dot.bad { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.24); }
.saydo-node-body {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.52);
  padding: 10px 11px;
}
.saydo-node--warn .saydo-node-body {
  border-color: rgba(244, 63, 94, 0.62);
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.3);
}
.saydo-node-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.saydo-node-body p {
  margin: 0 0 6px 0;
  color: #dbe7ff;
  line-height: 1.4;
  font-size: 0.86rem;
}
.saydo-quarter {
  color: #bfdbfe;
  font-size: 0.78rem;
}
.saydo-kpi-row {
  color: #a5b4fc;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.integrity-score-wrap {
  display: grid;
  grid-template-columns: minmax(130px, 160px) 1fr;
  gap: 12px;
  align-items: start;
}
.integrity-gauge {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: conic-gradient(var(--gauge) calc(var(--score) * 1%), rgba(71, 85, 105, 0.35) 0);
  padding: 12px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.3), 0 12px 24px rgba(2, 6, 23, 0.45);
}
.integrity-gauge-inner {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: rgba(5, 9, 20, 0.92);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}
.integrity-gauge-value {
  font-size: 1.5rem;
  color: #f8fafc;
}
.integrity-gauge-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.integrity-pillars {
  display: grid;
  gap: 8px;
}
.integrity-pillar {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.48);
  padding: 8px 9px;
}
.integrity-pillar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.78rem;
}
.integrity-pillar-bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.65);
  overflow: hidden;
  margin-bottom: 6px;
}
.integrity-pillar-bar > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981 0%, #f43f5e 100%);
}
.integrity-pillar p {
  margin: 0;
  font-size: 0.75rem;
  color: #cbd5e1;
}
.dilution-table-wrap {
  overflow-x: auto;
}
.dilution-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}
.dilution-table th,
.dilution-table td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.45);
  text-align: left;
  white-space: nowrap;
}
.dilution-table th {
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
}
.dilution-table .heat-high { background: rgba(244, 63, 94, 0.34); color: #ffe4ea; }
.dilution-table .heat-mid { background: rgba(245, 158, 11, 0.24); color: #fef3c7; }
.dilution-table .heat-low { background: rgba(16, 185, 129, 0.24); color: #bbf7d0; }
.dilution-table .heat-na { background: rgba(71, 85, 105, 0.2); color: #cbd5e1; }
.redflag-list {
  display: grid;
  gap: 8px;
  overflow: visible;
}
.redflag-row {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.54);
  padding: 9px 10px;
}
.redflag-row.ruthless {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.3), inset 0 0 18px rgba(127, 29, 29, 0.2);
}
.redflag-row.sev-high {
  border-color: rgba(244, 63, 94, 0.72);
}
.redflag-row.sev-med {
  border-color: rgba(245, 158, 11, 0.68);
}
.redflag-row.sev-low {
  border-color: rgba(148, 163, 184, 0.4);
}
.redflag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.redflag-title {
  margin-bottom: 4px;
  color: #f8fafc;
  font-size: 0.84rem;
}
.pill.sev-high {
  color: #ffe4ea;
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.72);
}
.pill.sev-med {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.68);
}
.pill.sev-low {
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.58);
  border-color: rgba(148, 163, 184, 0.45);
}
.analyst-annotation {
  position: absolute;
  top: 8px;
  right: -250px;
  width: 230px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(2, 6, 23, 0.92);
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.analyst-annotation::before {
  content: "Analyst annotation";
  display: block;
  margin-bottom: 5px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fda4af;
}
.redflag-row:hover .analyst-annotation {
  opacity: 1;
  transform: translateX(0);
}
.compare-card {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.3);
  background: rgba(10, 16, 36, 0.62);
  padding: 12px;
}
.compare-card h4 {
  margin: 0 0 8px 0;
}
.delta-chip {
  display: inline-flex;
  margin: 4px 8px 0 0;
  border: 1px solid rgba(130, 153, 221, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: #cfe0ff;
  background: rgba(27, 40, 75, 0.44);
}
.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 18px 10px;
}
.report-tab {
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(11, 18, 40, 0.64);
  color: var(--text);
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 6px 10px;
  cursor: pointer;
}
.report-tab.active {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(59, 130, 246, 0.2);
}
.verdict {
  font-size: 0.74rem;
  padding: 3px 7px;
  border-radius: 999px;
  margin-left: 6px;
  border: 1px solid transparent;
}
.verdict.bullish {
  color: #9ef2bd;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.2);
}
.verdict.neutral {
  color: #dbe6ff;
  border-color: rgba(125, 144, 196, 0.45);
  background: rgba(125, 144, 196, 0.2);
}
.verdict.bearish {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.2);
}

.scan-insights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 12px;
}
.scan-block {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.3);
  background: rgba(9, 16, 35, 0.55);
  padding: 10px;
}
.scan-block h3 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
}
.scan-block--blockers {
  padding: 6px 10px;
  background: rgba(9, 16, 35, 0.4);
  border-color: rgba(130, 153, 221, 0.18);
  order: 2;
}
.scan-block--blockers h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.scan-block-hint {
  font-size: 0.66rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.scan-block--funnel {
  order: 1;
}
.blocker-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.blocker-chips li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(164, 184, 242, 0.2);
  background: rgba(54, 76, 140, 0.18);
  color: #c8d4f0;
}
.blocker-chips li strong {
  color: #e8ecff;
  font-weight: 600;
}
.blocker-chips li .pill {
  padding: 1px 6px;
  font-size: 0.62rem;
}
.blocker-chips li.empty {
  border-style: dashed;
  opacity: 0.7;
}
.scan-blockers-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  font-weight: 600;
}
.scan-blockers-chip:hover,
.scan-blockers-chip:focus-visible {
  background: rgba(245, 158, 11, 0.28);
  outline: none;
}
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.funnel-node {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: linear-gradient(165deg, rgba(22, 30, 58, 0.85) 0%, rgba(12, 18, 36, 0.75) 100%);
  padding: 10px 10px 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: help;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.funnel-node:hover {
  border-color: rgba(165, 180, 252, 0.55);
  transform: translateY(-1px);
}
.funnel-node[data-gate-mode="shadow"],
.funnel-node[data-gate-mode="off"],
.funnel-node[data-gate-mode="soft"] {
  border-style: dashed;
}
.funnel-node-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.funnel-node .label {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.funnel-node-pct {
  font-size: 0.72rem;
  color: #a5b4fc;
  font-weight: 600;
}
.funnel-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.funnel-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    hsl(var(--funnel-hue, 200), 78%, 55%),
    hsl(calc(var(--funnel-hue, 200) + 28), 72%, 62%)
  );
  box-shadow: 0 0 12px hsla(var(--funnel-hue, 200), 80%, 50%, 0.35);
  transition: width 0.45s ease;
  min-width: 4px;
}
.funnel-node-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}
.funnel-node .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8ecff;
}
.funnel-node-filtered {
  font-size: 0.7rem;
  color: rgba(248, 113, 113, 0.85);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.funnel-shadow-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-top: 2px;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}
.timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(125, 144, 196, 0.7);
}
.context-mini {
  color: #d2ddff;
  font-size: 0.78rem;
  line-height: 1.35;
}

.task-board {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}
.task-group {
  border: 1px solid rgba(63, 63, 70, 0.7);
  border-radius: 12px;
  padding: 8px;
  background: rgba(9, 9, 11, 0.65);
}
.task-group h3 {
  margin: 0 0 8px 2px;
  font-size: 0.82rem;
  color: #d4d4d8;
  letter-spacing: 0.03em;
}
.task-card {
  border: 1px solid rgba(63, 63, 70, 0.85);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(24, 24, 27, 0.72);
  display: grid;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.task-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.task-card:last-child { margin-bottom: 0; }
.task-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.task-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.risk-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-transform: uppercase;
}
.risk-chip.low {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 95, 70, 0.32);
}
.risk-chip.medium {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.56);
  background: rgba(120, 53, 15, 0.32);
}
.risk-chip.high {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(127, 29, 29, 0.36);
}
.task-card--risk-high {
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.18);
}
.task-card--risk-medium {
  border-color: rgba(245, 158, 11, 0.42);
}
.task-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.meter-label {
  display: block;
  font-size: 0.72rem;
  color: #c4c4cc;
  margin-bottom: 3px;
}
.meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(63, 63, 70, 0.8);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
}
.meter.conviction > span {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}
.meter.info > span {
  background: linear-gradient(135deg, #22c55e, #10b981);
}
.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.task-empty {
  border: 1px dashed rgba(82, 82, 91, 0.7);
  border-radius: 10px;
  padding: 14px;
  background: rgba(9, 9, 11, 0.55);
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.sector-card {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  padding: 10px;
  background: rgba(17, 26, 52, 0.6);
}
.sector-card.win { border-color: rgba(34, 197, 94, 0.35); }
.sector-card.loss { border-color: rgba(239, 68, 68, 0.35); }
.sector-winning { font-weight: 700; color: #f4f4f5; }
.sector-lagging { opacity: 0.5; }
.sector-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin: 6px 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.sector-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 3px;
  transition: width 0.4s ease;
}
.sector-bar-fill--win {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.85), rgba(16, 185, 129, 0.65));
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}
.sector-bar-fill--loss {
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.85), rgba(244, 63, 94, 0.55));
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.2);
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0 18px 18px;
  display: grid;
  gap: 8px;
}
.log-list li {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  background: rgba(14, 22, 45, 0.56);
  padding: 8px 10px;
  font-size: 0.84rem;
  color: #d0dcff;
}
.log-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-kind {
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  padding: 2px 6px;
  text-transform: uppercase;
}
.log-kind.system { color: #bfdbfe; }
.log-kind.scan { color: #93c5fd; }
.log-kind.trade { color: #fcd34d; }
.log-kind.report { color: #c4b5fd; }
.log-kind.error { color: #fecaca; border-color: rgba(239,68,68,0.45); }

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

.modal {
  border: 1px solid rgba(130, 153, 221, 0.45);
  border-radius: 14px;
  background: rgba(12, 18, 36, 0.95);
  color: var(--text);
  width: min(520px, 90vw);
  padding: 18px;
}
.modal::backdrop {
  background: rgba(3, 6, 16, 0.72);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-form-grid {
  flex-wrap: wrap;
  align-items: flex-end;
}
.hero-quick-links {
  font-size: 0.92rem;
  margin-top: 0.35rem;
  line-height: 1.5;
}
.hero-quick-links a {
  white-space: nowrap;
}
.stage-trade-panel {
  margin-bottom: 12px;
}
.stage-trade-form {
  margin-top: 8px;
}
.warn-text {
  color: #f9ca8c;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.12);
}
.approve-risk-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}
.approve-confirm-hint {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.approve-confirm-hint.warn {
  color: #fcd34d;
}
.approve-confirm-hint.good {
  color: #86efac;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}
.status-dot.good { background: #22c55e; }
.status-dot.bad { background: #ef4444; }
.status-dot.warn { background: #f59e0b; }

/* Trade drawer (unified Decision + Recovery slide-in) ------------------ */
.trade-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  z-index: 79;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
body.trade-drawer-open .trade-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.trade-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 96vw);
  height: 100vh;
  background: rgba(9, 9, 11, 0.97);
  border-left: 1px solid rgba(82, 82, 91, 0.9);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 80;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}
.trade-drawer.open { transform: translateX(0); }
.trade-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.trade-drawer-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}
.trade-drawer-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.35);
  padding-bottom: 4px;
}
.trade-drawer-tab {
  flex: 1 1 auto;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.trade-drawer-tab:hover { color: #cbd5f5; }
.trade-drawer-tab.active {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  border-bottom-color: rgba(9, 9, 11, 0.97);
}
.trade-drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trade-drawer-panel.hidden { display: none; }
.trade-drawer-panel .inline-form {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.trade-drawer-panel .inline-form input,
.trade-drawer-panel .inline-form select {
  flex: 1 1 120px;
  min-width: 0;
}
.trade-drawer-launcher input,
.trade-drawer-launcher select {
  flex: 1 1 140px;
  min-width: 0;
}

.activity-drawer {
  position: relative;
  width: min(1500px, 94vw);
  margin: 0 auto 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  pointer-events: auto;
}
.activity-drawer-toggle {
  width: auto;
  min-width: 180px;
  max-width: min(360px, calc(94vw - 24px));
  border: none;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.95);
  color: #e4e4e7;
  padding: 8px 14px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  border: 1px solid rgba(82, 82, 91, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.activity-drawer-body {
  width: min(560px, calc(94vw - 24px));
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  pointer-events: none;
  background: rgba(9, 9, 11, 0.95);
  border: 1px solid rgba(82, 82, 91, 0.7);
  border-top: none;
  border-radius: 0 0 12px 12px;
}
.activity-drawer-body.open {
  max-height: 220px;
  overflow: auto;
  pointer-events: auto;
}
.activity-drawer.open .activity-drawer-toggle {
  width: min(560px, calc(94vw - 24px));
  max-width: min(560px, calc(94vw - 24px));
  border-radius: 12px 12px 0 0;
}

.empty-state-cell {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 0;
}
.empty-icon {
  width: 26px;
  height: 26px;
  color: #a1a1aa;
}

/* Performance + Strategy Presets structured panels */
.performance-panel,
.preset-panel {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}

.performance-panel .panel-error {
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(69, 10, 20, 0.45);
  padding: 10px 12px;
  color: #fecaca;
  font-size: 0.88rem;
}

.performance-buckets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.perf-bucket {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.3);
  background: rgba(9, 16, 35, 0.55);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.perf-bucket h3 {
  margin: 0;
  font-size: 0.82rem;
  color: #d4dcff;
  letter-spacing: 0.03em;
}

.perf-bucket .perf-source {
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.perf-bucket-note {
  margin: 0;
  font-size: 0.78rem;
  color: #cbd8ff;
  line-height: 1.4;
}

.perf-metric {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
}

.perf-metric .label {
  color: var(--muted);
  flex: 1 1 50%;
  min-width: 0;
}

.perf-metric .value {
  flex: 1 1 50%;
  min-width: 0;
  font-weight: 700;
  color: #f4f4f5;
  text-align: right;
  overflow-wrap: anywhere;
}

.performance-validation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: rgba(16, 26, 54, 0.5);
  font-size: 0.84rem;
}

.performance-validation .health-badge {
  justify-self: start;
}

.perf-outcomes-empty {
  margin: 0;
  font-size: 0.82rem;
}

.performance-callout {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(12, 40, 58, 0.45);
  color: #bae6fd;
  font-size: 0.82rem;
  line-height: 1.45;
}

.performance-outcomes-wrap {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  overflow: hidden;
  background: rgba(14, 22, 45, 0.5);
}

.performance-outcomes-wrap h3 {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #d4dcff;
  border-bottom: 1px solid rgba(130, 153, 221, 0.2);
  background: rgba(9, 16, 35, 0.4);
}

.performance-outcomes-wrap .table-wrap {
  padding: 0;
}

.performance-outcomes-wrap table {
  font-size: 0.8rem;
}
.performance-outcomes-wrap th,
.performance-outcomes-wrap td {
  padding: 8px 10px;
  line-height: 1.35;
}
.performance-outcomes-wrap thead th {
  padding-top: 9px;
  padding-bottom: 9px;
}
.perf-attribution-wrap {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  background: rgba(10, 18, 36, 0.48);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.perf-attribution-wrap h3 {
  margin: 0;
  font-size: 0.82rem;
  color: #d4dcff;
}
.perf-attribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.perf-attribution-card {
  border-radius: 10px;
  border: 1px solid rgba(130, 153, 221, 0.25);
  background: rgba(9, 16, 35, 0.5);
  overflow: hidden;
}
.perf-attribution-card h3 {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #dbe6ff;
  border-bottom: 1px solid rgba(130, 153, 221, 0.18);
}
.perf-attribution-card .table-wrap {
  padding: 0;
}
.perf-attribution-card table {
  font-size: 0.78rem;
}
.perf-attribution-card th,
.perf-attribution-card td {
  padding: 7px 9px;
}
.perf-attribution-placeholder {
  margin: 0;
  font-size: 0.82rem;
}

.details-raw {
  margin: 0 16px 12px;
  border-radius: 10px;
  border: 1px solid rgba(63, 63, 70, 0.75);
  padding: 6px 10px;
  background: rgba(9, 9, 11, 0.55);
}

.details-raw summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
}

.details-raw .code-block {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  font-size: 0.72rem;
}

.preset-panel .panel-error {
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(69, 10, 20, 0.45);
  padding: 10px 12px;
  color: #fecaca;
  font-size: 0.88rem;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16, 26, 54, 0.62);
  color: #e8eeff;
}

.preset-chip.muted-chip {
  font-weight: 600;
  color: var(--muted);
  border-color: rgba(82, 82, 91, 0.65);
}

.preset-subsection {
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: rgba(9, 16, 35, 0.45);
  padding: 10px 12px;
}

.preset-subsection h3 {
  margin: 0 0 10px 0;
  font-size: 0.82rem;
  color: #d4dcff;
}

.preset-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.preset-kv-table th,
.preset-kv-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(63, 63, 70, 0.5);
  vertical-align: top;
}

.preset-kv-table th {
  color: var(--muted);
  font-weight: 600;
  width: 42%;
}

.preset-kv-table td {
  color: #e8e8ed;
  word-break: break-word;
}

.preset-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #a5f3fc;
}

.preset-kv-table tr:last-child th,
.preset-kv-table tr:last-child td {
  border-bottom: none;
}

.preset-expert {
  opacity: 0.92;
  border-style: dashed;
  border-color: rgba(82, 82, 91, 0.85);
  background: rgba(9, 9, 11, 0.5);
}

.preset-expert h3 {
  color: var(--muted);
}

.preset-apply-preview {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(82, 82, 91, 0.65);
  background: rgba(9, 9, 11, 0.45);
  font-size: 0.86rem;
  line-height: 1.45;
}

.preset-preview-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e4e4e7;
}

.preset-preview-list {
  margin: 0;
  padding-left: 1.15rem;
}

.preset-preview-list li {
  margin-bottom: 6px;
}

.live-trading-bullets {
  margin: 0 0 8px;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.live-trading-bullets li {
  margin-bottom: 4px;
}

.live-trading-status-line {
  margin: 0 0 8px;
}

.tool-output-host {
  margin-top: 10px;
}
.tool-output-padded {
  padding: 0 18px 18px;
}

.tool-output-placeholder {
  margin: 0;
}

.tool-summary-card {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(63, 63, 70, 0.65);
  background: rgba(24, 24, 27, 0.65);
  margin-bottom: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.tool-summary-card.hidden,
.tool-json-details.hidden {
  display: none !important;
}

.tool-summary-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.tool-summary-list {
  margin: 0;
  padding-left: 1.15rem;
}

.tool-summary-list li {
  margin-bottom: 4px;
}

.tool-summary-p {
  margin: 0 0 8px;
}

.tool-summary-next {
  margin: 0;
}

.tool-json-details {
  margin-top: 6px;
}

.tool-json-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.approve-preflight {
  margin-top: 10px;
  text-align: left;
}

.approve-preflight ul {
  margin: 6px 0 8px;
  padding-left: 1.15rem;
}

.approve-blocked {
  color: #fecaca;
  margin: 8px 0 4px;
}

.approve-checklist-details {
  margin-top: 8px;
}

.code-block--tight {
  max-height: 180px;
  overflow: auto;
  font-size: 0.75rem;
}

/* —— Backtest hub, tabs, chat —— */
.backtest-hub .backtest-intro {
  margin: 0 18px 14px;
  max-width: 72ch;
  line-height: 1.55;
}

.backtest-hub .backtest-intro strong {
  color: #e4e4e7;
  font-weight: 600;
}

.tab-bar {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
  border-bottom: 1px solid rgba(63, 63, 70, 0.55);
}

.tab-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(82, 82, 91, 0.85);
  background: rgba(9, 9, 11, 0.55);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.45);
}

.tab-btn-active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 116, 144, 0.22);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.tab-panel {
  padding: 16px 18px 18px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.preset-row .field-label {
  margin-right: 4px;
}

.backtest-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.backtest-form-grid .form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.backtest-form-grid .form-row input,
.backtest-form-grid .form-row select {
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(9, 9, 11, 0.65);
  color: var(--text);
}

.backtest-form-grid .form-row-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.backtest-form-grid .form-row-dates > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-hint {
  font-size: 0.78rem;
  flex: 1 1 200px;
}

.advanced-details {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(82, 82, 91, 0.75);
  background: rgba(9, 9, 11, 0.35);
}

.advanced-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #c9d7ff;
}

.advanced-grid {
  margin-top: 12px;
}

.form-row-check {
  align-items: flex-start;
}

.field-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}

.field-check input {
  width: 1rem;
  height: 1rem;
}

.backtest-actions {
  padding: 0 0 8px;
}

.bt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1.5rem;
}

.bt-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bt-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes bt-spin {
  to {
    transform: rotate(360deg);
  }
}

.bt-result-summary {
  margin: 10px 0 12px;
}

.bt-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
}

.bt-metric {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 9, 11, 0.55);
  border: 1px solid rgba(63, 63, 70, 0.65);
}

.bt-metric .bt-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.bt-metric .bt-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bt-findings {
  margin-top: 12px;
  font-size: 0.88rem;
  color: #d4d4d8;
  line-height: 1.45;
}

.bt-run-list {
  list-style: none;
  padding-left: 0;
}

.bt-run-list li {
  margin-bottom: 10px;
}

.bt-run-item {
  list-style: none;
  margin-left: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(63, 63, 70, 0.55);
  background: rgba(9, 9, 11, 0.35);
}

.bt-run-item strong {
  font-weight: 700;
}

.bt-run-spec {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.bt-run-metrics {
  font-size: 0.82rem;
  margin-top: 6px;
  color: #d4d4d8;
}

.chat-subhead {
  margin: 0 0 10px;
  max-width: 65ch;
}

.chat-log-scroll {
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(63, 63, 70, 0.75);
  background: rgba(9, 9, 11, 0.65);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: min(92%, 640px);
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.32);
}

.chat-bubble-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-tool-details {
  margin-top: 8px;
  font-size: 0.82rem;
}

.chat-tool-details summary {
  cursor: pointer;
  color: var(--accent);
}

.chat-tool-details pre {
  margin: 8px 0 0;
  font-size: 0.76rem;
  max-height: 220px;
  overflow: auto;
}

.chat-chips {
  margin-top: 10px;
}

.chat-input-row {
  margin-top: 12px;
}

.chat-input-row input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(9, 9, 11, 0.65);
  color: var(--text);
}

.callout {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.callout-info {
  background: rgba(14, 116, 144, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.callout .callout-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.callout code {
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 6px;
}

.chat-empty-hint {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 4px;
}

/* —— Task-first layout, progressive disclosure, view modes —— */
.hero-toolbar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hero-toolbar select {
  margin-left: 0;
  min-width: 140px;
}

.dashboard-today-stack {
  display: grid;
  gap: 16px;
}

.pending-summary-strip {
  padding: 12px 16px;
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(12, 40, 58, 0.35);
}
.pending-summary-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pending-summary-text {
  font-size: 0.92rem;
  color: #e0e7ff;
}

.workflow-primary {
  display: grid;
  gap: 12px;
}
.workflow-primary-heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bfdbfe;
  padding: 0 4px;
}

.card--primary-task {
  position: relative;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(180deg, rgba(18, 28, 56, 0.62) 0%, rgba(10, 14, 27, 0.88) 100%);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12) inset,
    0 18px 44px rgba(0, 0, 0, 0.45),
    0 0 84px rgba(56, 189, 248, 0.08);
}
.card--primary-task::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.92), rgba(129, 140, 248, 0.75));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  opacity: 0.9;
}
.card--primary-task .section-title {
  padding-left: 24px;
}

.layout-quick-tools {
  align-items: stretch;
}

.panel-disclosure {
  margin: 0 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.75);
  background: rgba(9, 9, 11, 0.45);
  padding: 0;
  overflow: hidden;
}
.panel-disclosure.panel-disclosure--advanced {
  border-style: dashed;
  opacity: 0.98;
}
.status-details-wrap.panel-disclosure {
  padding: 0;
}
.panel-disclosure-summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #c9d7ff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.panel-disclosure-summary::-webkit-details-marker {
  display: none;
}
.panel-disclosure .disclosure-hint {
  font-weight: 500;
  font-size: 0.78rem;
}
.panel-disclosure > *:not(summary) {
  padding: 0 12px 14px;
}
.stats-in-disclosure.stats {
  padding: 0 8px 14px;
}

#scanSection .panel-disclosure > .scan-insights {
  padding-top: 0;
}
#scanSection .panel-disclosure #scanDiagnostics {
  padding: 0 16px 14px;
}

.scan-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}
.scan-results-layout > * {
  min-width: 0;
}
.scan-actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Filtered candidates (everything in the shortlist except disposition="kept")
   are visually de-emphasised so the kept survivors still pop. The Stage
   button is also disabled on these rows so a misclick can't queue a
   filtered name as a trade. */
tr.scan-row--filtered {
  opacity: 0.62;
}
tr.scan-row--filtered:hover,
tr.scan-row--filtered:focus-within {
  opacity: 0.85;
}
tr.scan-row--filtered td:first-child strong {
  color: var(--paper-mute, #94a3b8);
}
.scan-detail-panel {
  border: 1px solid rgba(100, 116, 139, 0.36);
  border-radius: 14px;
  background: rgba(8, 12, 24, 0.72);
  padding: 12px;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.scan-detail-header h3 {
  margin: 0;
  font-size: 1rem;
}
.scan-detail-header p {
  margin: 4px 0 0;
}
.scan-detail-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 250px;
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}
.scan-detail-chart > * {
  max-width: 100%;
}

.scan-brief-card {
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.6), rgba(8, 14, 30, 0.76));
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
}

.scan-brief-card h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.scan-brief-content {
  font-size: 0.84rem;
  line-height: 1.4;
}

.scan-brief-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.scan-brief-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scan-brief-setup {
  margin: 8px 0;
  color: rgba(226, 232, 240, 0.96);
}

.scan-brief-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.scan-brief-sections {
  display: grid;
  gap: 6px;
}

.scan-brief-detail {
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.scan-brief-detail > summary {
  cursor: pointer;
  font-weight: 600;
}

.scan-brief-detail[open] {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(15, 23, 42, 0.54);
}

.scan-brief-sections ul {
  margin: 4px 0 0;
  padding-left: 1rem;
}

.scan-brief-sections li {
  margin: 0;
}

.scan-brief-detail p {
  margin: 6px 0 0;
}

.scan-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.scan-detail-stat {
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  padding: 8px;
  display: grid;
  gap: 2px;
}
.scan-detail-stat strong {
  font-size: 0.96rem;
}
.scan-detail-stat small {
  font-size: 0.72rem;
}

.tools-hub .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 0 18px 20px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid rgba(130, 153, 221, 0.28);
  background: linear-gradient(160deg, rgba(24, 32, 58, 0.75) 0%, rgba(10, 14, 28, 0.85) 100%);
  padding: 14px 14px 14px 48px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.12);
}
.tool-card:nth-child(2)::before {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.15));
  border-color: rgba(251, 191, 36, 0.35);
}
.tool-card:nth-child(3)::before {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.28), rgba(99, 102, 241, 0.15));
}
.tool-card:nth-child(4)::before {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.12));
  border-color: rgba(52, 211, 153, 0.35);
}
.tool-card:nth-child(5)::before {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.22), rgba(192, 132, 252, 0.12));
}
.tool-card:nth-child(6)::before {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(45, 212, 191, 0.12));
}
.tool-card:nth-child(7)::before {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.22), rgba(251, 113, 133, 0.12));
}
.tool-card:nth-child(8)::before {
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.25), rgba(96, 165, 250, 0.12));
}
.tool-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}
.tool-card:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.95);
  outline-offset: 2px;
}
.tool-card-title {
  margin: 0;
  font-size: 0.95rem;
  color: #f4f4f5;
  font-weight: 600;
}
.tool-card-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  flex: 1;
}
.tool-card-cta {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Visual hierarchy refinements: emphasize core flow, quiet advanced surfaces. */
.hero-lead {
  max-width: 64ch;
  line-height: 1.5;
  font-size: 0.97rem;
}
.hero-actions #scanBtn {
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.35);
}
.hero-actions #refreshBtn {
  opacity: 0.92;
}

.section-nav a:not(.nav-advanced) {
  font-weight: 650;
  border-color: rgba(141, 165, 231, 0.38);
  background: rgba(20, 31, 59, 0.72);
}
.section-nav a.nav-advanced {
  opacity: 0.78;
  border-style: dashed;
  border-color: rgba(100, 116, 139, 0.45);
  background: rgba(10, 14, 27, 0.6);
}

.section-advanced {
  border-color: rgba(100, 116, 139, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}
.section-advanced .section-title h2,
.section-advanced .section-title h3 {
  font-size: 1.02rem;
  color: #d8e2ff;
}
.section-advanced .section-title small {
  color: #93a0bf;
}

body.ui-standard .section-advanced {
  opacity: 0.94;
  filter: saturate(0.92);
}
body.ui-standard .nav-advanced {
  display: none !important;
}
body.ui-pro .section-advanced {
  opacity: 1;
  filter: none;
}

.tools-hub {
  border-color: rgba(100, 116, 139, 0.34);
}
.tools-hub .tool-card {
  border-color: rgba(100, 116, 139, 0.3);
}

.onboarding-next-row {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 10px 22px rgba(8, 47, 73, 0.22);
}

.app-rail {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.rail-quick-actions {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  background: linear-gradient(140deg, rgba(8, 47, 73, 0.4), rgba(15, 23, 42, 0.82));
}

.rail-quick-actions strong {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

/* .workflow-toolbar removed in cleanup pass: was duplicate of topbar
   actions with marketing copy and no live data binding. */

.flow-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: linear-gradient(120deg, rgba(8, 47, 73, 0.24), rgba(15, 23, 42, 0.76));
}

.flow-stepper a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(141, 165, 231, 0.28);
  border-radius: 10px;
  padding: 6px 10px;
  color: #dbe6ff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.5);
}

.flow-stepper a span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  background: rgba(56, 189, 248, 0.22);
  color: #dbeafe;
  border: 1px solid rgba(125, 211, 252, 0.45);
}

.flow-stepper a:hover {
  border-color: rgba(125, 211, 252, 0.62);
  background: rgba(30, 41, 59, 0.62);
}

.workflow-strapline {
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

/* .operate-priority-bar removed in cleanup pass: marketing tiles. */

.workspace-intro {
  margin-bottom: 12px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(10, 16, 34, 0.78));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.workspace-intro > div:first-child {
  display: grid;
  gap: 6px;
}

.workspace-intro h2 {
  margin: 0;
  font-size: 1.05rem;
}

.workspace-eyebrow {
  margin: 0;
  color: #7dd3fc;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  font-weight: 700;
}

body.ui-screen-operations #researchWorkspaceIntro,
body.ui-screen-operations #diagnosticsWorkspaceIntro,
body.ui-screen-operations #settingsWorkspaceIntro,
body.ui-screen-research #operationsWorkspaceIntro,
body.ui-screen-research #diagnosticsWorkspaceIntro,
body.ui-screen-research #settingsWorkspaceIntro,
body.ui-screen-diagnostics #operationsWorkspaceIntro,
body.ui-screen-diagnostics #researchWorkspaceIntro,
body.ui-screen-diagnostics #settingsWorkspaceIntro,
body.ui-screen-settings #operationsWorkspaceIntro,
body.ui-screen-settings #researchWorkspaceIntro,
body.ui-screen-settings #diagnosticsWorkspaceIntro {
  display: none !important;
}

body.ui-screen-settings #settingsWorkspaceIntro {
  display: flex !important;
}

.operations-workspace-intro {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(145deg, rgba(8, 47, 73, 0.44), rgba(15, 23, 42, 0.84));
}

.research-workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.research-lane {
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.research-lane h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #dbeafe;
}

.research-lane p {
  margin: 0;
  font-size: 0.82rem;
}

.diagnostics-workflow-strip,
.settings-workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.diagnostics-lane,
.settings-lane {
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.diagnostics-lane h3,
.settings-lane h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #dbeafe;
}

.diagnostics-lane p,
.settings-lane p {
  margin: 0;
  font-size: 0.82rem;
}

body.ui-simple .section-advanced,
body.ui-simple #toolsSection,
body.ui-simple .nav-advanced {
  display: none !important;
}
body.ui-screen-operations .diagnostics-surface,
body.ui-screen-research .diagnostics-surface,
body.ui-screen-settings .diagnostics-surface {
  display: none !important;
}
body.ui-screen-operations #onboardingSection,
body.ui-screen-operations #settingsSection,
body.ui-screen-operations #researchWorkflowStrip,
body.ui-screen-operations #settingsWorkflowStrip,
body.ui-screen-operations #diagnosticsWorkflowStrip,
body.ui-screen-operations #quickCheckSection,
body.ui-screen-operations #toolsSection,
body.ui-screen-operations #decisionSection,
body.ui-screen-operations #recoverySection,
body.ui-screen-operations #statusDetailsPanel,
body.ui-screen-operations #portfolioSection,
body.ui-screen-operations #performanceSection,
body.ui-screen-operations #learningSection,
body.ui-screen-operations #backtestSection,
body.ui-screen-operations #calibrationSection,
body.ui-screen-operations #reportSectionCard,
body.ui-screen-operations #secCompareSection,
body.ui-screen-operations #activitySection {
  display: none !important;
}
body.ui-screen-research #dashboardToday,
body.ui-screen-research #onboardingSection,
body.ui-screen-research #settingsSection,
body.ui-screen-research #settingsWorkflowStrip,
body.ui-screen-research #diagnosticsWorkflowStrip,
body.ui-screen-research #statusDetailsPanel,
body.ui-screen-research #scanSection,
body.ui-screen-research #scanDetailPanel,
body.ui-screen-research #sectorsSection {
  display: none !important;
}

/* Analyze/Research should avoid half-empty two-column wrappers when only one
   card is visible. Chrome supports :has(), so tighten these sections to one
   full-width track in that case. */
body.ui-screen-research .layout-2:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

/* Execution Notes is intentionally an operations-only helper; hide it on
   Research to reclaim space for analytical surfaces. */
body.ui-screen-research #activitySection {
  display: none !important;
}

/* Keep calibration visible on Research so the page uses available space with
   substantive analysis tooling rather than blank gutters. */
body.ui-screen-research #calibrationSection {
  display: block !important;
}

body.ui-screen-research #workflowPrimary .workflow-primary-heading,
body.ui-screen-research #workflowPrimary .workflow-strapline {
  display: none !important;
}

body.ui-screen-research #workflowPrimary .operate-kanban {
  grid-template-columns: minmax(0, 1fr);
}
body.ui-screen-diagnostics .operations-surface,
body.ui-screen-diagnostics #workflowPrimary,
body.ui-screen-diagnostics #researchWorkflowStrip,
body.ui-screen-diagnostics #settingsWorkflowStrip,
body.ui-screen-diagnostics #quickCheckSection,
body.ui-screen-diagnostics #toolsSection,
body.ui-screen-diagnostics #decisionSection,
body.ui-screen-diagnostics #recoverySection,
body.ui-screen-diagnostics #onboardingSection,
body.ui-screen-diagnostics #settingsSection,
body.ui-screen-diagnostics #portfolioSection,
body.ui-screen-diagnostics #sectorsSection,
body.ui-screen-diagnostics #performanceSection,
body.ui-screen-diagnostics #learningSection,
body.ui-screen-diagnostics #backtestSection,
body.ui-screen-diagnostics #reportSectionCard,
body.ui-screen-diagnostics #secCompareSection,
body.ui-screen-diagnostics #activitySection {
  display: none !important;
}
body.ui-screen-settings #dashboardToday,
body.ui-screen-settings #workflowPrimary,
body.ui-screen-settings #researchWorkflowStrip,
body.ui-screen-settings #diagnosticsWorkflowStrip,
body.ui-screen-settings #quickCheckSection,
body.ui-screen-settings #toolsSection,
body.ui-screen-settings #decisionSection,
body.ui-screen-settings #recoverySection,
body.ui-screen-settings #statusDetailsPanel,
body.ui-screen-settings #portfolioSection,
body.ui-screen-settings #sectorsSection,
body.ui-screen-settings #performanceSection,
body.ui-screen-settings #learningSection,
body.ui-screen-settings #backtestSection,
body.ui-screen-settings #calibrationSection,
body.ui-screen-settings #reportSectionCard,
body.ui-screen-settings #secCompareSection,
body.ui-screen-settings #activitySection {
  display: none !important;
}

body.ui-simple .scan-col-secondary,
body.ui-simple .scan-col-advanced {
  display: none !important;
}

body.ui-standard .scan-col-advanced {
  display: none !important;
}

.scan-detail-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(100, 116, 139, 0.28);
  display: grid;
  gap: 0.4rem;
}

.ui-screen-switching #screenContextCard,
.ui-screen-switching #workflowPrimary,
.ui-screen-switching .layout-2,
.ui-screen-switching .section-advanced,
.ui-screen-switching #dashboardToday {
  opacity: 0.86;
  transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
/* Blockers alert is part of the Health tab; visibility is mode-driven
   (diagnostics-surface) rather than detail-level driven, so users in
   Simple mode still see scan blockers when they're on Health. */
/* Setup wizard stays available in Simple view; presets stay under section-advanced. */
body.ui-simple .layout-onboarding-presets {
  grid-template-columns: 1fr;
}
body.ui-simple #onboardingSection {
  display: block !important;
}

.onboarding-user-hint {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
}
.onboarding-user-hint p {
  margin: 0;
}
.onboarding-connect-row {
  flex-wrap: wrap;
  align-items: center;
}

/* Schwab onboarding stepper -------------------------------------------- */
.onboarding-stepper {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  counter-reset: ob-step;
}
.onboarding-stepper li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  background: rgba(10, 16, 34, 0.5);
  font-size: 0.85rem;
  line-height: 1.25;
  transition: border-color 120ms ease, background 120ms ease;
}
.onboarding-stepper li .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.25);
  color: #cbd5f5;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.onboarding-stepper li .step-label {
  font-weight: 600;
  color: #e2e8f0;
}
.onboarding-stepper li .step-state {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.onboarding-stepper li.done {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.22);
}
.onboarding-stepper li.done .step-num {
  background: rgba(52, 211, 153, 0.85);
  color: #022c22;
}
.onboarding-stepper li.done .step-state {
  color: #6ee7b7;
}
.onboarding-stepper li.failed {
  border-color: rgba(251, 113, 133, 0.6);
  background: rgba(127, 29, 29, 0.18);
}
.onboarding-stepper li.failed .step-num {
  background: rgba(251, 113, 133, 0.85);
  color: #4c0519;
}
.onboarding-stepper li.failed .step-state {
  color: #fda4af;
}
.onboarding-stepper li.current {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(8, 47, 73, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}
.onboarding-stepper li.current .step-num {
  background: rgba(56, 189, 248, 0.9);
  color: #082f49;
}
.onboarding-stepper li.current .step-state {
  color: #7dd3fc;
}
.onboarding-stepper.complete li.done .step-state {
  opacity: 0.7;
}

.onboarding-next-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 12px;
}
.onboarding-next-copy {
  flex: 1 1 240px;
  min-width: 0;
}
.onboarding-next-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 1rem;
  color: #e2e8f0;
}
.onboarding-next-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.onboarding-next-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (min-width: 1120px) {
  .app-rail {
    position: sticky;
    top: 10px;
    z-index: 5;
  }
}

@media (max-width: 900px) {
  .workspace-intro {
    flex-direction: column;
  }
  .flow-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Operations-first layout refinements */
.layout-workflow {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  align-items: start;
  gap: 14px;
}

.layout-workflow > #pendingSection {
  position: sticky;
  top: var(--sticky-offset);
}

.scan-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.scan-detail-panel {
  position: sticky;
  top: var(--sticky-offset);
  max-height: var(--sticky-max-height);
  overflow: auto;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 12px;
  background: rgba(10, 16, 34, 0.72);
  padding: 12px;
}

#scanSection table tbody tr {
  transition: background-color 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}

#scanSection table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

#scanSection table tbody tr:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: -2px;
}

#scanSection table tbody tr.is-active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(59, 130, 246, 0.08));
  box-shadow: inset 2px 0 0 rgba(56, 189, 248, 0.95);
}

#pendingSection .task-board {
  min-height: 280px;
  max-height: calc(var(--sticky-max-height) - 70px);
  overflow: auto;
}

.workflow-primary-heading {
  margin-bottom: 10px;
}

@media (max-width: 1200px) {
  .layout-workflow {
    grid-template-columns: 1fr;
  }

  .layout-workflow > #pendingSection,
  .scan-detail-panel {
    position: static;
    max-height: none;
  }

  .scan-results-layout {
    grid-template-columns: 1fr;
  }
}

.onboarding-help,
.onboarding-advanced {
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(10, 16, 34, 0.4);
  padding: 0 12px;
}
.onboarding-help summary,
.onboarding-advanced summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
  color: #cbd5f5;
}
.onboarding-help[open],
.onboarding-advanced[open] {
  padding-bottom: 12px;
}
.onboarding-help-body h3 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
  color: #e2e8f0;
}
.onboarding-help-body p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.onboarding-help-list {
  margin: 0 0 8px 18px;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.onboarding-help-list li {
  margin-bottom: 4px;
}
body.ui-simple #scanDiagnosticsPanel {
  display: none !important;
}
body.ui-simple .layout-quick-tools {
  grid-template-columns: 1fr;
}

body.ui-pro .panel-disclosure--advanced {
  border-style: solid;
  opacity: 1;
}

@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .performance-buckets { grid-template-columns: 1fr; }
  .layout-2 { grid-template-columns: 1fr; }
  .scan-results-layout { grid-template-columns: 1fr; }
  .scan-detail-grid { grid-template-columns: 1fr; }
  .research-workflow-strip { grid-template-columns: 1fr; }
  .diagnostics-workflow-strip,
  .settings-workflow-strip { grid-template-columns: 1fr; }
  .hero-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "aside";
  }
  .hero-aside { max-width: 100%; }
  .hero-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .compare-grid { grid-template-columns: 1fr; }
  .mgmt-dashboard { grid-template-columns: 1fr; }
  .integrity-score-wrap { grid-template-columns: 1fr; }
  .integrity-gauge { margin: 0 auto; }
  .analyst-annotation {
    position: static;
    width: auto;
    margin-top: 8px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .scan-insights { grid-template-columns: 1fr; }
  .task-meters { grid-template-columns: 1fr; }
  .funnel-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }
  .ic-snapshot-grid,
  .report-split-grid,
  .report-claim-grid,
  .report-scenario-kpis,
  .perf-attribution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .container { width: min(96vw, 1280px); margin-top: 16px; gap: 12px; }
  .hero { padding: 16px; }
  .hero-kpi-strip {
    grid-template-columns: 1fr;
  }
  .hero h1 { font-size: 1.46rem; }
  .stats { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .section-title { padding: 14px 14px 10px; }
  .inline-form { padding: 0 14px 12px; gap: 8px; }
  .table-wrap { padding: 0 10px 14px; }
  .btn.small { font-size: 0.76rem; padding: 6px 9px; }
  .section-nav { top: 6px; }
  .health-ribbon { top: 4px; }
  .screen-context {
    flex-direction: column;
    align-items: flex-start;
  }
  .screen-context-actions {
    width: 100%;
  }
  .flow-stepper {
    grid-template-columns: 1fr;
  }
}

.mobile-primary-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  width: min(96vw, 620px);
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  z-index: 40;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(141, 165, 231, 0.35);
  background: rgba(10, 16, 34, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.mobile-primary-dock .btn {
  justify-content: center;
  min-height: 38px;
}

.mobile-primary-dock a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 760px) {
  .mobile-primary-dock {
    display: grid;
  }
  .scroll-top-btn {
    bottom: 86px;
  }
}

/* Legal / site footer */
.site-footer {
  margin-top: 0.75rem;
  padding: 16px 18px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  border-radius: 14px;
}
.site-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover {
  color: #7dd3fc;
}

.legal-page {
  max-width: 820px;
  margin-bottom: 48px;
}
.legal-page-header {
  padding: 20px 22px;
}
.legal-body {
  padding: 20px 22px 24px;
}
.legal-body h2 {
  font-size: 1rem;
  margin: 1.35rem 0 0.5rem;
  color: #e4e4e7;
}
.legal-body h2:first-of-type {
  margin-top: 0;
}
.legal-body p,
.legal-body li {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #d4d4d8;
}
.legal-list {
  margin: 0.35rem 0 0.75rem 1.1rem;
  padding: 0;
}
.legal-list li {
  margin-bottom: 0.35rem;
}
.legal-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
  font-size: 0.8rem;
}
.legal-body code {
  font-size: 0.82em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}

/* Scroll-to-top button */
.scroll-top-btn {
  position: fixed;
  bottom: 64px;
  right: 24px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(12, 18, 36, 0.92);
  backdrop-filter: blur(12px);
  color: #e0e7ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s var(--ease-spring),
    background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.scroll-top-btn:hover {
  background: rgba(64, 84, 180, 0.5);
  border-color: rgba(122, 141, 255, 0.6);
  transform: translateY(-2px) scale(1.05);
}
.scroll-top-btn:active {
  transform: translateY(0) scale(0.95);
}
.scroll-top-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(12, 18, 36, 0.95);
  backdrop-filter: blur(16px);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.86rem;
  max-width: 380px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.35s var(--ease-out-expo) both;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.toast-success { border-color: rgba(52, 211, 153, 0.5); }
.toast.toast-error { border-color: rgba(251, 113, 133, 0.5); }
.toast.toast-info { border-color: rgba(56, 189, 248, 0.5); }
.toast-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.toast-success .toast-dot { background: var(--good); }
.toast-error .toast-dot { background: var(--bad); }
.toast-info .toast-dot { background: var(--accent); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(20px) scale(0.95); }
}
.toast.exiting { animation: toast-out 0.25s ease forwards; }

/* Input improvements */
input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled) {
  border-color: rgba(130, 153, 221, 0.55);
}
input::placeholder {
  color: rgba(156, 163, 184, 0.5);
  transition: color 0.2s ease;
}
input:focus::placeholder {
  color: rgba(156, 163, 184, 0.3);
}

/* Progress bar polish */
progress {
  appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.4s var(--ease-out-expo);
}
progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

/* Activity drawer badge */
.activity-drawer-toggle {
  position: relative;
}
.activity-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  animation: badge-pop 0.3s var(--ease-spring);
}
@keyframes badge-pop {
  from { transform: translateY(-50%) scale(0); }
  to { transform: translateY(-50%) scale(1); }
}

/* Keyboard shortcut hints */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid rgba(130, 153, 221, 0.35);
  background: rgba(8, 14, 31, 0.7);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

/* Smooth section title underline on hover */
.section-title h2,
.section-title h3 {
  position: relative;
}
.section-title h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 1px;
  transition: width 0.3s var(--ease-out-expo);
}
.section-title:hover h2::after {
  width: 100%;
}

/* Login page specific */
.login-container {
  max-width: 520px;
  padding-top: 2rem;
}
.login-card-header {
  padding: 22px;
}
.login-card-header h1 {
  margin: 8px 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(120deg, #f8fafc 0%, #c7d2fe 45%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-body {
  padding: 22px;
}
.login-message {
  margin-top: 12px;
}
.login-actions {
  margin-top: 16px;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 18, 36, 0.95);
  border: 1px solid rgba(130, 153, 221, 0.35);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Ticker Chart ────────────────────────── */
.ticker-chart-container {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
}
.ticker-chart-container.hidden { display: none; }

/* ── Notification Center ─────────────────── */
.icon-btn {
  position: relative;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(56, 189, 248, 0.1); }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-badge.hidden { display: none; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, 90vw);
  max-height: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
}
.notif-panel.hidden { display: none; }
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(99,120,200,0.08);
  font-size: 0.82rem;
}
.notif-unread { background: rgba(56, 189, 248, 0.04); }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot--info { background: var(--accent); }
.notif-dot--good { background: var(--good); }
.notif-dot--bad { background: var(--bad); }
.notif-msg { flex: 1; }
.notif-time {
  font-size: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-actions { position: relative; }

/* ── Portfolio Risk Panel ─────────────────── */
.risk-panel-content {
  padding: 8px 0;
}
.risk-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.risk-kpi {
  flex: 1 1 120px;
  min-width: 100px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.risk-kpi-value {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.risk-kpi-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}
.risk-section-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
}
.risk-recommendation-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.risk-sector-bars, .risk-weight-grid, .risk-pl-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.risk-sector-row, .risk-weight-row, .risk-pl-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.risk-sector-name, .risk-weight-sym {
  min-width: 110px;
  font-size: 0.82rem;
  font-weight: 500;
  flex-shrink: 0;
}
.risk-weight-sym {
  min-width: 56px;
  font-family: var(--font-mono);
}
.risk-sector-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(99, 120, 200, 0.1);
  border-radius: 4px;
  overflow: hidden;
}
.risk-sector-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s var(--ease-out-expo);
}
.risk-weight-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-2), #c084fc);
  transition: width 0.3s var(--ease-out-expo);
}
.risk-sector-pct {
  min-width: 42px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 500;
}
.risk-sector-val {
  min-width: 68px;
  text-align: right;
  font-size: 0.76rem;
}
.risk-pl-row {
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(99, 120, 200, 0.08);
}
@media (max-width: 760px) {
  .risk-kpi-row { gap: 8px; }
  .risk-kpi { min-width: 80px; padding: 8px 10px; }
  .risk-sector-name { min-width: 80px; }
  .risk-sector-val { display: none; }
}

/* ── Command Palette ───────────────────────── */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: min(18vh, 160px);
}
.cmd-palette-overlay.open {
  display: flex;
}
.cmd-palette {
  width: min(560px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 120, 200, 0.12);
  overflow: hidden;
  animation: cmdSlideIn 0.18s var(--ease-out-expo);
}
@keyframes cmdSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-palette-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.cmd-palette-search-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.cmd-palette-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.cmd-palette-esc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(99, 120, 200, 0.12);
  border: 1px solid rgba(99, 120, 200, 0.25);
  color: var(--muted);
  flex-shrink: 0;
}
.cmd-palette-hints {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cmd-palette-hint {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 120, 200, 0.1);
  border: 1px solid rgba(99, 120, 200, 0.2);
  color: var(--muted);
}
.cmd-palette-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}
.cmd-palette-item:hover,
.cmd-palette-item.selected {
  background: rgba(56, 189, 248, 0.1);
}
.cmd-palette-item.selected {
  outline: 1px solid rgba(56, 189, 248, 0.3);
}
.cmd-palette-label {
  flex: 1;
}
.cmd-palette-kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 120, 200, 0.1);
  border: 1px solid rgba(99, 120, 200, 0.2);
  color: var(--muted);
}

/* ── Toast variants ──────────────────────────── */
.toast-warn { border-color: var(--warn); }
.toast-warn .toast-dot { background: var(--warn); }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-top-btn { transition: none; }
  .toast { animation: none; }
  .cmd-palette { animation: none; }
}

/* ------------------------------------------------------------------
   Visual Overhaul v2
   Intent: make the product feel fundamentally new (not incremental polish)
------------------------------------------------------------------- */
:root {
  --bg: #04060f;
  --bg-elevated: #0a1020;
  --panel: rgba(10, 16, 32, 0.9);
  --panel-border: rgba(94, 114, 228, 0.28);
  --text: #f6f8ff;
  --muted: #a8b3d6;
  --accent: #60a5fa;
  --accent-2: #8b5cf6;
  --hero-glow: rgba(96, 165, 250, 0.22);
  --radius-card: 22px;
  --elevation-soft: 0 22px 52px rgba(1, 6, 18, 0.62);
}

html, body {
  background:
    radial-gradient(circle at 8% -5%, rgba(99, 102, 241, 0.24), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(56, 189, 248, 0.2), transparent 38%),
    linear-gradient(180deg, #03050d 0%, #050915 100%);
}

.bg-grid {
  opacity: 0.32;
  background-size: 40px 40px;
}

.bg1 { background: #6366f1; opacity: 0.2; }
.bg2 { background: #38bdf8; opacity: 0.2; }
.bg3 { background: #8b5cf6; opacity: 0.16; }

.container {
  width: min(1540px, 95vw);
  gap: 18px;
}

.card {
  background:
    linear-gradient(165deg, rgba(18, 27, 52, 0.9) 0%, rgba(8, 14, 29, 0.94) 100%);
  border: 1px solid rgba(104, 129, 255, 0.28);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-soft);
}

.hero-shell {
  gap: 1.4rem 2.2rem;
  border: 1px solid rgba(125, 211, 252, 0.32);
  background:
    linear-gradient(130deg, rgba(30, 64, 175, 0.32) 0%, rgba(7, 11, 24, 0.9) 42%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(6, 11, 25, 0.95));
}

.hero-shell::before {
  opacity: 1;
}

.hero h1 {
  font-size: clamp(1.95rem, 2.5vw, 2.8rem);
  letter-spacing: -0.022em;
}

.hero-lead {
  max-width: 72ch;
  color: #dbe7ff;
  font-size: 1rem;
}

.hero-actions .btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-color: rgba(165, 180, 252, 0.55);
  color: #ffffff;
}

.hero-actions .btn.secondary {
  background: rgba(9, 15, 30, 0.72);
  border-color: rgba(148, 163, 184, 0.34);
}

.hero-kpi-strip {
  gap: 10px;
}

.hero-kpi {
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.24);
}

.app-rail {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.section-nav {
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 14, 30, 0.94), rgba(5, 10, 24, 0.9));
  box-shadow: 0 10px 26px rgba(2, 6, 20, 0.45);
}

.section-nav a,
.screen-switch-btn {
  border-color: rgba(147, 197, 253, 0.3);
  background: rgba(10, 19, 40, 0.8);
  color: #e7edff;
}

.section-nav a.active,
.screen-switch-btn[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.42), rgba(139, 92, 246, 0.4));
  border-color: rgba(165, 180, 252, 0.78);
  box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.32) inset;
}

.screen-context {
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: linear-gradient(145deg, rgba(8, 14, 30, 0.84), rgba(7, 11, 24, 0.96));
}

.flow-stepper {
  border-radius: 16px;
  padding: 12px;
}

.flow-stepper a {
  min-height: 42px;
  border-radius: 12px;
  font-size: 0.82rem;
}

#workflowPrimary {
  border-radius: 22px;
  padding: 12px;
  background: linear-gradient(165deg, rgba(7, 14, 30, 0.86), rgba(5, 10, 22, 0.94));
  border: 1px solid rgba(96, 165, 250, 0.24);
}

.workflow-primary-heading {
  font-size: 1.32rem;
  letter-spacing: -0.01em;
}

#scanSection,
#pendingSection {
  border-radius: 18px;
}

#scanSection .table-wrap {
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: rgba(4, 10, 23, 0.72);
}

#scanSection table thead th {
  background: rgba(15, 23, 42, 0.88);
  color: #dbe7ff;
}

/* Sortable column headers used in the scan candidates table.
   Header cells get a small caret on the right that brightens when the
   column is the active sort target. Keeping the indicator inside the
   <th> (rather than a separate column) avoids any layout shift when
   the sort target changes. */
.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.sortable-th:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.10);
}
.sortable-th:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.sortable-th .sort-indicator {
  display: inline-block;
  width: 12px;
  margin-left: 6px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.35;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.sortable-th .sort-indicator::before { content: "\2195"; } /* up-down arrow */
.sortable-th.is-sorted-asc .sort-indicator::before { content: "\25B2"; } /* ▲ */
.sortable-th.is-sorted-desc .sort-indicator::before { content: "\25BC"; } /* ▼ */
.sortable-th.is-sorted .sort-indicator {
  opacity: 1;
  color: var(--accent);
}
.sortable-th.is-sorted {
  color: #ffffff;
}

#scanSection table tbody tr {
  border-bottom-color: rgba(99, 102, 241, 0.18);
}

#scanSection table tbody tr:hover {
  background: rgba(30, 58, 138, 0.24);
}

.scan-detail-panel {
  border-color: rgba(165, 180, 252, 0.35);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(8, 12, 24, 0.86), rgba(12, 18, 38, 0.72));
}

#pendingSection .task-board {
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(6, 10, 24, 0.58);
  padding: 8px;
}

.workspace-intro {
  border-radius: 18px;
}

#researchWorkflowStrip,
#diagnosticsWorkflowStrip,
#settingsWorkflowStrip {
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: linear-gradient(165deg, rgba(8, 14, 30, 0.88), rgba(6, 10, 22, 0.9));
}

.research-lane,
.diagnostics-lane,
.settings-lane {
  border-radius: 14px;
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(8, 15, 31, 0.74);
}

.tool-card {
  border-radius: 14px;
  border-color: rgba(125, 211, 252, 0.24);
  background: linear-gradient(155deg, rgba(7, 13, 29, 0.92), rgba(10, 17, 35, 0.84));
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.42);
}

#statusSection .stat {
  border-radius: 14px;
  border-color: rgba(125, 211, 252, 0.2);
  background: rgba(8, 13, 27, 0.7);
}

.site-footer {
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(5, 10, 22, 0.9), rgba(7, 12, 24, 0.96));
}

.mobile-primary-dock {
  border-radius: 16px;
  border-color: rgba(125, 211, 252, 0.35);
  background: linear-gradient(155deg, rgba(8, 14, 30, 0.95), rgba(4, 8, 20, 0.95));
}

@media (max-width: 1120px) {
  .container {
    width: min(96vw, 1400px);
  }
  .app-rail {
    position: static;
  }
}

@media (max-width: 760px) {
  .hero-shell {
    border-radius: 18px;
  }
  .hero h1 {
    font-size: 1.68rem;
  }
  .workflow-primary-heading {
    font-size: 1.08rem;
  }
  #workflowPrimary {
    padding: 8px;
  }
}

/* ------------------------------------------------------------------
   Operating Shell Overhaul: left rail + kanban lanes
   (Command center / KPI cards removed in cleanup pass — they were
   decorative tiles with no live data binding.)
------------------------------------------------------------------- */
.operate-kanban {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.kanban-lane {
  min-height: 560px;
}

.kanban-lane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: rgba(8, 15, 34, 0.66);
}

.kanban-lane-step {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.kanban-lane-head strong {
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.operate-kanban #scanSection .scan-results-layout {
  grid-template-columns: 1fr;
}

.operate-kanban #scanSection .table-wrap {
  max-height: 620px;
  overflow: auto;
}

.operate-kanban #pendingSection .task-board {
  max-height: 620px;
}


@media (min-width: 1280px) {
  .container {
    margin: 16px 24px 56px 338px;
    width: auto;
    max-width: none;
  }

  .app-rail {
    position: fixed;
    left: 20px;
    top: 16px;
    width: 300px;
    height: calc(100vh - 32px);
    overflow: auto;
    z-index: 35;
    padding-right: 2px;
  }

  .app-rail .section-nav {
    position: static;
  }
}

@media (max-width: 1279px) {
  .app-rail {
    position: static;
  }
}

@media (max-width: 1120px) {
  .operate-kanban {
    grid-template-columns: 1fr;
  }
  .kanban-lane {
    min-height: 0;
  }
}

.scan-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.scan-mode-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 0.72rem;
  cursor: help;
}

.scan-mode-helper {
  display: inline-flex;
  align-items: center;
}

.scan-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scan-list-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-list-title {
  margin: 0;
  font-size: 0.95rem;
}

.scan-rank-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-rank-cell--inline {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.scan-rank-score {
  font-variant-numeric: tabular-nums;
}

.scan-rank-why {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: rgba(191, 219, 254, 0.95);
  font-size: 0.68rem;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.scan-rank-inline {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.scan-severity-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.scan-severity-legend .pill {
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.qualified-table-wrap {
  margin-top: 8px;
}

.scan-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.scan-near-miss-panel {
  margin-top: 12px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 10px;
  background: rgba(51, 17, 17, 0.16);
  padding: 8px 10px;
}

.scan-near-miss-panel > summary {
  cursor: pointer;
  font-weight: 600;
}

.scan-near-miss-copy {
  margin: 8px 0;
}

.near-miss-table-wrap {
  max-height: 320px;
}

.scan-actions-menu {
  display: inline-block;
  position: relative;
}

.scan-actions-menu > summary {
  list-style: none;
}

.scan-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.scan-actions-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 96px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.94);
  z-index: 40;
}
