:root {
    --bg: #16150f;
    --panel: #1c1a13;
    --card: #221f17;
    --border: #3a361f;
    --border-soft: #2b2819;
    --text: #eae5d6;
    --muted: #8f8a72;
    --muted-dim: #5f5c4c;

    --accent: #b8552e;
    --accent-dim: #7a3a21;
    --accent-glow: rgba(184, 85, 46, 0.35);
    --accent-tint: rgba(184, 85, 46, 0.1);
    --accent-tint-soft: rgba(184, 85, 46, 0.08);

    --hazard: #d1a125;

    --good: #7a9b5e;
    --good-glow: rgba(122, 155, 94, 0.55);
    --bad: #a3453d;
    --bad-glow: rgba(163, 69, 61, 0.5);

    --afk: #c9a227;
    --afk-glow: rgba(201, 162, 39, 0.5);
    --offline-dot: #6b6858;
    --offline-glow: rgba(107, 104, 88, 0.35);

    --vending: #6a8caf;
    --vending-glow: rgba(106, 140, 175, 0.5);

    --grid-line: rgba(234, 229, 214, 0.35);
    --grid-label: rgba(10, 9, 6, 0.95);
    --grid-label-shadow: rgba(234, 229, 214, 0.95);

    --font-display: 'Oswald', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

/* RatsBot theme - a separate look for the RATS group, selected in
   Settings > Theme. SeanBot (the :root defaults above) is untouched. */
body[data-theme="rats"] {
    --bg: #10140d;
    --panel: #141a10;
    --card: #181f12;
    --border: #2c3a1a;
    --border-soft: #212b15;
    --text: #d8e8c8;
    --muted: #7f9468;
    --muted-dim: #566b42;

    --accent: #8bd13f;
    --accent-dim: #5c8c2a;
    --accent-glow: rgba(139, 209, 63, 0.35);
    --accent-tint: rgba(139, 209, 63, 0.1);
    --accent-tint-soft: rgba(139, 209, 63, 0.08);

    --font-display: 'Chakra Petch', sans-serif;
}

/* ToadBot theme - a separate look for Toad, selected the same way as
   RatsBot above. SeanBot (the :root defaults) is still untouched. */
body[data-theme="toad"] {
    --bg: #12100a;
    --panel: #1a1710;
    --card: #211e14;
    --border: #3d3520;
    --border-soft: #2b2617;
    --text: #e8dfc4;
    --muted: #9c8f68;
    --muted-dim: #6b6247;

    --accent: #c98a2e;
    --accent-dim: #8f5f1e;
    --accent-glow: rgba(201, 138, 46, 0.35);
    --accent-tint: rgba(201, 138, 46, 0.1);
    --accent-tint-soft: rgba(201, 138, 46, 0.08);

    --font-display: 'Bungee', sans-serif;
}

/* SmeagBot theme - a separate look for Smeag (Brazil-flag green), selected
   the same way as RatsBot/ToadBot above. SeanBot (the :root defaults) is
   still untouched. */
body[data-theme="smeag"] {
    --bg: #0d1710;
    --panel: #122015;
    --card: #17281a;
    --border: #24402c;
    --border-soft: #1a2f1f;
    --text: #d8f0d8;
    --muted: #7fa88a;
    --muted-dim: #4f6b58;

    --accent: #00a859;
    --accent-dim: #00733d;
    --accent-glow: rgba(0, 168, 89, 0.35);
    --accent-tint: rgba(0, 168, 89, 0.1);
    --accent-tint-soft: rgba(0, 168, 89, 0.08);

    --font-display: 'Russo One', sans-serif;
}

/* Weather? theme - a separate look for Weather?, selected the same way
   as the other bots above. SeanBot (the :root defaults) is still
   untouched. */
body[data-theme="weather"] {
    --bg: #0c1420;
    --panel: #101b2a;
    --card: #142234;
    --border: #24425c;
    --border-soft: #1a2f42;
    --text: #dbe9f5;
    --muted: #7fa0bf;
    --muted-dim: #52708a;

    --accent: #3fa9f5;
    --accent-dim: #2678ab;
    --accent-glow: rgba(63, 169, 245, 0.35);
    --accent-tint: rgba(63, 169, 245, 0.1);
    --accent-tint-soft: rgba(63, 169, 245, 0.08);

    --font-display: 'Rajdhani', sans-serif;
}

/* k!ngBot theme - a separate look for k!ng, selected the same way as
   the other bots above. SeanBot (the :root defaults) is still untouched. */
body[data-theme="king"] {
    --bg: #140a1c;
    --panel: #1c0f26;
    --card: #24132f;
    --border: #4a2a5c;
    --border-soft: #331c40;
    --text: #ecdff5;
    --muted: #a488b8;
    --muted-dim: #6e5480;

    --accent: #d4af37;
    --accent-dim: #9c7f28;
    --accent-glow: rgba(212, 175, 55, 0.35);
    --accent-tint: rgba(212, 175, 55, 0.1);
    --accent-tint-soft: rgba(212, 175, 55, 0.08);

    --font-display: 'Cinzel', serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

.app { display: flex; height: 100vh; }

/* ------------------------------------------------------------------ */
/* Base codes widget - lives in the sidebar (below connection status)  */
/* so it's visible on every panel/tab without floating over content.   */
/* ------------------------------------------------------------------ */

.base-codes-widget {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    padding: 8px 10px;
}

.base-codes-title {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}

.base-codes-row + .base-codes-row { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border-soft); }

.base-codes-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.base-codes-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
    width: 60px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.base-codes-value {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent);
}

