:root {
    color-scheme: light;
    --ink: #171321;
    --ink-2: #2a2238;
    --muted: #6d6478;
    --muted-2: #8c829d;
    --paper: #fffdfb;
    --paper-soft: #fbf8ff;
    --surface: #ffffff;
    --surface-2: #f7f2ff;
    --line: #e8e0f2;
    --line-strong: #d8cbea;
    --plum-950: #23142f;
    --plum-900: #321e4b;
    --plum-800: #432769;
    --plum-700: #5a38a1;
    --violet: #7257e8;
    --violet-soft: #ede8ff;
    --lavender: #f4efff;
    --success: #307457;
    --success-surface: #e9f8ef;
    --success-stroke: #bfe8cc;
    --success-text: #225d43;
    --danger: #b74747;
    --danger-surface: #fff0f0;
    --danger-stroke: #f0c8c8;
    --danger-text: #8b2f2f;
    --warning-surface: #fff8e7;
    --warning-stroke: #f0dfa9;
    --warning-text: #765116;
    --info-surface: #f3efff;
    --info-stroke: #ded3f8;
    --info-text: #4e3279;
    --scrim: rgba(23, 19, 33, 0.72);
--radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 32px;
    --radius-xl: 44px;
    --primary: var(--violet);
    --primary-strong: var(--plum-900);
    --primary-soft: var(--violet-soft);
    --primary-soft-strong: var(--lavender);
    --accent: var(--violet);
    --background: var(--paper-soft);
    --surface-alt: var(--surface-2);
    --surface-muted: var(--lavender);
    --stroke: var(--line);
    --stroke-strong: var(--line-strong);
    --text: var(--ink);
    --text-secondary: var(--muted);
    --text-muted: var(--muted-2);
    --text-on-primary: #ffffff;
    --radius-card: var(--radius-lg);
    --radius-control: 18px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.12), transparent 19rem),
        linear-gradient(180deg, var(--background) 0%, var(--background) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
label,
.choice {
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
}

img {
    max-width: 100%;
}

.shell {
    width: 100%;
    max-width: 44rem;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 1rem 1rem calc(1.25rem + var(--safe-bottom));
}

.panel {
    width: 100%;
    margin: 0 0 0.875rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-card);
}

.hero {
    padding-top: 1.125rem;
    padding-bottom: 1.125rem;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(255, 255, 255, 0) 58%),
        var(--surface);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2 {
    color: var(--text);
    letter-spacing: -0.045em;
    line-height: 1.08;
}

h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 9vw, 2.75rem);
    font-weight: 900;
}

h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.3rem, 5vw, 1.75rem);
    font-weight: 850;
}

h3 {
    color: var(--text);
    line-height: 1.15;
}

label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 800;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.channel-input,
select,
input[type="text"] {
    width: 100%;
    min-height: 3.35rem;
    padding: 0.875rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
    color: var(--text);
    caret-color: var(--primary);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    outline: none;
    text-transform: uppercase;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.channel-input::placeholder,
input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.channel-input:focus,
select:focus,
input[type="text"]:focus,
textarea:focus {
    background: var(--surface);
    border-color: var(--primary);
}

select {
    letter-spacing: normal;
    text-transform: none;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.35rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: var(--text-on-primary);
}

.secondary-button {
    background: var(--primary-soft);
    border-color: var(--stroke);
    color: var(--primary-strong);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
    transform: translateY(0);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-link:focus-visible,
.qr-mini-button:focus-visible,
.language-inline-button:focus-visible,
.choice:focus-within {
    outline: 0.1875rem solid rgba(124, 58, 237, 0.45);
    outline-offset: 0.125rem;
}

.primary-button:disabled,
.secondary-button:disabled,
button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    margin: 0 0 0.875rem;
    padding: 0.5rem 0.875rem;
    background: var(--primary-soft);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    color: var(--primary-strong);
    font-size: 0.875rem;
    font-weight: 850;
    text-decoration: none;
}

.muted {
    margin-bottom: 0;
    color: var(--text-secondary);
}

.alert {
    padding: 0.875rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-weight: 700;
}

.alert-error {
    background: var(--danger-surface);
    border-color: var(--danger-stroke);
    color: var(--danger-text);
}

.alert-info {
    background: var(--info-surface);
    border-color: var(--info-stroke);
    color: var(--info-text);
}

.choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

.choice-scroll-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 22rem;
    max-height: min(50svh, 22rem);
    padding: 0.125rem 0.125rem 0.125rem 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-color: var(--stroke-strong) transparent;
}

.choice-scroll-list::-webkit-scrollbar {
    width: 0.35rem;
}

.choice-scroll-list::-webkit-scrollbar-thumb {
    background: var(--stroke-strong);
    border-radius: 999px;
}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.75rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
    color: var(--text);
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}

.choice-list-item {
    min-height: 3rem;
}

.choice:hover {
    border-color: var(--stroke-strong);
    transform: translateY(-1px);
}

.choice:has(input[type="radio"]:checked) {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.choice input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--primary);
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compact-control-row {
    align-items: stretch;
}

.audio-meter-card {
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
}

.audio-meter-label-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 850;
}

.audio-meter-track {
    height: 0.55rem;
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--stroke);
    border-radius: 999px;
}

.audio-meter-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 42%, #f59e0b 74%, #dc2626 100%);
    border-radius: 999px;
    transition: width 80ms linear;
}

.banner {
    margin-top: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--warning-surface);
    border: 1px solid var(--warning-stroke);
    border-radius: var(--radius-control);
    color: var(--warning-text);
    font-weight: 700;
}

.banner-error {
    background: var(--danger-surface);
    border-color: var(--danger-stroke);
    color: var(--danger-text);
}

.hidden {
    display: none !important;
}

.state-title {
    margin-bottom: 0.5rem;
}

.transcript {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transcript-panel {
    margin-bottom: 0;
}

.transcript-textbox {
    width: 100%;
    min-height: 20rem;
    padding: 1rem;
    resize: vertical;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
}

.player-panel {
    padding-top: 1rem;
}

.player-panel-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.player-panel-header .connection-state-card {
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
}

.connection-state-title {
    margin-bottom: 0.25rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 900;
}

.connection-state-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.connection-state-card.state-connected {
    background: var(--success-surface);
    border-color: var(--success-stroke);
}

.connection-state-card.state-connected .connection-state-title {
    color: var(--success-text);
}

.connection-state-card.state-restoring,
.connection-state-card.state-reconnecting {
    background: var(--info-surface);
    border-color: var(--info-stroke);
}

.connection-state-card.state-restoring .connection-state-title,
.connection-state-card.state-reconnecting .connection-state-title {
    color: var(--info-text);
}

.connection-state-card.state-disconnected,
.connection-state-card.state-failed {
    background: var(--danger-surface);
    border-color: var(--danger-stroke);
}

.connection-state-card.state-disconnected .connection-state-title,
.connection-state-card.state-failed .connection-state-title {
    color: var(--danger-text);
}

.qr-mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 4.25rem;
    height: 4.25rem;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.qr-mini-image,
.qr-modal-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 var(--safe-bottom);
}

.qr-modal.hidden {
    display: none;
}

.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--scrim);
}

.qr-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 88vh;
    max-height: 88svh;
    margin: 0;
    padding: 1.125rem;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 1.5rem 1.5rem 0 0;
}

.qr-modal-image {
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 1rem;
}

.qr-modal-text {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    word-break: break-all;
}

.modal-title {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.modal-action-row {
    margin-top: 1rem;
}

.qr-inline-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
}

.qr-inline-card-vertical {
    flex-direction: column;
    align-items: center;
}

.qr-inline-image {
    width: 8rem;
    height: 8rem;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    object-fit: contain;
}

.qr-inline-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.qr-inline-text-below {
    width: 100%;
    align-items: center;
    text-align: center;
}

.qr-inline-url {
    max-width: 100%;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    word-break: break-all;
}

.transcript-line {
    padding: 0.875rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-control);
    color: var(--text);
    word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (min-width: 30rem) {
    .player-panel-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .qr-mini-button {
        justify-self: end;
    }

    .qr-modal {
        align-items: center;
        padding: 1rem;
    }

    .qr-modal-card {
        width: min(24rem, calc(100vw - 2rem));
        border-radius: var(--radius-card);
    }
}

