:root {
    color-scheme: light dark;
    --font-sans: "Manrope", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Cascadia Code", "Consolas", monospace;
    --bg-page: #f8fbff;
    --bg-page-tint: #eef7f6;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-soft: rgba(246, 249, 255, 0.92);
    --border-soft: rgba(18, 34, 85, 0.12);
    --border-strong: rgba(18, 34, 85, 0.22);
    --text-main: #101a45;
    --text-soft: #526174;
    --text-faint: #7b879c;
    --accent: #315bdf;
    --accent-strong: #2548bf;
    --accent-soft: rgba(49, 91, 223, 0.12);
    --accent-mint: #31c8b5;
    --accent-mint-strong: #159f91;
    --success: #1b6a41;
    --success-bg: #e8f6ee;
    --danger: #b13d3d;
    --danger-bg: #fdeaea;
    --shadow-xl: 0 28px 70px rgba(28, 55, 132, 0.16);
    --shadow-lg: 0 18px 44px rgba(28, 55, 132, 0.11);
    --shadow-md: 0 10px 28px rgba(28, 55, 132, 0.08);
    --chat-frame: #f4f8ff;
    --chat-topbar: rgba(255, 255, 255, 0.9);
    --chat-composer: rgba(255, 255, 255, 0.92);
    --chat-feed: #edf4fb;
    --chat-feed-tint: rgba(49, 91, 223, 0.055);
    --chat-input: #ffffff;
    --chat-bubble-in: #ffffff;
    --chat-bubble-out: #315bdf;
    --chat-bubble-out-strong: #244bc9;
    --chat-pill: rgba(49, 91, 223, 0.08);
    --chat-pill-text: #21315f;
    --chat-text: #142044;
    --chat-text-on-accent: #ffffff;
    --chat-muted: #637189;
    --chat-accent: #31c8b5;
    --chat-danger: #ff7276;
    --scrollbar-track: rgba(18, 34, 85, 0.08);
    --scrollbar-thumb: rgba(49, 91, 223, 0.28);
    --scrollbar-thumb-hover: rgba(49, 91, 223, 0.46);
    --scrollbar-chat-track: rgba(255, 255, 255, 0.04);
    --scrollbar-chat-thumb: rgba(125, 155, 255, 0.22);
    --scrollbar-chat-thumb-hover: rgba(49, 200, 181, 0.34);
}

:root.theme-dark {
    --bg-page: #090f22;
    --bg-page-tint: #071d24;
    --surface: rgba(14, 23, 45, 0.9);
    --surface-strong: #101b2d;
    --surface-soft: rgba(17, 28, 54, 0.94);
    --border-soft: rgba(190, 215, 255, 0.12);
    --border-strong: rgba(190, 215, 255, 0.22);
    --text-main: #f5f8ff;
    --text-soft: #b5c4d7;
    --text-faint: #8798b5;
    --accent: #7d9bff;
    --accent-strong: #9fb4ff;
    --accent-soft: rgba(125, 155, 255, 0.16);
    --accent-mint: #31c8b5;
    --accent-mint-strong: #68dfd1;
    --success: #72d29b;
    --success-bg: rgba(27, 106, 65, 0.2);
    --danger: #ff9f9f;
    --danger-bg: rgba(177, 61, 61, 0.22);
    --shadow-xl: 0 28px 60px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 18px 38px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.22);
    --scrollbar-track: rgba(255, 255, 255, 0.04);
    --scrollbar-thumb: rgba(255, 255, 255, 0.18);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.28);
    --chat-frame: #091225;
    --chat-topbar: #111c36;
    --chat-composer: #111c36;
    --chat-feed: #0a1326;
    --chat-feed-tint: rgba(125, 155, 255, 0.045);
    --chat-input: rgba(255, 255, 255, 0.08);
    --chat-bubble-in: #19233d;
    --chat-bubble-out: #315bdf;
    --chat-bubble-out-strong: #214fcf;
    --chat-pill: rgba(255, 255, 255, 0.08);
    --chat-pill-text: #dbe5ff;
    --chat-text: #f4f7ff;
    --chat-text-on-accent: #ffffff;
    --chat-muted: #aebbd4;
    --scrollbar-chat-track: rgba(255, 255, 255, 0.04);
    --scrollbar-chat-thumb: rgba(125, 155, 255, 0.22);
    --scrollbar-chat-thumb-hover: rgba(49, 200, 181, 0.34);
}

:root.theme-light {
    --chat-frame: #f4f8ff;
    --chat-topbar: rgba(255, 255, 255, 0.9);
    --chat-composer: rgba(255, 255, 255, 0.92);
    --chat-feed: #edf4fb;
    --chat-feed-tint: rgba(49, 91, 223, 0.055);
    --chat-input: #ffffff;
    --chat-bubble-in: #ffffff;
    --chat-bubble-out: #315bdf;
    --chat-bubble-out-strong: #244bc9;
    --chat-pill: rgba(49, 91, 223, 0.08);
    --chat-pill-text: #21315f;
    --chat-text: #142044;
    --chat-text-on-accent: #ffffff;
    --chat-muted: #637189;
    --scrollbar-chat-track: rgba(18, 34, 85, 0.08);
    --scrollbar-chat-thumb: rgba(49, 91, 223, 0.28);
    --scrollbar-chat-thumb-hover: rgba(49, 91, 223, 0.46);
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(55, 100, 255, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(47, 197, 177, 0.13), transparent 24%),
        linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-tint) 100%);
}

.auth-body {
    background:
        radial-gradient(circle at 28% 16%, rgba(55, 100, 255, 0.22), transparent 26%),
        radial-gradient(circle at 72% 18%, rgba(47, 197, 177, 0.24), transparent 24%),
        linear-gradient(135deg, #f8fbff 0%, #eef7f6 48%, #f7f9ff 100%);
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(12, 22, 64, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 22, 64, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 78%);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    border: 3px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

.app-chat-theme {
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 0%, rgba(55, 100, 255, 0.16), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(49, 200, 181, 0.14), transparent 30%),
        linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-tint) 100%);
}

.app-body:not(.app-chat-theme) {
    background:
        radial-gradient(circle at 18% 10%, rgba(55, 100, 255, 0.18), transparent 26%),
        radial-gradient(circle at 84% 14%, rgba(49, 200, 181, 0.2), transparent 25%),
        linear-gradient(135deg, var(--bg-page) 0%, var(--bg-page-tint) 100%);
}

html.theme-dark body {
    background:
        radial-gradient(circle at top left, rgba(55, 100, 255, 0.17), transparent 24%),
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.11), transparent 26%),
        linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-tint) 100%);
}

html.theme-dark .auth-body {
    background:
        radial-gradient(circle at 24% 12%, rgba(55, 100, 255, 0.26), transparent 26%),
        radial-gradient(circle at 76% 16%, rgba(47, 197, 177, 0.2), transparent 24%),
        linear-gradient(135deg, #090f22 0%, #101b2d 48%, #071d24 100%);
}

html.theme-dark .auth-body::before {
    background:
        linear-gradient(rgba(232, 239, 252, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 239, 252, 0.045) 1px, transparent 1px);
}

.auth-shell,
.app-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 0;
}

.app-shell {
    display: grid;
    gap: 24px;
    padding: 32px 0 40px;
}

.dashboard-shell {
    align-content: start;
}

.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

.dashboard-page .topbar {
    height: 112px;
}

.dashboard-page .app-shell {
    height: calc(100vh - 112px);
    overflow: hidden;
    padding: 18px 0 16px;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.panel,
.room-card,
.share-box,
.listener-room-summary > div,
.chat-empty-state {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
    border-radius: 28px;
}

.panel {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.auth-layout {
    width: min(1060px, 100%);
    min-height: min(720px, calc(100vh - 64px));
    min-height: min(720px, calc(100dvh - 64px));
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid rgba(18, 34, 85, 0.1);
    border-radius: 38px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.58)),
        radial-gradient(circle at 10% 12%, rgba(49, 91, 223, 0.12), transparent 34%),
        radial-gradient(circle at 90% 0%, rgba(49, 200, 181, 0.16), transparent 30%);
    box-shadow: 0 34px 90px rgba(28, 55, 132, 0.14);
    backdrop-filter: blur(18px);
}

.auth-hero {
    min-width: 0;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: clamp(30px, 6vh, 58px);
}

.auth-logo-picture {
    display: block;
    width: clamp(220px, 26vw, 330px);
    max-width: 100%;
}

.auth-logo-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.auth-logo-mark {
    position: relative;
    width: 104px;
    height: 84px;
    flex: 0 0 auto;
}

.auth-logo-symbol {
    position: absolute;
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border-radius: 26px 26px 26px 9px;
    color: #fff;
    font-size: 2.05rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 18px 34px rgba(29, 52, 148, 0.18);
}

