/* BETTY dashboard / settings UI -- dark, minimal, single-file. */

:root {
  --bg:        #0d1117;
  --bg-2:      #11161e;
  --bg-3:      #161c26;
  --line:      #1f2733;
  --line-2:    #2a3340;
  --txt:       #e6edf3;
  --txt-dim:   #9ca7b3;
  --txt-mut:   #6b7684;
  --accent:    #f97316;
  --accent-2:  #fb923c;
  --good:      #22c55e;
  --bad:       #ef4444;
  --warn:      #eab308;
  --info:      #3b82f6;
  --radius:    10px;
  --gap:       16px;
  --gap-lg:    24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

.mono { font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; }
.subtle  { color: var(--txt-dim); margin: 4px 0 12px; }
.empty   { color: var(--txt-mut); padding: 20px; text-align: center; }
.ok      { color: var(--good); }
.warn    { color: var(--warn); }
.pos     { color: var(--good); }
.neg     { color: var(--bad); }
.r       { text-align: right; }

/* ----- layout ----- */
body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 18px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand-mark {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #c2410c);
  color: #0a0c10; font-weight: 800; border-radius: 8px;
  font-family: ui-monospace, monospace;
}
.brand-name {
  font-weight: 700; letter-spacing: 0.18em; font-size: 13px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--txt-dim); font-weight: 500;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--bg-3); color: var(--txt); }
.nav-link.active {
  background: var(--bg-3); color: var(--txt);
  border-color: var(--line-2);
}
.nav-ico { width: 18px; opacity: 0.85; font-size: 12px; }

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg-3); font-size: 12px;
  width: max-content;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad);
}
.status-pill.on .dot { background: var(--good); }
.status-pill.on { color: var(--good); }
.status-pill.off { color: var(--txt-mut); }