.base-codes-value.is-empty {
    color: var(--muted-dim);
    font-size: 11px;
    letter-spacing: 0.4px;
}

.base-codes-actions { display: flex; gap: 4px; flex-shrink: 0; }
.base-codes-actions .icon-btn { width: 18px; height: 18px; font-size: 9px; }

.base-codes-display.hidden { display: none; }

.base-codes-edit { display: flex; align-items: center; gap: 4px; }
.base-codes-edit.hidden { display: none; }

.base-codes-input {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 2px;
    padding: 2px 6px;
}

.base-codes-input:focus { outline: none; border-color: var(--accent); }

.base-codes-edit .icon-btn { width: 18px; height: 18px; font-size: 9px; }
.base-codes-save { color: var(--good); border-color: var(--good); }

.base-codes-status {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--bad);
    margin-top: 4px;
    min-height: 0;
}
.base-codes-status:empty { margin-top: 0; }

/* ------------------------------------------------------------------ */
/* Sidebar                                                              */
/* ------------------------------------------------------------------ */

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) var(--panel);
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: var(--panel); }
.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 18px 18px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
}

.brand-mark {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--accent-tint);
    box-shadow: 0 0 16px -3px var(--accent-glow);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
}

.brand-name {
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-shadow: 0 0 22px var(--accent-glow);
}

.brand-subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 3px;
}

.field-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted-dim);
    padding: 0 18px;
}

select {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 9px 10px;
    margin: 6px 18px 0;
    font-family: var(--font-mono);
    font-size: 13px;
}

.status-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 18px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin: 0 18px;
}

.status-block-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.action-full { width: 100%; text-align: center; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-header h1 { margin: 0; }
.panel-header h2 { margin: 0; }

.action-danger { background: var(--bad); color: #fff; }
.action-danger:hover { filter: brightness(1.15); }

.muted-tight { margin-top: 0; min-height: 14px; }

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--good);
    box-shadow: 0 0 8px 2px var(--good-glow);
    animation: pulse 2.4s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--bad);
    box-shadow: 0 0 6px 1px var(--bad-glow);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.nav {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    margin-top: 4px;
}

.nav-item {
    text-align: left;
    background: transparent;
    color: var(--muted);
    border: none;
    border-left: 3px solid transparent;
    padding: 11px 12px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.02); }

.nav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-tint-soft);
    font-weight: 600;
}

.sidebar-spacer { flex: 1; min-height: 12px; }

.nav-bottom {
    border-top: 1px solid var(--border-soft);
    padding-top: 8px;
    padding-bottom: 14px;
    margin-top: 0;
}

/* ------------------------------------------------------------------ */
/* Content                                                              */
/* ------------------------------------------------------------------ */

.content { flex: 1; padding: 30px 40px; overflow-y: auto; }

.panel { display: none; }
.panel.active { display: block; }