@media (min-width: 48rem) {
    .shell {
        max-width: 52rem;
        padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom));
    }

    .panel {
        margin-bottom: 1rem;
        padding: 1.35rem;
    }

    .hero {
        padding: 1.5rem;
    }

    .control-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .control-row label {
        margin-right: 0.25rem;
    }

    .control-row select {
        flex: 1 1 12rem;
    }

    .control-row .primary-button,
    .control-row .secondary-button {
        width: auto;
        min-width: 11rem;
    }

    .compact-control-row .primary-button,
    .compact-control-row .secondary-button {
        width: auto;
    }

    .choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .choice-scroll-list {
        max-height: 24rem;
    }
}

/* Marketing design-system alignment */
body {
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% -10%, rgba(114, 87, 232, 0.12), transparent 32rem),
        radial-gradient(circle at 92% 6%, rgba(67, 39, 105, 0.08), transparent 30rem),
        linear-gradient(180deg, #fffdfb 0%, #fbf8ff 45%, #fffdfb 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    color: #fff;
    background: var(--plum-800);
}

.shell {
    position: relative;
    width: min(100% - 2rem, 52rem);
    max-width: none;
    padding: clamp(1rem, 2.5vw, 1.5rem) 0 calc(1.5rem + var(--safe-bottom));
}

.shell::before {
    content: "";
    position: fixed;
    right: -13rem;
    bottom: -18rem;
    z-index: -1;
    width: 42rem;
    height: 42rem;
    border-radius: 999px;
    background: rgba(114, 87, 232, 0.07);
    filter: blur(10px);
    pointer-events: none;
}

.server-topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    font-weight: 760;
    letter-spacing: -0.035em;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(67, 39, 105, 0.16);
    border-radius: 14px;
    color: var(--plum-800);
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.95rem;
}

.brand-text {
    overflow: hidden;
    color: var(--ink);
    font-size: 1.08rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.64);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.topbar-action {
    color: var(--ink);
    transition: transform 160ms ease, border-color 160ms ease;
}

.topbar-action:hover,
.topbar-action:focus-visible {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.panel {
    border: 1px solid rgba(232, 224, 242, 0.86);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(1.35rem, 5vw, 2.4rem);
    background:
        radial-gradient(circle at 20% 0%, rgba(114, 87, 232, 0.12), transparent 18rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 242, 255, 0.76));
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -8rem -17rem auto;
    width: 30rem;
    height: 30rem;
    border-radius: 999px;
    background: rgba(114, 87, 232, 0.075);
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

h1 {
    max-width: 760px;
    margin-bottom: 0.85rem;
    font-size: clamp(2.35rem, 9vw, 4.4rem);
    font-weight: 790;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: clamp(1.7rem, 5vw, 2.55rem);
    font-weight: 780;
}

h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.15rem, 3.2vw, 1.45rem);
    font-weight: 760;
}

.muted {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 0.95rem;
}

label {
    color: var(--ink-2);
    font-weight: 760;
}

.channel-input,
select,
input[type="text"] {
    border-color: var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    caret-color: var(--violet);
    font-weight: 740;
}

.channel-input:focus,
select:focus,
input[type="text"]:focus,
textarea:focus {
    border-color: rgba(114, 87, 232, 0.48);
    background: #fff;
}

.primary-button,
.secondary-button {
    border-radius: 999px;
    font-weight: 740;
    letter-spacing: -0.015em;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
    color: #fff;
    background: var(--plum-950);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--plum-900);
}

.secondary-button {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    border-color: var(--line-strong);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-link:focus-visible,
.qr-mini-button:focus-visible,
.language-inline-button:focus-visible,
.choice:focus-within,
.topbar-action:focus-visible {
    outline: 0.18rem solid rgba(114, 87, 232, 0.42);
    outline-offset: 0.12rem;
}

.text-link,
.topbar-action {
    border-color: var(--line);
    background: rgba(244, 239, 255, 0.72);
    color: var(--plum-700);
}

.alert,
.choice,
.audio-meter-card,
.connection-state-card,
.qr-inline-card,
.transcript-line {
    border-radius: 18px;
}

.choice {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    font-weight: 740;
}

.choice:has(input[type="radio"]:checked) {
    border-color: rgba(114, 87, 232, 0.38);
    background: rgba(237, 232, 255, 0.66);
    color: var(--plum-800);
}

.choice input[type="radio"] {
    accent-color: var(--violet);
}

.audio-meter-card,
.connection-state-card,
.qr-inline-card,
.transcript-line {
    border: 1px solid rgba(232, 224, 242, 0.86);
    background: rgba(255, 255, 255, 0.74);
}

.audio-meter-track {
    background: var(--lavender);
    border-color: var(--line);
}

.audio-meter-fill {
    background: linear-gradient(90deg, var(--success) 0%, #70ad83 42%, #d5a647 74%, var(--danger) 100%);
}

.transcript-textbox {
    border-color: var(--line);
    border-radius: 20px;
    background:
        radial-gradient(circle at 8% 0%, rgba(114, 87, 232, 0.08), transparent 14rem),
        rgba(255, 255, 255, 0.78);
    color: var(--ink-2);
}

.qr-mini-button {
    border-color: var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
}

.qr-modal-backdrop {
    backdrop-filter: blur(5px);
}

.qr-modal-card {
    border-color: var(--line);
    background:
        radial-gradient(circle at 20% 0%, rgba(114, 87, 232, 0.1), transparent 16rem),
        rgba(255, 255, 255, 0.96);
}

.qr-inline-url {
    color: var(--plum-700);
    font-weight: 650;
}

.join-card,
.live-player-card,
.transcript-panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(247, 242, 255, 0.56));
}

.channel-hero @media (min-width: 48rem) {
    .server-topbar {
        margin-bottom: 1.2rem;
        padding: 0.85rem 0.95rem;
    }

    .hero {
        padding: 2rem;
    }
}

@media (max-width: 30rem) {
    }

.server-topbar .brand .brand-logo {
    width: 49px;
    height: 49px;
    max-width: 49px;
    max-height: 49px;
    object-fit: contain;
    flex: 0 0 36px;
    display: block;
}
body.modal-open {
    overflow: hidden;
}

.language-modal {
    z-index: 80;
    align-items: center;
    padding: max(1rem, env(safe-area-inset-top, 1rem)) 1rem max(1rem, calc(1rem + var(--safe-bottom)));
}

.language-modal .qr-modal-backdrop,
.language-modal-backdrop {
    background:
        radial-gradient(circle at 50% 10%, rgba(114, 87, 232, 0.22), transparent 24rem),
        rgba(23, 19, 33, 0.74);
    backdrop-filter: blur(10px);
}

.language-modal-card {
    display: flex;
    flex-direction: column;
    width: min(100%, 34rem);
    max-height: min(86svh, 42rem);
    padding: 1.15rem;
    overflow: hidden;
    border-color: rgba(232, 224, 242, 0.95);
    border-radius: 1.65rem;
    background:
        radial-gradient(circle at 18% 0%, rgba(114, 87, 232, 0.14), transparent 17rem),
        rgba(255, 255, 255, 0.98);
}

.language-modal-header {
    padding: 0.15rem 0.15rem 0.85rem;
}

.language-choice-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    margin: 0 -0.2rem;
    padding: 0.15rem 0.35rem 0.15rem 0.2rem;
}

.language-choice-item {
    align-items: flex-start;
    min-height: 3.85rem;
    padding: 0.9rem 0.95rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.82);
}

.language-choice-item:hover {
    border-color: rgba(114, 87, 232, 0.34);
}

.language-choice-text {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.language-choice-name {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
}

.language-choice-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.language-empty-state {
    padding: 1rem;
    border: 1px dashed var(--stroke-strong);
    border-radius: var(--radius-control);
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-weight: 700;
}

.language-modal-actions {
    flex: 0 0 auto;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--stroke);
}

@media (min-width: 30rem) {
    .language-modal-card {
        width: min(34rem, calc(100vw - 2rem));
        border-radius: 1.75rem;
    }

    .language-modal-actions {
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    }
}

.ask-guide-button {
    white-space: nowrap;
}

.ask-guide-modal {
    z-index: 82;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.ask-guide-modal .qr-modal-backdrop,
.ask-guide-modal-backdrop {
    background:
        radial-gradient(circle at 50% 10%, rgba(114, 87, 232, 0.2), transparent 24rem),
        rgba(23, 19, 33, 0.74);
    backdrop-filter: blur(10px);
}

.ask-guide-modal-card {
    display: grid;
    grid-template-rows: auto auto auto auto auto;
    gap: 0.75rem;
    width: 100%;
    max-height: min(92svh, 44rem);
    margin: 0;
    padding: 0.8rem 1rem max(1rem, calc(1rem + var(--safe-bottom)));
    overflow-y: auto;
    border-color: rgba(232, 224, 242, 0.95);
    border-radius: 1.75rem 1.75rem 0 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(114, 87, 232, 0.12), transparent 17rem),
        rgba(255, 255, 255, 0.98);
}