.bnb-block {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.bnb-label { color: var(--txt-mut); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.bnb-price { font-family: ui-monospace, monospace; font-size: 18px; font-weight: 600; }

.legacy-link { font-size: 12px; color: var(--txt-mut); }

/* sidebar wallet block */
.wallet-block {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.wallet-label { color: var(--txt-mut); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.wallet-addr  { font-size: 12px; color: var(--txt-dim); margin: 4px 0; cursor: pointer; transition: color 0.15s; }
.wallet-addr:hover  { color: var(--accent-2); }
.wallet-addr.copied { color: var(--good); }
.wallet-bal   { font-size: 14px; font-weight: 600; }
.wallet-usd   { font-size: 12px; color: var(--txt-dim); }

/* dashboard wallet card */
.card-wallet { padding: 18px 22px; }
.wallet-card-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}
.wallet-card-addr {
  font-size: 14px;
  word-break: break-all;
  margin: 8px 0;
  cursor: pointer;
  color: var(--txt);
  transition: color 0.15s;
}
.wallet-card-addr:hover  { color: var(--accent-2); }
.wallet-card-addr.copied { color: var(--good); }
.refresh-link {
  font-size: 12px;
  margin-left: 12px;
  color: var(--txt-mut);
  text-decoration: underline dotted;
}
.refresh-link:hover { color: var(--accent-2); }
.badge-warn { background: rgba(234,179,8,0.12); color: var(--warn); border-color: rgba(234,179,8,0.4); }

/* ----- main ----- */
.main {
  flex: 1; min-width: 0;
  padding: 22px 28px 72px;
}

/* ----- frozen footer ----- */
.app-footer {
  position: fixed; bottom: 0; left: 230px; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  background: var(--bg-2); border-top: 1px solid var(--line);
  color: var(--txt-mut); font-size: 12px; white-space: nowrap;
}
.app-footer-brand { color: var(--txt-dim); font-weight: 700; letter-spacing: 0.04em; }
.app-footer-sep { opacity: 0.5; }
.app-footer-copy { margin-left: 4px; }
.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px; margin-bottom: 20px;
}
.page-title { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.topbar-meta { color: var(--txt-dim); font-size: 13px; }

.messages { margin-bottom: 18px; }
.msg {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
  border: 1px solid var(--line-2);
}
.msg-success { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.4); color: var(--good); }
.msg-error   { background: rgba(239,  68, 68, 0.08); border-color: rgba(239,  68, 68, 0.4); color: var(--bad); }
.msg-warning { background: rgba(234, 179,   8, 0.08); border-color: rgba(234, 179,   8, 0.4); color: var(--warn); }

.page { padding-bottom: 40px; }

/* ----- cards / grid ----- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.mb-lg { margin-bottom: var(--gap-lg); }

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h2 { margin: 0 0 6px 0; font-size: 15px; letter-spacing: 0.02em; }

.card-label {
  color: var(--txt-mut);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 6px;
}
.card-value { font-size: 22px; font-weight: 600; line-height: 1.2; }
.card-foot  { color: var(--txt-dim); font-size: 12px; margin-top: 6px; }

/* stats row */
.stat-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.card-wide .stat-row { grid-template-columns: repeat(6, 1fr); }
.stat-num { font-size: 20px; font-weight: 600; }
.stat-label {
  color: var(--txt-mut); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* badges */
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  background: var(--bg-3); color: var(--txt-dim);
  border: 1px solid var(--line-2);
}
.badge-on  { background: rgba(34, 197, 94, 0.12); color: var(--good); border-color: rgba(34, 197, 94, 0.4); }
.badge-off { background: rgba(239, 68, 68, 0.12); color: var(--bad);  border-color: rgba(239, 68, 68, 0.4); }
.dir.up    { color: var(--good); font-weight: 600; }
.dir.dn    { color: var(--bad);  font-weight: 600; }

/* table */
.table {
  width: 100%; border-collapse: collapse; margin-top: 10px;
  font-size: 13px;
}
.table th {
  text-align: left; padding: 8px 10px;
  color: var(--txt-mut);
  border-bottom: 1px solid var(--line);
  font-weight: 600; letter-spacing: 0.04em;
}
.table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* settings form */
.settings-form .field {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 0;
}
.settings-form label {
  font-weight: 500; font-size: 13px;
}
.settings-form input[type="number"],
.settings-form input[type="text"],
.settings-form select {
  background: var(--bg-3);
  color: var(--txt);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  width: 100%;
}
.settings-form input[type="number"]:focus,
.settings-form input[type="text"]:focus,
.settings-form select:focus {
  outline: none; border-color: var(--accent);
}
.hint { color: var(--txt-mut); font-size: 12px; }
.kv {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.kv-label { color: var(--txt-mut); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.kv-val   { font-size: 18px; font-weight: 600; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line-2);
  border-radius: 24px;
  transition: 0.2s;
}
.slider::before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: var(--txt-dim);
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background-color: rgba(249, 115, 22, 0.4); }
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: var(--accent);
}

/* buttons */
.btn {
  display: inline-block;
  padding: 9px 16px; border-radius: 8px;
  font: inherit; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent; cursor: pointer;
  transition: 0.15s;
}
.btn-primary {
  background: var(--accent); color: #0a0c10; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost {
  background: transparent; color: var(--txt-dim);
  border-color: var(--line-2);
}
.btn-ghost:hover { color: var(--txt); border-color: var(--txt-dim); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-sm   { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.btn.danger:hover { color: #fff; background: rgba(239, 68, 68, 0.12); border-color: var(--bad); }

/* utilities */
.mt-md { margin-top: var(--gap); }

/* Train Model page */
.train-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 10px;
}
.kv.compact { padding: 8px 10px; }
.kv.compact .kv-val { font-size: 14px; }
.inline-form { display: inline-block; margin-left: 6px; }
.logbox {
  background: #05080d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  max-height: 380px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  color: #d1d8e0;
}

/* Data source picker */
.data-source-block {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: var(--gap);
}
.data-source-block h3,
.settings-form h3 {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--txt-mut); margin: 0 0 10px 0;
}
.source-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.source-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2);
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--txt-dim);
  transition: 0.15s;
}
.source-tab input { display: none; }
.source-tab:has(input:checked) {
  background: rgba(249, 115, 22, 0.12);
  border-color: var(--accent);
  color: var(--accent-2);
}
.source-tab:hover { color: var(--txt); }
.db-stats { font-size: 13px; }
.data-preview {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--txt-dim);
}
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0;
}
input[type="date"] {
  background: var(--bg-3); color: var(--txt);
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 9px 12px; font: inherit;
  color-scheme: dark;
}
input[type="date"]:focus { outline: none; border-color: var(--accent); }
input[type="date"]:disabled { opacity: 0.4; cursor: not-allowed; }


