/* =========================================================
   PLORE DESIGN SYSTEM — shared tokens & base components
   Used across TG Digest, TG Notifier, Server-Monitor, Cropper.
   Keep this block identical across projects so the products
   read as one family. Update the palette here, then copy the
   change into the other three style.css files.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&display=swap');

:root,
:root[data-theme="light"] {
    color-scheme: light;

    /* Brand source colors */
    --brand-cloud: #D9D9D9;
    --brand-ink: #070B17;
    --brand-pine: #152C13;
    --brand-sage: #5C775A;

    /* Surfaces */
    --bg: #F5F5F3;
    --bg-elevated: #FFFFFF;
    --bg-subtle: #EBEBE8;
    --bg-sunken: #E4E4E0;

    /* Text */
    --text-primary: #0C1220;
    --text-secondary: rgba(12, 18, 32, .60);
    --text-tertiary: rgba(12, 18, 32, .40);
    --text-on-accent: #FFFFFF;

    /* Borders */
    --border: rgba(12, 18, 32, .10);
    --border-strong: rgba(12, 18, 32, .18);

    /* Accent buttons and actions */
    --accent: #5C775A;
    --accent-strong: #A82E27;
    --accent-soft: rgba(216, 78, 61, .14);
    --accent-soft-strong: rgba(216, 78, 61, .24);
    --button-accent: #5C775A;
    --button-warning: #7FA6B8;
    --button-danger: #D14B6A;

    /* Status */
    --status-ok: #3D8B4B;
    --status-ok-soft: rgba(61, 139, 75, .12);
    --status-warning: #7FA6B8;
    --status-warning-soft: rgba(245, 180, 0, .14);
    --status-critical: #D14B6A;
    --status-critical-soft: rgba(227, 61, 53, .14);
    --status-unknown: var(--text-tertiary);
    --status-unknown-soft: rgba(12, 18, 32, .06);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(12, 18, 32, .06), 0 1px 1px rgba(12, 18, 32, .04);
    --shadow-md: 0 10px 28px rgba(12, 18, 32, .08), 0 2px 8px rgba(12, 18, 32, .05);
    --shadow-lg: 0 26px 64px rgba(12, 18, 32, .14), 0 8px 22px rgba(12, 18, 32, .07);

    --glass-bg: rgba(255, 255, 255, .72);
    --glass-border: rgba(12, 18, 32, .08);
    --scrim: rgba(7, 11, 23, .35);
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #070B17;
    --bg-elevated: #11172A;
    --bg-subtle: #151D33;
    --bg-sunken: #0B1120;

    --text-primary: #F3F4F6;
    --text-secondary: rgba(243, 244, 246, .64);
    --text-tertiary: rgba(243, 244, 246, .42);
    --text-on-accent: #0B1220;

    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .16);

    --accent: #5C775A;
    --accent-strong: #FF8A66;
    --accent-soft: rgba(240, 106, 77, .18);
    --accent-soft-strong: rgba(240, 106, 77, .28);
    --status-ok: #6FCB7F;
    --status-ok-soft: rgba(111, 203, 127, .14);
    --status-warning: #7FA6B8;
    --status-warning-soft: rgba(255, 183, 3, .18);
    --status-critical: #FF5B52;
    --status-critical-soft: rgba(255, 91, 82, .18);
    --status-unknown: var(--text-tertiary);
    --status-unknown-soft: rgba(255, 255, 255, .06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-lg: 0 34px 84px rgba(0, 0, 0, .55), 0 10px 24px rgba(0, 0, 0, .35);

    --glass-bg: rgba(17, 23, 42, .66);
    --glass-border: rgba(255, 255, 255, .08);
    --scrim: rgba(2, 4, 10, .55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #070B17;
        --bg-elevated: #11172A;
        --bg-subtle: #151D33;
        --bg-sunken: #0B1120;
        --text-primary: #F3F4F6;
        --text-secondary: rgba(243, 244, 246, .64);
        --text-tertiary: rgba(243, 244, 246, .42);
        --text-on-accent: #0B1220;
        --border: rgba(255, 255, 255, .09);
        --border-strong: rgba(255, 255, 255, .16);
        --accent: #5C775A;
        --accent-strong: #FF8A66;
        --accent-soft: rgba(240, 106, 77, .18);
        --accent-soft-strong: rgba(240, 106, 77, .28);
        --status-ok: #6FCB7F;
        --status-ok-soft: rgba(111, 203, 127, .14);
        --status-warning: #FFB703;
        --status-warning-soft: rgba(255, 183, 3, .18);
        --status-critical: #FF5B52;
        --status-critical-soft: rgba(255, 91, 82, .18);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
        --shadow-md: 0 14px 34px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
        --shadow-lg: 0 34px 84px rgba(0, 0, 0, .55), 0 10px 24px rgba(0, 0, 0, .35);
        --glass-bg: rgba(17, 23, 42, .66);
        --glass-border: rgba(255, 255, 255, .08);
        --scrim: rgba(2, 4, 10, .55);
    }
}

:root {
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;
    --font-sans: 'Jost', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 450;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -.02em;
    margin: 0;
    color: var(--text-primary);
}

