:root {
    --bg: #0f0f13;
    --card: #1a1a22;
    --accent: #53fc18;
    --accent-ink: #06210a;
    --text: #e8e8ec;
    --muted: #9a9aa6;
    --danger: #ff5050;
}

/* Motyw Twitcha: gdy wybrana jest platforma Twitch, akcent staje się fioletowy. */
.layout[data-platform="twitch"] {
    --accent: #9147ff;
    --accent-ink: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 16px;
    color: var(--muted);
    margin-top: 28px;
}

h2.collapsible {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

h2.collapsible:hover {
    color: var(--text);
}

h2.collapsible .chevron {
    font-size: 12px;
    width: 12px;
    display: inline-block;
}

h2.collapsible .count-badge {
    background: #2a2a36;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 1px 8px;
    line-height: 18px;
}

.card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2a2a36;
    background: #101018;
    color: var(--text);
    margin-top: 6px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 10px;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

button.secondary {
    background: #2a2a36;
    color: var(--text);
}

button.link {
    background: none;
    color: var(--danger);
    padding: 4px 8px;
    font-weight: 500;
}

button.icon-button {
    background: none;
    border: none;
    padding: 4px 6px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

button.icon-button:hover {
    color: var(--text);
    background: #2a2a36;
}

button.icon-button svg {
    display: block;
}

.platform-selector {
    display: flex;
    gap: 8px;
    margin: 8px 0 4px;
}

.plat-tab {
    background: #2a2a36;
    color: var(--text);
    border: 1px solid transparent;
    padding: 8px 16px;
    font-weight: 600;
}

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

.plat-tab.active.kick {
    background: var(--accent);
    color: #06210a;
}

.plat-tab.active.twitch {
    background: #9147ff;
    color: #fff;
}

.plat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 999px;
    padding: 1px 7px;
    vertical-align: middle;
}

.plat-badge.kick {
    background: rgba(83, 252, 24, 0.15);
    color: #53fc18;
}

.plat-badge.twitch {
    background: rgba(145, 71, 255, 0.18);
    color: #b794ff;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.acct {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #24242e;
}

.acct:last-child {
    border-bottom: none;
}

.autospam {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

.autospam input {
    width: auto;
    margin: 2px 0 0;
}

.spam-config {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.spam-config label {
    margin-top: 0;
    font-size: 12px;
    color: var(--muted);
}

.spam-config input {
    margin-top: 4px;
}

h3.collapsible.sub {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    margin: 16px 0 8px;
    padding-top: 14px;
    border-top: 1px solid #24242e;
}

h3.collapsible.sub .chevron {
    font-size: 11px;
    width: 11px;
    display: inline-block;
}

h3.collapsible.sub .count-badge {
    background: #2a2a36;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    padding: 1px 8px;
    line-height: 18px;
}

.spam-history {
    margin-top: 8px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #24242e;
    border-radius: 8px;
}

.spam-history-head,
.spam-history-row {
    display: grid;
    grid-template-columns: 72px 64px minmax(70px, 1fr) 52px minmax(0, 2fr);
    gap: 10px;
    padding: 7px 12px;
    align-items: baseline;
}

.spam-history-head {
    position: sticky;
    top: 0;
    background: #14141c;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid #24242e;
}

.spam-history-row {
    font-size: 13px;
    border-bottom: 1px solid #1d1d26;
}

.spam-history-row:last-child {
    border-bottom: none;
}

.spam-history-row span:last-child {
    overflow-wrap: anywhere;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.simple-table th,
.simple-table td {
    border-bottom: 1px solid #24242e;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.simple-table thead th {
    color: var(--muted);
    font-weight: 600;
    background: #14141c;
}

/* Liczba kont (wysłano/łącznie) w historii; czerwona, gdy były błędy. */
.acct-count {
    color: var(--muted);
}

.acct-count.err {
    color: var(--danger);
    font-weight: 600;
    cursor: help;
}

/* Pasek nad historią: tytuł + akcja „Wyczyść”. */
.spam-history-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 4px 0 0;
}

.history-clear {
    background: none;
    color: var(--muted);
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
}

.history-clear:hover {
    color: var(--danger);
}

/* Przełączniki sygnałów (dźwięk / powiadomienia). */
.signal-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #24242e;
}

.signal-hint {
    margin: 2px 0 0 24px;
    font-size: 12px;
    color: var(--danger);
}

/* Wybór kont, z których leci auto-spam. */
.spam-accounts-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.spam-accounts-actions button {
    background: #2a2a36;
    color: var(--text);
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

.spam-accounts-actions button:hover {
    background: #34343f;
}

.spam-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #24242e;
    border-radius: 8px;
    padding: 8px 10px;
}

.acct-pick {
    font-size: 13px;
}

/* Badge ostrzeżenia przy nagłówkach (np. liczba kont z problemem). */
.count-badge.warn {
    background: rgba(255, 176, 32, 0.18);
    color: #ffb020;
}

/* Panel zdrowia tokenów. */
.token-health {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #24242e;
}

.token-row:last-child {
    border-bottom: none;
}

.token-info {
    min-width: 0;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.health-dot.ok {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(83, 252, 24, 0.5);
}

.health-dot.warn {
    background: #ffb020;
    box-shadow: 0 0 6px rgba(255, 176, 32, 0.5);
}

.health-dot.err {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(255, 80, 80, 0.5);
}

.token-status {
    font-size: 12px;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.token-status.ok {
    color: var(--muted);
}

.token-status.warn {
    color: #ffb020;
}

.token-status.err {
    color: var(--danger);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

#status {
    margin-top: 10px;
    font-size: 14px;
    min-height: 18px;
}

.ok {
    color: var(--accent);
}

.err {
    color: var(--danger);
}

code {
    background: #101018;
    padding: 2px 6px;
    border-radius: 4px;
}

.layout {
    display: flex;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    align-items: flex-start;
}

.main {
    flex: 0 1 360px;
    min-width: 300px;
}

.stream-col {
    flex: 3 1 0;
    min-width: 360px;
    position: sticky;
    top: 24px;
}

.chat {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}

.stream-box {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.stream-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.stream-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.chat-box {
    background: var(--card);
    border-radius: 12px;
    padding: 12px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.chat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.chat-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.chat-status.live {
    color: var(--accent);
}

.chat-status.err {
    color: var(--danger);
}

.chat-msgs {
    flex: 1;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

.chat-msg {
    padding: 3px 0;
    overflow-wrap: anywhere;
}

.chat-user {
    font-weight: 600;
}

.chat-emote {
    height: 22px;
    width: auto;
    vertical-align: middle;
    margin: -2px 1px;
}

.chat-empty {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1200px) {
    .layout {
        flex-wrap: wrap;
    }

    .stream-col {
        flex-basis: 60%;
        position: static;
    }

    .chat {
        position: static;
    }
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .stream-col,
    .chat {
        width: 100%;
        flex-basis: auto;
        position: static;
    }

    .chat-box {
        height: 50vh;
    }
}

/* ===== Nawigacja (Menedżer / Auto-spam) ===== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(15, 15, 19, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #24242e;
}

.nav-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-tab {
    background: #2a2a36;
    color: var(--text);
    border: 1px solid transparent;
    padding: 8px 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-tab.active {
    background: #4f7cff;
    color: #ffffff;
}

.nav-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #53fc18;
    box-shadow: 0 0 6px rgba(83, 252, 24, 0.7);
}

/* Przełącznik języka (PL/EN) — grupowany po prawej, przy panic-buttonie. */
.nav-lang {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.nav-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.nav-user-name {
    font-size: 12px;
    color: var(--muted);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-extra {
    font-size: 11px;
    color: #b9b9c5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-user-role {
    background: #355f24;
    color: #d7ffc5;
    border: 1px solid #4a7a35;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 6px;
}

.nav-user-btn {
    background: #2a2a36;
    color: var(--text);
    border: 1px solid transparent;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}

.nav-user-btn.danger {
    color: #ffc7c7;
    border-color: #5b2a2a;
}

.lang-btn {
    background: #2a2a36;
    color: var(--muted);
    border: 1px solid transparent;
    padding: 6px 10px;
    min-width: 34px;
    font-weight: 700;
    font-size: 12px;
    border-radius: 8px;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--accent);
    color: var(--accent-ink);
}

/* ===== Kontener strony ===== */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.auth-gate {
    max-width: 560px;
}

.auth-card h1 {
    margin-top: 0;
}

.page-head h1 {
    margin: 0 0 4px;
}

.save-badge {
    font-size: 0.55em;
    font-weight: normal;
    vertical-align: middle;
}

.save-badge.err {
    color: var(--danger);
}

.intro {
    margin-top: 0;
}

/* ===== Karty auto-spamu (osobno dla każdej platformy) ===== */
.spam-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    margin: 12px 0 8px;
}

.spam-card {
    border-top: 3px solid #2a2a36;
}

.spam-card[data-platform="kick"] {
    border-top-color: #53fc18;
}

.spam-card[data-platform="twitch"] {
    border-top-color: #9147ff;
}

.spam-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

/* Plakietka zdrowia nasłuchu (serwer): zielony = nasłuch, żółty = łączenie, czerwony = błąd. */
.listener-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    margin: 2px 0 10px;
    color: var(--muted, #9aa4b2);
}
.listener-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    flex: 0 0 auto;
}
.listener-status.live .dot { background: #3fb950; }
.listener-status.connecting .dot { background: #d29922; }
.listener-status.error { color: #f85149; }
.listener-status.error .dot { background: #f85149; }

.spam-card .switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
}

.spam-card .switch input {
    width: auto;
    margin: 0;
}

.spam-card-note {
    margin-top: 10px;
}

.chatroom-id input {
    max-width: 180px;
}

.send-delay input {
    max-width: 140px;
}

/* Karty obok siebie na szerokim ekranie, w stosie na wąskim. */
@media (max-width: 760px) {
    .spam-cards {
        grid-template-columns: 1fr;
    }
}

/* Sygnały jako osobna karta — bez górnej kreski. */
.signal-toggles.no-border {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* ===== Historia: pasek z filtrem platformy ===== */
.spam-history-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.history-filter {
    display: flex;
    gap: 6px;
}

.history-filter .hf {
    background: #2a2a36;
    color: var(--text);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}

.history-filter .hf.active.all {
    background: #3a3a48;
    color: #fff;
}

.history-filter .hf.active.kick {
    background: #53fc18;
    color: #06210a;
}

.history-filter .hf.active.twitch {
    background: #9147ff;
    color: #fff;
}

/* ===== M-D: platformy read-only, panic, guardraile, wyzwalacze, zdrowie ===== */

/* Plakietki i kreski kart dla YouTube / TikTok. */
.plat-badge.youtube {
    background: rgba(255, 0, 51, 0.15);
    color: #ff6b81;
}

.plat-badge.tiktok {
    background: rgba(37, 244, 238, 0.15);
    color: #25f4ee;
}

.spam-card[data-platform="youtube"] {
    border-top-color: #ff0033;
}

.spam-card[data-platform="tiktok"] {
    border-top-color: #25f4ee;
}

.spam-card.read-only {
    opacity: 0.96;
}

.ro-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    background: #2a2a36;
    color: var(--muted);
    padding: 1px 7px;
    border-radius: 999px;
}

.ro-note {
    margin-top: 10px;
}

.channel-hint {
    margin-top: 4px;
    font-size: 11px;
}

/* ===== Wiele kanałów na platformę (lista monitorowanych kanałów) ===== */
.server-channels {
    margin-top: 10px;
}

.server-channels-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.channel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.channel-row input {
    flex: 1 1 auto;
    margin-top: 0;
}

/* Kropka statusu pojedynczego kanału (kolory jak w plakietce zbiorczej). */
.chan-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
    flex: 0 0 auto;
}
.chan-dot.live { background: #3fb950; }
.chan-dot.connecting { background: #d29922; }
.chan-dot.error { background: #f85149; }
.chan-dot.off { background: #3a3a48; }

.chan-remove {
    flex: 0 0 auto;
    background: #2a2a36;
    color: var(--muted);
    padding: 6px 11px;
    line-height: 1;
    font-weight: 700;
}
.chan-remove:hover {
    background: #3a1414;
    color: #ff8a8a;
}

.chan-add {
    background: #2a2a36;
    color: var(--text);
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== Akordeon per kanał (Kick/Twitch — każdy kanał ma własne ustawienia) ===== */
.channel-blocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.channel-block {
    border: 1px solid #2a2a36;
    border-radius: 10px;
    background: #20202a;
    overflow: hidden;
}
.channel-block.open {
    border-color: #3a3a48;
    background: #23232e;
}

.channel-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}
.channel-block-head input {
    flex: 1 1 auto;
    margin-top: 0;
}

.chan-toggle {
    flex: 0 0 auto;
    background: #2a2a36;
    color: var(--text);
    padding: 6px 10px;
    line-height: 1;
    font-weight: 700;
    min-width: 32px;
}
.chan-toggle:hover { background: #34343f; }

.channel-block-body {
    padding: 0 10px 12px;
    border-top: 1px solid #2a2a36;
}
.channel-block-body .spam-config { margin-top: 10px; }

/* Konta per kanał (wewnątrz rozwiniętego bloku kanału). */
.channel-accounts {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #2f2f3a;
}
/* Naglowek sekcji kont = klikalny przycisk (zwijanie listy kont, domyslnie zwiniete). */
.channel-accounts-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 2px 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    color: var(--muted);
    font: inherit;
}
.channel-accounts-toggle:hover { color: var(--text); }
.channel-accounts.open .channel-accounts-toggle { margin-bottom: 6px; }
.chan-toggle-caret {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1;
    color: var(--muted);
}
.channel-accounts-label {
    font-size: 13px;
    color: inherit;
}

/* Panic-button w nawigacji (zawsze pod ręką, też na telefonie). */
.nav-panic {
    background: #3a1414;
    color: #ff8a8a;
    border: 1px solid #5a2020;
    padding: 8px 14px;
    font-weight: 800;
    border-radius: 8px;
    min-height: 38px;
    white-space: nowrap;
}

.nav-panic.armed {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.5);
}

.nav-panic.done {
    background: #1d3a1d;
    color: #9cff9c;
    border-color: #2e5a2e;
}

.nav-panic:disabled {
    opacity: 0.6;
}

/* Duży panic-button w nagłówku strony Auto-spam. */
.page-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panic-btn {
    background: var(--danger);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 10px;
    min-height: 48px;
    box-shadow: 0 2px 10px rgba(255, 80, 80, 0.35);
    letter-spacing: 0.02em;
}

.panic-btn.working {
    background: #5a2020;
}

.panic-btn.done {
    background: #1d3a1d;
    color: #9cff9c;
}

.panic-btn:disabled {
    opacity: 0.65;
}

/* Pasek ostrzeżeń o kontach (ban-protection). */
.health-alerts {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.health-alert {
    background: rgba(255, 80, 80, 0.12);
    border-left: 3px solid var(--danger);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #ffb3b3;
}

/* Karta guardraili (bezpiecznik + limity tempa). */
.guardrails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.guard-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.guard-note {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.spam-config.disabled {
    opacity: 0.45;
}

/* Edytor wyzwalaczy. */
.triggers {
    margin-top: 14px;
    border-top: 1px dashed #2a2a36;
    padding-top: 12px;
}

.triggers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.triggers-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.triggers-add {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.triggers-add button {
    background: #2a2a36;
    color: var(--text);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}

.triggers-empty {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.55;
}

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

.trigger-row {
    background: #15151c;
    border: 1px solid #24242e;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trigger-row.off {
    opacity: 0.55;
}

.trigger-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trigger-row-top select {
    flex: 1;
    min-width: 0;
}

.trigger-on {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.trigger-on input {
    width: auto;
    margin: 0;
}

.trigger-del {
    background: transparent;
    color: var(--danger);
    border: 1px solid #4a2020;
    padding: 2px 9px;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1;
}

.trigger-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--muted);
}

.trigger-field input {
    margin-top: 0;
    width: 100%;
}

.trigger-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.trigger-check input {
    width: auto;
    margin: 0;
}

/* Serwerowe zdrowie konta w panelu „Zdrowie tokenów". */
.token-server {
    font-size: 11px;
    margin-top: 2px;
}

/* ===== Telefon: panic na całą szerokość, kompaktowa nawigacja ===== */
@media (max-width: 760px) {
    .guardrails {
        grid-template-columns: 1fr;
    }

    .panic-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .nav-brand {
        display: none;
    }

    .nav-bar {
        gap: 8px;
        padding: 10px 14px;
    }

    .nav-tab {
        padding: 8px 14px;
    }

    .nav-user-name {
        display: none;
    }
}