/* ================================================================ */
/* Master mode switches  ::  ACTIVE/INACTIVE  +  LIVE/TEST            */
/* ================================================================ */
.mode-switches-card {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent),
    var(--bg-2);
  overflow: hidden;
}
.mode-switches-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  background:
    radial-gradient(900px 200px at 50% -50px, rgba(239,68,68,0.18), transparent 70%),
    linear-gradient(180deg, rgba(239,68,68,0.06), transparent 60%);
}
.mode-switches-card[data-current-live="1"]::before { opacity: 1; }
.mode-switches-card[data-current-live="1"] {
  border-color: rgba(239,68,68,0.45);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.20) inset, 0 8px 30px -16px rgba(239,68,68,0.45);
}

.mode-switches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
  position: relative;
}
@media (max-width: 760px) {
  .mode-switches { grid-template-columns: 1fr; gap: 22px; }
}

.mode-switch-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255,255,255,0.015);
}

.mode-switch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mode-switch-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt-mut);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mode-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.mode-state-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.mode-state-badge.is-on   { color: #4ade80; background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.45); }
.mode-state-badge.is-off  { color: #94a3b8; background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.30); }
.mode-state-badge.is-live { color: #fca5a5; background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.55); }
.mode-state-badge.is-live .dot { animation: cerb-pulse-red 1.4s infinite; }
.mode-state-badge.is-test { color: #93c5fd; background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.45); }

@keyframes cerb-pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.55), 0 0 8px currentColor; }
  50%     { box-shadow: 0 0 0 7px rgba(239,68,68,0), 0 0 8px currentColor; }
}

/* ----- Global topbar LIVE / PAPER mode badge ----- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mode-badge-topbar {
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
}
/* Flash the whole badge (not just the dot) when betting real money. */
.mode-badge-topbar.is-live {
  animation: betty-live-flash 1.1s ease-in-out infinite;
}
@keyframes betty-live-flash {
  0%, 100% {
    background: rgba(239,68,68,0.14);
    border-color: rgba(239,68,68,0.55);
    box-shadow: 0 0 0 0 rgba(239,68,68,0);
  }
  50% {
    background: rgba(239,68,68,0.32);
    border-color: rgba(239,68,68,0.95);
    box-shadow: 0 0 12px 1px rgba(239,68,68,0.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-badge-topbar.is-live { animation: none; }
  .mode-state-badge.is-live .dot { animation: none; }
}

/* ----- Segmented control (the buttons) ----- */
.mode-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  width: 100%;
}
.mode-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt-dim);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  padding: 13px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-transform: uppercase;
  transition:
    background 160ms ease,
    color      160ms ease,
    border     160ms ease,
    box-shadow 160ms ease,
    transform   90ms ease;
}
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-btn:hover:not(.is-on):not(:disabled) {
  color: var(--txt);
  background: rgba(255,255,255,0.04);
  border-color: var(--line-2);
}
.mode-btn:active:not(:disabled) { transform: translateY(1px); }
.mode-btn:disabled { opacity: 0.55; cursor: progress; }

