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

:root {
  --bg: #f4f6f5;
  --bg-strong: #e9eeec;
  --surface: #ffffff;
  --surface-soft: #f9fbfa;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-panel: rgba(255, 255, 255, 0.86);
  --surface-elevated: #ffffff;
  --ink: #101411;
  --active-bg: #101411;
  --active-fg: #ffffff;
  --strong-chip-bg: #101411;
  --strong-chip-fg: #ffffff;
  --muted: #66706a;
  --faint: #98a29b;
  --line: #d9dfdb;
  --line-strong: #c3ccc7;
  --accent: #008f67;
  --accent-soft: #e6f5ef;
  --blue: #2f5cff;
  --blue-soft: #e9edff;
  --loss: #c94e49;
  --loss-soft: #f8ebe9;
  --warning: #9a6716;
  --shadow: 0 18px 50px rgba(16, 20, 17, 0.06);
  --body-bg:
    linear-gradient(180deg, rgba(244, 246, 245, 0.96), rgba(233, 238, 236, 0.96)),
    radial-gradient(circle at 18% -10%, rgba(0, 143, 103, 0.1), transparent 32%);
  --chart-card-bg:
    linear-gradient(180deg, rgba(0, 143, 103, 0.06), transparent 54%),
    repeating-linear-gradient(90deg, transparent 0, transparent 82px, rgba(217, 223, 219, 0.5) 83px);
  --trade-chart-bg:
    linear-gradient(180deg, #fbfcfb 0%, #edf4f0 100%),
    repeating-linear-gradient(0deg, transparent 0, transparent 54px, rgba(217, 223, 219, 0.6) 55px);
  --chart-title-bg: rgba(255, 255, 255, 0.78);
  --button-bg: rgba(255, 255, 255, 0.92);
  --focus-ring: rgba(16, 20, 17, 0.08);
  --tv-chart-bg: #f8fbf9;
  --tv-chart-text: #53615a;
  --tv-chart-grid: rgba(217, 223, 219, 0.65);
  --tv-chart-border: #d7ded9;
  --equity-area-top: rgba(0, 143, 103, 0.22);
  --equity-area-bottom: rgba(0, 143, 103, 0.02);
  --theme-ease: 360ms cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #080b0a;
  --bg-strong: #111713;
  --surface: #111613;
  --surface-soft: #151d18;
  --surface-glass: rgba(17, 22, 19, 0.74);
  --surface-panel: rgba(17, 22, 19, 0.9);
  --surface-elevated: #151d18;
  --ink: #f3f7f4;
  --active-bg: #f3f7f4;
  --active-fg: #0b100d;
  --strong-chip-bg: #15231d;
  --strong-chip-fg: #edf8f2;
  --muted: #a0aaa4;
  --faint: #748078;
  --line: #27322c;
  --line-strong: #3a473f;
  --accent: #26d39b;
  --accent-soft: rgba(38, 211, 155, 0.13);
  --blue: #8aa2ff;
  --blue-soft: rgba(138, 162, 255, 0.14);
  --loss: #ff7c75;
  --loss-soft: rgba(255, 124, 117, 0.12);
  --warning: #d8a13d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --body-bg:
    linear-gradient(180deg, rgba(8, 11, 10, 0.98), rgba(13, 19, 16, 0.98)),
    radial-gradient(circle at 18% -10%, rgba(38, 211, 155, 0.12), transparent 34%);
  --chart-card-bg:
    linear-gradient(180deg, rgba(38, 211, 155, 0.07), transparent 58%),
    repeating-linear-gradient(90deg, transparent 0, transparent 82px, rgba(58, 71, 63, 0.36) 83px);
  --trade-chart-bg:
    linear-gradient(180deg, #121915 0%, #0d1310 100%),
    repeating-linear-gradient(0deg, transparent 0, transparent 54px, rgba(58, 71, 63, 0.42) 55px);
  --chart-title-bg: rgba(17, 22, 19, 0.82);
  --button-bg: rgba(17, 22, 19, 0.9);
  --focus-ring: rgba(38, 211, 155, 0.16);
  --tv-chart-bg: #0f1512;
  --tv-chart-text: #a0aaa4;
  --tv-chart-grid: rgba(58, 71, 63, 0.5);
  --tv-chart-border: #2d3932;
  --equity-area-top: rgba(38, 211, 155, 0.22);
  --equity-area-bottom: rgba(38, 211, 155, 0.02);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  transition: background var(--theme-ease), color var(--theme-ease);
}

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

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 166px;
}

.brand-logo {
  width: 122px;
  height: 38px;
  display: block;
  background-image: url("/assets/skew-logo-light.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  flex: 0 0 auto;
  transition: opacity var(--theme-ease);
}

:root[data-theme="dark"] .brand-logo {
  background-image: url("/assets/skew-logo-dark.png");
}

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

.nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: var(--surface-glass);
  transition: background-color var(--theme-ease), border-color var(--theme-ease);
}

.nav a {
  height: 34px;
  min-width: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.nav a.active {
  background: var(--active-bg);
  color: var(--active-fg);
}

.top-actions {
  min-width: 166px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.theme-toggle {
  width: 58px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-glass);
  color: var(--ink);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background-color var(--theme-ease), border-color var(--theme-ease), box-shadow var(--theme-ease);
}

.theme-toggle-track {
  width: 46px;
  height: 22px;
  position: relative;
  display: block;
}

.theme-toggle-thumb {
  position: absolute;
  z-index: 2;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--active-bg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: transform var(--theme-ease), background-color var(--theme-ease);
}

:root[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(24px);
}

.theme-icon {
  position: absolute;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.62;
  transition: opacity var(--theme-ease), transform var(--theme-ease), border-color var(--theme-ease), background-color var(--theme-ease);
}

.theme-icon-sun {
  left: 5px;
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(154, 103, 22, 0.13);
}

.theme-icon-moon {
  right: 5px;
  border: 2px solid var(--muted);
  background: transparent;
}

:root[data-theme="dark"] .theme-icon-sun {
  opacity: 0.32;
  transform: scale(0.82);
}

:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0.92;
  border-color: var(--accent);
}

.live-chip,
.badge,
.control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-glass);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color var(--theme-ease), border-color var(--theme-ease), color var(--theme-ease);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(0, 143, 103, 0.12);
}