h1 {
    margin-top: 0;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

h2 {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 30px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

.cards { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; margin-top: 16px; align-items: stretch; }

@media (max-width: 950px) {
    .cards { grid-template-columns: 1fr 1fr; }
    .card-server { grid-column: 1 / -1; }
}

.event-info-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    margin-top: 10px;
    background: var(--border-soft);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.event-info-item {
    background: var(--card);
    padding: 7px 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 2px solid transparent;
}

.event-info-item:hover { background: var(--panel); }

.event-info-item.is-active {
    border-left-color: var(--good);
    background: color-mix(in srgb, var(--good) 10%, var(--card));
}

.event-info-item.is-active:hover { background: color-mix(in srgb, var(--good) 16%, var(--card)); }

.event-info-item.is-disabled { cursor: default; opacity: 0.55; }

.event-info-label {
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-info-item.is-active .event-info-label { color: var(--good); }

.event-info-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 950px) {
    .event-info-strip { grid-template-columns: repeat(3, 1fr); }
    .event-info-item:nth-child(3n) { border-right: none; }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 3px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    min-height: 84px;
}

.card-server { grid-column: 1; }

.card-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
}

.card-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.card-value-text {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.35;
    margin-top: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Hero cards: the values that are actually live telemetry (Players, Time) -
   bigger, glowing, with a pulsing "live" dot, so the eye goes here first. */
.card-hero {
    border-top-width: 3px;
    border-top-color: var(--accent);
    box-shadow: 0 0 0 1px var(--border), 0 2px 18px -6px var(--accent-glow);
    padding-top: 14px;
    padding-bottom: 18px;
}

.card-label-live { display: flex; align-items: center; gap: 7px; }

.card-label-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px 2px var(--accent-glow);
    animation: pulse 2.4s ease-in-out infinite;
}

.card-value-hero {
    font-family: var(--font-mono);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-top: 6px;
    line-height: 1;
    color: #fdf6e8;
    text-shadow: 0 0 18px rgba(209, 161, 37, 0.22);
    white-space: nowrap;
}

.card-time {
    position: relative;
}

.time-icon {
    display: inline-flex;
    flex-shrink: 0;
    position: absolute;
    top: 14px;
    right: 16px;
}

.time-icon-sun {
    color: #f5c518;
    filter: drop-shadow(0 0 6px rgba(245, 197, 24, 0.5));
}

.time-icon-moon {
    color: #6fa8ff;
    filter: drop-shadow(0 0 6px rgba(111, 168, 255, 0.5));
}

.time-icon-dusk {
    color: #ff8c42;
    filter: drop-shadow(0 0 6px rgba(255, 140, 66, 0.5));
}

/* Quiet cards: rarely-changing context (Team size) - same accent bar as the
   rest for a consistent set, just dimmed so it doesn't compete with the
   live readouts. */
.card-quiet {
    opacity: 0.75;
}

.card-quiet .card-value { font-size: 20px; }

@keyframes value-pulse {
    0% { color: var(--hazard); text-shadow: 0 0 16px rgba(209, 161, 37, 0.85); }
    100% { color: #fdf6e8; text-shadow: 0 0 18px rgba(209, 161, 37, 0.22); }
}

.value-flash { animation: value-pulse 900ms ease-out; }

/* ------------------------------------------------------------------ */
/* Tables                                                               */
/* ------------------------------------------------------------------ */

.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-family: var(--font-mono); }

.table th, .table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}

.table th {
    color: var(--muted);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-pill { display: inline-flex; align-items: center; gap: 6px; }
.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-dim);
}
.status-pill.is-online::before { background: var(--good); box-shadow: 0 0 6px 1px var(--good-glow); }
.status-pill.is-dead::before { background: var(--bad); box-shadow: 0 0 6px 1px var(--bad-glow); }

/* ------------------------------------------------------------------ */
/* Devices                                                              */
/* ------------------------------------------------------------------ */

.device-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }

.device-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-name { font-family: var(--font-mono); font-size: 13px; }

.device-name-group { display: flex; flex-direction: column; gap: 2px; }

.device-command {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.toggle {
    width: 44px;
    height: 24px;
    border-radius: 3px;
    background: #2a2718;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.toggle.on {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px 1px var(--accent-glow);
}

.toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 2px;
    background: #0e0d09;
    transition: left 0.15s ease;
}

.toggle.on::after { left: 23px; background: #1a1206; }

.device-card-not-found { opacity: 0.6; border-color: var(--bad); }

.device-status {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    color: var(--bad);
}

#storageList.device-list {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: start;
}