/* Selected ("on") states -- vivid, color-coded */
.mode-btn.mode-btn-active.is-on {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #052e16;
  border-color: #16a34a;
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.35),
    0 8px 22px -10px rgba(34,197,94,0.65),
    inset 0 1px 0 rgba(255,255,255,0.20);
  text-shadow: 0 1px 0 rgba(255,255,255,0.10);
}
.mode-btn.mode-btn-inactive.is-on {
  background: linear-gradient(180deg, #475569, #334155);
  color: #e2e8f0;
  border-color: #475569;
  box-shadow:
    0 0 0 1px rgba(100,116,139,0.40),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
.mode-btn.mode-btn-live.is-on {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff5f5;
  border-color: #b91c1c;
  box-shadow:
    0 0 0 1px rgba(239,68,68,0.45),
    0 8px 22px -10px rgba(239,68,68,0.75),
    inset 0 1px 0 rgba(255,255,255,0.18);
  text-shadow: 0 1px 0 rgba(0,0,0,0.20);
  animation: cerb-glow-red 2.2s ease-in-out infinite;
}
.mode-btn.mode-btn-test.is-on {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #eff6ff;
  border-color: #1d4ed8;
  box-shadow:
    0 0 0 1px rgba(59,130,246,0.40),
    0 8px 22px -10px rgba(59,130,246,0.55),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

@keyframes cerb-glow-red {
  0%,100% { box-shadow: 0 0 0 1px rgba(239,68,68,0.45), 0 8px 22px -10px rgba(239,68,68,0.75), inset 0 1px 0 rgba(255,255,255,0.18); }
  50%     { box-shadow: 0 0 0 1px rgba(239,68,68,0.65), 0 10px 28px -8px  rgba(239,68,68,1.00), inset 0 1px 0 rgba(255,255,255,0.18); }
}

.mode-switch-help {
  font-size: 12px;
  color: var(--txt-mut);
  line-height: 1.55;
  margin: 0;
}
.mode-switch-help .mono {
  color: var(--txt-dim);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

/* ================================================================ */
/* Compact control bar  ::  toggles + live ps_bot.py activity feed   */
/* ================================================================ */
.mode-switches-card--compact { padding: 14px 16px; }

.control-bar-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .control-bar-grid { grid-template-columns: 1fr; }
}

.control-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-compact {
  gap: 8px;
  padding: 10px 12px;
}
.control-compact .mode-segmented { padding: 4px; border-radius: 11px; gap: 4px; }
.control-compact .mode-btn {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

/* ----- toggles-only control bar (activity feed extracted) ----- */
.control-bar-grid--toggles-only { grid-template-columns: 1fr; }
.control-bar-grid--toggles-only .control-toggles {
  flex-direction: row;
  flex-wrap: wrap;
}
.control-bar-grid--toggles-only .control-toggles .mode-switch-block {
  flex: 1 1 240px;
  min-width: 0;
}

/* ----- performance metrics section + bet-type filter ----- */
.metrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.metrics-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--txt-mut);
}
.metrics-filter.mode-segmented {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  width: auto;
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}
.metrics-filter .mode-btn {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}
.metrics-filter .mode-btn.is-on {
  background: linear-gradient(180deg, #334155, #1e293b);
  color: #e2e8f0;
  border-color: #475569;
  box-shadow:
    0 0 0 1px rgba(100,116,139,0.40),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
.metrics-filter .mode-btn[data-mode-value="live"].is-on {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff5f5;
  border-color: #b91c1c;
}
.metrics-filter .mode-btn[data-mode-value="test"].is-on {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #eff6ff;
  border-color: #1d4ed8;
}

/* ----- recent positions header ----- */
.recent-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.recent-head h2 { margin: 0; }
.recent-mode-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-mut);
}

/* ----- recent positions pager ----- */
.recent-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}
.recent-pager .pager-label {
  font-size: 12px;
  color: var(--txt-mut);
  min-width: 78px;
  text-align: center;
}
.pager-btn {
  background: var(--bg-3);
  color: var(--txt);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-2); }
.pager-btn:active:not(:disabled) { transform: translateY(1px); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }

