/* file: public/assets/css/base.css */
:root {
    color-scheme: light;
    --orange: #ff5a16;
    --orange-bright: #ff6a22;
    --orange-soft: #fff0e8;
    --green: #21a55b;
    --yellow: #d99a00;
    --red: #d83b35;
    --background: #e9e9e7;
    --surface: #f5f5f2;
    --surface-strong: #ffffff;
    --text: #191919;
    --text-muted: #656563;
    --border: #cfcfca;
    --border-strong: #a6a6a1;
    --header: rgba(245, 245, 242, 0.94);
    --grid-line: rgba(25, 25, 25, 0.055);
    --shadow: 0 18px 48px rgba(25, 25, 25, 0.08);
    --radius: 4px;
    --content-width: 1440px;
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --orange-soft: #341a0e;
    --background: #0c0d0d;
    --surface: #141515;
    --surface-strong: #1a1b1b;
    --text: #f2f2ef;
    --text-muted: #a4a4a0;
    --border: #323332;
    --border-strong: #555652;
    --header: rgba(13, 14, 14, 0.94);
    --grid-line: rgba(255, 255, 255, 0.035);
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        color-scheme: dark;
        --orange-soft: #341a0e;
        --background: #0c0d0d;
        --surface: #141515;
        --surface-strong: #1a1b1b;
        --text: #f2f2ef;
        --text-muted: #a4a4a0;
        --border: #323332;
        --border-strong: #555652;
        --header: rgba(13, 14, 14, 0.94);
        --grid-line: rgba(255, 255, 255, 0.035);
        --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
    }

    html[data-theme="auto"] .brand {
        border-radius: var(--radius);
        background: #dededb;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background-color: var(--background);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    font-size: 16px;
    line-height: 1.55;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
    text-decoration-color: var(--orange);
    text-underline-offset: 0.2em;
}

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

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

h1,
h2,
h3 {
    line-height: 1.05;
    letter-spacing: -0.035em;
}

h1 {
    font-size: clamp(2.9rem, 7vw, 7.4rem);
    font-weight: 760;
}

h1 span,
h2 span {
    color: var(--orange);
}

h2 {
    font-size: clamp(1.65rem, 3vw, 3rem);
}

h3 {
    font-size: 1.35rem;
}

code,
.panel-code,
.utc-clock,
.local-clock,
.eyebrow,
.status-item,
.card-index,
.state-badge,
.document-icon,
.room-toolbar,
.table-title span {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    color: #fff;
    background: #151515;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--border);
    background: var(--header);
    backdrop-filter: blur(18px);
}

.header-main,
.main-navigation,
.site-main,
.site-footer {
    width: min(100%, var(--content-width));
    margin-inline: auto;
}

.header-main {
    display: grid;
    grid-template-columns: 190px 1fr auto;
    min-height: 62px;
    align-items: center;
    padding-inline: 24px;
}

.brand {
    display: flex;
    width: 146px;
    height: 48px;
    align-items: center;
    overflow: hidden;
}

.brand img {
    display: block;
    width: 100%;
    height: auto;
}

html[data-theme="dark"] .brand {
    border-radius: var(--radius);
    background: #dededb;
}

.header-status,
.header-actions,
.main-navigation {
    display: flex;
    align-items: center;
}

.header-status {
    justify-content: center;
    gap: 22px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.local-clock {
    display: none;
    color: var(--text-muted);
    font-size: 0.72rem;
}

@media (min-width: 1180px) {
    .local-clock { display: inline; }
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.usb-header-status[data-connected="true"] {
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--green) 38%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--green) 8%, transparent);
    color: var(--text);
}

.usb-header-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--green);
}

.usb-header-icon::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 3px;
    width: 10px;
    height: 9px;
    box-sizing: border-box;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.usb-header-icon::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 7px;
    width: 2px;
    height: 6px;
    border-radius: 0 0 2px 2px;
    background: currentColor;
}

.usb-header-icon-contact::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 4px;
    left: 5px;
    width: 2px;
    height: 3px;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 4px 0 0 currentColor;
}

.usb-header-icon[hidden] {
    display: none;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-strong);
}

.header-actions {
    gap: 8px;
}

.icon-button,
.nav-toggle,
.account-link {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover,
.nav-toggle:hover,
.account-link:hover {
    border-color: var(--orange);
}

.nav-toggle {
    display: none;
}

.main-navigation {
    gap: 4px;
    padding: 0 24px 10px;
}

.main-navigation a {
    padding: 7px 11px;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    text-decoration: none;
}

.main-navigation a:hover,
.main-navigation a.is-active {
    border-color: var(--orange);
    color: var(--text);
}

.site-main {
    padding: 34px 24px 96px;
}

.eyebrow {
    margin-bottom: 14px;
    color: var(--orange);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(370px, 0.85fr);
    gap: clamp(36px, 6vw, 96px);
    min-height: 560px;
    align-items: center;
}

.home-hero {
    padding: 24px 0 16px;
}

.home-hero h1 {
    margin: 0;
    font-size: clamp(3.2rem, 6vw, 6rem);
}

.home-hero > p:not(.eyebrow) {
    color: var(--text-muted);
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
}

.home-morse-divider {
    overflow: hidden;
    margin-top: 18px;
    color: var(--orange);
    font-family: monospace;
    font-size: clamp(1rem, 2vw, 1.45rem);
    letter-spacing: 0.2em;
    white-space: nowrap;
}

.home-primary-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 8px 0 18px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    background: var(--surface-strong);
}
.home-primary-action p { margin-bottom: 4px; }

.home-room-section {
    margin: 14px 0 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.home-room-section > header,
.home-journal > header,
.home-morse-flow > header,
.home-morse-flow > footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.home-room-section > header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-room-section > header a,
.home-journal > header > a {
    color: var(--orange);
    font-weight: 700;
}

.home-room {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.3fr) auto;
    gap: 28px;
    align-items: center;
    padding: 24px;
}

.home-room.is-active {
    background: linear-gradient(90deg, rgba(101, 227, 153, 0.055), transparent 38%);
}

.home-room-identity {
    display: flex;
    gap: 14px;
    align-items: center;
}

.home-room-identity > div {
    display: grid;
}

.home-room-identity strong {
    font-size: 1.8rem;
}

.home-room-identity small {
    color: var(--text-muted);
}

.home-room dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.home-room dl div {
    padding: 4px 16px;
    border-left: 1px solid var(--border);
}

.home-room dt,
.morse-sign dt {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-room dd,
.morse-sign dd {
    margin: 3px 0 0;
    font-family: monospace;
}

.home-room-empty {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
}

.home-room-empty p {
    margin: 0;
}

.home-morse-flow {
    overflow: hidden;
    margin-bottom: 18px;
    padding: 16px 18px 12px;
    border: 1px solid #39464a;
    border-radius: 7px;
    color: #dce8e7;
    background: #091012;
}

.home-morse-flow > header {
    color: #91a3a5;
    font-family: monospace;
    font-size: 0.7rem;
}

.home-morse-flow > header strong {
    color: #e5f2f1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-morse-tracks {
    display: grid;
    gap: 7px;
    margin: 14px 0 10px;
}

.home-morse-tracks p {
    width: max-content;
    min-width: 150%;
    margin: 0;
    color: #ff6a22;
    font-family: monospace;
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    white-space: nowrap;
    animation: home-morse-scroll 24s linear infinite;
}

.home-morse-tracks p + p {
    color: #687779;
    animation-duration: 31s;
    animation-direction: reverse;
}

.home-morse-flow > footer {
    border-top: 1px solid #293538;
    padding-top: 8px;
    color: #73f0ee;
    font-family: monospace;
    font-size: 0.62rem;
}

@keyframes home-morse-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-32%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-morse-tracks p {
        animation: none;
    }
}

.home-content-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0 72px;
}

