  :root {
    --bg: #0f1722;
    --panel: #131c2a;
    --panel-strong: #0d1521;
    --border: #1f2a3b;
    --muted: #9aa7bd;
    --accent: #5dd0ff;
    --accent-strong: #7df3c5;
    --text: #e8edf5;
    --danger: #ff7b8a;
    --shadow: 0 14px 40px rgba(0,0,0,0.45);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(80% 80% at 10% 10%, rgba(93, 208, 255, 0.08), transparent 40%),
                radial-gradient(60% 60% at 80% 20%, rgba(125, 243, 197, 0.05), transparent 40%),
                var(--bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
  }
  body.waiting-room {
    overflow: hidden;
  }
  body.waiting-room .app-shell {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
  }
  .waiting-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 22, 32, 0.96);
    z-index: 20;
    padding: 20px;
  }
  body.waiting-room .waiting-overlay {
    display: flex;
  }
  .waiting-card {
    width: min(480px, 100%);
    background: linear-gradient(160deg, rgba(19, 28, 42, 0.95), rgba(10, 14, 22, 0.95));
    border: 1px solid rgba(93, 208, 255, 0.35);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 40px 90px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .waiting-card h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.4px;
  }
  .waiting-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
  }
  .waiting-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .waiting-card input,
  .waiting-card textarea {
    width: 100%;
  }
  .waiting-card textarea {
    min-height: 90px;
    resize: vertical;
  }
  .waiting-status {
    min-height: 18px;
    font-size: 14px;
    color: var(--muted);
  }
  .waiting-status.error {
    color: var(--danger);
  }
  .waiting-status.success {
    color: var(--accent);
  }
  body.landing-only {
    display: block;
  }
  .app-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 240px 1fr 320px;
    grid-template-areas:
      "sidebar header utility"
      "sidebar main utility";
    height: 100vh;
    overflow: hidden;
  }
  @media (max-width: 900px) {
    .app-shell {
      grid-template-columns: 1fr;
      grid-template-rows: auto minmax(220px, auto) minmax(400px, 1fr) minmax(260px, auto);
      grid-template-areas:
        "header"
        "sidebar"
        "main"
        "utility";
      height: auto;
      overflow: visible;
    }
    header.topbar {
      position: static;
    }
    .sidebar {
      flex-direction: row;
      align-items: flex-start;
      border-right: none;
      border-bottom: 1px solid var(--border);
    }
    .utility-panel {
      border-left: none;
      border-top: 1px solid var(--border);
      height: auto;
    }
  }
  body.landing-only .app-shell {
    display: none;
  }
  .landing {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(80% 80% at 10% 10%, rgba(93, 208, 255, 0.1), transparent 40%),
                radial-gradient(60% 60% at 80% 20%, rgba(125, 243, 197, 0.08), transparent 40%),
                var(--bg);
  }
  body.landing-only .landing {
    display: flex;
  }
  .landing-card {
    width: min(520px, 100%);
    background: rgba(19, 28, 42, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .landing-card h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.5px;
  }
  .landing-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
  }
  .landing-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .landing-actions button,
  .landing-actions input,
  .landing-card form input,
  .landing-card form button {
    width: 100%;
  }
  .landing-card form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .landing-card small {
    color: var(--muted);
  }
  .landing-error {
    color: var(--danger);
    min-height: 18px;
  }
  header.topbar {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(19, 28, 42, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
  }
  .brand span {
    font-family: 'Space Mono', monospace;
    color: var(--accent);
  }
  .presence {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(93,208,255,0.12);
    border: 1px solid rgba(93,208,255,0.3);
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
  }
  .share {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    box-shadow: var(--shadow);
  }
  .share.active {
    display: flex;
  }
  .share-label {
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
  }
  .share-url {
    font-weight: 700;
    letter-spacing: 0.5px;
  }
  .share button {
    background: rgba(93,208,255,0.15);
    color: var(--text);
    box-shadow: none;
    padding: 10px 14px;
    min-width: 96px;
  }
  .sidebar {
    grid-area: sidebar;
    background: rgba(9,13,21,0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 16px;
    overflow-y: auto;
    overflow-x: visible;
    position: relative;
    z-index: 2;
  }
  .utility-panel {
    grid-area: utility;
    border-left: 1px solid var(--border);
    background: rgba(9,13,21,0.9);
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 14px;
    overflow-y: auto;
  }
  .utility-tabs {
    display: flex;
    gap: 10px;
  }
  .utility-tab {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .utility-tab.active {
    color: var(--text);
    border-color: rgba(93,208,255,0.4);
    box-shadow: inset 0 0 18px rgba(93,208,255,0.2);
  }
  .utility-panels {
    position: relative;
    flex: 1;
  }
  .utility-card {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px;
    background: rgba(12,18,28,0.9);
    overflow-y: auto;
  }
  .utility-card.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
  }
  .utility-actions,
  .drawer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .utility-card button {
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    background: rgba(93,208,255,0.08);
    border: 1px solid rgba(93,208,255,0.3);
    color: var(--text);
  }
  .lock-state {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .lock-state.locked {
    color: var(--danger);
  }
  .lock-state.open {
    color: var(--accent);
  }
  .admin-panel {
    margin-top: 12px;
    background: rgba(93,208,255,0.04);
    border-color: rgba(93,208,255,0.25);
  }
  .admin-panel small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
  }
  .danger-button {
    background: rgba(255,123,138,0.18);
    border: 1px solid rgba(255,123,138,0.4);
    color: var(--text);
  }
  .admin-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .admin-section label {
    font-size: 13px;
    color: var(--muted);
  }
  .admin-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }
  .admin-controls button {
    margin: 0;
  }
  .stage-banner {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .stage-banner.active {
    display: flex;
  }
  .stage-banner strong {
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }
  .topic-line {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
  }
  .join-requests-toggle {
    margin-top: 12px;
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(93,208,255,0.25);
    border-radius: 10px;
    padding: 10px;
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }
  .join-requests-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: none;
    flex-direction: column;
    gap: 10px;
  }
  .join-requests-panel.open {
    display: flex;
  }
  .join-requests-panel label {
    font-size: 13px;
    color: var(--muted);
  }
  .join-requests-panel input,
  .join-requests-panel textarea {
    width: 100%;
  }
  .activity-log {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(93,208,255,0.15);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .activity-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .activity-meta {
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--muted);
  }
  .activity-text {
    font-size: 13px;
    color: var(--text);
  }
  .activity-item.activity-join .activity-text {
    color: var(--accent);
  }
  .activity-item.activity-leave .activity-text {
    color: var(--muted);
  }
  .activity-item.activity-moderation .activity-text {
    color: var(--danger);
  }
  .activity-empty {
    font-size: 13px;
    color: var(--muted);
  }
  .join-request-item {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255,255,255,0.02);
  }
  .join-request-item strong {
    font-size: 14px;
  }
  .join-request-actions {
    display: flex;
    gap: 6px;
  }
  .join-request-actions button {
    margin: 0;
    flex: 1;
  }
  .join-request-actions button.deny {
    background: rgba(255,123,138,0.15);
    border-color: rgba(255,123,138,0.4);
  }
  .join-request-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(93,208,255,0.18);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
  }
  .sidebar .block.filled {
    background: linear-gradient(145deg, rgba(93,208,255,0.08), rgba(93,208,255,0.02));
    border-color: rgba(93,208,255,0.35);
  }
  .sidebar-scroll {
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(93,208,255,0.12);
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    width: fit-content;
  }
  .title {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin: 4px 0 6px;
    letter-spacing: 0.3px;
  }
  .subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
  }
  input[type="text"] {
    flex: 1;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    outline: none;
    transition: border 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    font-weight: 600;
  }
  input[type="text"]:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(93,208,255,0.18);
  }
  button {
    cursor: pointer;
    border-radius: 10px;
    padding: 11px 14px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255,255,255,0.15);
    transition: border 0.15s ease, background 0.15s ease, transform 0.1s ease;
    box-shadow: none;
  }
  button:hover {
    border-color: rgba(93,208,255,0.45);
    background: rgba(93,208,255,0.08);
    transform: translateY(-1px);
  }
  button:active {
    transform: translateY(0);
  }
  main {
    grid-area: main;
    display: grid;
    grid-template-rows: 1fr auto;
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow) inset;
    min-height: 0;
  }
  .chat {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    height: 100%;
    min-height: 0;
  }
  .chat header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 2px;
  }
  .badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(93, 208, 255, 0.12);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    border: 1px solid rgba(93,208,255,0.35);
  }
  .messages {
    overflow-y: auto;
    padding: 10px;
    border-radius: 12px;
    background: rgba(13,21,33,0.7);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border);
    box-shadow: inset 0 0 25px rgba(0,0,0,0.35);
    min-height: 0;
  }
  .message {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
  }
  .avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(140deg, rgba(93,208,255,0.25), rgba(125,243,197,0.2));
    display: grid;
    place-items: center;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.4px;
    border: 1px solid rgba(93,208,255,0.4);
  }
  .meta { color: var(--muted); font-size: 12px; }
  .meta strong { color: var(--text); }
  .text { grid-column: 1 / -1; line-height: 1.5; }
  .text a { color: var(--accent); }
  .system { color: var(--muted); font-style: italic; }
  .composer {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: rgba(13,21,33,0.8);
  }
  .composer button {
    white-space: nowrap;
    min-width: 90px;
  }
  .media {
    grid-column: 1 / -1;
  }
  .media img {
    max-width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    border: 1px solid rgba(93,208,255,0.25);
  }
  .caption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
  }
  .mod-actions {
    display: none;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 6px;
  }
  .mod-actions button {
    background: rgba(255,123,138,0.12);
    border: 1px solid rgba(255,123,138,0.4);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
  }
  .messages.admin .mod-actions {
    display: flex;
  }
  .voice {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(13,21,33,0.8);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.3);
  }
  .voice-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .voice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .voice-actions button {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 10px 10px;
    background: rgba(93,208,255,0.12);
    border: 1px solid rgba(93,208,255,0.35);
    color: var(--text);
    box-shadow: none;
    white-space: nowrap;
  }
  .voice-status {
    color: var(--muted);
    font-size: 12px;
  }
  .users {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  .user-chip {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 13px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
    position: relative;
  }
  .user-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
  }
  .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(87,242,135,0.8);
    box-shadow: 0 0 10px rgba(87,242,135,0.4);
    flex-shrink: 0;
  }
  .user-chip.voice .user-dot {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(93,208,255,0.7);
  }
  .user-chip .user-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .user-role {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(93,208,255,0.12);
    border: 1px solid rgba(93,208,255,0.4);
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }
  .user-voice-indicator {
    font-family: 'Material Symbols Rounded', sans-serif;
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    margin-left: auto;
  }
  .user-voice-indicator[data-state="live"] {
    border-color: rgba(93,208,255,0.5);
    color: var(--text);
    background: rgba(93,208,255,0.18);
  }
  .user-voice-indicator[data-state="muted"] {
    border-color: rgba(255,123,138,0.6);
    background: rgba(255,123,138,0.2);
    color: var(--danger);
  }
  .user-chip.has-menu {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .user-chip.has-menu:hover,
  .user-chip.has-menu.menu-open {
    border-color: rgba(93,208,255,0.5);
    background: rgba(93,208,255,0.08);
  }
  .user-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background: var(--panel-strong);
    border: 1px solid rgba(93,208,255,0.2);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.6);
    padding: 6px;
    display: none;
    flex-direction: column;
    min-width: 220px;
    z-index: 12;
  }
  .user-chip.menu-open .user-menu {
    display: flex;
  }
  .menu-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
  }
  .menu-action:hover {
    background: rgba(93,208,255,0.12);
  }
  .menu-action.danger {
    color: var(--danger);
  }
  .menu-action.danger:hover {
    background: rgba(255,123,138,0.16);
  }
  .menu-action span.material-symbols-rounded {
    font-size: 18px;
    color: var(--muted);
  }
  .menu-action.danger span.material-symbols-rounded {
    color: var(--danger);
  }
  .menu-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
  }
  .menu-volume:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 8px;
  }
  .menu-volume .volume-toggle {
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: 'Material Symbols Rounded', sans-serif;
    cursor: pointer;
  }
  .menu-volume.muted .volume-toggle {
    color: var(--danger);
    border-color: rgba(255,123,138,0.5);
  }
  .menu-volume input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    outline: none;
  }
  .menu-volume.muted input[type="range"] {
    opacity: 0.5;
  }
  .menu-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(15,23,34,0.4);
  }
  .menu-volume input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    cursor: pointer;
  }
  .menu-volume input[type="range"]::-moz-range-track {
    background: transparent;
  }
  .menu-volume .volume-value {
    width: 48px;
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .user-chip.voice {
    border-color: rgba(93,208,255,0.4);
    background: rgba(93,208,255,0.06);
  }
  .user-chip.speaking {
    box-shadow: 0 0 0 2px rgba(125,243,197,0.3);
    border-color: rgba(125,243,197,0.5);
  }
  .gif-panel {
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 22, 0.9);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 20;
  }
  .gif-card {
    width: min(900px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.55);
  }
  .gif-header {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
  }
  .gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
  }
  .gif-item {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.1s ease, border 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  }
  .gif-item:hover { transform: translateY(-2px); border-color: rgba(125,243,197,0.6); box-shadow: 0 14px 26px rgba(0,0,0,0.45); }
  .gif-item img { width: 100%; display: block; }
  .gif-empty { color: var(--muted); text-align: center; padding: 16px; }
  @media (max-width: 900px) {
    .app-shell {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto 1fr;
      grid-template-areas:
        "header"
        "sidebar"
        "main";
    }
    .sidebar {
      grid-template-rows: auto;
    }
    .sidebar .block {
      margin-bottom: 8px;
    }
    main {
      border-left: none;
    }
    .composer {
      flex-wrap: wrap;
    }
    .composer input[type="text"] {
      min-width: 100%;
    }
    .composer button {
      flex: 1;
    }
    .messages {
      max-height: 50vh;
    }
  }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
  }
  .modal {
    width: min(420px, 90%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.5), var(--glow);
  }
  @media (max-width: 960px) {
    .frame { grid-template-columns: 1fr; }
    .chat { height: auto; min-height: 0; }
  }