/* ----- live activity terminal ----- */
.bot-log--section { padding: 0; }
.bot-log--section .bot-log-body { max-height: 280px; }
.bot-log {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}
.bot-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(255,255,255,0.015);
}
.bot-log-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-mut);
}
.bot-log-title .mono {
  text-transform: none;
  letter-spacing: 0;
  color: var(--txt-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.bot-log-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--txt-mut);
  white-space: nowrap;
}
.bot-log-state .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}
.bot-log-state[data-state="running"] { color: #4ade80; }
.bot-log-state[data-state="running"] .dot { animation: cerb-pulse-red 1.4s infinite; }
.bot-log-state[data-state="stale"]   { color: #fbbf24; }
.bot-log-state[data-state="idle"]    { color: #64748b; }

.bot-log-body {
  flex: 1;
  min-height: 132px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.5;
}
.bot-log-empty { color: var(--txt-mut); padding: 6px 2px; }
.bot-log-line {
  display: flex;
  gap: 8px;
  padding: 1px 0;
  color: var(--txt-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.bot-log-line .ll-time { color: var(--txt-mut); flex: 0 0 auto; }
.bot-log-line .ll-svc {
  color: #93c5fd;
  flex: 0 0 auto;
  opacity: 0.85;
}
.bot-log-line .ll-txt { flex: 1 1 auto; min-width: 0; }
.bot-log-line.is-error .ll-txt { color: #fca5a5; }
.bot-log-line.is-error .ll-svc { color: #fca5a5; }

/* Toast message after a successful flip */
.mode-toast[hidden] { display: none; }
.mode-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.40);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  align-self: flex-start;
  animation: cerb-toast-in 200ms ease;
}
.mode-toast.is-error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.45);
  color: #fecaca;
}
@keyframes cerb-toast-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sticky LIVE warning ribbon (only when LIVE is on) */
.mode-live-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(239,68,68,0.20), rgba(239,68,68,0.06));
  border: 1px solid rgba(239,68,68,0.45);
  color: #fecaca;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mode-live-ribbon .ribbon-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(239,68,68,0.8));
}

/* ==================================================================== */
/* Live rounds strip (Expired / Live / Next / Later)                     */
/* ==================================================================== */
.rounds-section {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rounds-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.rounds-title h2 { margin: 0; font-size: 15px; letter-spacing: 0.02em; }
.rounds-sub { color: var(--txt-mut); font-size: 11.5px; }
.rounds-clock { display: flex; gap: 22px; }
.rounds-clock-block { text-align: right; }
.rounds-clock-label {
  color: var(--txt-mut); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rounds-clock-value { font-size: 20px; font-weight: 700; line-height: 1.1; }
#rounds-lock-countdown { color: var(--accent-2); }

.rounds-strip {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.rounds-strip::-webkit-scrollbar { height: 8px; }
.rounds-strip::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.rounds-loading { color: var(--txt-mut); padding: 24px 8px; }
.rounds-error {
  color: var(--bad); font-size: 12.5px; padding: 6px 2px 0;
}

/* ----- a single round card ----- */
.round-card {
  position: relative;
  flex: 0 0 218px;
  display: flex; flex-direction: column;
  padding: 6px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.012) 38%, rgba(0,0,0,0.16) 100%),
    var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  overflow: hidden;
  min-height: 268px;
  box-shadow:
    0 14px 32px -20px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
/* diagonal glass sheen */
.round-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,0.07) 0%, transparent 30%, transparent 100%);
}
.round-card > * { position: relative; z-index: 1; }
.round-card:hover { transform: translateY(-3px); }

.rc-next {
  border-color: rgba(249,115,22,0.55);
  box-shadow:
    0 0 0 1px rgba(249,115,22,0.22),
    0 16px 38px -20px rgba(249,115,22,0.7),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.rc-live {
  border-color: rgba(34,197,94,0.55);
  background:
    radial-gradient(circle at 50% -10%, rgba(34,197,94,0.16), transparent 48%),
    linear-gradient(160deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.012) 38%, rgba(0,0,0,0.16) 100%),
    var(--bg-3);
  animation: rc-live-glow 2.2s ease-in-out infinite;
}
@keyframes rc-live-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(34,197,94,0.28),
      0 0 22px -4px rgba(34,197,94,0.35),
      inset 0 1px 0 rgba(255,255,255,0.05);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(34,197,94,0.5),
      0 0 34px 0 rgba(34,197,94,0.55),
      inset 0 1px 0 rgba(255,255,255,0.06);
  }
}
.rc-expired { opacity: 0.9; }

.rc-live.rc-hasbet { border-color: rgba(34,197,94,0.7); }