.auth-logo-symbol-primary {
    left: 0;
    top: 2px;
    z-index: 2;
    background: linear-gradient(145deg, #2f63ff 0%, #3e78ff 100%);
}

.auth-logo-symbol-secondary {
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, #31c8b5 0%, #40d1ba 100%);
    mix-blend-mode: multiply;
}

.auth-brand-name {
    color: #0d1748;
    font-size: clamp(2.15rem, 6vw, 3.15rem);
    font-weight: 900;
    letter-spacing: -0.06em;
}

.auth-body .eyebrow {
    color: #315bdf;
}

.auth-body h1 {
    color: #0d1748;
    max-width: 13ch;
    font-size: clamp(2.7rem, 5vw, 5rem);
    line-height: 0.95;
}

.auth-body .auth-copy {
    max-width: 52ch;
    color: #526174;
    font-size: clamp(1rem, 1.6vw, 1.16rem);
    line-height: 1.62;
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: clamp(24px, 4vh, 38px);
}

.auth-benefits span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(18, 34, 85, 0.1);
    color: #24325c;
    font-size: 0.84rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(28, 55, 132, 0.07);
}

.auth-panel {
    position: relative;
    padding: clamp(24px, 4vw, 34px);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.14), transparent 34%);
    border: 1px solid rgba(18, 34, 85, 0.11);
    box-shadow: 0 24px 70px rgba(28, 55, 132, 0.16);
    overflow: hidden;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #315bdf 0%, #31c8b5 100%);
}

.auth-panel-header {
    margin-bottom: 22px;
}

.auth-panel-header h2 {
    margin-bottom: 8px;
    color: #0d1748;
    font-size: clamp(1.65rem, 3vw, 2.1rem);
}

.auth-panel-header p:not(.eyebrow) {
    margin: 0;
    color: #526174;
    line-height: 1.5;
}

.auth-panel .form-stack {
    margin-top: 24px;
}

