:root {
  color-scheme: light;
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #e9eef6;
  --text: #1b232c;
  --muted: #5f6b79;
  --line: #dce2ea;
  --line-strong: #c8d1dc;
  --accent: #2354c5;
  --accent-hover: #1b46a8;
  --accent-soft: #e7eeff;
  --on-accent: #ffffff;
  --incoming: #ffffff;
  --outgoing: #2354c5;
  --danger: #b3261e;
  --warning: #8a5a00;
  --avatar: hsl(var(--account-hue, 220) 45% 42%);
  --shadow: 0 10px 28px rgba(27, 35, 44, .12);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f141a;
    --surface: #171d25;
    --surface-2: #1d242d;
    --surface-3: #25303b;
    --text: #e9eef5;
    --muted: #a0acb9;
    --line: #2a343f;
    --line-strong: #3a4653;
    --accent: #779bff;
    --accent-hover: #93b0ff;
    --accent-soft: #1c2b4d;
    --on-accent: #0d1420;
    --incoming: #1d242d;
    --outgoing: #2d4f9e;
    --danger: #ff8f86;
    --warning: #f0b64a;
    --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.shell { max-width: 1600px; margin: 0 auto; padding: 16px; }

/* ------------------------------------------------------------------ login */
.login {
  max-width: 430px; margin: max(8vh, 40px) auto; padding: 28px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.login h1 { font-size: 24px; letter-spacing: -.02em; }
.login-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
form { display: grid; gap: 10px; margin-top: 20px; }
label { font-size: 13px; font-weight: 600; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 11px 12px; background: var(--surface); color: var(--text);
}
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button {
  min-height: 44px; border: 0; border-radius: 9px; padding: 10px 15px;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
}
button:hover { background: var(--accent-hover); }
button:disabled { cursor: default; opacity: .45; }
button.secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); font-weight: 500;
}
button.secondary:hover { background: var(--surface-3); }
.link-button {
  min-height: 0; padding: 0; background: none; color: var(--accent);
  text-decoration: underline; font-weight: 500;
}
.link-button:hover { background: none; }
.error { min-height: 1.1em; margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }
.eyebrow {
  margin: 0 0 2px; color: var(--muted); font-size: 11px;
  font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
}