.ask-guide-sheet-handle {
    justify-self: center;
    width: 2.75rem;
    height: 0.3rem;
    margin-bottom: 0.1rem;
    border-radius: 999px;
    background: rgba(50, 30, 75, 0.18);
}

.ask-guide-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.ask-guide-heading-copy {
    min-width: 0;
}

.ask-guide-header .ask-guide-header .modal-title {
    margin-bottom: 0.25rem;
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    line-height: 1.1;
}

.ask-guide-header .muted {
    max-width: 28rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

.ask-guide-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--primary-strong);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.ask-guide-close-button:focus-visible {
    outline: 0.1875rem solid rgba(124, 58, 237, 0.45);
    outline-offset: 0.125rem;
}

.ask-guide-field {
    display: grid;
    gap: 0.45rem;
}

.ask-guide-label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 900;
}

textarea#askGuideText.ask-guide-textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 8rem;
    padding: 0.95rem 1rem;
    resize: none;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--stroke-strong);
    border-radius: 1.25rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.45;
    outline: none;
}

textarea#askGuideText.ask-guide-textarea::placeholder {
    color: var(--text-muted);
}

textarea#askGuideText.ask-guide-textarea:focus {
    border-color: rgba(114, 87, 232, 0.58);
}

.ask-guide-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 850;
}

#askGuideCounter {
    margin-left: auto;
    color: var(--text-muted);
}

.ask-guide-status {
    min-height: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 800;
}

.ask-guide-status:not(:empty) {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    background: rgba(247, 242, 255, 0.78);
}

.ask-guide-status.success {
    color: var(--success-text);
}

.ask-guide-status.success:not(:empty) {
    background: var(--success-surface);
    border-color: var(--success-stroke);
}

.ask-guide-status.error {
    color: var(--danger-text);
}

.ask-guide-status.error:not(:empty) {
    background: var(--danger-surface);
    border-color: var(--danger-stroke);
}

.ask-guide-status.sending {
    color: var(--info-text);
}

.ask-guide-status.sending:not(:empty) {
    background: var(--info-surface);
    border-color: var(--info-stroke);
}

.ask-guide-actions {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.1rem;
}

.ask-guide-actions .primary-button,
.ask-guide-actions .secondary-button {
    width: 100%;
    min-width: 0;
}

@media (min-width: 30rem) {
    .compact-control-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 42rem) {
    .ask-guide-modal {
        align-items: center;
        padding: max(1rem, env(safe-area-inset-top, 1rem)) 1rem max(1rem, calc(1rem + var(--safe-bottom)));
    }

    .ask-guide-modal-card {
        width: min(34rem, calc(100vw - 2rem));
        padding: 1.15rem;
        border-radius: 1.75rem;
    }

    .ask-guide-actions {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    }

    #askGuideCancelButton {
        order: 1;
    }

    #askGuideSendButton {
        order: 2;
    }
}

/* Premium passenger UI refresh: aligned with the marketing project */
.server-shell {
    width: min(100% - 2rem, 58rem);
    padding-top: clamp(0.85rem, 2.4vw, 1.35rem);
}

.channel-shell {
    width: min(100% - 2rem, 62rem);
}

.server-topbar {
    min-height: 72px;
    margin-bottom: clamp(1rem, 3vw, 1.4rem);
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(232, 224, 242, 0.72);
    border-radius: 999px;
    background: rgba(255, 253, 251, 0.82);
    backdrop-filter: blur(18px);
}

.server-topbar .brand {
    min-width: 0;
}

.server-topbar .brand .brand-logo {
    width: 49px;
    height: 49px;
    max-width: 49px;
    max-height: 49px;
    object-fit: contain;
    flex: 0 0 49px;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
}

.server-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--success);
}

.premium-hero {
    margin-bottom: 1rem;
    padding: clamp(1.35rem, 5.5vw, 2.8rem);
    border-radius: clamp(1.8rem, 5vw, var(--radius-xl));
    background:
        radial-gradient(circle at 12% 4%, rgba(114, 87, 232, 0.16), transparent 19rem),
        radial-gradient(circle at 96% 12%, rgba(67, 39, 105, 0.1), transparent 17rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(247, 242, 255, 0.73));
}

.hero-copy-block {
    max-width: 48rem;
}

.hero-subtitle {
    max-width: 44rem;
    margin-bottom: 0;
    font-size: clamp(1rem, 2.6vw, 1.16rem);
    line-height: 1.62;
}

.server-feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: clamp(1.2rem, 4vw, 2rem);
}

.server-feature-card,
.language-intro-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(232, 224, 242, 0.82);
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.72);
}

.server-feature-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    color: var(--plum-700);
    background: var(--violet-soft);
    font-size: 0.78rem;
    font-weight: 850;
}

.server-feature-card strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.server-feature-card p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.premium-join-card,
.channel-join-card,
.live-player-card,
.premium-transcript-panel,
.channel-unavailable-card {
    padding: clamp(1.1rem, 4vw, 1.55rem);
    border-radius: clamp(1.7rem, 4vw, var(--radius-lg));
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(247, 242, 255, 0.58));
}

.form-panel-header {
    max-width: 42rem;
    margin-bottom: 1.1rem;
}

.form-panel-header h2,
.language-intro-card h2,
.transcript-panel-header h2,
.premium-player-header h2 {
    margin-bottom: 0.45rem;
}

.channel-form {
    gap: 0.8rem;
}

.channel-form label {
    color: var(--ink-2);
}

.input-support {
    margin: -0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.channel-input {
    min-height: 3.75rem;
    padding-inline: 1.1rem;
    font-size: clamp(1.25rem, 6vw, 1.75rem);
    letter-spacing: 0.16em;
    text-align: center;
}

.channel-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
}

.channel-hero-copy {
    min-width: 0;
}

.channel-share-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.95rem;
}

.premium-qr-card {
    justify-content: center;
    padding: 1.1rem;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(114, 87, 232, 0.1), transparent 12rem),
        rgba(255, 255, 255, 0.78);
}

.premium-qr-card .qr-inline-image {
    width: min(11rem, 58vw);
    height: min(11rem, 58vw);
    border-radius: 1.2rem;
}

.language-intro-card {
    display: grid;
    align-content: center;
    padding: clamp(1rem, 4vw, 1.35rem);
}

.language-form {
    gap: 0.9rem;
}

.premium-choice-list {
    max-height: min(48svh, 28rem);
    padding-right: 0.2rem;
}

.premium-choice-list .choice {
    min-height: 3.5rem;
    padding: 0.9rem 1rem;
}

.player-panel-header.premium-player-header {
    gap: 1rem;
    margin-bottom: 1rem;
}

.live-control-row {
    margin-top: 0.95rem;
}

.connection-state-card {
    padding: 1rem;
    border-radius: 1.25rem;
}

.connection-state-title {
    letter-spacing: -0.02em;
}

.audio-meter-card {
    margin-top: 0.95rem;
    padding: 1rem;
    border-radius: 1.25rem;
}

.audio-meter-track {
    height: 0.68rem;
}

.banner {
    border-radius: 1.2rem;
}

.transcript-panel-header {
    margin-bottom: 0.95rem;
}

.premium-transcript-panel {
    margin-top: 1rem;
}

.transcript-textbox {
    min-height: min(45svh, 23rem);
    resize: vertical;
}

.qr-modal-card,
.language-modal-card,
.ask-guide-modal-card {
    border-radius: clamp(1.45rem, 5vw, 1.9rem);
}

.ask-guide-modal-card {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.channel-unavailable-card {
    display: grid;
    gap: 1rem;
}

.channel-unavailable-card .secondary-button {
    width: 100%;
    text-decoration: none;
}

@media (min-width: 38rem) {
    .server-feature-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .channel-share-grid {
        grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 1.2fr);
        align-items: stretch;
    }

    .channel-unavailable-card .secondary-button {
        justify-self: start;
        width: auto;
        min-width: 13rem;
    }
}

@media (min-width: 48rem) {
    .server-shell {
        padding-top: 1.25rem;
    }

    .channel-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.42fr);
    }

    .player-panel-header.premium-player-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .live-control-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 34rem) {
    .server-topbar {
        border-radius: 1.35rem;
    }

    .topbar-actions .topbar-action {
        display: none;
    }

    .brand-text {
        max-width: 12.5rem;
    }

    .premium-hero h1 {
        font-size: clamp(2.25rem, 12vw, 3.2rem);
    }

    }

