:root {
  color-scheme: dark;
  --bg: #080a0d;
  --rail: #0d1117;
  --panel: #111821;
  --panel-2: #151e29;
  --soft: rgba(255, 255, 255, 0.035);
  --line: #263241;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f3f6fa;
  --muted: #9aa7b7;
  --faint: #687586;
  --blue: #59b8ff;
  --green: #62d493;
  --yellow: #ffd166;
  --orange: #ff9f43;
  --red: #ff6258;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 45% -10%, rgba(89, 184, 255, 0.12), transparent 30rem),
    linear-gradient(180deg, #0b0f14 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 28px;
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(89, 184, 255, 0.65);
  background:
    linear-gradient(135deg, rgba(89, 184, 255, 0.34), transparent 48%),
    #121b26;
}

.nav-group {
  display: grid;
  gap: 3px;
  margin-bottom: 22px;
}

.nav-group a {
  padding: 10px 11px;
  color: var(--muted);
  font-size: 13px;
}

.nav-group a:hover,
.nav-group .active {
  color: var(--text);
  background: var(--soft);
}

.sidebar-card,
.tracked-list {
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-card {
  margin-bottom: 18px;
}

.sidebar-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--orange);
  font-size: 18px;
}

.sidebar-card p,
.tracked-list a {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tracked-list h2 {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tracked-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--blue);
}

.dot.red {
  background: var(--red);
}

.dot.orange {
  background: var(--orange);
}

.dot.yellow {
  background: var(--yellow);
}

.dashboard {
  min-width: 0;
  padding: 18px 22px 44px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin-bottom: 22px;
}

.ask-box {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.ask-box span {
  padding-left: 14px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ask-box input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.snapshot-meta {
  min-width: 188px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  text-align: right;
}

.snapshot-meta span {
  display: block;
  color: var(--faint);
  font-size: 11px;
}

.snapshot-meta strong {
  font-size: 14px;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
}

.page-title p:first-child,
.panel-heading p,
.section-header p {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(34px, 4.5vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

.page-title > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-strip article,
.briefing-panel,
.watch-panel,
.signals-section,
.feed-panel,
.methodology {
  border: 1px solid var(--line);
  background: rgba(17, 24, 33, 0.9);
}

.metric-strip article {
  padding: 14px;
}

.metric-strip span {
  display: block;
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-strip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 20px;
}

.metric-strip small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  margin-bottom: 18px;
}

.briefing-panel,
.watch-panel,
.signals-section,
.feed-panel,
.methodology {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.section-header h2 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.1;
}

.briefing-panel p {
  max-width: 900px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.66;
}

.briefing-panel p:last-child {
  margin-bottom: 0;
}

.watch-panel ul,
.feed-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.watch-panel li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.watch-panel strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.watch-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.signals-section {
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-header > span {
  color: var(--faint);
  font-size: 12px;
}

.signals-table {
  display: grid;
  border: 1px solid var(--line);
}

.signal-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 140px 92px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.signal-row:last-child {
  border-bottom: 0;
}

.rank {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.signal-row h3 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.28;
}

.signal-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.signal-row > span:not(.rank) {
  color: var(--muted);
  font-size: 12px;
}

.signal-row strong {
  justify-self: start;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signal-row.red strong {
  color: var(--red);
  border-color: rgba(255, 98, 88, 0.4);
  background: rgba(255, 98, 88, 0.08);
}

.signal-row.orange strong {
  color: var(--orange);
  border-color: rgba(255, 159, 67, 0.4);
  background: rgba(255, 159, 67, 0.08);
}

.signal-row.yellow strong {
  color: var(--yellow);
  border-color: rgba(255, 209, 102, 0.36);
  background: rgba(255, 209, 102, 0.07);
}

.signal-row details {
  margin-top: 10px;
}

.signal-row summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
}

.signal-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.signal-fact,
.evidence-links {
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.signal-fact span {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 1 / -1;
}

.evidence-links a,
.evidence-links span {
  padding: 6px 8px;
  border: 1px solid rgba(89, 184, 255, 0.25);
  color: #bde5ff;
  background: rgba(89, 184, 255, 0.07);
  font-size: 12px;
}

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

.feed-list li {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.feed-list strong {
  font-size: 13px;
}

.feed-list span {
  color: var(--muted);
  font-size: 13px;
}

.methodology dl {
  display: grid;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.methodology dl div {
  padding: 12px;
  background: rgba(8, 10, 13, 0.55);
}

.methodology dt {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 760;
}

.methodology dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.method-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group,
  .tracked-list {
    display: none;
  }

  .page-title,
  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .dashboard {
    padding: 14px 12px 36px;
  }

  .topbar,
  .ask-box,
  .metric-strip,
  .signal-row,
  .feed-list li,
  .signal-details {
    grid-template-columns: 1fr;
  }

  .snapshot-meta {
    text-align: left;
  }

  .signal-row {
    align-items: start;
  }
}
