@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #11140f;
  --bg-soft: #181d16;
  --panel: rgba(22, 28, 20, 0.84);
  --panel-strong: rgba(20, 25, 18, 0.96);
  --panel-weak: rgba(31, 38, 28, 0.68);
  --line: rgba(206, 228, 150, 0.14);
  --line-strong: rgba(206, 228, 150, 0.28);
  --text: #f4f5ee;
  --text-muted: #b8bba9;
  --text-faint: #7f8574;
  --accent: #c7e36b;
  --accent-soft: rgba(199, 227, 107, 0.14);
  --shadow: 0 34px 90px rgba(5, 7, 5, 0.46);
  --shadow-soft: 0 20px 60px rgba(13, 16, 12, 0.22);
  --radius-xl: 34px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --grid-gap: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% 10%, rgba(199, 227, 107, 0.14), transparent 26%),
    radial-gradient(circle at 80% 4%, rgba(199, 227, 107, 0.08), transparent 22%),
    linear-gradient(180deg, #141812 0%, #0f120e 100%);
  color: var(--text);
  font-family: "Outfit", "Aptos", "Segoe UI Variable Text", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 26%, transparent 88%);
  opacity: 0.65;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.028) 0.7px, transparent 0.7px);
  background-size: 6px 6px;
  opacity: 0.08;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

button,
input,
label {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -48px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #11140f;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  top: 14px;
}

.app-shell {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.dashboard {
  display: grid;
  gap: var(--grid-gap);
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%),
    radial-gradient(circle at top left, rgba(199, 227, 107, 0.08), transparent 34%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 22px 20px;
  margin-bottom: var(--grid-gap);
}

.brand-deck {
  max-width: 720px;
}

.topbar h1,
.hero h2,
.sidebar-section h3,
.timeline-panel h3,
.chart-panel h3,
.events-panel h3,
.insights-panel h3,
.stats-card strong,
.signal-card strong {
  margin: 0;
  font-family: "Outfit", "Segoe UI Variable Display", sans-serif;
  letter-spacing: -0.035em;
  line-height: 0.96;
}

.topbar h1 {
  margin-top: 4px;
  font-size: clamp(2.6rem, 6vw, 5rem);
  text-wrap: balance;
}

.eyebrow,
.panel-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}

.eyebrow-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.eyebrow-link:hover,
.eyebrow-link:focus-visible {
  border-color: currentColor;
  opacity: 0.92;
}

.topbar-note,
.hero-body,
.hero-support-copy {
  max-width: 60ch;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-button {
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.18), rgba(199, 227, 107, 0.08)),
    rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}

.ghost-button.small {
  min-height: 40px;
  padding: 0 14px;
}

.upload-button:hover,
.ghost-button:hover,
.dropzone:hover,
.dropzone:focus-visible,
.preset-button:hover,
.channel-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.upload-button:active,
.ghost-button:active,
.preset-button:active {
  transform: translateY(1px) scale(0.985);
}

.upload-button:focus-visible,
.ghost-button:focus-visible,
.dropzone:focus-visible,
.preset-button:focus-visible,
.search-box input:focus-visible,
.channel-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.88fr);
  gap: 26px;
  padding: 28px;
}

.hero-copy {
  padding: 8px 0 18px;
}

.hero h2 {
  margin: 12px 0 0;
  max-width: 11ch;
  font-size: clamp(2.8rem, 5vw, 4.9rem);
  text-wrap: balance;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.hero-board {
  display: grid;
  gap: 14px;
  align-content: start;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal-card,
.status-badge {
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%),
    var(--panel-weak);
  box-shadow: var(--shadow-soft);
}

.signal-card span {
  display: block;
  color: var(--text-faint);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.signal-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(199, 227, 107, 0.42);
  animation: statusPulse 2.8s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(199, 227, 107, 0.16);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(199, 227, 107, 0);
  }
}

.hero-support-copy {
  margin-top: 0;
  font-size: 0.92rem;
}

.dropzone {
  display: grid;
  align-content: end;
  min-height: 228px;
  padding: 22px;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  border: 1px solid rgba(199, 227, 107, 0.26);
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 100%),
    rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(199, 227, 107, 0.18);
  pointer-events: none;
}

.dropzone p {
  margin: 0;
  max-width: 12ch;
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}

.dropzone span {
  max-width: 32ch;
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.65;
}

.dropzone.is-dragover {
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 100%),
    rgba(255, 255, 255, 0.04);
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 18px;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
}

.status-strip[data-state="loading"] {
  border-color: rgba(199, 227, 107, 0.36);
}

.status-strip[data-state="error"] {
  border-color: rgba(255, 144, 122, 0.34);
}

.status-copy {
  display: grid;
  gap: 6px;
}