/* -------------------------------------------------------------- workspace */
.workspace { padding: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px; min-height: 64px; padding: 9px 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { min-width: 0; }
.brand h1 { font-size: 19px; letter-spacing: -.02em; }
.brand p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-button { min-height: 38px; padding: 7px 12px; }

.notifications-toggle { position: relative; }
.notification-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.notifications-panel {
  position: fixed; top: 72px; right: 18px; z-index: 38;
  width: min(390px, calc(100vw - 24px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
}
.notifications-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.notifications-head h2 { font-size: 15px; }
.notifications-list { overflow: auto; padding: 6px; }
.notification {
  display: flex; gap: 9px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 8px; background: transparent;
  color: inherit; text-align: left;
}
.notification:hover { background: var(--surface-2); }
.notification.unread { background: var(--accent-soft); }
.notification-dot {
  flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px;
  border-radius: 50%; border: 1px solid var(--line-strong);
}
.notification.unread .notification-dot { background: var(--accent); border-color: var(--accent); }
.notification-body { min-width: 0; flex: 1; }
.notification-title { display: block; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.notification-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.notifications-empty { padding: 22px 14px; color: var(--muted); text-align: center; font-size: 13px; }
.notifications-foot {
  display: flex; justify-content: flex-end; padding: 8px;
  border-top: 1px solid var(--line);
}

.app-body {
  display: grid;
  grid-template-columns: 92px minmax(290px, 360px) minmax(0, 1fr);
  height: calc(100dvh - 64px); min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}
.accounts-rail {
  display: flex; flex-direction: column; gap: 7px; align-items: stretch;
  padding: 12px 8px; overflow: auto;
  background: var(--surface-2); border-right: 1px solid var(--line);
}
.instance {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 66px; padding: 7px 4px;
  background: transparent; color: var(--text); border: 1px solid transparent;
  border-radius: 11px;
}
.instance:hover { background: var(--surface-3); }
.instance.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.account-avatar, .chat-avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--avatar); color: #fff; font-size: 12px; font-weight: 700;
}
.account-name {
  max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; line-height: 1.2;
}
.account-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.account-dot.on { background: #2fa66a; }
.account-dot.off { background: var(--danger); }

.chats-panel {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 14px; border-right: 1px solid var(--line); background: var(--surface);
}
.chats-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.chats-head h2 { font-size: 18px; letter-spacing: -.01em; }
#chats-count { font-variant-numeric: tabular-nums; }
.search-form { grid-template-columns: 1fr auto; gap: 6px; margin-top: 12px; }
.search-form input { padding: 9px 11px; font-size: 16px; }
.search-submit { min-height: 42px; padding: 8px 12px; font-size: 13px; }
.chat-list {
  display: flex; flex-direction: column; gap: 3px;
  flex: 1; min-height: 0; overflow: auto; margin-top: 8px;
  overscroll-behavior: contain;
}
.chat {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 66px; padding: 9px 8px; text-align: left;
  background: transparent; color: var(--text); border: 1px solid transparent;
  border-radius: 10px;
}
.chat:hover { background: var(--surface-2); }
.chat.selected { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.chat-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-time { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.chat-preview {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 13px;
}
.chat-meta { display: flex; align-items: center; gap: 8px; }
.chat-id { color: var(--muted); font-size: 10px; }
.chat-unread {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); overflow: hidden; text-indent: -99px;
}
.empty-state { margin: 26px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding-top: 9px; color: var(--muted); font-size: 12px;
}
.pagination button { min-height: 36px; padding: 5px 9px; font-size: 12px; }

/* ------------------------------------------------------------ conversation */
.conversation {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--surface);
}
.conversation-head {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface); z-index: 5;
}
#chat-back { display: none; flex: 0 0 auto; min-width: 42px; padding: 7px 10px; font-size: 18px; }
.conversation-title { min-width: 0; flex: 1; }
.conversation-title h2 {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 16px; letter-spacing: -.01em;
}
.conversation-title p { margin: 1px 0 0; }
.conversation-actions { position: relative; flex: 0 0 auto; }
#chat-menu { min-width: 42px; padding: 7px 10px; font-size: 20px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  width: min(310px, 78vw); padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--shadow);
}
.menu-item {
  display: block; width: 100%; min-height: 40px; padding: 9px 10px;
  background: none; color: var(--text); text-align: left; font-weight: 500;
}
.menu-item:hover { background: var(--surface-2); }
.menu-note { margin: 6px 9px 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.menu-form { display: grid; gap: 7px; padding: 7px 9px 9px; border-top: 1px solid var(--line); }
.menu-form label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.menu-form input { width: 100%; min-height: 40px; padding: 8px 9px; font-size: 16px; }
.menu-form .menu-note { margin: 0; }
.menu-form button:not(.secondary) { width: 100%; min-height: 40px; }

.messages-wrap { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.older { align-self: center; flex: 0 0 auto; min-height: 32px; margin: 8px 0 0; padding: 4px 10px; font-size: 12px; }
.messages {
  display: flex; flex-direction: column; gap: 5px;
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 18px 18px;
}
@supports (overflow-anchor: auto) { .messages { overflow-anchor: auto; } }
.date-separator {
  align-self: center; margin: 10px 0 4px; padding: 2px 9px;
  border-radius: 99px; background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 600;
}
.message {
  align-self: flex-start; max-width: min(78%, 640px);
  padding: 8px 11px 9px; border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px; background: var(--incoming);
  overflow-wrap: anywhere;
}
.message.outgoing {
  align-self: flex-end; background: var(--outgoing); color: #fff;
  border-color: transparent; border-radius: 14px 14px 4px 14px;
}
.message.system, .message.staff {
  align-self: center; max-width: 88%; padding: 4px 10px;
  background: var(--surface-2); border: 0; border-radius: 8px;
  color: var(--muted); font-size: 12px; text-align: center;
}
.message.arbitration-message { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }
.message-meta {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px; color: var(--muted); font-size: 10px;
}
.message.outgoing .message-meta { color: color-mix(in srgb, #fff 78%, transparent); }
.message-author { font-weight: 650; }
.message-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.badge {
  padding: 1px 5px; border-radius: 99px; background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning); font-size: 9px; font-weight: 700;
}
.message p { margin: 0; white-space: pre-wrap; line-height: 1.4; font-size: 14px; }
.message-image {
  display: block; max-width: 100%; max-height: 320px; margin: 2px 0 6px;
  border-radius: 8px; background: var(--surface-2); cursor: zoom-in;
}
.message-image-missing { color: var(--muted); font-size: 13px; }
.message.system p { font-size: 12px; }
.new-messages {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 6; min-height: 36px; padding: 7px 14px; font-size: 12px;
  border-radius: 99px; box-shadow: var(--shadow);
}

.composer {
  flex: 0 0 auto; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1; min-height: 44px; max-height: 168px; resize: none;
  padding: 10px 12px; font-size: 16px; line-height: 1.35;
  border-radius: 12px; background: var(--surface-2);
}
.send-button { flex: 0 0 auto; min-height: 44px; padding: 8px 15px; }
.composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 16px; margin-top: 4px; color: var(--muted); font-size: 11px;
}
.composer-foot .link-button { font-size: 11px; }
.composer .error { margin-top: 2px; }

/* ---------------------------------------------------------------- reports */
.reports-view {
  margin-top: 16px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.reports-view .section-heading { flex-wrap: wrap; }
.reports-view h2 { font-size: 18px; }
.report-scope { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.report-scope select { width: auto; min-width: 170px; padding: 8px 10px; }
.coverage-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.reports { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.report-block {
  min-width: 0; padding: 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-block h2, .report-block h3 { font-size: 15px; margin: 0; }
.report-controls { display: flex; gap: 7px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.report-controls label { font-size: 11px; flex: 1; min-width: 120px; color: var(--muted); }
.report-controls input { padding: 7px 8px; margin-top: 3px; }
.report-block > label { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.report-block > select { margin-top: 4px; padding: 8px 10px; }
.report-block p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.report-block small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
table { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: 12px; }
th, td { padding: 7px 5px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 600; }
.summary-total { font-weight: 700; color: var(--text); }
.arbitration { display: block; width: 100%; min-height: 40px; margin: 6px 0; text-align: left; font-size: 12px; }
#scan-status { min-height: 1.2em; color: var(--muted); }

/* ------------------------------------------------------------------- more */
.more-view { display: none; max-width: 720px; margin: 16px auto; padding: 18px; }
.more-view h2 { margin-bottom: 12px; }
.more-view .report-block { margin-bottom: 12px; }
.more-view .report-block .secondary { margin-top: 10px; margin-right: 8px; }

/* ---------------------------------------------------------------- settings */
.settings {
  position: fixed; z-index: 100; top: 72px; right: 16px;
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 88px);
  overflow: auto; padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.settings h2 { font-size: 18px; }
.settings .report-block { background: var(--surface-2); }
.settings label { display: block; margin-top: 10px; }
.settings input { margin-top: 4px; }
.settings code, .settings pre {
  display: block; margin: 6px 0; padding: 10px;
  background: var(--surface-3); border-radius: 8px;
  overflow-wrap: anywhere; user-select: all;
}
.settings pre { white-space: pre-wrap; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ------------------------------------------------------------ status/details */
.freshness { display: block; margin-top: 2px; font-size: 10px; line-height: 1.3; }
.chats-updated { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.heading-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-platform {
  align-self: center; flex: 0 0 auto; max-width: 92px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--muted); font-size: 9px; font-weight: 650;
}
.quick-replies-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.quick-replies {
  display: flex; flex: 1; gap: 6px; min-width: 0; overflow-x: auto;
  padding-bottom: 2px; scrollbar-width: none;
}
.quick-replies::-webkit-scrollbar { display: none; }
.quick-reply {
  flex: 0 0 auto; min-height: 32px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 9px; font-size: 11px;
}
#quick-add { flex: 0 0 auto; font-size: 11px; }
.send-warning {
  margin-top: 8px; padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line));
  border-radius: 9px; background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}
.send-warning p { margin: 0 0 7px; color: var(--warning); font-size: 12px; line-height: 1.4; }
.send-warning button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.composer.uncertain textarea { border-color: var(--warning); }

/* ------------------------------------------------------------- image viewer */
.image-view {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0, 0, 0, .82);
}
.image-view img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 8px; background: #fff;
}
.image-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  width: 44px; min-height: 44px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 24px;
}
.image-close:hover { background: rgba(255, 255, 255, .26); }

/* ------------------------------------------------------------ mobile tabs */
.mobile-tabs { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 800px) {
  .shell { padding: 0; max-width: none; }
  .login { margin: 7vh 14px; padding: 22px; }
  .topbar {
    height: calc(56px + env(safe-area-inset-top)); min-height: calc(56px + env(safe-area-inset-top)); padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .brand h1 { font-size: 17px; }
  .brand p { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { display: none; }
  .notifications-toggle { padding: 7px 10px; font-size: 12px; }
  .notifications-panel {
    top: calc(56px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto;
    max-height: calc(100dvh - 130px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .app-body {
    display: block; height: calc(100dvh - 56px - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 360px; border: 0; border-radius: 0; box-shadow: none;
  }
  .accounts-rail {
    flex-direction: row; align-items: stretch; gap: 6px;
    height: 60px; padding: 7px 10px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .accounts-rail::-webkit-scrollbar { display: none; }
  .instance {
    flex: 0 0 auto; flex-direction: row; gap: 6px;
    min-height: 46px; padding: 5px 9px;
  }
  .account-avatar { width: 28px; height: 28px; font-size: 10px; }
  .account-name { max-width: 120px; font-size: 11px; }
  .account-dot { display: none; }
  .chats-panel { height: calc(100% - 60px); padding: 12px; border: 0; }
  .chats-head h2 { font-size: 17px; }
  .chat-list { margin-top: 6px; }
  .chat { min-height: 64px; padding: 8px 5px; }
  .chat-avatar { width: 38px; height: 38px; font-size: 12px; }
  .pagination { padding-bottom: 4px; }

  .conversation { display: none; }
  .chat-open .topbar { display: none; }
  .chat-open .app-body { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .chat-open .accounts-rail, .chat-open .chats-panel { display: none; }
  .chat-open .conversation { display: flex; height: 100%; border: 0; border-radius: 0; }
  #chat-back { display: inline-flex; align-items: center; justify-content: center; }
  .conversation-head {
    min-height: 58px; padding: 8px 10px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .conversation-title h2 { font-size: 15px; }
  .messages { padding: 10px 12px 14px; }
  .message { max-width: 86%; }
  .message p { font-size: 15px; }
  .composer { padding-left: 10px; padding-right: 10px; }
  .send-button { padding-left: 12px; padding-right: 12px; }
  .mobile-tabs {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
    height: calc(58px + env(safe-area-inset-bottom));
    padding: 5px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line); backdrop-filter: blur(12px);
  }
  .mobile-tabs button {
    min-height: 46px; padding: 4px; border-radius: 9px;
    background: none; color: var(--muted); font-size: 12px; font-weight: 600;
  }
  .mobile-tabs button.selected { background: var(--accent-soft); color: var(--accent); }
  .chat-open .mobile-tabs { display: none; }

  .reports-view { display: none; margin: 0; padding: 14px; border: 0; border-radius: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tab-reports .app-body { display: none; }
  .tab-reports .reports-view { display: block; }
  .tab-reports { overflow: auto; }
  .reports { grid-template-columns: 1fr; }
  .report-scope { width: 100%; }
  .report-scope select { flex: 1; }
  .more-view { display: none; margin: 0; padding: 14px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }
  .tab-more .app-body { display: none; }
  .tab-more .more-view { display: block; }
  .settings {
    top: calc(56px + env(safe-area-inset-top)); right: 8px;
    width: calc(100vw - 16px); max-height: calc(100dvh - 72px - env(safe-area-inset-bottom));
  }
}