* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b1016;
    color: #edf2f7;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(75, 100, 140, 0.14), transparent 35%),
        #0b1016;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: default;
    opacity: 0.55;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.eyebrow,
.section-label {
    color: #8fa2b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

h1 {
    margin: 7px 0 4px;
    font-size: clamp(36px, 6vw, 54px);
    line-height: 1;
    letter-spacing: -0.04em;
}

h2 {
    margin: 6px 0 0;
    font-size: 20px;
}

.subtitle,
.muted {
    color: #8291a4;
}

.subtitle {
    margin: 8px 0 0;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.badge-live {
    color: #67e8b0;
    background: rgba(60, 180, 130, 0.12);
}

.badge-reconnecting {
    color: #f4c96b;
    background: rgba(244, 201, 107, 0.12);
}

.badge-offline {
    color: #ff7373;
    background: rgba(255, 90, 90, 0.12);
}

.panel,
.status-card {
    background: rgba(18, 25, 35, 0.94);
    border: 1px solid #273445;
    border-radius: 16px;
}

.panel {
    padding: 22px;
    margin-bottom: 22px;
}

.auth-panel {
    display: grid;
    gap: 18px;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

input {
    min-width: 0;
    width: 100%;
    padding: 13px 14px;
    color: #edf2f7;
    background: #0c121a;
    border: 1px solid #2b394b;
    border-radius: 10px;
    outline: none;
}

input:focus {
    border-color: #6ed9aa;
}

button {
    border: 1px solid #304055;
    border-radius: 10px;
    padding: 11px 16px;
    color: #eaf1f7;
    background: #16202c;
}

button:hover:not(:disabled) {
    filter: brightness(1.12);
}

button.primary {
    min-width: 110px;
    color: #07130e;
    background: #68d9a8;
    border-color: #68d9a8;
    font-weight: 800;
}

button.secondary {
    padding: 9px 14px;
}

.message {
    min-height: 20px;
    color: #ff7777;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

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

.status-card {
    padding: 18px;
    min-height: 116px;
}

.status-value {
    margin: 10px 0 5px;
    font-size: 22px;
    font-weight: 800;
}

.status-value.small {
    font-size: 18px;
    word-break: break-word;
}

.status-online {
    color: #68d9a8;
}

.status-offline {
    color: #ff7373;
}

.status-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channels-section {
    margin-bottom: 28px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.channel-card {
    position: relative;
    padding: 22px;
    min-height: 154px;
    background: rgba(18, 25, 35, 0.94);
    border: 1px solid #273445;
    border-radius: 16px;
    transition:
        border-color 140ms ease,
        transform 140ms ease,
        opacity 140ms ease;
}

.channel-card.pending {
    opacity: 0.72;
}

.channel-card.on {
    border-color: #3b7b62;
}

.channel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channel-number {
    color: #8fa2b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.channel-state {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.channel-state.on {
    color: #68d9a8;
}

.channel-state.off {
    color: #8fa2b8;
}

.channel-title {
    margin: 12px 0 26px;
    font-size: 20px;
    font-weight: 800;
}

.channel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.channel-description {
    color: #d7e0e9;
    font-size: 13px;
}

.channel-button {
    min-width: 98px;
    color: #07130e;
    background: #68d9a8;
    border-color: #68d9a8;
    font-weight: 800;
}

.channel-button.off {
    color: #eaf1f7;
    background: #16202c;
    border-color: #304055;
}

.activity {
    max-height: 250px;
    overflow: auto;
    border: 1px solid #222e3d;
    border-radius: 10px;
    background: #0c121a;
}

.activity-row {
    padding: 9px 11px;
    border-bottom: 1px solid #1b2633;
    color: #aab8c7;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.activity-row:last-child {
    border-bottom: 0;
}

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

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 1120px);
        padding-top: 20px;
    }

    .topbar {
        flex-direction: column;
        margin-bottom: 22px;
    }

    .auth-row {
        grid-template-columns: 1fr;
    }

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

    .section-heading {
        align-items: center;
    }
}
