:root {
  color-scheme: light;
  --ink: #0f172a;
  --text: #111b21;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: rgba(15, 23, 42, 0.12);
  --line-soft: rgba(15, 23, 42, 0.07);
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --wash: #f5f7fb;
  --teal: #008069;
  --teal-dark: #075e54;
  --blue: #2aabee;
  --blue-dark: #1d6fd8;
  --lime: #20d466;
  --bubble-out: #d9fdd3;
  --bubble-in: #ffffff;
  --chat-bg: #eef3f7;
  --danger: #dc2626;
  --warn: #a16207;
  --good: #008069;
  --shadow: 0 18px 58px rgba(15, 23, 42, 0.18);
  --soft-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(42, 171, 238, 0.22), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(0, 128, 105, 0.20), transparent 28%),
    linear-gradient(135deg, #101827, #182334 54%, #eef3f7 54%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.42rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.98rem;
  line-height: 1.25;
}

svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.25;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(330px, 420px) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  background: rgba(15, 23, 42, 0.88);
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark,
.rail-button,
.icon-button,
.call-button,
.composer-button,
.mobile-tab,
.mini-button,
.call-control {
  display: inline-grid;
  place-items: center;
}

.brand-mark,
.rail-button,
.icon-button,
.call-button,
.composer-button {
  border: 0;
  color: inherit;
}

.brand-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(42, 171, 238, 0.32);
}

.rail-button {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(15, 23, 42, 0.92);
  border-radius: 999px;
  padding: 0 4px;
  color: #ffffff;
  background: var(--danger);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.rail-button:hover,
.rail-button.is-active {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.rail-button.is-active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.rail-button-bottom {
  margin-top: auto;
}

.conversation-panel,
.chat-panel {
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.06);
}

.panel-header,
.chat-header,
.control-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  min-height: 68px;
  padding: 14px 16px 12px;
  background:
    linear-gradient(135deg, rgba(42, 171, 238, 0.12), rgba(0, 128, 105, 0.08)),
    var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

.panel-header .eyebrow {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.call-button,
.composer-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.call-button:hover,
.call-button.is-active,
.composer-button:hover {
  background: rgba(15, 23, 42, 0.07);
  color: var(--ink);
}

.primary-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: var(--soft-shadow);
}

.primary-icon:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.back-mobile {
  display: none;
}

.profile-switcher {
  padding: 12px 14px 10px;
  background: var(--paper);
}

.profile-chip {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--wash);
  font-weight: 800;
}

.session-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 54px;
}

.session-card strong,
.session-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card span span {
  color: var(--muted);
  font-size: 0.78rem;
}

.search-box {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 0 14px 10px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #eef2f7;
  color: var(--muted);
}

.search-box:focus-within {
  border-color: rgba(42, 171, 238, 0.36);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(42, 171, 238, 0.10);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: #8795a6;
}

.chat-filters {
  display: flex;
  gap: 7px;
  padding: 0 14px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 0.8rem;
  font-weight: 820;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--teal);
  border-color: rgba(0, 128, 105, 0.16);
  background: rgba(0, 128, 105, 0.10);
}

.quick-stats {
  display: none;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 12px;
}

.conversation-item {
  width: 100%;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.conversation-item:hover,
.conversation-item.is-active {
  background: linear-gradient(90deg, rgba(42, 171, 238, 0.10), rgba(0, 128, 105, 0.08));
}

.conversation-item.has-unread {
  background: linear-gradient(90deg, rgba(0, 128, 105, 0.14), rgba(42, 171, 238, 0.08));
  box-shadow: inset 4px 0 0 var(--teal);
}

.conversation-item.is-active {
  box-shadow: inset 4px 0 0 var(--blue);
}

.conversation-item.is-filtered {
  display: none;
}

.conversation-copy {
  min-width: 0;
}

.conversation-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.conversation-title strong,
.message-author,
.file-card strong,
.attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-title strong {
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.conversation-time {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.72rem;
}

.conversation-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.conversation-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview svg {
  width: 14px;
  height: 14px;
}

.conversation-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.conversation-meta svg {
  width: 12px;
  height: 12px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 850;
  box-shadow: inset 0 -14px 22px rgba(15, 23, 42, 0.12), 0 8px 18px rgba(15, 23, 42, 0.12);
}

.avatar.small {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
  box-shadow: inset 0 -8px 14px rgba(15, 23, 42, 0.12);
}

.avatar.large {
  width: 76px;
  height: 76px;
  font-size: 1.35rem;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -8px;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 7px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.2;
}

.badge.good,
.status-pill.good {
  background: rgba(0, 128, 105, 0.12);
  color: var(--good);
}

.badge.warn,
.status-pill.warn {
  background: rgba(161, 98, 7, 0.12);
  color: var(--warn);
}

.badge.danger,
.status-pill.danger {
  background: rgba(220, 38, 38, 0.10);
  color: var(--danger);
}

.list-empty,
.empty-state {
  color: var(--muted);
  text-align: center;
}

.list-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 28px;
}

.list-empty p,
.empty-state p {
  margin-bottom: 8px;
}

.empty-orb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 18px 34px rgba(42, 171, 238, 0.22);
}