.storage-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.storage-card-upkeep-healthy {
    border-color: var(--good);
    box-shadow: 0 0 8px -2px var(--good-glow);
}

.storage-card-upkeep-low {
    border-color: var(--hazard);
    box-shadow: 0 0 8px -2px rgba(209, 161, 37, 0.4);
}

.storage-card-upkeep-decaying {
    border-color: var(--bad);
    box-shadow: 0 0 8px -2px var(--bad-glow);
}

.storage-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.storage-type-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.storage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
}

.storage-label { color: var(--muted); }
.storage-value { color: var(--text); }
.storage-upkeep { color: var(--text); }

.storage-upkeep-warning {
    color: var(--hazard);
    text-shadow: 0 0 10px rgba(209, 161, 37, 0.4);
}

.storage-status {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    color: var(--bad);
    padding: 4px 0;
}

.storage-empty {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-dim);
    padding-top: 3px;
}

.storage-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 150px;
    overflow-y: auto;
    padding-top: 5px;
    margin-top: 2px;
    border-top: 1px solid var(--border-soft);
}

.storage-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.storage-item-name { color: var(--text); }
.storage-item-qty { color: var(--muted); flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* Device rename/edit                                                  */
/* ------------------------------------------------------------------ */

.device-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 3px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
    flex-shrink: 0;
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.icon-btn-danger:hover { color: var(--bad); border-color: var(--bad); }

/* ------------------------------------------------------------------ */
/* Trackers                                                            */
/* ------------------------------------------------------------------ */

#trackerAddBtn.hidden,
#trackersUnavailable.hidden,
#trackerServerConfig.hidden,
#trackerCreateStatusRow.hidden { display: none; }

#trackerServerSelect { display: none; }

.tracker-server-config {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
}
.tracker-server-config-label {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.03em;
}
.tracker-server-config select,
.tracker-server-config .modal-input {
    width: auto;
    min-width: 180px;
}
#trackerCreateStatusRow { margin: 6px 0; }

.tracker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }

.tracker-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tracker-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tracker-clan-tag { color: var(--muted); font-size: 11px; }

.tracker-status { font-family: var(--font-mono); }

.tracker-toggles { display: flex; flex-wrap: wrap; gap: 14px; }
.tracker-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
}

.tracker-players {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 5px;
    margin-top: 2px;
    border-top: 1px solid var(--border-soft);
    max-height: 220px;
    overflow-y: auto;
}

.tracker-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.tracker-player-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tracker-add-player-row { display: flex; gap: 6px; }
.tracker-add-player-row .modal-input { flex: 1; }

.tracker-browse-modal-box { width: 380px; display: flex; flex-direction: column; gap: 10px; }

.tracker-browse-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
    border-top: 1px solid var(--border-soft);
    padding-top: 8px;
}

.tracker-browse-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 9, 6, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-overlay.hidden { display: none; }

.app.hidden { display: none; }

.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.login-screen.hidden { display: none; }

.login-box { width: 320px; }

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-brand .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.nav-item.hidden { display: none; }

.modal-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 4px;
    width: 360px;
    max-width: calc(100vw - 40px);
    padding: 18px;
    box-shadow: 0 8px 40px -8px rgba(0, 0, 0, 0.6);
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 14px;
}

.modal-field { margin-bottom: 12px; }
.modal-field .field-label { padding: 0; margin-bottom: 5px; display: block; }

.modal-input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 3px;
    padding: 9px 11px;
    font-family: var(--font-mono);
    font-size: 13px;
    box-sizing: border-box;
}

textarea.modal-input { resize: vertical; min-height: 60px; }

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.modal-actions-buttons { display: flex; gap: 8px; }

.modal-actions-buttons button {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 11px;
    padding: 8px 14px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
}

.btn-save { background: var(--accent); color: #17100a; }
.btn-save:hover { filter: brightness(1.12); }
.btn-save:disabled { opacity: 0.55; cursor: default; filter: none; }

.btn-cancel { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-cancel:hover { color: var(--text); border-color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Smart alarm live trigger alerts                                     */
/* ------------------------------------------------------------------ */

.alarm-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    animation: alarmPulse 1.1s ease-in-out infinite;
}

.alarm-overlay.hidden { display: none; animation: none; }

@keyframes alarmPulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(163, 69, 61, 0); background: rgba(163, 69, 61, 0); }
    50% { box-shadow: inset 0 0 150px 30px rgba(163, 69, 61, 0.55); background: rgba(163, 69, 61, 0.07); }
}

