:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f9fbff;
  --text: #142033;
  --muted: #68758a;
  --line: #dde5f0;
  --line-strong: #c8d4e3;
  --accent: #2388e8;
  --accent-strong: #1266bb;
  --good: #1f9d6a;
  --warn: #df8b1f;
  --bad: #d94b55;
  --violet: #7d5bed;
  --shadow: 0 20px 50px rgba(35, 54, 82, 0.12);
  --radius: 8px;
  --radius-lg: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(35, 136, 232, 0.12), transparent 32rem),
    linear-gradient(135deg, #f7f9fd 0%, var(--bg) 52%, #eef4fb 100%);
  color: var(--text);
}

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

button {
  min-height: 40px;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(35, 136, 232, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.boot-screen,
.empty-state,
.access-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-content: center;
  padding: 28px;
  text-align: center;
}

.boot-mark,
.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2388e8, #1f9d6a);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(35, 136, 232, 0.26);
}

.boot-screen h1,
.access-screen h1 {
  margin: 18px 0 8px;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
}

.boot-screen p,
.access-screen p,
.empty-state p {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.workspace {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  gap: 18px;
  padding: calc(18px + var(--safe-top)) 14px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 10px;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 780;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  transition-duration: 150ms;
  transition-property: background-color, color, transform;
  transition-timing-function: ease-out;
}

.nav-button:hover {
  background: rgba(35, 136, 232, 0.08);
  color: var(--text);
}

.nav-button:active {
  transform: scale(0.98);
}

.nav-button.active {
  background: #e7f1fd;
  color: var(--accent-strong);
  font-weight: 720;
}

.nav-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nav-icon,
.metric-icon,
.mini-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: currentColor;
}

.nav-count {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(20, 32, 51, 0.08);
  color: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 3px 7px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 8px 0;
}

.user-mini {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #dcefff;
  color: var(--accent-strong);
  font-weight: 800;
}

.user-mini strong,
.chat-title,
.source-title,
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mini span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: calc(22px + var(--safe-top)) 22px calc(26px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
}

.page-subtitle {
  margin: 8px 0 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(125, 91, 237, 0.22);
  border-radius: var(--radius);
  background: rgba(125, 91, 237, 0.1);
  color: var(--text);
  padding: 10px 12px;
}

.access-actions {
  justify-content: center;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0 13px;
  font-weight: 690;
  transition-duration: 150ms;
  transition-property: transform, background-color, border-color, color, box-shadow;
  transition-timing-function: ease-out;
}

.button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(35, 54, 82, 0.08);
}

.button:active {
  transform: scale(0.97);
}

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(35, 136, 232, 0.24);
}

.button.danger {
  border-color: rgba(217, 75, 85, 0.22);
  color: var(--bad);
}

.grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manager-home-panel {
  margin-top: 14px;
}

.metric {
  display: grid;
  gap: 10px;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(35, 54, 82, 0.06);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin: 0;
  font-size: 32px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.dialogs-layout {
  grid-template-columns: minmax(250px, 0.52fr) minmax(0, 1.48fr);
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(35, 54, 82, 0.06);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 780;
}

.panel-body {
  padding: 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  min-height: 36px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0 12px;
  transition-duration: 150ms;
  transition-property: background-color, color, border-color, transform;
}

.chip.active {
  background: #e7f1fd;
  border-color: rgba(35, 136, 232, 0.24);
  color: var(--accent-strong);
  font-weight: 720;
}

.list {
  display: grid;
  gap: 10px;
}

.chat-row,
.source-row,
.user-row,
.alert-row,
.settings-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
  transition-duration: 150ms;
  transition-property: border-color, box-shadow, transform, background-color;
}

.chat-row {
  grid-template-columns: minmax(0, 1fr);
}

.dialog-list-panel .panel-header,
.dialog-list-panel .panel-body {
  padding-inline: 12px;
}

.dialog-list-body {
  padding-top: 10px;
}

.dialog-list {
  gap: 7px;
  max-height: calc(100dvh - 230px);
  overflow: auto;
  padding-right: 2px;
}

.dialog-list .chat-row {
  gap: 6px;
  padding: 9px 10px;
}

.dialog-list .chat-preview {
  margin-top: 4px;
}

.chat-row:hover,
.source-row:hover,
.user-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(35, 54, 82, 0.08);
}

.chat-row.active,
.user-row.active {
  border-color: rgba(35, 136, 232, 0.48);
  background: #f3f9ff;
}

.chat-row.needs-admin {
  border-color: rgba(217, 75, 85, 0.34);
  background: rgba(217, 75, 85, 0.06);
}

.row-main {
  min-width: 0;
}

