:root {
  --bg: #050809;
  --surface: #0d1417;
  --surface-2: #11191d;
  --surface-3: #172126;
  --line: #223138;
  --line-soft: #17252a;
  --text: #f1f7f8;
  --muted: #9aa8ad;
  --muted-2: #65747d;
  --green: #3bd17f;
  --green-soft: rgba(59, 209, 127, 0.14);
  --orange: #ffb238;
  --orange-soft: rgba(255, 178, 56, 0.15);
  --red: #ff3b32;
  --red-soft: rgba(255, 59, 50, 0.15);
  --blue: #55a7ff;
  --blue-soft: rgba(85, 167, 255, 0.14);
  --gold: #f6c35b;
  --gold-soft: rgba(246, 195, 91, 0.16);
  --reactor: #7be7ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(circle at 72% 12%, rgba(39, 70, 67, 0.16), transparent 28%), var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

.ecg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(rgba(246, 195, 91, 0.04) 1px, transparent 1px) 0 0 / 100% 54px,
    linear-gradient(90deg, rgba(255, 59, 50, 0.035) 1px, transparent 1px) 0 0 / 72px 100%;
}

.ecg-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 59, 50, 0.06), rgba(246, 195, 91, 0.08), transparent);
  transform: translateX(-100%);
  animation: ecgScan 7.5s linear infinite;
}

.ecg-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  height: 112px;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg width='720' height='112' viewBox='0 0 720 112' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 58 H78 L94 58 L106 34 L122 84 L142 20 L158 58 H236 L250 58 L264 44 L280 70 L296 58 H398 L410 58 L424 50 L438 64 L452 58 H544 L558 58 L570 30 L588 82 L606 58 H720' fill='none' stroke='%23ffb238' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 720px 112px;
  animation: ecgDrift 16s linear infinite;
}

@keyframes ecgScan {
  to { transform: translateX(100%); }
}

@keyframes ecgDrift {
  to { background-position-x: -720px; }
}

button,
input,
table {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  isolation: isolate;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  border-right: 1px solid var(--line-soft);
  background: rgba(5, 8, 9, 0.9);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 195, 91, 0.44);
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, rgba(123, 231, 255, 0.2), rgba(13, 18, 22, 0.9) 62%);
  color: var(--gold);
  font-weight: 800;
  box-shadow: 0 0 22px rgba(123, 231, 255, 0.16);
}

.brand-title {
  font-size: 18px;
  font-weight: 850;
  text-transform: uppercase;
}

.brand-subtitle,
.mini-label,
.eyebrow,
.panel p,
.bot-card p {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item,
.ghost-button,
.warning-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 25, 29, 0.74);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 0 12px;
  color: var(--muted);
}

.nav-link {
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover,
.ghost-button:hover {
  border-color: #3d5360;
  background: #1a252c;
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(255, 59, 50, 0.72);
  background: linear-gradient(90deg, rgba(255, 59, 50, 0.18), rgba(246, 195, 91, 0.08));
  color: var(--text);
}

.warning-button {
  background: var(--orange-soft);
  border-color: rgba(255, 178, 56, 0.34);
  color: #ffd8a3;
}

.danger-button {
  background: var(--red-soft);
  border-color: rgba(255, 59, 50, 0.36);
  color: #ffb9b9;
}

.nav-item:active,
.ghost-button:active,
.warning-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.mode-pill,
.status-chip,
.bot-state,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mode-pill,
.status-chip.info,
.tag.blue,
.bot-state.blue {
  background: var(--blue-soft);
  color: #b9dcff;
}

.status-chip.healthy,
.tag.green,
.bot-state.green {
  background: var(--green-soft);
  color: #a8efc8;
}

.status-chip.danger,
.tag.red,
.bot-state.red {
  background: var(--red-soft);
  color: #ffb9b9;
}

.tag.orange {
  background: var(--orange-soft);
  color: #ffd39b;
}

.activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-pill.idle,
.activity-pill.watching {
  background: var(--green-soft);
  color: #a8efc8;
}

.activity-pill.signal,
.activity-pill.busy,
.activity-pill.triathlon {
  background: var(--orange-soft);
  color: #ffd39b;
}

.activity-pill.trading {
  background: rgba(59, 209, 127, 0.24);
  color: #c4ffd9;
}

.activity-pill.error,
.activity-pill.dead {
  background: var(--red-soft);
  color: #ffb9b9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.status-dot.green {
  background: var(--green);
}

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

.status-dot.blue {
  background: var(--blue);
}

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

.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
}

