html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: #17313c;
    background:
        radial-gradient(circle at top left, rgba(33, 184, 166, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 183, 77, 0.18), transparent 26%),
        linear-gradient(180deg, #f4fbfa 0%, #edf5f4 100%);
}

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

.page-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px 18px 40px;
}

.panel {
    border-radius: 24px;
    border: 1px solid rgba(23, 49, 60, 0.08);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(23, 49, 60, 0.08);
}

.hero-card {
    padding: 26px;
}

.eyebrow,
.section-kicker {
    margin: 0;
    color: #0b7a74;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
}

.hero-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.hero-heading h1,
.section-header h2,
.stream-meta h3,
.viewer-card h3 {
    margin: 0;
    font-weight: 700;
}

.hero-heading p,
.stream-meta p,
.viewer-card p {
    margin: 8px 0 0;
    color: #52707d;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button,
.ghost-button {
    border-radius: 999px;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

#copyInviteButton,
.primary-button {
    background: linear-gradient(135deg, #0b7a74, #129f91);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(18, 159, 145, 0.24);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 122, 116, 0.08);
    color: #0b5d5a;
    border: 1px solid rgba(11, 122, 116, 0.14);
}

.stats-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(244, 251, 250, 0.98), rgba(232, 243, 242, 0.98));
    border: 1px solid rgba(11, 122, 116, 0.12);
}

.stat-label {
    display: block;
    color: #52707d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.05rem;
}

.status-stack {
    margin-top: 22px;
    display: grid;
    gap: 12px;
}

.status-banner {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(23, 49, 60, 0.08);
    background: rgba(244, 251, 250, 0.96);
    color: #34525f;
}

.warning-banner {
    background: rgba(255, 246, 230, 0.98);
    border-color: rgba(232, 145, 39, 0.2);
    color: #8a4b08;
}

.layout-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.settings-panel,
.preview-panel,
.viewers-panel {
    padding: 24px;
}

.viewers-panel {
    grid-column: 1 / -1;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-header-spacing {
    margin-top: 28px;
}

.field-block {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #34525f;
}

.field-block span {
    font-weight: 600;
}

.field-block small {
    color: #6a848f;
    line-height: 1.45;
}

.field-block input,
.field-block select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(23, 49, 60, 0.14);
    background: #ffffff;
    color: #17313c;
}

.source-group {
    display: grid;
    gap: 0;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(244, 251, 250, 0.98), rgba(237, 246, 245, 0.96));
    border: 1px solid rgba(11, 122, 116, 0.12);
}

.source-group-header {
    margin-bottom: 14px;
}

.source-group-header h3 {
    margin: 6px 0 0;
    font-size: 1.04rem;
    color: #17313c;
}

.source-group-body {
    display: grid;
    gap: 0;
    margin-top: 14px;
}

.source-group-body[hidden] {
    display: none;
}

.audio-processing-group {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.audio-processing-heading {
    margin-bottom: 0;
}

.audio-processing-group .toggle-row {
    margin-top: 0;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(244, 251, 250, 0.9);
    border: 1px solid rgba(11, 122, 116, 0.12);
    margin-top: 14px;
}

.toggle-copy {
    display: block;
    flex: 1 1 auto;
    cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
    display: block;
}

.toggle-row small {
    margin-top: 4px;
    color: #52707d;
}

.toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.stream-card {
    display: grid;
    gap: 16px;
}

.stream-media {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    border-radius: 22px;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(145deg, rgba(11, 122, 116, 0.9), rgba(255, 183, 77, 0.5)),
        #0f2c34;
}

.stream-media video,
.media-fallback {
    width: 100%;
    height: 100%;
}

.stream-media video {
    display: block;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    object-fit: contain;
    object-position: center center;
    background: #07171b;
}

.media-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 40%),
        linear-gradient(180deg, rgba(7, 23, 27, 0.2), rgba(7, 23, 27, 0.5));
    color: #ffffff;
    font-size: clamp(34px, 7vw, 72px);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.chip-active {
    background: rgba(21, 153, 95, 0.14);
    color: #0b7a4f;
}

.chip-muted {
    background: rgba(191, 44, 69, 0.12);
    color: #b12240;
}

.viewer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.viewer-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(23, 49, 60, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 246, 0.96));
}

.viewer-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.viewer-id {
    color: #6b8590;
}

.viewer-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(11, 122, 116, 0.08);
    color: #0b5d5a;
    font-size: 0.78rem;
    font-weight: 700;
}

.viewer-state-soft {
    background: rgba(136, 152, 167, 0.16);
    color: #4c6470;
}

.viewer-state-alert {
    background: rgba(191, 44, 69, 0.12);
    color: #b12240;
}

.viewer-refresh {
    margin-top: 14px;
    width: 100%;
}

.viewer-info-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.viewer-info-list div {
    display: grid;
    gap: 4px;
}

.viewer-info-list dt {
    color: #68828d;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.viewer-info-list dd {
    margin: 0;
    color: #17313c;
    font-weight: 600;
    word-break: break-word;
}

.empty-state {
    margin-top: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(11, 122, 116, 0.22);
    background: rgba(244, 251, 250, 0.9);
    color: #52707d;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.info-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(23, 49, 60, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 250, 0.96));
}

.info-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.info-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.info-list div {
    display: grid;
    gap: 4px;
}

.info-list dt {
    color: #68828d;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.info-list dd {
    margin: 0;
    color: #17313c;
    font-weight: 600;
    word-break: break-word;
}

code {
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.94em;
}

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

@media (max-width: 760px) {
    .page-shell {
        padding-inline: 14px;
    }

    .hero-heading,
    .stream-meta,
    .viewer-card-head {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
