:root {
  --bg: #070b12;
  --surface: #0e1624;
  --surface-soft: #121c2b;
  --surface-dark: #050914;
  --text-primary: #e5edf8;
  --text-secondary: #a9b6c8;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.13);
  --bull: #34d399;
  --bull-soft: rgba(52, 211, 153, 0.13);
  --bear: #fb7185;
  --bear-soft: rgba(251, 113, 133, 0.13);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --neutral: #94a3b8;
  --neutral-soft: rgba(148, 163, 184, 0.12);
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --shadow-card: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.22);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border);
  --navy: var(--surface-dark);
  --blue: var(--accent);
  --ok: var(--bull);
  --ok-bg: var(--bull-soft);
  --warn: var(--warning);
  --warn-bg: var(--warning-soft);
  --danger: var(--bear);
  --danger-bg: var(--bear-soft);
  --info: var(--cyan);
  --info-bg: rgba(34, 211, 238, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% -10%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(8, 145, 178, 0.12), transparent 30%),
    var(--bg);
  color: var(--text-primary);
  font-family: Inter, "Geist", "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

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

.numeric,
.price,
.timestamp,
.metric-value,
.pnl,
td[data-numeric="true"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.code-label {
  display: inline-block;
  margin-top: 3px;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 12px 24px;
  background: rgba(7, 11, 18, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.15;
}

.brand-lockup,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: var(--surface-dark);
  background-image: url("/assets/prism-insights-logo.png");
  background-repeat: no-repeat;
  background-position: center 38%;
  background-size: 205%;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.04);
}

.brand-mark.large {
  width: 62px;
  height: 62px;
  background-size: 205%;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

button {
  min-height: 36px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 7px;
  padding: 7px 14px;
  color: white;
  background: #0f172a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
  background: #17233a;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.layout {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 22px 24px 52px;
}

.dashboard-zone {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.dashboard-zone:first-child {
  margin-top: 0;
}

.zone-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.zone-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 780;
  line-height: 1.2;
}

.zone-heading > span {
  color: var(--text-muted);
  font-size: 13px;
}

.command-grid,
.content-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-items: start;
}

.command-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(300px, 0.8fr) minmax(0, 1.1fr);
  align-items: stretch;
}

.content-grid.wide-left,
.wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.review-zone .content-grid.wide-left {
  grid-template-columns: minmax(0, 1fr);
}

.panel,
.status-panel,
.brain-panel,
.market-section {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

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

.section-title h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 760;
  line-height: 1.25;
}

.section-title span {
  color: var(--text-muted);
  font-size: 13px;
}

.card-dark,
.status-panel {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(96, 165, 250, 0.08)),
    var(--surface-dark);
}

.status-panel .eyebrow,
.status-panel .lead-note,
.status-panel small,
.status-panel .section-title span {
  color: rgba(226, 232, 240, 0.75);
}

.status-panel h2 {
  margin-bottom: 0;
  color: var(--text-primary);
  font-size: 46px;
  font-weight: 780;
  line-height: 1;
}

.lead-note {
  margin: 0 0 16px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.badge.ok {
  color: var(--bull);
  background: var(--bull-soft);
  border-color: rgba(5, 150, 105, 0.14);
}

.badge.warn {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(217, 119, 6, 0.16);
}

.badge.danger {
  color: var(--bear);
  background: var(--bear-soft);
  border-color: rgba(220, 38, 38, 0.16);
}

.badge.info {
  color: var(--cyan);
  background: var(--info-bg);
  border-color: rgba(8, 145, 178, 0.16);
}

.badge.muted {
  color: var(--neutral);
  background: var(--neutral-soft);
  border-color: rgba(100, 116, 139, 0.12);
}

.service-lights,
.score-grid,
.mini-grid,
.paper-grid,
.asset-metrics,
.research-head,
.debug-grid,
.command-cards {
  display: grid;
  gap: 10px;
}

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

.service-light {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.08);
}

.service-light i {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--bull);
}

.service-light i.warn,
.service-light i.info {
  background: var(--warning);
}

.service-light i.danger {
  background: #ef4444;
}

.service-light strong,
.service-light span,
.service-light small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-light span {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.15;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.warning-item,
.empty.slim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--surface-soft);
}

