/* ── Auction Engine control panel · dark theme ─────────────────────────────── */
:root {
  --bg: #0b0f14;
  --bg-2: #111823;
  --panel: #141d2b;
  --panel-2: #182333;
  --border: #223047;
  --border-2: #2c3d59;
  --text: #dfe8f4;
  --muted: #7d8fa8;
  --accent: #34e0c4;
  --accent-2: #4aa8ff;
  --good: #35d07f;
  --warn: #f4b740;
  --bad: #ff5c6c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(52, 224, 196, 0.08), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(74, 168, 255, 0.07), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* Static soft glow behind everything (no motion). */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 460px at 18% 20%, rgba(52,224,196,0.07), transparent 60%),
    radial-gradient(800px 520px at 85% 75%, rgba(74,168,255,0.06), transparent 60%);
}

/* ── Shell: sidebar + main ───────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; align-items: start; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 22px 18px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: 11px; font-size: 20px; color: #04211d; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(52, 224, 196, 0.35);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 6px 18px rgba(52,224,196,0.30); }
  50% { box-shadow: 0 6px 22px rgba(74,168,255,0.45); }
}
.brand-text h1 { margin: 0; font-size: 16px; letter-spacing: 0.2px; }
.brand-text span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 11px 12px; border-radius: 10px; cursor: pointer; background: transparent; border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-ico { font-style: normal; font-size: 14px; width: 18px; text-align: center; opacity: .85; }
.nav-item:hover { color: var(--text); background: var(--panel-2); transform: translateX(2px); }
.nav-item.active { color: var(--text); background: var(--panel-2); border-color: var(--border); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.active .nav-ico { color: var(--accent); opacity: 1; }
.nav-item { transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }

.side-section { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); padding: 0 2px; }
.master-actions { display: flex; flex-direction: column; gap: 7px; }
.master-actions .btn { width: 100%; text-align: center; }

.side-foot { padding: 0 2px; }

/* ── Main content ────────────────────────────────────────────────────────── */
.main { padding: 22px 28px 60px; min-width: 0; }
.pane-head { margin-bottom: 18px; }
.pane-head h2 { margin: 0 0 4px; font-size: 20px; }
.pane-head p { margin: 0; }

