:root {
  --bg: #0f1419;
  --bg-card: #1a222d;
  --bg-elevated: #232d3b;
  --border: #2d3a4d;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #e07830;
  --accent-dim: #b85c1a;
  --accent-glow: rgba(224, 120, 48, 0.25);
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, var(--accent-glow), transparent),
    linear-gradient(180deg, var(--bg) 0%, #0c1015 100%);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rules-body {
  min-height: 100vh;
  min-height: 100dvh;
}

.nav-muted a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-muted a:hover {
  color: var(--accent);
}

.header-extra-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.header-extra-nav--single {
  gap: 0;
}

.header-extra-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.header-extra-nav a:hover {
  color: var(--accent);
}

.header-extra-nav__btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
}

.header-extra-nav__btn:hover {
  color: var(--accent);
}

.header-inner-trail {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.header-avatar-chip {
  display: block;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-avatar-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-avatar-chip:hover {
  border-color: var(--accent-dim);
}

.profile-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-form > button[type="submit"],
.profile-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.profile-form .password-field-wrap {
  position: relative;
  width: 100%;
}

.profile-form .password-field-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.password-toggle-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.profile-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.profile-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}

/* Status text under forms — scoped + div.node so global `p { color }` never washes out success mint. */
.profile-card .profile-form-status {
  display: block;
  margin-top: 0.75rem;
  color: #f0b878;
  min-height: 1.4em;
}

.profile-card .profile-form-status.is-error {
  color: #f0a8a8;
}

.profile-logout-wrap {
  margin-top: 1.25rem;
}

.profile-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.profile-outline-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Custom display defeats the HTML hidden attribute in the cascade for these controls. */
.profile-outline-btn[hidden] {
  display: none !important;
}

.profile-outline-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.profile-outline-btn:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.admin-stats-mount {
  margin-top: 1rem;
}

.admin-stats-dl {
  margin: 0;
}

.admin-stats-dl dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1.1rem;
}

.admin-stats-dl dt:first-of-type {
  margin-top: 0;
}

.admin-stats-dl dd {
  margin: 0.35rem 0 0;
  color: var(--text);
  line-height: 1.45;
}