.channel-meta-list,
.live-session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.25rem;
    color: var(--muted);
}

.channel-meta-list div {
    display: grid;
    gap: 0.18rem;
    min-width: min(100%, 11rem);
}

.channel-meta-list span,
.live-session-meta > span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 720;
}

.channel-meta-list strong {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 760;
}

.language-inline-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.55rem;
    padding: 0.45rem 0;
    border: 0;
    border-bottom: 1px solid rgba(114, 87, 232, 0.32);
    border-radius: 0;
    background: transparent;
    color: var(--plum-700);
    cursor: pointer;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 760;
}

.language-inline-button:hover,
.language-inline-button:focus-visible {
    color: var(--plum-950);
    border-bottom-color: rgba(114, 87, 232, 0.68);
}


/* Marketing-page visual alignment pass: warm paper, plum ink, violet accents, soft cards. */
:root {
    --ink: #171321;
    --ink-2: #2a2238;
    --muted: #6d6478;
    --muted-2: #8c829d;
    --paper: #fffdfb;
    --paper-soft: #fbf8ff;
    --surface: #ffffff;
    --surface-2: #f7f2ff;
    --line: #e8e0f2;
    --line-strong: #d8cbea;
    --plum-950: #23142f;
    --plum-900: #321e4b;
    --plum-800: #432769;
    --plum-700: #5a38a1;
    --violet: #7257e8;
    --violet-soft: #ede8ff;
    --lavender: #f4efff;
    --success: #307457;
    --danger: #b74747;
    --primary: #7257e8;
    --primary-strong: #23142f;
    --primary-soft: #ede8ff;
    --primary-soft-strong: #f4efff;
    --background: #fffdfb;
    --surface-alt: #fbf8ff;
    --surface-muted: #f4efff;
    --stroke: #e8e0f2;
    --stroke-strong: #d8cbea;
    --text: #171321;
    --text-secondary: #6d6478;
    --text-muted: #8c829d;
--radius-card: 32px;
    --radius-control: 16px;
}

body {
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% -10%, rgba(114, 87, 232, 0.13), transparent 32rem),
        radial-gradient(circle at 92% 6%, rgba(67, 39, 105, 0.08), transparent 30rem),
        linear-gradient(180deg, #fffdfb 0%, #fbf8ff 45%, #fffdfb 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.shell.server-shell {
    width: min(100% - 2rem, 64rem);
    max-width: none;
    padding: clamp(1rem, 2.5vw, 1.75rem) 0 calc(2rem + var(--safe-bottom));
}

.shell.server-shell::before {
    content: "";
    position: fixed;
    right: -13rem;
    bottom: -18rem;
    z-index: -1;
    width: 42rem;
    height: 42rem;
    border-radius: 999px;
    background: rgba(114, 87, 232, 0.07);
    filter: blur(10px);
    pointer-events: none;
}

.server-topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 30;
    min-height: 70px;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.95rem;
    border: 1px solid rgba(232, 224, 242, 0.72);
    border-radius: 22px;
    background: rgba(255, 253, 251, 0.82);
    backdrop-filter: blur(18px);
}

.brand {
    gap: 0.72rem;
    color: var(--ink);
    font-weight: 760;
    letter-spacing: -0.035em;
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 15px;
}

.brand-text {
    color: var(--ink);
    font-size: 1.08rem;
}

.topbar-action,
.text-link {
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-weight: 650;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.topbar-action:hover,
.text-link:hover,
.topbar-action:focus-visible,
.text-link:focus-visible {
    color: var(--ink);
    background: rgba(244, 239, 255, 0.72);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.panel {
    border: 1px solid rgba(232, 224, 242, 0.86);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
}

.hero.premium-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(1.55rem, 5vw, 2.8rem);
    border-radius: 34px;
    background:
        radial-gradient(circle at 15% 0%, rgba(114, 87, 232, 0.14), transparent 18rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 242, 255, 0.78));
}

.hero.premium-hero::after {
    content: "";
    position: absolute;
    inset: auto -8rem -17rem auto;
    width: 30rem;
    height: 30rem;
    border-radius: 999px;
    background: rgba(114, 87, 232, 0.075);
    pointer-events: none;
}

.hero.premium-hero > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

h1 {
    max-width: 820px;
    margin-bottom: 0.9rem;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 790;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: clamp(1.7rem, 4.5vw, 2.7rem);
    font-weight: 780;
}

h3 {
    margin-bottom: 0.55rem;
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 760;
}

.hero-subtitle,
.muted,
.input-support,
.qr-inline-url,
.connection-state-text {
    color: var(--muted);
}

.server-feature-grid {
    gap: 0.9rem;
    margin-top: 1.7rem;
}

.server-feature-card {
    padding: 1.05rem;
    border: 1px solid rgba(232, 224, 242, 0.86);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
}

.server-feature-card span {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--plum-700);
    font-size: 0.78rem;
    font-weight: 820;
}

.server-feature-card strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 760;
}

.server-feature-card p {
    margin: 0.28rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.join-card,
.channel-join-card,
.live-player-card,
.premium-transcript-panel,
.channel-unavailable-card {
    padding: clamp(1.2rem, 4vw, 1.65rem);
    border-radius: 28px;
}

.form-panel-header,
.panel-heading,
.transcript-panel-header {
    margin-bottom: 1rem;
}

.form-panel-header h2,
.transcript-panel-header h2 {
    margin-bottom: 0.35rem;
}

label {
    color: var(--ink-2);
    font-weight: 760;
}

.channel-input,
select,
input[type="text"],
textarea,
.transcript-textbox,
.ask-guide-textarea {
    border-color: var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    caret-color: var(--violet);
}

.channel-input {
    min-height: 3.55rem;
    font-size: 1.15rem;
    font-weight: 760;
    letter-spacing: 0.12em;
}

.channel-input:focus,
select:focus,
input[type="text"]:focus,
textarea:focus,
.transcript-textbox:focus,
.ask-guide-textarea:focus {
    border-color: rgba(114, 87, 232, 0.48);
    background: #fff;
}

.primary-button,
.secondary-button {
    min-height: 3.35rem;
    border-radius: 999px;
    font-weight: 740;
    letter-spacing: -0.015em;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
    color: #fff;
    background: var(--plum-950);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--plum-900);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.alert,
.banner,
.choice,
.audio-meter-card,
.connection-state-card,
.qr-inline-card,
.transcript-line {
    border-radius: 18px;
}

.choice {
    min-height: 3.45rem;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    font-weight: 740;
}

.choice:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.choice:has(input[type="radio"]:checked) {
    border-color: rgba(114, 87, 232, 0.42);
    background: rgba(237, 232, 255, 0.74);
    color: var(--plum-800);
}

.choice input[type="radio"] {
    accent-color: var(--violet);
}

.channel-code-lockup,
.audio-meter-card,
.connection-state-card,
.qr-inline-card,
.transcript-line,
.language-intro-card {
    border: 1px solid rgba(232, 224, 242, 0.86);
    background: rgba(255, 255, 255, 0.76);
}

.channel-meta-list div {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.66);
}

.premium-qr-card {
    padding: 1.15rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(114, 87, 232, 0.1), transparent 12rem),
        rgba(255, 255, 255, 0.78);
}

.qr-inline-image,
.qr-mini-button,
.qr-modal-image {
    border-color: var(--line);
    border-radius: 18px;
    background: #fff;
}

.qr-mini-button {
    border: 1px solid var(--line);
}

.live-session-meta {
    gap: 0.75rem;
}

.language-inline-button {
    min-height: 2.4rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(244, 239, 255, 0.66);
    color: var(--plum-700);
}

.language-inline-button:hover,
.language-inline-button:focus-visible {
    color: var(--plum-950);
    border-color: rgba(114, 87, 232, 0.42);
    background: #fff;
}

.live-control-row {
    gap: 0.75rem;
}

.audio-meter-track {
    height: 0.68rem;
    border-color: var(--line);
    background: var(--lavender);
}

.audio-meter-fill {
    background: linear-gradient(90deg, var(--success) 0%, #70ad83 42%, #d5a647 74%, var(--danger) 100%);
}

.transcript-textbox {
    min-height: min(45svh, 24rem);
    border-radius: 20px;
    background:
        radial-gradient(circle at 8% 0%, rgba(114, 87, 232, 0.08), transparent 14rem),
        rgba(255, 255, 255, 0.78);
    color: var(--ink-2);
}

.qr-modal-backdrop {
    background: rgba(23, 19, 33, 0.68);
    backdrop-filter: blur(8px);
}

.qr-modal-card,
.language-modal-card,
.ask-guide-modal-card {
    border: 1px solid var(--line);
    border-radius: clamp(1.45rem, 5vw, 1.9rem);
    background: rgba(255,255,255,.96);
}

.ask-guide-sheet-handle {
    background: var(--line-strong);
}

.ask-guide-close-button {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--plum-700);
}