.pane { display: none; animation: fade .2s ease; }
.pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(125,143,168,0.15); flex: none; }
.pill.on   .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(53,208,127,0.18); animation: pulse 2s ease-in-out infinite; }
.pill.off  .dot { background: var(--bad);  box-shadow: 0 0 0 3px rgba(255,92,108,0.18); }
.pill.busy .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(244,183,64,0.18); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(53,208,127,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(53,208,127,0.05); }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  padding: 9px 15px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-2);
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: #1f2e44; border-color: #3a5178; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-good { background: rgba(53,208,127,0.14); border-color: rgba(53,208,127,0.5); color: #a9f0cc; }
.btn-good:hover { background: rgba(53,208,127,0.22); box-shadow: 0 0 16px rgba(53,208,127,0.35); }
.btn-warn { background: rgba(244,183,64,0.13); border-color: rgba(244,183,64,0.5); color: #f6d79a; }
.btn-warn:hover { background: rgba(244,183,64,0.2); box-shadow: 0 0 16px rgba(244,183,64,0.3); }
.btn-bad  { background: rgba(255,92,108,0.13); border-color: rgba(255,92,108,0.5); color: #ffb3ba; }
.btn-bad:hover { background: rgba(255,92,108,0.2); box-shadow: 0 0 16px rgba(255,92,108,0.3); }
.btn-block { width: 100%; margin-top: 12px; }

/* ── Account cards (Dashboard) ──────────────────────────────────────────── */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 22px; }

/* ── Groups: vertical columns, each with a name header + one line per account ── */
.groups-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Accounts view toggle — All / Ungrouped / Hidden. Groups always stay visible. */
.accounts-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-toggle {
  display: inline-flex; flex: 0 0 auto; gap: 2px; padding: 2px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 9px;
}
.view-toggle .vt-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 600; letter-spacing: .2px;
  color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s;
}
.view-toggle .vt-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.view-toggle .vt-btn.on {
  color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 1px 3px rgba(0,0,0,.28);
}
.btn-sm { padding: 5px 11px; font-size: 12px; }
.groups-hint { font-size: 12px; margin: -4px 0 12px; }
.groups-grid { display: flex; gap: 14px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.group-col {
  flex: 0 0 300px; min-width: 260px; max-width: 340px;
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.group-col.drop-hot { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,224,196,0.22); background: rgba(52,224,196,0.08); }
.group-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer;
  padding: 12px 14px; background: linear-gradient(150deg, rgba(52,224,196,0.10), rgba(52,224,196,0.02));
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.group-col-head:hover { background: rgba(52,224,196,0.14); }
.group-col-head .g-name { font-weight: 700; font-size: 15px; }
.group-col-head .g-sub { font-size: 11px; color: var(--muted); }
.group-col-head .g-gear { font-size: 13px; color: var(--muted); }
/* Group-wide power button: a clear labeled pill with a status dot.
   GREEN "● Start all" when the group is off, RED "● Stop all" when it's on. */
.group-col-head .g-power {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 7px 13px; margin-right: 8px; border-radius: 999px;
  cursor: pointer; user-select: none; white-space: nowrap; transition: filter 0.15s ease, transform 0.05s ease;
}
.group-col-head .g-power .g-power-dot {
  width: 9px; height: 9px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 7px currentColor; flex: none;
}
.group-col-head .g-power.off { color: #0a2a17; background: #35d07f; }
.group-col-head .g-power.on  { color: #2a0a0a; background: #ff5252; }
.group-col-head .g-power:hover { filter: brightness(1.12); }
.group-col-head .g-power:active { transform: scale(0.96); }
.group-col-head .g-power.busy { opacity: 0.55; pointer-events: none; }

/* Refresh button: give it an accent outline so it's clearly a control. */
#btn-refresh { border-color: var(--accent); color: var(--accent); font-weight: 600; }
#btn-refresh:hover { background: var(--accent); color: #04120c; }

/* Inline toast — replaces browser alert() dialogs. */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 10px 18px; font-size: 13.5px; z-index: 999;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.group-col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 46px; }
/* one compact line per account: dot + name + live task */
.g-acc-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); cursor: pointer;
}
.g-acc-row:hover { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.g-acc-row .g-acc-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; flex: 0 0 8px; }
.g-acc-row.on .g-acc-dot { background: var(--good); box-shadow: 0 0 7px rgba(45,224,138,.7); }
.g-acc-row .g-acc-name { font-size: 12.5px; font-weight: 600; flex: 0 0 auto; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-acc-row .g-acc-task { font-size: 11px; color: var(--muted); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
/* Take a bot out of the group. Hidden until the row is hovered so the columns
   stay readable, but always present for the keyboard. */
.g-acc-row .g-acc-remove {
  flex: 0 0 auto; margin-left: 6px; padding: 0 5px; line-height: 16px;
  background: transparent; border: 0; border-radius: 4px; cursor: pointer;
  color: var(--muted); font-size: 12px; opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.g-acc-row:hover .g-acc-remove,
.g-acc-row .g-acc-remove:focus-visible { opacity: 1; }
.g-acc-row .g-acc-remove:hover { color: #fff; background: var(--bad, #e5534b); }
.g-acc-row .g-acc-remove:disabled { opacity: .4; cursor: default; }
.g-acc-empty { font-size: 11.5px; color: var(--muted); padding: 10px; text-align: center; border: 1px dashed rgba(255,255,255,.1); border-radius: 8px; }
.group-col-foot { padding: 8px 14px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; border-top: 1px solid rgba(255,255,255,.05); }
.group-col-foot .gf { display: flex; justify-content: space-between; font-size: 11px; }
.group-col-foot .gf .k { color: var(--muted); }
.group-col-foot .gf .v { font-weight: 600; }
.group-col-foot .gf .v.good { color: var(--good); }
.group-col-foot .gf .v.accent { color: var(--accent); }
.groups-empty { padding: 18px 22px; text-align: center; color: var(--muted); font-size: 13px;
  border: 1px dashed rgba(255,255,255,.1); border-radius: 12px; width: 100%; }
.account-card[draggable="true"] { cursor: grab; }
.account-card.dragging { opacity: .5; }
.group-name-input { flex: 1; background: #0c1219; border: 1px solid rgba(255,255,255,.1); color: #e8eef6;
  font-size: 17px; font-weight: 700; padding: 8px 11px; border-radius: 8px; }
.group-members { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.group-member { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 5px 6px 5px 12px; font-size: 12px; }
.group-member button { background: rgba(255,80,80,.15); color: #ff8a8a; border: 0; border-radius: 50%;
  width: 18px; height: 18px; cursor: pointer; font-size: 12px; line-height: 1; }
.group-members-empty { color: var(--muted); font-size: 12px; }
.accounts-empty {
  grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--border-2); border-radius: 14px;
}
.acc-card {
  position: relative; padding: 14px 14px 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  animation: cardIn .35s ease backwards; /* backwards, not both: a finished 'both' fill would pin transform and kill the hover lift */
}
/* Gentle staggered entrance when the roster (re)builds. */
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.acc-card:nth-child(2) { animation-delay: .05s; }
.acc-card:nth-child(3) { animation-delay: .1s; }
.acc-card:nth-child(4) { animation-delay: .15s; }
.acc-card:nth-child(5) { animation-delay: .2s; }
.acc-card:nth-child(n+6) { animation-delay: .25s; }
.acc-card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: 0 10px 22px rgba(0,0,0,0.3); }
.acc-card.focused { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(52,224,196,0.35), 0 10px 24px rgba(0,0,0,0.35); }
.acc-card.is-on { box-shadow: inset 3px 0 0 var(--good); }
.acc-card.focused.is-on { box-shadow: inset 3px 0 0 var(--good), 0 0 0 1px rgba(52,224,196,0.35), 0 10px 24px rgba(0,0,0,0.35); }

.acc-remove {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 7px;
  background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 11px;
  cursor: pointer; display: grid; place-items: center; transition: background .15s ease, color .15s ease;
}
.acc-remove:hover { background: rgba(255,92,108,0.15); border-color: rgba(255,92,108,0.4); color: #ffb3ba; }

.acc-card-top { display: flex; align-items: center; gap: 9px; padding-right: 20px; }
.acc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.acc-dot.on { background: var(--good); box-shadow: 0 0 8px rgba(53,208,127,0.6); animation: pulse 2s ease-in-out infinite; }
.acc-dot.busy { background: var(--warn); box-shadow: 0 0 8px rgba(244,183,64,0.5); }
.acc-dot.off { background: var(--muted); }
.acc-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acc-card-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.acc-phase { font-size: 11.5px; color: var(--muted); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-balance { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(52,224,196,0.25); }

.acc-card-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-action { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.toggle { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 38px; height: 21px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-2);
  position: relative; transition: background .2s ease, border-color .2s ease;
}
.toggle-thumb {
  position: absolute; top: 1px; left: 1px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--muted); transition: transform .2s ease, background .2s ease;
}
.toggle input:checked + .toggle-track { background: rgba(53,208,127,0.25); border-color: rgba(53,208,127,0.55); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(17px); background: var(--good); box-shadow: 0 0 8px rgba(53,208,127,0.6); }
.toggle input:disabled + .toggle-track { opacity: .5; cursor: wait; }

/* ── Focus header ────────────────────────────────────────────────────────── */
.focus-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; }
.focus-head h3 { margin: 0; font-size: 15px; }

/* ── Phase strip ─────────────────────────────────────────────────────────── */
.phase-strip {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
}
.phase-step {
  flex: 1 1 92px; min-width: 92px; text-align: center; position: relative;
  padding: 10px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
}
.phase-step .idx { display: block; font-size: 10px; opacity: .6; margin-bottom: 3px; letter-spacing: 1px; }
.phase-step.active {
  color: #04211d; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; box-shadow: 0 6px 16px rgba(52,224,196,0.28);
  animation: phasePulse 2.4s ease-in-out infinite;
}
.phase-step.active .idx { color: #063a33; opacity: .8; }
@keyframes phasePulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(52,224,196,0.28); }
  50%      { box-shadow: 0 6px 26px rgba(52,224,196,0.55), 0 0 0 1px rgba(52,224,196,0.35); }
}

/* ── Action banner ───────────────────────────────────────────────────────── */
.action-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(52,224,196,0.08), transparent);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px;
}
.action-banner .label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.action-banner .value { font-size: 15px; font-weight: 600; }