.activity-dot.idle {
  background: #6f817d;
  animation: pulseSlow 3.2s infinite;
}

.activity-dot.watching {
  background: var(--green);
  animation: pulseCalm 2.2s infinite;
}

.activity-dot.signal {
  background: var(--orange);
  animation: pulseFast 1.1s infinite;
}

.activity-dot.trading {
  background: var(--green);
  animation: pulseFast 0.75s infinite;
}

.activity-dot.busy {
  background: var(--orange);
  animation: pulseBusy 0.55s infinite;
}

.activity-dot.triathlon {
  background: var(--orange);
  animation: pulseBusy 0.38s infinite;
}

.activity-dot.error {
  background: var(--red);
  animation: pulseFast 0.85s infinite;
}

.activity-dot.dead {
  background: #6b3737;
}

@keyframes pulseSlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(111, 129, 125, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(111, 129, 125, 0); }
}

@keyframes pulseCalm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 209, 127, 0.28); }
  50% { box-shadow: 0 0 0 8px rgba(59, 209, 127, 0); }
}

@keyframes pulseFast {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 159, 50, 0.38); }
  50% { box-shadow: 0 0 0 10px rgba(245, 159, 50, 0); }
}

@keyframes pulseBusy {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 159, 50, 0.48); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px rgba(245, 159, 50, 0); transform: scale(1.18); }
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  margin-bottom: 22px;
  padding: 18px 22px;
  border: 1px solid rgba(246, 195, 91, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 50%, rgba(123, 231, 255, 0.12), transparent 13%),
    linear-gradient(90deg, rgba(35, 9, 8, 0.72), rgba(13, 20, 23, 0.88) 34%, rgba(13, 20, 23, 0.9));
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(246, 195, 91, 0.2);
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.command-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.command-strip .ghost-button,
.command-strip .warning-button,
.compact {
  padding: 0 12px;
}

.bot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.bot-card,
.panel {
  border: 1px solid rgba(246, 195, 91, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(25, 28, 28, 0.94), rgba(10, 15, 17, 0.96)),
    linear-gradient(135deg, rgba(255, 59, 50, 0.04), rgba(246, 195, 91, 0.03));
  box-shadow: var(--shadow);
}

.bot-card {
  position: relative;
  min-height: 170px;
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.bot-card.muted {
  opacity: 0.82;
}

.bot-card.selected {
  border-color: rgba(246, 195, 91, 0.12);
}

.bot-card:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 195, 91, 0.38);
}

.bot-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 59, 50, 0.36), rgba(246, 195, 91, 0.36), transparent);
}

.fleet-ecg-panel {
  margin-bottom: 14px;
}

.fleet-ecg {
  margin-top: 12px;
}

.ecg-monitor {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 54, 62, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 34px 100%,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 18px,
    rgba(2, 9, 8, 0.64);
  color: var(--green);
  box-shadow: inset 0 0 18px rgba(59, 209, 127, 0.04);
}

.ecg-monitor.mini {
  height: 36px;
  margin-top: 16px;
}

.ecg-monitor.row {
  height: 34px;
  margin-top: 8px;
}

.ecg-monitor.fleet {
  height: 86px;
}

.ecg-monitor.detail {
  height: 92px;
  margin-top: 14px;
}

