html,
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(40, 165, 245, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(240, 80, 110, 0.12), transparent 24%),
        linear-gradient(180deg, #f7fbfe 0%, #eef3f7 100%);
}

body {
    color: #1f2933;
}

.tm-navbar-container {
    background: linear-gradient(135deg, #28a5f5, #1e87f0) !important;
    box-shadow: 0 10px 30px rgba(30, 135, 240, 0.18);
}

.uk-logo,
.uk-logo:hover,
.uk-logo:active,
.uk-logo:visited {
    color: #ffffff;
}

.toolbarButton {
    min-height: auto !important;
    padding: 0 12px !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
}

.menuButton {
    min-height: 80px !important;
}

.menuInfoItem {
    white-space: nowrap;
    padding: 5px 0;
    color: #6b7280;
}

.section-shell {
    padding-top: 32px;
    padding-bottom: 32px;
}

.panel-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: #1e87f0;
    font-weight: 700;
}

.room-title {
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-subtitle {
    max-width: 28rem;
}

.qr-shell {
    flex: 0 0 auto;
    width: 160px;
    min-width: 160px;
    min-height: 160px;
    margin-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #eee;
    box-shadow: 4.0px 8.0px 8.0px #ddd;
}

.qr-shell img,
.qr-shell canvas {
    display: block;
    width: 100%;
    height: auto;
}

.stat-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    color: #111827;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.side-card {
    margin-top: 24px;
}

.identity-bar {
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.identity-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#myNameDisplay {
    display: block;
    font-size: 1rem;
    color: #111827;
}

.presence-card {
    min-height: 240px;
}

.presence-list {
    display: grid;
    gap: 12px;
}

.presence-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.presence-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.presence-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(30, 135, 240, 0.08);
}

.presence-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.presence-name-row strong {
    color: #0f172a;
}

.presence-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e87f0;
    background: rgba(30, 135, 240, 0.08);
}

.presence-meta,
.presence-state {
    font-size: 0.84rem;
    color: #64748b;
}

.status-banner {
    border-radius: 14px;
}

.editor-card {
    overflow: hidden;
}

.editor-toolbar {
    gap: 16px;
}

.cursor-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(30, 135, 240, 0.08);
    color: #1e87f0;
    font-weight: 600;
}

.editor-shell {
    position: relative;
}

.editor-stage {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.98));
}

.editor-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 65vh;
    border: 0;
    resize: vertical;
    padding: 24px;
    background: transparent;
    color: #0f172a;
    font: 500 15px/1.65 "Cascadia Code", Consolas, Monaco, monospace;
    caret-color: #1e87f0;
    tab-size: 4;
    position: relative;
    z-index: 1;
}

.editor-input:focus {
    outline: none;
}

.editor-input::selection {
    background: rgba(30, 135, 240, 0.18);
}

.remote-cursor-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.remote-selection-block {
    position: absolute;
    border-radius: 4px;
    opacity: 0.22;
}

.remote-cursor-marker {
    position: absolute;
    width: 2px;
    height: 22px;
}

.remote-cursor-line {
    width: 2px;
    height: 22px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.remote-cursor-label {
    position: absolute;
    left: 0;
    top: -22px;
    transform: translateX(-6px);
    padding: 2px 8px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #64748b;
}

.empty-state-inline {
    padding: 18px;
    text-align: center;
    color: #64748b;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.95));
}

.mirror {
    position: absolute;
    top: 0;
    left: -99999px;
    visibility: hidden;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    pointer-events: none;
}

@media (max-width: 959px) {
    .hero-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .side-card {
        margin-top: 20px;
    }

    .editor-input {
        min-height: 56vh;
    }
}

@media (max-width: 639px) {
    .section-shell {
        padding-top: 18px;
    }

    .panel-card {
        border-radius: 16px;
    }

    .identity-bar,
    .editor-footer,
    .editor-toolbar,
    .presence-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .room-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .qr-shell {
        width: 160px;
        min-width: 160px;
        min-height: 160px;
    }

    .editor-input {
        padding: 18px;
        min-height: 50vh;
    }
}