.status-actions {
  display: flex;
  justify-content: flex-end;
}

.toggle-group {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.segment-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 100%),
    rgba(8, 11, 12, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segment-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  min-width: 104px;
  padding: 10px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.segment-button:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.segment-button:active {
  transform: translateY(1px) scale(0.98);
}

.segment-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(199, 227, 107, 0.28);
}

.segment-button.is-active {
  color: #f7fbe8;
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.26), rgba(199, 227, 107, 0.1)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 30px -18px rgba(199, 227, 107, 0.72);
}

.status-detail {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.error-banner {
  grid-column: 1 / -1;
  max-width: none;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 144, 122, 0.26);
  background: rgba(255, 144, 122, 0.08);
  color: #ffd0c4;
  line-height: 1.45;
}

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

.stats-card {
  min-height: 132px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    var(--panel-strong);
}

.stats-card:nth-child(1),
.stats-card:nth-child(6) {
  grid-column: span 4;
}

.stats-card:nth-child(2),
.stats-card:nth-child(5) {
  grid-column: span 3;
}

.stats-card:nth-child(3),
.stats-card:nth-child(4) {
  grid-column: span 5;
}

.stats-card span,
.stats-card small,
.session-meta dt,
.channel-count,
.search-box span,
.event-card time,
.event-card p,
.chart-tooltip ul,
.notes-list {
  color: var(--text-muted);
}

.stats-card span,
.session-meta dt {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.stats-card strong,
.session-meta dd,
.signal-card strong {
  font-variant-numeric: tabular-nums;
}

.stats-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

.stats-card small {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
}

.window-strip {
  display: grid;
  gap: 16px;
  padding: 18px 22px 20px;
}

.window-strip-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.window-strip-header h3 {
  margin: 4px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  letter-spacing: -0.03em;
}

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

.window-card {
  min-height: 116px;
  padding: 16px 18px;
  border-radius: calc(var(--radius-lg) - 8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 100%),
    rgba(8, 11, 12, 0.82);
}

.window-card span,
.window-card small {
  display: block;
  color: var(--text-muted);
}

.window-card span {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.window-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.2rem, 2.3vw, 1.8rem);
  font-variant-numeric: tabular-nums;
}

.window-card small {
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: var(--grid-gap);
}

.sidebar {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1fr) minmax(360px, 1.18fr);
  gap: var(--grid-gap);
}

.main-pane {
  display: grid;
  gap: 18px;
}