@media (min-width: 48rem) {
    .join-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.72fr);
        gap: 1rem;
        align-items: start;
    }

    .join-shell .server-topbar {
        grid-column: 1 / -1;
    }

    .channel-shell {
        width: min(100% - 2rem, 72rem);
    }

    .channel-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.42fr);
    }

    .channel-share-grid {
        grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.3fr);
    }

    .live-control-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 34rem) {
    .shell.server-shell {
        width: min(100% - 1rem, 64rem);
    }

    .server-topbar {
        top: 0.5rem;
        border-radius: 18px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .brand-text {
        max-width: 13rem;
    }

    .premium-hero h1 {
        font-size: clamp(2.25rem, 12vw, 3.35rem);
    }

    }


/* Final passenger page cleanup */
.server-topbar {
    position: relative;
    top: auto;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0.45rem 0 0.65rem !important;
    margin-bottom: 0.45rem !important;
    border-radius: 0 !important;
}

.server-topbar::before,
.server-topbar::after {
    content: none !important;
    display: none !important;
}

.server-topbar .brand .brand-logo,
.brand-logo {
    width: 49px;
    height: 49px;
    max-width: 49px;
    max-height: 49px;
    object-fit: contain;
    flex: 0 0 49px;
}

.channel-code-lockup {
    display: none !important;
}

.panel.hero.channel-hero.premium-hero {
    padding: clamp(0.95rem, 3.5vw, 1.6rem) !important;
    margin-bottom: 0.7rem !important;
    border-radius: clamp(1.35rem, 4vw, 2rem) !important;
}

.panel.hero.channel-hero.premium-hero h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.85rem, 8vw, 2.55rem);
}

.panel.hero.channel-hero.premium-hero .hero-subtitle {
    font-size: clamp(0.94rem, 2.5vw, 1.04rem);
    line-height: 1.48;
}

.channel-hero-grid {
    gap: 0.5rem !important;
}

.channel-meta-list {
    margin-top: 0.75rem !important;
}

.live-session-meta {
    margin-top: 0.35rem !important;
}

.live-session-meta > span {
    display: none !important;
}



/* Homepage redesign with premium three-column phrase wall */
body.tour-homepage {
    background: #ffffff !important;
}

body.tour-homepage .tour-home-shell {
    position: relative;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    justify-content: center;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.tour-phrase-wall {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 30rem) minmax(0, 1fr);
    column-gap: clamp(1.5rem, 4vw, 5rem);
    width: 100%;
    min-height: 100%;
    padding: clamp(2rem, 3.5vw, 3rem) clamp(2rem, 4vw, 4rem);
    opacity: 0.9;
    pointer-events: none;
    user-select: none;
}

.tour-phrase-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    height: 100%;
}

.phrase-column-left {
    align-items: flex-start;
}

.phrase-column-center {
    align-items: center;
    text-align: center;
}

.phrase-column-right {
    align-items: flex-end;
    text-align: right;
}

.tour-phrase-safe-gap {
    flex: 0 0 clamp(20rem, 42vh, 28rem);
    width: 100%;
}

.tour-phrase {
    display: block;
    max-width: 100%;
    color: rgba(67, 39, 105, 0.20);
    font-size: clamp(0.82rem, 0.74rem + 0.22vw, 1.02rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.tour-phrase.tone-14 { color: rgba(67, 39, 105, 0.14); }
.tour-phrase.tone-16 { color: rgba(67, 39, 105, 0.16); }
.tour-phrase.tone-18 { color: rgba(67, 39, 105, 0.18); }
.tour-phrase.tone-20 { color: rgba(67, 39, 105, 0.20); }
.tour-phrase.tone-22 { color: rgba(67, 39, 105, 0.22); }
.tour-phrase.tone-24 { color: rgba(67, 39, 105, 0.24); }
.tour-phrase.tone-28 { color: rgba(67, 39, 105, 0.28); }
.tour-phrase.tone-32 { color: rgba(67, 39, 105, 0.32); }
.tour-phrase.tone-34 { color: rgba(67, 39, 105, 0.34); }
.tour-phrase.tone-38 { color: rgba(67, 39, 105, 0.38); }
.tour-phrase.tone-44 { color: rgba(67, 39, 105, 0.44); }
.tour-phrase.tone-48 { color: rgba(67, 39, 105, 0.48); }
.tour-phrase.tone-52 { color: rgba(67, 39, 105, 0.52); }
.tour-phrase.tone-58 { color: rgba(67, 39, 105, 0.58); }
.tour-phrase.tone-62 { color: rgba(67, 39, 105, 0.62); }

body.tour-homepage .tour-home-layout {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: clamp(2rem, 5vw, 3.5rem);
    padding-bottom: 2rem;
}

.tour-home-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.tour-home-brand .brand-text {
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 760;
}

.tour-home-card {
    width: min(100% - 2rem, 27rem);
    margin-bottom: 0;
    background: rgba(255,255,255,.90) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 80rem) {
    .tour-phrase-wall {
        grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem) minmax(0, 1fr);
        column-gap: clamp(1rem, 2.4vw, 2rem);
    }

    .tour-phrase {
        font-size: clamp(0.76rem, 0.7rem + 0.2vw, 0.92rem);
    }
}

@media (max-width: 56rem) {
    body.tour-homepage .tour-home-shell {
        padding: 0;
    }

    body.tour-homepage .tour-home-layout {
        padding-top: 1.5rem;
    }

    .tour-home-card {
        width: min(100% - 1rem, 28rem);
    }

    .tour-phrase-wall {
        grid-template-columns: 1fr 1fr;
        column-gap: 1rem;
        padding: 1.5rem 1rem 2rem;
    }

    .phrase-column-center {
        display: none;
    }

    .phrase-column-left,
    .phrase-column-right {
        align-items: flex-start;
        text-align: left;
    }

    .tour-phrase {
        font-size: 0.78rem;
    }
}

/* Channel page targeted patch: remove hero, source language meta, protected change-channel flow. */
.channel-shell .topbar-actions .topbar-action {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.channel-shell .live-session-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.45rem !important;
}

.live-session-source-language {
    display: inline-grid;
    gap: 0.12rem;
    min-height: 2.4rem;
    padding: 0.38rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    line-height: 1.1;
}

.live-session-source-language span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 720;
}

.live-session-source-language strong {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 780;
}

.channel-shell .language-inline-button {
    min-height: 2.4rem;
    padding: 0.38rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(244, 239, 255, 0.66);
    color: var(--plum-700);
}

.channel-shell .language-inline-button:hover,
.channel-shell .language-inline-button:focus-visible {
    border-color: rgba(114, 87, 232, 0.42);
    background: #fff;
    color: var(--plum-950);
}

.channel-shell #manualReconnectButton.hidden {
    display: none !important;
}

.change-channel-modal .qr-modal-card,
.change-channel-modal-card {
    display: grid;
    gap: 1rem;
    max-width: 30rem;
    padding: clamp(1.15rem, 4vw, 1.45rem);
}

.change-channel-modal-copy {
    display: grid;
    gap: 0.35rem;
}

.change-channel-modal-actions {
    gap: 0.75rem;
}

.change-channel-modal-actions .primary-button,
.change-channel-modal-actions .secondary-button {
    text-decoration: none;
}

@media (min-width: 38rem) {
    .change-channel-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 48rem) {
    .channel-shell .live-control-row {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)) !important;
    }

    .change-channel-modal {
        align-items: center;
        padding: 1rem;
    }

    .change-channel-modal-card {
        border-radius: clamp(1.45rem, 5vw, 1.9rem);
    }
}

@media (max-width: 34rem) {
    .channel-shell .topbar-actions .topbar-action {
        display: inline-flex !important;
        min-height: 38px;
        padding: 0.45rem 0.65rem;
        font-size: 0.82rem;
    }

    .channel-shell .brand-text {
        max-width: 9.5rem;
    }

    .channel-shell .live-session-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .live-session-source-language,
    .channel-shell .language-inline-button {
        justify-content: center;
        width: 100%;
    }
}

/* Mobile-first world-tour refresh for Index + Channel pages. */
body.tour-world-page {
    min-width: 320px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% -8%, rgba(114, 87, 232, 0.18), transparent 18rem),
        radial-gradient(circle at 104% 12%, rgba(67, 39, 105, 0.13), transparent 16rem),
        linear-gradient(180deg, #fbf8ff 0%, #fffdfb 52%, #ffffff 100%) !important;
}

