@media (max-width: 767px) {
  body.twalk-glass { height: 100dvh; overflow: hidden; padding: 0; background: var(--tw-bg-page); }
  .app-shell:not(.chat-mode) { min-height: 100dvh; background: var(--tw-bg-surface); }
  .screen {
    width: 100%;
    height: 100dvh;
    padding: 0 0 calc(72px + env(safe-area-inset-bottom));
    overflow: auto;
    background: var(--tw-bg-surface);
  }
  .screen > .panel:first-child {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0;
    padding: calc(18px + env(safe-area-inset-top)) 16px 12px;
    border: 0;
    border-bottom: 1px solid var(--tw-border);
    border-radius: 0;
    background: rgba(255,255,255,.88);
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .topbar.top-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 70;
    min-height: calc(60px + env(safe-area-inset-bottom));
    padding: 0 0 env(safe-area-inset-bottom);
    background: rgba(255,255,255,.92);
    border-top: 1px solid var(--tw-border);
    border-bottom: 0;
    box-shadow: 0 -6px 18px rgba(0,0,0,.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .topbar .brand { display: none; }
  .topbar nav {
    position: static;
    inset: auto;
    width: 100%;
    height: 60px;
    min-height: 60px;
    padding: 0 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .topbar nav a {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    color: var(--tw-text-tertiary);
    font-size: 10px;
    font-weight: 600;
  }
  .topbar nav a:nth-child(1)::before { content: "💬"; font-size: 20px; }
  .topbar nav a:nth-child(2)::before { content: "👥"; font-size: 20px; }
  .topbar nav a:nth-child(3)::before { content: "⚙"; font-size: 20px; }
  .topbar nav a:nth-child(4)::before { content: "◉"; font-size: 20px; }
  .chat-screen {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--tw-bg-surface);
  }
  .chat-head {
    height: calc(56px + env(safe-area-inset-top));
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
  }
  .messages { padding: 12px 16px 92px; overflow-y: auto; }
  .composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transform: none;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }
}

@media (prefers-color-scheme: dark) and (max-width: 767px) {
  .screen > .panel:first-child,
  .topbar.top-bar,
  .chat-head,
  .composer { background: rgba(26,39,53,.90); }
}
