:root {
  --bg: #07111f;
  --bg-soft: #0f1d30;
  --panel: rgba(10, 19, 33, 0.78);
  --panel-strong: rgba(10, 19, 33, 0.9);
  --panel-light: rgba(255, 255, 255, 0.06);
  --ink: #ecf3ff;
  --muted: #9eb0c8;
  --accent: #5dd0b2;
  --accent-strong: #37a48a;
  --secondary: #69a4ff;
  --warning: #f2b766;
  --error: #ff7c7c;
  --border: rgba(167, 191, 224, 0.18);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --company: #5dd0b2;
  --theme: #efad54;
  --news: #6d91ff;
  --filing: #b286ff;
  --agent: #ff7085;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(93, 208, 178, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(109, 145, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom center, rgba(242, 183, 102, 0.12), transparent 28%),
    linear-gradient(180deg, #09111d 0%, #0d1524 52%, #08111d 100%);
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 30px auto 56px;
  display: grid;
  gap: 20px;
}

.hero,
.panel,
.launch-card,
.hero-stat,
.info-card,
.timeline-card,
.chat-bubble {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero,
.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 32px;
}

.panel-company {
  background: var(--panel);
}

.panel-graph {
  background:
    linear-gradient(180deg, rgba(17, 22, 45, 0.92), rgba(13, 19, 38, 0.88)),
    radial-gradient(circle at top right, rgba(109, 145, 255, 0.14), transparent 34%);
}

.panel-simulation {
  background:
    linear-gradient(180deg, rgba(16, 23, 37, 0.92), rgba(10, 19, 33, 0.86)),
    radial-gradient(circle at top left, rgba(93, 208, 178, 0.1), transparent 32%);
}

.hero {
  padding: 28px;
  position: relative;
  overflow: visible;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
}

.hero::before {
  width: 240px;
  height: 240px;
  top: -80px;
  right: -70px;
  background: rgba(109, 145, 255, 0.18);
}

.hero::after {
  width: 200px;
  height: 200px;
  bottom: -70px;
  left: -40px;
  background: rgba(93, 208, 178, 0.16);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.hero-copy,
.launch-card {
  position: relative;
  z-index: 1;
}

.hero-copy {
  padding-top: 10px;
}

.eyebrow,
.stage-kicker,
.hero-stat-label,
.info-card-label,
.graph-details-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 10px;
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.intro {
  max-width: 56ch;
  margin-top: 18px;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-chips,
.hero-stats,
.chip-row,
.graph-legend,
.metric-row,
.reaction-row,
.timeline-filters,
.graph-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chips {
  margin-top: 22px;
}

.hero-chip,
.chip,
.event-meta span,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 14px;
  border: 1px solid rgba(167, 191, 224, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.94rem;
}

.hero-stats {
  margin-top: 22px;
}

.hero-stat,
.info-card {
  flex: 1 1 180px;
  min-width: 180px;
  border-radius: 22px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.hero-stat strong,
.info-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.35;
}

.launch-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(160deg, rgba(93, 208, 178, 0.08), transparent 56%);
  border-radius: 28px;
  padding: 22px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.launch-card-head,
.results-header,
.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.results-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.launch-copy,
.message,
.folder,
.detail-text,
.report-note,
.graph-related,
.timeline-context,
.comment-list,
.chat-answer,
.chat-question {
  color: var(--muted);
}

.summary-block {
  display: grid;
  gap: 12px;
}

.summary-block .summary-line {
  display: block;
}

.launch-copy {
  line-height: 1.55;
}

.panel {
  padding: 24px;
}

label {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.controls-hero {
  margin-top: -2px;
}

.ticker-picker {
  position: relative;
  width: 100%;
}

.ticker-picker input[type="text"] {
  padding-right: 54px;
}

.ticker-picker::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 20px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(236, 243, 255, 0.6);
  border-bottom: 2px solid rgba(236, 243, 255, 0.6);
  transform: rotate(45deg);
  pointer-events: none;
}

.ticker-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(167, 191, 224, 0.16);
  background: rgba(8, 17, 30, 0.96);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.36);
}

.ticker-option {
  width: 100%;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: transparent;
  border: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

.ticker-option:hover,
.ticker-option.is-active {
  background: rgba(93, 208, 178, 0.12);
}

.ticker-option strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.ticker-option span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-empty {
  padding: 14px;
  color: var(--muted);
}

.launch-action-row {
  display: flex;
  justify-content: flex-start;
  margin-top: -2px;
}

.launch-action-row button {
  min-width: 190px;
}

select,
input,
button {
  font: inherit;
  border-radius: 18px;
}

select,
input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(167, 191, 224, 0.16);
  background: rgba(4, 10, 19, 0.48);
  color: var(--ink);
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(93, 208, 178, 0.72);
  box-shadow: 0 0 0 4px rgba(93, 208, 178, 0.12);
}

button {
  border: 0;
  padding: 15px 22px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: #05111d;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(93, 208, 178, 0.18);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.results-panel {
  min-height: 190px;
}

.status-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-badge.idle {
  background: rgba(158, 176, 200, 0.12);
  color: var(--muted);
}

.status-badge.working {
  background: rgba(242, 183, 102, 0.14);
  color: var(--warning);
}

.status-badge.saved,
.status-badge.cached {
  background: rgba(93, 208, 178, 0.14);
  color: var(--accent);
}

.status-badge.error {
  background: rgba(255, 124, 124, 0.14);
  color: var(--error);
}

.message {
  margin-top: 16px;
  font-size: 1.06rem;
  line-height: 1.55;
}

.stage-kicker {
  margin-bottom: 8px;
}

.detail-text,
.folder {
  margin-top: 10px;
  line-height: 1.5;
}

.report-link-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.report-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.report-link:hover {
  color: #85e4cd;
}

.cta-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(93, 208, 178, 0.28);
  background: linear-gradient(180deg, rgba(93, 208, 178, 0.16), rgba(93, 208, 178, 0.08));
  box-shadow: 0 14px 30px rgba(11, 28, 42, 0.24);
}