p { margin: 0; }

a { color: inherit; }

::selection { background: var(--accent-soft-strong); }

/* Focus ring */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- Layout shell ---------- */
.plore-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 70px;
}

/* ---------- Top navigation ---------- */
.plore-nav {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 26px;
}

.plore-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.plore-mark {
    position: relative;
    display: block;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: url("icons/logo.svg") center / contain no-repeat;
    box-shadow: none;
    overflow: hidden;
    animation: none;
}

.plore-mark::after {
    content: none;
}

.plore-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.plore-brand-text .plore-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--text-tertiary);
}

.plore-brand-text .plore-product {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text-primary);
}

.plore-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 30px;
    padding: 3px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}

.theme-toggle .knob {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
    transition: transform .25s var(--ease);
}

:root[data-theme="dark"] .theme-toggle .knob {
    transform: translateX(22px);
}

.theme-toggle .knob svg { width: 13px; height: 13px; }

.theme-toggle svg.sun { color: #B5790C; }
.theme-toggle svg.moon { color: var(--accent); display: none; }

:root[data-theme="dark"] .theme-toggle svg.sun { display: none; }
:root[data-theme="dark"] .theme-toggle svg.moon { display: block; }

/* ---------- Buttons ---------- */
button, .btn, .button {
    font: inherit;
    font-family: var(--font-sans);
}

.btn, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 11px 18px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -.01em;
    cursor: pointer;
    background: var(--button-accent, var(--accent));
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
    transition: transform .12s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}

.btn:hover, .button:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active, .button:active { transform: translateY(0) scale(.98); }

.btn-ghost, .button-ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: none;
}
.btn-ghost:hover, .button-ghost:hover { background: var(--bg-subtle); box-shadow: none; }

a.button.button-ghost.logout-button {
    min-width: 92px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-primary);
    box-shadow: none;
    text-decoration: none;
}

a.button.button-ghost.logout-button:hover,
a.button.button-ghost.logout-button:focus-visible {
    background: var(--bg-sunken);
    border-color: transparent;
    box-shadow: none;
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: none;
}

.btn-warning, .button-warning {
    background: var(--button-warning, var(--status-warning));
    color: #FFFFFF;
}

.btn-danger, .button-danger {
    background: var(--button-danger, var(--status-critical));
    color: #FFFFFF;
}

/* ---------- Cards ---------- */
.card, .surface {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ---------- Inputs ---------- */
input, textarea, select {
    font: inherit;
    font-family: var(--font-sans);
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-primary);
    outline: none;
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}

input::placeholder, textarea::placeholder { color: var(--text-tertiary); }

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; }

/* ---------- Status badges ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 56px;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--status-unknown-soft);
    color: var(--status-unknown);
}

.status-badge.ok { background: var(--status-ok-soft); color: var(--status-ok); }
.status-badge.warning { background: var(--status-warning-soft); color: var(--status-warning); }
.status-badge.critical, .status-badge.down { background: var(--status-critical-soft); color: var(--status-critical); }

/* ---------- Tooltip ---------- */
.tooltip { position: relative; cursor: help; }

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 40;
    left: 0;
    bottom: calc(100% + 10px);
    width: min(280px, calc(100vw - 48px));
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    white-space: pre-line;
    text-align: left;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
}

.tooltip:hover::after, .tooltip:focus-within::after, .tooltip.tooltip-active::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---------- Login layout (shared across services) ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(60% 50% at 15% 0%, var(--accent-soft), transparent 60%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 30px 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: left;
}

.login-card .plore-mark { margin-bottom: 16px; }

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

.login-subtitle {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 0 24px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-form label { display: flex; flex-direction: column; gap: 7px; }

.login-form label span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.login-form button, .login-form .button { margin-top: 4px; width: 100%; }

.login-error {
    padding: 11px 13px;
    border: 1px solid var(--status-critical-soft);
    border-radius: var(--radius-sm);
    background: var(--status-critical-soft);
    color: var(--status-critical);
    font-size: 12.5px;
    line-height: 1.4;
}

.eyebrow, .section-title, .card-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-tertiary);
}

/* =========================================================
   TG DIGEST — product-specific styles
   ========================================================= */

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px 70px; }

.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }

h1 { font-size: 28px; margin: 2px 0 4px; }
h2 { margin: 5px 0 0; font-size: 18px; }
h3 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.01em; }

.text-link { color: var(--text-secondary); font-size: 13px; text-decoration: none; }
.text-link:hover { color: var(--text-primary); }

.group-schedule { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-secondary); font-size: 12px; }
.group-schedule strong { color: var(--accent); font-weight: 600; }
.group-pending { margin-top: 8px; color: var(--text-secondary); font-size: 12px; }
.group-pending strong { color: var(--text-primary); font-weight: 600; }

.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 20px; }

.resource {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.resource--recipient {
    min-height: 100%;
}

.resource-form--recipient {
    margin-top: auto;
}

.recipient-last-sent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 12px;
}

.recipient-last-sent strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.resource--action .stack-form { margin-top: auto; }

.resource-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 18px;
    padding: 12px 12px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}

.resource-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 12px;
}