.sidebar-section,
.timeline-panel,
.chart-panel,
.events-panel,
.insights-panel {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.session-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.session-meta div {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.session-meta dd {
  margin: 6px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.94rem;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h3 {
  margin-top: 8px;
  font-size: 1.5rem;
  text-wrap: balance;
}

.preset-grid,
.channel-list,
.event-list {
  display: grid;
  gap: 10px;
}

.preset-button,
.selected-pill {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-button strong,
.selected-pill strong,
.channel-row strong,
.event-card strong {
  display: block;
  font-weight: 600;
}

.preset-button.is-active,
.ghost-button.is-active {
  border-color: rgba(199, 227, 107, 0.24);
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.16), rgba(199, 227, 107, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.preset-button span,
.selected-pill span,
.channel-row span {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.selected-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border-color: rgba(199, 227, 107, 0.2);
}

.selected-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}

.selected-pill-copy,
.channel-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.selected-pill-copy {
  min-width: 0;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}

.confidence-verified {
  border-color: rgba(199, 227, 107, 0.22);
  background: rgba(199, 227, 107, 0.1);
  color: #eef7bf;
}

.confidence-inferred {
  border-color: rgba(255, 204, 102, 0.18);
  background: rgba(255, 204, 102, 0.08);
  color: #ffe0aa;
}

.confidence-derived {
  border-color: rgba(64, 230, 193, 0.2);
  background: rgba(64, 230, 193, 0.08);
  color: #baf7ea;
}

.confidence-unknown {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d7ddd6;
}

.selected-pill-meta {
  flex-shrink: 0;
}

.channel-list {
  max-height: min(45vh, 520px);
  overflow: auto;
  padding-right: 6px;
}

.channel-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.channel-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.channel-swatch {
  width: 8px;
  height: 38px;
  border-radius: 999px;
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-toolbar,
.chart-toolbar-group,
.toolbar-actions {
  display: flex;
  align-items: center;
}

.chart-toolbar {
  justify-content: flex-start;
  align-items: flex-end;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  gap: 16px 18px;
  margin: 0 auto 16px 0;
  padding: 10px 14px 12px;
  border-radius: calc(var(--radius-xl) - 10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
}

.chart-toolbar-group {
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-actions {
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 1px;
}

.compact-toggle {
  align-items: start;
  gap: 6px;
  justify-items: start;
}

.segment-control-compact {
  padding: 3px;
}

.segment-control-compact .segment-button {
  min-width: 84px;
  padding: 8px 14px;
}

.ghost-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

#overview-canvas {
  width: 100%;
  height: 190px;
  display: block;
  border-radius: calc(var(--radius-xl) - 10px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 100%),
    rgba(11, 14, 10, 0.34);
}

.chart-panel {
  padding-bottom: 16px;
}

.chart-scroll {
  position: relative;
  overflow: auto;
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 100%),
    rgba(8, 10, 7, 0.42);
}

#detail-chart {
  display: block;
  width: 100%;
  min-height: 320px;
}

.chart-tooltip {
  position: absolute;
  min-width: 220px;
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 13, 9, 0.94);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
}

.chart-tooltip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-tooltip b {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.chart-tooltip em {
  display: block;
  margin-top: 4px;
  color: #b8f3e1;
  font-style: normal;
  font-size: 0.8rem;
}

.cursor-readout {
  max-width: 340px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.55;
}

.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(280px, 0.84fr);
  gap: var(--grid-gap);
}

.event-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
}

.event-card.is-focused {
  border-color: rgba(199, 227, 107, 0.18);
  background:
    linear-gradient(135deg, rgba(199, 227, 107, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.03);
}

.event-card.tone-danger {
  border-color: rgba(255, 111, 124, 0.16);
}

.event-card.tone-warm {
  border-color: rgba(255, 204, 102, 0.14);
}

.event-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-card time,
.event-card p {
  font-size: 0.92rem;
}

.event-card p {
  margin: 9px 0 0;
  line-height: 1.6;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.event-chip.is-focus {
  background: rgba(199, 227, 107, 0.12);
  color: #eef7bf;
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.72;
}

.notes-list li + li {
  margin-top: 10px;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.detail-axis-text {
  fill: #aab09b;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.detail-label {
  fill: var(--text);
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.detail-grid-line {
  stroke: rgba(206, 228, 150, 0.08);
  stroke-width: 1;
}

.detail-divider {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.detail-cursor {
  stroke: rgba(199, 227, 107, 0.36);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.detail-measure {
  stroke-width: 1.4;
  stroke-dasharray: 6 5;
}

.detail-measure-a {
  stroke: rgba(107, 167, 255, 0.86);
}

.detail-measure-b {
  stroke: rgba(255, 143, 79, 0.86);
}

.detail-measure-label {
  fill: #edf4ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.detail-path {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.detail-area {
  opacity: 0.14;
}

.detail-point {
  stroke: #0f120e;
  stroke-width: 2;
}

.detail-threshold {
  stroke-width: 1.1;
  stroke-dasharray: 4 6;
}

.detail-threshold-accent {
  stroke: rgba(199, 227, 107, 0.48);
}

.detail-threshold-warm {
  stroke: rgba(255, 204, 102, 0.48);
}

.detail-threshold-danger {
  stroke: rgba(255, 111, 124, 0.48);
}

.detail-threshold-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.detail-threshold-label-accent {
  fill: #dceca5;
}

.detail-threshold-label-warm {
  fill: #ffd9a0;
}

.detail-threshold-label-danger {
  fill: #ffb0ba;
}

@media (max-width: 1240px) {
  .hero,
  .sidebar,
  .event-layout,
  .status-strip,
  .topbar {
    grid-template-columns: 1fr;
  }

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

  .stats-card:nth-child(n) {
    grid-column: span 3;
  }

  .status-actions {
    justify-content: flex-start;
  }

  .toggle-group {
    justify-items: start;
  }

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

  .chart-toolbar {
    align-items: flex-start;
    width: 100%;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 16px, 100%);
  }

  .topbar,
  .hero,
  .sidebar-section,
  .timeline-panel,
  .chart-panel,
  .events-panel,
  .insights-panel {
    padding: 18px;
  }

  .topbar-actions,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .signal-grid {
    grid-template-columns: 1fr;
  }

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

  .stats-card:nth-child(n) {
    grid-column: span 1;
  }

  .session-meta {
    grid-template-columns: 1fr;
  }

  .cursor-readout {
    max-width: none;
    text-align: left;
  }

  .chart-toolbar,
  .chart-toolbar-group,
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    padding-bottom: 0;
  }

  .selected-pill-copy,
  .channel-row-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .segment-control,
  .window-summary-grid {
    width: 100%;
  }

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

  .segment-button {
    min-width: 0;
    width: 100%;
  }

  .window-strip-header {
    align-items: start;
  }

  .window-summary-grid {
    grid-template-columns: 1fr;
  }
}