.status-panel .empty.slim,
.status-panel .warning-item {
  color: rgba(226, 232, 240, 0.82);
  background: rgba(148, 163, 184, 0.1);
}

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

.command-card,
.mini-metric,
.stat-card,
.key-level {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.command-card span,
.mini-metric span,
.stat-card > span,
.key-level span,
.kv span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 730;
}

.command-card strong,
.mini-metric strong,
.stat-card strong,
.key-level strong,
.kv strong {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 780;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.command-card small,
.mini-metric small,
.stat-card small,
.key-level small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.command-card.ok strong,
.stat-card.ok strong,
.key-level.primary strong {
  color: var(--bull);
}

.command-card.warn strong,
.stat-card.warn strong {
  color: var(--warning);
}

.command-card.danger strong,
.stat-card.danger strong {
  color: var(--bear);
}

.command-card.muted strong,
.stat-card.muted strong {
  color: var(--neutral);
}

.stale-level {
  border-style: dashed;
  background: rgba(245, 158, 11, 0.08);
}

.stale-level strong {
  color: var(--warning);
}

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

.paper-grid,
.research-head {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.brain-panel {
  display: grid;
  align-content: start;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ai-main {
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.insight-list ul,
.event-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-primary);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.insight-list li {
  margin-bottom: 6px;
}

.ai-details {
  margin-top: 4px;
}

.ai-details summary {
  width: fit-content;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.ai-details ul {
  margin-top: 8px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.asset-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.asset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.asset-head > div {
  min-width: 0;
}

.asset-head h3 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 780;
  line-height: 1.1;
}

.asset-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.asset-summary {
  margin: 14px 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.stance-compass {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.compass-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.compass-scale span:nth-child(2) {
  text-align: center;
}

.compass-scale span:nth-child(3) {
  text-align: right;
}

.compass-arc {
  position: relative;
  width: min(100%, 330px);
  height: 96px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(circle at 50% 100%, var(--surface) 0 34px, transparent 35px),
    conic-gradient(from 270deg at 50% 100%,
      rgba(220, 38, 38, 0.24) 0deg 42deg,
      rgba(217, 119, 6, 0.18) 42deg 72deg,
      rgba(100, 116, 139, 0.2) 72deg 108deg,
      rgba(5, 150, 105, 0.18) 108deg 138deg,
      rgba(5, 150, 105, 0.3) 138deg 180deg);
}

.compass-arc::after {
  content: "";
  position: absolute;
  inset: 10px 10px 0;
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.compass-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 84px;
  border-radius: 999px;
  background: #dbeafe;
  transform: translateX(-50%) rotate(var(--needle-angle));
  transform-origin: 50% 100%;
  box-shadow: 0 2px 10px rgba(96, 165, 250, 0.28);
}

.compass-arc b {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: #dbeafe;
  transform: translateX(-50%);
}

.stance-readout {
  display: grid;
  gap: 3px;
  text-align: center;
}

.stance-readout strong {
  font-size: 21px;
  font-weight: 780;
  line-height: 1.2;
}

.stance-readout span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.stance-compass.ok .stance-readout strong {
  color: var(--bull);
}

.stance-compass.danger .stance-readout strong {
  color: var(--bear);
}

.stance-compass.info .stance-readout strong,
.stance-compass.muted .stance-readout strong {
  color: var(--cyan);
}

.key-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.range-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.range-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 80px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.2), rgba(8, 145, 178, 0.2), rgba(5, 150, 105, 0.24));
}

.range-track i {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: #dbeafe;
}

.range-line.stale .range-track {
  background: repeating-linear-gradient(
    90deg,
    rgba(100, 116, 139, 0.16) 0,
    rgba(100, 116, 139, 0.16) 8px,
    rgba(100, 116, 139, 0.07) 8px,
    rgba(100, 116, 139, 0.07) 16px
  );
}

.tag-row,
.dimension-row,
.reaction-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row,
.dimension-row {
  margin-top: 12px;
}

.paper-panel,
.research-panel,
.research-progress,
.digest-list,
.brief-list,
.review-panel {
  display: grid;
  gap: 12px;
}

.timeline-list {
  gap: 0;
}

.brief-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.brief-item:last-child {
  border-bottom: 0;
}

.brief-item span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 780;
}

.brief-item p,
.digest-item p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.feed-card,
.digest-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.digest-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.digest-item small {
  display: block;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.impact-tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 760;
}

.reaction-chips {
  margin-top: 10px;
}

.reaction-chip {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.reaction-chip.ok {
  color: var(--bull);
  background: var(--bull-soft);
}

.reaction-chip.danger {
  color: var(--bear);
  background: var(--bear-soft);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(96, 165, 250, 0.06);
}

.text-right {
  text-align: right;
}

.reason-cell {
  max-width: 320px;
  white-space: normal;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chip-groups {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.chip-groups > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip-groups strong {
  margin-right: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.chip-groups span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--neutral-soft);
  font-size: 12px;
  font-weight: 700;
}

.progress-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.progress-label strong {
  font-size: 13px;
}

.progress-label span {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--purple));
}

.research-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

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

.research-title strong {
  display: block;
  font-size: 15px;
}

.research-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.execution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.execution-grid h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 15px;
}

.run-event-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.run-event-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.run-event-list span {
  color: var(--text-secondary);
  font-size: 12px;
}

.empty,
.empty-state {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--surface-soft);
}

