:root {
    --bg: #0b1220;
    --panel: rgba(15, 27, 51, 0.82);
    --panel-strong: rgba(13, 24, 45, 0.94);
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --blue: #3b82f6;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --white: #f8fafc;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 720px at 10% 0%, rgba(59, 130, 246, 0.18), transparent 45%),
        radial-gradient(960px 640px at 100% 10%, rgba(16, 185, 129, 0.16), transparent 50%),
        linear-gradient(180deg, #08111f 0%, #0b1220 100%);
    line-height: 1.6;
}

a,
button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.talkie-app {
    min-height: 100vh;
    padding: 20px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(8, 17, 31, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--white);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(16, 185, 129, 0.9));
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.18);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-size: 18px;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.topbar-center {
    display: flex;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.channel-chip,
.speaker-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 176px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.channel-chip-label,
.speaker-chip-label {
    font-size: 12px;
    color: var(--muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-pills {
    display: flex;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
}

.status-pill[data-state="connecting"] {
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.14);
}

.status-pill[data-state="online"] {
    color: #d1fae5;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.14);
}

.status-pill[data-state="warning"] {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.14);
}

.status-pill[data-state="muted"] {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.14);
}

.ghost-button,
.secondary-button,
.primary-button,
.text-button {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ghost-button,
.secondary-button {
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.primary-button {
    color: var(--white);
    background: linear-gradient(135deg, var(--blue), var(--green));
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.18);
}

.text-button {
    min-height: auto;
    padding: 0;
    color: #bfdbfe;
    background: transparent;
}

.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover,
.text-button:hover,
.ptt-button:hover {
    transform: translateY(-1px);
}

.layout {
    display: grid;
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr) minmax(250px, 300px);
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.sidebar,
.inspector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.workspace {
    padding: 22px;
}

.panel-section + .panel-section {
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 16px;
}

.section-meta {
    color: var(--muted);
    font-size: 12px;
}

.channel-list,
.member-list,
.queue-list,
.notice-list,
.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-card,
.member-card,
.notice-card,
.message-card,
.queue-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.channel-card {
    width: 100%;
    padding: 12px 14px;
    text-align: left;
}

.channel-card.active {
    border-color: rgba(249, 115, 22, 0.72);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.28), rgba(245, 158, 11, 0.2));
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.2);
    color: #fff7ed;
}

.channel-card.active .channel-card-meta,
.channel-card.active .channel-card-title span:last-child {
    color: #ffedd5;
}

.channel-card.pending {
    border-color: rgba(245, 158, 11, 0.42);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(249, 115, 22, 0.08));
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.12);
}

.channel-card.pending .channel-card-meta,
.channel-card.pending .channel-card-title span:last-child {
    color: #fde68a;
}

.channel-card-title,
.member-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.channel-card-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.channel-card-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 237, 213, 0.4);
    background: rgba(255, 247, 237, 0.16);
    color: #fff7ed;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.channel-card-status.pending {
    border-color: rgba(253, 230, 138, 0.35);
    background: rgba(120, 53, 15, 0.3);
    color: #fde68a;
}

.channel-card-meta,
.member-card-meta {
    color: var(--muted);
    font-size: 12px;
}

.member-role-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.tag-chip[data-tone="warning"] {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}

.tag-chip[data-tone="danger"] {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.member-card,
.notice-card,
.queue-card {
    padding: 12px 14px;
}

.member-card.current-user {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.08);
}

.member-card.active-speaker {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
}

.member-card.recent-speaker {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.14);
}

.member-card.active-speaker .member-activity-fill {
    animation: speakerPulse 1s ease-in-out infinite;
}

.member-activity {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.member-activity-label {
    font-size: 12px;
    color: var(--muted);
}

.member-activity-track {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.member-activity-fill {
    width: 4%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.9), rgba(16, 185, 129, 0.95));
    transition: width 120ms linear;
}

.speech-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-weight: 600;
}

.speech-card-copy {
    color: var(--muted);
    font-size: 13px;
}

.queue-card.active-speaker {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    animation: speakerPulse 1s ease-in-out infinite;
}

@keyframes speakerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.18);
        filter: saturate(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.04);
        filter: saturate(1.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.18);
        filter: saturate(1);
    }
}

.empty-state {
    color: var(--muted);
    border-style: dashed;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 13px;
    margin: 0 0 16px;
}

.workspace-header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.1;
}

.workspace-summary {
    margin: 12px 0 0;
    color: var(--muted);
    max-width: 640px;
}

.workspace-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.speaker-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.08));
}

.speaker-status-label {
    display: block;
    font-size: 12px;
    color: #bfdbfe;
    margin-bottom: 4px;
}

.speaker-status-title {
    display: block;
    font-size: 18px;
}

.speaker-status-meter {
    width: min(280px, 42vw);
    height: 10px;
    margin-top: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.speaker-status-meter-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.95), rgba(16, 185, 129, 0.95));
    transition: width 120ms linear;
}

.speaker-status-copy {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    text-align: right;
}

.speaker-status-side {
    display: grid;
    gap: 12px;
    justify-items: end;
}

.speaker-status-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.metric-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 108px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.metric-label {
    font-size: 12px;
    color: var(--muted);
}

#connectionQuality[data-quality="good"] {
    color: #86efac;
}

#connectionQuality[data-quality="fair"] {
    color: #fde68a;
}

#connectionQuality[data-quality="poor"] {
    color: #fca5a5;
}

.runtime-banner,
.rtc-panel,
.media-panel {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.runtime-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.runtime-banner[data-state="error"] {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
}

.runtime-banner[data-state="warning"] {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.08);
}