body.tour-world-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(67, 39, 105, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 39, 105, 0.035) 1px, transparent 1px);
    background-size: 4.5rem 4.5rem;
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.68), transparent 72%);
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.68), transparent 72%);
}

body.tour-homepage .tour-home-shell,
.channel-page .channel-shell {
    position: relative;
    isolation: isolate;
}

body.tour-homepage .tour-home-shell {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100svh;
    margin: 0;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem calc(1.5rem + var(--safe-bottom));
    overflow: hidden;
}

.tour-phrase-wall {
    display: none !important;
}

.tour-world-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.tour-world-globe {
    position: absolute;
    top: -5.8rem;
    right: -7.2rem;
    width: clamp(15rem, 62vw, 24rem);
    aspect-ratio: 1;
    border: 1px solid rgba(114, 87, 232, 0.16);
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 34%, rgba(255,255,255,0.86) 0 16%, transparent 17%),
        repeating-linear-gradient(90deg, rgba(114,87,232,0.10) 0 1px, transparent 1px 2.25rem),
        repeating-linear-gradient(0deg, rgba(114,87,232,0.08) 0 1px, transparent 1px 2.25rem),
        linear-gradient(135deg, rgba(237,232,255,0.94), rgba(255,255,255,0.42));
    opacity: 0.74;
}

.tour-world-globe::after {
    content: "";
    position: absolute;
    inset: 17%;
    border: 1px dashed rgba(67, 39, 105, 0.16);
    border-radius: 50%;
}

.tour-route-line {
    position: absolute;
    top: 7.3rem;
    left: -3rem;
    width: min(30rem, 92vw);
    height: 9rem;
    border-top: 2px dashed rgba(114, 87, 232, 0.22);
    border-radius: 50%;
    transform: rotate(-9deg);
}

.tour-place {
    position: absolute;
    display: none;
    color: rgba(50, 30, 75, 0.30);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.tour-place::before {
    content: "";
    display: inline-block;
    width: 0.38rem;
    height: 0.38rem;
    margin-right: 0.3rem;
    border-radius: 50%;
    background: rgba(114, 87, 232, 0.45);
    vertical-align: 0.05rem;
}

body.tour-homepage .tour-home-layout {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: min(100%, 31rem);
    max-width: 31rem;
    min-height: calc(100svh - 2.5rem);
    margin: 0 auto;
    padding: 0;
}

.tour-home-brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.7rem;
    margin: 0 0 1rem;
    color: var(--ink);
    text-decoration: none;
}

.tour-home-brand .brand-logo,
.channel-page .brand-logo {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
    flex: 0 0 44px;
}

.tour-home-brand .brand-text,
.channel-page .brand-text {
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 850;
    letter-spacing: -0.025em;
}

.tour-home-hero {
    width: 100%;
    margin: 0 0 0.9rem;
}

.tour-home-kicker,
.channel-context-kicker {
    margin: 0 0 0.4rem;
    color: var(--plum-700);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tour-home-hero h1,
.channel-context-block h1 {
    margin: 0 0 0.7rem;
    color: var(--plum-950);
    font-size: clamp(2.25rem, 12vw, 3.85rem);
    font-weight: 920;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.tour-home-subtitle {
    max-width: 34rem;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 3.4vw, 1.14rem);
    line-height: 1.48;
}

.tour-home-card,
.channel-language-card,
.channel-status-card,
.channel-live-card,
.premium-transcript-panel {
    border: 1px solid rgba(216, 203, 234, 0.82) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tour-home-card {
    width: 100%;
    margin: 0;
    padding: clamp(1rem, 4.5vw, 1.35rem);
    border-radius: 1.7rem !important;
}

.form-panel-header h2,
.language-intro-card h2,
.premium-player-header h2,
.transcript-panel-header h2 {
    color: var(--plum-950);
    letter-spacing: -0.045em;
}

.input-support {
    margin: -0.3rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.channel-input,
select,
input[type="text"] {
    min-height: 3.45rem;
    border-radius: 1.05rem;
    font-size: 1rem;
}

.primary-button,
.secondary-button,
.channel-shell .topbar-actions .topbar-action,
.language-inline-button,
.qr-mini-button,
.choice {
    min-height: 44px;
}

.channel-page .channel-shell {
    width: min(100%, 64rem) !important;
    max-width: 64rem !important;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 0.75rem calc(1.25rem + var(--safe-bottom));
}

.channel-page .server-topbar {
    position: sticky !important;
    top: max(0.5rem, env(safe-area-inset-top, 0px)) !important;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin: 0 0 0.8rem !important;
    padding: 0.55rem 0.55rem !important;
    border: 1px solid rgba(216, 203, 234, 0.84) !important;
    border-radius: 1.35rem !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

.channel-page .server-topbar .brand {
    min-width: 0;
    gap: 0.55rem;
}

.channel-page .brand-text {
    max-width: 10.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-shell .topbar-actions .topbar-action {
    padding: 0.56rem 0.78rem;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--plum-900);
    font-size: 0.88rem;
    font-weight: 850;
}

.channel-status-card,
.channel-language-card,
.channel-live-card,
.premium-transcript-panel {
    margin-bottom: 0.85rem;
    padding: clamp(1rem, 4vw, 1.35rem);
    border-radius: 1.7rem !important;
}

.channel-context-block {
    display: grid;
    gap: 0.2rem;
}

.channel-context-block .muted strong {
    color: var(--plum-900);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.channel-share-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.language-intro-card,
.qr-inline-card,
.audio-meter-card,
.connection-state-card {
    border-color: rgba(216, 203, 234, 0.86) !important;
    background:
        linear-gradient(135deg, rgba(244, 239, 255, 0.72), rgba(255,255,255,0.86)) !important;
}

.language-intro-card {
    padding: 1rem;
    border: 1px solid rgba(216, 203, 234, 0.86);
    border-radius: 1.25rem;
}

.language-intro-card h2 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.28rem, 5vw, 1.65rem);
}

.premium-qr-card {
    padding: 0.85rem;
}

.qr-inline-image {
    width: min(8rem, 46vw);
    height: min(8rem, 46vw);
    border-radius: 1rem;
}

.choice-scroll-list {
    max-height: min(42svh, 24rem);
    padding-right: 0.15rem;
}

.choice {
    min-height: 3.25rem;
    border-radius: 1.05rem;
    background: rgba(255, 255, 255, 0.82);
}

.choice:hover {
    transform: none;
}

.choice:has(input[type="radio"]:checked) {
    background: rgba(237, 232, 255, 0.96);
}

.player-panel-header.premium-player-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
}

.channel-live-copy {
    min-width: 0;
}

.channel-live-copy h2 {
    margin-bottom: 0.45rem;
}

.qr-mini-button {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1rem;
}

.channel-shell .live-session-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: stretch;
}

.live-session-source-language,
.channel-shell .language-inline-button {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    border-radius: 1rem;
    justify-content: center;
    text-align: center;
}

.channel-shell .language-inline-button {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    line-height: 1.15;
}

.channel-shell .language-inline-button #languageValue {
    font-weight: 900;
}

.connection-state-card {
    margin: 0.9rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(216, 203, 234, 0.86);
    border-radius: 1.05rem;
}

.live-control-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.audio-meter-card {
    margin-top: 0.8rem;
    border-radius: 1.05rem;
}

.audio-meter-fill {
    background: linear-gradient(90deg, var(--violet), var(--plum-800));
}

.transcript-textbox {
    min-height: min(44svh, 24rem);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
}

.qr-modal {
    padding: 0 0 var(--safe-bottom);
}

.qr-modal-card,
.language-modal-card,
.ask-guide-modal-card,
.change-channel-modal-card {
    border-radius: 1.55rem 1.55rem 0 0 !important;
}

.qr-inline-url,
.qr-modal-text {
    overflow-wrap: anywhere;
}

@media (min-width: 36rem) {
    .tour-place {
        display: inline-flex;
        align-items: center;
    }

    .tour-place-rome { top: 5.9rem; left: 6%; }
    .tour-place-paris { top: 9.6rem; left: 30%; }
    .tour-place-nyc { top: 6.7rem; left: 53%; }
    .tour-place-tokyo { top: 11.6rem; right: 8%; }

    .channel-shell .live-session-meta {
        grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    }
}

