:root {
  --paper: #eff4fb;
  --paper-strong: #ffffff;
  --ink: #0f172a;
  --ink-soft: #546178;
  --forest: #1358db;
  --forest-2: #0d3d9a;
  --rust: #0b8f7a;
  --rust-dark: #076857;
  --gold: #23b7ff;
  --gold-soft: rgba(35, 183, 255, 0.16);
  --line: rgba(15, 23, 42, 0.1);
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 80px rgba(10, 31, 68, 0.12);
  --shadow-tight: 0 14px 36px rgba(10, 31, 68, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --max-width: 1240px;
  --heading-font: "Space Grotesk", "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --body-font: "IBM Plex Sans", "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(19, 88, 219, 0.14), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(35, 183, 255, 0.14), transparent 22%),
    linear-gradient(180deg, #f5f9ff 0%, #edf3fb 48%, #e6edf8 100%);
  font-family: var(--body-font);
  min-height: 100vh;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
  pointer-events: none;
  opacity: 0.45;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(19, 88, 219, 0.1), transparent 30%),
    radial-gradient(circle at 75% 45%, rgba(11, 143, 122, 0.08), transparent 28%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(var(--max-width), calc(100vw - 40px));
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  color: var(--forest);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(19, 88, 219, 0.45);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--heading-font);
  line-height: 1;
  letter-spacing: -0.04em;
}

p {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  width: min(var(--max-width), calc(100vw - 40px));
  margin: 18px auto 0;
  padding: 16px 22px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-sm);
  background: rgba(250, 253, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-tight);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.brand-block .eyebrow {
  margin-bottom: 0;
}

.brand-block .eyebrow::before {
  display: none;
}

.brand {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.topnav {
  display: flex;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.topnav a {
  transition: color 180ms ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
}

.ghost-button,
.primary-button {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.ghost-button {
  padding: 0.95rem 1.25rem;
  color: var(--ink);
  background: rgba(19, 88, 219, 0.08);
  box-shadow: inset 0 0 0 1px rgba(19, 88, 219, 0.08);
}

.primary-button {
  padding: 1rem 1.35rem;
  color: var(--paper-strong);
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-2) 100%);
  box-shadow: 0 14px 30px rgba(19, 88, 219, 0.24);
}

.ghost-button:hover,
.ghost-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  gap: 2rem;
  padding: 52px 0 20px;
}

.hero-copy {
  display: grid;
  gap: 1.4rem;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(3.2rem, 6vw, 5.6rem);
}

.lede {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.command-surface,
.hero-panel,
.feature-card,
.trust-card,
.main-panel,
.side-panel,
.footer,
.control-bar {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.command-surface {
  padding: 1.35rem;
  border-radius: var(--radius-lg);
}

.command-label,
.command-hint {
  color: var(--ink-soft);
}

.command-label {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
}

.command-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
}

.command-row input {
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.command-textarea {
  width: 100%;
  min-height: 96px;
  margin-top: 0.15rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  resize: vertical;
  font: inherit;
}

.command-row input:focus,
.command-textarea:focus {
  outline: 2px solid rgba(19, 88, 219, 0.28);
  outline-offset: 1px;
}

.command-hint {
  margin-top: 0.8rem;
  font-size: 0.92rem;
}

.seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.trust-card {
  position: relative;
  padding: 1.35rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.trust-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -45% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 183, 255, 0.12), transparent 72%);
}

.trust-index {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--forest);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.trust-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.55rem;
}

.trust-card p {
  color: var(--ink-soft);
}