.empty-state strong {
  color: var(--text-primary);
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.kv:last-child {
  border-bottom: 0;
}

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

.review-block {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
}

.review-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.review-main {
  display: grid;
  gap: 4px;
  padding: 8px 0;
}

.review-main strong {
  font-size: 14px;
}

.review-main span {
  color: var(--text-secondary);
  font-size: 12px;
}

.compact-list,
.source-review-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: grid;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.compact-list b {
  display: grid;
  gap: 2px;
  font-size: 12px;
}

.compact-list span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.manual-feed {
  display: grid;
  gap: 8px;
}

.manual-feed article {
  display: grid;
  gap: 4px;
  max-height: 96px;
  overflow: hidden;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.manual-feed b {
  color: var(--accent);
  font-size: 12px;
}

.manual-feed span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.source-summary .kv {
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.source-review-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.source-review-list strong,
.source-review-list span,
.source-review-list small {
  min-width: 0;
}

.source-review-list span,
.source-review-list small {
  color: var(--text-secondary);
  font-size: 12px;
}

.source-review-list small {
  grid-column: 1 / -1;
  line-height: 1.45;
}

.ok {
  color: var(--bull);
}

.warn {
  color: var(--warning);
}

.danger {
  color: var(--bear);
}

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

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 80% 30%, rgba(124, 58, 237, 0.14), transparent 28%),
    linear-gradient(135deg, #020617 0%, #07111f 45%, #0f172a 100%);
}

.login-stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.8) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 42%, black, transparent 74%);
}

.login-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image: radial-gradient(circle, rgba(226, 232, 240, 0.22) 0 1px, transparent 1px);
  background-size: 7px 7px;
}

.prism-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(980px, 120vw);
  height: auto;
  transform: translate(-58%, -54%);
  opacity: 0.84;
}

.prism-core {
  opacity: 0;
  transform-origin: 430px 310px;
  animation: prismEnter 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards, prismBreathe 8s ease-in-out 1.5s infinite;
}

.prism-core polygon,
.prism-core polyline,
.prism-core line {
  stroke: rgba(148, 163, 184, 0.38);
  stroke-width: 1.2;
}

.data-lines path {
  fill: none;
  stroke: rgba(56, 189, 248, 0.34);
  stroke-width: 1;
  stroke-dasharray: 9 18;
  stroke-dashoffset: 90;
  opacity: 0;
  animation: dataFlow 5.8s linear infinite, lineReveal 1.5s ease forwards;
}

.data-lines path:nth-child(2) {
  animation-delay: 0.08s, 0.34s;
}

.data-lines path:nth-child(3) {
  animation-delay: 0.18s, 0.42s;
}

.data-lines path:nth-child(4) {
  animation-delay: 0.28s, 0.5s;
}

.data-lines path:nth-child(5) {
  animation-delay: 0.38s, 0.58s;
}