.home-content-row > * {
    padding: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.home-content-row > :only-child {
    grid-column: 1 / -1;
}

.morse-sign > div {
    display: flex;
    gap: 26px;
    align-items: baseline;
}

.morse-sign > div > strong {
    color: var(--orange);
    font-size: 3.7rem;
    line-height: 1;
}

.morse-sign > div > span {
    font-family: monospace;
    font-size: 1.8rem;
    letter-spacing: 0.15em;
}

.morse-sign h2 {
    margin: 18px 0 8px;
    font-size: 1.35rem;
}

.morse-sign > p:not(.eyebrow) {
    color: var(--text-muted);
}

.morse-sign dl {
    display: flex;
    gap: 32px;
    margin: 18px 0 0;
}

.morse-demonstrator {
    display: grid !important;
    gap: 12px !important;
    align-items: stretch !important;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.morse-demonstrator > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.morse-demonstrator label {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.morse-demonstrator select {
    min-height: 42px;
}

.morse-demonstrator > p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.morse-demonstrator-track {
    display: flex !important;
    gap: 8px !important;
    min-height: 24px;
    align-items: center !important;
}

.morse-demonstrator-track span {
    width: 10px;
    height: 8px;
    border-radius: 999px;
    background: var(--border-strong);
    transition: background 120ms ease, box-shadow 120ms ease;
}

.morse-demonstrator-track span.is-dash {
    width: 30px;
}

.morse-demonstrator-track span.is-active {
    background: var(--orange);
    box-shadow: 0 0 12px rgba(255, 92, 31, 0.55);
}

.morse-knowledge {
    display: grid;
    align-content: start;
}

.morse-knowledge h2 {
    margin: 18px 0 8px;
    font-size: 1.55rem;
}

.morse-knowledge > p:not(.eyebrow) {
    color: var(--text-muted);
}

.morse-knowledge dl {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.morse-knowledge dt {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.morse-knowledge dd {
    margin: 3px 0 0;
}

.morse-knowledge > a {
    align-self: end;
    color: var(--orange);
    font-weight: 700;
}

.realtime-status {
    display: grid;
    align-content: start;
}

.home-content-row > .realtime-status {
    grid-column: 1 / -1;
}

.contact-page {
    display: grid;
    grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1fr);
    gap: 64px;
    margin: 56px 0 96px;
    padding: clamp(24px, 4vw, 56px);
    border: 1px solid var(--border);
    background: var(--surface);
}

.contact-form {
    display: grid;
    gap: 18px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.contact-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.contact-form label span small,
.contact-privacy {
    color: var(--text-muted);
    font-weight: 400;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
}

.contact-form textarea {
    resize: vertical;
}

.contact-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}

.field-error {
    color: var(--danger);
    font-weight: 600;
}

.contact-privacy {
    margin: 0;
    font-size: 0.82rem;
}

.realtime-status strong {
    font-size: 1.7rem;
}

.realtime-status span,
.realtime-status time {
    margin-top: 8px;
    color: var(--text-muted);
    font-family: monospace;
}

.home-journal {
    margin: 72px 0;
}

.home-journal > header {
    align-items: end;
    margin-bottom: 22px;
}

.home-journal h2 {
    margin: 0;
}

.home-journal-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid var(--border);
}

.home-journal-list article {
    display: grid;
    grid-template-columns: minmax(100px, 0.48fr) 1fr;
    gap: 16px;
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
}

.home-journal-list article:last-child {
    border-right: 0;
}

.home-journal-list img {
    width: 100%;
    height: 104px;
    object-fit: cover;
}

.home-journal-list time,
.journal-index time {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.68rem;
}

.home-journal-list h3 {
    margin: 5px 0 8px;
    font-size: 1rem;
    line-height: 1.25;
}

.home-journal-list p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.82rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.home-journal-empty {
    padding: 24px;
    border-block: 1px solid var(--border);
    color: var(--text-muted);
}

.home-development {
    display: grid;
    grid-template-columns: minmax(220px, 0.5fr) 1fr auto;
    gap: 32px;
    align-items: center;
    padding: 26px;
    border-left: 4px solid var(--orange);
    background: var(--surface);
}

.home-development h2,
.home-development p {
    margin: 0;
}

.home-development > p {
    color: var(--text-muted);
}

.firmware-heading {
    margin-bottom: 20px;
}

.firmware-stable-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 20px;
    padding: 24px;
    border: 2px solid var(--orange);
    background: var(--surface-strong);
}
.firmware-stable-card h2, .firmware-stable-card p:last-child { margin-bottom: 0; }
.firmware-stable-card.is-empty { border-color: var(--border); }

.release-admin-bar,
.downloads-heading,
.firmware-install-future,
.release-categories {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: center;
}

.release-admin-bar {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.download-admin-bar {
    border-left: 4px solid #36b6bf;
}

.download-catalog-mark {
    display: grid;
    min-width: 170px;
    text-align: right;
}

.download-catalog-mark strong {
    color: var(--orange);
    font-family: monospace;
    font-size: 3.5rem;
}

.download-catalog-mark span {
    color: var(--text-muted);
    font-family: monospace;
    text-transform: uppercase;
}

.release-section {
    margin: 48px 0;
}

.release-section .section-heading {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
}

.release-list {
    display: grid;
    gap: 14px;
}

.release-item {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    background: var(--surface);
}

.download-list .release-item {
    border-left-color: #36b6bf;
    box-shadow: inset 0 1px rgba(54, 182, 191, 0.08);
}

.release-item.is-outdated {
    border-left-color: var(--border-strong);
    opacity: 0.86;
}

.release-item > header,
.release-item > footer,
.release-version,
.release-badges,
.release-admin-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.release-item h2 {
    margin: 5px 0 0;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.release-kind {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.state-badge.channel-stable {
    border-color: #47b879;
    color: #32945f;
    background: rgba(71, 184, 121, 0.08);
}

.state-badge.channel-beta {
    border-color: #d89836;
    color: #b9791a;
    background: rgba(216, 152, 54, 0.09);
}

.release-version {
    justify-content: flex-start;
    margin-top: 16px;
    color: var(--text-muted);
    font-family: monospace;
}

.release-summary {
    max-width: 850px;
    color: var(--text-muted);
}

.release-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 22px 0;
    border-block: 1px solid var(--border);
}

.release-facts div {
    padding: 13px 16px;
    border-right: 1px solid var(--border);
}

.release-facts div:last-child {
    border-right: 0;
}

.release-facts dt {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.release-facts dd {
    margin: 4px 0 0;
    font-family: monospace;
}

.release-compatibility {
    padding: 12px 14px;
    border-left: 3px solid var(--border-strong);
    background: var(--surface-strong);
}

.release-changes {
    margin: 18px 0;
    border-block: 1px solid var(--border);
}

.release-changes summary,
.release-archive > details > summary {
    padding: 14px 0;
    font-weight: 700;
    cursor: pointer;
}

.release-changes div {
    max-width: 900px;
    padding: 0 0 18px;
    color: var(--text-muted);
    line-height: 1.65;
}

.release-admin-links {
    justify-content: flex-end;
}

.danger-link {
    color: #c34c42;
}

.release-empty {
    padding: 28px;
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
}

.release-archive {
    margin: 50px 0;
    border-top: 1px solid var(--border);
}

.release-archive > details > .release-list,
.release-archive > details > .release-empty {
    margin-top: 12px;
}

.firmware-install-future {
    margin: 70px 0;
    padding: 28px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--orange);
    background: var(--surface);
}

.firmware-install-future h2,
.firmware-install-future p {
    margin-bottom: 8px;
}

.firmware-install-future p:last-child {
    max-width: 820px;
    color: var(--text-muted);
}

.release-categories {
    align-items: start;
    margin: 70px 0 0;
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--border);
    background: var(--surface);
}

.release-categories > * {
    flex: 1;
}

.category-list {
    display: grid;
    gap: 8px;
}

.category-list details {
    border: 1px solid var(--border);
}

.category-list summary {
    padding: 10px;
    font-family: monospace;
    font-size: 0.78rem;
    cursor: pointer;
}

.category-edit-form {
    padding: 14px;
    border-top: 1px solid var(--border);
}

.release-management-page {
    margin-top: 28px;
}

.release-existing-file {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
}

.delete-confirmation {
    max-width: 820px;
    margin: 50px auto;
    padding: clamp(24px, 5vw, 54px);
    border: 1px solid #b84c42;
    background: var(--surface);
}

.button-danger {
    border-color: #b84c42;
    color: #fff;
    background: #a43d35;
}

.button-danger:hover {
    background: #bd4b41;
}

.journal-index {
    border-top: 1px solid var(--border);
}

.journal-index article {
    display: grid;
    grid-template-columns: minmax(180px, 0.28fr) 1fr;
    gap: 30px;
    padding: 26px 0;
    border-bottom: 1px solid var(--border);
}

.journal-index img {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
}

.journal-index h2 {
    margin: 7px 0 10px;
}

.journal-index p {
    color: var(--text-muted);
}

.journal-entry {
    max-width: 980px;
    margin: 30px auto;
}

.journal-entry header {
    margin: 42px 0;
}

.journal-entry header > p:last-child {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.journal-entry > img {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
}

.journal-entry-body {
    max-width: 760px;
    margin: 42px 0;
    font-size: 1.05rem;
    line-height: 1.75;
}

.admin-content-heading {
    margin: 10px 0 24px;
}

.admin-content-heading h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 4rem);
}

.section-heading-unified,
.page-heading.compact,
.rooms-heading,
.admin-content-heading,
.user-admin-hero,
.account-dashboard-hero {
    margin: 10px 0 24px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: none;
}
.section-heading-unified h1,
.page-heading.compact h1,
.rooms-heading h1,
.admin-content-heading h1,
.user-admin-hero h1,
.account-dashboard-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(2.35rem, 4vw, 4rem);
    line-height: 1;
}
.section-heading-unified p:last-child,
.page-heading.compact > p:last-child { margin-bottom: 0; }

.admin-navigation {
    display: flex;
    gap: 8px;
    margin: -18px 0 24px;
    padding: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-navigation a {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 750;
    text-decoration: none;
}

.admin-navigation a:hover {
    border-color: var(--border);
    color: var(--text);
}

.admin-navigation a.is-active {
    border-color: var(--orange);
    color: var(--text);
    background: var(--orange-soft);
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.admin-metrics article {
    display: grid;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-metrics span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-metrics strong {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.admin-settings,
.admin-journal {
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-settings {
    display: grid;
    grid-template-columns: minmax(220px, 0.4fr) 1fr;
    gap: 42px;
    margin-bottom: 20px;
}

.admin-journal {
    display: grid;
    grid-template-columns: minmax(260px, 0.65fr) minmax(420px, 1.35fr);
    gap: 42px;
}

.admin-journal-list article {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.admin-journal-list article div {
    display: grid;
}

.admin-journal-list small {
    color: var(--text-muted);
}

.admin-entry-photo {
    width: min(320px, 100%);
    max-height: 220px;
    object-fit: cover;
}

.hero-copy h1 {
    max-width: 850px;
    margin-bottom: 24px;
}

.lead,
.page-heading > p:last-child {
    max-width: 760px;
    color: var(--text-muted);
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-weight: 680;
    text-decoration: none;
}

.button-primary {
    border-color: var(--orange);
    color: #111;
    background: var(--orange);
}

.button-primary:hover {
    border-color: var(--orange-bright);
    background: var(--orange-bright);
}

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

.button-secondary:hover {
    border-color: var(--orange);
}

.button-disabled {
    border-color: var(--border);
    color: var(--text-muted);
    background: var(--surface);
    cursor: not-allowed;
}

.system-panel,
.release-card,
.empty-device,
.room-preview,
.account-status,
.warning-panel,
.legal-notice {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.system-panel {
    overflow: hidden;
}

.panel-heading,
.table-title,
.room-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-grid {
    margin: 0;
}

.status-grid div,
.technical-row {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 20px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
}

.status-grid dt,
.technical-row span,
.release-card dt {
    color: var(--text-muted);
}

.status-grid dd,
.release-card dd {
    margin: 0;
    font-weight: 680;
}

.value-pending {
    color: var(--orange);
}

.signal-line {
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--surface-strong);
}

.signal-line span {
    display: block;
    width: 5px;
    height: 12px;
    background: var(--orange);
}

.signal-line span:nth-child(2),
.signal-line span:nth-child(5),
.signal-line span:nth-child(8) {
    height: 32px;
}

.signal-line span:nth-child(3),
.signal-line span:nth-child(6) {
    width: 34px;
    height: 2px;
    background: var(--border-strong);
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 24px 0 100px;
    border-block: 1px solid var(--border);
}

.metric-strip div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    border-right: 1px solid var(--border);
}

.metric-strip div:last-child {
    border-right: 0;
}

.metric-strip strong {
    color: var(--orange);
    font-size: 1.25rem;
}

.metric-strip span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.content-section {
    margin: 100px 0;
}

.content-section.narrow {
    max-width: 960px;
}

.section-heading {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 0.65fr);
    gap: 40px;
    margin-bottom: 34px;
    align-items: end;
}

.section-heading h2 {
    margin-bottom: 0;
}

.section-heading > p {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.feature-grid,
.document-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.feature-card,
.document-grid article {
    min-height: 260px;
    padding: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.feature-card {
    display: flex;
    flex-direction: column;
}

.feature-card p,
.document-grid p {
    color: var(--text-muted);
}

.feature-card a {
    margin-top: auto;
    font-weight: 680;
}

.card-index {
    margin-bottom: 54px;
    color: var(--orange);
}

.callout {
    display: grid;
    grid-template-columns: 1fr 0.8fr auto;
    gap: 42px;
    align-items: center;
    padding: 34px;
    border-left: 4px solid var(--orange);
    background: var(--surface);
}

.callout h2,
.callout p {
    margin-bottom: 0;
}

.callout > p {
    color: var(--text-muted);
}

.text-link {
    color: var(--orange);
    font-weight: 700;
}

.page-heading {
    max-width: 1100px;
    margin: 48px 0 84px;
}

.page-heading.compact h1 {
    font-size: clamp(2.8rem, 6vw, 6rem);
}

.data-list {
    border-top: 1px solid var(--border);
}

.data-list article {
    display: grid;
    grid-template-columns: 70px minmax(230px, 0.6fr) 1fr;
    gap: 30px;
    padding: 30px 12px;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.data-list article > span {
    color: var(--orange);
    font-family: monospace;
}

.data-list h2,
.data-list p {
    margin: 0;
}

.data-list p {
    color: var(--text-muted);
}

.technical-layout {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 0.38fr);
    gap: 18px;
    align-items: start;
}

.technical-table {
    border: 1px solid var(--border);
    background: var(--surface);
}

.table-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0;
}

.technical-row:last-child {
    border-bottom: 0;
}

.warning-panel {
    padding: 26px;
    border-top: 4px solid var(--orange);
}

.warning-panel p:not(.eyebrow) {
    color: var(--text-muted);
}

.state-badge {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid var(--orange);
    color: var(--orange);
    background: var(--orange-soft);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.state-badge.neutral {
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: transparent;
}

.protocol-section {
    display: grid;
    grid-template-columns: 0.4fr 1fr;
    gap: 48px;
    margin-top: 100px;
}

.protocol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--border);
}

.protocol-grid div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.protocol-grid code {
    color: var(--orange);
}

.protocol-grid span {
    color: var(--text-muted);
}

.release-card {
    display: grid;
    grid-template-columns: 160px 1fr minmax(260px, 0.5fr) auto;
    gap: 28px;
    align-items: center;
    padding: 26px;
}

.release-meta {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.release-card h2 {
    margin-bottom: 8px;
    font-size: 1.45rem;
}

.release-card p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.release-card dl {
    margin: 0;
}

.release-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 0;
    font-size: 0.8rem;
}

.check-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.check-list li::before {
    margin-right: 10px;
    color: var(--orange);
    content: "■";
}

.document-grid article > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 50px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.document-icon {
    color: var(--orange);
}

.empty-device {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 34px;
    align-items: center;
    padding: 34px;
}

.simulator-panel {
    margin-top: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.simulator-panel[hidden] {
    display: none;
}

.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 0.72fr;
}

.simulator-grid > * + * {
    border-left: 1px solid var(--border);
}

.simulator-diagnostics {
    padding: 24px;
}

.simulator-diagnostics ul {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.simulator-diagnostics li::marker {
    color: var(--orange);
}

.simulator-note {
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.device-status-page {
    display: grid;
    gap: 18px;
}

.device-connect-panel,
.device-status-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.device-connect-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 24px;
}

.device-connect-panel h2,
.device-status-card h2 {
    margin: 4px 0 12px;
}

.device-connect-panel p {
    margin-bottom: 0;
}

.device-status-actions {
    justify-content: flex-end;
}

.device-privacy-note {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.device-status-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.device-status-card {
    padding: 22px;
}

.device-value-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin: 0;
}

.device-value-grid > div {
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.device-value-grid dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.device-value-grid dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    font-family: monospace;
    font-weight: 700;
}

.device-value-grid .device-value-wide {
    grid-column: 1 / -1;
}

.device-card-note,
.device-capability-card > p {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.device-diagnostic-list {
    display: grid;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.device-diagnostic-list li {
    display: grid;
    grid-template-columns: 72px 84px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-left: 2px solid var(--orange);
    background: var(--surface-muted);
    font-family: monospace;
    font-size: 0.76rem;
}

.device-diagnostic-list strong {
    overflow-wrap: anywhere;
}

.device-capability-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.device-capability-list li::before {
    margin-right: 8px;
    color: var(--green);
    content: "●";
}

.device-status-page[data-connected="true"] .device-status-overview {
    border-top: 3px solid var(--green);
}

.device-configuration-panel {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--orange);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.device-configuration-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.device-configuration-heading h2 {
    margin: 4px 0 8px;
}

.device-configuration-heading p {
    margin: 0;
}

.device-configuration-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.device-configuration-fields label {
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.device-configuration-fields input,
.device-configuration-fields select {
    width: 100%;
}

.device-configuration-confirm {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 700;
}

.device-configuration-message {
    padding: 12px;
    border-left: 2px solid var(--orange);
    background: var(--surface-muted);
}

.device-self-test {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.device-self-test-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.device-self-test-heading h2 {
    margin: 4px 0 8px;
}

.device-self-test-heading p {
    margin-bottom: 0;
}

.device-self-test-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.device-self-test-list li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-width: 0;
    padding: 11px 12px;
    border-left: 3px solid var(--border-strong);
    background: var(--surface-strong);
}

.device-self-test-list li[data-result="pending"] {
    border-left-color: var(--yellow);
    background: color-mix(in srgb, var(--yellow) 8%, var(--surface-strong));
}

.device-self-test-list li[data-result="passed"] {
    border-left-color: var(--green);
    background: color-mix(in srgb, var(--green) 8%, var(--surface-strong));
}

.device-self-test-list li[data-result="failed"] {
    border-left-color: var(--red);
    background: color-mix(in srgb, var(--red) 8%, var(--surface-strong));
}

.device-self-test-list strong {
    flex: 0 0 auto;
    font-family: monospace;
    font-size: 0.72rem;
}

.device-self-test-list label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.device-self-test-manual > span {
    flex: 1 1 auto;
}

.device-self-test-observation {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
}

.device-self-test-observation button {
    min-width: 44px;
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.device-self-test-observation button[aria-pressed="true"][data-result="passed"] {
    border-color: var(--green);
    background: color-mix(in srgb, var(--green) 18%, var(--surface));
}

.device-self-test-observation button[aria-pressed="true"][data-result="failed"] {
    border-color: var(--red);
    background: color-mix(in srgb, var(--red) 18%, var(--surface));
}

.device-self-test-summary {
    margin: 18px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--border-strong);
    background: var(--surface-strong);
}

.device-self-test-summary[data-result="passed"] {
    border-left-color: var(--green);
    background: color-mix(in srgb, var(--green) 8%, var(--surface-strong));
}

.device-self-test-summary[data-result="failed"] {
    border-left-color: var(--red);
    background: color-mix(in srgb, var(--red) 8%, var(--surface-strong));
}

.device-self-test-summary[data-result="pending"] {
    border-left-color: var(--yellow);
    background: color-mix(in srgb, var(--yellow) 8%, var(--surface-strong));
}

.device-update-guide {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.device-update-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.device-update-heading h2 {
    margin: 4px 0 8px;
}

.device-update-heading p {
    margin-bottom: 0;
}

.device-update-facts {
    display: grid;
    grid-template-columns: 0.7fr 0.5fr 0.7fr 2fr;
    gap: 1px;
    margin: 22px 0;
    background: var(--border);
}

.device-update-facts div {
    min-width: 0;
    padding: 12px;
    background: var(--surface-strong);
}

.device-update-facts dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.device-update-facts dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-family: monospace;
    font-weight: 700;
}

.device-update-current {
    padding: 11px 12px;
    border-left: 3px solid var(--orange);
    background: var(--surface-strong);
}

.device-update-steps {
    display: grid;
    gap: 8px;
    margin: 20px 0;
    padding-left: 24px;
}

.device-update-steps li::marker {
    color: var(--orange);
    font-family: monospace;
    font-weight: 700;
}

.browser-update-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.browser-update-progress li {
    padding: 8px 6px;
    border-top: 3px solid var(--border-strong);
    color: var(--text-muted);
    text-align: center;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 700;
}

.browser-update-progress li[data-state="active"] {
    border-top-color: var(--yellow);
    color: var(--text);
    background: color-mix(in srgb, var(--yellow) 8%, transparent);
}

.browser-update-progress li[data-state="complete"] {
    border-top-color: var(--green);
    color: var(--green);
    background: color-mix(in srgb, var(--green) 8%, transparent);
}

.browser-update-progress li[data-state="error"] {
    border-top-color: var(--red);
    color: var(--red);
    background: color-mix(in srgb, var(--red) 8%, transparent);
}

.browser-update-panel {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.browser-update-confirm {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 700;
}

.browser-update-confirm input {
    margin-top: 0.2rem;
}

.browser-update-message {
    margin: 0.8rem 0;
    padding: 0.75rem 0.9rem;
    border-left: 3px solid var(--orange);
    background: var(--surface-strong);
}

.browser-update-message[data-state="error"] {
    border-left-color: #c8372d;
}

.browser-update-message[data-state="success"] {
    border-left-color: #228b52;
}

.lab-safety {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-left: 4px solid var(--orange);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.lab-safety strong {
    color: var(--orange);
}

.lab-console {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.lab-toolbar,
.lab-endpoint {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.lab-toolbar > div:first-child {
    display: flex;
    gap: 10px;
    align-items: center;
}

.lab-endpoint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.lab-endpoint code {
    color: var(--orange);
}

.status-pending {
    background: #d98b15;
}

.status-active {
    background: #268d58;
}

.status-error {
    background: #d33d2c;
}

.lab-metrics {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border-bottom: 1px solid var(--border);
}

.lab-metrics div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: 16px;
    border-right: 1px solid var(--border);
}

.lab-metrics div:last-child {
    border-right: 0;
}

.lab-metrics span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-metrics strong {
    font-family: monospace;
    font-size: 1.05rem;
}

.lab-details {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
}

.lab-details > div {
    min-height: 320px;
    padding: 24px;
}

.lab-details > div + div {
    border-left: 1px solid var(--border);
}

.lab-details h2 {
    font-size: 1.2rem;
}

.lab-details ol {
    max-height: 270px;
    margin: 0;
    padding-left: 24px;
    overflow: auto;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.76rem;
}

.lab-details ol li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.usb-symbol {
    display: grid;
    width: 120px;
    height: 120px;
    place-items: center;
    border: 1px solid var(--orange);
    color: var(--orange);
    font-family: monospace;
    font-size: 1.6rem;
}

.empty-device p,
.empty-device li {
    color: var(--text-muted);
}

.room-preview {
    overflow: hidden;
}

.rooms-heading {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: end;
    margin: 22px 0 24px;
}

.rooms-heading h1 {
    margin: 4px 0 0;
    font-size: clamp(2.35rem, 5vw, 4.8rem);
}

.rooms-heading .eyebrow {
    margin-bottom: 0;
}

.rooms-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
    align-items: center;
}

.rooms-summary > span {
    padding: 8px 11px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
    font-family: monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.rooms-summary > span strong {
    color: var(--text);
}

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

.radio-room-card {
    overflow: hidden;
    border: 1px solid #39464a;
    border-radius: 8px;
    color: #e7f5f4;
    background: #0a1012;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.radio-room-card-closed {
    filter: saturate(0.42);
    opacity: 0.76;
}

.radio-room-bar,
.radio-room-display,
.radio-room-state,
.radio-room-actions {
    display: flex;
    align-items: center;
}

.radio-room-bar {
    justify-content: space-between;
    gap: 18px;
    min-height: 43px;
    padding: 10px 14px;
    border-bottom: 1px solid #293538;
    background: linear-gradient(180deg, #1b2427, #11191b);
    font-family: monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.radio-room-bar > div {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.radio-room-model {
    color: #57d7e5;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.radio-room-state {
    gap: 8px;
    color: #a7b7b8;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-light {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #738083;
    box-shadow: 0 0 0 2px rgba(115, 128, 131, 0.12);
}

.status-light-occupied {
    background: #65e399;
    box-shadow: 0 0 0 2px rgba(101, 227, 153, 0.12), 0 0 10px rgba(101, 227, 153, 0.5);
    animation: room-status-pulse 3.6s ease-in-out infinite;
}

.status-light-idle {
    background: #879496;
}

.status-light-closed {
    background: #5c6567;
}

@keyframes room-status-pulse {
    0%,
    100% {
        opacity: 0.72;
        transform: scale(0.92);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-light-occupied {
        animation: none;
    }
}

.radio-room-display {
    justify-content: space-between;
    gap: 20px;
    min-height: 128px;
    padding: 20px;
    background:
        radial-gradient(circle at 78% 50%, rgba(20, 66, 72, 0.68), transparent 34%),
        #071012;
}

.radio-room-title {
    min-width: 0;
}

.radio-room-title h2 {
    overflow: hidden;
    margin: 0;
    color: #f1fbfa;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-room-title p {
    display: -webkit-box;
    max-width: 58ch;
    margin: 10px 0 0;
    overflow: hidden;
    color: #9ba9aa;
    font-size: 0.83rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.radio-room-count {
    display: grid;
    min-width: 104px;
    text-align: right;
}

.radio-room-count strong {
    color: #73f0ee;
    font-family: monospace;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1;
    text-shadow: 0 0 18px rgba(73, 236, 232, 0.3);
}

.radio-room-count small {
    color: #86a4a6;
    font-size: 0.45em;
}

.radio-room-count span {
    margin-top: 7px;
    color: #708789;
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.radio-room-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid #293538;
}

.radio-room-metrics div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid #293538;
    border-bottom: 1px solid #293538;
}

.radio-room-metrics div:nth-child(3n) {
    border-right: 0;
}

.radio-room-metrics dt {
    color: #708789;
    font-family: monospace;
    font-size: 0.57rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.radio-room-metrics dd {
    overflow: hidden;
    margin: 4px 0 0;
    color: #d7e4e4;
    font-family: monospace;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-room-metrics .radio-room-participants {
    grid-column: 1 / -1;
    border-right: 0;
}

.radio-room-actions {
    gap: 14px;
    min-height: 62px;
    padding: 11px 14px 14px;
}

.radio-room-actions .button {
    min-height: 40px;
}

.radio-room-manage {
    margin-left: auto;
    color: #9eb1b2;
    font-size: 0.78rem;
}

.radio-room-manage:hover {
    color: #e7f5f4;
}

.radio-room-unavailable {
    color: #899698;
    font-size: 0.78rem;
}

.rooms-empty {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.rooms-empty div {
    margin-right: auto;
}

.rooms-empty h2,
.rooms-empty p {
    margin-bottom: 0;
}

.rooms-empty p {
    color: var(--text-muted);
}

.room-management-page {
    display: grid;
    grid-template-columns: minmax(240px, 0.55fr) minmax(420px, 1.25fr);
    gap: clamp(32px, 7vw, 100px);
    align-items: start;
    margin-top: 42px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--border);
    background: var(--surface);
}

.room-management-page h1 {
    margin: 8px 0 16px;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
}

.room-management-page header > p:last-child {
    color: var(--text-muted);
}

.room-management-form {
    padding-top: 2px;
}

.room-columns {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
}

.room-columns > div {
    min-height: 340px;
    padding: 28px;
}

.room-columns > div + div {
    border-left: 1px solid var(--border);
}

.room-list {
    padding: 0;
    list-style: none;
}

.room-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.room-list span {
    margin-right: 18px;
    color: var(--orange);
    font-family: monospace;
}

.telemetry-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-muted);
}

.telemetry-placeholder > span {
    color: var(--orange);
    font-family: monospace;
}

.telemetry-line {
    height: 2px;
    margin: 24px 0;
    background: repeating-linear-gradient(90deg, var(--orange) 0 30px, transparent 30px 50px, var(--orange) 50px 58px, transparent 58px 90px);
}

.account-shell {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(40px, 8vw, 130px);
    min-height: 560px;
    align-items: center;
}

.register-layout,
.account-overview {
    display: grid;
    grid-template-columns: minmax(300px, 0.75fr) minmax(420px, 1.25fr);
    gap: clamp(40px, 8vw, 130px);
    align-items: start;
}

.register-layout .page-heading {
    position: sticky;
    top: 150px;
    margin-top: 40px;
}

.stack-form {
    display: grid;
    gap: 18px;
}

.stack-form label:not(.checkbox-row) {
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.stack-form input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-strong);
}

.stack-form textarea,
.stack-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    padding: 13px 14px;
}

.stack-form textarea {
    resize: vertical;
}

.stack-form textarea:focus,
.stack-form select:focus {
    border-color: var(--orange);
    outline: 2px solid color-mix(in srgb, var(--orange) 22%, transparent);
}

.room-editor,
.room-login-note {
    margin-top: 28px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--border);
    background: var(--surface);
}

.room-editor {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
    gap: clamp(28px, 5vw, 72px);
}

.room-editor h2 {
    margin: 8px 0 14px;
}

.room-editor > div > p:last-child,
.room-login-note p {
    color: var(--text-muted);
}

.room-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.room-login-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.room-login-note p {
    margin: 0;
}

.room-session-heading {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: end;
    padding: 50px 0 34px;
}

.room-session-heading h1 {
    margin: 8px 0 16px;
    font-size: clamp(3rem, 7vw, 7rem);
}

.room-session-heading p:last-child {
    max-width: 720px;
    color: var(--text-muted);
}

.room-session-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border);
    background: var(--surface);
}

.room-session-summary div {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.room-session-summary div + div {
    border-left: 1px solid var(--border);
}

.room-session-summary span {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.room-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.room-workspace > div {
    min-height: 220px;
    padding: clamp(24px, 4vw, 44px);
}

.room-workspace > div + div {
    border-left: 1px solid var(--border);
}

.room-workspace h2 {
    margin: 8px 0 16px;
}

.room-workspace p:not(.eyebrow) {
    color: var(--text-muted);
}

.realtime-room-test {
    margin: 24px 0 50px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.realtime-room-test > summary {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
    cursor: pointer;
    list-style: none;
}

.realtime-room-test > summary::-webkit-details-marker {
    display: none;
}

.realtime-room-test > summary > span:first-child {
    display: grid;
    gap: 6px;
}

.realtime-room-test > summary small {
    color: var(--text-muted);
    font-weight: 400;
}

.realtime-room-test > summary > span:last-child {
    color: var(--orange);
    font-family: monospace;
    font-size: 1.6rem;
}

.realtime-room-test[open] > summary {
    border-bottom: 1px solid var(--border);
}

.realtime-room-test[open] > summary > span:last-child {
    transform: rotate(45deg);
}

.realtime-room-test-body .lab-safety {
    margin: 18px;
}

.realtime-room-test-body .lab-toolbar,
.realtime-room-test-body .lab-endpoint,
.realtime-room-test-body .lab-details {
    border-top: 1px solid var(--border);
}

.realtime-room-test-body .lab-details > div {
    min-height: 230px;
}

.sdr-room {
    display: grid;
    gap: 18px;
    padding-top: 34px;
}

.sdr-radio {
    overflow: hidden;
    border: 1px solid #39464a;
    border-radius: 8px;
    color: #e7f5f4;
    background: #0a1012;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.sdr-radio-bar,
.sdr-connection,
.sdr-channel-actions,
.sdr-frequency > div,
.sdr-waterfall-scale {
    display: flex;
    align-items: center;
}

.sdr-radio-bar {
    justify-content: space-between;
    gap: 20px;
    padding: 12px 18px;
    border-bottom: 1px solid #293538;
    background: linear-gradient(180deg, #1b2427, #11191b);
}

.sdr-radio-bar > div:first-child {
    display: flex;
    gap: 14px;
    align-items: baseline;
}

.sdr-model {
    color: #57d7e5;
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sdr-radio-bar strong {
    font-size: 0.85rem;
}

.sdr-connection {
    gap: 9px;
    color: #a7b7b8;
    font-family: monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.sdr-radio-display {
    display: grid;
    grid-template-columns: minmax(270px, 0.75fr) minmax(230px, 0.55fr) minmax(360px, 1.25fr);
}

.sdr-radio-display > div {
    min-width: 0;
    padding: 22px;
}

.sdr-radio-display > div + div {
    border-left: 1px solid #293538;
}

.sdr-channel .eyebrow {
    margin-bottom: 8px;
    color: #57d7e5;
}

.sdr-channel h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 3.8rem);
}

.sdr-channel > p:last-of-type {
    color: #9ba9aa;
    font-size: 0.88rem;
}

.sdr-channel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    gap: 9px;
    margin-top: 20px;
}

.sdr-channel-actions .button {
    display: grid;
    min-height: 48px;
    padding: 7px 11px 8px;
    border-color: #536164;
    border-radius: 5px;
    color: #dce7e6;
    background: linear-gradient(180deg, #2a3335 0%, #151c1e 48%, #0e1415 100%);
    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.13),
        inset 0 -2px rgba(0, 0, 0, 0.48),
        0 3px 0 #05090a;
    font-family: monospace;
    line-height: 1.05;
    text-align: left;
    transform: translateY(-1px);
}

.sdr-channel-actions .button strong {
    color: #f4fbfa;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
}

.sdr-channel-actions .button small {
    color: #8ea0a2;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sdr-channel-actions .button:hover:not(:disabled) {
    border-color: #76dce3;
    background: linear-gradient(180deg, #344144, #172225);
    transform: translateY(0);
}

.sdr-channel-actions .button-secondary {
    color: #e7f5f4;
    background: linear-gradient(180deg, #2a3335 0%, #151c1e 48%, #0e1415 100%);
}

.sdr-channel-actions .button-primary {
    border-color: #b75427;
    background: linear-gradient(180deg, #ff7440, #c7491e 52%, #7e2b13);
}

.sdr-channel-actions .button-primary small {
    color: #2c1008;
}

.sdr-room[data-connection-state="active"] [data-room-connect] {
    border-color: #2b805d;
    background: linear-gradient(180deg, #337a5b, #164934 52%, #0c2d20);
}

.sdr-channel-actions button:disabled {
    cursor: not-allowed;
    filter: saturate(0.35);
    opacity: 0.56;
    transform: translateY(0);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.sdr-channel-actions .button-danger {
    border-color: #8b3d38;
    color: #ffd6d1;
    background: #3a1715;
}

.sdr-channel-actions .button-danger:hover:not(:disabled) {
    border-color: #ff675c;
    background: #51201d;
}

.sdr-frequency {
    display: grid;
    align-content: center;
    gap: 12px;
    background: radial-gradient(circle at center, #14343a, #081012 70%);
    text-align: center;
}

.sdr-frequency > span {
    color: #77a5aa;
    font-family: monospace;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sdr-frequency > strong {
    color: #73f0ee;
    font-family: monospace;
    font-size: clamp(2.4rem, 4vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.08em;
    line-height: 1;
    text-shadow: 0 0 22px rgba(73, 236, 232, 0.38);
}

.sdr-frequency > strong small {
    font-size: 0.28em;
    letter-spacing: 0;
}

.sdr-frequency > div {
    justify-content: center;
    gap: 22px;
    color: #98acad;
    font-family: monospace;
    font-size: 0.7rem;
}

.sdr-frequency .sdr-frequency-tuning {
    gap: 6px;
}

.sdr-frequency-tuning button {
    min-width: 42px;
    min-height: 28px;
    padding: 3px 7px;
    border: 1px solid #31565b;
    border-radius: 4px;
    color: #9ff8f5;
    background: #0b1c1f;
    font: 700 0.66rem monospace;
}

.sdr-frequency-tuning button:hover:not(:disabled) {
    border-color: #73f0ee;
    background: #123136;
}

.sdr-frequency-tuning button:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.sdr-frequency .sdr-frequency-meta {
    gap: 22px;
}

.sdr-frequency .sdr-rx-readout {
    min-height: 1.2em;
    color: #ffc857;
    font-family: monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.sdr-frequency .sdr-live-analysis {
    min-height: 1.2em;
    color: #65e399;
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.keyboard-keyer-active .sdr-frequency {
    background:
        radial-gradient(circle at 50% 50%, rgba(101, 227, 153, 0.14), transparent 68%),
        #071012;
    box-shadow: inset 0 0 24px rgba(101, 227, 153, 0.13);
}

.room-frequency-status {
    margin: -3px 0 12px;
    color: #6fbfc5;
    font-size: 0.74rem;
}

.sdr-frequency b {
    color: #e7f5f4;
}

.sdr-waterfall-panel {
    display: grid;
    align-content: center;
    background: #050a0b;
}

.sdr-waterfall-scale {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 30px;
    align-items: start;
    color: #6f898c;
    font-family: monospace;
    font-size: 0.62rem;
}

.sdr-scale-tick {
    text-align: center;
}

.sdr-scale-tick:first-child {
    text-align: left;
}

.sdr-scale-tick:last-of-type {
    text-align: right;
}

.sdr-scale-tick-minor {
    color: #526b6e;
}

.sdr-waterfall-own-marker {
    position: absolute;
    top: 15px;
    z-index: 2;
    transform: translateX(-50%);
    padding: 1px 4px;
    border: 1px solid #cf704b;
    border-radius: 3px;
    color: #ff9b68;
    background: rgba(15, 18, 18, 0.92);
    font-size: 0.56rem;
    line-height: 1.2;
    white-space: nowrap;
}

.sdr-waterfall-own-marker[data-edge="start"] {
    transform: none;
}

.sdr-waterfall-own-marker[data-edge="end"] {
    transform: translateX(-100%);
}

.sdr-waterfall-pointer-marker {
    position: absolute;
    top: 15px;
    z-index: 3;
    transform: translateX(-50%);
    padding: 1px 4px;
    border: 1px solid #619da4;
    border-radius: 3px;
    color: #8fe5ec;
    background: rgba(5, 12, 14, 0.94);
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.sdr-waterfall-pointer-marker[data-edge="start"] {
    transform: none;
}

.sdr-waterfall-pointer-marker[data-edge="end"] {
    transform: translateX(-100%);
}

.sdr-waterfall-canvas-wrap {
    position: relative;
    overflow: hidden;
}

.sdr-waterfall-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 112px;
    margin-top: 2px;
    border: 1px solid #253337;
    background: #020607;
}

.sdr-waterfall-passband {
    position: absolute;
    top: 3px;
    bottom: 1px;
    z-index: 2;
    min-width: 5px;
    transform: translateX(-50%);
    border-right: 1px solid rgba(97, 220, 229, 0.65);
    border-left: 1px solid rgba(97, 220, 229, 0.65);
    background: rgba(79, 211, 222, 0.08);
    box-shadow: 0 0 12px rgba(79, 211, 222, 0.18) inset;
    pointer-events: none;
}

.sdr-waterfall-controls {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.sdr-waterfall-controls button {
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid #30484c;
    border-radius: 3px;
    color: #8fb2b5;
    background: #0b1315;
    font: 700 0.59rem monospace;
    letter-spacing: 0.04em;
}

.sdr-waterfall-controls button:hover,
.sdr-waterfall-controls button.active {
    border-color: #73f0ee;
    color: #c9ffff;
    background: #123136;
}

.hide-waterfall .sdr-waterfall-panel {
    display: none;
}

.hide-waterfall .sdr-radio-display {
    grid-template-columns: minmax(270px, 1fr) minmax(230px, 0.7fr);
}

.sdr-waterfall-panel p {
    margin: 7px 0 0;
    color: #6f898c;
    font-size: 0.68rem;
    text-align: center;
}

.sdr-meter-strip {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border-top: 1px solid #293538;
}

.sdr-latest-activity {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 9px 12px;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border-top: 1px solid var(--sdr-line);
    color: var(--sdr-muted);
    background: color-mix(in srgb, var(--sdr-panel) 92%, #071b20);
    font-family: monospace;
}

.sdr-latest-activity > span {
    color: var(--cyan);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
}

.sdr-latest-activity strong {
    color: var(--participant-color, var(--sdr-text));
    font-size: 0.72rem;
}

.sdr-latest-activity p {
    overflow: hidden;
    margin: 0;
    color: var(--sdr-text);
    font-size: 0.73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sdr-meter-strip div {
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border-right: 1px solid #293538;
}

.sdr-meter-strip div:last-child {
    border-right: 0;
}

.sdr-meter-strip span {
    color: #708789;
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}

.sdr-meter-strip strong {
    overflow: hidden;
    color: #d7e4e4;
    font-family: monospace;
    font-size: 0.75rem;
    text-overflow: ellipsis;
}

.sdr-meter-strip [data-state="active"] {
    color: #65e399;
}

.sdr-meter-strip [data-state="pending"] {
    color: #ffbc57;
}

.room-phase-boundary {
    display: flex;
    gap: 18px;
    padding: 11px 16px;
    border-left: 4px solid var(--orange);
    color: var(--text-muted);
    background: var(--surface);
    font-size: 0.78rem;
}

.room-phase-boundary strong {
    flex: 0 0 auto;
    color: var(--orange);
}

.morse-room-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 18px;
    align-items: start;
}

.morse-room-layout > *,
.room-side-panel,
.room-side-panel > section {
    min-width: 0;
    max-width: 100%;
}

.morse-chat-panel,
.room-side-panel > section {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.morse-chat-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.morse-chat-heading .eyebrow {
    margin-bottom: 7px;
}

.morse-chat-heading h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.8rem);
}

.morse-chat-legend {
    display: flex;
    max-width: 42%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.morse-chat-legend span {
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--participant-color, var(--border)) 60%, var(--border));
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.morse-chat-legend span::before {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--participant-color, var(--border-strong));
    content: "";
}

.morse-message-stream {
    min-height: 360px;
    max-height: 62vh;
    overflow-y: auto;
    background:
        linear-gradient(90deg, transparent 0 49px, var(--grid-line) 49px 50px, transparent 50px),
        var(--surface-strong);
}

.morse-new-messages {
    display: block;
    width: max-content;
    margin: -44px auto 10px;
    padding: 7px 13px;
    position: relative;
    z-index: 2;
    border: 1px solid var(--orange);
    border-radius: 999px;
    color: #fff;
    background: color-mix(in srgb, var(--orange) 88%, #111);
    box-shadow: var(--shadow);
    font-size: 0.76rem;
    font-weight: 700;
}

.morse-new-messages[hidden] {
    display: none;
}

.morse-message {
    --participant-color: var(--orange);
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    border-bottom: 1px solid var(--border);
}

.morse-message > div {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 6px 10px;
    align-content: center;
    padding: 10px 12px 10px 16px;
    border-right: 1px solid var(--border);
}

.morse-color,
.participant-marker {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--participant-color);
    box-shadow: 0 0 9px color-mix(in srgb, var(--participant-color) 55%, transparent);
}

.morse-message strong {
    overflow: hidden;
    color: var(--participant-color);
    font-family: monospace;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.morse-message time {
    grid-column: 2;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.67rem;
}

.morse-input-source {
    grid-column: 2;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.morse-message > p {
    margin: 0;
    padding: 12px 18px;
    align-self: center;
    font-family: monospace;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    overflow-wrap: anywhere;
}

.morse-message > .morse-plain {
    grid-column: 2;
    margin-top: -8px;
    padding-top: 0;
    color: var(--participant-color);
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.morse-message.system-message {
    --participant-color: var(--text-muted);
}

.morse-message.system-message > p {
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: normal;
}

.morse-message.text-message > p {
    color: var(--text);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.5;
    white-space: pre-wrap;
}

.hide-message-time .morse-message time,
.hide-message-name .morse-message strong {
    display: none;
}

.hide-message-plain .morse-message .morse-plain {
    display: none;
}

.hide-own-messages .morse-message.own-message {
    display: none;
}

.morse-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.morse-composer-heading {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
}

.morse-composer-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.morse-composer > label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.morse-composer textarea {
    min-height: 62px;
    padding: 12px 14px;
    resize: vertical;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface-strong);
    font: 0.9rem/1.45 monospace;
}

.morse-composer textarea:focus {
    border-color: var(--orange);
    outline: 2px solid color-mix(in srgb, var(--orange) 24%, transparent);
}

.morse-composer-actions {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-content: end;
}

.morse-composer-actions > span {
    grid-column: 1 / -1;
    max-width: 310px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: right;
}

.composer-mode-switch {
    display: inline-grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.composer-mode-switch button {
    min-height: 30px;
    padding: 4px 9px;
    border: 0;
    color: var(--text-muted);
    background: var(--surface-strong);
    font-family: monospace;
    font-size: 0.7rem;
}

.composer-mode-switch button + button {
    border-left: 1px solid var(--border);
}

.composer-mode-switch button.active {
    color: #fff;
    background: var(--orange);
}

.composer-mode-switch button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.morse-composer-actions .icon-button {
    display: inline-grid;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    place-items: center;
    font-size: 1.25rem;
    line-height: 1;
}

.morse-composer[data-mode="text"] [data-room-send-test] {
    display: none;
}

.room-side-panel {
    display: grid;
    gap: 18px;
}

.room-side-panel > section {
    padding: 20px;
}

.room-side-panel h2 {
    margin: 6px 0 18px;
    font-size: 1.35rem;
}

.room-participant-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.room-participant-list li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.room-participant-list li > div {
    flex: 1 1 auto;
    min-width: 0;
}

.room-participant-list small {
    display: block;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.66rem;
}

.participant-name-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.participant-input-badge {
    appearance: none;
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid color-mix(in srgb, var(--participant-color) 55%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--participant-color) 8%, transparent);
    color: var(--text);
    font-family: monospace;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.participant-input-badge::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    vertical-align: 1px;
}

.participant-input-badge[data-quality="good"]::before {
    background: var(--green);
}

.participant-input-badge[data-quality="fair"]::before {
    background: #c88917;
}

.participant-input-badge[data-quality="practice"]::before {
    background: var(--orange);
}

.participant-input-badge:focus-visible {
    outline: 2px solid var(--participant-color);
    outline-offset: 2px;
}

.participant-input-badge[hidden] {
    display: none;
}

.participant-input-details {
    margin: 7px 0 2px;
    padding: 7px 8px;
    border-left: 2px solid var(--participant-color);
    background: color-mix(in srgb, var(--participant-color) 5%, transparent);
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.64rem;
    line-height: 1.45;
}

.participant-input-details[hidden] {
    display: none;
}

.room-learning-controls {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.room-practice-control {
    display: grid;
    gap: 7px;
}

.room-practice-status {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface-strong);
}

.room-practice-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.room-practice-status strong,
.room-practice-status small {
    display: block;
}

.room-practice-status strong {
    font: 700 0.7rem monospace;
}

.room-practice-status small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.62rem;
    line-height: 1.3;
}

.room-practice-control[data-state="active"] .room-practice-indicator,
.room-practice-control[data-state="saved"] .room-practice-indicator {
    background: var(--green);
    box-shadow: 0 0 8px color-mix(in srgb, var(--green) 55%, transparent);
}

.room-practice-control[data-state="saving"] .room-practice-indicator {
    background: var(--orange);
}

.room-practice-control[data-state="error"] .room-practice-indicator {
    background: var(--red);
}

.room-learning-feedback {
    margin: 0;
    padding: 9px 10px;
    border-left: 3px solid var(--green);
    background: color-mix(in srgb, var(--green) 7%, transparent);
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.4;
}

.room-learning-feedback[hidden] {
    display: none;
}

.computer-marker {
    --participant-color: hsl(48 90% 58%);
    background: var(--participant-color);
}

.room-log-direction {
    margin: -8px 0 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.room-measurement-log {
    max-height: 320px;
    margin: 0;
    padding-left: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.room-measurement-log li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.room-local-settings {
    display: grid;
    gap: 11px;
}

.room-local-settings > label:not(.room-toggle) {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 10px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.room-local-settings select {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface-strong);
}

.room-toggle {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.room-local-settings > p:last-child {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.room-local-settings .room-audio-status {
    margin: -2px 0 4px;
    color: #73d9de;
    font-size: 0.72rem;
}

.room-setting-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 1px;
    color: var(--orange);
    font-family: monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.room-setting-divider::after {
    height: 1px;
    flex: 1;
    background: var(--border);
    content: "";
}

.room-keyer-choice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.room-keyer-choice button {
    min-height: 34px;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    background: var(--surface-strong);
    font: 700 0.68rem monospace;
}

.room-keyer-choice button.active {
    border-color: #36b86d;
    color: #fff;
    background: #237a49;
    box-shadow: 0 0 10px color-mix(in srgb, #36b86d 34%, transparent);
}

.room-keyer-choice button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.room-keyer-status {
    min-height: 2.8em;
    margin: -2px 0 2px;
    color: #36a968;
    font-size: 0.7rem;
    line-height: 1.4;
}

.sdr-waterfall-learning {
    margin: 5px 0 0;
    color: #42c77a;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.35;
}

.sdr-waterfall-learning[hidden] {
    display: none;
}

.practice-hub {
    display: grid;
    grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.practice-lesson-list {
    display: grid;
    max-height: 620px;
    overflow-y: auto;
}

.practice-lesson-list a {
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.practice-lesson-list a[aria-current="page"] {
    border-left: 3px solid var(--orange);
    background: color-mix(in srgb, var(--orange) 7%, transparent);
}

.practice-lesson-list span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.practice-exercise-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.practice-exercise-settings label {
    display: grid;
    gap: 5px;
}

.practice-prompt {
    margin: 24px 0 12px;
    padding: 24px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    font: 800 clamp(3rem, 8vw, 6rem)/1 monospace;
    text-align: center;
}

.practice-exercise-status {
    min-height: 2.8em;
}

.practice-score {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.practice-score div {
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.practice-score dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.practice-score dd {
    margin: 4px 0 0;
    font: 700 1.1rem monospace;
}

.koch-trainer {
    display: grid;
    gap: 24px;
}

.koch-overview,
.koch-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.koch-continue {
    border-left: 4px solid var(--orange);
}

.koch-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.koch-summary dl div {
    padding: 8px 14px;
    border-left: 1px solid var(--border);
}

.koch-summary dl div:first-child {
    padding-left: 0;
    border-left: 0;
}

.koch-summary dt,
.koch-stat-list small {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.koch-summary dd {
    margin: 4px 0 0;
    font: 750 1.45rem/1.1 "SFMono-Regular", Consolas, monospace;
}

.koch-setup {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 16px;
}

.koch-setup > div:first-child,
.koch-mode-grid {
    grid-column: 1 / -1;
}

.koch-choice-block {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.koch-choice-block h3 {
    font-size: 1rem;
}

.koch-segmented,
.koch-lesson-control,
.koch-fine-control {
    display: flex;
    gap: 6px;
}

.koch-segmented {
    flex-wrap: wrap;
}

.koch-segmented button,
.koch-lesson-control button,
.koch-fine-control button,
.koch-stage-bar button {
    min-width: 44px;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-strong);
    font-weight: 750;
    cursor: pointer;
}

.koch-segmented button.is-selected {
    border-color: var(--orange);
    color: #fff;
    background: var(--orange);
}

.koch-lesson-control,
.koch-fine-control {
    align-items: center;
    margin-bottom: 10px;
}

.koch-lesson-control strong,
.koch-fine-control strong {
    min-width: 82px;
    text-align: center;
}

.koch-fine-control {
    margin-top: 8px;
}

.field-help {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.koch-mode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.koch-mode-grid button {
    display: grid;
    min-height: 150px;
    gap: 5px;
    align-content: end;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-strong);
    text-align: left;
    cursor: pointer;
}

.koch-mode-grid button:hover,
.koch-mode-grid button:focus-visible {
    border-color: var(--orange);
}

.koch-mode-grid button > span {
    color: var(--orange);
    font: 700 0.72rem monospace;
}

.koch-mode-grid button strong {
    font-size: 1.05rem;
}

.koch-mode-grid button small {
    color: var(--text-muted);
}

.koch-statistics {
    display: grid;
    gap: 18px;
}

.koch-stat-list {
    display: grid;
    gap: 6px;
}

.koch-stat-list > div {
    display: grid;
    grid-template-columns: minmax(50px, auto) auto;
    gap: 0 12px;
    align-items: baseline;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}

.koch-stat-list > div > span {
    font: 750 1rem monospace;
}

.koch-stat-list > div > strong {
    justify-self: end;
}

.koch-stat-list > div > small {
    grid-column: 1 / -1;
}

.koch-stage {
    min-height: 640px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.koch-stage-bar {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-strong);
}

.koch-stage-bar > div {
    display: flex;
    gap: 12px;
    align-items: center;
}

.koch-stage-bar span {
    color: var(--text-muted);
}

.koch-stage-body {
    display: grid;
    width: min(760px, 100%);
    margin-inline: auto;
    padding: 48px 24px;
    text-align: center;
}

.koch-stage-instruction {
    color: var(--text-muted);
}

.koch-display {
    display: grid;
    min-height: 170px;
    place-items: center;
    margin: 18px 0 8px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    font: 800 clamp(3.6rem, 10vw, 7rem)/1 monospace;
    letter-spacing: 0.08em;
}

.koch-pattern {
    min-height: 32px;
    color: var(--orange);
    font: 750 1.1rem monospace;
}

.koch-copy-answer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 16px 0;
    text-align: left;
}

.koch-copy-answer[hidden] {
    display: none;
}

.koch-copy-answer label {
    grid-column: 1 / -1;
    font-weight: 750;
}

.koch-copy-answer input {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-strong);
    font: 750 1.15rem monospace;
    text-transform: uppercase;
}

.koch-key-area {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: 16px 0;
}

.koch-key-area[hidden] {
    display: none;
}

.koch-touch-key {
    display: grid;
    width: min(100%, 360px);
    min-height: 118px;
    place-content: center;
    border: 3px solid var(--border-strong);
    border-radius: 16px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 8px 0 var(--border-strong);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.koch-touch-key * {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.koch-touch-key span {
    font: 850 1.35rem monospace;
}

.koch-touch-key small {
    color: var(--text-muted);
}

.koch-touch-key.is-pressed {
    border-color: var(--orange);
    background: var(--orange-soft);
    box-shadow: 0 2px 0 var(--orange);
    transform: translateY(6px);
}

.koch-device-panel,
.koch-stage-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
}

.koch-device-panel span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.koch-feedback {
    min-height: 28px;
    margin-top: 14px;
    font-weight: 750;
}

.koch-stage-bar small {
    color: var(--text-muted);
    font: 700 0.68rem "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
}

.koch-legacy-link {
    padding: 18px 0 4px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.koch-legacy-link p {
    margin: 0;
}

@media (max-width: 768px) {
    .practice-hub {
        grid-template-columns: 1fr;
    }
}

.room-device-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.room-device-actions .button {
    min-height: 36px;
    padding: 7px 9px;
}

.room-device-status {
    margin: -2px 0 2px;
    color: #73d9de;
    font-size: 0.7rem;
}

.room-live-cw-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface-strong);
    font: 0.66rem monospace;
}

.room-live-cw-stats > strong {
    grid-column: 1 / -1;
    color: #36a968;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.room-live-cw-stats span {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
    color: var(--text-muted);
}

.room-live-cw-stats b {
    min-width: 0;
    color: var(--text);
    text-align: right;
    overflow-wrap: anywhere;
}

.room-technical-list {
    margin: 0;
}

.room-technical-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.room-technical-list dt {
    color: var(--text-muted);
}

.room-technical-list dd {
    margin: 0;
    font-family: monospace;
    overflow-wrap: anywhere;
    text-align: right;
}

.stack-form input:focus {
    border-color: var(--orange);
    outline: 2px solid color-mix(in srgb, var(--orange) 30%, transparent);
}

.stack-form small {
    color: var(--text-muted);
}

.checkbox-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.checkbox-row input {
    min-height: auto;
    margin-top: 4px;
}

.field-error {
    color: #d33d2c !important;
}

.form-alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--orange);
    background: var(--surface-strong);
}

.form-alert-danger {
    border-left-color: #d33d2c;
}

.form-alert-success {
    border-left-color: #268d58;
}

.form-alert-warning {
    border-left-color: #d98b15;
}

.account-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    font-size: 0.86rem;
}

.form-footnote {
    margin: 22px 0 0;
    color: var(--text-muted);
}

.account-overview {
    min-height: 560px;
    padding-top: 50px;
}

.account-overview h1 {
    font-size: clamp(3rem, 7vw, 7rem);
}

.account-overview > div:first-child p:last-child {
    max-width: 580px;
    color: var(--text-muted);
}

.account-overview .button-row,
.account-overview .logout-form {
    grid-column: 2;
}

.logout-form {
    margin-top: -70px;
    justify-self: end;
}

.account-shell h1 {
    font-size: clamp(3rem, 6vw, 6rem);
}

.account-shell > div:first-child > p:last-child,
.account-status p {
    color: var(--text-muted);
}

.account-status {
    padding: clamp(24px, 4vw, 48px);
}

.account-status h2 {
    margin-top: 28px;
}

.account-dashboard {
    display: grid;
    gap: 24px;
    padding-block: 18px 42px;
}

.account-dashboard-hero,
.account-panel,
.account-destinations,
.account-dashboard-footer {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.account-dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: 22px 24px;
}

.account-dashboard-hero h1 {
    margin: 4px 0 10px;
    font-size: clamp(2.35rem, 4vw, 4rem);
    line-height: 0.88;
}

.account-section-nav { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--border); background: var(--surface); }
.account-section-nav a { padding: 9px 14px; font-weight: 750; text-decoration: none; }
.account-group { border: 1px solid var(--border); background: var(--surface-strong); }
.account-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; cursor: pointer; list-style: none; }
.account-group > summary::-webkit-details-marker { display: none; }
.account-group > summary span { font-size: 1.25rem; font-weight: 780; }
.account-group > summary small { color: var(--text-muted); }
.account-group[open] > summary { border-bottom: 1px solid var(--border); }
.account-group .account-panel, .account-group .account-destinations, .account-group .account-dashboard-footer { border: 0; box-shadow: none; }

.documentation-task-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 42px; }
.documentation-task { display: grid; align-content: start; gap: 10px; min-height: 190px; padding: 22px; border: 1px solid var(--border); background: var(--surface-strong); text-decoration: none; }
.documentation-task:hover { border-color: var(--orange); }
.documentation-task > span { color: var(--orange); font-family: "SFMono-Regular", Consolas, monospace; font-size: .72rem; font-weight: 750; }
.documentation-task > strong { font-size: 1.25rem; }
.documentation-task p { margin: 0; color: var(--text-muted); }
.documentation-reference { margin-top: 32px; }
.room-mobile-toolbar { display: none; }

.account-dashboard-hero p:last-child {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--text-muted);
}

.account-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.account-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 24px;
}

.account-panel,
.account-destinations {
    padding: clamp(24px, 4vw, 46px);
}

.account-panel h2,
.account-destinations h2 {
    margin: 4px 0 24px;
    font-size: clamp(1.8rem, 3vw, 3rem);
}

.account-fact-list,
.account-device-facts {
    display: grid;
    margin: 0;
}

.account-fact-list div,
.account-device-facts div {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.account-fact-list dt,
.account-device-facts dt {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.account-fact-list dd,
.account-device-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-weight: 700;
}

.account-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.account-learning-recommendation,
.account-practice-chart,
.account-practice-sharing,
.account-practice-shared {
    margin-top: 24px;
}

.account-learning-recommendation p {
    padding: 14px 18px;
    border-left: 3px solid var(--orange);
    background: var(--surface);
}

.account-practice-chart svg {
    display: block;
    width: 100%;
    min-height: 180px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.account-practice-chart[hidden] {
    display: none;
}

.practice-chart-axis {
    stroke: var(--border-strong);
    stroke-width: 1;
}

.practice-chart-line {
    fill: none;
    stroke: var(--orange);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-practice-chart text {
    fill: currentColor;
    font-size: 13px;
}

.user-admin-shell {
    display: grid;
    gap: 24px;
    padding-block: 0 42px;
}

.user-admin-hero,
.user-admin-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.user-admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 5vw, 58px);
}

.user-admin-hero h1 {
    margin: 4px 0 12px;
    font-size: clamp(2.8rem, 6vw, 6rem);
    line-height: 0.94;
}

.user-admin-hero p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--text-muted);
}

.user-admin-panel {
    padding: clamp(20px, 3vw, 34px);
}

.user-admin-action label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-admin-action select,
.user-admin-action input {
    min-height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-strong);
    color: var(--text);
}

.user-admin-list { display: grid; gap: 10px; }
.user-admin-card { border: 1px solid var(--border); background: var(--surface); }
.user-admin-card[open] { border-color: var(--border-strong); }
.user-admin-card summary { display: grid; grid-template-columns: minmax(180px, 1.2fr) auto minmax(150px, .8fr) auto; align-items: center; gap: 18px; padding: 18px 20px; cursor: pointer; list-style: none; }
.user-admin-card summary::-webkit-details-marker { display: none; }
.user-admin-card summary:hover { background: var(--surface-strong); }
.user-admin-identity { display: grid; }
.user-admin-identity > span, .user-admin-summary-role { color: var(--text-muted); font-size: .88rem; }
.user-admin-open-label { color: var(--orange); font-weight: 750; }
.user-admin-card-body { padding: 0 20px 22px; border-top: 1px solid var(--border); }
.user-admin-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 20px 0; }
.user-admin-facts dt { color: var(--text-muted); font-size: .72rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.user-admin-facts dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.user-admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.user-admin-actions h2 { margin: 0; font-size: 1.2rem; }
.user-admin-own-account { margin: 0; padding: 16px; background: var(--surface-strong); color: var(--text-muted); }

.user-admin-callsign {
    display: block;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1.05rem;
}

.user-admin-subline {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.user-admin-action {
    display: grid;
    grid-template-columns: minmax(230px, 1fr);
    gap: 10px;
    min-width: 250px;
}

.audit-log { display: grid; gap: 10px; }
.audit-log article { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(190px, auto); align-items: center; gap: 20px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); }
.audit-log article > div:first-child { display: grid; gap: 4px; }
.audit-log article > div:first-child span, .audit-log-meta { color: var(--text-muted); font-size: .85rem; }
.audit-log article > p { margin: 0; font-family: "SFMono-Regular", Consolas, monospace; }
.audit-log-meta { display: grid; gap: 4px; text-align: right; }
.admin-empty-state { padding: 24px; border: 1px solid var(--border); background: var(--surface); }

/* Einheitlicher, kompakter Seitenkopf: absichtlich am Ende der Basisregeln. */
.section-heading-unified,
.page-heading.compact,
.rooms-heading,
.admin-content-heading,
.user-admin-hero,
.account-dashboard-hero {
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 10px 0 24px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: none;
}
.section-heading-unified { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.page-heading.compact.section-heading-unified { display: block; }
.page-heading.compact.downloads-heading { display: flex; }
.page-heading.compact.firmware-page-heading { display: flex; }
.section-heading-unified h1,
.page-heading.compact h1,
.rooms-heading h1,
.user-admin-hero h1,
.account-dashboard-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(2.35rem, 4vw, 4rem);
    line-height: 1;
}

.user-admin-role-action {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.user-admin-role-action small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.account-device-message {
    margin-top: -12px;
    color: var(--text-muted);
}

.account-update-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 16px;
    border: 2px solid #d98b15;
    background: #fff4dc;
    color: #2b1c00;
}

.account-update-alert[hidden] {
    display: none;
}

.account-update-alert[data-level="current"] {
    border-color: #2a9d62;
    background: #e9f8ef;
    color: #123d27;
}

.account-device-panel > .button-row {
    margin-top: 22px;
}

.account-destination-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.account-destination {
    display: grid;
    align-content: start;
    min-height: 190px;
    padding: 22px;
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease;
}

.account-destination:hover,
.account-destination:focus-visible {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.account-destination-code {
    width: max-content;
    margin-bottom: 30px;
    color: var(--orange);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.account-destination strong {
    font-size: 1.2rem;
}

.account-destination span:last-child {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.account-dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
}

.account-dashboard-footer p,
.account-dashboard-footer .logout-form {
    margin: 0;
}

.account-dashboard-footer p {
    color: var(--text-muted);
}

.legal-page,
.not-found {
    max-width: 900px;
    min-height: 500px;
    padding-top: 50px;
}

.legal-page h1,
.not-found h1 {
    font-size: clamp(3rem, 6vw, 6rem);
}

.legal-notice {
    margin-top: 40px;
    padding: 26px;
    border-left: 4px solid var(--orange);
}

.legal-notice p {
    margin: 14px 0 0;
    color: var(--text-muted);
}

.not-found p:not(.eyebrow) {
    color: var(--text-muted);
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    padding: 28px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.site-footer > div {
    display: flex;
    gap: 14px;
}

.site-footer strong {
    color: var(--text);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.phase-note {
    grid-column: 1 / -1;
    margin: 0;
    font-family: monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}