.hero-panel {
  position: relative;
  align-self: start;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 249, 255, 0.78)),
    var(--card);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -20% -15% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(19, 88, 219, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-panel .section-title h2 {
  font-size: 2rem;
}

.hero-panel .kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-panel .stat-card,
.hero-panel .list-card {
  background: rgba(255, 255, 255, 0.86);
}

.hero-panel .stat-card {
  padding: 0.95rem;
}

.hero-panel .stat-value {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.feature-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 18px 0 12px;
}

.feature-card {
  padding: 1.4rem;
  border-radius: var(--radius-lg);
}

.feature-card h2 {
  margin-bottom: 0.6rem;
  font-size: 1.5rem;
}

.feature-card p:last-child {
  color: var(--ink-soft);
}

.workspace {
  padding: 46px 0 80px;
}

.workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1rem;
  padding: 1.45rem 1.55rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 248, 255, 0.76)),
    var(--card);
  box-shadow: var(--shadow);
}

.workspace-header h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  margin-bottom: 0.35rem;
}

.workspace-header p:last-child {
  color: var(--ink-soft);
  max-width: 60ch;
  font-size: 1rem;
}

.mode-badge {
  align-self: start;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(19, 88, 219, 0.08);
  border-radius: 18px;
  background: rgba(19, 88, 219, 0.06);
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 700;
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: start;
  margin-bottom: 0.85rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-xl);
}

.filter-group {
  display: grid;
  gap: 0.62rem;
  min-width: 0;
}

.filter-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  padding: 0.74rem 0.98rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  cursor: pointer;
}

.chip.active {
  border-color: transparent;
  color: var(--paper-strong);
  background: linear-gradient(135deg, var(--forest) 0%, #0f7fd1 100%);
  box-shadow: 0 10px 22px rgba(19, 88, 219, 0.2);
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: end;
  align-self: end;
}

.stacked-control {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.control-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.valuation-legend {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.inline-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
}

.control-select {
  width: 100%;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.control-select:focus {
  outline: 2px solid rgba(19, 88, 219, 0.28);
  outline-offset: 1px;
}

.ghost-button-compact {
  padding: 0.9rem 1.1rem;
}

.notice {
  min-height: 1.4rem;
  margin: 0 0 0.95rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(11, 143, 122, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--rust-dark);
  font-size: 0.94rem;
  box-shadow: var(--shadow-tight);
}

#statusBanner:empty {
  display: none;
}

.status-banner {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-tight);
}

.status-banner .section-title h3 {
  font-size: 1.25rem;
}

.status-banner-success {
  border-color: rgba(10, 129, 109, 0.18);
  background: linear-gradient(180deg, rgba(231, 251, 246, 0.92), rgba(255, 255, 255, 0.82));
}

.status-banner-warning {
  border-color: rgba(15, 127, 209, 0.18);
  background: linear-gradient(180deg, rgba(235, 245, 255, 0.92), rgba(255, 255, 255, 0.82));
}

.status-banner-danger {
  border-color: rgba(181, 72, 72, 0.2);
  background: linear-gradient(180deg, rgba(255, 239, 239, 0.94), rgba(255, 255, 255, 0.84));
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow-tight);
}

.tab-button {
  padding: 0.82rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
}

.tab-button[aria-selected="true"] {
  color: var(--paper-strong);
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-2) 100%);
  box-shadow: 0 12px 24px rgba(19, 88, 219, 0.22);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(300px, 0.72fr);
  gap: 1.2rem;
  align-items: start;
}

.main-panel,
.side-panel {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.main-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 251, 255, 0.78)),
    var(--card);
}

.side-panel {
  position: sticky;
  top: 112px;
  background:
    linear-gradient(180deg, rgba(244, 249, 255, 0.84), rgba(255, 255, 255, 0.8)),
    var(--card);
}

.panel-section {
  display: grid;
  gap: 1rem;
}

.kpi-grid,
.snapshot-grid,
.report-grid,
.valuation-grid,
.three-up {
  display: grid;
  gap: 1rem;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.snapshot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.valuation-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.valuation-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.valuation-comparable-card {
  display: grid;
  gap: 0.8rem;
}

.valuation-comparable-card--selected {
  background: linear-gradient(180deg, rgba(11, 143, 122, 0.09), rgba(255, 255, 255, 0.88));
  border-color: rgba(11, 143, 122, 0.18);
}

.valuation-comparable-card--holdout {
  background: linear-gradient(180deg, rgba(19, 88, 219, 0.07), rgba(255, 255, 255, 0.88));
  border-color: rgba(19, 88, 219, 0.16);
}

.valuation-comparable-card--rejected {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05), rgba(255, 255, 255, 0.88));
  border-color: rgba(15, 23, 42, 0.12);
}