.live-dot.stale {
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(154, 103, 22, 0.12);
}

.app {
  flex: 1;
  padding: 28px 0 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 56px;
  align-items: end;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: var(--ink);
}

.hero h1,
.page-title h1 {
  margin: 0;
  max-width: 790px;
  font-size: 76px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  margin: 22px 0 0;
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.radar-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-top: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.radar-cta .eyebrow {
  margin-bottom: 12px;
}

.radar-cta h2 {
  margin: 0;
  max-width: 720px;
  font-size: 31px;
  line-height: 1.05;
  font-weight: 800;
}

.radar-cta p {
  margin: 12px 0 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.radar-cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-card,
.panel {
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background-color var(--theme-ease), border-color var(--theme-ease), box-shadow var(--theme-ease);
}

.summary-card {
  padding: 17px;
}

.summary-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 750;
}

.big-number {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.metric-value {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
}

.positive {
  color: var(--accent);
}

.negative {
  color: var(--loss);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.85fr);
  gap: 18px;
  margin-top: 20px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.chart-card {
  height: 348px;
  position: relative;
  overflow: hidden;
  background: var(--chart-card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.equity-chart {
  width: 100%;
  height: 100%;
  position: relative;
}

.equity-chart .chart-empty {
  min-height: 100%;
}

.equity-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  pointer-events: none;
  opacity: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: var(--shadow);
  transition: opacity 0.12s ease;
}

.equity-tooltip.visible {
  opacity: 1;
}

.equity-tooltip strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.2;
}

.equity-tooltip span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.chart-reset {
  cursor: pointer;
}

.chart-reset:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.chart-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.badge.dark {
  background: var(--strong-chip-bg);
  border-color: var(--strong-chip-bg);
  color: var(--strong-chip-fg);
}

.route-list,
.method-list {
  display: grid;
  gap: 0;
}

.route-row,
.method-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.route-row:last-child,
.method-row:last-child {
  border-bottom: 0;
}

.route-title,
.method-title {
  font-weight: 800;
}

.route-copy,
.method-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.round-action {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-elevated);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: 0 0 auto;
}

.trade-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.trade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 680px;
}

.trade-table.compact {
  min-width: 0;
  table-layout: fixed;
}

.trade-table.compact th,
.trade-table.compact td {
  padding-right: 10px;
}

.trade-table.compact th:nth-child(1),
.trade-table.compact td:nth-child(1) {
  width: 36%;
}

.trade-table.compact th:nth-child(2),
.trade-table.compact td:nth-child(2) {
  width: 20%;
}

.trade-table.compact th:nth-child(3),
.trade-table.compact td:nth-child(3) {
  width: 26%;
  text-align: right;
}

.trade-table.compact th:nth-child(4),
.trade-table.compact td:nth-child(4) {
  width: 18%;
  text-align: right;
  padding-right: 0;
}

.trade-table.compact td:first-child a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-table th {
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--line);
}