/* Same full-screen inset pulse as the alarm overlay above, but slower and
   lower peak opacity - a decaying TC can stay in this state for hours, so
   it needs to read as "unresolved" rather than "urgent, look now". */
.decay-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 89;
    animation: decayPulse 2.2s ease-in-out infinite;
}

.decay-overlay.hidden { display: none; animation: none; }

@keyframes decayPulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(163, 69, 61, 0); background: rgba(163, 69, 61, 0); }
    50% { box-shadow: inset 0 0 110px 24px rgba(163, 69, 61, 0.35); background: rgba(163, 69, 61, 0.045); }
}

.alarm-banner {
    background: var(--panel);
    border: 1px solid var(--bad);
    border-left: 4px solid var(--bad);
    border-radius: 4px;
    padding: 14px 16px;
    box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.65), 0 0 20px -4px var(--bad-glow);
    animation: alarmBannerIn 0.2s ease-out;
}

@keyframes alarmBannerIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alarm-banner-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--bad);
    margin-bottom: 6px;
}

.alarm-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bad);
    box-shadow: 0 0 8px 2px var(--bad-glow);
    flex-shrink: 0;
}

.alarm-banner-device {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
}

.alarm-banner-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    word-break: break-word;
}

.alarm-banner-actions { display: flex; justify-content: flex-end; }

.alarm-banner-dismiss {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
}

.alarm-banner-dismiss:hover { color: var(--text); border-color: var(--muted); }

/* Lighter-weight sibling of .alarm-banner for map-event notifications (cargo
   ship/heli/chinook/vendor entering the map, oil rig crate unlocked) - same
   stack, but --good instead of --bad and no full-screen pulse, since these
   are routine map activity rather than "something needs you now". Clicking
   jumps to the event's map location (see jumpToEvent() in app.js). */
.event-banner {
    background: var(--panel);
    border: 1px solid var(--good);
    border-left: 4px solid var(--good);
    border-radius: 4px;
    padding: 12px 14px;
    box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.65), 0 0 16px -6px var(--good-glow);
    animation: alarmBannerIn 0.2s ease-out;
    cursor: pointer;
}

.event-banner-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--good);
    margin-bottom: 5px;
}

.event-banner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 8px 2px var(--good-glow);
    flex-shrink: 0;
}

.event-banner-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* Events                                                               */
/* ------------------------------------------------------------------ */

.event-list { list-style: none; padding: 0; margin-top: 10px; font-family: var(--font-mono); }
.event-list li {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--muted);
}
.event-list li:empty::before,
.event-list:empty::after {
    content: "NO EVENTS LOGGED";
    color: var(--muted-dim);
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 11px 12px;
    display: block;
}
.event-list .event-time {
    color: var(--muted-dim);
    margin-right: 10px;
}
.event-list .event-text {
    color: var(--text);
}

/* ------------------------------------------------------------------ */
/* Activity feed (mirrors Discord's #activity channel)                 */
/* ------------------------------------------------------------------ */

.activity-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.activity-list:empty::after {
    content: "NO ACTIVITY YET";
    color: var(--muted-dim);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 11px 12px;
    display: block;
}
.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--activity-color, var(--accent));
    border-radius: 3px;
    padding: 10px 14px;
}
.activity-entry-icon {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    object-fit: cover;
    background: var(--panel);
    flex-shrink: 0;
    margin-top: 2px;
}
.activity-entry-body { flex: 1; min-width: 0; }
.activity-entry-title {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}
.activity-entry-title a { color: inherit; text-decoration: none; }
.activity-entry-title a:hover { text-decoration: underline; }
.activity-entry-desc {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    margin-top: 2px;
    white-space: pre-wrap;
}
.activity-entry-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 4px;
}
.activity-entry-fields span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
}
.activity-entry-fields span b { color: var(--text); font-weight: 500; }
.activity-entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.activity-entry-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-dim);
}
.activity-entry-footer {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-dim);
}
.activity-entry-everyone {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--hazard);
    border: 1px solid var(--hazard);
    border-radius: 2px;
    padding: 1px 5px;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ */
/* Chat                                                                 */
/* ------------------------------------------------------------------ */

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    margin-top: 14px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
}

