/* Me — private student workspaces */

.me-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin: 0.7rem 0 0.3rem;
}
.me-optional { font-weight: 500; color: #64748b; }
.me-hint { font-size: 0.875rem; color: #64748b; margin: 0.35rem 0 0.7rem; }
.me-kicker {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #001A72;
    margin: 0 0 0.35rem;
}
.me-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 0.85rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
}
.me-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 2.15rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0.75rem;
    border: 1.5px solid #c7d2fe;
    background: #fff;
    color: #001A72;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
}
.me-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.me-btn-primary {
    background: linear-gradient(135deg, #001A72, #2563eb);
    color: #fff;
    border: 0;
    box-shadow: 0 8px 16px rgba(0, 26, 114, 0.18);
}
.me-btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.me-btn-block { width: 100%; margin-top: 1rem; }
.me-btn-file { position: relative; overflow: hidden; }
.me-link-btn {
    background: none;
    border: 0;
    color: #001A72;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.me-join-card, .me-hub-create, .me-room-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.4rem 1.25rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}
.me-join-card h2, .me-room-card h2 { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 0 0 0.35rem; }
.me-join-card input, .me-join-card select,
.me-hub-create input,
.me-modal .willow-modal-body input,
.me-label-row input,
.me-host-status select {
    width: 100%;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.8rem;
    min-height: 2.7rem;
    padding: 0.45rem 0.75rem;
    font-size: 1rem;
}
.me-join-foot { margin-top: 1rem; }
.me-resume {
    background: #eef2ff;
    border-radius: 0.85rem;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.9rem;
}
.me-resume .me-btn { margin-top: 0.5rem; }

.me-hub-create { margin-bottom: 1.5rem; }
.me-hub-create .me-btn-primary { width: 100%; margin-top: 0.75rem; }
.me-room-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.me-room-card { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.me-room-code { font-weight: 800; letter-spacing: 0.08em; color: #001A72; margin: 0; }
.me-room-meta { color: #64748b; font-size: 0.85rem; margin: 0.2rem 0 0; }
.me-room-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: flex-start; }
.me-empty { color: #64748b; }

.me-room-main { max-width: none; padding: 0 !important; margin: 0; }
.me-shell {
    display: grid;
    grid-template-columns: 1fr minmax(14rem, 17rem);
    grid-template-rows: 1fr;
    height: calc(100vh - 5.25rem);
    min-height: calc(100vh - 5.25rem);
    position: relative;
}
.me-shell.is-chat-collapsed { grid-template-columns: 1fr 0; }
.me-shell-student .me-board-viewport {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    height: 100%;
}
.me-shell-student .me-chat { grid-column: 2; grid-row: 1; }
.me-board-viewport {
    position: relative;
    overflow: auto;
    background:
        linear-gradient(#eef2ff 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, #eef2ff 1px, transparent 1px) 0 0 / 28px 28px,
        #f8fafc;
    min-height: 0;
}
.me-board-wrap {
    position: relative;
    overflow: auto;
    background:
        linear-gradient(#eef2ff 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, #eef2ff 1px, transparent 1px) 0 0 / 28px 28px,
        #f8fafc;
    min-height: 0;
}
.me-board-scaler {
    position: relative;
    display: inline-block;
    min-width: 100%;
    min-height: 100%;
    transform-origin: 0 0;
}
.me-board {
    position: relative;
    min-width: 2800px;
    min-height: 1800px;
}
.me-board-empty {
    position: absolute;
    inset: 2.5rem 1.5rem auto;
    text-align: center;
    color: #64748b;
    pointer-events: none;
    z-index: 0;
}
.me-board-empty.is-hidden { display: none; }

.me-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(0, 26, 114, 0.12);
    border-radius: 1.15rem;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    cursor: grab;
}
.me-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.me-card.is-selected {
    border-color: #001A72;
    box-shadow:
        0 0 0 3px rgba(197, 165, 114, 0.55),
        0 18px 40px rgba(15, 23, 42, 0.16);
}
.me-card.is-link { cursor: grab; }
.me-card-accent {
    height: 7px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #C5A572 0%, #001A72 72%);
}
.me-card-inner {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem 0.95rem 1.35rem;
}
.me-card-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C5A572;
    margin: 0 0 0.3rem;
}
.me-card-title {
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.me-card-body {
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}
.me-card-body [style*="font-size"] { line-height: 1.15; }
.me-card-body p { margin: 0 0 0.4rem; }
.me-card-body p:last-child { margin-bottom: 0; }
.me-card.is-copyable { cursor: default; }
.me-card.is-copyable .me-card-body,
.me-card.is-copyable .me-card-body * {
    user-select: text;
    cursor: text;
}
.me-card.is-copyable .me-resize { cursor: nwse-resize; }
.me-card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.35rem 0;
    font-size: 0.92em;
}
.me-card-body th,
.me-card-body td {
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.5rem;
    text-align: left;
    vertical-align: top;
}
.me-card.is-dragging { cursor: grabbing; z-index: 9999 !important; opacity: 0.96; }
.me-card.is-label .me-card-body { padding-top: 0.15rem; }
.me-label-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88em;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid #dbe4f0;
    background: #fff;
}
.me-label-table th,
.me-label-table td {
    border: 0;
    border-bottom: 1px solid #e8eef6;
    padding: 0.45rem 0.65rem;
    text-align: left;
    vertical-align: top;
}
.me-label-table tr:last-child th,
.me-label-table tr:last-child td { border-bottom: 0; }
.me-label-table th {
    background: #eef2ff;
    font-weight: 700;
    width: 38%;
    color: #001A72;
}
.me-label-table td { background: #fff; }
.me-card-photo {
    margin: 0.1rem 0 0.45rem;
    border-radius: 0.85rem;
    overflow: hidden;
    background: #0f172a;
    min-height: 9rem;
}
.me-card-photo.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
}
.me-card-hero {
    display: block;
    width: 100%;
    height: auto;
    min-height: 10rem;
    max-height: 22rem;
    object-fit: cover;
    background: #0f172a;
    margin: 0;
}
.me-card-body img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 0.65rem;
    margin: 0.45rem 0;
}
.me-card-url { color: #001A72; font-weight: 700; font-size: 0.85rem; word-break: break-all; }
.me-card-link {
    color: #001A72;
    font-weight: 800;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
    pointer-events: auto;
}
.me-card-link:hover { color: #2563eb; }
.me-resize {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 22px;
    height: 22px;
    border-right: 4px solid #001A72;
    border-bottom: 4px solid #C5A572;
    border-radius: 0 0 0.55rem 0;
    background: linear-gradient(135deg, transparent 46%, rgba(197, 165, 114, 0.35) 46%);
    cursor: nwse-resize;
    z-index: 2;
}

.me-chat {
    grid-column: 3;
    grid-row: 1;
    border-left: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.me-chat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
}
.me-chat-log { flex: 1; overflow: auto; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }
.me-chat-item { max-width: 95%; }
.me-chat-item.is-me { align-self: flex-end; text-align: right; }
.me-chat-item.is-direct .me-chat-bubble { background: #fef3c7; }
.me-chat-who { font-size: 0.72rem; font-weight: 700; color: #64748b; }
.me-chat-bubble {
    display: inline-block;
    background: #eef2ff;
    border-radius: 0.8rem;
    padding: 0.4rem 0.65rem;
    color: #0f172a;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.me-chat-form {
    padding: 0.7rem 0.8rem 0.9rem;
    border-top: 1px solid #e2e8f0;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}
.me-chat-row {
    display: flex;
    gap: 0.4rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.me-chat-row input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.75rem;
    padding: 0.45rem 0.65rem;
    box-sizing: border-box;
}
.me-chat-row .me-btn { flex: 0 0 auto; }
.me-chat-scope {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 0.35rem;
    min-width: 0;
}
.me-btn-icon .me-btn-label { margin-left: 0.25rem; }
@media (max-width: 420px) {
    .me-btn-icon .me-btn-label { display: none; }
}
.me-chat-toggle { display: none; }

.me-host-page {
    padding: 0.15rem 0.45rem 0.35rem;
    margin: -0.25rem -0.35rem 0;
}
body:has(.me-host-page) #main-content > header {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}
.me-host-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 0.75rem;
    margin-bottom: 0.3rem;
}
.me-host-bar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.45rem 0.85rem;
    min-width: 0;
    flex: 1 1 16rem;
}
@media (max-width: 900px) {
    .me-host-bar { flex-direction: column; }
}
.me-host-title h1 { font-size: 1.05rem; font-weight: 800; margin: 0; line-height: 1.1; }
.me-host-title p { margin: 0.1rem 0 0; color: #64748b; font-size: 0.78rem; line-height: 1.3; }
.me-code-pill {
    letter-spacing: 0.06em;
    color: #001A72;
    font: inherit;
    font-weight: 800;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.me-code-pill:hover { color: #2563eb; }
.me-back { color: #001A72; font-weight: 700; white-space: nowrap; }
.me-host-status { min-width: 0; flex: 0 1 14rem; }
.me-host-status .me-label { margin: 0 0 0.15rem; font-size: 0.72rem; }
.me-host-status select { min-height: 2.2rem; padding: 0.3rem 0.55rem; font-size: 0.85rem; }
.me-status-help {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    line-height: 1.25;
    color: #64748b;
}
.me-host-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 14rem) 1fr minmax(13rem, 16rem);
    grid-template-rows: 1fr;
    gap: 0;
    height: calc(100vh - 5.75rem);
    min-height: 38rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    position: relative;
}
.me-host-grid.is-roster-collapsed { grid-template-columns: 0 1fr minmax(13rem, 16rem); }
.me-host-grid.is-chat-collapsed { grid-template-columns: minmax(11rem, 14rem) 1fr 0; }
.me-host-grid.is-roster-collapsed.is-chat-collapsed { grid-template-columns: 0 1fr 0; }
.me-roster {
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.me-canvas-col {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.me-host-panel.is-collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}
.me-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem 0.25rem;
    flex-shrink: 0;
}
.me-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.me-panel-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.me-panel-collapse {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #001A72;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.me-panel-collapse svg { display: block; }
.me-panel-collapse:hover { background: #eef2ff; }
.me-rail-btn {
    display: none;
    position: absolute;
    z-index: 5;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #001A72;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.35rem;
    border-radius: 0 0.55rem 0.55rem 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.me-rail-btn span { writing-mode: vertical-rl; text-orientation: mixed; }
.me-rail-btn svg { flex-shrink: 0; }
.me-rail-btn.is-visible { display: block; }
.me-rail-left { left: 0; top: 50%; transform: translateY(-50%); border-radius: 0 0.55rem 0.55rem 0; }
.me-rail-right { right: 0; top: 50%; transform: translateY(-50%); border-radius: 0.55rem 0 0 0.55rem; }
.me-roster-hint {
    padding: 0 0.85rem;
    margin: 0 0 0.5rem;
    line-height: 1.45;
    font-size: 0.82rem;
}
.me-roster-list { list-style: none; margin: 0; padding: 0.2rem 0.55rem 0.8rem; }
.me-roster-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.5rem 0.45rem;
    border-radius: 0.7rem;
    cursor: pointer;
}
.me-roster-presence {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.12rem;
    color: #cbd5e1;
}
.me-roster-presence.is-online { color: #16a34a; }
.me-roster-item:hover, .me-roster-item.is-on { background: #eef2ff; }
.me-roster-text { min-width: 0; flex: 1; }
.me-roster-name {
    display: block;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.88rem;
    line-height: 1.3;
    word-break: break-word;
}
.me-roster-meta {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.1rem;
}
.me-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.me-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.me-tab {
    border: 0;
    background: #eef2ff;
    color: #001A72;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.82rem;
    cursor: pointer;
}
.me-tab.is-on { background: #001A72; color: #fff; }
.me-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.me-btn-ico, .me-btn-ico-send { display: inline-flex; align-items: center; justify-content: center; }
.me-btn-ico svg, .me-btn-ico-send svg { display: block; }
.me-toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.me-board-wrap-host { flex: 1; min-height: 0; }
.me-zoom-hud {
    position: absolute;
    left: 0.65rem;
    bottom: 0.55rem;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.me-chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.me-chat-audience {
    max-width: 9rem;
    text-align: right;
    line-height: 1.3;
    font-size: 0.75rem;
}
.me-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0.4rem;
}
.me-ed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    min-height: 2.15rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.6rem;
    border: 1.5px solid #c7d2fe;
    background: #fff;
    color: #001A72;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}
.me-ed-btn svg { display: block; }
.me-ed-btn:hover { background: #eef2ff; }
.me-ed-sep {
    width: 1px;
    height: 1.4rem;
    background: #e2e8f0;
}
.me-ed-size-lab {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#me-font-size {
    width: 4.6rem;
    min-height: 2.15rem;
    padding: 0.25rem 0.4rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.6rem;
    font-weight: 700;
}
.me-editor {
    min-height: 8.5rem;
    max-height: 18rem;
    overflow: auto;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.85rem;
    padding: 0.75rem 0.9rem;
    font-size: 22px;
    line-height: 1.35;
    background: #fff;
    color: #0f172a;
    word-break: break-word;
}
.me-editor:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 26, 114, 0.14);
    border-color: #001A72;
}
.me-editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}
.me-editor img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.55rem;
    margin: 0.4rem 0;
}
.me-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.4rem 0;
}
.me-editor th,
.me-editor td {
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.5rem;
    min-width: 2rem;
}
.me-editor-student { min-height: 12rem; max-height: 50vh; }
.me-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.me-modal.hidden { display: none !important; }
.me-modal.willow-modal-backdrop {
    background: rgba(15, 23, 42, 0.5);
}
.me-modal .willow-modal-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    max-height: min(90vh, 36rem);
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
    border: 1px solid #e2e8f0;
}
.me-modal-wide { max-width: min(720px, 100%) !important; max-height: min(90vh, 860px) !important; }
.me-modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.5rem !important;
}
.me-modal-header-row h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.me-modal .willow-modal-header { padding: 1.25rem 1.5rem 0.4rem; }
.me-modal .willow-modal-header h3 { margin: 0; font-size: 1.2rem; color: #0f172a; }
.me-modal .willow-modal-header p { margin: 0.35rem 0 0; color: #64748b; font-size: 0.9rem; }
.me-modal .willow-modal-body { padding: 0.5rem 1.5rem 1rem; overflow: auto; flex: 1; }
.me-modal .willow-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1.25rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}
.me-modal-close {
    border: 0;
    background: #f1f5f9;
    border-radius: 0.55rem;
    color: #64748b;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.me-modal-close svg { display: block; }
.me-label-rows { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.5rem 0 0.65rem; }
.me-label-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.4rem;
    align-items: center;
}
.me-label-row input {
    width: 100%;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.65rem;
    min-height: 2.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.me-label-remove {
    border: 1px solid #fecaca;
    background: #fff;
    color: #b91c1c;
    border-radius: 0.55rem;
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.me-modal-spacer { flex: 1; }
body.me-modal-open { overflow: hidden; }
.me-header-name { color: #fff; font-weight: 700; font-size: 0.9rem; }
.hidden { display: none !important; }

.me-theme-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.2rem 0 0.6rem;
}
.me-theme-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}
.me-theme-swatch.is-on { border-color: #001A72; box-shadow: 0 0 0 2px rgba(0, 26, 114, 0.15); }
.me-theme-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: linear-gradient(135deg, #C5A572, #001A72);
    padding: 0;
    cursor: pointer;
}
.me-theme-dot[data-theme="navy"], .me-theme-swatch[data-theme="navy"] .me-theme-dot { background: linear-gradient(135deg, #1d4ed8, #001A72); }
.me-theme-dot[data-theme="gold"], .me-theme-swatch[data-theme="gold"] .me-theme-dot { background: linear-gradient(135deg, #fde68a, #C5A572); }
.me-theme-dot[data-theme="slate"], .me-theme-swatch[data-theme="slate"] .me-theme-dot { background: linear-gradient(135deg, #cbd5e1, #475569); }
.me-theme-dot[data-theme="rose"], .me-theme-swatch[data-theme="rose"] .me-theme-dot { background: linear-gradient(135deg, #fecdd3, #be123c); }
.me-theme-dot[data-theme="forest"], .me-theme-swatch[data-theme="forest"] .me-theme-dot { background: linear-gradient(135deg, #bbf7d0, #166534); }
.me-theme-dot[data-theme="paper"], .me-theme-swatch[data-theme="paper"] .me-theme-dot { background: linear-gradient(135deg, #fff7ed, #d6d3d1); }
.me-theme-dot[data-theme="ink"], .me-theme-swatch[data-theme="ink"] .me-theme-dot { background: linear-gradient(135deg, #334155, #0f172a); }
.me-theme-dot.is-on { outline: 2px solid #001A72; outline-offset: 2px; }

.me-card[data-theme="navy"] { background: linear-gradient(180deg, #e8eefc, #dbe7fb); border-color: #94a3d8; }
.me-card[data-theme="navy"] .me-card-accent { background: linear-gradient(90deg, #2563eb, #001A72); }
.me-card[data-theme="gold"] { background: linear-gradient(180deg, #fffbeb, #fef3c7); border-color: #e8c98a; }
.me-card[data-theme="gold"] .me-card-accent { background: linear-gradient(90deg, #C5A572, #92400e); }
.me-card[data-theme="slate"] { background: linear-gradient(180deg, #f8fafc, #e2e8f0); border-color: #94a3b8; }
.me-card[data-theme="slate"] .me-card-accent { background: linear-gradient(90deg, #64748b, #334155); }
.me-card[data-theme="rose"] { background: linear-gradient(180deg, #fff1f2, #ffe4e6); border-color: #fda4af; }
.me-card[data-theme="rose"] .me-card-accent { background: linear-gradient(90deg, #fb7185, #be123c); }
.me-card[data-theme="forest"] { background: linear-gradient(180deg, #f0fdf4, #dcfce7); border-color: #86efac; }
.me-card[data-theme="forest"] .me-card-accent { background: linear-gradient(90deg, #22c55e, #166534); }
.me-card[data-theme="paper"] { background: #fffaf3; border-color: #e7d8c3; }
.me-card[data-theme="paper"] .me-card-accent { background: linear-gradient(90deg, #d6d3d1, #78716c); }
.me-card[data-theme="ink"] { background: linear-gradient(180deg, #1e293b, #0f172a); border-color: #334155; color: #e2e8f0; }
.me-card[data-theme="ink"] .me-card-title,
.me-card[data-theme="ink"] .me-card-body { color: #e2e8f0; }
.me-card[data-theme="ink"] .me-card-kicker { color: #C5A572; }
.me-card[data-theme="ink"] .me-label-table { border-color: #334155; background: #1e293b; }
.me-card[data-theme="ink"] .me-label-table th { background: #334155; color: #f8fafc; }
.me-card[data-theme="ink"] .me-label-table td { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.me-card[data-theme="ink"] .me-card-url { color: #93c5fd; }

.me-ctx {
    position: fixed;
    z-index: 140;
    min-width: 12rem;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
.me-ctx-item {
    display: flex;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.55rem;
    padding: 0.45rem 0.6rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}
.me-ctx-item:hover { background: #eef2ff; }
.me-ctx-item.is-danger { color: #b91c1c; }
.me-ctx-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.35rem 0.55rem 0.15rem;
}
.me-ctx-themes { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.25rem 0.5rem 0.5rem; }
.me-bulk-text {
    width: 100%;
    min-height: 10rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.8rem;
    padding: 0.65rem 0.75rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85rem;
    box-sizing: border-box;
}

html.dark .me-hub-create,
html.dark .me-room-card,
html.dark .me-join-card {
    background: #18181b;
    border-color: #3f3f46;
    color: #f4f4f5;
}
html.dark .me-room-card h2,
html.dark .me-host-title h1 { color: #fafafa; }
html.dark .me-room-meta,
html.dark .me-host-title p,
html.dark .me-hint,
html.dark .me-status-help,
html.dark .me-roster-meta { color: #a1a1aa; }
html.dark .me-room-code,
html.dark .me-back,
html.dark .me-code-pill { color: #93c5fd; }
html.dark #me-sel-count { color: #93c5fd; }
html.dark .me-hub-create input,
html.dark .me-host-status select,
html.dark .me-modal input,
html.dark .me-bulk-text,
html.dark #me-font-size,
html.dark .me-chat-row input,
html.dark .me-label-row input {
    background: #27272a;
    border-color: #52525b;
    color: #f4f4f5;
}
html.dark .me-btn { background: #27272a; border-color: #52525b; color: #e4e4e7; }
html.dark .me-btn-primary { background: linear-gradient(135deg, #1d4ed8, #001A72); color: #fff; border: 0; }
html.dark .me-host-grid,
html.dark .me-roster,
html.dark .me-chat,
html.dark .me-canvas-col { background: #18181b; border-color: #3f3f46; }
html.dark .me-toolbar,
html.dark .me-chat-head,
html.dark .me-panel-head,
html.dark .me-chat-form { border-color: #3f3f46; }
html.dark .me-tab { background: #27272a; color: #93c5fd; }
html.dark .me-tab.is-on { background: #1d4ed8; color: #fff; }
html.dark .me-board-viewport,
html.dark .me-board-wrap {
    background:
        linear-gradient(#27272a 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, #27272a 1px, transparent 1px) 0 0 / 28px 28px,
        #111113;
}
html.dark .me-card:not([data-theme]),
html.dark .me-card[data-theme="default"] {
    background: linear-gradient(180deg, #27272a, #1f1f23);
    border-color: #3f3f46;
    color: #f4f4f5;
}
html.dark .me-card:not([data-theme]) .me-card-title,
html.dark .me-card:not([data-theme]) .me-card-body,
html.dark .me-card[data-theme="default"] .me-card-title,
html.dark .me-card[data-theme="default"] .me-card-body { color: #f4f4f5; }
html.dark .me-label-table { border-color: #3f3f46; background: #18181b; }
html.dark .me-label-table th { background: #27272a; color: #93c5fd; }
html.dark .me-label-table td { background: #18181b; color: #e4e4e7; border-color: #3f3f46; }
html.dark .me-roster-item:hover,
html.dark .me-roster-item.is-on { background: #27272a; }
html.dark .me-roster-name { color: #f4f4f5; }
html.dark .me-chat-bubble { background: #27272a; color: #f4f4f5; }
html.dark .me-zoom-hud { background: rgba(24, 24, 27, 0.92); border-color: #3f3f46; color: #a1a1aa; }
html.dark .me-rail-btn,
html.dark .me-panel-collapse { background: #27272a; border-color: #52525b; color: #93c5fd; }
html.dark .me-editor { background: #18181b; border-color: #52525b; color: #f4f4f5; }
html.dark .me-ed-btn { background: #27272a; border-color: #52525b; color: #e4e4e7; }
html.dark .me-ctx { background: #18181b; border-color: #3f3f46; }
html.dark .me-ctx-item { color: #f4f4f5; }
html.dark .me-ctx-item:hover { background: #27272a; }
html.dark .me-theme-swatch { background: #27272a; border-color: #52525b; color: #e4e4e7; }
html.dark .me-modal .willow-modal-panel { background: #18181b; border-color: #3f3f46; }
html.dark .me-modal .willow-modal-header h3,
html.dark .me-modal-header-row h3 { color: #fafafa; }
html.dark .me-modal .willow-modal-footer { background: #18181b; border-color: #3f3f46; }
html.dark .me-link-btn { color: #93c5fd; }
html.dark .me-board-empty { color: #a1a1aa; }
html.dark .me-sel-bar { background: #18181b; border-color: #3f3f46; color: #e4e4e7; }
html.dark .me-code-board { background: #0b0b0e; color: #fafafa; }
html.dark .me-card-link { color: #93c5fd; }
html.dark #me-sel-count { color: #93c5fd; }

.me-sel-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.4rem 0.7rem;
    border-bottom: 1px solid #e2e8f0;
    background: #eef2ff;
    flex-shrink: 0;
}
.me-sel-bar.hidden { display: none !important; }
.me-sel-hint { font-size: 0.72rem; color: #64748b; }
#me-sel-count { font-weight: 800; color: #001A72; }

.me-code-modal { padding: 0; align-items: stretch; }
.me-code-board {
    position: relative;
    z-index: 1;
    width: min(96vw, 1100px);
    max-height: 92vh;
    margin: auto;
    background: #001A72;
    color: #fff;
    border-radius: 1.25rem;
    padding: 2.5rem 2rem 3rem;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.me-code-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.me-code-kicker {
    margin: 0;
    font-size: clamp(1rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.8;
}
.me-code-url {
    margin: 0.35rem 0 0.8rem;
    font-size: clamp(1.7rem, 4.4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    overflow-wrap: break-word;
}
.me-code-label {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C5A572;
}
.me-code-giant {
    margin: 0.35rem 0 0;
    font-size: clamp(1.8rem, 4.6vw, 2.9rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.15;
    color: #fde68a;
    word-break: break-word;
}

@media (max-width: 960px) {
    .me-shell { grid-template-columns: 1fr; }
    .me-shell.is-chat-collapsed { grid-template-columns: 1fr; }
    .me-shell.is-chat-collapsed .me-chat { display: none; }
    .me-chat { border-left: 0; border-top: 1px solid #e2e8f0; max-height: 16rem; }
    .me-chat-toggle { display: inline-flex; }
    .me-shell-student .me-chat:not(.is-open) .me-chat-body { display: none; }
    .me-host-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: calc(100vh - 6rem);
        min-height: calc(100vh - 6rem);
    }
    .me-host-grid.is-roster-collapsed,
    .me-host-grid.is-chat-collapsed,
    .me-host-grid.is-roster-collapsed.is-chat-collapsed {
        grid-template-columns: 1fr;
    }
    .me-roster { border-right: 0; border-bottom: 1px solid #e2e8f0; max-height: 11rem; }
    .me-host-grid.is-roster-collapsed .me-roster.is-collapsed,
    .me-host-grid.is-chat-collapsed .me-chat.is-collapsed { display: none; }
    .me-rail-btn { display: none !important; }
    .me-board { min-width: 1800px; min-height: 1200px; }
    .me-shell { height: calc(100vh - 5rem); min-height: calc(100vh - 5rem); }
}