.refracted-beams {
  opacity: 0;
  animation: beamReveal 1.5s ease 0.8s forwards, beamPulse 7s ease-in-out 1.5s infinite;
}

.beam {
  fill: none;
  stroke-linecap: round;
  stroke-width: 9;
  filter: blur(8px);
}

.beam.cyan {
  stroke: rgba(34, 211, 238, 0.18);
}

.beam.blue {
  stroke: rgba(59, 130, 246, 0.16);
}

.beam.violet {
  stroke: rgba(139, 92, 246, 0.14);
}

.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle-field i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.44);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
  animation: particleDrift 8s ease-in-out infinite;
}

.particle-field i:nth-child(1) { left: 8%; top: 16%; animation-delay: -1.1s; }
.particle-field i:nth-child(2) { left: 14%; top: 72%; width: 1px; height: 1px; animation-delay: -4.2s; }
.particle-field i:nth-child(3) { left: 21%; top: 42%; animation-delay: -2.6s; }
.particle-field i:nth-child(4) { left: 27%; top: 18%; width: 3px; height: 3px; animation-delay: -5.5s; }
.particle-field i:nth-child(5) { left: 33%; top: 82%; animation-delay: -6.2s; }
.particle-field i:nth-child(6) { left: 39%; top: 31%; width: 1px; height: 1px; animation-delay: -1.8s; }
.particle-field i:nth-child(7) { left: 45%; top: 66%; animation-delay: -3.4s; }
.particle-field i:nth-child(8) { left: 52%; top: 12%; animation-delay: -7.1s; }
.particle-field i:nth-child(9) { left: 58%; top: 47%; width: 3px; height: 3px; animation-delay: -2.2s; }
.particle-field i:nth-child(10) { left: 64%; top: 74%; animation-delay: -5.8s; }
.particle-field i:nth-child(11) { left: 71%; top: 22%; width: 1px; height: 1px; animation-delay: -3.8s; }
.particle-field i:nth-child(12) { left: 77%; top: 58%; animation-delay: -6.7s; }
.particle-field i:nth-child(13) { left: 84%; top: 35%; animation-delay: -0.8s; }
.particle-field i:nth-child(14) { left: 91%; top: 78%; width: 1px; height: 1px; animation-delay: -4.7s; }
.particle-field i:nth-child(15) { left: 18%; top: 27%; background: rgba(148, 163, 184, 0.38); animation-delay: -8.3s; }
.particle-field i:nth-child(16) { left: 47%; top: 89%; background: rgba(148, 163, 184, 0.32); animation-delay: -2.9s; }
.particle-field i:nth-child(17) { left: 68%; top: 8%; background: rgba(148, 163, 184, 0.36); animation-delay: -1.6s; }
.particle-field i:nth-child(18) { left: 88%; top: 48%; background: rgba(148, 163, 184, 0.32); animation-delay: -6.9s; }
.particle-field i:nth-child(19) { left: 6%; top: 54%; animation-delay: -3.2s; }
.particle-field i:nth-child(20) { left: 30%; top: 6%; width: 1px; height: 1px; animation-delay: -5.1s; }
.particle-field i:nth-child(21) { left: 55%; top: 28%; animation-delay: -4.4s; }
.particle-field i:nth-child(22) { left: 73%; top: 88%; width: 3px; height: 3px; animation-delay: -7.6s; }
.particle-field i:nth-child(23) { left: 94%; top: 14%; animation-delay: -2.4s; }
.particle-field i:nth-child(24) { left: 11%; top: 91%; background: rgba(148, 163, 184, 0.34); animation-delay: -6.1s; }

.login-shell {
  width: min(420px, calc(100% - 32px));
  position: relative;
  z-index: 1;
}