.cta-link::after {
  content: "↗";
  font-size: 0.95rem;
  opacity: 0.9;
}

.cta-link:hover {
  color: #b6f4e6;
  border-color: rgba(133, 228, 205, 0.44);
  background: linear-gradient(180deg, rgba(93, 208, 178, 0.24), rgba(93, 208, 178, 0.12));
}

.hidden {
  display: none;
}

.graph-toolbar,
.timeline-toolbar {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.graph-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-button {
  min-width: 52px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid rgba(167, 191, 224, 0.16);
  box-shadow: none;
}

.zoom-button:hover {
  box-shadow: none;
  background: rgba(93, 208, 178, 0.12);
}

.filter-pill {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.filter-pill.active,
.filter-pill:hover {
  color: var(--ink);
  border-color: rgba(93, 208, 178, 0.28);
  background: rgba(93, 208, 178, 0.12);
}

.graph-layout,
.timeline-layout {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.graph-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
}

.timeline-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  align-items: start;
}

.graph-main,
.graph-side,
.timeline-insights {
  display: grid;
  gap: 14px;
}

.graph-legend {
  color: var(--muted);
  font-size: 0.94rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-dot.company,
.node-company {
  fill: var(--company);
  background: var(--company);
}

.legend-dot.theme,
.node-theme {
  fill: var(--theme);
  background: var(--theme);
}

.legend-dot.news,
.node-news,
.node-source {
  fill: var(--news);
  background: var(--news);
}

.legend-dot.filing,
.node-filing,
.node-price {
  fill: var(--filing);
  background: var(--filing);
}

.legend-dot.agent,
.node-agent {
  fill: var(--agent);
  background: var(--agent);
}

.graph-canvas {
  overflow: auto;
  min-height: 620px;
  border-radius: 26px;
  border: 1px solid rgba(167, 191, 224, 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.72), rgba(12, 21, 38, 0.92));
  padding: 14px;
}

.graph-canvas-inner {
  width: fit-content;
  min-width: 100%;
}

.graph-canvas svg {
  display: block;
  min-width: 980px;
  height: auto;
}

.graph-zone-label {
  fill: rgba(158, 176, 200, 0.5);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.graph-edge {
  stroke: rgba(167, 191, 224, 0.16);
}

.node,
.node-group {
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, stroke-width 140ms ease;
}

.node:hover,
.node-group:hover .node {
  opacity: 0.88;
}

.node.is-selected,
.node-group.is-selected .node {
  stroke: rgba(236, 243, 255, 0.9);
  stroke-width: 3px;
}

.node.is-dimmed,
.node-group.is-dimmed {
  opacity: 0.2;
}

.node-label {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 12px;
  fill: rgba(236, 243, 255, 0.88);
}

.node-label.node-label-muted {
  fill: rgba(158, 176, 200, 0.72);
}

.stage-placeholder {
  min-height: 580px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px dashed rgba(167, 191, 224, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 1.02rem;
}

.graph-stats,
.graph-details,
.timeline-insights {
  display: grid;
  gap: 12px;
}

.graph-details-card,
.insight-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(167, 191, 224, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.graph-details-card h3 {
  margin-top: 10px;
  font-size: 1.35rem;
}

.graph-details-card p {
  margin-top: 10px;
  line-height: 1.55;
}

.timeline-feed {
  display: grid;
  gap: 16px;
}

.timeline-card,
.chat-bubble {
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(109, 145, 255, 0.05), transparent 44%);
  padding: 18px;
}

.timeline-card {
  position: relative;
}

.summary-card h3 {
  font-size: 1.18rem;
  line-height: 1.5;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.timeline-identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(93, 208, 178, 0.22), rgba(109, 145, 255, 0.22));
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.timeline-meta {
  display: grid;
  gap: 4px;
}

.timeline-meta strong {
  font-size: 1rem;
}

.timeline-handle {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-card h3 {
  margin-top: 16px;
  font-size: 1.3rem;
  line-height: 1.25;
}

.timeline-card > p {
  margin-top: 10px;
  line-height: 1.6;
}

.timeline-context {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.chip,
.event-meta span {
  font-size: 0.9rem;
}

.chip.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.metric-row,
.reaction-row,
.comment-list {
  margin-top: 14px;
}

.metric-row {
  gap: 8px;
}

.metric-item,
.reaction-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-bubble {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(167, 191, 224, 0.1);
}

.comment-bubble p {
  margin-top: 6px;
  line-height: 1.5;
}

.comment-bubble em {
  color: var(--accent);
  font-style: normal;
}

.card-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-action {
  appearance: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 191, 224, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  cursor: pointer;
}

.card-action:hover {
  background: rgba(93, 208, 178, 0.12);
  color: var(--ink);
}

.card-link {
  text-decoration: none;
}

.insight-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.insight-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.stance {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stance.up,
.stance.bullish,
.stance.post,
.stance.quote {
  background: rgba(93, 208, 178, 0.14);
  color: var(--accent);
}

.stance.down,
.stance.bearish {
  background: rgba(255, 124, 124, 0.14);
  color: var(--error);
}

.stance.range,
.stance.balanced,
.stance.mixed,
.stance.comment,
.stance.follow,
.stance.like,
.stance.repost {
  background: rgba(109, 145, 255, 0.14);
  color: var(--secondary);
}

.subdued {
  margin-top: 10px;
}

.chat-controls {
  margin-top: 12px;
}

.chat-output {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.chat-bubble.error {
  border-color: rgba(255, 124, 124, 0.22);
  color: var(--error);
}

@media (max-width: 1100px) {
  .hero-grid,
  .graph-layout,
  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .graph-canvas svg {
    min-width: 860px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    margin: 16px auto 34px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.4rem, 12vw, 3.8rem);
  }

  .controls,
  .chat-controls {
    flex-direction: column;
  }

  .launch-action-row {
    justify-content: stretch;
  }

  .launch-action-row button {
    width: 100%;
    min-width: 0;
  }

  .graph-canvas {
    min-height: 500px;
  }

  .graph-canvas svg {
    min-width: 760px;
  }

  .timeline-top,
  .timeline-identity {
    flex-direction: column;
  }
}