.ecg-monitor svg {
  width: 100%;
  height: 100%;
}

.ecg-monitor path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px currentColor);
}

.ecg-track {
  animation: ecgScroll 2.8s linear infinite;
}

.ecg-monitor.idle {
  color: #7bbd93;
}

.ecg-monitor.idle .ecg-track {
  animation-duration: 4.8s;
}

.ecg-monitor.watching {
  color: var(--green);
}

.ecg-monitor.watching .ecg-track {
  animation-duration: 3.2s;
}

.ecg-monitor.signal {
  color: var(--orange);
}

.ecg-monitor.signal .ecg-track {
  animation-duration: 2.1s;
}

.ecg-monitor.trading {
  color: #33ff88;
  box-shadow: inset 0 0 20px rgba(59, 209, 127, 0.08), 0 0 18px rgba(59, 209, 127, 0.12);
}

.ecg-monitor.trading .ecg-track {
  animation-duration: 1.45s;
}

.ecg-monitor.busy {
  color: var(--orange);
  box-shadow: inset 0 0 20px rgba(255, 178, 56, 0.1), 0 0 20px rgba(255, 178, 56, 0.14);
}

.ecg-monitor.busy .ecg-track {
  animation-duration: 0.9s;
}

.ecg-monitor.triathlon {
  color: #ffcf5a;
  box-shadow:
    inset 0 0 26px rgba(255, 178, 56, 0.18),
    0 0 28px rgba(255, 178, 56, 0.2),
    0 0 38px rgba(255, 59, 50, 0.12);
}

.ecg-monitor.triathlon path {
  stroke-width: 3;
}

.ecg-monitor.triathlon .ecg-track {
  animation-duration: 0.56s;
}

.ecg-monitor.error {
  color: var(--red);
  box-shadow: inset 0 0 22px rgba(255, 59, 50, 0.12), 0 0 22px rgba(255, 59, 50, 0.14);
}

.ecg-monitor.error .ecg-track {
  animation-duration: 1.1s;
}

.ecg-monitor.dead {
  color: #8d4545;
}

.ecg-monitor.dead .ecg-track {
  animation: none;
}

.ecg-monitor.flash-hard {
  animation: hardStopFlash 1.2s ease-out 2;
}

.ecg-monitor.flash-trail {
  animation: trailFlash 1.1s ease-out 2;
}

@keyframes ecgScroll {
  to { transform: translateX(-240px); }
}

@keyframes hardStopFlash {
  0%, 100% { box-shadow: inset 0 0 18px rgba(255, 59, 50, 0.04); }
  35% { box-shadow: inset 0 0 28px rgba(255, 59, 50, 0.42), 0 0 24px rgba(255, 59, 50, 0.35); }
}

@keyframes trailFlash {
  0%, 100% { box-shadow: inset 0 0 18px rgba(59, 209, 127, 0.04); }
  35% { box-shadow: inset 0 0 28px rgba(59, 209, 127, 0.34), 0 0 24px rgba(59, 209, 127, 0.28); }
}

.card-head,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.metric-row div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.metric-row span,
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metric-row strong {
  font-size: 18px;
}

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

.loss {
  color: #ff8b8b;
}

.primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.chart-stack,
.right-rail,
.table-grid {
  display: grid;
  gap: 14px;
}

.right-rail {
  position: sticky;
  top: 18px;
}

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

.chart-panel {
  min-height: 332px;
}

.detail-chart-panel {
  min-height: 494px;
}

.detail-chart {
  height: 412px;
}

.mock-chart {
  position: relative;
  height: 250px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 9.09% 100%,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 20%,
    #0b1115;
}

.mock-chart::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(36, 255, 131, 0.06) 48%, transparent 100%);
  opacity: 0.62;
  transform: translateX(-100%);
  animation: chartSweep 6s linear infinite;
  pointer-events: none;
}