.chat-message {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message-time {
    flex-shrink: 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.chat-message-name {
    flex-shrink: 0;
    font-weight: 600;
    font-family: var(--font-mono);
}

.chat-message-text { color: var(--text); word-break: break-word; }

.chat-message.incoming .chat-message-name { color: var(--accent); }
.chat-message.outgoing .chat-message-name { color: var(--good, #7a9a4a); }

.chat-message-source {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-sender-row { display: flex; align-items: center; gap: 6px; }
.chat-sender-row strong { color: var(--text); font-family: var(--font-mono); }

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.chat-row { display: flex; gap: 8px; margin-top: 14px; }
.chat-row input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 3px;
    padding: 11px 13px;
    font-family: var(--font-mono);
    font-size: 13px;
}

button#chatSend, button.action {
    background: var(--accent);
    color: #17100a;
    border: none;
    border-radius: 3px;
    padding: 11px 18px;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
    cursor: pointer;
    transition: filter 0.12s ease;
}

button#chatSend:hover, button.action:hover { filter: brightness(1.12); }

button.action:disabled { opacity: 0.55; cursor: default; filter: none; }

.action-small {
    padding: 6px 11px;
    font-size: 11px;
    border-radius: 3px;
}

.leader-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--hazard);
    border: 1px solid rgba(209, 161, 37, 0.4);
    border-radius: 3px;
    padding: 3px 8px;
}

.muted { color: var(--muted); font-size: 12px; margin-top: 10px; font-family: var(--font-mono); }

/* ------------------------------------------------------------------ */
/* Map                                                                  */
/* ------------------------------------------------------------------ */

.map-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-legend-item { display: flex; align-items: center; gap: 6px; }

.map-legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.map-legend-dot.player {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 8px 2px var(--good-glow);
    animation: pulse 2.4s ease-in-out infinite;
}
.map-legend-dot.cargoShip { background: var(--accent); }
.map-legend-dot.patrolHelicopter { background: var(--bad); }
.map-legend-dot.travelingVendor { background: var(--hazard); }
.map-legend-dot.ch47 { background: var(--good); }
.map-legend-dot.vendingMachine { background: var(--vending); }

.map-legend-x {
    position: relative;
    width: 9px;
    height: 9px;
    display: inline-block;
}
.map-legend-x::before, .map-legend-x::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: var(--bad);
    box-shadow: 0 0 4px 1px var(--bad-glow);
}
.map-legend-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.map-legend-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

.map-legend-x.heliCrash::before, .map-legend-x.heliCrash::after {
    background: var(--hazard);
    box-shadow: 0 0 4px 1px rgba(209, 161, 37, 0.55);
}

.map-reset-btn:first-of-type { margin-left: auto; }

#mapFocusToggle.active {
    background: var(--good);
    box-shadow: 0 0 8px 1px var(--good-glow);
}

#mapGridToggle.active {
    background: var(--accent);
    box-shadow: 0 0 8px 1px var(--accent-glow);
}

.map-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.map-search-input { flex: 1; }

#mapSearchCount { margin: 0; white-space: nowrap; }

#mapSearchClear.hidden { display: none; }

.map-search-results {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 300px;
    max-height: calc(100% - 20px);
    overflow-y: auto;
    background: rgba(15, 13, 9, 0.92);
    border: 1px solid var(--border);
    border-radius: 4px;
    z-index: 6;
    box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.65);
}

.map-search-results.hidden { display: none; }

.map-search-group-header {
    padding: 8px 12px 4px;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--vending);
    background: rgba(106, 140, 175, 0.08);
    border-bottom: 1px solid var(--border-soft);
}

.map-search-result {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
}

.map-search-result:last-child { border-bottom: none; }

.map-search-result:hover { background: rgba(106, 140, 175, 0.12); }

.map-search-result-item {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
}

.map-search-result-price {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--vending);
}

.map-search-result-location {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.map-search-empty {
    padding: 14px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-dim);
}

/* ------------------------------------------------------------------ */
/* Vending machine store popup                                         */
/* ------------------------------------------------------------------ */

.vending-popup {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 55;
    pointer-events: none;
}

.vending-popup.hidden { display: none; }

.vending-popup .modal-box {
    pointer-events: auto;
}

.vending-modal-box {
    width: 420px;
    max-width: calc(100vw - 48px);
    border-top-color: var(--vending);
}

