/* ============================================================
   SKELLY PROTECT — xauto design tokens (classic black theme)
   Elevation is surface colour + a 1px border, never shadows.
   Primary action = white/black; secondary = bordered ghost.
   Green = good, red = failed/destructive, amber = waiting.
   ============================================================ */
:root {
  --bg: #0d0d0d;
  --page: #090909;
  --frame: #101011;
  --surface: #131313;
  --surface2: #171717;
  --elevated: #1f1f1f;
  --input: #0e0e0e;

  --edge: #252525;
  --line: #2e2e2e;
  --hair: #1a1a1a;

  --ink: #ffffff;
  --ink2: #c8c8c8;
  --muted: #808080;
  --faint: #505050;

  --brand: #0070f3;
  --brand2: #1480ff;
  --good: #04c40a;
  --bad: #ff4949;
  --warn: #e9b731;
  --info: #49c3ff;

  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; border-color: var(--edge); }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(0, 112, 243, 0.32); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232323; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #303030; }
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.tabnums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.icon-sm svg.lucide, svg.lucide.sm { width: 14px; height: 14px; }

/* ------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--frame); padding: 17px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-word { font-weight: 800; letter-spacing: -0.03em; font-size: 18px; line-height: 1; }
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); animation: pulse 2s ease-in-out infinite; }
.live.down .live-dot { background: var(--bad); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.nav { margin-top: 24px; display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 0; cursor: pointer;
  border-radius: 10px; padding: 8px 12px; font: 600 13px var(--sans);
  background: transparent; color: var(--muted); transition: background .15s, color .15s;
}
.nav button:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink2); }
.nav button.on { background: var(--elevated); color: var(--ink); }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; font-size: 11px;
  background: rgba(255, 73, 73, .15); color: var(--bad); text-align: center;
}

.side-foot { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.side-foot .row-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.side-foot .row-kv span:first-child { color: var(--muted); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; padding: 28px; }
.mobile-bar { display: none; }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  main { padding: 16px; }
  .mobile-bar {
    display: block; position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line);
    background: rgba(16, 16, 17, 0.95); backdrop-filter: blur(8px);
  }
  .mobile-bar .top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; }
  .mobile-bar .chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
  .mobile-bar .chips::-webkit-scrollbar { display: none; }
  .mobile-bar .chips button {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 38px; border: 0;
    border-radius: 10px; padding: 0 12px; font: 600 13px var(--sans); background: transparent; color: var(--muted);
  }
  .mobile-bar .chips button.on { background: var(--elevated); color: var(--ink); }
}

/* ------------------------------------------------------------ page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ card */
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.card-head {
  display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--line); padding: 12px 16px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
.stat .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stat .value { margin-top: 6px; font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 15px; line-height: 1.3; word-break: break-all; }
.stat .sub { margin-top: 5px; font-size: 11px; color: var(--faint); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border-radius: 10px; font: 600 13px var(--sans); padding: 8px 14px; white-space: nowrap;
  border: 1px solid var(--line); background: transparent; color: var(--ink2);
  transition: background .15s, color .15s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); transform: scale(1.01); }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: #fff; color: #000; border-color: #fff; }
.btn.primary:hover { background: rgba(255, 255, 255, 0.9); color: #000; }
.btn.danger { border-color: rgba(255, 73, 73, 0.4); color: var(--bad); }
.btn.danger:hover { background: rgba(255, 73, 73, 0.1); }
.btn.success { border-color: rgba(4, 196, 10, 0.4); color: var(--good); }
.btn.success:hover { background: rgba(4, 196, 10, 0.1); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.icon { padding: 6px; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ fields */
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.field .hint { display: block; margin-top: 4px; font-size: 11px; color: var(--faint); font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; border-radius: 10px; border: 1px solid #272b27; background: var(--input); color: var(--ink);
  padding: 9px 12px; font: 14px var(--sans); outline: none; transition: border-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand2); }
textarea { min-height: 110px; resize: vertical; font: 12px/1.5 var(--mono); }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink2); cursor: pointer; user-select: none; border: 0; background: none; padding: 0; font-family: var(--sans); }
.toggle .track { position: relative; width: 36px; height: 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--input); transition: .15s; flex-shrink: 0; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .15s; }
.toggle.on .track { border-color: var(--brand2); background: rgba(20, 128, 255, 0.3); }
.toggle.on .knob { left: 19px; background: var(--brand2); }