.login-panel {
  padding: 30px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  animation: cardEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

.login-brand-block {
  display: grid;
  justify-items: center;
  text-align: center;
  animation: formItemEnter 0.5s ease 1.18s both;
}

.login-logo {
  display: block;
  width: min(340px, 100%);
  height: auto;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  animation: logoFade 0.7s ease 1.12s both;
}

.login-brand-block p {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-brand-block h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.25;
  animation: titleShimmer 1.05s ease 1.2s both;
}

.login-brand-block span {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 14px;
  animation: formItemEnter 0.44s ease both;
}

.login-form label:nth-child(1) {
  animation-delay: 1.24s;
}

.login-form label:nth-child(2) {
  animation-delay: 1.32s;
}

.login-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.login-form input:hover,
.login-form input:focus {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
  background: rgba(15, 23, 42, 0.92);
}

.login-form input:focus {
  outline: none;
}

.login-form button {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  border-color: rgba(96, 165, 250, 0.34);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
  animation: formItemEnter 0.44s ease 1.4s both;
}

.login-form button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-130%);
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.22), transparent);
  transition: transform 480ms ease;
}

.login-form button:hover::after {
  transform: translateX(130%);
}

.login-form button:active {
  transform: scale(0.98);
}

.login-error {
  display: none;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: var(--radius-md);
  color: var(--bear);
  background: rgba(127, 29, 29, 0.16);
  font-size: 14px;
}

.login-panel.has-error .login-error {
  animation: errorShake 360ms ease both;
}

.login-footnote {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  animation: formItemEnter 0.44s ease 1.46s both;
}

@keyframes prismEnter {
  0% { opacity: 0; transform: scale(0.985); }
  100% { opacity: 0.78; transform: scale(1); }
}

@keyframes prismBreathe {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.025); }
}

@keyframes lineReveal {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes dataFlow {
  to { stroke-dashoffset: -90; }
}

@keyframes beamReveal {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes beamPulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}

@keyframes particleDrift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.2; }
  50% { transform: translate3d(10px, -18px, 0); opacity: 0.72; }
}

@keyframes cardEnter {
  0% { opacity: 0; transform: translateY(18px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logoFade {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes formItemEnter {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes titleShimmer {
  0% { color: var(--text-secondary); text-shadow: none; }
  55% { color: #f8fafc; text-shadow: 0 0 20px rgba(96, 165, 250, 0.2); }
  100% { color: var(--text-primary); text-shadow: none; }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@media (max-width: 1279px) {
  .command-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  }

  .brief-panel {
    grid-column: 1 / -1;
  }

  .content-grid.wide-left,
  .wide-left {
    grid-template-columns: 1fr;
  }

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

  .paper-grid,
  .key-levels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .asset-grid,
  .execution-grid {
    grid-template-columns: 1fr;
  }

  .mini-grid,
  .score-grid,
  .research-head,
  .command-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .topbar {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .top-actions {
    justify-content: space-between;
    white-space: normal;
  }

  .layout {
    padding: 14px 10px 34px;
  }

  .dashboard-zone {
    margin-top: 18px;
  }

  .zone-heading,
  .section-title,
  .review-head,
  .source-review-list li,
  .research-title {
    display: grid;
    gap: 5px;
  }

  .zone-heading h2,
  .section-title h2 {
    font-size: 20px;
  }

  .command-grid,
  .content-grid,
  .service-lights,
  .mini-grid,
  .score-grid,
  .paper-grid,
  .research-head,
  .command-cards,
  .key-levels,
  .review-panel,
  .source-summary {
    grid-template-columns: 1fr;
  }

  .panel,
  .status-panel,
  .brain-panel,
  .market-section,
  .asset-card {
    padding: 16px;
  }

  .status-panel h2 {
    font-size: 38px;
  }

  .ai-main {
    font-size: 15px;
  }

  .asset-head h3 {
    font-size: 26px;
  }

  .range-line {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .login-page {
    padding: 18px 0;
    align-items: center;
  }

  .login-shell {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 50%;
    width: auto;
    max-width: 420px;
    margin: 0 auto;
    transform: translateY(-50%);
  }

  .login-panel {
    padding: 22px;
  }

  .login-logo {
    width: min(280px, 100%);
  }

  .login-brand-block h1 {
    font-size: 20px;
  }

  .prism-scene {
    width: 820px;
    transform: translate(-62%, -58%);
  }

  .data-lines path {
    opacity: 0.72;
  }
}

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

  .prism-core,
  .data-lines path,
  .refracted-beams,
  .particle-field i,
  .login-panel,
  .login-logo,
  .login-brand-block,
  .login-form label,
  .login-form button,
  .login-footnote {
    opacity: 1 !important;
    transform: none !important;
  }
}