.vending-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.vending-modal-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    filter: drop-shadow(0 0 6px var(--vending-glow));
    flex-shrink: 0;
}

.vending-modal-title { margin-bottom: 3px; }

.vending-order-list {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 4px;
}

.vending-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.vending-order-row:last-child { margin-bottom: 0; }

.vending-order-col { display: flex; flex-direction: column; gap: 3px; }

.vending-order-label {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--muted-dim);
}

.vending-order-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
}

.vending-order-stock {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--vending);
    white-space: nowrap;
    text-align: right;
}

.map-wrap {
    position: relative;
    width: 100%;
    height: calc(100vh - 252px);
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: #16333c;
}

.map-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.map-canvas.dragging { cursor: grabbing; }

.map-pill {
    position: absolute;
    transform: translate(-50%, calc(-100% - 10px));
    background: rgba(15, 13, 9, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
}

.map-player-pill {
    background: rgba(10, 9, 6, 0.85);
    border: none;
    color: var(--good);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-player-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: none;
}

.map-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    margin: 0;
    background: #0b0906;
}

/* ------------------------------------------------------------------ */
/* Logs                                                                 */
/* ------------------------------------------------------------------ */

.log-view {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 16px;
    height: 70vh;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Settings                                                             */
/* ------------------------------------------------------------------ */

.settings-save-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }

.settings-list { margin-top: 10px; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 11px 15px;
    margin-bottom: 6px;
}

.setting-label { font-family: var(--font-mono); font-size: 13px; }

.setting-row input[type="text"], .setting-row input[type="number"] {
    background: #14130d;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 3px;
    padding: 7px 10px;
    width: 160px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.theme-select {
    display: block;
    width: 320px;
    max-width: 100%;
    margin: 10px 0 24px;
    padding: 10px 12px;
}

/* Foot badge sticker - the one deliberate "include a foot" touch for
   SmeagBot, kept to a small corner sticker on the brand tile so the logo
   itself still matches SeanBot/RatsBot's plain text-mark style. */
body[data-theme="smeag"] .brand-mark::after {
    content: '🦶';
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.notif-toggle-cell { text-align: center; }

/* ------------------------------------------------------------------ */
/* Timers                                                              */
/* ------------------------------------------------------------------ */

.timer-add-row { display: flex; gap: 8px; margin-top: 12px; }

.timer-duration-input { width: 140px; flex-shrink: 0; }
.timer-message-input { flex: 1; }

.timer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.timer-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.timer-row-main { flex: 1; min-width: 0; }

.timer-row-message {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timer-row-bar {
    margin-top: 7px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-soft);
    overflow: hidden;
}

.timer-row-bar-fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 8px 0 var(--accent-glow);
    transition: width 1s linear;
}

.timer-row-time {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
    min-width: 52px;
    text-align: right;
}

.timer-row-remove {
    font-size: 16px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Timer finished toasts                                               */
/* ------------------------------------------------------------------ */

.timer-toast-stack {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 95;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(340px, calc(100vw - 32px));
}

.timer-toast {
    background: var(--panel);
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 12px 14px;
    box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.65), 0 0 20px -4px var(--accent-glow);
    animation: timerToastIn 0.2s ease-out;
    position: relative;
}

@keyframes timerToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.timer-toast-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 4px;
    padding-right: 16px;
}

.timer-toast-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    word-break: break-word;
    padding-right: 16px;
}

.timer-toast-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.timer-toast-dismiss:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Tool Cupboard decay toast - lives in the same bottom-right stack as */
/* the timer toast above, but styled with the --bad tokens (same as    */
/* the alarm banner) since a decaying TC is a security-relevant state, */
/* and has no dismiss button / auto-timeout - it persists until the    */
/* upkeep state changes.                                               */
/* ------------------------------------------------------------------ */

.decay-toast {
    background: var(--panel);
    border: 1px solid var(--bad);
    border-left: 4px solid var(--bad);
    border-radius: 4px;
    padding: 12px 14px;
    box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.65), 0 0 20px -4px var(--bad-glow);
    animation: timerToastIn 0.2s ease-out;
    position: relative;
}

.decay-toast-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--bad);
    margin-bottom: 4px;
}

.decay-toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bad);
    box-shadow: 0 0 8px 2px var(--bad-glow);
    flex-shrink: 0;
    animation: pulse 1.4s ease-in-out infinite;
}

.decay-toast-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    word-break: break-word;
}