.row-top {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.chat-meta,
.source-meta,
.user-meta,
.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chat-preview {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #edf3fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  padding: 0 8px;
}

.badge.high {
  background: rgba(217, 75, 85, 0.12);
  color: #b6323c;
}

.badge.medium {
  background: rgba(223, 139, 31, 0.14);
  color: #a66010;
}

.badge.good {
  background: rgba(31, 157, 106, 0.12);
  color: #13774e;
}

.badge.violet {
  background: rgba(125, 91, 237, 0.12);
  color: #6043c7;
}

.chat-stage {
  display: grid;
  min-height: calc(100dvh - 142px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.messages {
  display: flex;
  min-height: 360px;
  max-height: none;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(rgba(244, 247, 251, 0.84), rgba(244, 247, 251, 0.84)),
    radial-gradient(circle at top right, rgba(31, 157, 106, 0.12), transparent 28rem);
}

.message {
  max-width: min(82%, 620px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(35, 54, 82, 0.05);
}

.message.outgoing,
.message.internal {
  align-self: flex-end;
  border-color: rgba(35, 136, 232, 0.2);
  background: #eaf4ff;
}

.message.failed {
  border-color: rgba(217, 75, 85, 0.34);
  background: #fff2f3;
}

.message-text {
  margin: 4px 0 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-error,
.text-danger {
  color: var(--bad);
}

.message-error {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.reply-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.reply-box textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  line-height: 1.45;
}

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.wide-field {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.field input,
.field select,
.field textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.45;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.checkbox-list legend {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.checkbox-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 9px 11px;
}

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

.checkbox-row span span {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.compact-field {
  margin-top: 2px;
}

.source-row,
.user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.compact-toggle {
  align-self: end;
  min-height: 42px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 18, 30, 0.38);
  backdrop-filter: blur(8px);
  animation: fade-in 160ms ease-out;
}

.bottom-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(86vh, 680px);
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  box-shadow: 0 -24px 70px rgba(20, 32, 51, 0.22);
  padding: 10px 16px calc(16px + var(--safe-bottom));
  animation: sheet-enter 180ms ease-out;
}

.wide-sheet {
  max-width: 980px;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 0 auto 10px;
}

.sheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.sheet-header h2 {
  margin: 2px 0 4px;
  font-size: 20px;
  line-height: 1.2;
  text-wrap: balance;
}

.sheet-header span {
  color: var(--muted);
  font-size: 13px;
}

.sheet-body {
  display: grid;
  min-height: 0;
  gap: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 0;
  -webkit-overflow-scrolling: touch;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(0, 1fr);
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 12px;
}

.profile-grid dt {
  color: var(--muted);
  font-size: 13px;
}

.profile-grid dd {
  margin: 0;
  min-width: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.privacy-fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.privacy-fieldset legend {
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 760;
}

.sheet-toggle {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 10px 12px;
  font-weight: 720;
}

.sheet-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.sheet-actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.sheet-actions .button {
  width: 100%;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-row {
  display: grid;
  min-height: 54px;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  transition-duration: 150ms;
  transition-property: border-color, background-color, box-shadow;
}

.choice-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(35, 54, 82, 0.08);
}

.choice-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.choice-row span span {
  color: var(--muted);
  font-size: 13px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-enter {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert-row {
  border-left: 4px solid var(--warn);
}

.alert-row.high {
  border-left-color: var(--bad);
}

.alert-row.medium {
  border-left-color: var(--warn);
}

.alert-row.low {
  border-left-color: var(--good);
}

.alert-title {
  margin: 0;
  font-weight: 760;
}

.alert-copy {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
}

.request-attachment-preview {
  display: block;
  width: min(100%, 320px);
  max-height: 220px;
  object-fit: contain;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.attachment-link {
  width: fit-content;
  margin-top: 8px;
}

.settings-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.setting-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mini-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  padding: 0 8px;
}

.mini-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.agent-list {
  margin-top: 14px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  align-items: center;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cfd8e6;
  transition-duration: 150ms;
  transition-property: background-color;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.22);
  content: "";
  transition-duration: 150ms;
  transition-property: transform;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.notice {
  border: 1px solid rgba(35, 136, 232, 0.2);
  border-radius: var(--radius);
  background: #edf6ff;
  color: #174d82;
  line-height: 1.45;
  padding: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 32, 51, 0.96);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition-duration: 180ms;
  transition-property: opacity, transform;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.mobile-bar {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-2 {
    grid-template-columns: 1fr;
  }

  .chat-stage {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .workspace {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: calc(14px + var(--safe-top)) 12px calc(84px + var(--safe-bottom));
  }

  .topbar {
    display: grid;
  }

  .view-as-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

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

  .panel-header,
  .chat-row,
  .source-row,
  .user-row,
  .member-row,
  .settings-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .setting-toggles {
    justify-content: flex-start;
  }

  .bottom-sheet {
    max-height: calc(100dvh - 12px - var(--safe-top));
    border-radius: 16px 16px 0 0;
    padding-right: 12px;
    padding-left: 12px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 92%;
  }

  .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 12;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 4px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    padding: 7px 8px calc(7px + var(--safe-bottom));
  }

  .mobile-bar .nav-button {
    min-height: 50px;
    justify-content: center;
    padding: 0 6px;
  }

  .mobile-bar .nav-label {
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
  }

  .mobile-bar .nav-count {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111821;
    --panel: #182332;
    --panel-2: #131e2a;
    --text: #eef4fb;
    --muted: #93a5bb;
    --line: #2b394a;
    --line-strong: #3d5066;
    --accent: #57a8ff;
    --accent-strong: #8ac3ff;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(87, 168, 255, 0.12), transparent 32rem),
      linear-gradient(135deg, #101720 0%, #111821 55%, #121f29 100%);
  }

  .sidebar,
  .panel,
  .metric {
    background: rgba(24, 35, 50, 0.88);
  }

  .nav-button.active,
  .chip.active,
  .chat-row.active,
  .user-row.active,
  .message.outgoing,
  .message.internal,
  .notice {
    background: rgba(87, 168, 255, 0.13);
  }

  .notice {
    color: #bbdbff;
  }

  .mobile-bar {
    background: rgba(17, 24, 33, 0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
