:root {
    --bg: #f5c84b;
    /* brand yellow (page) */
    --bg-soft: #f7d268;
    --card: #ffffff;
    --card-2: #fbf7ec;
    /* insets / hover */
    --ink: #1c1b1a;
    /* near-black text + bold linework */
    --muted: #6f6a5f;
    --line: #ece4d0;
    /* hairline on white */
    --line-bold: #1c1b1a;
    /* bold outline */
    --brand: #f5c84b;
    --brand-deep: #d99f27;
    /* amber accent / hover */
    --green: #2e9e5b;
    --red: #e0483f;
    --pink: #eb6e8a;
    --discord: #5865f2;
    --discord-hover: #4954d4;
    --radius: 12px;
    --shadow: 0 6px 18px rgba(28, 27, 26, 0.12);
    --shadow-card: 0 2px 0 rgba(28, 27, 26, 0.06);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

/* The hidden attribute must always win, even over display:flex on a class. */
[hidden] {
    display: none !important;
}

/* ── Recurring schedule templates ──────────── */
.tpl-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tpl-add input[type="text"] { flex: 1; min-width: 140px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
.tpl-add select, .tpl-add input[type="time"] { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-family: inherit; font-weight: 600; }
.tpl-item .rule-channel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-time, .tpl-day { background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 3px 7px; font-size: 12px; font-family: inherit; font-weight: 600; }
.tpl-type { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: #efe9db; color: #6f6a5f; }
.tpl-pvp { background: #fbd9d6; color: #a3251d; }
.tpl-pve { background: #cdeecf; color: #1c1b1a; }
.tpl-boss { background: #fbe8c2; color: #8a5a06; }

/* ── Event card (activity style) ──────────── */
.ev-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .ev-form-grid { grid-template-columns: 1fr; } }
.ev-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 4px 0 14px; }
.ev-check input { width: 16px; height: 16px; accent-color: var(--brand-deep); }
.event-headmain { min-width: 0; }
.event-titlerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; padding: 2px 8px; border-radius: 6px; background: var(--brand); border: 2px solid var(--ink); color: var(--ink); }
.ev-mandatory { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: #fbd9d6; color: #a3251d; border: 2px solid #a3251d; }
.count-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; }
.cnt { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); }
.cnt-yes { background: #cdeecf; }
.cnt-maybe { background: #fbe8c2; }
.cnt-no { background: #efe9db; color: #6f6a5f; }
.cnt-wait { background: #fbd9d6; color: #a3251d; }
.event-deadline { font-size: 12px; color: var(--muted); margin-left: auto; font-weight: 600; }

/* ── Calendar ──────────── */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title { font-size: 17px; font-weight: 800; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 86px; background: var(--card-2); border: 2px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal-empty { background: transparent; border-color: transparent; }
.cal-today { border-color: var(--ink); }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-today .cal-daynum { color: var(--ink); }
.cal-chip { text-align: left; border: 1.5px solid var(--ink); border-radius: 5px; padding: 2px 5px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; }
.cal-chip .cal-time { font-weight: 800; }
.cal-chip.sel { outline: 2px solid var(--brand-deep); outline-offset: 1px; }
.cal-event { background: #fff; }
.cal-pve { background: #cdeecf; }
.cal-pvp { background: #fbd9d6; }
.cal-boss { background: #fbe8c2; }

/* ── Admin sidebar layout ──────────── */
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }
.admin-side {
  width: 210px; flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; padding: 14px 10px;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; color: #fff; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: transparent; border: none; color: #cfcabf; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none; text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: var(--brand); color: var(--ink); font-weight: 800; }
.nav-item i { font-size: 18px; }
.admin-side-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 10px; }
.admin-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 13px; color: #cfcabf; }
.admin-user .btn-ghost { color: #cfcabf; border-color: rgba(255, 255, 255, 0.25); }
.admin-user .btn-ghost:hover { color: #fff; border-color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 20px 22px 50px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-title { font-size: 20px; font-weight: 800; }
.events-frame { width: 100%; height: calc(100vh - 96px); border: 2px solid var(--ink); border-radius: 14px; background: var(--bg); }
body.embed .topbar { display: none; }
body.embed .dash { padding-top: 14px; }

/* ── Boss tracker (map layout) ──────────── */
.bt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .bt-wrap { grid-template-columns: 1fr; } }

/* left: map */
.bt-mapcard { background: var(--ink); border: 2px solid var(--ink); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-card); }
.bt-maptools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bt-hint { font-size: 12px; font-weight: 700; color: var(--brand); }
.bt-mapview { position: relative; width: 100%; margin-inline: auto; background: #0d0d0f url("/maps/_grid.svg"); background-size: cover; border: 2px solid #000; border-radius: 12px; overflow: hidden; user-select: none; cursor: grab; touch-action: none; }
.bt-mapview.bt-panning { cursor: grabbing; }
.bt-mapview.bt-adding { cursor: crosshair; }
.bt-mapinner { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.bt-mapimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* territory dropdown */
.bt-terrsel { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: #cfcabf; }
.bt-terrsel select { font-family: inherit; font-size: 13px; font-weight: 700; color: #fff; background: #0d0d0f; border: 2px solid #000; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.bt-terrsel select:focus { outline: none; border-color: var(--brand); }
#btSelLoc { font-family: inherit; font-size: 13px; font-weight: 600; color: #fff; background: #0d0d0f; border: 2px solid #000; border-radius: 8px; padding: 6px 10px; width: 100%; cursor: pointer; }
#btSelLoc:focus { outline: none; border-color: var(--brand); }

/* zoom controls */
.bt-zoomctl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.bt-zoomctl button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; background: rgba(13,13,15,.85); border: 2px solid #000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.bt-zoomctl button:hover { background: var(--brand); color: #1c1b1a; }
.bt-mapmissing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #cfcabf; padding: 24px; }
.bt-mapmissing i { font-size: 38px; color: var(--brand); }
.bt-mapmissing span { font-weight: 800; font-size: 16px; color: #fff; }
.bt-mapmissing small { font-size: 12px; color: #a7a297; max-width: 260px; line-height: 1.5; }
.bt-mapmissing code { background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 4px; }
.bt-pins { position: absolute; inset: 0; --pin-scale: 1; }

/* pins — small subtle ring markers; the name shows only on hover as a dark tooltip */
.bt-pin { position: absolute; transform: translate(-50%, -50%) scale(var(--pin-scale, 1)); transform-origin: center; display: block; background: transparent; border: 0; padding: 0; cursor: pointer; touch-action: none; z-index: 2; font-family: inherit; }
.bt-pin.sel { z-index: 8; }
.bt-pin-mark { --pc: #9aa0aa; display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1c1b1a; box-shadow: 0 0 0 2px #d9c38a, 0 2px 5px rgba(0,0,0,.6); background: radial-gradient(circle, #fff 0 15%, var(--pc) 15% 54%, #241f1a 54% 68%, var(--pc) 68% 100%); }
.bt-pin-label { position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); font-size: 12px; font-weight: 700; color: #fff; background: rgba(9,11,18,.96); border: 1px solid rgba(255,255,255,.14); border-radius: 7px; padding: 5px 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 6px 16px rgba(0,0,0,.55); z-index: 12; }
.bt-pin-label::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: rgba(9,11,18,.96); }
.bt-pin:hover { z-index: 20; }
.bt-pin:hover .bt-pin-label, .bt-pin.sel .bt-pin-label { opacity: 1; }
.bt-pin.bt-up .bt-pin-mark { --pc: #e8443a; }
.bt-pin.bt-wait .bt-pin-mark { --pc: #e8b84b; }
.bt-pin.bt-unknown .bt-pin-mark { --pc: #9aa0aa; }
.bt-pin.bt-elite .bt-pin-mark { --pc: #a56be0; width: 22px; height: 22px; box-shadow: 0 0 0 2px #d9c38a, 0 0 12px 2px rgba(150,90,220,.7), 0 2px 6px rgba(0,0,0,.6); animation: btPulse 1.9s ease-in-out infinite; }
@keyframes btPulse {
  0%, 100% { box-shadow: 0 0 0 2px #d9c38a, 0 0 9px 1px rgba(150,90,220,.5), 0 2px 6px rgba(0,0,0,.6); }
  50% { box-shadow: 0 0 0 2px #e8d3a0, 0 0 18px 5px rgba(150,90,220,.9), 0 2px 6px rgba(0,0,0,.6); }
}
.bt-pin.sel:not(.bt-elite) .bt-pin-mark { box-shadow: 0 0 0 2px var(--brand), 0 2px 8px rgba(0,0,0,.7); }

/* custom boss-location pins: a distinct SVG marker, no hover tooltip */
.bt-pin.bt-custom { transform: translate(-50%, -100%) scale(var(--pin-scale, 1)); transform-origin: 50% 100%; }
.bt-pin.bt-custom .bt-custom-svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.55)); }
.bt-pin.bt-custom.sel .bt-custom-svg { filter: drop-shadow(0 0 3px var(--brand)) drop-shadow(0 2px 3px rgba(0,0,0,.55)); }
.bt-legcustom { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; background: #e8443a; border: 1.5px solid #1c1b1a; border-radius: 50% 50% 50% 0; transform: rotate(45deg); }
.bt-zoomctl button.active { background: var(--brand); color: #1c1b1a; }

.bt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; color: #cfcabf; font-size: 12px; font-weight: 600; }
.bt-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #000; box-shadow: 0 0 0 1.5px rgba(255,255,255,.6); vertical-align: -1px; margin-right: 4px; }
.bt-dot.bt-up { background: var(--red); } .bt-dot.bt-wait { background: var(--brand); } .bt-dot.bt-unknown { background: #b8b2a4; }
.bt-dot.bt-elite { background: radial-gradient(circle, #c79bff 0%, #7b45c8 72%); }
.bt-legnote { margin-left: auto; color: #8f8a80; }

/* right: side panel */
.bt-side { display: flex; flex-direction: column; gap: 14px; }
.bt-tabs { display: flex; gap: 6px; }
.bt-tab { flex: 1; padding: 9px 8px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; font-family: inherit; cursor: pointer; }
.bt-tab.active { background: var(--ink); color: #fff; }
.bt-block { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-card); }
.bt-block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.bt-block-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.bt-block-note { font-size: 11px; font-weight: 700; color: var(--muted); }
.bt-terrcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bt-terr { text-align: left; background: var(--card-2); border: 2px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 6px; }
.bt-terr.active { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.bt-terr-top { display: flex; align-items: center; justify-content: space-between; }
.bt-terr-name { font-weight: 800; font-size: 14px; }
.bt-terr-h { font-size: 10px; font-weight: 800; color: var(--muted); background: #efe9db; padding: 1px 6px; border-radius: 5px; }
.bt-terr-time { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 15px; padding: 2px 8px; border-radius: 7px; border: 2px solid var(--ink); text-align: center; }

/* status colors (shared) */
.bt-wait { background: #fbe8c2; color: #8a5a06; }
.bt-up { background: #fbd9d6; color: #a3251d; }
.bt-unknown { color: #6f6a5f; }

/* selected boss detail */
.bt-selected { display: flex; flex-direction: column; gap: 12px; }
.bt-sel-head { display: flex; flex-direction: column; gap: 2px; }
.bt-sel-kicker { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--brand-deep); }
.bt-sel-name { font-size: 20px; font-weight: 800; line-height: 1.1; }
.bt-sel-terr { font-size: 12px; color: var(--muted); font-weight: 600; }
.bt-sel-countdown { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 30px; text-align: center; padding: 10px; border-radius: 12px; border: 2px solid var(--ink); letter-spacing: 1px; }
.bt-sel-row { display: flex; flex-direction: column; gap: 10px; }
.bt-field { display: flex; flex-direction: column; gap: 5px; }
.bt-field-lab { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.bt-field-in { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.bt-field input { background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; font-family: inherit; font-weight: 600; }
.bt-field input[type="number"] { width: 84px; }
.bt-field input[type="text"] { width: 100%; }
.bt-field input:focus { outline: none; border-color: var(--ink); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink.active { background: var(--brand); color: var(--ink); }
.btn-ink:hover:not(:disabled) { background: #34322e; }
.btn-ink.active:hover { background: var(--brand-deep); }
.btn-defeat { width: 100%; justify-content: center; padding: 13px; font-size: 15px; font-weight: 800; background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 11px; cursor: pointer; font-family: inherit; text-transform: uppercase; letter-spacing: .4px; }
.btn-defeat:hover { background: #c63b33; }
.bt-sel-actions { display: flex; gap: 16px; justify-content: center; }
.linkish { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: underline; padding: 2px; }
.linkish:hover { color: var(--ink); }
.linkish.bt-danger { color: var(--red); }
.bt-sel-empty { background: var(--card-2); border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ── tracker parity: territory timers header ── */
.bt-timers-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bt-timers-titles { display: flex; flex-direction: column; gap: 1px; }
.bt-timers-def { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 16px; color: var(--brand-deep); white-space: nowrap; }
.bt-timers-sub { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.45; margin: 8px 0 12px; }

/* territory cards */
.bt-terr-badge { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 6px; border: 1.5px solid var(--ink); }
.bt-terr-loc { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* selected territory panel */
.bt-sel-head { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.bt-sel-diamond { width: 46px; height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--ink); background: #171614; box-shadow: inset 0 1px 4px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.3); }
.bt-sel-diamond svg { display: block; }
.bt-sel-heading { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.bt-sel-status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 7px; border: 2px solid var(--ink); white-space: nowrap; }
.bt-sel-mid { display: flex; align-items: center; gap: 12px; }
.bt-sel-mid .bt-sel-countdown { flex: 1; margin: 0; }
.bt-field-est .bt-field-lab { text-align: right; }
.bt-confirm { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.bt-confirm-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #1c6b3a; background: #d6f2df; border: 1.5px solid #1c6b3a; border-radius: 6px; padding: 2px 8px; }
.bt-sel-killtime { font-size: 12px; font-weight: 700; color: var(--ink); margin: 0; }
.bt-sel-hintnote { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.45; margin: 0; }
.bt-field select { background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; font-family: inherit; font-weight: 600; width: 100%; cursor: pointer; }
.bt-field select:focus { outline: none; border-color: var(--ink); }

/* Enter kill time modal */
.bt-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(9,11,18,.6); padding: 20px; }
.bt-modal[hidden] { display: none; }
.bt-modal-card { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 20px; width: min(380px, 100%); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 12px; }
.bt-modal-title { font-size: 16px; font-weight: 800; margin: 0; }
.bt-modal-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0; }
.bt-modal input[type="datetime-local"] { background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; font-family: inherit; font-weight: 600; }
.bt-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.bt-modal-actions .btn-defeat { width: auto; padding: 10px 18px; }

/* history */
.bt-history-btn { margin-left: auto; }
.bt-history-card { width: min(480px, 100%); }
.bt-history-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.bt-history-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--card-2); }
.bt-hist-time { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.bt-hist-text { font-size: 13px; font-weight: 600; color: var(--ink); }
.bt-hist-empty { text-align: center; color: var(--muted); font-weight: 600; background: transparent !important; }
.bt-modal-actions .linkish.bt-danger { margin-right: auto; }

/* legacy list styles (kept for reference) */
.boss-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.boss-region-h { font-size: 13px; font-weight: 800; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); }
.boss-list { display: flex; flex-direction: column; gap: 8px; }
.boss-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card-2); border: 2px solid var(--line); border-radius: 10px; }
.boss-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.boss-name { font-weight: 700; font-size: 14px; }
.boss-kind { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: #efe9db; color: #6f6a5f; }
.boss-cycle { font-size: 12px; color: var(--muted); }
.boss-status { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 15px; padding: 3px 10px; border-radius: 8px; border: 2px solid var(--ink); min-width: 96px; text-align: center; }
.boss-wait { background: #fbe8c2; color: #8a5a06; }
.boss-up { background: #cdeecf; color: #1c1b1a; }
.boss-unknown { background: #efe9db; color: #6f6a5f; }
.boss-actions { display: flex; gap: 6px; flex-shrink: 0; }
.boss-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.boss-tab { padding: 8px 16px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; }
.boss-tab.active { background: var(--ink); color: #fff; }
.boss-item .boss-cycle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.boss-est { width: 66px; background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 3px 6px; font-size: 12px; font-family: inherit; font-weight: 600; }
.boss-loc { flex: 1; min-width: 90px; max-width: 200px; background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; font-family: inherit; }
.boss-addbox { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--line); }
.boss-addbox input[type="text"] { flex: 1; min-width: 120px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
.boss-addbox input[type="number"] { width: 72px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 8px; font-size: 14px; font-family: inherit; }
.boss-addbox select { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 8px; font-size: 14px; font-family: inherit; font-weight: 600; }
@media (max-width: 600px) {
  .boss-item { flex-wrap: wrap; }
  .boss-status { min-width: 80px; font-size: 13px; }
}
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; }
  .admin-brand { padding: 0 8px 0 4px; }
  .admin-nav { flex-direction: row; flex: 1 1 100%; order: 3; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
  .nav-item { width: auto; padding: 8px 10px; }
  .admin-side-foot { flex-direction: row; border-top: none; padding-top: 0; margin-left: auto; }
  .admin-user #userName { display: none; }
  .admin-main { padding: 16px 12px 40px; }
}
@media (max-width: 600px) {
  .cal-cell { min-height: 58px; padding: 2px; }
  .cal-chip { font-size: 9px; padding: 1px 3px; }
  .cal-title { font-size: 15px; min-width: 110px; }
}

/* ── Events (guild manager) ──────────── */
.start-row input[type="text"],
.start-row input[type="datetime-local"],
.start-row input[type="number"],
.start-row textarea {
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}
.start-row textarea { resize: vertical; }
.slot-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.slot-input-row .slot-name { flex: 1; }
.slot-input-row .slot-cap-in { width: 90px; }
.event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-title { font-size: 17px; font-weight: 800; }
.event-when { color: var(--muted); font-size: 13px; margin-top: 2px; }
.event-cd { color: var(--brand-deep); font-weight: 700; }
.event-desc { font-size: 14px; margin: 10px 0 0; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.slot-block { flex: 1; min-width: 140px; background: var(--card-2); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.slot-head { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.slot-cap { color: var(--muted); }
.slot-people { display: flex; flex-wrap: wrap; gap: 5px; }
.person { background: #fff; border: 1px solid var(--ink); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.rsvp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 2px solid var(--line); padding-top: 12px; }
.rsvp-slot { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-family: inherit; font-weight: 600; }
.maybe-line { color: var(--muted); font-size: 12px; margin-left: auto; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

/* ── Mascot logo ─────────────────────── */
.mascot {
    display: block;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--ink);
    object-fit: cover;
}

/* ── Buttons ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s, color 0.15s, opacity 0.15s;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 7px 13px;
    font-size: 14px;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #34322e;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--ink);
}

.btn-danger:hover:not(:disabled) {
    background: #c63b33;
}

.btn-discord {
    background: var(--discord);
    color: #fff;
    border-color: var(--ink);
    gap: 9px;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.btn-discord:hover {
    background: var(--discord-hover);
}

.btn-discord svg {
    width: 20px;
    margin-top: 3px;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ── Login ───────────────────────────── */
.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.logo-mark {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
}

.logo-mark .mono {
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 1px;
}

.ping {
    position: absolute;
    top: -1px;
    right: 5px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--ink);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.login-logo {
    width: 100%;
    border-radius: 100%;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 28px;
    font-size: 15px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin: 18px 0 0;
}

.error {
    color: var(--red);
    font-size: 14px;
    margin-top: 14px;
    font-weight: 600;
}

/* ── Top bar ─────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    border-bottom: 2px solid var(--ink);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    min-width: 0;
}

#botTitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand .mascot {
    width: 32px;
    height: 32px;
}

.logo-dot {
    position: relative;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--ink);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-dot-small {
    position: relative;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--ink);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-dot .mascot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding-right: 12px;
    margin-right: 2px;
    border-right: 2px solid var(--line);
}

.back-link:hover {
    color: var(--ink);
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.user img {
    border-radius: 50%;
    border: 2px solid var(--ink);
}


@media (max-width: 720px) {
    #botTitle {
        display: none;
    }
}

/* ── Dashboard layout ────────────────── */
.dash {
    max-width: 980px;
    margin: 0 auto;
    padding: 26px 22px 60px;
}

.card {
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 18px;
}

.card h2 {
    margin: 0 0 4px;
    font-size: 16px;
}

.card-sub {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.5;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.volume-card {
    grid-column: 1 / -1;
}

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

/* two-column relay layout: controls + volume | log + fleet */
.relay-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.relay-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.relay-col .card {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .relay-col {
        margin-bottom: 18px;
    }

    .relay-cols {
        grid-template-columns: 1fr;
        display: block;
    }
}

/* ── Hub (bot selector) ──────────────── */
.hub {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 22px 60px;
}

.hub-title {
    margin: 0 0 4px;
    font-size: 24px;
}

.hub-sub {
    color: #5c5849;
    font-size: 14px;
    margin: 0 0 26px;
}

.bot-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bot-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.08s, box-shadow 0.14s;
}

.bot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.bot-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    background: var(--brand);
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-size: 24px;
    color: var(--ink);
    overflow: hidden;
}

.bot-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-dot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-body {
    flex: 1;
    min-width: 0;
}

.bot-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.bot-name {
    font-size: 16px;
    font-weight: 800;
}

.bot-blurb {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.bot-chevron {
    color: var(--ink);
    font-size: 20px;
    flex-shrink: 0;
}

/* ── Status card ─────────────────────── */
.status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: 2px solid var(--ink);
}

.pill-off {
    background: #efe9db;
    color: #6f6a5f;
}

.pill-on {
    background: #cdeecf;
    color: #1c1b1a;
}

.guild {
    margin-left: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.status-actions {
    display: flex;
    gap: 10px;
}

.status-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 560px) {
    .status-meta {
        grid-template-columns: repeat(2, 1fr);
    }
}

.meta-item {
    background: var(--card-2);
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
}

.meta-val {
    font-size: 18px;
    font-weight: 800;
}

/* ── Channel picker ──────────────────── */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    background: var(--card-2);
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    user-select: none;
}

.channel:hover {
    border-color: var(--ink);
}

.channel.selected {
    border-color: var(--ink);
    background: #fdefc2;
}

.channel.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.channel .chk {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #fff;
}

.channel.selected .chk {
    background: var(--ink);
}

.channel .chk svg {
    display: none;
}

.channel.selected .chk svg {
    display: block;
}

.channel .name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.channel .tag {
    font-size: 12px;
    color: var(--muted);
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.pick-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* ── Fleet list ──────────────────────── */
.fleet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fleet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card-2);
    border: 2px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
}

.fleet-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    border: 1px solid var(--ink);
    flex-shrink: 0;
}

.fleet-name {
    font-weight: 700;
}

.fleet-worker {
    color: var(--muted);
    font-size: 13px;
    margin-left: auto;
}

.fleet-clear {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
}

.fleet-clear:hover {
    color: var(--red);
}

.fleet-empty {
    color: var(--muted);
    font-size: 14px;
    padding: 8px 2px;
}

.failed-box {
    margin-top: 14px;
    padding: 12px;
    border: 2px solid var(--red);
    border-radius: 10px;
    background: #fbe4e2;
}

.failed-title {
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
}

.failed-box ul {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #8a3b36;
    font-size: 13px;
}

/* ── Volume ──────────────────────────── */
.volume-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.volume-row input[type="range"] {
    flex: 1;
    accent-color: var(--brand-deep);
    height: 6px;
}

.volume-val {
    font-weight: 800;
    font-size: 16px;
    min-width: 52px;
    text-align: right;
}

/* ── Notifier: rules ─────────────────── */
.rule-list,
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    background: var(--card-2);
    border: 2px solid var(--line);
    border-radius: 10px;
}

.rule-item.rule-off {
    opacity: 0.6;
}

.rule-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rule-name {
    font-size: 14px;
    font-weight: 700;
}

.rule-channel {
    font-size: 12px;
    color: var(--muted);
}

.rule-switch {
    width: 40px;
    height: 23px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: #efe9db;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.rule-switch.on {
    background: var(--green);
}

.rule-switch .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--ink);
    transition: transform 0.15s;
}

.rule-switch.on .knob {
    transform: translateX(17px);
}

.rule-test {
    flex-shrink: 0;
}

/* ── Notifier: activity ──────────────── */
.activity-item {
    padding: 11px 13px;
    background: var(--card-2);
    border: 2px solid var(--line);
    border-radius: 10px;
    border-left: 6px solid var(--brand);
}

.activity-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.activity-rule {
    font-size: 13px;
    font-weight: 800;
}

.activity-time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.activity-text {
    font-size: 14px;
    margin: 3px 0;
}

.activity-channel {
    font-size: 12px;
    color: var(--muted);
}

/* ── Toast ───────────────────────────── */
.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 600;
    z-index: 50;
    animation: rise 0.2s ease;
}

.toast.err {
    background: var(--red);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ── Server picker + start form ──────── */
.guildbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.guildbar label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
}

.guildbar select,
.start-row select {
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.guildbar select {
    min-width: 240px;
}

.start-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.start-row>label {
    font-size: 13px;
    font-weight: 700;
}

.start-row select {
    max-width: 100%;
}

.caller-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.caller-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-2);
    border: 2px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.caller-item input {
    accent-color: var(--brand-deep);
    width: 16px;
    height: 16px;
}

/* ── Add worker (admin) ──────────────── */
.worker-add {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.worker-add input {
    flex: 1;
    min-width: 0;
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
}

.worker-add input::placeholder {
    color: var(--muted);
}

/* ── Session log ─────────────────────── */
.logs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logs-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--green);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: blink 1.4s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.log-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 10px;
    background: #fffdf6;
    border: 2px solid var(--line);
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.log-item {
    display: grid;
    grid-template-columns: 82px 64px 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12.5px;
}

.log-item:hover {
    background: var(--card-2);
}

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

.log-tag {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3px;
    padding: 2px 4px;
    border-radius: 5px;
    text-align: center;
    background: #efe9db;
    color: #6f6a5f;
}

.log-msg {
    color: var(--ink);
    line-height: 1.4;
}

.log-warn .log-tag {
    background: #fbe8c2;
    color: #8a5a06;
}

.log-error .log-tag {
    background: #fbd9d6;
    color: #a3251d;
}

.log-error .log-msg {
    color: #a3251d;
}

.log-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 6px;
    font-family: system-ui, sans-serif;
}

/* ── Mobile ──────────────────────────── */
@media (max-width: 600px) {
    .topbar {
        padding: 9px 12px;
    }

    .brand {
        font-size: 14px;
        gap: 7px;
    }

    .brand .logo-dot {
        width: 24px;
        height: 24px;
    }

    .back-link {
        padding-right: 8px;
        margin-right: 0;
        font-size: 13px;
    }

    .user {
        gap: 6px;
        font-size: 12px;
    }

    .user img {
        display: none;
    }

    #userName {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn {
        padding: 10px 14px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    .dash {
        padding: 16px 12px 48px;
    }

    .hub {
        padding: 20px 12px 48px;
    }

    .hub-title,
    .login-card h1 {
        font-size: 21px;
    }

    .card {
        padding: 15px;
    }

    .guildbar {
        flex-wrap: wrap;
    }

    .guildbar select {
        min-width: 0;
        width: 100%;
    }

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

    .status-actions {
        width: 100%;
    }

    .status-meta {
        grid-template-columns: 1fr 1fr;
    }

    .login-card {
        padding: 30px 22px;
    }

    .bot-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .caller-item,
    .channel .name {
        font-size: 13px;
    }

    .log-item {
        grid-template-columns: 58px 50px 1fr;
        gap: 6px;
        font-size: 11.5px;
    }

    .fleet-worker {
        font-size: 12px;
    }
}
/* Cross-server relay: "relay into server" picker in the squads card */
.relay-into-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.relay-into-row label { font-size: 13px; opacity: .85; }
.relay-into-row select { flex: 1; min-width: 180px; padding: 7px 10px; border-radius: 8px; }

/* Recent logins: cap height and scroll so it doesn't stretch the admin page */
#loginsList { max-height: 320px; overflow-y: auto; padding-right: 4px; }

/* Worker bots: cap height and scroll so a big fleet doesn't stretch the page */
#workersList { max-height: 340px; overflow-y: auto; padding-right: 4px; }

/* ── Admin: Active instances ─────────────────────────────────── */
.instances-list { display: flex; flex-direction: column; gap: 18px; }
.instance-card {
  border: 1.5px solid var(--border, #e4dcc6);
  border-radius: 16px;
  padding: 20px 22px;
  background: var(--surface-2, #fff);
  box-shadow: 0 6px 20px rgba(60, 50, 20, .07);
}
.instance-card, .instance-card * { font-family: inherit; }
.inst-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inst-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 0; }
.inst-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.inst-title { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-toprow { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; align-items: flex-start; }
.inst-stats { flex: 1; min-width: 240px; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 14px; border: 1px solid var(--border, #e4dcc6); border-radius: 14px; background: var(--surface-1, #fffdf8); }
.inst-stat { display: flex; flex-direction: column; gap: 3px; background: var(--surface-0, #faf6ea); border: 1px solid var(--border, #e4dcc6); border-radius: 10px; padding: 10px 13px; }
.inst-stat-k { font-size: 10px; opacity: .5; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.inst-stat-v { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-relays { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border, #e4dcc6); }
.inst-relay { border: 1px solid var(--border, #e4dcc6); border-radius: 14px; padding: 12px 14px; background: var(--surface-1, #fffdf8); }
.inst-relay-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.inst-relay-name { font-size: 13.5px; font-weight: 700; }
.inst-relay-count { font-size: 11px; opacity: .5; }
.inst-chan { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 6px; border-radius: 8px; }
.inst-chan:hover { background: rgba(0,0,0,.03); }
.inst-chan-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-worker { font-size: 11px; opacity: .5; }
.inst-chan-x { border: 0; background: transparent; cursor: pointer; color: var(--text-muted, #b0a892); font-size: 17px; line-height: 1; padding: 0 4px; border-radius: 6px; }
.inst-chan-x:hover { color: var(--text-danger, #e5484d); background: var(--bg-danger, rgba(229,72,77,.1)); }
.inst-empty { font-size: 13px; opacity: .55; padding: 10px 2px; }

/* per-instance controls (volume + add squads) */
.inst-controls {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start;
  flex: 1; min-width: 260px; margin: 0;
  padding: 14px 16px; border: 1px solid var(--border, #e4dcc6); border-radius: 14px; background: var(--surface-1, #fffdf8);
}
.inst-ctrl { display: flex; flex-direction: column; gap: 7px; }
.inst-ctrl > label { font-size: 10px; font-weight: 700; opacity: .5; text-transform: uppercase; letter-spacing: .07em; }
.inst-ctrl select { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong, #c9bd98); background: var(--surface-2, #fff); font-size: 13px; }
.inst-vol select { width: 100px; }
.inst-add { flex: 1; min-width: 260px; }
.inst-add-server { width: 100%; max-width: 360px; }
.inst-add-channels { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.inst-add-channels:empty { margin: 0; }
.inst-add-chan {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 700;
  border: 2px solid var(--border-strong, #c9bd98); border-radius: 999px; padding: 6px 14px; cursor: pointer;
  background: #fff; transition: background .12s, border-color .12s, box-shadow .12s; user-select: none;
}
.inst-add-chan:hover { border-color: #b7a870; background: #fdfbf4; }
.inst-add-chan input { position: absolute; opacity: 0; width: 0; height: 0; }
.inst-add-chan:has(input:checked) {
  background: #fbe6a2; border-color: #c9971a; color: #6b4e00; font-weight: 700;
  box-shadow: inset 0 0 0 1px #c9971a;
}
.inst-add-note { font-size: 12px; opacity: .55; }
.inst-add-go { align-self: flex-start; }

/* Dashboard: dismiss a 'could not cover' entry */
#failedList li { display: flex; align-items: center; gap: 8px; }
#failedList li > span { flex: 1; }
.failed-x { border: 0; background: transparent; cursor: pointer; color: var(--text-danger, #e5484d); font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 6px; }
.failed-x:hover { background: var(--bg-danger, rgba(229,72,77,.12)); }

/* Instances: captain line control */
.inst-cap-active { display: flex; align-items: center; gap: 10px; }
.inst-cap-name { font-size: 13px; }
.inst-cap select { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong, #c9bd98); background: var(--surface-2, #fff); font-size: 13px; width: 100%; max-width: none; box-sizing: border-box; }

/* Dashboard: captain line control */
.cap-active { display: flex; align-items: center; gap: 12px; }
.cap-active .cap-name { flex: 1; }
.cap-pick select { width: 100%; max-width: 420px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong, #c9bd98); background: var(--surface-2, #fff); font-size: 13px; }

/* Dashboard: captain two-step picker */
.cap-pick { display: flex; flex-wrap: wrap; gap: 14px; }
.cap-field { display: flex; flex-direction: column; gap: 6px; }
.cap-label { font-size: 11px; font-weight: 700; opacity: .55; text-transform: uppercase; letter-spacing: .04em; }
.cap-field select { padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong, #c9bd98); background: var(--surface-2, #fff); font-size: 13px; min-width: 200px; }

/* Dashboard captain picker: match the caller picker */
.cap-head-label { display: block; font-weight: 700; font-size: 13px; margin: 4px 0 6px; }
.cap-server { width: 100%; max-width: none; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--border-strong, #c9bd98); background: var(--surface-2, #fff); font-size: 13px; margin-bottom: 6px; }
.cap-set { margin-top: 10px; }

/* Uniform dropdown borders (dashboard + admin) */
#guildSelect, #startChannel, #relayGuildSelect, .relay-into-row select,
.cap-server, .inst-ctrl select, .inst-add-server, .inst-cap-server {
  border: 2px solid #333;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-2, #fff);
  font-size: 13px;
}
.cap-server, .inst-cap-server { width: 100%; max-width: none; }
.inst-cap-people { margin: 8px 0; }
.inst-cap-set { margin-top: 4px; }

/* Admin: captain line always on its own full-width row below the other controls */
.inst-cap { flex-basis: 100%; width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border, #e4dcc6); }
.inst-cap .inst-cap-people { margin: 8px 0; }

/* Instance card: pulsing live dot + subtle depth */
.inst-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green, #3ba55d); box-shadow: 0 0 0 0 rgba(59,165,93,.5); animation: instPulse 2s infinite; flex: none; }
@keyframes instPulse {
  0% { box-shadow: 0 0 0 0 rgba(59,165,93,.5); }
  70% { box-shadow: 0 0 0 7px rgba(59,165,93,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,165,93,0); }
}
.instance-card { transition: box-shadow .2s ease; }
.instance-card:hover { box-shadow: 0 10px 30px rgba(60, 50, 20, .10); }

/* Admin instance controls: stacked layout + full-width dropdowns + volume slider */
.inst-controls { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 14px; }
.inst-add, .inst-add-server, .inst-cap-server, .inst-cap-pick { width: 100%; max-width: none; }
.inst-add-server { max-width: none; }
.inst-vol-ctrl label { display: flex; justify-content: space-between; align-items: center; }
.inst-vol-val { font-weight: 700; opacity: .85; }
.inst-vol-slider { width: 100%; accent-color: var(--brand-deep); height: 6px; cursor: pointer; }

/* Captain + add-squads selects: force true full width */
.inst-cap-pick, .inst-cap-active { width: 100%; }
.inst-cap-server, .inst-add-server { display: block; width: 100%; max-width: none; box-sizing: border-box; }

/* Two-line identity chip: server nickname over the real username */
.caller-item .cn { display: flex; flex-direction: column; line-height: 1.15; }
.cn-name { color: var(--ink); font-weight: 600; }
.cn-user { color: var(--muted); font-size: 11px; }
.cn-extra { color: var(--muted); font-weight: 400; opacity: .8; }

/* Collapsible admin cards (click the title to slide open/closed) */
.collapsible > .card-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 0; user-select: none; }
.collapsible > .card-toggle::after { content: '\25B8'; font-size: .8em; opacity: .55; transition: transform .25s ease; }
.collapsible:not(.collapsed) > .card-toggle::after { transform: rotate(90deg); }
.collapsible > .card-body { overflow: hidden; max-height: 1600px; opacity: 1; transition: max-height .32s ease, opacity .25s ease, margin-top .25s ease; margin-top: 12px; }
.collapsible.collapsed > .card-body { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }

/* Captain picker: search box + height-capped scroll list for long lists */
.cap-search { width: 100%; box-sizing: border-box; padding: 8px 12px; margin: 8px 0 6px; border: 2px solid #000; border-radius: 10px; font-size: 13px; background: var(--surface-2, #fff); }
.cap-scroll { max-height: 220px; overflow-y: auto; }
.cap-scroll::-webkit-scrollbar { width: 8px; }
.cap-scroll::-webkit-scrollbar-thumb { background: var(--border-strong, #c9bd98); border-radius: 8px; }

/* Cap the "Who to relay" / caller lists so a long list scrolls instead of growing */
.caller-list { max-height: 240px; overflow-y: auto; }
.caller-list::-webkit-scrollbar { width: 8px; }
.caller-list::-webkit-scrollbar-thumb { background: var(--border-strong, #c9bd98); border-radius: 8px; }

/* Captain-line volume slider (independent of squad relay volume) */
.cap-vol-row { margin-top: 10px; }
.cap-vol-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; opacity: .8; margin-bottom: 4px; }
.cap-vol-row input[type="range"] { width: 100%; accent-color: var(--brand-deep); height: 6px; cursor: pointer; }

/* Clean, thin scrollbars for all scrollable card lists */
.fleet-list, .cap-scroll, .caller-list, .log-list, #logList {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #c9bd98) transparent;
}
.fleet-list::-webkit-scrollbar,
.log-list::-webkit-scrollbar,
#logList::-webkit-scrollbar { width: 8px; }
.fleet-list::-webkit-scrollbar-track,
.log-list::-webkit-scrollbar-track,
#logList::-webkit-scrollbar-track { background: transparent; }
.fleet-list::-webkit-scrollbar-thumb,
.log-list::-webkit-scrollbar-thumb,
#logList::-webkit-scrollbar-thumb { background: var(--border-strong, #c9bd98); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.fleet-list::-webkit-scrollbar-thumb:hover,
.log-list::-webkit-scrollbar-thumb:hover,
#logList::-webkit-scrollbar-thumb:hover { background: #b7a870; background-clip: padding-box; }

/* Cap Command servers + Bot install links so long lists scroll instead of growing */
#mainServersList, #installsList { max-height: 260px; overflow-y: auto; padding-right: 2px; }

/* Command-server per-worker access checklist */
.ms-block { flex-direction: column; align-items: stretch; gap: 0; }
.ms-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.ms-head .fleet-name { flex: 1; }
.ms-workers { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 2px; padding-left: 22px; }
.ms-wchk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.ms-wchk input { accent-color: var(--brand-deep); cursor: pointer; }
.ms-wchk.ms-absent { opacity: .5; cursor: not-allowed; }
.ms-abs-tag { font-size: 10px; opacity: .7; font-style: italic; }

/* "Not a member" tag on admin instance cards */
.inst-notmember { margin-left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8a5a06; background: #fbe8c2; padding: 2px 7px; border-radius: 999px; }

/* Command-server worker sub-lists (present vs. request-to-join) */
.ms-sub { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .5; margin: 10px 0 2px; padding-left: 22px; }
.ms-workers-req .ms-wchk { opacity: .85; }

/* "Could not cover" — put the × at the top of the row, not the bottom */
.failed-box ul { list-style: none; padding-left: 0; }
.failed-box li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.failed-x { align-self: flex-start; }

/* Admin Instances "Could not cover" block */
.inst-failed { margin: 12px 14px 14px; padding: 10px 12px; border: 1px solid #e5484d; border-radius: 10px; background: #fbe4e2; }
.inst-failed-title { color: #e5484d; font-weight: 800; font-size: 12px; display: block; margin-bottom: 6px; }
.inst-failed-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #8a3b36; }
.inst-failed-x { align-self: flex-start; border: 0; background: transparent; color: #e5484d; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 6px; }
.inst-failed-x:hover { background: rgba(229,72,77,.12); }

/* ─────────────────────────────────────────────────────────────────────────
   DARK MODE — per-user, toggled via #themeToggle. Overrides the CSS variables
   plus a handful of hard-coded surfaces the base theme sets directly.
   ───────────────────────────────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg: #14161b;
  --bg-soft: #1b1e25;
  --card: #1e2128;
  --card-2: #262a33;
  --ink: #e9e7e2;
  --muted: #9b968d;
  --line: #333741;
  --line-bold: #454a55;
  --brand: #f5c84b;
  --brand-deep: #e0b64a;
  --green: #35c46b;
  --red: #f0655c;
  --pink: #f2889f;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 2px 0 rgba(0, 0, 0, 0.35);
  /* surface/border tokens used by newer components (with light fallbacks) */
  --surface-1: #1e2128;
  --surface-2: #262a33;
  --border: #333741;
  --border-strong: #454a55;
}

/* Cards: use a subtle border instead of the heavy near-black outline. */
html[data-theme="dark"] .card,
html[data-theme="dark"] .instance-card,
html[data-theme="dark"] .status-card { border-color: var(--line-bold); background: var(--card); }
html[data-theme="dark"] .status-card,
html[data-theme="dark"] .inst-stat,
html[data-theme="dark"] .fleet-item,
html[data-theme="dark"] .caller-item,
html[data-theme="dark"] .channel,
html[data-theme="dark"] .ms-block { background: var(--card-2); }

/* Inputs, selects, sliders, dropdowns */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
}
html[data-theme="dark"] select option { background: #1e2128; color: var(--ink); }
html[data-theme="dark"] .cap-search,
html[data-theme="dark"] .inst-add-server,
html[data-theme="dark"] .inst-cap-server { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }

/* Log + session views */
html[data-theme="dark"] .log-item:hover { background: var(--card-2); }
html[data-theme="dark"] .log-tag { background: #33373f; color: #cfc9bd; }
html[data-theme="dark"] .log-warn .log-tag { background: #4a3a1a; color: #f0c46a; }
html[data-theme="dark"] .log-error .log-tag { background: #4a2320; color: #f0918a; }
html[data-theme="dark"] .log-list, html[data-theme="dark"] #logList { background: transparent; }

/* Buttons: keep primary as amber-on-dark so it reads on dark cards */
html[data-theme="dark"] .btn-ghost { color: var(--ink); border-color: var(--border-strong); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--card-2); }

/* Pills / tags / badges that were tuned for the light theme */
html[data-theme="dark"] .inst-notmember { background: #4a3a1a; color: #f0c46a; }
html[data-theme="dark"] .failed-box,
html[data-theme="dark"] .inst-failed { background: #2a1c1b; border-color: #6e3a35; }
html[data-theme="dark"] .failed-title,
html[data-theme="dark"] .inst-failed-title { color: #f0918a; }
html[data-theme="dark"] .failed-box ul,
html[data-theme="dark"] .inst-failed-row { color: #e5b3ad; }

/* The theme toggle button */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle i { font-size: 16px; }

/* Admin sidebar in dark mode: the base theme paints it with var(--ink) (black in
   light mode). In dark that variable is light, so pin the sidebar to a genuine
   dark shade and restore readable nav contrast. */
html[data-theme="dark"] .admin-side { background: #0f1218; color: var(--ink); border-right: 1px solid var(--line); }
html[data-theme="dark"] .admin-brand { color: var(--ink); }
html[data-theme="dark"] .nav-item { color: #c3beb4; }
html[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
html[data-theme="dark"] .nav-item.active { color: #1c1b1a; }
html[data-theme="dark"] .admin-user { color: #c3beb4; }
html[data-theme="dark"] .admin-side-foot { border-top-color: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .admin-brand .logo-dot { filter: none; }

/* Status stat tiles: softer border than the stark light outline */
html[data-theme="dark"] .meta-item,
html[data-theme="dark"] .inst-stat { border-color: var(--line-bold); background: var(--card-2); }

/* Dark mode: channel chips in the admin add-squads picker were hard-coded white */
html[data-theme="dark"] .inst-add-chan { background: var(--card-2); color: var(--ink); border-color: var(--border-strong); }
html[data-theme="dark"] .inst-add-chan:hover { background: #30343e; border-color: var(--brand-deep); }
html[data-theme="dark"] .inst-add-chan:has(input:checked) { background: #4a3a12; border-color: var(--brand-deep); color: #f2d489; box-shadow: inset 0 0 0 1px var(--brand-deep); }

/* Dark mode buttons: .btn-primary uses var(--ink) as its background (black in
   light) which inverts to light in dark, hiding the white label. Make primary
   buttons amber-on-dark, and soften generic button borders. */
html[data-theme="dark"] .btn { border-color: var(--line-bold); }
html[data-theme="dark"] .btn-primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #1b1608; }
html[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #f0c452; border-color: #f0c452; color: #1b1608; }
html[data-theme="dark"] .btn-ink { background: var(--brand-deep); border-color: var(--brand-deep); color: #1b1608; }
html[data-theme="dark"] .btn-ink:hover:not(:disabled) { background: #f0c452; }

/* Dark mode: fully custom checkbox - dark empty box, amber with a check when on */
html[data-theme="dark"] input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin: 0; flex: 0 0 auto;
  border: 2px solid var(--border-strong); border-radius: 5px;
  background: var(--surface-2); cursor: pointer; position: relative;
  transition: background .12s, border-color .12s;
}
html[data-theme="dark"] input[type="checkbox"]:hover { border-color: var(--brand-deep); }
html[data-theme="dark"] input[type="checkbox"]:checked {
  background: var(--brand-deep); border-color: var(--brand-deep);
}
html[data-theme="dark"] input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 1px;
  width: 4px; height: 9px; border: solid #1b1608; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Dark mode: the squad picker's custom checkbox (.chk) was hard-coded white */
html[data-theme="dark"] .channel .chk { background: var(--surface-2); border-color: var(--border-strong); }
html[data-theme="dark"] .channel.selected .chk { background: var(--brand-deep); border-color: var(--brand-deep); }

/* Relaying (covered) channels: show as checked, less dimmed than fully-disabled ones */
.channel.covered.disabled { opacity: .72; }
.channel.covered .chk { opacity: 1; }

/* Live "change caller" control on the status card */
.btn-xs { font-size: 11px; padding: 3px 8px; border-width: 1px; }
.change-caller-box { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.change-caller-box select { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 8px; }

/* "change" caller button: clearly visible in both light and dark mode */
#changeCallerBtn {
  border: 1.5px solid var(--line-bold, #1c1b1a);
  color: var(--ink);
  background: var(--card-2, #fbf7ec);
  opacity: 1;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 6px;
}
#changeCallerBtn:hover { background: var(--brand); color: #1c1b1a; border-color: var(--brand-deep); }
html[data-theme="dark"] #changeCallerBtn { border-color: var(--border-strong); background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] #changeCallerBtn:hover { background: var(--brand-deep); color: #1b1608; border-color: var(--brand-deep); }