.rc-head {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  padding: 11px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin: 0 4px;
}
.rc-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--txt-dim);
}
.rc-next  .rc-state { color: var(--accent-2); }
.rc-live  .rc-state { color: var(--good); }
.rc-epoch { color: var(--txt-mut); font-size: 12px; font-weight: 600; }
.rc-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: rc-pulse 1.4s infinite;
}
@keyframes rc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* payout pills */
.rc-pay {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 8px 0; padding: 9px 13px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid; border-radius: 11px;
}
.rc-pay .rc-dir { display: inline-flex; align-items: center; gap: 6px; }
.rc-pay-up .rc-dir::before { content: "\25B2"; font-size: 10px; }
.rc-pay-dn .rc-dir::before { content: "\25BC"; font-size: 10px; }
.rc-pay-up {
  color: var(--good); border-color: rgba(34,197,94,0.32);
  background: linear-gradient(180deg, rgba(34,197,94,0.18), rgba(34,197,94,0.05));
}
.rc-pay-dn {
  color: var(--bad); border-color: rgba(239,68,68,0.32);
  background: linear-gradient(180deg, rgba(239,68,68,0.18), rgba(239,68,68,0.05));
}
.rc-pay .rc-mult { font-weight: 800; }
.rc-pay-win.rc-pay-up {
  border-color: rgba(34,197,94,0.65);
  box-shadow: 0 0 16px -6px rgba(34,197,94,0.9);
}
.rc-pay-win.rc-pay-dn {
  border-color: rgba(239,68,68,0.65);
  box-shadow: 0 0 16px -6px rgba(239,68,68,0.9);
}

.rc-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 12px 10px; }
.rc-body-inner { width: 100%; }
.rc-livetag {
  text-align: center; color: var(--txt-mut);
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 5px;
}
.rc-bigprice {
  text-align: center; font-size: 23px; font-weight: 800; line-height: 1.15;
  letter-spacing: -0.01em;
}
.rc-delta {
  display: block; width: fit-content; margin: 5px auto 10px;
  padding: 2px 10px; border-radius: 999px;
  text-align: center; font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
}
.rc-delta.pos { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); }
.rc-delta.neg { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); }
.rc-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11.5px; padding: 7px 11px; margin-top: 6px;
  color: var(--txt-dim);
  background: rgba(0,0,0,0.24);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.rc-row-k { letter-spacing: 0.02em; }
.rc-row-v { color: var(--txt); font-weight: 600; }
.rc-countdown {
  margin: 10px 4px 0; padding: 9px 10px; text-align: center;
  font-size: 11px; color: var(--txt-dim);
  background: rgba(0,0,0,0.24); border: 1px solid var(--line);
  border-radius: 10px;
}
.rc-countdown .rc-cd-val { display: block; font-size: 19px; font-weight: 800; color: var(--txt); margin-top: 1px; }
.rc-countdown-strong { border-color: rgba(249,115,22,0.35); background: rgba(249,115,22,0.08); }
.rc-countdown-strong .rc-cd-val { color: var(--accent-2); }
.rc-cd-label { font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--txt-mut); }
.rc-cd-urgent .rc-cd-val { color: var(--bad); animation: rc-blink 1s steps(2) infinite; }
@keyframes rc-blink { 50% { opacity: 0.4; } }
.rc-later-icon { text-align: center; font-size: 30px; opacity: 0.45; margin-bottom: 8px; }

/* our bet ribbon */
.rc-ourbet {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px; padding: 8px 11px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,0.02);
}
.rc-ourbet-up {
  border-color: rgba(34,197,94,0.32);
  box-shadow: inset 3px 0 0 rgba(34,197,94,0.75);
  background: rgba(34,197,94,0.07);
}
.rc-ourbet-dn {
  border-color: rgba(239,68,68,0.32);
  box-shadow: inset 3px 0 0 rgba(239,68,68,0.75);
  background: rgba(239,68,68,0.07);
}
.rc-bet-tag {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700;
  color: var(--txt-dim);
}
.rc-bet-qty { color: var(--txt-dim); }
.rc-bet-test {
  font-size: 9px; padding: 1px 5px; border-radius: 999px;
  background: rgba(234,179,8,0.14); color: var(--warn);
  border: 1px solid rgba(234,179,8,0.4);
}
.rc-bet-res { margin-left: auto; font-weight: 700; }