.trade-table td {
  padding: 14px 14px 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.trade-table tr:last-child td {
  border-bottom: 0;
}

.trade-table a {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

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

.side-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 64px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  font-size: 12px;
  font-weight: 800;
}

.side-pill.long {
  color: var(--accent);
  background: var(--accent-soft);
}

.side-pill.short {
  color: var(--blue);
  background: var(--blue-soft);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 150px;
  gap: 10px;
  margin-bottom: 16px;
}

.field {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field:focus,
.nav a:focus-visible,
.round-action:focus-visible,
.tv-button:focus-visible,
.chart-reset:focus-visible,
.load-more:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.load-more {
  width: 100%;
  height: 42px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.page-title {
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.legal-title h1 {
  max-width: 980px;
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.legal-aside {
  position: sticky;
  top: 18px;
}

.legal-document {
  padding: 28px;
}

.legal-section {
  padding: 0 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.legal-section:last-of-type {
  margin-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.25;
}

.legal-section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.legal-section p + p {
  margin-top: 10px;
}

.legal-callout {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.legal-callout strong {
  font-size: 14px;
}

.legal-callout span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.deal-preview {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.deal-preview-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.deal-title h1 {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.deal-preview-title {
  align-items: center;
}

.deal-preview-title h3 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
}

.deal-preview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.deal-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.deal-stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.deal-stat strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.deal-price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
}

.deal-price-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 18px;
}

.kv-list {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.kv-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  font-size: 14px;
}

.kv-row span:first-child {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.trade-chart {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--trade-chart-bg);
  position: relative;
  overflow: hidden;
}

.deal-preview-chart {
  min-height: 292px;
}

.deal-preview-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.deal-chart-placeholder {
  min-height: 292px;
  height: 100%;
  padding: 74px 22px 22px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.deal-chart-placeholder strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 5px;
}

.deal-chart-placeholder span {
  display: block;
  max-width: 330px;
  font-size: 13px;
  line-height: 1.45;
}

.placeholder-bars {
  width: min(320px, 86%);
  height: 96px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  opacity: 0.78;
}

.placeholder-bars span {
  width: 14px;
  height: var(--h);
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}

.placeholder-bars span:nth-child(even) {
  background: linear-gradient(180deg, var(--loss), color-mix(in srgb, var(--loss) 28%, transparent));
}

.chart-head {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  pointer-events: none;
}

.chart-title {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  background: var(--chart-title-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.chart-title strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 2px;
}

.tv-button {
  pointer-events: auto;
  height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
  font-size: 13px;
}

.chart-actions {
  pointer-events: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tv-button.primary {
  background: var(--active-bg);
  color: var(--active-fg);
}

.tv-test-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.tv-test-panel {
  min-height: 620px;
}

.tv-exact-chart {
  height: 520px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--tv-chart-bg);
}

.tv-test-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chart-marker {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 12px;
}

.state-block {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.state-block p {
  margin: 12px 0 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.footer {
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.footer > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--ink);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--accent);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .shell {
    width: min(100% - 28px, 1240px);
  }

  .topbar {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .brand {
    min-width: auto;
  }

  .top-actions {
    order: 3;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .live-chip {
    flex: 1;
    justify-content: center;
  }

  .hero,
  .layout,
  .radar-cta,
  .legal-grid,
  .deal-preview,
  .deal-grid,
  .tv-test-grid {
    grid-template-columns: 1fr;
  }

  .legal-aside {
    position: static;
  }

  .radar-cta-actions {
    justify-content: flex-start;
  }

  .hero h1,
  .page-title h1 {
    font-size: 54px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1240px);
  }

  .nav {
    width: 100%;
    order: 2;
  }

  .nav a {
    min-width: 0;
    flex: 1;
  }

  .hero {
    padding-top: 22px;
    gap: 28px;
  }

  .hero h1,
  .page-title h1 {
    font-size: 41px;
    line-height: 0.94;
  }

  .hero p,
  .page-title p {
    font-size: 16px;
  }

  .radar-cta {
    align-items: start;
    gap: 16px;
  }

  .radar-cta h2 {
    font-size: 25px;
  }

  .radar-cta-actions .tv-button {
    flex: 1 1 150px;
    justify-content: center;
  }

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

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

  .panel,
  .summary-card {
    padding: 14px;
  }

  .legal-document {
    padding: 18px;
  }

  .legal-section h2 {
    font-size: 17px;
  }

  .chart-card {
    height: 292px;
  }

  .trade-chart {
    min-height: 330px;
  }

  .deal-preview-chart,
  .deal-chart-placeholder {
    min-height: 250px;
  }

  .deal-preview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .deal-actions .tv-button {
    flex: 1 1 140px;
    justify-content: center;
  }

  .chart-head {
    position: static;
    padding: 12px;
    background: var(--chart-title-bg);
  }

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

  .tv-exact-chart {
    height: 430px;
    min-height: 430px;
  }

  .kv-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .trade-table-wrap {
    overflow-x: visible;
  }

  .trade-table:not(.compact) {
    min-width: 0;
    display: block;
  }

  .trade-table:not(.compact) thead {
    display: none;
  }

  .trade-table:not(.compact) tbody {
    display: grid;
    gap: 10px;
  }

  .trade-table:not(.compact) tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-elevated);
  }

  .trade-table:not(.compact) td {
    border: 0;
    padding: 0;
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .trade-table:not(.compact) td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .trade-table:not(.compact) td:first-child,
  .trade-table:not(.compact) td:last-child {
    grid-column: 1 / -1;
  }

  .footer {
    display: grid;
    align-content: center;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