.locale-switcher {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.locale-switcher label,
.settings-locale-form .field > span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.locale-switcher select,
.settings-locale-form select {
    width: 100%;
    min-height: 46px;
    padding: 0 44px 0 14px;
    border: 1px solid rgba(18, 34, 85, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.9));
    color: var(--text);
    font: inherit;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.locale-switcher select:focus-visible,
.settings-locale-form select:focus-visible {
    outline: 3px solid rgba(49, 200, 181, 0.22);
    border-color: rgba(49, 200, 181, 0.72);
}

.auth-body input {
    border-color: rgba(18, 34, 85, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.auth-body input:focus {
    border-color: rgba(55, 100, 255, 0.48);
    box-shadow: 0 0 0 4px rgba(55, 100, 255, 0.13);
}

.password-input-shell {
    position: relative;
    display: block;
}

.password-input-shell input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(18, 34, 85, 0.08);
    color: #526174;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(49, 91, 223, 0.13);
    color: #315bdf;
    outline: none;
}

.password-toggle:focus-visible {
    box-shadow: 0 0 0 4px rgba(55, 100, 255, 0.13);
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

.password-toggle-icon-hide,
.password-toggle.is-visible .password-toggle-icon-show {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-hide {
    display: block;
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: #526174;
    font-size: 0.93rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: #31c8b5;
    cursor: pointer;
}

.auth-body .button-primary {
    background: linear-gradient(135deg, #315bdf 0%, #31c8b5 100%);
    box-shadow: 0 16px 32px rgba(49, 91, 223, 0.24);
}

html.theme-dark .auth-layout {
    background:
        linear-gradient(135deg, rgba(14, 23, 45, 0.82), rgba(11, 28, 39, 0.62)),
        radial-gradient(circle at 10% 12%, rgba(125, 155, 255, 0.13), transparent 34%),
        radial-gradient(circle at 90% 0%, rgba(49, 200, 181, 0.12), transparent 30%);
    border-color: rgba(190, 215, 255, 0.12);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
}

html.theme-dark .auth-panel {
    background:
        linear-gradient(180deg, rgba(14, 23, 45, 0.96), rgba(11, 28, 39, 0.9)),
        radial-gradient(circle at top right, rgba(49, 202, 184, 0.12), transparent 34%);
    border-color: rgba(190, 215, 255, 0.12);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
}

html.theme-dark .auth-brand-name,
html.theme-dark .auth-body h1,
html.theme-dark .auth-panel-header h2 {
    color: #f5f8ff;
}

html.theme-dark .auth-body .auth-copy,
html.theme-dark .auth-panel-header p:not(.eyebrow) {
    color: #b5c4d7;
}

html.theme-dark .auth-body .eyebrow {
    color: #7d9bff;
}

html.theme-dark .auth-body input {
    background: rgba(7, 17, 31, 0.74);
    border-color: rgba(190, 215, 255, 0.14);
}

html.theme-dark .password-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: #b5c4d7;
}

html.theme-dark .password-toggle:hover,
html.theme-dark .password-toggle:focus-visible {
    background: rgba(125, 155, 255, 0.16);
    color: #f5f8ff;
}

html.theme-dark .remember-option {
    color: #b5c4d7;
}

html.theme-dark .owner-badge,
html.theme-dark .button-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border-color: var(--border-soft);
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea {
    background: rgba(19, 29, 34, 0.94);
    color: var(--text-main);
    border-color: var(--border-soft);
}

html.theme-dark .rooms-empty-state,
html.theme-dark .room-showcase-card {
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
        radial-gradient(circle at bottom left, rgba(125, 155, 255, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(14, 23, 45, 0.94), rgba(11, 28, 39, 0.92));
    border-color: var(--border-soft);
}

html.theme-dark .settings-locale-form,
html.theme-dark .room-active-toggle,
html.theme-dark .room-summary-settings,
html.theme-dark .room-tts-settings,
html.theme-dark .summary-trigger-card,
html.theme-dark .settings-nav-item,
html.theme-dark .usage-summary-card,
html.theme-dark .usage-table-card,
html.theme-dark .usage-row {
    background: rgba(255, 255, 255, 0.055);
}

html.theme-dark .settings-sidebar {
    background:
        linear-gradient(180deg, rgba(49, 200, 181, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.025);
}

.single-column {
    max-width: 760px;
}

.listener-entry-card {
    margin-top: clamp(16px, 3vh, 28px);
    max-height: min(92vh, 860px);
    max-height: min(92dvh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 12px;
    font-size: clamp(2.05rem, 4vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h3 {
    margin-bottom: 6px;
    font-size: 1.04rem;
}

.auth-copy,
.section-copy,
.meta,
.empty-state,
.recording-status,
.counter {
    color: var(--text-soft);
}

.topbar {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.form-stack,
.form-inline,
.room-list,
.listener-room-summary,
.card-actions,
.room-grid,
.room-showcase-meta,
.room-showcase-actions,
.modal-actions {
    display: grid;
    gap: 14px;
}

.listener-room-summary {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.listener-room-summary-tight {
    margin-bottom: 20px;
}

.form-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.field {
    display: grid;
    gap: 8px;
}

.field span,
.field legend {
    font-size: 0.94rem;
    font-weight: 700;
}

.language-picker {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.listener-entry-card .form-stack {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.listener-entry-card .field:not(.language-picker),
.listener-entry-card .listener-room-summary,
.listener-entry-card .button {
    flex: 0 0 auto;
}

.listener-entry-card .language-picker {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.language-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.listener-entry-card .language-card-grid {
    max-height: min(38vh, 380px);
    max-height: min(38dvh, 380px);
    overflow-y: auto;
    padding-right: 6px;
    padding-bottom: 4px;
    overscroll-behavior: contain;
}

.language-card-option {
    position: relative;
    min-width: 0;
}

.language-card-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.language-card {
    position: relative;
    min-height: 82px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.language-card:hover {
    transform: translateY(-1px);
    border-color: rgba(49, 91, 223, 0.28);
    box-shadow: var(--shadow-md);
}

.language-card-input:focus-visible + .language-card {
    border-color: rgba(49, 91, 223, 0.52);
    box-shadow: 0 0 0 4px rgba(49, 91, 223, 0.13);
}

.language-card-input:checked + .language-card {
    border-color: rgba(49, 200, 181, 0.62);
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.18), transparent 38%),
        rgba(49, 91, 223, 0.08);
    box-shadow: 0 14px 30px rgba(49, 91, 223, 0.12);
}

.language-card-input:checked + .language-card::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent-mint);
    box-shadow: 0 0 0 4px rgba(49, 200, 181, 0.16);
    transform: translateY(-50%);
}

.language-card-flag {
    width: 48px;
    height: 32px;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(18, 34, 85, 0.14);
}

.language-card-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.language-card-name {
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.15;
}

.language-card-native {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.room-status-badge {
    width: max-content;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 8px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.room-status-badge.is-active {
    background: rgba(49, 200, 181, 0.14);
    color: var(--accent);
}

.room-status-badge.is-inactive {
    background: rgba(255, 114, 118, 0.14);
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(18, 34, 85, 0.14);
    border-radius: 18px;
    padding: 14px 16px;
    font: inherit;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-main);
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
    min-height: 104px;
    resize: none;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(49, 91, 223, 0.45);
    box-shadow: 0 0 0 4px rgba(49, 91, 223, 0.12);
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.96rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

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

.button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, #315bdf 0%, #31c8b5 100%);
    box-shadow: 0 14px 28px rgba(49, 91, 223, 0.22);
}

.button-secondary {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
}

.button-icon-only {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
}

.button-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.button-ghost {
    color: var(--text-main);
    background: rgba(18, 34, 85, 0.08);
}

.button-danger {
    color: #fff;
    background: linear-gradient(180deg, #d85b5b 0%, #b13d3d 100%);
    box-shadow: 0 12px 24px rgba(177, 61, 61, 0.24);
}

.button-full {
    width: 100%;
}

.align-end {
    min-height: 52px;
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 24px));
}

.toast-notice {
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    transition: opacity 240ms ease, transform 240ms ease;
}

.toast-success {
    background: rgba(242, 247, 255, 0.96);
    color: var(--accent-strong);
}

.toast-error {
    background: rgba(253, 234, 234, 0.96);
    color: var(--danger);
}

.toast-dismiss {
    opacity: 0;
    transform: translateY(14px);
}

.share-box,
.listener-room-summary > div {
    padding: 18px;
}

.room-list {
    gap: 16px;
}

.room-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.room-grid-shell {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding: 6px 8px 18px 0;
}

.room-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto;
    gap: 18px;
    padding: 22px;
    align-items: center;
}

.room-card .share-box {
    grid-column: 1 / -1;
}

.room-gallery-panel {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 16px;
}

.rooms-empty-state {
    min-height: 320px;
    display: grid;
    place-items: center;
    gap: 24px;
    text-align: center;
    border-radius: 24px;
    border: 1px dashed var(--border-strong);
    background:
        radial-gradient(circle at top left, rgba(49, 91, 223, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22));
}

.rooms-empty-copy {
    display: grid;
    gap: 10px;
    justify-items: center;
    max-width: 560px;
}

.rooms-empty-eyebrow {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rooms-empty-title {
    margin: 0;
    font-size: clamp(1.55rem, 2.6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.rooms-empty-text {
    margin: 0;
    max-width: 480px;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.5;
}

.room-showcase-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(49, 91, 223, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 255, 0.84));
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
}

.room-showcase-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #315bdf 0%, #31c8b5 100%);
    opacity: 0.82;
}

.room-showcase-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.room-showcase-avatar {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 18px;
    background: linear-gradient(145deg, #315bdf 0%, #31c8b5 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    box-shadow: 0 14px 28px rgba(49, 91, 223, 0.22);
}

.room-showcase-copy {
    min-width: 0;
}

.room-showcase-copy h3 {
    margin-bottom: 4px;
}

.room-showcase-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.room-showcase-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-items: start;
}

.room-delete-form {
    display: contents;
}

.button-danger-soft {
    color: var(--danger);
    background: rgba(177, 61, 61, 0.08);
    border: 1px solid rgba(177, 61, 61, 0.18);
    box-shadow: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 14, 34, 0.48);
    backdrop-filter: blur(10px);
}

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

.activity-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 12, 16, 0.42);
    backdrop-filter: blur(8px);
}

.activity-overlay.is-passive {
    pointer-events: none;
}

.activity-overlay[hidden] {
    display: none !important;
}

.activity-overlay-card {
    width: min(420px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 26px 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 36%),
        rgba(10, 19, 38, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 26px 52px rgba(0, 0, 0, 0.34);
    text-align: center;
}

.activity-overlay-pulse {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--chat-accent);
    box-shadow: 0 0 0 0 rgba(49, 200, 181, 0.45);
    animation: activity-pulse 1.4s infinite ease-out;
}

.activity-overlay-title,
.activity-overlay-copy {
    margin: 0;
}

.activity-overlay-title {
    color: #f5fbf8;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.activity-overlay-copy {
    color: var(--chat-muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.activity-stop-button {
    margin-top: 4px;
    min-height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 999px;
    background: #ff6b6b;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(255, 107, 107, 0.28);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.activity-stop-button:hover {
    background: #ff5252;
    box-shadow: 0 18px 34px rgba(255, 107, 107, 0.34);
    transform: translateY(-1px);
}

.activity-stop-button:active {
    transform: translateY(0);
}

.activity-stop-button[hidden] {
    display: none !important;
}

.word-lookup-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 12, 16, 0.5);
    backdrop-filter: blur(10px);
}

.word-lookup-overlay[hidden] {
    display: none !important;
}

.word-lookup-card {
    width: min(480px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    position: relative;
    display: grid;
    gap: 16px;
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.16), transparent 34%),
        var(--chat-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
    color: var(--chat-text);
    overflow: auto;
}

.word-lookup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--chat-text);
    cursor: pointer;
    font-size: 1.35rem;
}

.word-lookup-eyebrow {
    margin: 0;
    color: var(--chat-accent);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.word-lookup-card h2 {
    max-width: calc(100% - 42px);
    margin: 0;
    font-size: clamp(1.45rem, 5vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.word-lookup-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--chat-muted);
}

.word-lookup-loading[hidden],
.word-lookup-result[hidden],
.word-lookup-error[hidden] {
    display: none !important;
}

.word-lookup-loading span {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--chat-accent);
    box-shadow: 0 0 0 0 rgba(49, 200, 181, 0.45);
    animation: activity-pulse 1.4s infinite ease-out;
}

.word-lookup-loading p,
.word-lookup-error,
.word-lookup-result p {
    margin: 0;
}

.word-lookup-result {
    display: grid;
    gap: 10px;
}

.word-lookup-result section {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
}

.word-lookup-result span {
    color: rgba(233, 237, 239, 0.62);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.word-lookup-result p {
    line-height: 1.45;
}

.word-lookup-error {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 107, 107, 0.13);
    color: #ffdede;
    line-height: 1.45;
}

html.theme-light .word-lookup-card {
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
        #ffffff;
    border-color: rgba(23, 48, 64, 0.1);
    color: #132635;
    box-shadow: 0 28px 70px rgba(23, 48, 64, 0.24);
}

html.theme-light .word-lookup-close {
    background: rgba(23, 48, 64, 0.08);
    color: #132635;
}

html.theme-light .word-lookup-loading {
    color: #526577;
}

html.theme-light .word-lookup-result section {
    background: #f3f7fb;
    border: 1px solid rgba(23, 48, 64, 0.08);
}

html.theme-light .word-lookup-result span {
    color: #567084;
}

html.theme-light .word-lookup-error {
    background: rgba(211, 74, 84, 0.1);
    color: #8f1f2c;
}

.theater-mode {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(12px, 2vw, 22px);
    padding: clamp(18px, 2.5vw, 40px);
    background:
        radial-gradient(circle at top left, rgba(49, 200, 181, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(49, 91, 223, 0.22), transparent 34%),
        #020817;
    color: #f7fbff;
}

.theater-mode[hidden] {
    display: none !important;
}

.theater-topbar,
.theater-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.theater-eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: clamp(0.72rem, 1.4vw, 0.9rem);
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.theater-topbar h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    letter-spacing: -0.04em;
}

.theater-actions span {
    color: #b9c8e5;
    font-weight: 800;
}

.theater-actions button {
    width: auto;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.theater-stage {
    min-height: 0;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
}

.theater-message {
    width: min(1760px, calc(100vw - clamp(32px, 4vw, 80px)));
    height: min(100%, clamp(320px, 56vh, 660px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: clamp(18px, 2.4vw, 36px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: clamp(26px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.075);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.36);
    overflow: hidden;
}

.theater-message-text {
    min-height: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0 4px 2px;
    margin: 0;
    font-size: var(--theater-font-size, clamp(2.2rem, 5.2vw, 5.8rem));
    line-height: 1.06;
    font-weight: 950;
    letter-spacing: -0.05em;
    overflow-wrap: normal;
    word-break: normal;
    max-height: 100%;
}

.theater-message.is-pending .theater-message-text,
.theater-placeholder {
    color: #b9c8e5;
}

.theater-message-meta {
    margin: 0 0 clamp(14px, 2vw, 24px);
    color: var(--accent);
    font-size: clamp(0.78rem, 1.5vw, 1rem);
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.theater-history {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
    pointer-events: none;
}

.theater-history-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    color: #dce7ff;
}

.theater-history-item span {
    display: block;
    margin-bottom: 6px;
    color: #8ea1c9;
    font-size: 0.74rem;
    font-weight: 850;
}

.theater-history-item p {
    margin: 0;
    font-size: clamp(0.95rem, 1.5vw, 1.25rem);
    line-height: 1.3;
}

body.is-theater-open {
    overflow: hidden;
}

@keyframes activity-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(49, 200, 181, 0.45);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 18px rgba(49, 200, 181, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(49, 200, 181, 0);
    }
}

.modal-card {
    position: relative;
    width: min(560px, 100%);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 26px;
    border-radius: 28px;
    background: var(--surface-strong);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-xl);
}

.room-create-modal-card {
    width: min(760px, 100%);
}

.room-create-modal-card .form-stack {
    gap: 16px;
}

.room-create-modal-card .modal-actions {
    grid-template-columns: minmax(180px, 260px);
    justify-content: end;
}

.room-create-modal-card .room-language-grid {
    max-height: min(46vh, 430px);
    overflow-y: auto;
    padding-right: 6px;
    overscroll-behavior: contain;
}

.modal-card-chat-info {
    width: min(720px, 100%);
}

.room-settings-card {
    width: min(820px, 100%);
}

.room-settings-form {
    gap: 16px;
}

.room-settings-language-grid {
    max-height: min(42vh, 390px);
    overflow-y: auto;
    padding-right: 6px;
    overscroll-behavior: contain;
}

.room-active-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    background: rgba(18, 34, 85, 0.05);
    cursor: pointer;
}

.room-summary-settings {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(18, 34, 85, 0.045);
    border: 1px solid var(--border-soft);
}

.room-summary-settings .field {
    margin: 0;
}

.room-tts-settings {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(18, 34, 85, 0.045);
    border: 1px solid var(--border-soft);
}

.room-tts-settings h3 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1rem;
}

.room-tts-settings p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

.room-tts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.room-tts-grid .field {
    min-width: 0;
}

.summary-trigger-options {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.summary-trigger-options legend {
    margin-bottom: 2px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.summary-trigger-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
}

.summary-trigger-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.summary-trigger-card span {
    display: grid;
    gap: 3px;
}

.summary-trigger-card strong {
    color: var(--text-main);
}

.summary-trigger-card small {
    color: var(--text-soft);
    line-height: 1.35;
}

.room-active-toggle input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}

.room-active-toggle span {
    display: grid;
    gap: 3px;
}

.room-active-toggle strong {
    color: var(--text-main);
}

.room-active-toggle small {
    color: var(--text-muted);
    line-height: 1.35;
}

.settings-modal-card {
    width: min(1120px, 100%);
    height: min(860px, calc(100vh - 64px));
    height: min(860px, calc(100dvh - 64px));
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-card-compact {
    width: min(460px, 100%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.modal-close {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: rgba(18, 34, 85, 0.1);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 260px);
    gap: 18px;
    margin-top: 22px;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    border-top: 1px solid var(--border-soft);
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(49, 200, 181, 0.1), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(18, 34, 85, 0.035));
}

.settings-modal-card > .modal-header {
    padding: 26px 30px 22px;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at 12% 0%, rgba(49, 200, 181, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(18, 34, 85, 0.04));
}

.settings-sidebar {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 12px;
    padding: 20px 18px;
    background:
        linear-gradient(180deg, rgba(9, 26, 54, 0.055), rgba(49, 200, 181, 0.055)),
        rgba(255, 255, 255, 0.28);
    border-right: 1px solid var(--border-soft);
}

.settings-nav-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 2px 12px;
    width: 100%;
    min-height: 76px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.48));
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 12px 30px rgba(18, 34, 85, 0.06);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.settings-nav-icon {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: rgba(49, 200, 181, 0.13);
    color: var(--accent-strong);
}

.settings-nav-icon svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: currentColor;
}

.settings-nav-item span {
    align-self: end;
    font-size: 0.96rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.settings-nav-item small {
    align-self: start;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.settings-nav-item:not(.is-disabled):hover,
.settings-nav-item:not(.is-disabled):focus-visible {
    transform: translateY(-1px);
    border-color: rgba(49, 200, 181, 0.5);
    outline: none;
}

.settings-nav-item.is-active {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.45), transparent 42%),
        linear-gradient(135deg, var(--accent), var(--accent-mint));
    color: #071225;
    border-color: rgba(49, 200, 181, 0.3);
    box-shadow: 0 20px 42px rgba(49, 200, 181, 0.25);
}

.settings-nav-item.is-active .settings-nav-icon {
    background: rgba(7, 18, 37, 0.14);
    color: #071225;
}

.settings-nav-item.is-active small {
    color: rgba(7, 18, 37, 0.76);
}

.settings-nav-item.is-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

html.theme-dark .settings-nav-item.is-active {
    color: #fff;
}

html.theme-dark .settings-nav-item.is-active small {
    color: rgba(255, 255, 255, 0.78);
}

.settings-panel {
    display: none;
    min-width: 0;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.settings-panel.is-active {
    display: grid;
    align-content: start;
}

.settings-panel[hidden] {
    display: none !important;
}

.settings-empty,
.usage-state {
    min-height: 230px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 30px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
        rgba(18, 34, 85, 0.06);
    border: 1px solid var(--border-soft);
    text-align: center;
}

.settings-empty h3 {
    margin: 0;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    letter-spacing: -0.04em;
}

.settings-empty p,
.usage-state,
.usage-muted {
    color: var(--text-muted);
}

.settings-locale-form {
    display: grid;
    gap: 20px;
    margin-bottom: 18px;
    padding: 26px;
    border: 1px solid var(--border-soft);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(49, 200, 181, 0.16), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52));
    box-shadow: 0 22px 54px rgba(18, 34, 85, 0.08);
}

.settings-locale-form h3 {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    letter-spacing: -0.035em;
}

.settings-locale-form .field {
    max-width: 460px;
}

.settings-locale-form .composer-status {
    margin: 0;
    padding: 0;
    min-height: 1.3em;
    text-align: left;
}

.usage-error {
    color: #b33939;
    background: rgba(255, 107, 107, 0.12);
}

.usage-state[hidden],
.usage-dashboard[hidden] {
    display: none !important;
}

.usage-dashboard {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.usage-dashboard > .usage-muted {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.48);
}

.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.usage-summary-card,
.usage-table-card {
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5));
    border: 1px solid var(--border-soft);
    box-shadow: 0 20px 48px rgba(18, 34, 85, 0.08);
}

