:root {
  --bg: #06111f;
  --panel: rgba(9, 21, 38, 0.88);
  --panel-strong: rgba(10, 19, 34, 0.98);
  --border: rgba(113, 144, 189, 0.22);
  --text: #eff4ff;
  --muted: #8ea3c7;
  --green: #77f779;
  --green-soft: rgba(119, 247, 121, 0.14);
  --blue: #69a8ff;
  --blue-soft: rgba(105, 168, 255, 0.15);
  --gold: #ffca57;
  --gold-soft: rgba(255, 202, 87, 0.14);
  --violet: #ae8cff;
  --violet-soft: rgba(174, 140, 255, 0.14);
  --danger: #ff7a7a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(54, 96, 186, 0.22), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(72, 184, 135, 0.16), transparent 22%),
    linear-gradient(135deg, #030915 0%, #071221 38%, #050c16 100%);
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.96), rgba(7, 14, 25, 0.96));
}

.brand-panel,
.pulse-card,
.summary-hero,
.chat-card,
.panel,
.metric-card,
.selector,
.mode-switch,
.ghost-button,
.accent-button {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(11, 24, 42, 0.88);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #09131e;
  background: linear-gradient(135deg, #96ff99 0%, #4dd389 100%);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.brand-panel h1,
.topbar h2,
.summary-hero h3,
.panel-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin: 26px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(122, 247, 124, 0.1);
  border-color: rgba(119, 247, 121, 0.34);
}

.nav-icon {
  width: 18px;
  text-align: center;
  color: var(--green);
}

.pulse-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(10, 22, 40, 0.9);
}

.pulse-meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  align-items: end;
  height: 58px;
  margin: 12px 0 18px;
}

.pulse-meter span {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(115, 247, 120, 0.95), rgba(56, 165, 139, 0.36));
}

.pulse-meter span:nth-child(1) { height: 18px; }
.pulse-meter span:nth-child(2) { height: 30px; }
.pulse-meter span:nth-child(3) { height: 22px; }
.pulse-meter span:nth-child(4) { height: 42px; }
.pulse-meter span:nth-child(5) { height: 28px; }
.pulse-meter span:nth-child(6) { height: 36px; }
.pulse-meter span:nth-child(7) { height: 24px; }
.pulse-meter span:nth-child(8) { height: 48px; }
.pulse-meter span:nth-child(9) { height: 31px; }
.pulse-meter span:nth-child(10) { height: 26px; }

.pulse-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.pulse-score strong {
  font-size: 3rem;
  color: var(--green);
}

.main-stage {
  padding: 28px;
}

.topbar,
.control-row,
.hero-grid,
.metric-row,
.content-grid {
  display: grid;
  gap: 18px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 18px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(119, 247, 121, 0.12);
}

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

.league-id {
  margin: 8px 0 0;
  color: var(--muted);
}

.league-id code {
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
}

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

.ghost-button,
.accent-button,
.mode-pill {
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(10, 21, 38, 0.84);
  color: var(--text);
  cursor: pointer;
}

.ghost-button {
  border: 1px solid rgba(105, 168, 255, 0.35);
}

.accent-button {
  border: 1px solid rgba(174, 140, 255, 0.38);
  color: #f0e7ff;
  background: linear-gradient(135deg, rgba(75, 53, 143, 0.88), rgba(50, 30, 93, 0.88));
}

.control-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 18px;
}

.selector-group,
.mode-switch {
  display: flex;
  gap: 12px;
}

.selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(10, 21, 38, 0.84);
}

.selector span {
  color: var(--muted);
  font-size: 0.82rem;
}

.selector select {
  color: var(--text);
  background: transparent;
  border: 0;
}

.mode-switch {
  padding: 6px;
  border-radius: 18px;
  background: rgba(10, 21, 38, 0.84);
}

.mode-pill {
  border: 1px solid transparent;
}

.mode-pill.is-selected {
  background: rgba(119, 247, 121, 0.16);
  border-color: rgba(119, 247, 121, 0.42);
  box-shadow: inset 0 0 18px rgba(119, 247, 121, 0.12);
}

.hero-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.78fr);
  margin-bottom: 18px;
}

.load-status {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(10, 21, 38, 0.84);
  border: 1px solid var(--border);
}

.load-status.is-loading {
  color: var(--blue);
  border-color: rgba(105, 168, 255, 0.4);
}

.load-status.is-success {
  color: var(--green);
  border-color: rgba(119, 247, 121, 0.4);
}

.load-status.is-error {
  color: #ffb4b4;
  border-color: rgba(255, 122, 122, 0.4);
}

.summary-hero,
.chat-card,
.panel {
  border-radius: 24px;
  background: var(--panel);
}

.summary-hero {
  display: grid;
  grid-template-columns: 250px 1fr;
  padding: 26px;
  overflow: hidden;
  position: relative;
}

.summary-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(119, 247, 121, 0.08), transparent 45%),
    linear-gradient(0deg, transparent 0 92%, rgba(105, 168, 255, 0.18) 92% 93%, transparent 93%),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(105, 168, 255, 0.07) 34px 35px);
  pointer-events: none;
}

