*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #7d8590;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --blue: #58a6ff;
  --purple: #a371f7;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 18px; font-weight: 600; }

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.live    { background: #1a3c1a; color: var(--green); }
.badge.dry     { background: #3c2e1a; color: var(--yellow); }
.badge.neutral { background: #1c2330; color: var(--blue); }
.badge.long    { background: #1a3c1a; color: var(--green); }
.badge.short   { background: #3c1a1a; color: var(--red); }
.badge.risk    { background: #3c1a1a; color: var(--red); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.card h2 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.card .val { font-size: 24px; font-weight: 700; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.kill-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 0;
  margin-left: auto;
}

.toggle {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: .2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}
input:checked + .slider { background: var(--green); }
input:checked + .slider::before { transform: translateX(20px); }

section { padding: 0 20px 20px; }
section h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--muted); text-transform: uppercase; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 8px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

.buy  { color: var(--green); font-weight: 600; }
.sell { color: var(--red);   font-weight: 600; }

.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.tag.vetoed   { background: #3c2e1a; color: var(--yellow); }
.tag.executed { background: #1a3c1a; color: var(--green); }
.tag.dry      { background: #1c2330; color: var(--blue); }

.cost-bar-wrap { background: var(--border); border-radius: 4px; height: 8px; margin-top: 8px; }
.cost-bar      { background: var(--blue); border-radius: 4px; height: 8px; transition: width .5s; }

.posture-long    { color: var(--green); }
.posture-short   { color: var(--red); }
.posture-risk    { color: var(--red); }
.posture-neutral { color: var(--blue); }

.muted { color: var(--muted); }
.refresh-hint { font-size: 11px; color: var(--muted); margin-left: auto; padding-right: 20px; }
