:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #101722;
  --surface-2: #151f2d;
  --surface-3: #1c2837;
  --line: rgba(196, 212, 236, 0.16);
  --line-strong: rgba(196, 212, 236, 0.28);
  --text: #edf3f8;
  --muted: #9cadba;
  --soft: #c9d5df;
  --green: #4fd18b;
  --cyan: #5ab7d8;
  --amber: #e1b65a;
  --rose: #e96d83;
  --violet: #b99cff;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(120deg, rgba(90, 183, 216, 0.09), transparent 28%),
    linear-gradient(180deg, #080b12 0%, #0d121b 42%, #0a0d13 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.global-monitor-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.global-monitor-header,
.command-grid,
.workspace-grid,
.switch-board,
.mover-section,
.asset-section,
.review-section {
  margin-bottom: 18px;
}

.monitor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.monitor-nav a,
.tab-row button,
.text-link,
.icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.92);
  color: var(--soft);
  text-decoration: none;
}

.monitor-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
}

.monitor-nav a:hover,
.text-link:hover,
.icon-button:hover,
.tab-row button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.title-copy,
.sync-panel,
.focus-panel,
.pulse-panel,
.agent-panel,
.path-board,
.ticket-panel,
.switch-board,
.mover-section,
.asset-section,
.review-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.88);
  box-shadow: var(--shadow);
}

.title-copy {
  padding: 22px;
}

.kicker,
.panel-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.global-sentence {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.72;
}

.sync-panel {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
}

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

.sync-panel strong {
  font-size: 24px;
}

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

.focus-panel,
.pulse-panel,
.agent-panel,
.path-board,
.ticket-panel,
.switch-board,
.mover-section,
.asset-section,
.review-section {
  padding: 18px;
}

.section-head,
.focus-head,
.path-row-head,
.asset-card-head,
.switch-card-head,
.review-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-head {
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.muted-text,
.meta-line,
.path-thesis,
.focus-thesis,
.ticket-grid dt,
.asset-symbol,
.review-card p,
.agent-node p,
.state-pill,
.path-assets,
.switch-card p {
  color: var(--muted);
}

.score-lockup {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

.score-ring {
  position: relative;
  width: 116px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--cyan)) var(--score-fill, 0%), rgba(255, 255, 255, 0.08) 0);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
}

.score-ring strong {
  position: relative;
  z-index: 1;
  font-size: 30px;
}

.focus-title {
  margin: 8px 0;
  font-size: 30px;
  line-height: 1.15;
}

.focus-thesis {
  margin-bottom: 14px;
  line-height: 1.7;
}

.pill-row,
.asset-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-pill,
.state-pill,
.asset-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  white-space: nowrap;
}

.signal-pill[data-tone="green"],
.state-pill[data-tone="green"],
.asset-card[data-tone="up"] .asset-change {
  color: var(--green);
}

.signal-pill[data-tone="amber"],
.state-pill[data-tone="amber"] {
  color: var(--amber);
}

.signal-pill[data-tone="rose"],
.state-pill[data-tone="rose"],
.asset-card[data-tone="down"] .asset-change {
  color: var(--rose);
}

.signal-pill[data-tone="cyan"],
.state-pill[data-tone="cyan"] {
  color: var(--cyan);
}

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

.pulse-card {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.pulse-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pulse-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.pulse-card p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.icon-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: pointer;
}

.text-link {
  color: var(--cyan);
  font-size: 13px;
}

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

.agent-node {
  position: relative;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.agent-node strong,
.agent-node span {
  display: block;
}

.agent-node p {
  margin: 8px 0 14px;
  font-size: 12px;
  line-height: 1.5;
}

.agent-node span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--soft);
  font-size: 12px;
}

.agent-node[data-status="active"] {
  border-color: rgba(90, 183, 216, 0.68);
}

.agent-node[data-status="done"] {
  border-color: rgba(79, 209, 139, 0.55);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 420px;
  gap: 18px;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-row button {
  padding: 0 11px;
  color: var(--muted);
  cursor: pointer;
}

.tab-row button.is-active {
  border-color: rgba(90, 183, 216, 0.72);
  background: rgba(90, 183, 216, 0.12);
  color: var(--text);
}

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

.path-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.2fr) 180px 170px;
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.path-row.is-selected {
  border-color: rgba(90, 183, 216, 0.78);
  background: linear-gradient(180deg, rgba(90, 183, 216, 0.11), rgba(21, 31, 45, 0.96));
}