.usage-summary-card {
    display: grid;
    gap: 8px;
    min-height: 118px;
    padding: 18px;
    align-content: space-between;
    position: relative;
    overflow: hidden;
}

.usage-summary-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(49, 200, 181, 0.16), transparent 42%);
    pointer-events: none;
}

.usage-summary-card span,
.usage-row small {
    color: var(--text-muted);
}

.usage-summary-card strong {
    position: relative;
    font-size: clamp(1.12rem, 2vw, 1.55rem);
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
}

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

.usage-table-card-wide {
    grid-column: 1 / -1;
}

.usage-table-card {
    padding: 18px;
}

.usage-table-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.usage-table {
    display: grid;
    gap: 8px;
}

.usage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: start;
    padding: 12px;
    border-radius: 18px;
    background: rgba(18, 34, 85, 0.05);
    border: 1px solid rgba(18, 34, 85, 0.06);
}

.usage-row:first-child {
    border-top: 1px solid rgba(18, 34, 85, 0.06);
}

.usage-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.usage-row small {
    grid-column: 1 / -1;
    line-height: 1.45;
}

.usage-row strong {
    white-space: nowrap;
    text-align: right;
}

.chat-info-panel {
    padding: 18px;
    border-radius: 22px;
    background: rgba(18, 34, 85, 0.06);
    border: 1px solid var(--border-soft);
}

.chat-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.chat-info-qr-panel {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 10px;
}

.listener-qr-image {
    width: min(100%, 240px);
    aspect-ratio: 1;
    display: block;
    padding: 12px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.has-modal-open {
    overflow: hidden;
}

.share-label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

code,
.translation-summary {
    font-family: var(--font-mono);
}

code {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text-soft);
    font-size: 0.9rem;
}

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

.chat-app-shell {
    width: min(1480px, calc(100% - 20px));
    height: calc(100vh - 20px);
    margin: 10px auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    overflow: hidden;
    background: var(--chat-frame);
    border: 1px solid rgba(125, 155, 255, 0.12);
    border-radius: 22px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

html:not(.theme-dark) .chat-app-shell {
    box-shadow: 0 22px 70px rgba(28, 55, 132, 0.14);
}

.chat-topbar {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 18px;
    background:
        radial-gradient(circle at top left, rgba(49, 200, 181, 0.12), transparent 36%),
        var(--chat-topbar);
    border-bottom: 1px solid rgba(125, 155, 255, 0.12);
}

.chat-topbar-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, #315bdf 0%, #31c8b5 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(49, 91, 223, 0.28);
}

.chat-title-block {
    min-width: 0;
}

.chat-title {
    margin: 0;
    color: var(--chat-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.chat-subtitle {
    margin: 4px 0 0;
    color: var(--chat-muted);
    font-size: 0.84rem;
}

.chat-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.chat-mobile-details-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    border: 1px solid rgba(125, 155, 255, 0.14);
    border-radius: 999px;
    background: var(--chat-pill);
    color: var(--chat-pill-text);
    cursor: pointer;
}

.chat-mobile-details-toggle span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.chat-pill,
.chat-pill-link,
.chat-pill-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--chat-pill);
    color: var(--chat-pill-text);
    border: 1px solid rgba(125, 155, 255, 0.12);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.chat-pill strong {
    color: var(--chat-text);
}

.chat-pill-link,
.chat-pill-button {
    cursor: pointer;
}

.chat-pill-button {
    border: none;
}

.chat-pill-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
    fill: currentColor;
}

.chat-autoplay-toggle.is-active {
    background: rgba(49, 200, 181, 0.18);
    color: var(--chat-text);
    border-color: rgba(49, 200, 181, 0.34);
}

.room-state-pill.is-active {
    border-color: rgba(49, 200, 181, 0.34);
    background: rgba(49, 200, 181, 0.14);
}

.room-state-pill.is-inactive {
    border-color: rgba(255, 114, 118, 0.36);
    background: rgba(255, 114, 118, 0.14);
}

.chat-feed {
    min-height: 0;
    overflow-y: auto;
    padding: 28px 22px;
    background:
        radial-gradient(circle at top left, rgba(49, 91, 223, 0.1), transparent 24%),
        radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.08), transparent 28%),
        linear-gradient(90deg, transparent 23px, var(--chat-feed-tint) 24px, transparent 25px),
        linear-gradient(transparent 23px, var(--chat-feed-tint) 24px, transparent 25px),
        var(--chat-feed);
    background-size: auto, 24px 24px, 24px 24px, auto;
}