/* ------------------------------------------------------------ status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02); padding: 3px 10px; font-size: 11px; font-weight: 600; color: var(--ink2); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.pill.good::before { background: var(--good); }
.pill.bad::before { background: var(--bad); }
.pill.warn::before { background: var(--warn); }
.pill.info::before { background: var(--info); }
.tag { display: inline-block; border-radius: 6px; padding: 1px 6px; font-size: 10.5px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 14px; font-size: 13px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink2); }
.banner.bad { border-color: rgba(255, 73, 73, 0.35); background: rgba(255, 73, 73, 0.07); }
.banner.warn { border-color: rgba(233, 183, 49, 0.35); background: rgba(233, 183, 49, 0.07); }
.banner.good { border-color: rgba(4, 196, 10, 0.35); background: rgba(4, 196, 10, 0.07); }
.banner svg { margin-top: 1px; }
.banner.bad svg { color: var(--bad); }
.banner.warn svg { color: var(--warn); }

/* ------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; }
/* Lists cut into pages: a filter above, where we are / previous / next / page size below. */
.pager-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pager-top svg { flex: none; color: var(--faint); width: 15px; height: 15px; }
.pager-top input { flex: 1; min-width: 0; max-width: 360px; }
.pager-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); }
.pager-foot select { width: auto; padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
#co-results + .pager-foot { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .names { min-width: 0; }
.who .n1 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .n2 { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head { width: 28px; height: 28px; border-radius: 5px; image-rendering: pixelated; flex-shrink: 0; background: var(--elevated); }
.head-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.detail { margin-top: 5px; font-size: 11.5px; color: var(--muted); max-width: 420px; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

.code-box { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(233, 183, 49, 0.4); background: rgba(233, 183, 49, 0.07); border-radius: 10px; padding: 6px 8px 6px 12px; }
.code-box .code { font: 700 16px var(--mono); letter-spacing: 0.08em; color: var(--ink); }

/* ------------------------------------------------------------ functions */
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fn { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.fn h4 { margin: 0; font-size: 14px; font-weight: 700; }
.fn p { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1; }
.fn .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.category { margin: 6px 0 -2px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.check-list label:hover { background: rgba(255, 255, 255, 0.04); }
.check-list label.off { opacity: .45; cursor: not-allowed; }
input[type=checkbox] { accent-color: var(--brand2); width: 15px; height: 15px; }

.result { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; }
.result.ok { border-color: rgba(4, 196, 10, 0.35); }
.result.fail { border-color: rgba(255, 73, 73, 0.35); }
.result pre { margin: 6px 0 0; max-height: 220px; overflow: auto; font: 11.5px/1.5 var(--mono); color: var(--ink2); white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------ logs */
.logs { height: calc(100vh - 230px); min-height: 320px; overflow: auto; font: 12px/1.55 var(--mono); padding: 10px 14px; background: var(--frame); border-radius: 0 0 14px 14px; }
.logs .l { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.logs .t { color: var(--faint); flex-shrink: 0; }
.logs .s { color: var(--info); flex-shrink: 0; }
.logs .warn .m { color: var(--warn); }
.logs .error .m { color: var(--bad); }
.mini-log { font: 11.5px/1.6 var(--mono); max-height: 320px; overflow: auto; padding: 10px 14px; }
.mini-log .l { display: flex; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-log .l .m { overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ modal / toast / login */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.modal-box { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.modal-box.wide { max-width: 760px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
/* "Are you sure?" — above everything but the toasts, an open modal included. */
.modal.confirm-layer { z-index: 85; }
.modal-box.narrow { max-width: 460px; }
.confirm-title { display: flex; gap: 10px; align-items: center; }
.confirm-title svg { flex: none; color: var(--warn); }
.confirm-title.danger svg { color: var(--bad); }
.confirm-text { margin: 0; color: var(--ink2); font-size: 13px; line-height: 1.5; white-space: pre-line; }
.confirm-names { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.solid:hover { background: #e63e3e; color: #fff; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 90; max-width: 420px; border: 1px solid var(--line); background: var(--elevated); border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.toast.good svg { color: var(--good); }
.toast.bad { border-color: rgba(255, 73, 73, 0.45); }
.toast.bad svg { color: var(--bad); }

.login { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: var(--page); padding: 16px; }
.login .card { width: 100%; max-width: 360px; }
.dot-grid { background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 22px 22px; }

.chat-box { height: 360px; overflow: auto; font: 12px/1.55 var(--mono); padding: 10px 14px; background: var(--frame); border-bottom: 1px solid var(--line); }
.chat-box .bar { color: var(--warn); }

/* ---- guard ---------------------------------------------------------------------------------- */
/* The server cannot be reached (a restart, the connection): says so, and goes when it is back. */
.conn-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(233, 183, 49, 0.45); background: var(--elevated); color: var(--ink2);
  font-size: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.conn-bar .live-dot { background: var(--warn); }
.alert-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(255, 73, 73, 0.55); background: rgba(255, 73, 73, 0.12); color: var(--ink); font-size: 13px;
  animation: alert-pulse 1.6s ease-in-out infinite; }
.alert-bar svg { color: var(--bad); flex: none; }
.alert-bar .grow { min-width: 0; }
.alert-bar .more { color: var(--ink2); font-size: 12px; margin-top: 2px; }
@keyframes alert-pulse { 50% { background: rgba(255, 73, 73, 0.22); } }
.alert-list .a { display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.alert-list .a:first-child { border-top: 0; }
.alert-list .a .t { color: var(--faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; padding-top: 2px; }
.alert-list .a.danger { background: rgba(255, 73, 73, 0.06); }
.alert-list .a.danger.unacked { background: rgba(255, 73, 73, 0.14); }
.player-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.player-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.player-chip.bad { border-color: rgba(255, 73, 73, 0.5); color: var(--bad); }
.player-chip.good { border-color: rgba(4, 196, 10, 0.4); color: var(--good); }

/* ---- money ---------------------------------------------------------------------------------- */
.chart { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; }
.chart-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.chart svg { width: 100%; height: 140px; display: block; }
.chart .bar { fill: rgba(4, 196, 10, 0.55); }
.chart .bar.today { fill: var(--good); }
.chart .bar:hover { fill: var(--good); }
.chart .axis { fill: var(--faint); font-size: 10px; font-family: var(--mono); }
.tabnums { font-variant-numeric: tabular-nums; }

/* "Estimated per day": what the standing piles should make, with the bone price next to it. */
.est { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.est-main { min-width: 170px; }
.est .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.est .value { margin-top: 6px; font-size: 24px; font-weight: 700; line-height: 1; color: var(--good); font-variant-numeric: tabular-nums; }
.est .sub { margin-top: 5px; font-size: 11px; color: var(--faint); }
.est-how { flex: 1 1 260px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.est-how b { color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums; }
.est-price { display: block; }
.est-price > span:first-child { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.money-input { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--input); overflow: hidden; }
.money-input i { padding: 0 2px 0 10px; font-style: normal; color: var(--muted); }
.money-input input { width: 92px; border: 0; background: transparent; color: var(--ink); padding: 8px 10px 8px 4px; font: inherit; font-variant-numeric: tabular-nums; outline: none; }
.money-input:focus-within { border-color: var(--brand); }

/* The pop-up over a day's bar. */
.chart-wrap { position: relative; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit.on { fill: rgba(255, 255, 255, 0.045); }
.chart .bar.on { fill: var(--good); }
.chart .bar.neg { fill: rgba(255, 73, 73, 0.6); }
.chart .bar.neg.on, .chart .bar.neg:hover { fill: var(--bad); }
.chart-tip { position: absolute; z-index: 5; min-width: 220px; max-width: 270px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--elevated); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); pointer-events: none; }
.chart-tip .tip-date { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.chart-tip .tip-amount { margin-top: 4px; font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--good); font-variant-numeric: tabular-nums; }
.chart-tip .tip-exact { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.chart-tip .tip-rows { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--hair); display: grid; gap: 4px; }
.chart-tip .tip-rows div { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; color: var(--muted); }
.chart-tip .tip-rows b { color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-tip .up { color: var(--good) !important; }
.chart-tip .down { color: var(--bad) !important; }

/* ---- the flipper */
/* a two- or three-way switch (Microsoft email | Token) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--input); flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg button + button { border-left: 1px solid var(--hair); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--elevated); color: var(--ink); }

/* what trading is allowed to do right now: off / dry run / live / paused */
.mode { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.mode .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.mode .grow { min-width: 0; }
.mode .what { font-weight: 700; font-size: 14px; }
.mode .why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mode.off .dot { background: var(--faint); }
.mode.dry-run { border-color: rgba(73, 195, 255, 0.35); background: rgba(73, 195, 255, 0.05); }
.mode.dry-run .dot { background: var(--info); }
.mode.live { border-color: rgba(4, 196, 10, 0.35); background: rgba(4, 196, 10, 0.05); }
.mode.live .dot { background: var(--good); animation: pulse 1.3s ease-in-out infinite; }
.mode.paused { border-color: rgba(255, 73, 73, 0.4); background: rgba(255, 73, 73, 0.07); }
.mode.paused .dot { background: var(--bad); }

.pos { color: var(--good); }
.neg { color: var(--bad); }

/* the market's price line */
.chart .line { fill: none; stroke: var(--good); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .line.mid { stroke: var(--info); stroke-dasharray: 4 3; stroke-width: 1.5; }
.chart .grid { stroke: var(--hair); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .legend { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; }
.chart .legend i { display: inline-block; width: 14px; height: 2px; background: var(--good); }
.chart .legend i.mid { background: var(--info); }

/* ------------------------------------------------------------ profit page (2026-11-07) */
.pp-kpis .stat .value { font-size: 26px; }
.pp-chart svg { height: 200px; }
.chart .bar.part { fill: rgba(4, 196, 10, 0.28); }
.chart .bar.part.on, .chart .bar.part:hover { fill: rgba(4, 196, 10, 0.5); }
.chart .grid.base { stroke: var(--line); }
.chart .ylab { fill: var(--faint); font-size: 10px; font-family: var(--mono); }
th.num, td.num { text-align: right; }
td.strong { font-weight: 700; }
tfoot tr.total td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface2); white-space: nowrap; }
.chips-cell { display: flex; flex-wrap: wrap; gap: 4px; max-width: 340px; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; line-height: 1.5; color: var(--ink2); background: var(--surface2); white-space: nowrap; }
.chip.test { color: var(--muted); border-style: dashed; background: transparent; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 104px; }
.spark i { flex: 1 1 0; min-width: 4px; border-radius: 2px 2px 0 0; background: rgba(4, 196, 10, 0.6); }
.spark i.neg { background: rgba(255, 73, 73, 0.65); }
.spark i.zero { background: var(--edge); }
.pp-who { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.pp-state { display: flex; align-items: center; gap: 6px; }
#pp-accounts td, #pp-accounts th { padding-left: 12px; padding-right: 12px; }
#pp-accounts .chips-cell { max-width: 300px; }
/* Phones: the alert's buttons go under its text instead of squeezing it into one word a line. */
@media (max-width: 640px) {
  .alert-bar { flex-wrap: wrap; align-items: flex-start; }
  .alert-bar .grow { flex: 1 1 calc(100% - 40px); }
}

/* Bulk add (2026-11-14): the paste box doubles as a file drop zone. */
.bulk-drop textarea { width: 100%; min-height: 150px; }
.bulk-drop.over textarea { outline: 2px dashed var(--brand); outline-offset: 2px; background: var(--elevated); }
.bulk-tok { font: 11px/1.4 var(--mono); color: var(--muted); }