.empty-orb.large {
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--chat-bg);
}

.chat-panel::before {
  display: none;
}

.chat-header,
.messages,
.safety-strip,
.composer,
.empty-state {
  position: relative;
  z-index: 1;
}

.chat-header {
  min-height: 68px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.chat-identity {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.chat-identity h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-identity p {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px max(28px, 8vw) 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-width: 0;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-row.mine .avatar {
  display: none;
}

.message-bubble {
  position: relative;
  width: fit-content;
  max-width: min(68%, 650px);
  padding: 8px 10px 6px;
  border-radius: var(--radius);
  background: var(--bubble-in);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.11);
}

.message-row.mine .message-bubble {
  background: var(--bubble-out);
}

.message-bubble.flagged {
  outline: 2px solid rgba(161, 98, 7, 0.24);
  background: #fff7df;
}

.message-author {
  display: block;
  max-width: 100%;
  margin-bottom: 3px;
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 850;
}

.message-row.mine .message-author {
  display: none;
}

.message-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.message-text.deleted {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-style: italic;
}

.inline-token {
  color: var(--blue-dark);
  font-weight: 850;
}

.inline-token.mention {
  color: var(--teal);
}

.message-reply {
  display: grid;
  gap: 2px;
  width: 100%;
  max-width: 310px;
  margin-bottom: 7px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  text-align: left;
}

.message-reply strong,
.message-reply span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply strong {
  color: var(--teal);
  font-size: 0.74rem;
}

.message-reply span {
  font-size: 0.78rem;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.message-meta svg {
  width: 14px;
  height: 14px;
  color: #53bdeb;
}

.message-meta .meta-star {
  color: var(--warn);
  fill: currentColor;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 300px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.message-bubble:hover .message-actions,
.message-bubble:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.message-actions button,
.reaction-chip {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.78rem;
}

.message-actions button:hover,
.reaction-chip:hover,
.reaction-chip.mine {
  border-color: rgba(0, 128, 105, 0.24);
  color: var(--teal);
  background: rgba(0, 128, 105, 0.10);
}

.message-actions svg {
  width: 15px;
  height: 15px;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.reaction-chip {
  display: inline-flex;
  gap: 4px;
  padding: 0 8px;
  font-weight: 850;
}

.poll-card {
  display: grid;
  gap: 8px;
  min-width: min(320px, 72vw);
  margin-top: 6px;
}

.poll-card > strong {
  color: var(--ink);
}

.poll-options {
  display: grid;
  gap: 6px;
}

.poll-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  text-align: left;
}

.poll-option span,
.poll-option strong {
  position: relative;
  z-index: 1;
}

.poll-option i {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  background: rgba(42, 171, 238, 0.16);
}

.poll-option.is-voted {
  border-color: rgba(0, 128, 105, 0.28);
}

.poll-card small {
  color: var(--muted);
  font-weight: 800;
}

.chat-empty-note {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 28px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  font-size: 0.82rem;
  font-weight: 800;
}

.attachments {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.attachment {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: min(300px, 100%);
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.05);
}

.attachment-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #dde6ef;
  color: var(--muted);
}

.attachment span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.file-link {
  display: inline-flex;
  border: 0;
  padding: 0;
  margin-top: 4px;
  color: var(--blue-dark);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

.safety-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-top: 1px solid rgba(161, 98, 7, 0.18);
  background: rgba(255, 247, 223, 0.92);
  color: #6b4b00;
  font-size: 0.84rem;
  font-weight: 800;
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 9px;
  align-items: end;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.composer-context {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  background: rgba(0, 128, 105, 0.08);
}

.composer-context strong,
.composer-context small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-context strong {
  color: var(--teal);
  font-size: 0.78rem;
}

.composer-context small {
  color: var(--muted);
  margin-top: 2px;
}

.composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 136px;
  resize: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--ink);
  outline: none;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
  line-height: 1.35;
}

.composer textarea:focus {
  border-color: rgba(42, 171, 238, 0.36);
  box-shadow: 0 0 0 4px rgba(42, 171, 238, 0.10);
}

.composer-button.send {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 10px 22px rgba(0, 128, 105, 0.20);
}

.composer-button.is-recording {
  color: #ffffff;
  background: var(--danger);
  animation: recordPulse 1s ease-in-out infinite;
}

@keyframes recordPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.composer-button:disabled,
.primary-button:disabled {
  opacity: 0.45;
}

.pending-files {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.82rem;
}

.file-chip span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, 100vw);
  height: 100vh;
  height: 100dvh;
  padding: 16px;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

body.control-open .control-panel {
  transform: translateX(0);
}

.control-header {
  min-height: 52px;
  padding-bottom: 2px;
}

.control-card,
.safety-card,
.file-card,
.activity-item,
.request-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}