@media (min-width: 48rem) {
    body.tour-homepage .tour-home-shell {
        align-items: center;
        padding: 2rem;
    }

    body.tour-homepage .tour-home-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.78fr);
        align-items: center;
        gap: clamp(1.5rem, 5vw, 4rem);
        width: min(100%, 66rem);
        max-width: 66rem;
        min-height: auto;
    }

    .tour-home-brand {
        grid-column: 1 / -1;
        margin-bottom: -0.25rem;
    }

    .tour-home-hero {
        margin: 0;
    }

    .tour-home-card {
        align-self: center;
    }

    .tour-world-globe {
        top: -9rem;
        right: -5rem;
        width: clamp(24rem, 43vw, 38rem);
    }

    .tour-route-line {
        top: 11rem;
        width: min(48rem, 70vw);
    }

    .channel-page .channel-shell {
        padding: 1rem 1rem calc(1.5rem + var(--safe-bottom));
    }

    .channel-share-grid {
        grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
        align-items: stretch;
    }

    .premium-qr-card {
        justify-content: center;
    }

    .live-control-row {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)) !important;
    }

    .qr-modal {
        align-items: center;
        padding: 1rem;
    }

    .qr-modal-card,
    .language-modal-card,
    .ask-guide-modal-card,
    .change-channel-modal-card {
        border-radius: 1.6rem !important;
    }
}

@media (max-width: 23rem) {
    .channel-page .brand-text {
        max-width: 8rem;
    }

    .channel-shell .topbar-actions .topbar-action {
        padding-inline: 0.62rem;
        font-size: 0.8rem;
    }

    .tour-home-hero h1,
    .channel-context-block h1 {
        font-size: 2.1rem;
    }
}

/* --- Premium language selection refinement: quick flags, border-light cards, high-end search --- */
.channel-shell .high-end-language-panel,
.channel-shell .premium-live-channel-card,
.channel-shell .premium-transcript-panel,
.channel-shell .language-modal-card {
    border-color: rgba(232, 224, 242, 0.52);
}

.channel-shell .premium-qr-card,
.channel-shell .premium-language-intro-card,
.channel-shell .connection-state-card,
.channel-shell .audio-meter-card,
.channel-shell .live-session-source-language,
.channel-shell .language-inline-button,
.channel-shell .topbar-action,
.channel-shell .qr-mini-button,
.channel-shell .ask-guide-modal-card,
.channel-shell .change-channel-modal-card {
    border-color: rgba(232, 224, 242, 0.42);
}

.language-intro-eyebrow {
    margin-bottom: 0.55rem;
    color: var(--plum-700);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.language-quick-section,
.language-list-panel {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.language-list-panel {
    padding: 1rem;
    border-radius: 1.45rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 242, 255, 0.58));
    border: 1px solid rgba(232, 224, 242, 0.44);
}

.language-section-header,
.language-list-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.language-section-header.compact,
.language-list-toolbar.compact-toolbar {
    align-items: center;
}

.language-section-title {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -0.03em;
}

.language-section-copy {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.language-search-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: min(100%, 13.5rem);
    padding: 0.25rem 0.3rem 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(244, 239, 255, 0.78);
}

.language-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--plum-700);
    opacity: 0.9;
}

.language-search-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.language-search-input {
    width: 100%;
    min-height: 2.35rem;
    padding: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: normal;
    text-transform: none;
}

.language-search-input::placeholder {
    color: rgba(109, 100, 120, 0.88);
}

.language-search-input:focus {
    border: 0;
    background: transparent;
}

.language-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.quick-language-card {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 1.4rem;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: transform 160ms ease, opacity 160ms ease;
}

.quick-language-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.quick-language-card:hover,
.quick-language-card:focus-visible {
    transform: translateY(-1px);
}

.quick-language-card.is-selected {
}

.quick-language-card.is-selected::after {
}

.quick-language-card.is-disabled {
    opacity: 0.42;
    cursor: default;
}

.quick-language-card-mini {
    border-radius: 1.15rem;
}

.language-flag-svg,
.language-flag-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    object-fit: cover;
}


.premium-language-list {
    max-height: min(52svh, 30rem);
    padding: 0.1rem 0.15rem 0.1rem 0;
}

.language-choice-button,
.language-choice-item {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(232, 224, 242, 0.42);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.82);
    text-align: left;
}

.language-choice-button:hover,
.language-choice-item:hover {
    border-color: rgba(114, 87, 232, 0.28);
    background: rgba(255, 255, 255, 0.96);
}

.language-choice-button.is-selected,
.language-choice-item.is-selected,
.language-choice-item:has(input[type="radio"]:checked) {
    border-color: rgba(114, 87, 232, 0.78);
    background: linear-gradient(135deg, rgba(114, 87, 232, 0.10), rgba(255, 255, 255, 0.98));
}

.language-choice-button.is-hidden-by-search,
.language-choice-item.is-hidden-by-search {
    display: none;
}

.language-choice-flag {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: 3.25rem;
    min-width: 3.25rem;
    border-radius: 0.95rem;
    overflow: hidden;
}

.language-choice-content,
.language-choice-text {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    flex: 1 1 auto;
}

.language-choice-name {
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 820;
}

.language-choice-meta {
    color: var(--muted-2);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.language-choice-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    margin-left: auto;
    border-radius: 999px;
    background: rgba(114, 87, 232, 0.1);
    color: var(--plum-700);
    opacity: 0;
    transform: scale(0.8);
    transition: transform 160ms ease, opacity 160ms ease;
}

.language-choice-button.is-selected .language-choice-check,
.language-choice-item.is-selected .language-choice-check,
.language-choice-item:has(input[type="radio"]:checked) .language-choice-check {
    opacity: 1;
    transform: scale(1);
}

.language-choice-check svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.language-choice-button:focus-visible,
.quick-language-card:focus-visible,
.language-choice-item:focus-within,
.language-search-shell:focus-within {
    outline: 0.1875rem solid rgba(114, 87, 232, 0.26);
    outline-offset: 0.12rem;
}

.channel-shell .language-inline-button,
.channel-shell .live-session-source-language {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(232, 224, 242, 0.44);
}

.channel-shell .premium-player-header,
.channel-shell .player-panel-header {
    margin-bottom: 1.1rem;
}

.channel-shell .audio-meter-card,
.channel-shell .connection-state-card,
.channel-shell .transcript-textbox {
    border-color: rgba(232, 224, 242, 0.4);
}

.channel-shell .transcript-textbox {
    background: rgba(255, 255, 255, 0.72);
}

.language-list-panel-modal {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.language-choice-list {
    min-height: 0;
    max-height: min(38svh, 23rem);
    padding-right: 0.2rem;
}

.language-modal-quick-section {
    gap: 0.75rem;
}

.language-modal-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.language-modal-card .language-modal-actions {
    margin-top: 0.35rem;
}

.language-modal-card .language-choice-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 34rem) {
    .language-quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .language-modal-quick-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 33.99rem) {
    .language-modal-quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* Homepage route refinement: line starts from the left edge and passes through Rome, Paris, then New York */
.tour-route-line {
    position: absolute;
    top: 6.15rem;
    left: -1.25rem;
    width: min(34rem, 104vw);
    height: 10.25rem;
    transform: none;
    border: 0;
    border-radius: 0;
}

.tour-route-line svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tour-route-stroke {
    fill: none;
    stroke: rgba(114, 87, 232, 0.26);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8 11;
}

.tour-route-stop {
    fill: #7257e8;
    stroke: rgba(255, 255, 255, 0.94);
    stroke-width: 4;
}

@media (min-width: 36rem) {
    .tour-place-rome { top: 5.6rem; left: 12%; }
    .tour-place-paris { top: 3.35rem; left: 30%; }
    .tour-place-nyc { top: 6.45rem; left: 50.5%; }
    .tour-place-tokyo { top: 10.8rem; right: 8%; }
}

@media (min-width: 48rem) {
    .tour-route-line {
        top: 8.4rem;
        left: -2rem;
        width: min(54rem, 76vw);
        height: 13rem;
    }

    .tour-place-rome { top: 7.65rem; left: 12%; }
    .tour-place-paris { top: 5.2rem; left: 31%; }
    .tour-place-nyc { top: 8.6rem; left: 51%; }
}

/* Homepage route alignment fix: the path now spans the viewport and crosses the Rome, Paris, and New York dots. */
.tour-route-line {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 14rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
}

.tour-route-line svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tour-route-stroke {
    fill: none;
    stroke: rgba(114, 87, 232, 0.26);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 7 10;
}

.tour-route-stop {
    display: none;
}

@media (min-width: 36rem) {
    .tour-place-rome { top: 7.35rem !important; left: 12% !important; }
    .tour-place-paris { top: 4.9rem !important; left: 31% !important; }
    .tour-place-nyc { top: 8.25rem !important; left: 51% !important; }
    .tour-place-tokyo { top: 10.8rem !important; right: 8% !important; }
}

@media (min-width: 48rem) {
    .tour-route-line {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 14rem !important;
    }
}


/* Final homepage route polish: labels stay outside the line, dots stay on the path, readability increased. */
.tour-route-line {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 14rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
}

.tour-route-line svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tour-route-stroke {
    fill: none;
    stroke: rgba(114, 87, 232, 0.28);
    stroke-width: 3.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 7 11;
}

.tour-route-stop {
    display: block !important;
    fill: #7257e8;
    stroke: rgba(255, 255, 255, 0.98);
    stroke-width: 3;
}

.tour-place {
    display: inline-flex !important;
    align-items: center;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgba(81, 67, 114, 0.68);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}

.tour-place::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    margin-right: 0.32rem;
    border-radius: 50%;
    background: #7257e8;
}

