:root {
    color-scheme: dark;
    --page: #0a0b0e;
    --surface: #12141a;
    --surface-raised: #181b23;
    --surface-soft: #0e1015;
    --border: #232733;
    --border-strong: #383f52;
    --text: #f4f6f8;
    --muted: #9aa3af;
    --accent: #e50914;
    --accent-strong: #ff1a26;
    --accent-ink: #ffffff;
    --accent-soft: rgba(229, 9, 20, 0.16);
    --speaking: #10b981;
    --speaking-soft: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --danger-soft: #2e1518;
    --warning: #f59e0b;
    --focus: #e50914;
    --shadow: 0 20px 60px rgb(0 0 0 / 48%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;
    --page: #f4f5f8;
    --surface: #ffffff;
    --surface-raised: #f8f9fb;
    --surface-soft: #eef1f5;
    --border: #dcdfe6;
    --border-strong: #b8bec8;
    --text: #11141a;
    --muted: #647082;
    --accent: #e50914;
    --accent-strong: #b80610;
    --accent-ink: #ffffff;
    --accent-soft: rgba(229, 9, 20, 0.12);
    --speaking: #059669;
    --speaking-soft: rgba(5, 150, 105, 0.15);
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #d97706;
    --focus: #e50914;
    --shadow: 0 20px 50px rgb(20 24 35 / 15%);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--page);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background: var(--page);
    font-size: 15px;
    line-height: 1.5;
}

body.voice-connected {
    height: 100dvh;
    overflow: hidden;
}

button,
input,
select,
textarea {
    min-width: 0;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface-soft);
    font: inherit;
}

button {
    width: 100%;
    padding: 0.72rem 1rem;
    border-color: var(--accent);
    color: var(--accent-ink);
    background: var(--accent);
    font-weight: 720;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
}

button:active {
    transform: scale(0.985);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button.secondary {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface-raised);
}

button.secondary:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
}

button.danger {
    border-color: color-mix(in srgb, var(--danger) 36%, var(--border));
    color: var(--danger);
    background: var(--danger-soft);
}

button.text-button {
    width: auto;
    min-height: 44px;
    padding: 0.55rem 0.2rem;
    border-color: transparent;
    color: var(--muted);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 680;
}