.control-card,
.safety-card {
  padding: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.safety-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.08), rgba(0, 128, 105, 0.08));
  border-color: rgba(42, 171, 238, 0.18);
}

.safety-visual {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #ffffff;
}

.safety-card p,
.control-card p {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.4;
}

.god-panel {
  display: grid;
  gap: 12px;
}

.god-hero,
.god-card,
.god-metric {
  border: 1px solid rgba(42, 171, 238, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(0, 128, 105, 0.86));
  color: #ffffff;
}

.god-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.god-hero h3,
.god-hero p,
.god-hero small {
  margin: 0;
  color: inherit;
}

.god-hero small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.74);
}

.god-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.god-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.god-metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line-soft);
}

.god-metric svg {
  color: var(--teal);
}

.god-metric strong {
  font-size: 1.18rem;
}

.god-metric span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.god-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.god-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-soft);
}

.god-card h4 {
  margin: 0;
}

.god-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius);
  background: var(--wash);
}

.god-row span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.god-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.god-row-button {
  width: 100%;
  border: 0;
  text-align: left;
}

.setting-row,
.request-item,
.activity-item,
.file-card,
.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.setting-row,
.contact-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.setting-row:last-child,
.contact-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-row strong,
.contact-row strong,
.request-item strong,
.activity-item strong {
  display: block;
  margin-bottom: 3px;
}

.setting-row span,
.contact-row span,
.request-item span,
.activity-item span,
.file-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 160ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

.switch input:checked + .slider {
  background: var(--teal);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.field input,
.field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
}

.request-list,
.activity-list,
.file-list,
.notification-list,
.notification-grid {
  display: grid;
  gap: 8px;
}

.request-item,
.activity-item,
.file-card,
.notification-card {
  padding: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.notification-card.is-unread {
  border-color: rgba(0, 128, 105, 0.24);
  background: rgba(0, 128, 105, 0.08);
}

.notification-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.notification-card strong,
.notification-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.button-row {
  display: flex;
  gap: 6px;
}

.mini-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 8px 11px;
  font-weight: 850;
  color: var(--ink);
  background: var(--paper);
}

.mini-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.primary-button {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.secondary-button:hover,
.mini-button:hover {
  background: var(--wash);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px;
}

.feature-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 100%;
  padding: 18px;
  overflow-y: auto;
}

.feature-header,
.status-composer,
.status-card,
.broadcast-panel,
.channel-composer,
.channel-post,
.search-result-card,
.group-permissions {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.feature-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-composer,
.channel-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: end;
  padding: 12px;
}

.status-composer textarea,
.channel-composer textarea,
.inline-form input,
.inline-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--paper);
}

.status-composer textarea,
.channel-composer textarea {
  resize: vertical;
  min-height: 46px;
}

.status-grid,
.channel-feed,
.search-results {
  display: grid;
  gap: 10px;
  align-content: start;
}

.status-card,
.channel-post {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.status-card header,
.channel-post header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.status-card header span,
.channel-post header span {
  min-width: 0;
}

.status-card header strong,
.status-card header small,
.channel-post header strong,
.channel-post header small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card header small,
.channel-post header small {
  color: var(--muted);
  font-size: 0.76rem;
}

.status-card p,
.channel-post p {
  margin: 0;
  line-height: 1.45;
}

.action-list {
  border-bottom: 1px solid var(--line-soft);
}

.broadcast-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.broadcast-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 8px;
}