/* ── Stat grid ───────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 13px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
.stat::after {
  content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 28%; opacity: .55;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .35s ease, opacity .35s ease;
}
.stat:hover::after { width: 100%; opacity: 1; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); }
.stat .v { font-size: 21px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v.accent { color: var(--accent); text-shadow: 0 0 18px rgba(52,224,196,0.35); }
/* Small line under a stat's value — the True money card uses it for the live
   countdown to the next fleet update. Tabular numerals so a ticking second
   doesn't make the text jitter. */
.stat .sub { margin-top: 5px; font-size: 11px; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat .v.good { color: var(--good); text-shadow: 0 0 16px rgba(53,208,127,0.28); }
.stat .v.bad { color: var(--bad); }
/* Tint each tile toward its value's colour, so the totals row isn't one flat
   slab: teal balance, gold cash, green profit — quiet gradients, not blocks. */
.stat:has(.v.accent) { border-color: rgba(52,224,196,0.28); background: linear-gradient(160deg, rgba(52,224,196,0.08), var(--panel) 55%); }
.stat:has(.v.accent)::after { background: var(--accent); }
.stat:has(.v.good) { border-color: rgba(53,208,127,0.28); background: linear-gradient(160deg, rgba(53,208,127,0.08), var(--panel) 55%); }
.stat:has(.v.good)::after { background: var(--good); }
.stat:has(.v.cash) { border-color: rgba(255,215,106,0.30); background: linear-gradient(160deg, rgba(255,215,106,0.09), var(--panel) 55%); }
.stat:has(.v.cash)::after { background: #ffd76a; }
.stat:has(.v.bad) { border-color: rgba(255,92,108,0.28); background: linear-gradient(160deg, rgba(255,92,108,0.07), var(--panel) 55%); }
.stat:has(.v.bad)::after { background: var(--bad); }
/* Real-life cash — deliberately a different colour to in-game money, so the two
   are never confused at a glance. */
.stat .v.cash { color: #ffd76a; text-shadow: 0 0 18px rgba(255,215,106,0.30); }

/* ── Cards / split ───────────────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.card-head {
  padding: 11px 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.split .card { margin-bottom: 0; }

.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.order-grid .cell { background: var(--panel); padding: 12px 16px; }
.order-grid .k { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.order-grid .v { font-size: 16px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.slots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 7px; padding: 16px; }
.slot { aspect-ratio: 1; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--border); }
.slot.used { background: linear-gradient(135deg, var(--accent), var(--accent-2)); background-size: 200% 200%; border-color: transparent; box-shadow: 0 3px 10px rgba(52,224,196,0.3); animation: shimmer 4s ease infinite; }
@keyframes shimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ── Window inspector ────────────────────────────────────────────────────── */
.window-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; padding: 16px; }
.window-grid { align-content: start; }
/* ── Minecraft container, rendered properly ──────────────────────────────────
   Real GUI proportions and colours, sunken slots, the game's own tooltip, and
   restrained motion: items settle in on open, lift on hover, enchanted things
   shimmer. Nothing bounces or spins — it should read as a game panel, not a toy. */
.mcwin {
  --mc-face: #c6c6c6;
  --mc-slot: #8b8b8b;
  position: relative; display: inline-block;
  background: var(--mc-face);
  padding: 10px 10px 12px;
  border: 2px solid; border-color: #ffffff #565656 #565656 #ffffff;
  box-shadow: 0 0 0 2px #000, 0 18px 40px -18px rgba(0,0,0,0.85);
  image-rendering: pixelated;
  animation: mcwin-in .22s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes mcwin-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }

.mctitle {
  color: #404040; font-size: 12px; letter-spacing: .2px; margin: 1px 1px 7px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 370px;
}
.mctitle.mcinv { margin-top: 12px; }

.mcgrid { display: grid; grid-template-columns: repeat(9, 40px); gap: 0; }
.mcgrid.mchotbar { margin-top: 8px; }

/* A slot: the sunken 18×18 texture — dark top/left, white bottom/right. */
.mcslot {
  position: relative; width: 40px; height: 40px; box-sizing: border-box;
  background: var(--mc-slot);
  border: 2px solid; border-color: #373737 #ffffff #ffffff #373737;
  display: grid; place-items: center;
  transition: background-color .12s ease;
}
.mcslot.filled { cursor: help; }
/* The game's white hover wash, drawn over the item like the real slot highlight. */
.mcslot.filled::after {
  content: ''; position: absolute; inset: 0; background: #fff;
  opacity: 0; transition: opacity .12s ease; pointer-events: none;
}
.mcslot.filled:hover::after { opacity: .32; }

/* The 16×16 texture, scaled with hard pixel edges exactly as the game draws it. */
.mcicon {
  width: 30px; height: 30px; display: block; position: relative; z-index: 1;
  image-rendering: pixelated; image-rendering: crisp-edges;
  animation: mcpop .26s cubic-bezier(.2,.9,.25,1) both;
  animation-delay: var(--d, 0ms);
  transition: transform .12s cubic-bezier(.2,.8,.3,1);
}
@keyframes mcpop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }
.mcslot:hover .mcicon { transform: scale(1.12) translateY(-1px); }

/* Enchantment shimmer — the violet sweep, kept subtle. */
.mcslot:has(.glint)::before {
  content: ''; position: absolute; inset: 2px; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(190,120,255,.55) 50%, transparent 65%);
  background-size: 220% 100%;
  animation: mcglint 2.6s linear infinite;
  mix-blend-mode: screen;
}
@keyframes mcglint { from { background-position: 140% 0; } to { background-position: -40% 0; } }