button.text-button:hover {
    border-color: transparent;
    color: var(--text);
    background: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

input,
select {
    width: 100%;
    padding: 0.7rem 0.8rem;
}

input:hover,
select:hover {
    border-color: var(--border-strong);
}

input[type="range"] {
    min-height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
    width: 22px;
    min-height: 22px;
    accent-color: var(--accent);
}

label,
legend {
    color: var(--text);
    font-weight: 650;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(1.75rem, 8vw, 2.15rem);
    font-weight: 780;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.35rem, 6vw, 1.65rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

h3 {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 720;
}

a {
    color: inherit;
}

svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
}

.screen {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(1rem + env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        calc(1rem + env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
}

.auth-screen {
    display: flex;
    flex-direction: column;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 48px;
    font-size: 0.92rem;
}

.auth-brand.compact {
    margin-bottom: auto;
}

.auth-language-select {
    width: auto;
    min-width: 92px;
    min-height: 44px;
    margin-left: auto;
    padding: 0.45rem 2rem 0.45rem 0.7rem;
    border-radius: 12px;
    font-size: 0.78rem;
}

.voice-logo,
.server-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--surface-raised);
}

.voice-logo {
    width: 60px;
    height: 42px;
    border-radius: 13px;
    object-fit: contain;
    object-position: center;
}

.auth-intro {
    margin-top: clamp(3.6rem, 14vh, 7rem);
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 760;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.muted,
.field-help {
    color: var(--muted);
}

.pairing-panel,
.returning-session {
    margin-top: 2rem;
}

.pairing-panel form,
.advanced-auth form,
.group-actions form {
    display: grid;
    gap: 0.7rem;
}

.code-input {
    height: 64px;
    padding: 0.55rem 0.8rem;
    border-color: var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    font-size: clamp(1.55rem, 8vw, 2rem);
    font-variant-numeric: tabular-nums;
    font-weight: 760;
    letter-spacing: 0.16em;
    text-align: center;
}

.code-input::placeholder {
    letter-spacing: normal;
}

.field-help {
    margin: -0.15rem 0 0;
    font-size: 0.78rem;
}

.primary-action {
    min-height: 54px;
    margin-top: 0.25rem;
}

.advanced-auth {
    margin-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.advanced-auth summary,
.advanced-settings > summary,
.action-disclosure > summary {
    min-height: 48px;
    padding: 0.85rem 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 680;
}

.advanced-auth form {
    padding: 0.2rem 0 0.8rem;
}

.returning-session {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.returning-identity,
.participant-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.returning-identity > span:last-child,
.participant-identity > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.returning-identity small,
.participant-identity small {
    color: var(--muted);
    font-size: 0.72rem;
}

.returning-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar,
.avatar-group {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    background: var(--surface-raised);
    font-size: 0.82rem;
    font-weight: 760;
    text-transform: uppercase;
}

.avatar-group {
    color: var(--accent);
    background: var(--accent-soft);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.3rem;
    margin-top: auto;
    padding-top: 2.5rem;
}

.auth-links a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--text);
}

.permission-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
    text-align: center;
}

.permission-screen .auth-brand {
    position: absolute;
    top: calc(1rem + env(safe-area-inset-top));
    left: max(1rem, env(safe-area-inset-left));
}

.permission-symbol {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
}

.permission-microphone {
    width: 38px;
    height: 38px;
    color: var(--accent);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.button-stack {
    display: grid;
    gap: 0.65rem;
}

.notice {
    position: fixed;
    z-index: 100;
    top: calc(0.7rem + env(safe-area-inset-top));
    right: max(0.7rem, env(safe-area-inset-right));
    left: max(0.7rem, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(calc(100% - 1.4rem), 500px);
    align-items: center;
    gap: 0.8rem;
    margin: 0 auto;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.notice > div {
    min-width: 0;
}

.notice p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.notice button {
    width: auto;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 480px) {
    .notice {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .notice button {
        justify-self: start;
    }
}

.connected-shell {
    display: grid;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template:
        "header" auto
        "background" auto
        "version" auto
        "views" minmax(0, 1fr)
        "navigation" auto
        / 100%;
    overflow: hidden;
}

.client-header {
    position: relative;
    z-index: 20;
    display: grid;
    grid-area: header;
    grid-template-columns: minmax(0, 1fr) repeat(2, 44px);
    gap: 0.75rem;
    padding:
        calc(0.7rem + env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        0.75rem
        max(1rem, env(safe-area-inset-left));
    border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    background: color-mix(in srgb, var(--page) 93%, transparent);
    backdrop-filter: blur(16px);
}

.server-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.server-mark {
    position: relative;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 13px;
}

.server-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-fallback {
    width: 100%;
    height: 100%;
    padding: 2px;
    object-fit: contain;
}

.server-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.server-copy strong,
.server-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-copy strong {
    font-size: 0.95rem;
}

.server-copy small {
    color: var(--muted);
    font-size: 0.72rem;
}

.icon-button {
    display: grid;
    width: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border-color: var(--border);
    color: var(--muted);
    background: var(--surface-raised);
    font-size: 1.25rem;
}

.icon-button:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface-raised);
}

.site-menu-button svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.connection-summary {
    grid-column: 1 / -1;
}

.connection-state,
.quality-state {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 650;
}

.network-event-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

.status-dot,
.background-status-dot,
.speaker-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--muted);
}

.quality-state.good,
.connection-state.connected,
.connection-state.authenticated {
    color: var(--accent);
}

.quality-state.fair,
.quality-state.poor,
.quality-state.checking,
.connection-state.connecting {
    color: var(--warning);
}

.connection-state.waiting {
    color: var(--warning);
}

.quality-state.offline,
.connection-state.error {
    color: var(--danger);
}

.quality-state .status-dot,
.connection-state .status-dot {
    background: currentColor;
}

.quality-ping {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-left: 0.15rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--border);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.quality-ping strong {
    color: currentColor;
    font-size: inherit;
}

.background-status {
    display: grid;
    grid-area: background;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    margin: 0.75rem 1rem 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--warning);
    background: var(--surface);
    font-size: 0.78rem;
}

.background-status-dot {
    background: currentColor;
}

.background-status.restored {
    color: var(--accent);
}

.background-status.failed {
    color: var(--danger);
}

.version-notice {
    display: grid;
    grid-area: version;
    grid-template-columns: auto minmax(0, 1fr) 44px;
    align-items: start;
    gap: 0.65rem;
    margin: 0.65rem 1rem 0;
    padding: 0.7rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border));
    border-radius: 14px;
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