.hero-radar {
  display: grid;
  place-items: center;
}

.radar-core {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  color: #02140c;
  background:
    radial-gradient(circle, rgba(188, 255, 190, 0.98) 0 18%, rgba(113, 247, 116, 0.78) 18% 32%, rgba(113, 247, 116, 0.24) 32% 52%, transparent 52%),
    repeating-radial-gradient(circle, rgba(119, 247, 121, 0.24) 0 2px, transparent 2px 22px);
  box-shadow:
    0 0 0 1px rgba(119, 247, 121, 0.22),
    0 0 42px rgba(119, 247, 121, 0.18);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h3 {
  margin: 6px 0 18px;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.1;
}

.hero-actions {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.hero-actions strong {
  color: var(--text);
}

.chat-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.minimize,
.up-arrow {
  color: var(--muted);
  font-size: 1.2rem;
}

.chat-intro {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--green);
  background: radial-gradient(circle at top, rgba(174, 140, 255, 0.35), rgba(52, 27, 94, 0.26));
  border: 1px solid rgba(174, 140, 255, 0.35);
}

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

.prompt-button {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(142, 163, 199, 0.22);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
}

.chat-input input {
  padding: 14px 16px;
  color: var(--text);
  background: rgba(3, 10, 18, 0.75);
  border: 1px solid rgba(105, 168, 255, 0.2);
  border-radius: 16px;
}

.chat-input button {
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, rgba(52, 111, 245, 0.9), rgba(75, 53, 143, 0.92));
  border: 1px solid rgba(105, 168, 255, 0.42);
}

.metric-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  padding: 20px;
  border-radius: 22px;
  background: var(--panel);
}

.metric-card.green { background: linear-gradient(180deg, rgba(13, 32, 25, 0.96), rgba(10, 22, 40, 0.92)); }
.metric-card.blue { background: linear-gradient(180deg, rgba(12, 24, 43, 0.96), rgba(10, 22, 40, 0.92)); }
.metric-card.gold { background: linear-gradient(180deg, rgba(44, 30, 10, 0.96), rgba(10, 22, 40, 0.92)); }
.metric-card.violet { background: linear-gradient(180deg, rgba(27, 16, 46, 0.96), rgba(10, 22, 40, 0.92)); }

.metric-card h4,
.metric-card p {
  margin: 0;
}

.metric-card h4 {
  font-size: 0.95rem;
  color: var(--muted);
}

.metric-value {
  margin: 8px 0 6px;
  font-size: 2rem;
  font-family: "Space Grotesk", sans-serif;
}

.content-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.62fr);
}

.primary-stack,
.secondary-stack {
  display: grid;
  gap: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(9, 18, 32, 0.82);
  border: 1px solid var(--border);
}

.tab {
  padding: 12px 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 -2px 0 rgba(105, 168, 255, 0.8);
}

.panel {
  padding: 22px;
}

.summary-list,
.win-path-list,
.notes-list {
  padding-left: 18px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.priority-card,
.lineup-table,
.trade-card,
.waiver-card {
  width: 100%;
  border-collapse: collapse;
}

.priority-stack {
  display: grid;
  gap: 14px;
}

.priority-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(142, 163, 199, 0.14);
}

.priority-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  border: 1px solid currentColor;
}

.priority-rank.green { color: var(--green); }
.priority-rank.blue { color: var(--blue); }
.priority-rank.gold { color: var(--gold); }

.priority-card h4,
.priority-card p,
.table-header h3 {
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }

.priority-action {
  color: var(--muted);
  font-size: 1.3rem;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.table-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(142, 163, 199, 0.14);
  overflow: hidden;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(142, 163, 199, 0.12);
}

.table-header a {
  color: var(--blue);
  text-decoration: none;
}

code {
  word-break: break-all;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(142, 163, 199, 0.1);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.status-pill.lock {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.start {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-pill.lean {
  color: var(--gold);
  background: var(--gold-soft);
}

.projected-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid rgba(142, 163, 199, 0.12);
}

.projected-row strong,
.projected-total strong {
  color: var(--green);
  font-size: 1.8rem;
  font-family: "Space Grotesk", sans-serif;
}

.trade-stack,
.waiver-stack {
  display: grid;
  gap: 14px;
}

.trade-card,
.waiver-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(142, 163, 199, 0.14);
}

.trade-card h4,
.waiver-card h4 {
  margin: 0 0 10px;
}

.trade-meta,
.waiver-meta {
  color: var(--muted);
  margin-bottom: 10px;
}

.win-path-card {
  display: grid;
  gap: 16px;
}

.edge-table td:last-child,
.edge-table th:last-child {
  text-align: right;
}

.edge-up {
  color: var(--green);
}

.edge-down {
  color: var(--danger);
}

.projected-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

@media (max-width: 1280px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .topbar,
  .control-row,
  .summary-hero,
  .split-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-stage {
    padding: 18px;
  }

  .topbar-actions,
  .selector-group,
  .mode-switch,
  .tabs {
    flex-wrap: wrap;
  }

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