.chat-feed,
.composer-text,
code {
    scrollbar-color: var(--scrollbar-chat-thumb) var(--scrollbar-chat-track);
}

.chat-feed::-webkit-scrollbar,
.composer-text::-webkit-scrollbar,
code::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.chat-feed::-webkit-scrollbar-track,
.composer-text::-webkit-scrollbar-track,
code::-webkit-scrollbar-track {
    background: var(--scrollbar-chat-track);
    border-radius: 999px;
}

.chat-feed::-webkit-scrollbar-thumb,
.composer-text::-webkit-scrollbar-thumb,
code::-webkit-scrollbar-thumb {
    background: var(--scrollbar-chat-thumb);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.chat-feed::-webkit-scrollbar-thumb:hover,
.composer-text::-webkit-scrollbar-thumb:hover,
code::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-chat-thumb-hover);
    border: 3px solid transparent;
    background-clip: padding-box;
}

.owner-chat-feed,
.listener-chat-feed {
    display: grid;
    gap: 12px;
    align-content: start;
}

.chat-bubble {
    max-width: min(74%, 780px);
    padding: 10px 12px 8px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(28, 55, 132, 0.1);
    color: var(--chat-text);
}

.chat-bubble-in {
    justify-self: start;
    background: var(--chat-bubble-in);
    border: 1px solid rgba(125, 155, 255, 0.1);
    border-top-left-radius: 5px;
}

.chat-bubble-out {
    justify-self: end;
    background: linear-gradient(145deg, var(--chat-bubble-out) 0%, var(--chat-bubble-out-strong) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-right-radius: 5px;
    color: var(--chat-text-on-accent);
}

.chat-bubble-out .chat-bubble-meta,
.chat-bubble-out .chat-section-label {
    color: rgba(255, 255, 255, 0.72);
}

.chat-bubble-out .chat-edited-badge {
    background: rgba(255, 255, 255, 0.16);
}

.chat-bubble-pending {
    outline: 1px dashed rgba(49, 200, 181, 0.34);
    outline-offset: -3px;
}

.chat-summary-card {
    width: min(720px, calc(100% - 36px));
    justify-self: center;
    display: grid;
    gap: 8px;
    margin: 12px auto;
    padding: 18px 20px;
    border-radius: 22px;
    color: var(--chat-text);
    background:
        radial-gradient(circle at top left, rgba(125, 155, 255, 0.22), transparent 36%),
        radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 255, 0.96));
    border: 1px solid rgba(190, 215, 255, 0.18);
    box-shadow: 0 14px 34px rgba(28, 55, 132, 0.12);
}

.chat-summary-title {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chat-summary-range {
    margin: 0;
    color: var(--chat-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.chat-summary-card p:last-child {
    margin: 0;
    color: var(--chat-text);
    line-height: 1.55;
}

html.theme-dark .chat-summary-card {
    background:
        radial-gradient(circle at top left, rgba(125, 155, 255, 0.22), transparent 36%),
        radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 42%),
        linear-gradient(135deg, rgba(25, 35, 61, 0.98), rgba(15, 28, 50, 0.96));
    border-color: rgba(190, 215, 255, 0.2);
    color: rgba(244, 247, 255, 0.94);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

html.theme-dark .chat-summary-title {
    color: #8ea8ff;
}

html.theme-dark .chat-summary-card p:last-child {
    color: rgba(244, 247, 255, 0.94);
}

html.theme-dark .chat-empty-state {
    background:
        radial-gradient(circle at top left, rgba(125, 155, 255, 0.18), transparent 38%),
        linear-gradient(135deg, rgba(25, 35, 61, 0.96), rgba(13, 27, 49, 0.94));
    border-color: rgba(190, 215, 255, 0.18);
    color: rgba(244, 247, 255, 0.92);
}

html.theme-dark .chat-empty-state p {
    color: rgba(244, 247, 255, 0.92);
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .chat-summary-card {
        background:
            radial-gradient(circle at top left, rgba(125, 155, 255, 0.22), transparent 36%),
            radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 42%),
            linear-gradient(135deg, rgba(25, 35, 61, 0.98), rgba(15, 28, 50, 0.96));
        border-color: rgba(190, 215, 255, 0.2);
        color: rgba(244, 247, 255, 0.94);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    }

    :root:not(.theme-light) .chat-summary-title {
        color: #8ea8ff;
    }

    :root:not(.theme-light) .chat-summary-card p:last-child {
        color: rgba(244, 247, 255, 0.94);
    }

    :root:not(.theme-light) .chat-empty-state {
        background:
            radial-gradient(circle at top left, rgba(125, 155, 255, 0.18), transparent 38%),
            linear-gradient(135deg, rgba(25, 35, 61, 0.96), rgba(13, 27, 49, 0.94));
        border-color: rgba(190, 215, 255, 0.18);
        color: rgba(244, 247, 255, 0.92);
    }

    :root:not(.theme-light) .chat-empty-state p {
        color: rgba(244, 247, 255, 0.92);
    }
}

html.theme-dark .app-chat-theme {
    background:
        radial-gradient(circle at 20% 0%, rgba(55, 100, 255, 0.26), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(49, 200, 181, 0.18), transparent 30%),
        linear-gradient(180deg, #081021 0%, #091225 100%);
}

.chat-bubble-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--chat-muted);
    font-size: 0.74rem;
}

.chat-bubble-meta-right,
.chat-message-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chat-edited-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 1px 7px;
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.chat-message-actions {
    opacity: 0;
    transform: translateY(-1px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-bubble:hover .chat-message-actions,
.chat-bubble:focus-within .chat-message-actions {
    opacity: 1;
    transform: translateY(0);
}

.chat-message-action {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(125, 155, 255, 0.18);
    border-radius: 999px;
    color: currentColor;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
}

.chat-message-action svg {
    width: 13px;
    height: 13px;
}

.chat-message-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.chat-message-action.is-danger:hover {
    color: #fff;
    background: rgba(255, 114, 118, 0.34);
    border-color: rgba(255, 114, 118, 0.36);
}

.chat-original,
.chat-translation {
    margin: 0;
    line-height: 1.45;
    font-size: 0.96rem;
}

.chat-original + .chat-translation {
    margin-top: 8px;
}

.chat-message-sections {
    display: grid;
    gap: 10px;
}

.chat-message-section {
    position: relative;
    padding: 10px 12px;
    padding-right: 54px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
}

.chat-image-attachment {
    margin: 2px 0 10px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
}

.chat-image-attachment img {
    display: block;
    width: 100%;
    max-height: min(340px, 42vh);
    object-fit: contain;
}

.chat-image-status {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--chat-text) 8%, transparent);
    color: var(--chat-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.chat-expandable.is-collapsed {
    position: relative;
    max-height: 8.8em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
    mask-image: linear-gradient(180deg, #000 62%, transparent);
}

.chat-see-more {
    justify-self: start;
    margin: 8px 0 0;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.chat-see-more:hover {
    background: rgba(49, 200, 181, 0.16);
}

.chat-bubble-out .chat-see-more {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.chat-bubble-out .chat-see-more:hover {
    background: rgba(255, 255, 255, 0.24);
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    gap: 12px;
    padding: clamp(18px, 4vw, 44px);
    background: rgba(3, 10, 18, 0.82);
    backdrop-filter: blur(14px);
}

.image-preview-overlay[hidden] {
    display: none !important;
}

.image-preview-overlay img {
    max-width: min(1120px, 94vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.image-preview-overlay p {
    max-width: min(720px, 92vw);
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    font-weight: 800;
}

.image-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-section-head {
    margin-bottom: 6px;
}

.chat-section-label {
    margin: 0;
    color: var(--chat-muted);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chat-audio-button {
    width: 32px;
    height: 32px;
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: rgba(125, 155, 255, 0.12);
    color: var(--chat-text);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.chat-audio-button:hover {
    transform: translateY(calc(-50% - 1px));
    background: rgba(125, 155, 255, 0.18);
}

.chat-audio-button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: translateY(-50%);
}

.chat-audio-button.is-playing {
    background: rgba(49, 200, 181, 0.24);
    color: var(--chat-text);
}

.chat-audio-icon {
    width: 17px;
    height: 17px;
    display: block;
}

.chat-translation-pending {
    color: var(--chat-muted);
    font-style: italic;
}

.word-lookup-token {
    display: inline;
    margin: 0;
    padding: 0 1px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(49, 200, 181, 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: background-color 120ms ease, text-decoration-color 120ms ease;
}

.word-lookup-token:hover,
.word-lookup-token:focus-visible {
    background: rgba(49, 200, 181, 0.13);
    text-decoration-color: var(--chat-accent);
    outline: none;
}

.word-lookup-token:disabled {
    cursor: wait;
    opacity: 0.72;
}

.translation-summary {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: var(--chat-text);
    font-size: 0.82rem;
    line-height: 1.42;
    white-space: pre-wrap;
}

.chat-empty-state {
    justify-self: center;
    max-width: 560px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--chat-muted);
    text-align: center;
    border-radius: 10px;
    border: 1px solid rgba(125, 155, 255, 0.12);
    box-shadow: none;
}

.chat-history-state {
    justify-self: center;
    max-width: 360px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(125, 155, 255, 0.1);
    color: var(--chat-muted);
    border: 1px solid rgba(125, 155, 255, 0.12);
    font-size: 0.82rem;
    text-align: center;
}

.chat-history-state p {
    margin: 0;
}

.chat-history-notice {
    justify-self: center;
    max-width: 360px;
    margin: 2px auto 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(125, 155, 255, 0.1);
    color: var(--chat-muted);
    border: 1px solid rgba(125, 155, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.chat-composer {
    padding: 10px 14px 14px;
    background: var(--chat-composer);
    border-top: 1px solid rgba(125, 155, 255, 0.12);
}

.chat-composer-host {
    position: relative;
}

.chat-composer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.composer-input-shell {
    position: relative;
    min-height: 54px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 28px;
    background: var(--chat-input);
    border: 1px solid rgba(125, 155, 255, 0.1);
    box-shadow: 0 10px 26px rgba(28, 55, 132, 0.08);
}

.composer-input-shell.has-continuous-action {
    grid-template-columns: auto auto minmax(0, 1fr);
}

.composer-text {
    min-height: 22px;
    max-height: 120px;
    padding: 8px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--chat-text);
    box-shadow: none;
}

html.theme-dark .composer-text,
.app-chat-theme .composer-text {
    background: transparent;
    color: var(--chat-text);
    border: none;
}

.composer-text:focus {
    box-shadow: none;
    border: none;
}

.composer-text::placeholder {
    color: var(--chat-muted);
}

.composer-icon,
.composer-inline-button,
.composer-mic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font: inherit;
}

.composer-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: transparent;
    color: var(--chat-muted);
    font-size: 1.3rem;
}

.composer-attach-menu {
    position: absolute;
    left: 10px;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: min(220px, calc(100vw - 48px));
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--chat-text) 12%, transparent);
    border-radius: 18px;
    background: var(--chat-panel);
    box-shadow: 0 18px 38px rgba(5, 14, 25, 0.22);
}

html.theme-light .composer-attach-menu {
    background: #ffffff;
    border-color: rgba(23, 48, 64, 0.12);
    box-shadow: 0 18px 42px rgba(23, 48, 64, 0.18);
}

.composer-attach-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--chat-text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.composer-attach-option svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: currentColor;
}

.composer-attach-option > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    flex: 1;
}

.composer-attach-option:hover:not(:disabled) {
    background: color-mix(in srgb, var(--chat-accent) 14%, transparent);
}

.composer-attach-option:disabled {
    color: var(--chat-muted);
    cursor: default;
    opacity: 0.65;
}

.composer-attach-option small {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

html.theme-light .composer-attach-option {
    color: #132635;
}

html.theme-light .composer-attach-option:disabled {
    color: #7a8b99;
}

.composer-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(520px, calc(100% - 70px));
    margin: 10px 0 0 12px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--chat-accent) 26%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--chat-accent) 10%, var(--chat-panel));
    color: var(--chat-text);
}

.composer-image-preview[hidden] {
    display: none !important;
}

.composer-image-preview img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
}