.resource-meta-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.metric { font-size: 28px; font-weight: 600; margin: 12px 0; letter-spacing: -.02em; }
.small-metric { font-size: 19px; word-break: break-all; }

.card-title { margin-bottom: 4px; }

.notice { margin-bottom: 20px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); font-size: 14px; }
.notice-success { background: var(--status-ok-soft); color: var(--status-ok); border-color: transparent; }
.notice-error { background: var(--status-critical-soft); color: var(--status-critical); border-color: transparent; }
.notice-warning { background: var(--status-warning-soft); color: var(--status-warning); border-color: transparent; }
.notice code { background: var(--bg-subtle); padding: 1px 6px; border-radius: 6px; color: var(--text-primary); }

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-subtle) 100%);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    animation: toast-in .22s var(--ease) both;
}

.toast::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--border-strong);
}

.toast-pending {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-sunken) 100%);
}
.toast-pending::before { background: var(--text-tertiary); }

.toast-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 6px;
}

.toast-loader {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: 17px;
    height: 14px;
    flex: 0 0 17px;
}
.toast-loader-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: toast-loader-pulse 1.05s ease-in-out infinite;
}
.toast-success { border-color: rgba(61, 139, 75, .24); }
.toast-success::before { background: var(--status-ok); }
.toast-error { border-color: rgba(209, 75, 106, .24); }
.toast-error::before { background: var(--status-critical); }
.toast-close {
    flex: 0 0 auto;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(12, 18, 32, .02);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.toast-close:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

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

@keyframes toast-loader-pulse {
    0%, 60%, 100% { opacity: .35; }
    30% { opacity: 1; }
}

body.modal-open { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--scrim);
    animation: modal-backdrop-in .16s ease both;
}

.modal-backdrop[hidden] { display: none; }

.modal {
    width: min(100%, 430px);
    padding: 26px;
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    box-shadow: var(--shadow-lg);
    animation: modal-in .2s var(--ease) both;
}

.modal-kicker {
    margin-bottom: 8px;
    color: var(--status-critical);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.modal h2 { font-size: 22px; }
.modal p { margin-top: 10px; color: var(--text-secondary); line-height: 1.5; }
.modal p strong { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.submetric { color: var(--text-secondary); font-size: 12px; margin-top: -6px; margin-bottom: 12px; }

.stack-form, .large-form { display: flex; flex-direction: column; gap: 12px; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
.technical-settings > .checkbox-label { margin-top: 12px; }

.chart-card { padding: 22px; margin-bottom: 30px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { margin: 0 0 18px; }

.group-grid { display: grid; gap: 18px; }

.group-card {
    padding: 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.channel-list { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 4px; }
.channel-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }

.field-label { color: var(--text-tertiary); font-size: 11px; font-weight: 600; letter-spacing: .04em; }

.channel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--status-ok);
    background: var(--status-ok-soft);
    font-size: 12px;
    font-weight: 600;
}

.channel-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.remove-channel {
    width: 24px;
    height: 24px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.remove-channel:hover, .remove-channel:focus-visible { color: var(--text-secondary); background: var(--bg-sunken); }

.channel-tooltip-trigger { cursor: help; outline: none; }
.channel-tooltip-trigger:focus-visible { border-color: var(--status-ok); box-shadow: 0 0 0 3px var(--status-ok-soft); }
.channel-tooltip {
    position: absolute;
    z-index: 10;
    top: calc(100% + 8px);
    left: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: max-content;
    max-width: min(440px, calc(100vw - 56px));
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity .14s ease, transform .14s ease;
}
.channel-tooltip b { color: var(--text-primary); font-weight: 650; }
.channel-tooltip.is-visible { opacity: 1; transform: translateY(0); }

.channel-mark { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--status-ok); box-shadow: 0 0 0 4px var(--status-ok-soft); }
.channel-mark-warning { background: var(--status-warning); box-shadow: 0 0 0 4px var(--status-warning-soft); }

.channel-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; object-fit: cover; }

.channel-id { margin-left: auto; color: var(--text-tertiary); font-size: 11px; font-variant-numeric: tabular-nums; }
.channel-id-warning { color: var(--status-warning); }

.channel-hint {
    font-size: 12px;
    color: var(--status-warning);
    background: var(--status-warning-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    margin-bottom: 4px;
}

.technical-settings { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.technical-settings summary { color: var(--text-secondary); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.technical-settings[open] summary { margin-bottom: 12px; }

.group-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.group-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline-flex; }

.empty-state { padding: 16px 0; color: var(--text-secondary); }

@media (max-width: 640px) {
    .container { padding-left: 14px; padding-right: 14px; }
    .plore-nav { padding: 18px 14px 20px; }

    .header, .group-header { flex-direction: column; align-items: flex-start; }
    .group-actions { width: 100%; }
    .group-actions .button { flex: 1; }
}

@media (min-width: 960px) {
    .group-grid {
        display: block;
        column-count: 2;
        column-gap: 18px;
    }

    .group-card {
        display: inline-block;
        width: 100%;
        margin-bottom: 18px;
        vertical-align: top;
        break-inside: avoid;
    }
}