.version-notice > svg {
    width: 22px;
    margin-top: 0.12rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.version-notice strong {
    color: var(--text);
    font-size: 0.8rem;
}

.version-notice p {
    margin: 0.12rem 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.version-notice-dismiss {
    display: grid;
    width: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border-color: transparent;
    color: var(--muted);
    background: transparent;
}

.version-notice-dismiss:hover {
    border-color: transparent;
    color: var(--text);
    background: var(--surface-raised);
}

.version-notice-dismiss svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.client-views {
    grid-area: views;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.client-view {
    display: none;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
    padding: 1.1rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.client-view.active {
    display: block;
}

.speaker-summary {
    min-height: 82px;
    padding: 0.35rem 0 1rem;
    border-bottom: 1px solid var(--border);
}

.speaker-summary-text {
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 680;
}

.active-speakers {
    margin-top: 0.7rem;
}

.speaker-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.speaker-chip {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.76rem;
    font-weight: 660;
}

.speaker-chip .speaker-dot,
.participant-row.speaking .speaker-dot,
.group-member.speaking .speaker-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.microphone-stage {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1.8rem 0 1.2rem;
    text-align: center;
}

.mic-button {
    display: flex;
    width: clamp(154px, 46vw, 184px);
    height: clamp(154px, 46vw, 184px);
    min-height: 154px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: 0 0 0 10px var(--accent-soft);
    font-size: 0.82rem;
    font-weight: 760;
    touch-action: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.mic-button:hover {
    background: var(--accent-strong);
    transform: scale(1.02);
}

.mic-button.transmitting {
    border-color: var(--speaking);
    box-shadow: 0 0 0 12px var(--speaking-soft);
    animation: hypemc-pulse-speak 1.2s infinite;
}

@keyframes hypemc-pulse-speak {
    0% {
        box-shadow: 0 0 0 4px var(--speaking-soft);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 4px var(--speaking-soft);
    }
}

.mic-button.muted,
.mic-button.blocked {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--danger-soft) 80%, transparent);
}

.mic-button.recovering {
    border-color: var(--warning);
    color: var(--warning);
    background: var(--surface-raised);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--warning) 12%, transparent);
}

.audio-quick-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.65rem;
}

.audio-quick-actions button {
    min-height: 44px;
    min-width: 44px;
}

.ptt-primary.active {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    transform: scale(0.97);
}

.mic-symbol {
    position: relative;
    display: block;
    width: 31px;
    height: 44px;
    border: 4px solid currentColor;
    border-radius: 18px;
}

.mic-symbol::before {
    position: absolute;
    right: -12px;
    bottom: -12px;
    left: -12px;
    height: 23px;
    border-right: 4px solid currentColor;
    border-bottom: 4px solid currentColor;
    border-left: 4px solid currentColor;
    border-radius: 0 0 20px 20px;
    content: "";
}