/* Fallback chip for an id with no texture: a soft tinted disc with a small
   monogram — deliberately quiet, so it never looks like a broken placeholder. */
.mcitem {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--tint) 78%, #fff), var(--tint) 70%);
  color: rgba(255,255,255,.9); font-family: ui-monospace, Consolas, monospace;
  font-size: 9px; font-weight: 700; letter-spacing: .3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.4);
  animation: mcpop .26s cubic-bezier(.2,.9,.25,1) both; animation-delay: var(--d, 0ms);
}

/* Stack count: bottom-right, white with the classic hard drop shadow. */
.mccount {
  position: absolute; right: 2px; bottom: 1px; z-index: 3; line-height: 1;
  color: #fff; font-size: 12px; font-weight: 700;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  text-shadow: 2px 2px 0 rgba(0,0,0,.75); pointer-events: none;
}

/* ── The game's item tooltip ─────────────────────────────────────────────── */
.mctip {
  position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none;
  min-width: 130px; max-width: 320px; padding: 7px 10px 8px;
  background: rgba(16, 0, 24, .96);
  border: 2px solid transparent;
  border-image: linear-gradient(180deg, #5b2ba8, #2b0e63) 1;
  box-shadow: 0 10px 28px -10px rgba(0,0,0,.9);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  animation: mctip-in .1s ease-out both;
}
@keyframes mctip-in { from { opacity: 0; } to { opacity: 1; } }
.mctip-name { color: #fff; font-size: 13px; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.mctip-line { color: #a8a8a8; font-size: 11.5px; margin-top: 3px; text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
.mctip-line.gold { color: #fcd34d; }
.mctip-id { color: #6d5a8a; font-size: 10.5px; margin-top: 5px; }

@media (prefers-reduced-motion: reduce) {
  .mcwin, .mcicon, .mcitem, .mctip { animation: none !important; }
  .mcslot:hover .mcicon { transform: none; }
  .mcslot:has(.glint)::before { animation: none; }
}

.window-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }
.window-list { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: #b9c6db; max-height: 300px; overflow-y: auto; }
.window-list .wrow { display: flex; gap: 8px; }
.window-list .wrow .s { color: var(--accent); min-width: 52px; }
.window-list .wrow .p { color: var(--warn); margin-left: auto; }

/* ── Manual control ──────────────────────────────────────────────────────── */
.manual-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.manual-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.manual-row input {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  padding: 9px 11px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border-2);
}
.manual-row input#manual-cmd { flex: 1; min-width: 220px; }
.manual-row input:focus { outline: none; border-color: var(--accent); }

/* ── Logs ────────────────────────────────────────────────────────────────── */
.logs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.log-card { display: flex; flex-direction: column; margin-bottom: 0; }
.log {
  margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  color: #b9c6db; height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14px); mask-image: linear-gradient(180deg, transparent, #000 14px);
}
#log-error { color: #ffb3ba; }
#log-chat { color: #bfe3d6; }

/* ── Config form ─────────────────────────────────────────────────────────── */
.config-head { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.config-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.save-msg { font-size: 13px; line-height: 1.45; max-width: 100%; flex: 1 1 auto; text-align: right; }
.save-msg.ok { color: var(--good); }
.save-msg.err { color: var(--bad); font-weight: 600; }

.config-form { display: grid; gap: 18px; }
.config-group { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.config-group h3 {
  margin: 0; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.config-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; }
.field .help { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  padding: 9px 11px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border-2);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

/* Proxy split boxes: scheme+host+port on the first row, user+pass on the second.
   The whole field spans the settings grid so the boxes have room to breathe. */
.field-proxy { grid-column: 1 / -1; }
/* Proxy: an on/off switch, one line to paste into, then the split-out boxes. */
.proxy-box { display: flex; flex-direction: column; gap: 7px; }
.proxy-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.proxy-toggle-note { font-size: 11px; font-weight: 400; color: var(--muted); }
.switch-label { letter-spacing: .2px; }

/* A real sliding switch, not a checkbox. The input stays in the DOM (so
   .checked, change events and form reads all work unchanged) but is visually
   hidden behind the track. */
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.switch {
  position: relative; flex: 0 0 auto; width: 38px; height: 21px; border-radius: 999px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.14);
  transition: background .18s ease, border-color .18s ease; box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #d8dee9; box-shadow: 0 1px 3px rgba(0,0,0,.45);
  transition: transform .18s cubic-bezier(.3,.8,.4,1), background .18s ease;
}
.switch-input:checked + .switch { background: var(--accent-2); border-color: transparent; }
.switch-input:checked + .switch .switch-knob { transform: translateX(17px); background: #fff; }
.switch-input:focus-visible + .switch { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.proxy-toggle:hover .switch { border-color: rgba(255,255,255,.28); }
.proxy-oneline { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
/* Switched off: still readable, clearly not in use. */
.proxy-box.proxy-off .proxy-oneline,
.proxy-box.proxy-off .proxy-grid { opacity: .45; }
.proxy-grid { display: grid; grid-template-columns: 92px 1fr 88px; gap: 6px; }
.proxy-grid [data-pp="user"] { grid-column: 1 / 3; }
.proxy-grid [data-pp="pass"] { grid-column: 3 / 4; min-width: 0; }
@media (min-width: 700px) {
  .proxy-grid { grid-template-columns: 92px 1.4fr 80px 1fr 1fr; }
  .proxy-grid [data-pp="user"] { grid-column: auto; }
  .proxy-grid [data-pp="pass"] { grid-column: auto; }
}

/* ── Stats table ─────────────────────────────────────────────────────────── */
.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td { padding: 11px 16px; text-align: left; white-space: nowrap; }
.stats-table thead th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.stats-table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s ease; }
.stats-table tbody tr:last-child { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--panel-2); }
.stats-table td.good { color: var(--good); font-weight: 600; }
.stats-table td.bad { color: var(--bad); font-weight: 600; }

/* ── Requests / Q&A ──────────────────────────────────────────────────────── */
.requests-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.requests-body textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text); resize: vertical; min-height: 70px;
  padding: 10px 12px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border-2);
}
.requests-body textarea:focus { outline: none; border-color: var(--accent); }
.requests-body .btn { align-self: flex-start; }
.requests-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.request-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.request-item:last-child { border-bottom: none; }
.request-when { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.request-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3,6,10,0.72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(440px, 92vw); background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.modal-body { padding: 18px; }

.msa-box { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); text-align: center; }
.msa-box p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.msa-link { color: var(--accent-2); font-weight: 600; word-break: break-all; }
.msa-code {
  margin: 12px 0; font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: 5px;
  color: var(--accent); background: var(--panel); padding: 12px; border-radius: 10px; border: 1px dashed var(--border-2);
}
.msa-actions { display: flex; gap: 8px; justify-content: center; }

.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ── Section labels / new layout bits ────────────────────────────────────── */
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted);
  margin: 4px 2px 10px; font-weight: 700;
}
/* Small gradient tick before each section title — breaks up the flat columns. */
.section-label::before {
  content: ''; width: 14px; height: 3px; border-radius: 2px; flex: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.groups-label::before { background: linear-gradient(90deg, var(--accent-2), #b18bff); }
.logs.two { grid-template-columns: 1fr 1fr; }
.log-card.tall .log { height: 360px; }

/* Per-account login prompt on a card */
.acc-login { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.acc-login b { color: var(--accent); font-family: var(--mono); letter-spacing: 1px; }
.acc-login a { color: var(--accent-2); }
.login-badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: #f6d79a; background: rgba(244,183,64,0.15); border: 1px solid rgba(244,183,64,0.4);
  padding: 1px 6px; border-radius: 6px; margin-right: 4px;
}

/* Focused row in the per-account breakdown table */
.stats-table tbody tr { cursor: pointer; }
.stats-table tbody tr.row-focus { background: rgba(52,224,196,0.08); box-shadow: inset 2px 0 0 var(--accent); }

/* ── Per-bot config modal ────────────────────────────────────────────────── */
.modal-wide { width: min(760px, 94vw); max-height: 90vh; display: flex; flex-direction: column; }
.modal-wide .modal-body { overflow-y: auto; }

.acc-remove {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 7px;
  background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 12px;
  cursor: pointer; display: grid; place-items: center; z-index: 2; transition: background .15s ease, color .15s ease;
}
.acc-remove:hover { background: rgba(255,92,108,0.15); border-color: rgba(255,92,108,0.4); color: var(--bad); }

.acc-action-row { min-height: 15px; }

/* Footer row: prominent settings button on the left, on/off toggle on the right */
.acc-card-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.acc-power { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.acc-power-word { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); min-width: 20px; text-align: right; }
.acc-power-word.on { color: var(--good); }

/* Prominent per-bot settings button */
.acc-settings-btn {
  flex: 1; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text); padding: 8px 12px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-2);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.acc-settings-btn:hover { background: rgba(52,224,196,0.14); border-color: rgba(52,224,196,0.5); color: var(--accent); box-shadow: 0 0 14px rgba(52,224,196,0.2); }

/* Sidebar "Smart cashout all" master button (blue, matching the 🧠 badge). */
.btn-cashout { color: #a9c7ff; border-color: rgba(74,168,255,0.4); }
.btn-cashout:hover { background: rgba(74,168,255,0.14); border-color: #4aa8ff; box-shadow: 0 0 16px rgba(74,168,255,0.3); }

/* Cashout toggles inside the settings modal get their identity colours. */
.mode-cashout { border-left: 3px solid rgba(255,215,106,0.55); }
.mode-cashout b { color: #ffd76a; }
.mode-smartcashout { border-left: 3px solid rgba(74,168,255,0.55); }
.mode-smartcashout b { color: #a9c7ff; }

/* ── "Now selling" box (Dashboard) ───────────────────────────────────────── */
.selling-box {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 4px 0 18px;
  padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(52,224,196,0.10), rgba(74,168,255,0.05));
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
}
.selling-box[hidden] { display: none; }
.selling-left { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.selling-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px rgba(53,208,127,0.7); animation: pulse 2s ease-in-out infinite; }
.selling-name { font-size: 18px; font-weight: 700; text-transform: capitalize; }
.selling-figs { display: flex; gap: 26px; flex-wrap: wrap; margin-left: auto; }
.selling-fig { display: flex; flex-direction: column; gap: 2px; }
.selling-fig .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.selling-fig .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.selling-fig .v.accent { color: var(--accent); }
.selling-fig .v.good { color: var(--good); }

/* ── Smart Selling: 3-mode segmented control (settings modal) ─────────────── */
.smartsell-box { margin-bottom: 14px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.smartsell-head { font-size: 13px; margin-bottom: 8px; }
.smartsell-head small { color: var(--muted); font-weight: 400; }
.smartsell-box .help { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 9px; overflow: hidden; }
.seg-btn {
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 8px 14px; cursor: pointer; background: var(--panel); border: none; border-right: 1px solid var(--border);
  transition: background .15s ease, color .15s ease;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: rgba(52,224,196,0.16); color: var(--accent); }

/* ── Smart Selling status box (Dashboard) ────────────────────────────────── */
.smartsell-status {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 4px 0 18px;
  padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(74,168,255,0.10), rgba(52,224,196,0.04));
  border: 1px solid var(--border); border-left: 3px solid var(--accent-2);
}
.smartsell-status[hidden] { display: none; }
/* percent input with a fixed % suffix so the user only types the number */
.ss-pct-field { margin-top: 10px; max-width: 260px; }
.pct-wrap { position: relative; display: inline-block; }
.pct-wrap input {
  font-family: inherit; font-size: 13.5px; color: var(--text); width: 110px;
  padding: 9px 26px 9px 11px; border-radius: 9px; background: var(--panel); border: 1px solid var(--border-2);
}
.pct-wrap input:focus { outline: none; border-color: var(--accent); }
.pct-suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

.ss-left, .ss-mid { display: flex; flex-direction: column; gap: 2px; }
.ss-mid { padding-left: 20px; border-left: 1px solid var(--border); }
.ss-pct { font-size: 20px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.ss-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.ss-mode { color: var(--accent-2); font-weight: 700; }
.ss-profit { font-size: 20px; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
.ss-sub { font-size: 11px; color: var(--muted); }
.ss-right { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.ss-opps-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.ss-opp { font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; }
.ss-opp small { color: var(--good); }
.ss-none { font-size: 12px; color: var(--muted); font-style: italic; }

/* ── Easy Flip ranking card (Stats) ──────────────────────────────────────── */
.flip-rank-card[hidden] { display: none; }
.flip-rank { display: flex; flex-direction: column; }
.flip-row {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.flip-row:last-child { border-bottom: none; }
.flip-row.traded { background: rgba(52,224,196,0.06); }
.fr-rank { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fr-item { font-size: 13.5px; font-weight: 600; text-transform: capitalize; }
.fr-est { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.fr-est.good { color: var(--good); }
.fr-est.muted { color: var(--muted); }
.flip-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.flip-badge.best { color: #04211d; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.flip-badge.second { color: #a9c7ff; background: rgba(74,168,255,0.15); border: 1px solid rgba(74,168,255,0.4); }
.flip-badge.skip { color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); }

.acc-badges { display: flex; gap: 5px; flex-wrap: wrap; min-height: 18px; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--accent); background: rgba(52,224,196,0.10); border: 1px solid rgba(52,224,196,0.35);
  padding: 1px 7px; border-radius: 6px; text-transform: capitalize;
}
.badge-afk { color: #f6d79a; background: rgba(244,183,64,0.12); border-color: rgba(244,183,64,0.4); text-transform: uppercase; }
.badge-cashout { color: #ffd76a; background: rgba(255,215,106,0.14); border-color: rgba(255,215,106,0.5); }
.badge-smartcashout { color: #a9c7ff; background: rgba(74,168,255,0.14); border-color: rgba(74,168,255,0.5); }
/* Bedrock accounts must be OBVIOUS at a glance: loud badge + green-tinted card. */
.badge-bedrock { color: #7ce8a9; background: rgba(53,208,127,0.16); border-color: rgba(53,208,127,0.55); font-weight: 800; letter-spacing: 0.6px; }
.acc-card.is-bedrock { border-color: rgba(53,208,127,0.4); background: linear-gradient(165deg, rgba(53,208,127,0.07), var(--panel) 45%); }
.badge-flip { color: #a9c7ff; background: rgba(74,168,255,0.12); border-color: rgba(74,168,255,0.4); }
.badge-dim { color: var(--muted); background: var(--panel-2); border-color: var(--border); }

.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mode-toggle {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border);
}
.mode-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.mode-toggle .toggle-track { flex: none; margin-top: 2px; width: 38px; height: 21px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-2); position: relative; transition: background .2s ease, border-color .2s ease; display: inline-block; }
.mode-toggle .toggle-thumb { position: absolute; top: 1px; left: 1px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.mode-toggle input:checked + .toggle-track { background: rgba(53,208,127,0.25); border-color: rgba(53,208,127,0.55); }
.mode-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(17px); background: var(--good); box-shadow: 0 0 8px rgba(53,208,127,0.6); }
.mode-label b { display: block; font-size: 13px; }
.mode-label small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 2px; }

.flip-box { margin-bottom: 14px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.flip-box.disabled { opacity: 0.45; pointer-events: none; }
.flip-box textarea {
  font-family: var(--mono); font-size: 13px; color: var(--text); resize: vertical; width: 100%;
  padding: 9px 11px; border-radius: 9px; background: var(--panel); border: 1px solid var(--border-2);
}
.flip-box textarea:focus { outline: none; border-color: var(--accent); }
.flip-box .btn { margin-top: 8px; }
.cfg-modal-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .split, .logs, .logs.two { grid-template-columns: 1fr; }
  .window-body { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-section { margin-top: 0; }
  .master-actions { flex-direction: row; flex-wrap: wrap; }
  .master-actions .btn { width: auto; flex: 1; }
}

/* ── Alive-but-subtle polish ─────────────────────────────────────────────── */
/* Mode toggles in the modals react to the pointer instead of sitting flat. */
.mode-toggle { transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.mode-toggle:hover { border-color: var(--border-2); background: var(--panel-2); transform: translateY(-1px); }

/* Slim, themed scrollbars for the log feeds and modal bodies. */
.log::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-track, .modal-body::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
.log::-webkit-scrollbar-thumb:hover, .modal-body::-webkit-scrollbar-thumb:hover { background: #3a5178; background-clip: content-box; border: 2px solid transparent; }

/* Group cards + selling box share the hover-lift the account cards have. */
.group-col { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.group-col:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.28); }

/* Anyone who prefers less motion gets none of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Accounts as ranked rows (dashboard) — same slim look as the old
      per-account breakdown table, plus rank medals and inline controls. ────── */
.accounts-card { margin-bottom: 22px; }
.stats-table td.accent { color: var(--accent); font-weight: 600; }
.stats-table .c-rank { width: 44px; text-align: center; font-weight: 700; }
.acc-row .c-rank { font-size: 15px; }
.acc-name-cell { font-weight: 700; }
.stats-table .c-actions { text-align: right; }
.row-actions { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.acc-row .acc-settings-btn { flex: none; padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.acc-row .acc-remove { position: static; width: 24px; height: 24px; }
.acc-login-row td { background: rgba(244,183,64,0.05); }
.acc-row.dragging { opacity: .5; }
.focus-head #btn-unfocus { margin-left: auto; }

/* Symmetrical account columns: fixed layout, evenly balanced widths, numbers
   centred so every row lines up under its header. */
#accounts-table { table-layout: fixed; }
#accounts-table th:nth-child(1),  #accounts-table td:nth-child(1)  { width: 4.5%; text-align: center; }
#accounts-table th:nth-child(2),  #accounts-table td:nth-child(2)  { width: 14%; overflow: hidden; text-overflow: ellipsis; }
#accounts-table th:nth-child(3),  #accounts-table td:nth-child(3)  { width: 10.5%; text-align: center; }
#accounts-table th:nth-child(4),  #accounts-table td:nth-child(4)  { width: 12%; text-align: center; }
#accounts-table th:nth-child(5),  #accounts-table td:nth-child(5)  { width: 12%; text-align: center; }
#accounts-table th:nth-child(6),  #accounts-table td:nth-child(6)  { width: 12%; text-align: center; }
#accounts-table th:nth-child(7),  #accounts-table td:nth-child(7)  { width: 7%;  text-align: center; }
#accounts-table th:nth-child(8),  #accounts-table td:nth-child(8)  { width: 7%;  text-align: center; }
#accounts-table th:nth-child(9),  #accounts-table td:nth-child(9)  { width: 9%;  text-align: center; }
#accounts-table th:nth-child(10), #accounts-table td:nth-child(10) { width: 12%; text-align: right; }

/* Clean glowing power button — green ON / red OFF. */
.acc-power-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 62px; justify-content: center;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  transition: box-shadow .18s ease, transform .12s ease, background .18s ease;
}
.acc-power-btn:active { transform: scale(0.96); }
.acc-power-btn:disabled { opacity: .55; cursor: wait; }
.acc-power-btn .pw-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.acc-power-btn.on {
  color: #dbffeF; border: 1px solid rgba(53,208,127,0.65);
  background: linear-gradient(180deg, rgba(53,208,127,0.30), rgba(53,208,127,0.12));
  box-shadow: 0 0 14px rgba(53,208,127,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
}
.acc-power-btn.on .pw-dot { background: var(--good); box-shadow: 0 0 8px rgba(53,208,127,0.9); animation: pulse 2s ease-in-out infinite; }
.acc-power-btn.on:hover { box-shadow: 0 0 20px rgba(53,208,127,0.55), inset 0 1px 0 rgba(255,255,255,0.14); }
.acc-power-btn.off {
  color: #ffdfe3; border: 1px solid rgba(255,92,108,0.55);
  background: linear-gradient(180deg, rgba(255,92,108,0.26), rgba(255,92,108,0.10));
  box-shadow: 0 0 10px rgba(255,92,108,0.22), inset 0 1px 0 rgba(255,255,255,0.10);
}
.acc-power-btn.off .pw-dot { background: var(--bad); box-shadow: 0 0 8px rgba(255,92,108,0.9); }
.acc-power-btn.off:hover { box-shadow: 0 0 16px rgba(255,92,108,0.45), inset 0 1px 0 rgba(255,255,255,0.10); }

/* ── Withdraw-cash modal ─────────────────────────────────────────────────── */
.wd-stats { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.wd-stat {
  flex: 1 1 30%; min-width: 130px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.wd-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.wd-stat .v { font-size: 15.5px; font-weight: 700; }
.wd-stat .v.accent { color: var(--accent); }
.wd-stat .v.cashv { color: #ffd76a; }
#wd-from { width: 100%; }
.wd-plan { margin: 6px 0 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.wd-plan-row {
  display: flex; justify-content: space-between; padding: 8px 12px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.wd-plan-row:last-child { border-bottom: none; }
.wd-plan-row span:last-child { color: var(--accent); font-weight: 700; }
/* The countdown modal's rows carry a third column (what each bot is doing), so
   the ACCENT belongs on the amount in the middle, not on the status text. */
#wdw-rows .wd-plan-row { gap: 12px; }
#wdw-rows .wd-plan-row span:first-child { flex: 0 0 auto; }
#wdw-rows .wd-plan-row span:nth-child(2) { color: var(--accent); font-weight: 700; margin-left: auto; }
#wdw-rows .wd-plan-row span:last-child { color: var(--muted); font-weight: 400; flex: 0 0 auto; font-size: 12px; }
.wdw-count { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Dashboard "Server API key" box (per-owner; write-only from the browser). */
.apikey-box { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; }
.apikey-label { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.apikey-label.on { color: var(--good); }
#apikey-input {
  width: 190px; padding: 5px 9px; border-radius: 8px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text);
}
#apikey-input:focus { outline: none; border-color: rgba(52,224,196,0.55); }

/* ── Profit session (money stopwatch) ────────────────────────────────────── */
.session-box {
  margin: 0 0 22px; padding: 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
}
.session-box.live { border-color: rgba(53,208,127,0.45); box-shadow: 0 0 22px rgba(53,208,127,0.10); }
.session-main { display: flex; align-items: center; gap: 22px; flex: 1 1 420px; flex-wrap: wrap; }
.session-title { font-size: 13px; font-weight: 700; white-space: nowrap; }
.session-title .muted { font-weight: 500; }
.session-figs { display: flex; gap: 20px; flex-wrap: wrap; }
.sfig { display: flex; flex-direction: column; gap: 2px; }
.sfig .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.sfig .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sfig .v.good { color: var(--good); }
.sfig .v.bad { color: var(--bad); }
.sfig .v.accent { color: var(--accent); }
.session-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sched { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sched input {
  width: 54px; padding: 5px 8px; border-radius: 8px; font-size: 12px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text);
}
.sched input:focus { outline: none; border-color: rgba(52,224,196,0.55); }
.session-sched { flex-basis: 100%; font-size: 11.5px; }

/* Checkpoint marks: divider line above, one row per mark, profit frozen at the
   moment the timer passed it (user rule: "a line and below it"). */
.session-marks { flex-basis: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.smark { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; }
.smark .k { color: var(--muted); min-width: 90px; }
.smark .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.smark .v.good { color: var(--good); }
.smark .v.bad { color: var(--bad); }
.smark.hit .k { color: var(--text); }

/* One line under the combined totals saying why the fleet money reads what it
   reads (which accounts have checked in, when it updates next). */
.fleet-sync { margin: 8px 2px 0; font-size: 11.5px; line-height: 1.45; }

/* ── Sell Bot tab ─────────────────────────────────────────────────────────────
   The sell settings form reuses .config-form; only the bool rows need help —
   a bare toggle inside a .field column, without the big mode-toggle card look. */
.sb-bool .mode-toggle { padding: 2px 0; background: transparent; border: none; }
.sb-bool .mode-toggle:hover { background: transparent; transform: none; }
#sb-table td { white-space: nowrap; }
/* display:flex on .side-section beats the hidden attribute — restore it. */
#auction-side-controls[hidden] { display: none; }