/* no-signal / no-bet ribbon on current rounds */
.rc-nobet-ribbon {
  border-style: dashed;
  border-color: rgba(234,179,8,0.35);
  background: rgba(234,179,8,0.05);
}
.rc-nobet-msg {
  margin-left: auto; font-weight: 700;
  color: var(--warn); font-size: 11px;
}

/* open-bet $ projection (If Win / If Lose) */
.rc-bet-proj {
  flex-basis: 100%;
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--line);
}
.rc-proj { font-size: 11px; font-weight: 700; }
.rc-proj-win  { color: var(--good); }
.rc-proj-lose { color: var(--bad); }

@media (max-width: 720px) {
  .rounds-clock { gap: 14px; }
  .round-card { flex-basis: 190px; }
}

/* ----- payout-cap AutoTune ----- */
.autotune {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px dashed var(--line-2);
}
.autotune-head {
  display: flex; gap: var(--gap); align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap;
}
.autotune-controls {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.autotune-controls input { width: 72px; }
.autotune-result { margin-top: 12px; }
.autotune-reco {
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 10px 12px; line-height: 1.6;
}
.autotune-table {
  width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13px;
}
.autotune-table th, .autotune-table td {
  padding: 4px 8px; border-bottom: 1px solid var(--line);
}
.autotune-table th { color: var(--txt-dim); font-weight: 600; text-align: left; }
.autotune-table td.r, .autotune-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.autotune-table tr.hit { background: rgba(34,197,94,0.10); }
.autotune-table tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--good); }
@keyframes autotune-flash {
  from { background: rgba(249,115,22,0.35); }
  to   { background: transparent; }
}
input.flash { animation: autotune-flash 1.2s ease-out; }

/* ----- horizontally scrollable table wrapper (wide tables on small screens) */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { margin-top: 0; }

/* ----- mobile navigation (top bar + off-canvas drawer) ----- */
/* Hidden on desktop; activated in the <=720px block below. */
.mobile-topbar { display: none; }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.hamburger {
  width: 40px; height: 38px; flex-shrink: 0;
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  padding: 0 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: 8px;
}
.hamburger span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--txt); transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 720px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 52px;
    padding: 0 14px;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .mobile-brand { display: inline-flex; align-items: center; gap: 8px; }
  .mobile-bnb { margin-left: auto; font-size: 14px; color: var(--txt-dim); }

  /* Sidebar becomes an off-canvas drawer. */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 270px; max-width: 84vw;
    z-index: 70; transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Main content goes full width, clearing the fixed top bar + footer. */
  .main { padding: 66px 14px 64px; }
  .app-footer { left: 0; }
  .topbar {
    flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
    padding-bottom: 12px; margin-bottom: 16px;
  }
  .page-title { font-size: 19px; }
  .topbar-meta { font-size: 12px; }

  /* Denser stat rows so 5-6 metrics stay legible on a phone. */
  .stat-row, .card-wide .stat-row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-num { font-size: 18px; }

  /* 16px form controls so iOS Safari doesn't zoom on focus. */
  input[type="number"], input[type="text"], input[type="password"],
  input[type="email"], select, textarea { font-size: 16px; }

  /* Recent positions: compact + drop low-value columns so the essential
     ones (Epoch/Time/Dir/Qty/Profit/Result/Mode) fit a phone without a wide
     horizontal scroll. Column order is identical in server- and JS-rendered
     rows, so nth-child targeting stays in sync. Hidden: ID(1), Open$(5),
     Close$(6) — Profit already conveys the outcome. */
  #recent-positions-wrap .table { font-size: 12px; }
  #recent-positions-wrap .table th,
  #recent-positions-wrap .table td { padding: 7px 6px; }
  #recent-positions-wrap .table th:nth-child(1),
  #recent-positions-wrap .table td:nth-child(1),
  #recent-positions-wrap .table th:nth-child(5),
  #recent-positions-wrap .table td:nth-child(5),
  #recent-positions-wrap .table th:nth-child(6),
  #recent-positions-wrap .table td:nth-child(6),
  #recent-positions-wrap .table th:nth-child(7),
  #recent-positions-wrap .table td:nth-child(7) { display: none; }
}