.mic-symbol::after {
    position: absolute;
    bottom: -18px;
    left: 50%;
    width: 4px;
    height: 9px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    transform: translateX(-50%);
}

.mic-state-help {
    margin: 1.2rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.voice-range-controls {
    width: min(100%, 360px);
    display: grid;
    gap: 0.4rem;
    text-align: left;
}

.voice-range-controls label {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.voice-range-controls select {
    min-height: 44px;
}

.voice-range-controls .field-help {
    margin: 0;
}

.meter-block {
    width: min(100%, 330px);
    margin-top: 1rem;
}

.meter-label,
.range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.meter-label {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.meter,
.wizard-meter {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
}

.meter > div,
.wizard-meter > span {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 90ms linear;
}

.meter-threshold {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--warning);
}

.transmit-indicator.active {
    color: var(--accent);
}

.group-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 62px;
    padding: 0.65rem 0.75rem;
    border-color: var(--border);
    color: var(--text);
    background: var(--surface);
    text-align: left;
}

.group-summary:hover {
    border-color: var(--border-strong);
    background: var(--surface-raised);
}

.group-summary > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.group-summary small {
    color: var(--muted);
    font-size: 0.7rem;
}

.group-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.7rem;
}

.quick-action {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-color: var(--border);
    color: var(--text);
    background: var(--surface);
    font-size: 0.8rem;
}

.quick-action:hover {
    border-color: var(--border-strong);
    background: var(--surface-raised);
}