.admin-stats-meta,
.admin-stats-preview {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.admin-stats-preview {
  display: block;
  margin-top: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: rgba(15, 20, 25, 0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-dashboard-card .profile-hint.is-error {
  color: #f0a8a8;
}

.profile-card .profile-logout-btn {
  border: 1px solid rgba(232, 93, 93, 0.55);
  background: rgba(214, 69, 69, 0.18);
  color: #ffb4b4;
  cursor: pointer;
  font-weight: 600;
}

.profile-card .profile-logout-btn:hover {
  background: rgba(214, 69, 69, 0.3);
  border-color: rgba(232, 93, 93, 0.75);
  color: #ffd4d4;
}

.profile-card .profile-logout-btn:focus-visible {
  outline: 2px solid rgba(232, 93, 93, 0.85);
  outline-offset: 2px;
}

.avatar-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-muted);
}

.muted-link-inline {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.rules-layout {
  padding-bottom: 3rem;
}

.rules-card {
  max-width: 640px;
}

.rules-card h2 {
  font-size: 1.05rem;
  margin-top: 1.35rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.lead-rule {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.rules-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.rules-list li {
  margin-bottom: 0.35rem;
}

.rules-card strong {
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  padding-top: env(safe-area-inset-top, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-left: env(safe-area-inset-left, 0);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem calc(1.5rem + env(safe-area-inset-right, 0)) 3rem
    calc(1.5rem + env(safe-area-inset-left, 0));
}

.app-layout {
  max-width: 1180px;
  flex: 1;
  min-height: 0;
  padding-top: calc(1rem + env(safe-area-inset-top, 0) * 0.25);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  padding-left: calc(0px + env(safe-area-inset-left, 0));
  padding-right: calc(0px + env(safe-area-inset-right, 0));
}

.app-frame {
  height: 100%;
  background: rgba(26, 34, 45, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-frame--split {
  display: grid;
  grid-template-columns: 360px 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(21, 29, 40, 0.85);
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.workspace {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(15, 20, 25, 0.6);
}

.workspace-inner {
  text-align: center;
  padding: 1.5rem;
}

.workspace-inner h2 {
  margin-bottom: 0.4rem;
}

.centered-card,
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}

.centered-card {
  max-width: 580px;
  margin: 1.25rem auto;
  min-height: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

p {
  margin-top: 0;
  color: var(--text-muted);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

.inline-form button {
  flex: 0 0 auto;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.auth-form button {
  margin-top: 0.45rem;
  width: fit-content;
}

.muted-link {
  color: var(--text-muted);
}

.muted-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.muted-link a:hover {
  text-decoration: underline;
}

/* --- PWA install hint (Chrome/Android “Install app” + manual shortcut text) --- */
#pwa-root[hidden] {
  display: none !important;
}

#pwa-root:not([hidden]) {
  display: block;
}

.pwa-install-banner {
  position: fixed;
  z-index: 9999;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.pwa-install-banner:not(.pwa-install-banner--hint) .pwa-install-banner__inner {
  padding-right: 2.75rem;
}

.pwa-install-banner:not(.pwa-install-banner--hint) .pwa-install-banner__dismiss {
  position: absolute;
  top: 0.4rem;
  right: 0.35rem;
}

.pwa-install-banner--hint {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.5rem;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
}

.pwa-install-banner__inner {
  padding: 0.95rem 0.95rem 0.95rem 1.05rem;
}

.pwa-install-banner__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.pwa-install-banner__text {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pwa-install-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pwa-install-banner__install {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #fff0e6;
  padding: 0.55rem 1rem;
}

.pwa-install-banner__later {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
}

.pwa-install-banner__dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  border-radius: 8px;
}

.pwa-install-banner__dismiss:hover {
  color: var(--text);
}

.pwa-install-banner--hint .pwa-install-banner__dismiss {
  margin: -0.2rem -0.35rem 0 0;
}

input,
button {
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  font: inherit;
}

input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

button {
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: #fff0e6;
  cursor: pointer;
  font-weight: 600;
}

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

#status {
  margin-top: 0.85rem;
  color: #f0b878;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: rgba(21, 29, 40, 0.8);
  min-width: 0;
}

.chat-header-peer {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.chat-header-peer-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
}

.chat-header-peer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#chatHeaderAvatarFallback {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.chat-header-peer-text {
  flex: 1;
  min-width: 0;
}

.chat-header h2 {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-peer-link {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border-radius: 10px;
  margin: -0.15rem -0.3rem;
  padding: 0.15rem 0.35rem;
  text-decoration: none;
  color: inherit;
}

.chat-header-peer-link:hover:not([hidden]) {
  background: rgba(224, 120, 48, 0.1);
}

.chat-header-peer-link:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.chat-header-meta {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.missive-voip-call-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-dim), var(--accent));
  color: #fff5eb;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(224, 120, 48, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  position: relative;
  z-index: 2;
}

.missive-voip-call-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(224, 120, 48, 0.45);
}

.missive-voip-call-btn:active {
  transform: scale(0.96);
}

.missive-voip-call-btn:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 3px;
}

.missive-voip-call-btn svg {
  display: block;
}

.missive-voip-bar {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
  background: rgba(15, 22, 30, 0.92);
}

.missive-voip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.missive-voip-status {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-height: 1.25rem;
}

.missive-voip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.missive-voip-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.missive-voip-btn:hover {
  border-color: var(--accent-dim);
  background: rgba(224, 120, 48, 0.12);
}

.missive-voip-btn--accent {
  border-color: var(--accent-dim);
  background: rgba(224, 120, 48, 0.18);
  color: #fff0e6;
}

.missive-voip-btn--accent:hover {
  background: var(--accent-dim);
}

.missive-voip-btn--danger {
  border-color: rgba(232, 93, 93, 0.45);
  color: #ffb4b4;
}

.missive-voip-btn--danger:hover {
  background: rgba(214, 69, 69, 0.18);
}

.missive-voip-remote-audio {
  display: none;
}

.public-profile-preview {
  width: 120px;
  height: 120px;
}

.public-profile-nick {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0.75rem 0 0.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.public-profile-display {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.public-profile-avatar-row {
  margin-top: 0.5rem;
}

.chat-list {
  margin-top: 0.85rem;
}

.chat-row {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  padding-right: 1.75rem;
  margin-bottom: 0.65rem;
  position: relative;
}

.chat-row--has-new {
  border-color: rgba(232, 93, 93, 0.45);
  box-shadow: 0 0 0 1px rgba(232, 93, 93, 0.12);
}

.chat-row--has-new::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8a8a, #d64545 55%, #b83232);
  box-shadow: 0 0 0 2px rgba(15, 20, 25, 0.85), 0 2px 8px rgba(214, 69, 69, 0.45);
  z-index: 2;
}

.chat-row:hover {
  border-color: var(--accent-dim);
}

.chat-row strong {
  color: var(--text);
}

.chat-row span {
  display: block;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.messages {
  min-height: 0;
  height: calc(100vh - 300px);
  height: calc(100dvh - 300px);
  max-height: none;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.35rem;
  overscroll-behavior-y: contain;
}

.message {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  max-width: 85%;
}

.message.me {
  background: rgba(224, 120, 48, 0.18);
  border-color: var(--accent-dim);
  margin-left: auto;
}

.message-text {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.message-text a {
  color: var(--accent);
  word-break: break-all;
}

.message-link-preview {
  margin-top: 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(15, 20, 25, 0.45);
  max-width: 100%;
}

.message-link-preview--loading {
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.message-link-preview__shell {
  display: flex;
  flex-direction: column;
}

.message-link-preview__click {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.message-link-preview__click:hover {
  background: rgba(224, 120, 48, 0.08);
}

.message-link-preview__img {
  width: 96px;
  min-height: 72px;
  max-height: 120px;
  object-fit: cover;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}

.message-link-preview__main {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-link-preview__site {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-link-preview__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}

.message-link-preview__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.message.me .message-link-preview {
  border-color: rgba(224, 120, 48, 0.35);
}

.message small {
  color: var(--text-muted);
}

.app-title {
  margin-bottom: 0.2rem;
}

.app-subtitle {
  margin-bottom: 0.8rem;
}

.room-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.room-shell .messages {
  flex: 1;
  height: auto;
  margin: 0;
  padding: 1rem;
}

.composer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: calc(0.75rem + env(safe-area-inset-bottom, 0) * 0.35) calc(1rem + env(safe-area-inset-right, 0))
    calc(0.75rem + env(safe-area-inset-bottom, 0)) calc(1rem + env(safe-area-inset-left, 0));
  margin: 0;
  background: rgba(21, 29, 40, 0.7);
}

@media (max-width: 900px) {
  .site-header {
    position: static;
  }

  .layout {
    padding: 0.5rem max(0.5rem, env(safe-area-inset-right, 0))
      calc(0.5rem + env(safe-area-inset-bottom, 0))
      max(0.5rem, env(safe-area-inset-left, 0));
  }

  .app-layout {
    padding-top: calc(0.4rem + env(safe-area-inset-top, 0) * 0.3);
    padding-right: calc(0.4rem + env(safe-area-inset-right, 0));
    padding-left: calc(0.4rem + env(safe-area-inset-left, 0));
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0));
  }

  .app-frame {
    border-radius: 12px;
  }

  .app-frame--split {
    grid-template-columns: 1fr;
  }

  .workspace {
    display: none;
  }

  .sidebar {
    border-right: none;
    padding: 0.85rem;
  }

  body {
    font-size: 1rem;
  }

  .logo {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  button,
  .chat-row {
    min-height: 44px;
  }

  .centered-card {
    margin: 0.5rem;
    max-width: none;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-form button {
    width: 100%;
    margin-top: 0.2rem;
  }

  .centered-card .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .centered-card .inline-form button {
    width: 100%;
  }

  .room-shell .messages {
    padding: 0.8rem;
  }

  /* Chrome/Brave on Android often expose no safe-area while bottom UI still overlaps */
  .composer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 38px);
    padding-top: calc(0.85rem + env(safe-area-inset-bottom, 0px) * 0.35);
  }

  .chat-row {
    padding: 0.75rem 1.75rem 0.75rem 0.85rem;
  }