.composer-image-preview strong,
.composer-image-preview span {
    display: block;
}

.composer-image-preview strong {
    font-size: 0.88rem;
}

.composer-image-preview span {
    color: var(--chat-muted);
    font-size: 0.78rem;
}

.composer-image-preview button {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chat-text) 10%, transparent);
    color: var(--chat-text);
    cursor: pointer;
}

.composer-inline-button {
    min-width: 86px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(49, 91, 223, 0.18);
    color: var(--chat-text);
    font-size: 0.84rem;
    font-weight: 700;
}

.composer-inline-button[hidden] {
    display: none !important;
}

.composer-mic {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--chat-accent);
    color: #051f1d;
    box-shadow: 0 10px 22px rgba(49, 200, 181, 0.24);
}

.composer-action-icon {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}

.composer-action-icon-send,
.composer-mic.has-text .composer-action-icon-mic {
    display: none;
}

.composer-mic.has-text .composer-action-icon-send {
    display: block;
}

.composer-mic.is-recording {
    background: #ff6b6b;
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.26);
}

.composer-mic:disabled,
.composer-inline-button:disabled,
.composer-icon:disabled {
    opacity: 0.5;
    cursor: default;
}

.composer-status {
    width: max-content;
    max-width: calc(100% - 250px);
    box-sizing: border-box;
    margin: 8px 0 0;
    padding: 0 12px;
    color: #93a7af;
    font-size: 0.83rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transform-origin: left center;
}

.continuous-listen-button {
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 6px 64px 0 10px;
    padding: 0 14px;
    border: 1px solid rgba(125, 155, 255, 0.16);
    border-radius: 999px;
    background: var(--chat-pill);
    color: var(--chat-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.continuous-listen-button:hover,
.continuous-listen-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(49, 200, 181, 0.45);
    outline: none;
}

.continuous-listen-button.is-active {
    background: linear-gradient(135deg, var(--chat-accent), #7d9bff);
    color: #051f1d;
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(49, 200, 181, 0.23);
}

.continuous-listen-button:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

@media (min-width: 601px) {
    .chat-composer-host {
        padding-right: 198px;
    }

    .chat-composer-host .continuous-listen-button {
        position: absolute;
        top: 10px;
        right: 14px;
        float: none;
        min-width: 166px;
        min-height: 54px;
        margin: 0;
        padding: 0 16px;
    }
}

.composer-readonly .composer-inline-button,
.composer-readonly .composer-mic {
    opacity: 0.5;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-page: #090f22;
        --bg-page-tint: #071d24;
        --surface: rgba(14, 23, 45, 0.9);
        --surface-strong: #101b2d;
        --surface-soft: rgba(17, 28, 54, 0.94);
        --border-soft: rgba(190, 215, 255, 0.12);
        --border-strong: rgba(190, 215, 255, 0.22);
        --text-main: #f5f8ff;
        --text-soft: #b5c4d7;
        --text-faint: #8798b5;
        --accent: #7d9bff;
        --accent-strong: #9fb4ff;
        --accent-soft: rgba(125, 155, 255, 0.16);
        --accent-mint: #31c8b5;
        --accent-mint-strong: #68dfd1;
        --success: #72d29b;
        --success-bg: rgba(27, 106, 65, 0.2);
        --danger: #ff9f9f;
        --danger-bg: rgba(177, 61, 61, 0.22);
        --shadow-xl: 0 28px 60px rgba(0, 0, 0, 0.34);
        --shadow-lg: 0 18px 38px rgba(0, 0, 0, 0.28);
        --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.22);
        --scrollbar-track: rgba(255, 255, 255, 0.04);
        --scrollbar-thumb: rgba(255, 255, 255, 0.18);
        --scrollbar-thumb-hover: rgba(255, 255, 255, 0.28);
        --chat-frame: #091225;
        --chat-topbar: #111c36;
        --chat-composer: #111c36;
        --chat-feed: #0a1326;
        --chat-feed-tint: rgba(125, 155, 255, 0.045);
        --chat-input: rgba(255, 255, 255, 0.08);
        --chat-bubble-in: #19233d;
        --chat-bubble-out: #315bdf;
        --chat-bubble-out-strong: #214fcf;
        --chat-pill: rgba(255, 255, 255, 0.08);
        --chat-pill-text: #dbe5ff;
        --chat-text: #f4f7ff;
        --chat-text-on-accent: #ffffff;
        --chat-muted: #aebbd4;
        --scrollbar-chat-track: rgba(255, 255, 255, 0.04);
        --scrollbar-chat-thumb: rgba(125, 155, 255, 0.22);
        --scrollbar-chat-thumb-hover: rgba(49, 200, 181, 0.34);
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(55, 100, 255, 0.17), transparent 24%),
            radial-gradient(circle at top right, rgba(49, 200, 181, 0.11), transparent 26%),
            linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-tint) 100%);
    }

    :root:not(.theme-light) .app-chat-theme {
        background:
            radial-gradient(circle at 20% 0%, rgba(55, 100, 255, 0.26), transparent 34%),
            radial-gradient(circle at 82% 8%, rgba(49, 200, 181, 0.18), transparent 30%),
            linear-gradient(180deg, #081021 0%, #091225 100%);
    }

    :root:not(.theme-light) .chat-summary-card {
        background:
            radial-gradient(circle at top left, rgba(125, 155, 255, 0.22), transparent 36%),
            radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 42%),
            linear-gradient(135deg, rgba(25, 35, 61, 0.98), rgba(15, 28, 50, 0.96));
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    }

    :root:not(.theme-light) .chat-summary-card p:last-child {
        color: rgba(244, 247, 255, 0.94);
    }

    .auth-body {
        background:
            radial-gradient(circle at 24% 12%, rgba(55, 100, 255, 0.26), transparent 26%),
            radial-gradient(circle at 76% 16%, rgba(47, 197, 177, 0.2), transparent 24%),
            linear-gradient(135deg, #090f22 0%, #101b2d 48%, #071d24 100%);
    }

    .auth-body::before {
        background:
            linear-gradient(rgba(232, 239, 252, 0.045) 1px, transparent 1px),
            linear-gradient(90deg, rgba(232, 239, 252, 0.045) 1px, transparent 1px);
    }

    .auth-layout {
        background:
            linear-gradient(135deg, rgba(14, 23, 45, 0.82), rgba(11, 28, 39, 0.62)),
            radial-gradient(circle at 10% 12%, rgba(125, 155, 255, 0.13), transparent 34%),
            radial-gradient(circle at 90% 0%, rgba(49, 200, 181, 0.12), transparent 30%);
        border-color: rgba(190, 215, 255, 0.12);
        box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
    }

    .auth-panel {
        background:
            linear-gradient(180deg, rgba(14, 23, 45, 0.96), rgba(11, 28, 39, 0.9)),
            radial-gradient(circle at top right, rgba(49, 202, 184, 0.12), transparent 34%);
        border-color: rgba(190, 215, 255, 0.12);
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
    }

    .auth-brand-name,
    .auth-body h1,
    .auth-panel-header h2 {
        color: #f5f8ff;
    }

    .auth-body .auth-copy,
    .auth-panel-header p:not(.eyebrow) {
        color: #b5c4d7;
    }

    .auth-body .eyebrow {
        color: #7d9bff;
    }

    .auth-body input {
        background: rgba(7, 17, 31, 0.74);
        border-color: rgba(190, 215, 255, 0.14);
    }

    .password-toggle {
        background: rgba(255, 255, 255, 0.08);
        color: #b5c4d7;
    }

    .remember-option {
        color: #b5c4d7;
    }

    .locale-switcher select,
    .settings-locale-form select {
        background: rgba(7, 17, 31, 0.74);
        border-color: rgba(190, 215, 255, 0.14);
        color: var(--text-main);
    }

    .auth-benefits span {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(190, 215, 255, 0.13);
        color: #dbe5ff;
        box-shadow: none;
    }

    .owner-badge {
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-main);
        border-color: var(--border-soft);
    }

    input,
    select,
    textarea {
        background: rgba(19, 29, 34, 0.94);
        color: var(--text-main);
        border-color: var(--border-soft);
    }

    .composer-text {
        background: transparent;
        color: var(--chat-text);
        border: none;
    }

    .language-card {
        background: rgba(255, 255, 255, 0.055);
        border-color: var(--border-soft);
    }

    .language-card-input:checked + .language-card {
        background:
            radial-gradient(circle at top right, rgba(49, 200, 181, 0.16), transparent 38%),
            rgba(125, 155, 255, 0.08);
    }

    .room-active-toggle {
        background: rgba(255, 255, 255, 0.055);
        border-color: var(--border-soft);
    }

    .settings-locale-form {
        background:
            radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
            rgba(255, 255, 255, 0.055);
    }

    .settings-modal-card > .modal-header,
    .settings-layout {
        background:
            radial-gradient(circle at top left, rgba(49, 200, 181, 0.12), transparent 34%),
            rgba(14, 23, 45, 0.82);
    }

    .button-secondary {
        color: var(--text-main);
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--border-soft);
    }

    .button-ghost {
        color: var(--text-main);
        background: rgba(255, 255, 255, 0.05);
    }

    .button-danger {
        color: #fff;
        background: linear-gradient(180deg, #dd6a6a 0%, #b84a4a 100%);
    }

    code {
        color: var(--text-soft);
    }

    .rooms-empty-state,
    .room-showcase-card {
        background:
            radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
            radial-gradient(circle at bottom left, rgba(125, 155, 255, 0.12), transparent 36%),
            linear-gradient(180deg, rgba(14, 23, 45, 0.94), rgba(11, 28, 39, 0.92));
        border-color: var(--border-soft);
    }

    .modal-close {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-main);
    }

    .modal-card {
        background: var(--surface-strong);
    }

    .settings-nav-item,
    .usage-summary-card,
    .usage-table-card {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
    }

    .settings-sidebar {
        background:
            linear-gradient(180deg, rgba(49, 200, 181, 0.08), transparent 44%),
            rgba(255, 255, 255, 0.035);
    }

    .settings-nav-icon {
        background: rgba(49, 200, 181, 0.14);
        color: var(--accent);
    }

    .settings-nav-item.is-active {
        color: #fff;
    }

    .settings-nav-item.is-active .settings-nav-icon {
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
    }

    .settings-nav-item.is-active small {
        color: rgba(255, 255, 255, 0.78);
    }

    .usage-dashboard > .usage-muted {
        background: rgba(255, 255, 255, 0.045);
    }

    .usage-row {
        background: rgba(255, 255, 255, 0.055);
        border-color: var(--border-soft);
    }

    .settings-sidebar {
        background:
            linear-gradient(180deg, rgba(49, 200, 181, 0.08), transparent 42%),
            rgba(255, 255, 255, 0.025);
    }

    .settings-empty,
    .usage-state {
        background:
            radial-gradient(circle at top right, rgba(49, 200, 181, 0.12), transparent 34%),
            rgba(255, 255, 255, 0.045);
    }

    .usage-row {
        background: rgba(255, 255, 255, 0.045);
    }

    .toast-success {
        background: rgba(27, 106, 65, 0.9);
        color: #eaf8f0;
        border-color: rgba(114, 210, 155, 0.24);
    }

    .toast-error {
        background: rgba(177, 61, 61, 0.9);
        color: #fff0f0;
        border-color: rgba(255, 159, 159, 0.24);
    }
}