.count-badge {
    display: inline-grid;
    min-width: 23px;
    min-height: 23px;
    place-items: center;
    padding: 0 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.view-heading {
    display: flex;
    min-height: 62px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.view-heading .text-button {
    flex: 0 0 auto;
}

.participant-search {
    margin-bottom: 0.75rem;
}

.participant-list,
.group-member-list,
.admin-list {
    display: grid;
    gap: 0.55rem;
}

.participant-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 62px;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
}

.participant-row.speaking {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.participant-name {
    overflow: hidden;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-row-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.participant-volume {
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.participant-menu {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-color: transparent;
    color: var(--muted);
    background: transparent;
    font-size: 1.15rem;
}

.participant-menu:hover {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface-raised);
}

.empty-state {
    padding: 2.5rem 1rem;
    color: var(--muted);
    text-align: center;
}

.empty-state h3 {
    margin-top: 0.8rem;
    color: var(--text);
}

.empty-state p {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.group-current {
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--surface);
}

.group-current-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.group-current-heading > span:nth-child(2) {
    min-width: 0;
}

.group-current-heading small {
    color: var(--muted);
    font-size: 0.7rem;
}

.group-current-heading h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-list {
    margin: 0.9rem 0;
}

.group-member {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.55rem;
    border-radius: 12px;
    background: var(--surface-soft);
}

.group-member-copy {
    display: grid;
    min-width: 0;
    gap: 0.05rem;
}

.group-member-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.participant-quick-mute {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border-color: var(--border);
    color: var(--muted);
    background: var(--surface-raised);
}

.participant-quick-mute:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface);
}

.participant-quick-mute.active {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
    color: var(--danger);
    background: var(--danger-soft);
}

.participant-quick-mute svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.group-actions {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.action-disclosure,
.advanced-settings {
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
}

.action-disclosure > summary,
.advanced-settings > summary {
    padding: 0.85rem 0.9rem;
    color: var(--text);
    list-style-position: inside;
}

.action-disclosure form {
    padding: 0 0.9rem 0.9rem;
}

.settings-section {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:first-of-type {
    padding-top: 0;
}

.settings-section h3 {
    margin-bottom: 0.2rem;
}

.range-label output {
    color: var(--muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.button-row,
.sheet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.mic-test {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.segmented label {
    min-width: 0;
}

.segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.segmented span {
    display: grid;
    min-height: 44px;
    place-items: center;
    padding: 0.45rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.segmented input:checked + span {
    color: var(--text);
    background: var(--surface-raised);
}

.segmented input:focus-visible + span {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
}

.check-row {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.86rem;
}

.check-row input {
    flex: 0 0 22px;
}

.connection-details {
    display: grid;
    gap: 0;
    margin: 0;
}

.connection-details div {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.connection-details dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.connection-details dd {
    margin: 0;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.mobile-feature,
.platform-hint {
    display: grid;
    gap: 0.5rem;
}

.platform-hint {
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.78rem;
}

.platform-hint p {
    margin-bottom: 0;
}

.advanced-settings {
    margin-top: 1rem;
}

.advanced-content {
    padding: 0 0.9rem 0.9rem;
}

.advanced-content .settings-section:first-child {
    padding-top: 0.6rem;
}

.technical-section details {
    border: 1px solid var(--border);
    border-radius: 12px;
}

.technical-section summary {
    min-height: 44px;
    padding: 0.7rem;
    cursor: pointer;
}

pre {
    max-height: 320px;
    margin: 0;
    overflow: auto;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.7rem;
    white-space: pre-wrap;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.admin-row {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.admin-name {
    overflow: hidden;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-actions button {
    width: auto;
    min-height: 40px;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
}

.disconnect-button {
    margin-top: 1.3rem;
}

.bottom-nav {
    position: relative;
    z-index: 50;
    display: grid;
    grid-area: navigation;
    align-self: end;
    width: min(100%, 520px);
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin: 0 auto;
    padding: 0.35rem max(0.45rem, env(safe-area-inset-right)) calc(0.35rem + env(safe-area-inset-bottom)) max(0.45rem, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(18px);
}

.bottom-nav button {
    display: flex;
    height: 56px;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.3rem 0.15rem;
    border-color: transparent;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 0.67rem;
    font-weight: 680;
}

.bottom-nav button:hover,
.bottom-nav button.active {
    border-color: transparent;
    color: var(--accent);
    background: var(--accent-soft);
}

.bottom-nav button.active svg {
    fill: currentColor;
}

.bottom-nav button {
    position: relative;
}

.nav-unread {
    position: absolute;
    top: 4px;
    right: max(7px, calc(50% - 24px));
    display: grid;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: #10200d;
    background: var(--accent);
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
}

dialog {
    width: min(100% - 1rem, 520px);
    max-height: calc(100dvh - 1rem);
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
}

dialog::backdrop {
    background: rgb(0 0 0 / 68%);
    backdrop-filter: blur(2px);
}

.bottom-sheet {
    width: min(100%, 520px);
    max-width: 520px;
    margin: auto auto 0;
}

.sheet-card,
.dialog-card {
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.sheet-card {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.site-menu-card {
    max-height: min(520px, calc(100dvh - 1rem));
}

.site-menu-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.site-menu-list a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface-raised);
    font-size: 0.84rem;
    font-weight: 680;
    text-decoration: none;
}

.site-menu-list a::after {
    content: "↗";
    color: var(--muted);
    font-size: 0.9rem;
}

.site-menu-list a:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
}

.dialog-card {
    max-height: calc(100dvh - 1rem);
    border-radius: 20px;
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: -0.25rem auto 1rem;
    border-radius: 999px;
    background: var(--border-strong);
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}

.participant-identity.large h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-actions {
    margin-top: 0.9rem;
}

.chat-log {
    display: flex;
    min-height: 0;
    overflow-y: auto;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 0.3rem;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.client-view[data-client-view="chat"].active {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.chat-heading {
    align-items: center;
    margin-bottom: 0.3rem;
}

.chat-live-badge {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.7rem;
    font-weight: 720;
}

.chat-live-badge .status-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
    background: currentColor;
}

.chat-empty {
    display: grid;
    max-width: 270px;
    min-height: 300px;
    align-self: center;
    align-content: center;
    justify-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.chat-empty strong {
    color: var(--text);
    font-size: 0.9rem;
}

.chat-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 0.25rem;
    place-items: center;
    border-radius: 18px;
    color: var(--accent);
    background: var(--accent-soft);
}

.chat-empty-icon svg {
    width: 25px;
    fill: currentColor;
}

.chat-message {
    display: flex;
    width: min(88%, 410px);
    align-items: flex-end;
    gap: 0.45rem;
    align-self: flex-start;
}

.chat-message.own {
    align-self: flex-end;
    justify-content: flex-end;
}

.chat-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-raised);
    font-size: 0.68rem;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-bubble {
    min-width: 70px;
    padding: 0.58rem 0.68rem 0.42rem;
    border: 1px solid var(--border);
    border-radius: 15px 15px 15px 4px;
    color: var(--text);
    background: var(--surface-raised);
    box-shadow: 0 4px 14px rgb(0 0 0 / 8%);
}

.chat-message.own .chat-bubble {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    border-radius: 15px 15px 4px;
    background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface-raised));
}

.chat-sender {
    display: block;
    overflow: hidden;
    margin-bottom: 0.16rem;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message.own .chat-sender {
    color: var(--muted);
}

.chat-text {
    overflow-wrap: anywhere;
    font-size: 0.83rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.chat-time {
    display: block;
    margin-top: 0.22rem;
    color: var(--muted);
    font-size: 0.61rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.chat-message.system {
    width: auto;
    max-width: 88%;
    align-self: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.68rem;
    text-align: center;
}

.chat-form {
    display: grid;
    position: relative;
    z-index: 5;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 0.5rem;
    padding: 0.65rem 0 0.2rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
    background: var(--page);
}

.chat-form button {
    display: grid;
    width: 48px;
    min-height: 48px;
    padding: 0;
    place-items: center;
    border-radius: 15px;
}

.chat-form button svg {
    width: 21px;
    fill: currentColor;
}

.chat-form input {
    min-height: 48px;
    border-radius: 15px;
}

.wizard-card {
    display: grid;
    gap: 1rem;
}

.wizard-meter {
    height: 5px;
}

.wizard-copy {
    min-height: 180px;
}

.wizard-copy .meter {
    margin-top: 1rem;
}

.wizard-recommendation {
    margin: 1rem 0 0;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.8rem;
}

.capture-status.warning,
.field-help.warning {
    color: var(--warning);
}

.noscript {
    padding: 1rem;
    color: #fff;
    background: #8c1f2f;
    text-align: center;
}

.hidden {
    display: none !important;
}

.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;
}

@media (min-width: 560px) {
    body {
        padding: 1rem 0;
    }

    .app-shell {
        min-height: calc(100dvh - 2rem);
        border: 1px solid var(--border);
        border-radius: 22px;
        overflow: clip;
        background: color-mix(in srgb, var(--page) 86%, var(--surface));
    }

    .screen,
    .connected-shell {
        min-height: calc(100dvh - 2rem);
    }

    .connected-shell {
        height: calc(100dvh - 2rem);
        min-height: 0;
    }

    .bottom-nav {
        border: 1px solid var(--border);
        border-radius: 0 0 22px 22px;
    }

    .auth-screen {
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

@media (max-width: 380px) {
    .quick-actions,
    .button-row,
    .sheet-actions {
        grid-template-columns: 1fr;
    }

    .microphone-stage {
        min-height: 280px;
    }

    .view-heading {
        flex-direction: column;
    }

    .view-heading .text-button {
        margin-top: -0.5rem;
    }

    .bottom-nav button {
        font-size: 0.6rem;
    }

    .chat-message {
        width: 92%;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .microphone-stage {
        min-height: 220px;
        padding: 1rem 0;
    }

    .mic-button {
        width: 130px;
        height: 130px;
        min-height: 130px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