.search-result-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.search-result-card span,
.search-result-card strong,
.search-result-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.group-permissions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px 18px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
}

.group-permissions strong,
.group-permissions span {
  display: block;
}

.group-permissions span {
  color: var(--muted);
  font-size: 0.78rem;
}

.group-permissions label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.group-permissions select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--ink);
  background: var(--paper);
}

.permission-members {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.permission-member {
  grid-auto-flow: column;
  grid-auto-columns: auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--paper);
}

.permission-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.button-row.wide {
  margin-top: 10px;
  flex-wrap: wrap;
}

.welcome-card {
  width: min(360px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.modal {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: min(540px, calc(100vw - 28px));
  width: 540px;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--paper);
}

.member-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.member-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.member-option span,
.member-option strong,
.member-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.member-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.file-viewing {
  overflow: hidden;
}

.file-viewer {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
}

.file-viewer[hidden] {
  display: none;
}

.file-viewer-window {
  width: min(920px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.file-viewer-header,
.file-viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
}

.file-viewer-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.file-viewer-header div {
  min-width: 0;
}

.file-viewer-header strong,
.file-viewer-header span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-viewer-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-viewer-content {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #0f172a;
}

.file-viewer-media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-viewer-frame {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #ffffff;
}

.file-viewer-empty {
  width: min(360px, calc(100% - 28px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  color: #e2e8f0;
  text-align: center;
}

.file-viewer-empty svg {
  width: 42px;
  height: 42px;
}

.file-viewer-empty span {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.file-viewer-empty audio {
  width: min(320px, 100%);
}

.file-viewer-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: stretch;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.72);
}

.incoming-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.call-window {
  position: relative;
  isolation: isolate;
  align-self: center;
  justify-self: center;
  width: min(920px, 100%);
  height: min(760px, calc(100vh - 20px));
  height: min(760px, calc(100dvh - 20px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 18px 142px;
  border-radius: var(--radius);
  background: #0f172a;
  color: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.call-window.is-audio {
  width: min(620px, 100%);
}

.call-top,
.call-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.call-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(220, 38, 38, 0.92);
}

.call-top p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.call-status {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.call-window.is-video .video-grid {
  position: relative;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: #020617;
}

.video-tile {
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: #1e293b;
}

.call-window.is-video .video-tile {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: #020617;
}

.call-window.is-video .video-tile.is-remote {
  z-index: 1;
}

.call-window.is-video .video-tile.is-local {
  z-index: 2;
  inset: 14px 14px auto auto;
  width: min(190px, 34vw);
  height: min(238px, 30vh);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

.call-window.is-video .video-tile.is-local:only-child {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-tile audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.video-tile.audio-only {
  background: #182334;
}

.video-tile .avatar {
  width: 82px;
  height: 82px;
  font-size: 1.5rem;
}

.video-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.48);
  font-weight: 850;
  font-size: 0.82rem;
}

.call-controls {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
  z-index: 5;
  justify-content: center;
  flex-wrap: wrap;
}

.call-control {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.call-control-wide {
  width: auto;
  min-width: 88px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
}

.call-control.danger {
  background: var(--danger);
}

.call-control.is-off {
  background: #64748b;
}

.call-end-fab {
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 158px;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 22px 44px rgba(220, 38, 38, 0.34);
  transform: translateX(-50%);
  font-weight: 900;
}

.toast-zone {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 40;
}

.toast {
  width: min(330px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

	  .mobile-tabs {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 10%, rgba(42, 171, 238, 0.28), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(0, 128, 105, 0.24), transparent 30%),
    #0f172a;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 1.5rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-weight: 850;
}

.auth-tab.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 66px minmax(300px, 380px) minmax(0, 1fr);
  }

  .messages {
    padding-left: max(18px, 5vw);
    padding-right: max(18px, 5vw);
  }
}

@media (max-width: 820px) {
  body {
    background: var(--paper);
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 62px;
    box-shadow: none;
  }

  body.chat-focus .app-shell {
    padding-bottom: 0;
  }

  .rail {
    display: none;
  }

  .conversation-panel,
  .chat-panel {
    grid-column: 1;
    grid-row: 1;
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px);
  }

  body.chat-focus .conversation-panel,
  body.chat-focus .chat-panel {
    height: 100vh;
    height: 100dvh;
  }

  .conversation-panel {
    z-index: 2;
    transform: translateX(0);
    transition: transform 180ms ease;
  }

  body.chat-focus .conversation-panel {
    pointer-events: none;
    transform: translateX(-110vw);
  }

  .chat-panel {
    z-index: 1;
  }

  body.chat-focus .chat-panel {
    z-index: 3;
  }

  .panel-header {
    min-height: 64px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
  }

  .panel-header .icon-button {
    color: #ffffff;
  }

  .panel-header .icon-button:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  .profile-switcher,
  .search-box,
  .chat-filters {
    margin-left: 0;
    margin-right: 0;
  }

  .chat-header {
    min-height: 60px;
    padding: 8px 10px;
  }

  .back-mobile {
    display: inline-grid;
  }

  .chat-identity {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
  }

  .chat-identity .avatar {
    width: 40px;
    height: 40px;
  }

  .chat-actions {
    gap: 0;
  }

  .messages {
    padding: 12px 9px;
  }

  .message-row {
    gap: 5px;
  }

  .message-row .avatar {
    display: none;
  }

  .message-bubble {
    max-width: 84%;
  }

  .message-actions {
    opacity: 1;
    transform: none;
  }

  .composer {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    gap: 6px;
    padding: 8px;
  }

  .composer-button {
    width: 38px;
    height: 38px;
  }

  .control-panel {
    width: 100vw;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
	    grid-template-columns: repeat(7, 1fr);
    height: 62px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
  }

  body.chat-focus .mobile-tabs {
    display: none;
  }

	  .mobile-tab {
	    position: relative;
	    border: 0;
    gap: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 0.64rem;
    font-weight: 850;
  }

  .mobile-tab svg {
    width: 18px;
    height: 18px;
  }

	  .mobile-tab.is-active {
	    color: var(--teal);
	    background: rgba(0, 128, 105, 0.08);
	  }

	  .mobile-tab .nav-badge {
	    top: 5px;
	    right: 12px;
	    border-color: #ffffff;
	  }

  .toast-zone {
    left: 12px;
    right: 12px;
    bottom: 76px;
  }

  body.chat-focus .toast-zone {
    bottom: 86px;
  }

  .toast {
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .file-viewer {
    padding: 0;
  }

  .file-viewer-window {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .file-viewer-content {
    min-height: 0;
  }

  .file-viewer-frame {
    min-height: 100%;
  }

  .file-viewer-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .member-picker,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .call-overlay {
    padding: 0;
  }

  .call-window {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    padding: 14px 14px 148px;
  }

  .call-top {
    align-items: flex-start;
  }

  .call-top h2 {
    font-size: 1.05rem;
  }

  .call-status {
    font-size: 0.76rem;
  }

  .call-close {
    width: 46px;
    height: 46px;
  }

  .call-controls {
    left: 10px;
    right: 10px;
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
    gap: 8px;
  }

  .call-control {
    width: 48px;
    height: 48px;
  }

  .call-control-wide {
    min-width: 76px;
    padding: 0 12px;
  }

  .call-window.is-video .video-tile.is-local {
    inset: 10px 10px auto auto;
    width: min(124px, 35vw);
    height: min(168px, 28vh);
    border-radius: 14px;
  }

  .call-end-fab {
    min-width: 148px;
    min-height: 56px;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
  }

  .feature-panel {
    padding: 10px;
  }

  .feature-header,
  .status-composer,
  .channel-composer,
  .inline-form,
  .group-permissions {
    grid-template-columns: 1fr;
  }

  .god-metrics,
  .god-columns {
    grid-template-columns: 1fr;
  }

  .feature-header {
    align-items: stretch;
  }

  .inline-form {
    display: grid;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.32rem;
  }

  .profile-switcher,
  .chat-filters {
    padding-left: 10px;
    padding-right: 10px;
  }

  .search-box {
    margin-left: 10px;
    margin-right: 10px;
  }

  .conversation-item {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 68px;
    padding: 8px 10px;
  }

  .conversation-title strong {
    font-size: 0.94rem;
  }

  .chat-actions .call-button,
  .chat-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .chat-identity p {
    max-width: 46vw;
  }

  .message-bubble {
    max-width: 88%;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .file-viewer-actions {
    flex-wrap: wrap;
  }

  .file-viewer-actions .primary-button,
  .file-viewer-actions .secondary-button {
    flex: 1 1 150px;
  }

  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    flex: 1 1 150px;
  }
}