@media (min-width: 36rem) {
    .tour-place-rome { top: 6.55rem !important; left: 11.4% !important; }
    .tour-place-paris { top: 3.95rem !important; left: 31.0% !important; }
    .tour-place-nyc { top: 7.25rem !important; left: 51.9% !important; }
    .tour-place-tokyo { top: 10.65rem !important; right: 6.8% !important; }
}

@media (min-width: 48rem) {
    .tour-route-line {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 14rem !important;
    }

    .tour-place-rome { top: 6.55rem !important; left: 11.4% !important; }
    .tour-place-paris { top: 3.95rem !important; left: 31.0% !important; }
    .tour-place-nyc { top: 7.25rem !important; left: 51.9% !important; }
}


/* Final label cleanup: remove prefix dots/pills for Rome, Paris, New York and lift labels slightly above the route points. */
.tour-place-rome,
.tour-place-paris,
.tour-place-nyc {
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
}

.tour-place-rome::before,
.tour-place-paris::before,
.tour-place-nyc::before {
    content: none !important;
    display: none !important;
}

@media (min-width: 36rem) {
    .tour-place-rome { top: 6.15rem !important; left: 11.95% !important; }
    .tour-place-paris { top: 3.55rem !important; left: 31.45% !important; }
    .tour-place-nyc { top: 6.85rem !important; left: 52.35% !important; }
}

@media (min-width: 48rem) {
    .tour-place-rome { top: 6.15rem !important; left: 11.95% !important; }
    .tour-place-paris { top: 3.55rem !important; left: 31.45% !important; }
    .tour-place-nyc { top: 6.85rem !important; left: 52.35% !important; }
}


/* Route stop circle fix: render route stops as CSS circles instead of SVG circles so they stay perfectly round. */
.tour-route-stop {
    position: absolute;
    z-index: 0;
    display: block !important;
    width: 0.82rem;
    height: 0.82rem;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: #7257e8;
    border: 3px solid rgba(255, 255, 255, 0.98);
    box-sizing: border-box;
    transform: translate(-50%, -50%);
}

@media (min-width: 36rem) {
    .tour-route-stop-rome { top: 7.18rem !important; left: 12.28% !important; }
    .tour-route-stop-paris { top: 4.58rem !important; left: 31.95% !important; }
    .tour-route-stop-nyc { top: 7.88rem !important; left: 52.95% !important; }
}

@media (min-width: 48rem) {
    .tour-route-stop-rome { top: 7.18rem !important; left: 12.28% !important; }
    .tour-route-stop-paris { top: 4.58rem !important; left: 31.95% !important; }
    .tour-route-stop-nyc { top: 7.88rem !important; left: 52.95% !important; }
}


/* Final route alignment and label cleanup */
.tour-place-rome,
.tour-place-paris,
.tour-place-nyc,
.tour-place-tokyo {
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    white-space: nowrap;
}

.tour-place-rome::before,
.tour-place-paris::before,
.tour-place-nyc::before,
.tour-place-tokyo::before {
    content: none !important;
    display: none !important;
}

.tour-place {
    color: rgba(94, 82, 132, 0.82) !important;
    font-weight: 820 !important;
    line-height: 1 !important;
}

@media (min-width: 36rem) {
    .tour-route-stop-rome { top: 7.64rem !important; left: 12.30% !important; }
    .tour-route-stop-paris { top: 5.24rem !important; left: 31.70% !important; }
    .tour-route-stop-nyc { top: 8.48rem !important; left: 52.30% !important; }

    .tour-place-rome { top: 6.75rem !important; left: 11.95% !important; }
    .tour-place-paris { top: 4.33rem !important; left: 31.30% !important; }
    .tour-place-nyc { top: 7.55rem !important; left: 51.75% !important; }
    .tour-place-tokyo { top: 10.55rem !important; right: 6.55% !important; }
}

@media (min-width: 48rem) {
    .tour-route-stop-rome { top: 7.64rem !important; left: 12.30% !important; }
    .tour-route-stop-paris { top: 5.24rem !important; left: 31.70% !important; }
    .tour-route-stop-nyc { top: 8.48rem !important; left: 52.30% !important; }

    .tour-place-rome { top: 6.75rem !important; left: 11.95% !important; }
    .tour-place-paris { top: 4.33rem !important; left: 31.30% !important; }
    .tour-place-nyc { top: 7.55rem !important; left: 51.75% !important; }
    .tour-place-tokyo { top: 10.55rem !important; right: 6.55% !important; }
}


/* Language selection final layout: compact circular quick flags, title-side QR, no intro card. */
.channel-language-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: clamp(0.8rem, 3vw, 1.25rem);
    margin-bottom: 1rem;
}

.channel-language-heading-row .channel-context-block {
    margin: 0 !important;
}

.language-heading-qr {
    width: clamp(4.75rem, 18vw, 6rem);
    min-width: clamp(4.75rem, 18vw, 6rem);
    padding: 0.42rem !important;
    border-radius: 1.15rem !important;
    background: rgba(255, 255, 255, 0.72) !important;
    align-self: start;
}

.language-heading-qr .qr-inline-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    border-radius: 0.85rem !important;
}

.language-heading-qr .qr-inline-text {
    display: none !important;
}

.language-quick-section {
    gap: 0.65rem !important;
}

.language-quick-section .language-section-header {
    margin-bottom: 0;
}

.language-quick-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: clamp(0.35rem, 1.6vw, 0.65rem) !important;
    align-items: start;
}

.quick-language-card,
.quick-language-card-mini {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.34rem !important;
    min-width: 0 !important;
    padding: 0.15rem 0.05rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    text-align: center !important;
}

.quick-language-card::after,
.quick-language-card-mini::after {
    content: none !important;
    display: none !important;
}

.quick-language-flag {
    display: block;
    width: clamp(2.32rem, 9.6vw, 3.1rem);
    height: clamp(2.32rem, 9.6vw, 3.1rem);
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    transition: transform 160ms ease;
}

.quick-language-flag .language-flag-svg,
.quick-language-flag .language-flag-image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.quick-language-label {
    display: block;
    width: 100%;
    overflow: hidden;
    color: var(--ink-2);
    font-size: clamp(0.58rem, 1.8vw, 0.72rem);
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-language-card:hover,
.quick-language-card:focus-visible {
    transform: none !important;
}

.quick-language-card:hover .quick-language-flag,
.quick-language-card:focus-visible .quick-language-flag {
    transform: translateY(-1px);
}

.quick-language-card.is-selected .quick-language-flag {
}

.quick-language-card.is-disabled .quick-language-flag,
.quick-language-card.is-disabled .quick-language-label {
    opacity: 0.42;
}

.language-modal-quick-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.language-modal-card .quick-language-flag {
    width: clamp(2rem, 8vw, 2.65rem);
    height: clamp(2rem, 8vw, 2.65rem);
}

.language-list-panel {
    margin-top: 0.25rem;
}

.language-choice-flag .language-flag-svg,
.language-choice-flag .language-flag-image {
    width: 100%;
    height: 100%;
}

@media (max-width: 27rem) {
    .language-quick-grid,
    .language-modal-quick-grid {
        gap: 0.28rem !important;
    }

    .quick-language-flag {
        width: 2.05rem;
        height: 2.05rem;
    }

    .quick-language-label {
        font-size: 0.55rem;
    }

    .language-heading-qr {
        width: 4.35rem;
        min-width: 4.35rem;
    }
}

@media (min-width: 44rem) {
    .language-heading-qr {
        width: 6.4rem;
        min-width: 6.4rem;
    }

    .quick-language-flag {
        width: 3.25rem;
        height: 3.25rem;
    }
}
