    :root {
      --bg-base: #020617;
      --bg-glass: rgba(30, 41, 59, 0.4);
      --bg-glass-strong: rgba(30, 41, 59, 0.7);
      --border-glass: rgba(255, 255, 255, 0.1);
      --text-primary: #f1f5f9;
      --text-muted: #94a3b8;
      --accent: #4f46e5;
      --accent-hover: #6366f1;
      --code-bg: #0d1117;
      --danger: #f87171;
      --success: #34d399;
    }

    *, *::before, *::after { box-sizing: border-box; }

    body {
      font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
      margin: 0;
      color: var(--text-primary);
      background: var(--bg-base);
      min-height: 100vh;
    }

    h1, h2, h3, h4 { margin: 0 0 0.75rem; font-weight: 700; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.05rem; color: var(--text-primary); }

    .hidden { display: none !important; }

    .neural-grid {
      background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
      background-size: 40px 40px;
    }

    .glass-card {
      background: var(--bg-glass);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border-glass);
      border-radius: 12px;
    }

    .glass-panel {
      background: var(--bg-glass-strong);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border: 1px solid var(--border-glass);
    }

    .gradient-text {
      background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .site-nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 24px;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      color: inherit;
    }

    .nav-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: var(--accent);
      color: white;
      font-size: 0.95rem;
    }

    .nav-title {
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .nav-user {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
      font-size: 0.9rem;
    }

    .login-hero {
      position: relative;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 96px 16px 48px;
      overflow: hidden;
    }

    .login-orbs::before,
    .login-orbs::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      pointer-events: none;
    }

    .login-orbs::before {
      top: 10rem;
      left: 2.5rem;
      width: 18rem;
      height: 18rem;
      background: rgba(79, 70, 229, 0.2);
      filter: blur(120px);
    }

    .login-orbs::after {
      bottom: 5rem;
      right: 2.5rem;
      width: 24rem;
      height: 24rem;
      background: rgba(147, 51, 234, 0.1);
      filter: blur(150px);
    }

    .login-orbs {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .login-network-canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      pointer-events: none;
    }

    @media (prefers-reduced-motion: reduce) {
      .login-network-canvas { display: none; }
    }

    .login-card {
      position: relative;
      z-index: 1;
      width: min(420px, 100%);
      padding: 32px 28px;
      text-align: center;
    }

    .login-card h1 {
      font-size: 1.75rem;
      margin-bottom: 0.5rem;
    }

    .login-card .login-subtitle {
      color: var(--text-muted);
      margin-bottom: 1.5rem;
      font-size: 0.95rem;
    }

    .page-main {
      max-width: 1120px;
      margin: 0 auto;
      padding: 88px 16px 32px;
    }

    section, form {
      padding: 20px;
      margin: 14px 0;
    }

    section.glass-card { padding: 20px; }

    input, button, select {
      font: inherit;
      padding: 9px 12px;
      margin: 4px;
      border-radius: 8px;
    }

    input, select {
      background: #0f172a;
      color: var(--text-primary);
      border: 1px solid #334155;
    }

    input:focus, select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
    }

    button, .btn-secondary, .oauth-btn {
      cursor: pointer;
      transition: background 0.15s, transform 0.15s, border-color 0.15s;
    }

    button {
      background: var(--accent);
      color: white;
      border: 0;
      font-weight: 600;
      box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    }

    button:hover { background: var(--accent-hover); }

    .btn-secondary {
      display: inline-block;
      background: #1e293b;
      color: var(--text-primary);
      border: 1px solid #334155;
      text-decoration: none;
      font-weight: 500;
      box-shadow: none;
    }

    .btn-secondary:hover { background: #334155; }

    .btn-ghost {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 20px;
      margin: 0;
      border-radius: 8px;
      border: 1px solid #334155;
      background: transparent;
      color: #cbd5e1;
      text-decoration: none;
      font-weight: 500;
      font-size: 0.9rem;
      box-shadow: none;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .btn-ghost:hover {
      background: #1e293b;
      color: var(--text-primary);
      border-color: #475569;
    }

    .btn-ghost i { font-size: 0.75rem; opacity: 0.9; }

    .btn-sm {
      padding: 4px 10px;
      font-size: 12px;
      box-shadow: none;
    }

    .btn-link {
      background: none;
      color: #818cf8;
      padding: 0;
      text-decoration: underline;
      border: 0;
      box-shadow: none;
      font-weight: 500;
    }

    .btn-link:hover { color: #a5b4fc; background: none; }

    .btn-danger {
      background: transparent;
      color: var(--danger);
      border: 1px solid rgba(248, 113, 113, 0.4);
      box-shadow: none;
    }

    .btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

    .oauth-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: white;
      color: #0f172a;
      border: 0;
      padding: 12px 24px;
      border-radius: 12px;
      text-decoration: none;
      font-weight: 700;
      font-size: 1rem;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .oauth-btn:hover {
      background: #eef2ff;
      transform: translateY(-2px);
    }

    .nav-logout {
      padding: 8px 16px;
      font-size: 0.85rem;
      box-shadow: none;
    }

    .table-wrap { overflow-x: auto; }

    table {
      width: 100%;
      border-collapse: collapse;
      background: transparent;
    }

    th, td {
      text-align: left;
      border-bottom: 1px solid #334155;
      padding: 10px 8px;
      vertical-align: top;
    }

    th {
      color: var(--text-muted);
      font-size: 0.82rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid #334155;
    }

    .tabs button {
      background: #1e293b;
      color: var(--text-muted);
      box-shadow: none;
      font-weight: 500;
    }

    .tabs button:hover {
      background: #334155;
      color: var(--text-primary);
    }

    .tabs button.tab-active {
      background: rgba(79, 70, 229, 0.15);
      color: #a5b4fc;
      border: 1px solid rgba(79, 70, 229, 0.35);
    }

    .error {
      color: #fca5a5;
      background: rgba(127, 29, 29, 0.35);
      border: 1px solid rgba(248, 113, 113, 0.35);
      border-radius: 8px;
      padding: 10px 12px;
      margin: 8px 0;
    }

    .hint {
      color: var(--text-muted);
      font-size: 0.92rem;
      margin: 8px 0;
    }

    .hint-inline { margin: 0; }

    .probe-panel { display: grid; gap: 12px; max-width: 640px; }
    .probe-panel input, .probe-panel select { width: 100%; max-width: 100%; }
    .probe-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .probe-result { margin-top: 8px; padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.5; }
    .probe-result.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: #a7f3d0; }
    .probe-result.fail { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.35); color: #fecaca; }
    .probe-result pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 0.82rem; }

    .dev-note { color: var(--text-muted); font-size: 0.88rem; margin-top: 12px; }

    pre.key-display, .code-font {
      font-family: "JetBrains Mono", ui-monospace, monospace;
    }

    pre.key-display {
      white-space: pre-wrap;
      background: var(--code-bg);
      color: #d7f5e9;
      padding: 12px;
      border-radius: 8px;
      border: 1px solid #334155;
      font-size: 0.85rem;
    }

    .logs-message-preview {
      max-width: 420px;
      max-height: 4.5em;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.4;
    }

    .modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(2, 6, 23, 0.75);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 16px;
    }

    .modal.show { display: flex; }

    .modal-content {
      background: var(--bg-glass-strong);
      border: 1px solid var(--border-glass);
      border-radius: 12px;
      width: min(900px, 100%);
      max-height: 85vh;
      display: flex;
      flex-direction: column;
    }

    .modal-header {
      padding: 14px 16px;
      border-bottom: 1px solid #334155;
      font-weight: 600;
    }

    .modal-body { padding: 16px; overflow: auto; }

    .modal-footer {
      padding: 12px 16px;
      border-top: 1px solid #334155;
      text-align: right;
    }

    .log-detail-pre {
      margin: 0;
      max-height: 60vh;
      overflow: auto;
      font-family: "JetBrains Mono", ui-monospace, monospace;
      font-size: 0.85rem;
      white-space: pre-wrap;
    }

    .log-detail-meta {
      margin-bottom: 12px;
      color: var(--text-secondary, #94a3b8);
      font-size: 0.9rem;
    }

    .log-detail-section {
      margin-bottom: 14px;
    }

    .log-detail-section-head {
      font-weight: 600;
      margin-bottom: 6px;
      color: var(--text-primary);
    }

    .log-detail-block {
      margin: 0;
      padding: 10px 12px;
      border: 1px solid #334155;
      border-radius: 8px;
      background: rgba(15, 23, 42, 0.55);
      font-family: "JetBrains Mono", ui-monospace, monospace;
      font-size: 0.85rem;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-y: auto;
    }

    .log-detail-block-user {
      max-height: 25vh;
    }

    .log-detail-block-assistant {
      max-height: 50vh;
    }

    .log-detail-empty {
      color: var(--text-secondary, #94a3b8);
      font-style: italic;
    }

    .modal-footer-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      width: 100%;
    }

    details.course-expander {
      border: 1px solid #334155;
      border-radius: 8px;
      padding: 10px 12px;
      margin: 10px 0;
      background: rgba(15, 23, 42, 0.5);
    }

    details.course-expander > summary { cursor: pointer; font-weight: 600; }

    .session-form {
      margin: 12px 0;
      padding: 14px;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid #334155;
      border-radius: 8px;
    }

    .session-form label { display: inline-block; margin-right: 8px; }

    .input-narrow { width: 5em; }

    .subtable { margin: 8px 0 0; background: rgba(15, 23, 42, 0.5); }

    .key-meta {
      margin: 8px 0;
      padding: 12px;
      background: rgba(15, 23, 42, 0.5);
      border-radius: 8px;
      border: 1px solid #334155;
    }

    .admin-block { margin-top: 16px; }

    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .tag-active { background: rgba(52, 211, 153, 0.15); color: var(--success); }
    .tag-ended { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
    .tag-expired { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
    .tag-rejected { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
    .tag-success { background: rgba(52, 211, 153, 0.15); color: var(--success); }
    .tag-role-admin { background: rgba(167, 139, 250, 0.15); color: #c4b5fd; }
    .tag-role-teacher { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
    .tag-role-student { background: rgba(45, 212, 191, 0.15); color: #5eead4; }
    .tag-role-inactive { background: transparent; opacity: 0.45; border: 1px dashed currentColor; }
    .tag-clickable { cursor: pointer; border: none; font: inherit; }
    .tag-clickable:hover { filter: brightness(1.15); }
    .tag-user-active { background: rgba(74, 222, 128, 0.15); color: #86efac; }
    .tag-user-inactive { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
    #adminUserSearch { margin-top: 12px; max-width: 320px; }
    .tag-personal { background: rgba(129, 140, 248, 0.15); color: #a5b4fc; }
    .tag-endpoint-chat { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
    .tag-endpoint-responses { background: rgba(192, 132, 252, 0.15); color: #d8b4fe; }
    .tag-endpoint-images { background: rgba(244, 114, 182, 0.15); color: #f9a8d4; }
    .tag-endpoint-audio { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }

    .tag-row { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

    .profile-line {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .profile-line > span:first-child { color: var(--text-muted); }

    .course-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: 12px 0;
    }

    .course-detail-header {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin-bottom: 12px;
      font-weight: 600;
    }

    code.key-prefix {
      font-family: "JetBrains Mono", ui-monospace, monospace;
      font-size: 0.9em;
      color: #a5b4fc;
    }

    .session-name-sub {
      display: block;
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 400;
      margin-top: 2px;
    }

    .monitor-filters label {
      color: var(--text-muted);
      font-size: 0.88rem;
      margin-right: 4px;
    }

    @media (max-width: 640px) {
      .nav-user { justify-content: flex-end; max-width: 60%; }
      .profile-line > span:first-child { font-size: 0.82rem; }
      .nav-title { font-size: 1rem; }
    }

    /* Teacher sidebar (ProtoFlow p2 pattern) */
    .teacher-layout {
      display: flex;
      gap: 0;
      min-height: 520px;
      margin: 14px 0;
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--border-glass);
    }

    .app-sidebar {
      width: 240px;
      flex-shrink: 0;
      border-right: 1px solid #334155;
      padding: 12px 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .sidebar-section-label {
      padding: 8px 16px 4px;
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
    }

    .sidebar-nav-btn {
      display: flex;
      align-items: center;
      gap: 10px;
      width: calc(100% - 16px);
      margin: 2px 8px;
      padding: 10px 12px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: var(--text-muted);
      text-align: left;
      font-weight: 500;
      font-size: 0.92rem;
      box-shadow: none;
      text-decoration: none;
    }

    .sidebar-nav-btn:hover {
      background: #1e293b;
      color: var(--text-primary);
    }

    .sidebar-nav-btn.tab-active {
      background: rgba(79, 70, 229, 0.15);
      color: #a5b4fc;
      border-color: rgba(79, 70, 229, 0.35);
    }

    .sidebar-nav-btn i { width: 18px; text-align: center; }

    .teacher-content {
      flex: 1;
      min-width: 0;
      padding: 16px 20px;
    }

    .teacher-content > div[id$="Tab"] { padding: 0; margin: 0; }

    /* Lobby host page */
    .lobby-shell {
      display: flex;
      min-height: calc(100vh - 64px);
      padding-top: 64px;
    }

    .lobby-sidebar {
      width: 280px;
      flex-shrink: 0;
      border-right: 1px solid #334155;
      padding: 16px 12px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow-y: auto;
    }

    .lobby-main {
      flex: 1;
      min-width: 0;
      padding: 20px 24px 32px;
      overflow-y: auto;
    }

    .lobby-main:has(.lobby-room-layout) {
      overflow: hidden;
      display: flex;
      flex-direction: column;
      padding-bottom: 20px;
    }

    .lobby-room-layout {
      display: grid;
      grid-template-columns: 1fr min(360px, 32vw);
      grid-template-rows: auto 1fr;
      gap: 12px 16px;
      flex: 1;
      min-height: 0;
      height: calc(100vh - 64px - 40px);
    }

    .lobby-room-layout > .lobby-status-bar {
      grid-column: 1;
      grid-row: 1;
      margin-bottom: 0;
    }

    .lobby-room-layout > .lobby-member-section {
      grid-column: 2;
      grid-row: 1;
      margin: 0;
      min-height: 0;
    }

    .lobby-room-layout > .lobby-timeline-main {
      grid-column: 1;
      grid-row: 2;
      min-height: 0;
      margin: 0;
    }

    .lobby-room-layout > .lobby-config-details {
      grid-column: 2;
      grid-row: 2;
      margin: 0;
      min-height: 0;
      overflow-y: auto;
      align-self: stretch;
    }

    .lobby-timeline-main {
      display: flex;
      flex-direction: column;
    }

    .lobby-timeline-title {
      margin: 0 0 8px;
      font-size: 1rem;
      flex-shrink: 0;
    }

    .lobby-timeline-main .timeline-panel {
      flex: 1;
      min-height: 0;
      max-height: none;
    }

    .lobby-timeline-main .broadcast-row {
      margin-top: auto;
      flex-shrink: 0;
    }

    .lobby-room-layout > .lobby-member-section,
    .lobby-room-layout > .lobby-timeline-main,
    .lobby-room-layout > .lobby-config-details {
      padding: 16px;
    }

    .lobby-config-details summary {
      padding: 0;
      margin: 0;
      cursor: pointer;
      font-weight: 600;
    }

    .lobby-config-details[open] summary {
      margin-bottom: 12px;
    }

    .lobby-config-details form {
      padding: 0;
    }

    .lobby-room-layout > .lobby-config-details .lobby-config-grid {
      grid-template-columns: 1fr;
    }

    .lobby-config-details label {
      display: block;
    }

    .lobby-config-details input[type="text"],
    .lobby-config-details input[type="number"],
    .lobby-config-details textarea {
      width: 100%;
      margin: 4px 0 12px;
    }

    .lobby-config-details textarea {
      background: #0f172a;
      color: inherit;
      border: 1px solid #334155;
      border-radius: 8px;
      padding: 8px;
    }

    .lobby-config-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .lobby-config-checks {
      margin: 12px 0;
      display: grid;
      gap: 6px;
    }

    .lobby-create-form {
      display: flex;
      gap: 8px;
      align-items: stretch;
      margin: 0 4px 8px;
      padding: 0;
    }

    .lobby-create-form input {
      flex: 1;
      min-width: 0;
      margin: 0;
    }

    .lobby-create-form button {
      flex-shrink: 0;
      white-space: nowrap;
      margin: 0;
      padding: 9px 14px;
    }

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

    .lobby-room-btn {
      display: block;
      width: 100%;
      text-align: left;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid #334155;
      background: #0f172a;
      color: var(--text-primary);
      box-shadow: none;
      font-weight: 500;
      cursor: pointer;
    }

    .lobby-room-btn:hover { border-color: var(--accent); background: #1e293b; }
    .lobby-room-btn.active {
      background: rgba(79, 70, 229, 0.15);
      border-color: rgba(79, 70, 229, 0.35);
      color: #a5b4fc;
    }

    .lobby-room-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

    .lobby-status-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-bottom: 12px;
      padding: 14px 16px;
      border-radius: 12px;
    }

    .lobby-metric-label { font-size: 0.78rem; color: var(--text-muted); }
    .lobby-metric-value { font-size: 1.1rem; font-weight: 600; }

    .lobby-member-section {
      padding: 12px 16px;
      border-radius: 12px;
    }

    .lobby-member-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
    }

    .lobby-member-list .hint {
      margin: 0;
      display: block;
      font-size: 0.85rem;
    }

    .lobby-member-chip {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid #334155;
      background: rgba(15, 23, 42, 0.75);
      font-size: 0.85rem;
      color: var(--text-primary);
    }

    .timeline-panel {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: min(56vh, 520px);
      overflow-y: auto;
      padding-right: 4px;
    }

    .timeline-entry {
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid #334155;
      background: rgba(15, 23, 42, 0.55);
      font-size: 0.9rem;
      line-height: 1.45;
    }

    .timeline-entry.system {
      border-style: dashed;
      color: var(--text-muted);
    }

    .timeline-entry.host {
      border-left: 3px solid var(--accent);
    }

    .timeline-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-bottom: 4px;
    }

    .timeline-name { color: var(--text-primary); font-weight: 600; }

    .ws-live { color: var(--success); font-size: 0.85rem; }
    .ws-reconnecting { color: #fbbf24; font-size: 0.85rem; }
    .ws-off { color: var(--text-muted); font-size: 0.85rem; }

    .broadcast-row {
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }

    .broadcast-row input { flex: 1; margin: 0; }

    @media (max-width: 900px) {
      .teacher-layout { flex-direction: column; }
      .app-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid #334155; flex-direction: row; flex-wrap: wrap; }
      .lobby-shell { flex-direction: column; }
      .lobby-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid #334155; max-height: 240px; }
      .lobby-main:has(.lobby-room-layout) { overflow-y: auto; }
      .lobby-room-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        height: auto;
      }
      .lobby-room-layout > .lobby-status-bar,
      .lobby-room-layout > .lobby-member-section,
      .lobby-room-layout > .lobby-timeline-main,
      .lobby-room-layout > .lobby-config-details {
        grid-column: 1;
        grid-row: auto;
      }
      .lobby-timeline-main {
        min-height: 320px;
        max-height: min(56vh, 520px);
      }
      .lobby-timeline-main .timeline-panel {
        max-height: min(40vh, 400px);
      }
      .lobby-room-layout > .lobby-config-details {
        overflow-y: visible;
      }
    }