.rank-no {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.path-name {
  font-weight: 800;
  font-size: 18px;
}

.path-thesis,
.path-assets {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.mini-score {
  display: grid;
  gap: 6px;
}

.mini-score strong {
  font-size: 28px;
}

.mini-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-meter i {
  display: block;
  width: var(--score-fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--meter-color, var(--cyan));
}

.sparkline {
  width: 100%;
  height: 72px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--cyan);
}

.sparkline[data-tone="green"] {
  color: var(--green);
}

.sparkline[data-tone="amber"] {
  color: var(--amber);
}

.sparkline[data-tone="rose"] {
  color: var(--rose);
}

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

.ticket-grid div {
  min-height: 102px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.ticket-grid dt {
  font-size: 12px;
}

.ticket-grid dd {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.switch-grid,
.review-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.switch-card,
.review-card {
  min-height: 158px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.switch-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.switch-card p,
.review-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

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

.mover-list {
  display: grid;
  gap: 8px;
}

.mover-row {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mover-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.35fr) 130px 110px 110px 130px 180px;
  gap: 12px;
  align-items: center;
}

.mover-row .rank-no {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.mover-company {
  min-width: 0;
}

.mover-company strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.mover-company span,
.mover-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mover-cell strong {
  display: block;
  font-size: 15px;
}

.mover-return {
  font-size: 20px;
  font-weight: 850;
}

.mover-return[data-tone="up"] {
  color: var(--green);
}

.mover-return[data-tone="down"] {
  color: var(--rose);
}

.mover-row .sparkline {
  height: 52px;
}

.mover-analysis {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.mover-analysis-head,
.mover-analysis-pills,
.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mover-analysis-head {
  justify-content: space-between;
}

.mover-analysis-copy {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.mover-analysis-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mover-analysis-source {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.mover-analysis-source > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.source-chip,
.analysis-empty {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.source-chip:hover {
  border-color: rgba(137, 208, 255, 0.5);
  color: var(--cyan);
}

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

.mover-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.asset-card {
  min-height: 210px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.asset-label {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-symbol {
  flex: 0 0 auto;
  font-size: 12px;
}

.asset-value-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin: 13px 0 10px;
}

.asset-value {
  min-width: 0;
  font-size: 23px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.asset-change {
  flex: 0 0 auto;
  font-weight: 800;
}

.asset-card .sparkline {
  height: 68px;
  margin-top: 12px;
}

.error-line {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(233, 109, 131, 0.38);
  border-radius: 8px;
  background: rgba(233, 109, 131, 0.08);
  color: #ff9dad;
}

@media (max-width: 1280px) {
  .title-row,
  .command-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .path-row {
    grid-template-columns: 48px minmax(0, 1fr) 150px;
  }

  .mover-row {
    grid-template-columns: 1fr;
  }

  .mover-main {
    grid-template-columns: 44px minmax(0, 1.2fr) 110px 92px 100px;
  }

  .path-row .sparkline {
    grid-column: 2 / -1;
  }

  .mover-main .sparkline {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .global-monitor-shell {
    width: min(100% - 20px, 1500px);
    padding-top: 14px;
  }

  .title-copy,
  .sync-panel,
  .focus-panel,
  .pulse-panel,
  .agent-panel,
  .path-board,
  .ticket-panel,
  .switch-board,
  .mover-section,
  .asset-section,
  .review-section {
    padding: 14px;
  }

  .score-lockup,
  .pulse-grid,
  .agent-graph,
  .ticket-grid,
  .switch-grid,
  .review-list,
  .asset-grid,
  .mover-main,
  .path-row {
    grid-template-columns: 1fr;
  }

  .path-row .sparkline {
    grid-column: auto;
  }

  .mover-main .sparkline {
    grid-column: auto;
  }

  .mover-analysis-sources,
  .mover-analysis-source {
    grid-template-columns: 1fr;
  }

  .section-head,
  .section-actions,
  .focus-head,
  .path-row-head,
  .asset-card-head,
  .switch-card-head,
  .review-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .score-ring {
    width: 96px;
  }

  h1 {
    font-size: 36px;
  }
}