@media (max-width: 1024px) {
    .auth-shell,
    .app-shell,
    .topbar {
        width: min(100%, calc(100% - 28px));
    }

    .app-chat-theme,
    .dashboard-page {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .dashboard-page {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .dashboard-page .topbar {
        height: auto;
        padding-top: 22px;
    }

    .dashboard-page .app-shell {
        height: 100%;
        min-height: 0;
        padding: 16px 0 14px;
    }

    .room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-app-shell {
        width: min(100%, calc(100% - 16px));
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        margin: 8px auto;
    }

    .chat-topbar {
        gap: 12px;
        padding: 10px 14px;
    }

    .chat-bubble {
        max-width: min(82%, 680px);
    }

    .chat-info-grid {
        grid-template-columns: 1fr;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 28px;
    }

    .auth-body h1 {
        max-width: 16ch;
    }
}

@media (max-width: 600px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .auth-shell {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 8px 0;
    }

    .auth-layout {
        width: 100%;
        min-height: calc(100vh - 16px);
        min-height: calc(100dvh - 16px);
        display: grid;
        grid-template-rows: auto minmax(0, auto);
        gap: 12px;
        padding: 14px 14px;
        border-radius: 22px;
    }

    .auth-brand {
        gap: 12px;
        margin-bottom: 12px;
    }

    .auth-logo-picture {
        width: clamp(172px, 54vw, 230px);
    }

    .auth-logo-mark {
        width: 58px;
        height: 48px;
    }

    .auth-logo-symbol {
        width: 39px;
        height: 39px;
        border-radius: 15px 15px 15px 6px;
        font-size: 1.2rem;
    }

    .auth-brand-name {
        font-size: clamp(1.85rem, 13vw, 2.35rem);
    }

    .auth-body h1,
    .listener-entry-card h1,
    .topbar h1 {
        font-size: clamp(1.72rem, 8.6vw, 2.18rem);
        line-height: 1.04;
    }

    .auth-body .auth-copy {
        margin-bottom: 0;
        font-size: 0.9rem;
        line-height: 1.42;
    }

    .auth-panel {
        padding: 16px 14px;
        border-radius: 20px;
    }

    .auth-panel-header {
        margin-bottom: 12px;
    }

    .auth-panel-header h2 {
        margin-bottom: 0;
        font-size: 1.28rem;
    }

    .auth-benefits {
        gap: 6px;
        margin-top: 12px;
    }

    .auth-benefits span {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.7rem;
    }

    .auth-panel .form-stack {
        gap: 10px;
        margin-top: 14px;
    }

    .auth-panel .field {
        gap: 6px;
    }

    .auth-panel input {
        min-height: 44px;
        padding: 11px 13px;
        border-radius: 15px;
    }

    .auth-panel .button {
        min-height: 44px;
    }

    .auth-body .button,
    .listener-entry-card .button,
    .modal-card .button {
        width: 100%;
    }

    .single-column {
        width: min(100%, calc(100% - 20px));
        min-height: 100vh;
        min-height: 100dvh;
        padding: 12px 0;
        align-content: center;
    }

    .listener-entry-card {
        margin-top: 0;
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        display: flex;
        flex-direction: column;
        padding: 22px 18px;
        border-radius: 24px;
        overflow: hidden;
    }

    .listener-entry-card .eyebrow {
        margin-bottom: 6px;
        font-size: 0.66rem;
    }

    .listener-entry-card h1 {
        font-size: clamp(1.45rem, 7vw, 2rem);
        line-height: 1.02;
    }

    .listener-entry-card .section-copy {
        margin-bottom: 10px;
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .listener-entry-card .form-stack {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .listener-entry-card .field:not(.language-picker),
    .listener-entry-card .listener-room-summary,
    .listener-entry-card .button {
        flex: 0 0 auto;
    }

    .listener-room-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .listener-room-summary-tight {
        margin-bottom: 10px;
    }

    .listener-room-summary > div {
        min-width: 0;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .listener-room-summary .share-label {
        font-size: 0.64rem;
    }

    .listener-room-summary strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .listener-entry-card input {
        min-height: 44px;
        padding: 11px 13px;
        border-radius: 15px;
    }

    .listener-entry-card .language-picker {
        min-height: 0;
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        overflow: hidden;
    }

    .listener-entry-card .language-card-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        padding-right: 4px;
        padding-bottom: 4px;
        overscroll-behavior: contain;
    }

    .language-card {
        min-height: 72px;
        padding: 10px;
        border-radius: 16px;
    }

    .language-card-flag {
        width: 44px;
        height: 30px;
        border-radius: 9px;
    }

    .dashboard-page {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .dashboard-page .topbar {
        width: min(100%, calc(100% - 20px));
        min-height: 118px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "actions actions"
            "title title";
        align-items: center;
        gap: 10px 12px;
        padding-top: 16px;
    }

    .dashboard-page .topbar > div:first-child {
        display: contents;
    }

    .dashboard-page .topbar .eyebrow {
        display: none;
    }

    .dashboard-page .topbar h1 {
        grid-area: title;
        margin: 2px 0 0;
        font-size: clamp(2rem, 9vw, 2.65rem);
        line-height: 1;
        white-space: nowrap;
    }

    .dashboard-page .topbar-actions {
        grid-area: actions;
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }

    .dashboard-page .owner-badge {
        order: -1;
        margin-right: auto;
        max-width: 54vw;
        min-height: 44px;
        padding: 0 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-page .app-shell {
        width: min(100%, calc(100% - 20px));
        height: calc(100vh - 118px);
        height: calc(100dvh - 118px);
        padding: 10px 0 10px;
        grid-template-rows: minmax(0, 1fr);
    }

    .room-gallery-panel {
        min-height: 0;
        padding: 18px 14px 12px;
        border-radius: 24px;
    }

    .section-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 10px;
        margin-bottom: 12px;
    }

    .section-header h2 {
        font-size: 1.15rem;
    }

    .section-header .section-copy {
        display: none;
    }

    .counter {
        white-space: nowrap;
    }

    .room-grid-shell {
        height: 100%;
        padding: 4px 4px 18px 0;
    }

    .room-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .room-showcase-card {
        gap: 14px;
        padding: 18px;
        border-radius: 22px;
    }

    .room-showcase-avatar {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    .room-showcase-actions,
    .modal-actions,
    .chat-info-actions,
    .chat-info-grid {
        grid-template-columns: 1fr;
    }

    .room-showcase-actions {
        justify-items: stretch;
    }

    .rooms-empty-state {
        min-height: 0;
        height: 100%;
        padding: 28px 18px;
        border-radius: 22px;
    }

    .rooms-empty-title {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    .rooms-empty-text {
        font-size: 0.94rem;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal-card,
    .modal-card-compact,
    .modal-card-chat-info,
    .settings-modal-card {
        width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 20px 16px;
        border-radius: 24px;
    }

    .settings-modal-card {
        padding: 0;
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
    }

    .modal-card .form-stack {
        min-height: 0;
    }

    .settings-layout,
    .usage-detail-grid,
    .usage-summary-grid {
        grid-template-columns: 1fr;
    }

    .settings-layout {
        min-height: 0;
        overflow: hidden;
        background:
            radial-gradient(circle at top left, rgba(49, 200, 181, 0.13), transparent 34%),
            rgba(18, 34, 85, 0.025);
    }

    .settings-sidebar {
        grid-auto-flow: column;
        grid-auto-columns: minmax(112px, 1fr);
        grid-template-columns: none;
        overflow-x: auto;
        gap: 8px;
        margin: 0 14px;
        padding: 10px 0 12px;
        background: transparent;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
        scroll-snap-type: x proximity;
    }

    .settings-nav-item {
        grid-template-columns: auto;
        min-height: 44px;
        place-items: center;
        padding: 0 14px;
        border-radius: 999px;
        background: rgba(18, 34, 85, 0.07);
        box-shadow: none;
        text-align: center;
        scroll-snap-align: start;
    }

    .settings-nav-icon {
        display: none;
    }

    .settings-nav-item span {
        font-size: 0.86rem;
        align-self: center;
    }

    .settings-nav-item small {
        display: none;
    }

    .settings-nav-item.is-active {
        box-shadow: 0 14px 26px rgba(49, 200, 181, 0.24);
    }

    .settings-panel {
        padding: 16px 14px 18px;
    }

    .settings-modal-card > .modal-header {
        padding: 20px 18px 16px;
    }

    .usage-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .usage-summary-card {
        min-height: 94px;
        padding: 14px;
        border-radius: 19px;
    }

    .usage-table-card {
        padding: 14px;
        border-radius: 19px;
    }

    .usage-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .modal-card .language-card-grid {
        grid-template-columns: 1fr;
        max-height: min(36vh, 300px);
        max-height: min(36dvh, 300px);
        overflow-y: auto;
        padding-right: 4px;
        overscroll-behavior: contain;
    }

    .room-create-modal-card .room-language-grid {
        max-height: min(46vh, 430px);
        max-height: min(46dvh, 430px);
    }

    .room-create-modal-card .modal-actions {
        grid-template-columns: 1fr;
    }

    .room-settings-language-grid {
        max-height: min(38vh, 320px);
        max-height: min(38dvh, 320px);
    }

    .room-tts-grid {
        grid-template-columns: 1fr;
    }

    .theater-mode {
        padding: 16px;
    }

    .theater-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .theater-actions {
        display: grid;
        justify-items: end;
        gap: 8px;
    }

    .theater-actions span {
        font-size: 0.76rem;
        text-align: right;
    }

    .theater-message {
        padding: 22px;
        border-radius: 26px;
        width: min(100%, calc(100vw - 24px));
        height: min(100%, clamp(300px, 58vh, 560px));
    }

    .theater-message-text {
        font-size: var(--theater-font-size, clamp(1.85rem, 9vw, 3.9rem));
    }

    .theater-history {
        grid-template-columns: 1fr;
        max-height: 26vh;
        max-height: 26dvh;
        overflow-y: auto;
    }

    .modal-header {
        align-items: center;
    }

    .chat-app-shell {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        border: none;
        border-radius: 0;
    }

    .chat-topbar {
        position: relative;
        min-height: 64px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    }

    .chat-topbar-main {
        min-width: 0;
        gap: 10px;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.86rem;
    }

    .chat-title {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.98rem;
    }

    .chat-subtitle {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.76rem;
    }

    .chat-mobile-details-toggle {
        display: inline-flex;
    }

    .chat-topbar-meta {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 8px;
        justify-content: flex-start;
        gap: 6px;
    }

    .chat-topbar.is-mobile-meta-open .chat-topbar-meta {
        display: flex;
    }

    .chat-pill,
    .chat-pill-link,
    .chat-pill-button {
        min-height: 44px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .chat-feed {
        padding: 16px 8px;
    }

    .owner-chat-feed,
    .listener-chat-feed {
        gap: 10px;
    }

    .chat-bubble {
        max-width: 94%;
        padding: 9px 10px 8px;
        border-radius: 13px;
    }

    .chat-summary-card {
        width: 100%;
        max-width: calc(100vw - 24px);
        gap: 6px;
        margin: 8px auto;
        padding: 14px 13px;
        border-radius: 18px;
        box-shadow: 0 10px 24px rgba(28, 55, 132, 0.12);
    }

    .chat-summary-title {
        font-size: 0.68rem;
        letter-spacing: 0.1em;
    }

    .chat-summary-range {
        font-size: 0.72rem;
    }

    .chat-summary-card p:last-child {
        font-size: 0.9rem;
        line-height: 1.48;
    }

    html.theme-dark .chat-summary-card {
        background:
            radial-gradient(circle at top left, rgba(125, 155, 255, 0.22), transparent 36%),
            radial-gradient(circle at bottom right, rgba(49, 200, 181, 0.14), transparent 42%),
            linear-gradient(135deg, rgba(25, 35, 61, 0.98), rgba(15, 28, 50, 0.96));
        color: rgba(244, 247, 255, 0.94);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    }

    .chat-bubble-meta {
        font-size: 0.69rem;
    }

    .chat-message-actions {
        opacity: 1;
        transform: none;
    }

    .chat-message-action {
        width: 28px;
        height: 28px;
    }

    .chat-original,
    .chat-translation {
        font-size: 0.92rem;
        line-height: 1.43;
    }

    .chat-message-section {
        padding: 10px 46px 10px 10px;
    }

    .chat-audio-button {
        width: 34px;
        height: 34px;
        right: 8px;
    }

    .chat-composer {
        padding: 8px 8px max(10px, env(safe-area-inset-bottom));
    }

    .chat-composer-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .composer-input-shell {
        min-height: 50px;
        gap: 6px;
        padding: 7px 10px;
    }

    .composer-input-shell.has-continuous-action {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .composer-input-shell.has-continuous-action .composer-text {
        grid-column: 1 / -1;
    }

    .composer-icon {
        width: 36px;
        height: 36px;
    }

    .composer-inline-button {
        display: none;
    }

    .composer-mic {
        width: 50px;
        height: 50px;
    }

    .composer-text {
        max-height: 96px;
        font-size: 0.95rem;
    }

    .composer-status {
        width: 100%;
        max-width: 100%;
        margin: 6px 0 0;
        padding: 0 8px;
        font-size: 0.76rem;
    }

    .continuous-listen-button {
        float: none;
        width: 100%;
        min-height: 34px;
        margin: 8px 0 0;
        padding: 0 12px;
        font-size: 0.76rem;
    }

    .activity-overlay {
        padding: 14px;
    }

    .activity-overlay-card {
        width: 100%;
        padding: 22px 18px;
        border-radius: 24px;
    }
}