.runtime-banner[data-state="info"] {
    border-color: rgba(59, 130, 246, 0.24);
    background: rgba(59, 130, 246, 0.08);
}

.quality-banner {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 25;
    width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(16px);
    pointer-events: none;
}

.quality-banner[data-level="fair"] {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.08);
}

.quality-banner[data-level="poor"] {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
}

.quality-banner-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.quality-banner p {
    margin: 8px 0 0;
    color: var(--muted);
}

.runtime-banner-copy {
    min-width: 0;
}

.runtime-banner-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.runtime-banner-code {
    display: block;
    font-size: 15px;
    color: var(--white);
}

.runtime-banner-message {
    margin: 8px 0 0;
    color: var(--text);
}

.rtc-stage-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rtc-stage-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.rtc-stage-card[data-state="ready"] {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.08);
}

.rtc-stage-card[data-state="pending"] {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.08);
}

.rtc-stage-card[data-state="error"] {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
}

.rtc-stage-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rtc-stage-title {
    font-weight: 600;
}

.rtc-stage-state {
    font-size: 12px;
    color: var(--muted);
}

.rtc-stage-copy {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.media-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group span {
    font-size: 13px;
    color: var(--muted);
}

.field-group select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 0 12px;
    outline: none;
}

.field-group select:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.media-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.media-meter {
    margin-top: 16px;
}

.media-meter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.media-meter-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.media-meter-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
    transition: width 0.08s linear;
}

.media-visualizer {
    margin-top: 16px;
}

.media-visualizer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.media-visualizer canvas {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(16, 185, 129, 0.03)),
        rgba(255, 255, 255, 0.02);
}

.rtc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.rtc-stat-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.rtc-stat-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.rtc-stat-value {
    display: block;
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
}

.rtc-stat-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.ptt-area {
    display: grid;
    place-items: center;
    padding: 28px 0 20px;
}

.ptt-button {
    position: relative;
    width: min(320px, 64vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: radial-gradient(circle at 50% 35%, rgba(59, 130, 246, 0.24), rgba(8, 17, 31, 0.95));
    color: var(--white);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.ptt-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
}

.ptt-button[data-state="requesting"] {
    border-color: rgba(245, 158, 11, 0.35);
}

.ptt-button[data-state="speaking"] {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.08), 0 24px 64px rgba(0, 0, 0, 0.34);
}

.ptt-ring {
    position: absolute;
    inset: 16px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ptt-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.ptt-label {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    line-height: 1;
}

.ptt-subtitle {
    font-size: 14px;
    color: var(--muted);
}

.ptt-help {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
    max-width: 560px;
}

.ptt-shortcut {
    margin: 8px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.message-panel {
    margin-top: 10px;
}

.message-list {
    min-height: 240px;
    max-height: 360px;
    padding: 6px 2px 0;
    overflow: auto;
}

.message-card {
    padding: 12px 14px;
}

.message-card.system {
    border-style: dashed;
    color: #dbeafe;
}

.message-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
}

.message-card-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-form {
    margin-top: 12px;
}

.message-form textarea,
.auth-form input {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 12px 14px;
    resize: vertical;
    outline: none;
}

.message-form textarea:focus,
.auth-form input:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.message-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.message-hint {
    color: var(--muted);
    font-size: 12px;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row dt {
    color: var(--muted);
}

.detail-row dd {
    margin: 0;
    font-weight: 600;
}

.debug-frame-group {
    margin-top: 12px;
}

.debug-frame-title {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.debug-frame-card {
    margin: 0;
    min-height: 132px;
    max-height: 260px;
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.queue-list,
.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 10, 20, 0.72);
    backdrop-filter: blur(12px);
}

.modal-backdrop[aria-hidden="true"] {
    display: none;
}

.modal-card {
    width: min(520px, 100%);
    padding: 26px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.modal-card h2 {
    margin: 0;
    font-size: 26px;
}

.settings-modal-card {
    width: min(760px, 100%);
}

.settings-modal-head,
.settings-toolbar,
.settings-device-actions,
.settings-device-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-toolbar {
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.settings-device-list {
    display: grid;
    gap: 12px;
    max-height: min(56vh, 520px);
    overflow: auto;
}

.settings-device-card {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.settings-device-title {
    font-weight: 600;
}

.settings-device-copy {
    color: var(--muted);
    font-size: 13px;
}

.modal-copy {
    margin: 12px 0 18px;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 8px;
}

.auth-form span {
    font-size: 13px;
    color: var(--muted);
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

@media (max-width: 1220px) {
    .layout {
        grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
    }

    .inspector {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .talkie-app {
        padding: 14px;
    }

    .topbar {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .topbar-center,
    .topbar-right {
        justify-content: flex-start;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .workspace-header,
    .speaker-status,
    .runtime-banner,
    .message-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .speaker-status-copy {
        text-align: left;
    }

    .quality-banner {
        top: auto;
        right: 14px;
        bottom: 14px;
        width: min(420px, calc(100vw - 28px));
    }

    .inspector {
        grid-template-columns: 1fr;
    }

    .media-controls-grid,
    .rtc-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .sidebar,
    .workspace,
    .inspector {
        padding: 16px;
    }

    .ptt-button {
        width: min(280px, 80vw);
    }

    .status-pills,
    .workspace-actions,
    .topbar-right {
        flex-wrap: wrap;
    }

    .rtc-stage-list {
        grid-template-columns: 1fr;
    }

    .media-controls-grid,
    .rtc-stats-grid {
        grid-template-columns: 1fr;
    }
}