@media (max-width: 420px) {
  .stat-row, .card-wide .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Data feed collectors status ------------------------------------ */
.data-feeds-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.data-feeds-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.data-feeds-title h2 { margin: 0; }
.data-feeds-sub { color: var(--txt-mut); font-size: 12px; }

.feed-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
  color: var(--txt-mut);
}
.feed-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 7px currentColor;
}
.feed-pill[data-status="up"]      { color: var(--good); border-color: rgba(34,197,94,0.4); }
.feed-pill[data-status="up"] .dot { animation: cerb-pulse-red 1.6s infinite; }
.feed-pill[data-status="warn"]    { color: var(--warn); border-color: rgba(234,179,8,0.4); }
.feed-pill[data-status="down"]    { color: var(--bad);  border-color: rgba(239,68,68,0.4); }
.feed-pill[data-status="unknown"] { color: var(--txt-mut); }

.data-feeds-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feed-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg-3); border: 1px solid var(--line);
}
.feed-chip .feed-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--txt-mut);
}
.feed-chip[data-status="up"]   .feed-dot { background: var(--good); box-shadow: 0 0 7px var(--good); }
.feed-chip[data-status="warn"] .feed-dot { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.feed-chip[data-status="down"] .feed-dot { background: var(--bad);  box-shadow: 0 0 7px var(--bad); }
.feed-chip .feed-label { flex: 1; font-size: 13px; }
.feed-chip .feed-age { color: var(--txt-mut); font-size: 11.5px; white-space: nowrap; }
.feed-chip[data-status="down"]    { border-color: rgba(239,68,68,0.35); }
.feed-chip[data-status="down"] .feed-age { color: var(--bad); }
.feed-chip[data-status="warn"] .feed-age { color: var(--warn); }

/* ================================================================ */
/* PUBLIC landing + login (no sidebar; visitors see read-only data)  */
/* ================================================================ */
body.public { display: block; min-height: 100vh; }

.public-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 24px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.public-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--txt); text-decoration: none;
}
.public-topbar-right { display: flex; align-items: center; gap: 16px; }
.public-bnb { font-size: 15px; color: var(--txt-dim); }
.btn-login {
  display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: 8px;
  background: var(--accent); color: #0a0c10;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap;
  border: 1px solid var(--accent);
}
.btn-login:hover { background: var(--accent-2); border-color: var(--accent-2); }

.public-main {
  max-width: 1180px; margin: 0 auto;
  padding: 28px 24px 80px;
}

.public-hero { margin-bottom: 24px; }
.public-hero-title {
  margin: 0 0 6px; font-size: 30px; letter-spacing: -0.01em;
}
.public-hero-sub { margin: 0; color: var(--txt-dim); font-size: 14px; max-width: 720px; }

/* Frozen footer spans full width on the public pages (no sidebar). */
.app-footer--public { left: 0; }

/* ---- Login form ---- */
.login-wrap {
  min-height: 56vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card { width: 100%; max-width: 380px; }
.login-title { margin: 0 0 6px; font-size: 22px; }
.login-sub { margin: 0 0 18px; color: var(--txt-mut); font-size: 13px; }
.login-error { margin-bottom: 14px; }
.login-field { display: block; margin-bottom: 14px; }
.login-label {
  display: block; margin-bottom: 6px;
  color: var(--txt-mut); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.login-field input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-3); color: var(--txt);
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; font: inherit;
}
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-submit {
  width: 100%; margin-top: 4px;
  padding: 11px 14px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.login-back {
  display: block; margin-top: 14px; text-align: center;
  color: var(--txt-mut); font-size: 12px; text-decoration: none;
}
.login-back:hover { color: var(--txt-dim); }

.nav-link-logout { margin-top: 6px; color: var(--txt-mut); }
.nav-link-logout:hover { color: var(--bad); }

@media (max-width: 720px) {
  .public-topbar { padding: 12px 14px; }
  .public-main { padding: 20px 14px 72px; }
  .public-hero-title { font-size: 24px; }
}