@keyframes chartSweep {
  to { transform: translateX(100%); }
}

.mock-chart.candle-stale {
  border-color: rgba(245, 159, 50, 0.72);
}

.mock-chart.candle-dead {
  border-color: rgba(240, 82, 82, 0.72);
}

.mock-chart::before {
  content: "";
  position: absolute;
  inset: 22px 28px 22px 28px;
  background-repeat: repeat-x;
  background-size: 32px 100%;
}

.ranger-chart::before {
  background-image:
    linear-gradient(to top, transparent 0 18%, #3bd17f 18% 66%, transparent 66%),
    linear-gradient(to top, transparent 0 48%, #f05252 48% 82%, transparent 82%);
}

.sweephunter-chart::before {
  background-image:
    linear-gradient(to top, transparent 0 42%, #55a7ff 42% 74%, transparent 74%),
    linear-gradient(to top, transparent 0 16%, #3bd17f 16% 54%, transparent 54%);
}

.price-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.price-line.high {
  top: 23%;
}

.price-line.mid {
  top: 50%;
}

.price-line.low {
  top: 73%;
}

.trade-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
}

.trade-marker.long {
  background: var(--green);
  color: #062111;
}

.trade-marker.short {
  background: var(--blue);
  color: #061929;
}

.trade-marker.exit {
  background: var(--orange);
  color: #291504;
}

.trade-marker.trail-on {
  background: var(--blue);
  color: #061929;
}

.trade-marker.hard-stop {
  background: var(--red);
  color: #290808;
}

.overlay-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.28);
}

.overlay-line.vwap {
  border-color: rgba(85, 167, 255, 0.58);
}

.chart-legend {
  position: absolute;
  left: 10px;
  bottom: 32px;
  z-index: 3;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 20px);
}

.chart-legend span {
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(5, 8, 9, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-time-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(5, 8, 9, 0), rgba(5, 8, 9, 0.82));
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.chart-time-axis span {
  position: absolute;
  bottom: 6px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-time-axis span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 15px;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, 0.16);
}

.candle-wick,
.candle-body {
  position: absolute;
  min-width: 2px;
  border-radius: 2px;
}

.candle-wick {
  background: rgba(210, 222, 228, 0.45);
}

.candle-body.up {
  background: var(--green);
}

.candle-body.down {
  background: var(--red);
}

.ai-copy {
  margin-top: 16px;
  color: #d8e2e5;
  line-height: 1.5;
  font-size: 14px;
}

.signal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.heartbeat-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.heartbeat-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.heartbeat-row-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.heartbeat-row span,
.heartbeat-row-main span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.heartbeat-row.warning strong,
.heartbeat-row-main.warning strong {
  color: var(--orange);
}

.risk-meter {
  height: 10px;
  margin: 16px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f12;
  border: 1px solid var(--line);
}

.risk-fill {
  width: 51%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--orange));
}

.risk-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.risk-stats strong {
  color: var(--text);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.table-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  margin-top: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

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

td {
  color: #d7e0e4;
  font-size: 13px;
}

.side {
  font-weight: 800;
}

.side.long {
  color: var(--green);
}

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

.activity-panel {
  margin-top: 14px;
}

.handoff-panel {
  margin-top: 14px;
}

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.handoff-grid span {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: #d8e2e5;
  font-size: 12px;
  line-height: 1.35;
}

.config-box {
  max-height: 360px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090f13;
  color: #d8e2e5;
  font-size: 12px;
  line-height: 1.45;
}

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

.activity-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: #d8e2e5;
  font-size: 13px;
}

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

.activity-row time {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d1418;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .primary-grid,
  .detail-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: static;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-strip {
    justify-content: flex-start;
  }

  .bot-grid,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .brand-block {
    padding-bottom: 12px;
  }

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

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

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

  .chart-panel {
    min-height: 292px;
  }

  .mock-chart {
    height: 210px;
  }
}