.inline-score {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.08rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(19, 88, 219, 0.1);
  color: var(--forest-2);
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-provenance-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.4rem;
  padding: 0.08rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-badge-ok {
  color: #0b4d39;
  background: rgba(11, 143, 122, 0.14);
  box-shadow: inset 0 0 0 1px rgba(11, 143, 122, 0.2);
}

.health-badge-warn {
  color: #7a4b05;
  background: rgba(255, 196, 60, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 60, 0.28);
}

.health-badge-fail {
  color: #8b1e2b;
  background: rgba(219, 68, 83, 0.14);
  box-shadow: inset 0 0 0 1px rgba(219, 68, 83, 0.22);
}

.inline-reason {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.card,
.stat-card,
.source-card,
.timeline-card,
.evidence-card,
.report-card,
.list-card {
  padding: 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.stat-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  font-family: var(--heading-font);
  font-size: clamp(1.7rem, 2vw, 2.4rem);
}

.stat-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-title h3 {
  font-size: 1.55rem;
}

.section-title p {
  color: var(--ink-soft);
  max-width: 55ch;
}

.tag-row,
.source-meta,
.evidence-meta,
.timeline-meta,
.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag,
.source-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.tag {
  background: rgba(19, 88, 219, 0.08);
  color: var(--forest);
}

.source-pill {
  background: rgba(35, 183, 255, 0.14);
  color: #0d5f91;
}

.status-pill {
  color: var(--paper-strong);
}

.status-verified {
  background: #0a816d;
}

.status-probable {
  background: #0f7fd1;
}

.status-conflicting {
  background: #b54848;
}

.status-unavailable {
  background: #7b7e77;
}

.official {
  background: rgba(19, 88, 219, 0.1);
  color: var(--forest);
}

.secondary {
  background: rgba(11, 143, 122, 0.1);
  color: var(--rust-dark);
}

.source-card h4,
.timeline-card h4,
.evidence-card h4,
.report-card h4,
.list-card h4 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.evidence-card p,
.source-card p,
.report-card p,
.list-card p,
.timeline-card p {
  color: var(--ink-soft);
}

.evidence-card strong,
.timeline-card strong,
.list-card strong {
  color: var(--ink);
}

.timeline-list,
.source-list,
.evidence-list,
.contradiction-list,
.bullet-list,
.metric-table {
  display: grid;
  gap: 0.85rem;
}

.metric-table {
  gap: 0.55rem;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.3fr) minmax(110px, 0.7fr);
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(21, 34, 29, 0.08);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-row small {
  color: var(--ink-soft);
}

.progress-row {
  display: grid;
  gap: 0.55rem;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(21, 34, 29, 0.08);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--gold));
}

.footer {
  margin-bottom: 42px;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
}

.footer h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.footer p:last-child {
  color: var(--ink-soft);
  max-width: 72ch;
}

.fade-in {
  animation: rise 500ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .workspace-grid,
  .feature-rail,
  .trust-strip,
  .valuation-grid,
  .valuation-review-grid,
  .kpi-grid,
  .snapshot-grid,
  .three-up {
    grid-template-columns: 1fr;
  }

  .control-bar {
    grid-template-columns: 1fr;
  }

  .workspace-header,
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .control-actions {
    justify-content: start;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell,
  .topbar {
    width: min(var(--max-width), calc(100vw - 24px));
  }

  .hero {
    padding-top: 24px;
  }

  .hero h1 {
    max-width: none;
    font-size: 2.6rem;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .command-row {
    grid-template-columns: 1fr;
  }

  .inline-control-row {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }
}
