:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --bg-2: #e8eef1;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: rgba(247, 249, 246, 0.9);
  --surface-tint: rgba(229, 244, 241, 0.86);
  --text: #172026;
  --muted: #64717d;
  --line: rgba(29, 41, 51, 0.12);
  --line-strong: rgba(29, 41, 51, 0.2);
  --accent: #0f766e;
  --accent-strong: #0b5f5a;
  --accent-soft: #dff3ee;
  --blue: #3157a4;
  --amber: #a05d16;
  --ok: #147a55;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --warn-soft: #fff7ed;
  --radius-card: 8px;
  --radius-control: 12px;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
  --shadow-soft: 0 10px 30px rgba(23, 32, 38, 0.08);
  --workspace-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08) 0%, transparent 34%),
    linear-gradient(205deg, rgba(49, 87, 164, 0.1) 0%, transparent 38%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: Inter, "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  -webkit-tap-highlight-color: rgba(15, 118, 110, 0.16);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 38, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 38, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 80%);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

h1 {
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.muted,
.empty {
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  margin-top: 6px;
}

.shell,
.login-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom));
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  min-height: 56px;
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-badge,
.agent-avatar,
.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 850;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #0f8f83 0%, #0b5f5a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 24px rgba(15, 118, 110, 0.22);
}

.top-actions,
.counters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: flex-end;
  min-width: 0;
}

.counters {
  flex-wrap: wrap;
}

.counters span,
.meta span,
.inline-state {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.counters span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
}

.counters strong,
.metric-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.counters small,
.metric-row small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.counter-alert {
  border-color: rgba(180, 35, 24, 0.28) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.live-status,
.menu-shortcut,
.back,
.button-link,
button {
  touch-action: manipulation;
}

.live-status,
.menu-shortcut {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-weight: 800;
}

.live-status {
  min-width: 72px;
  padding: 0 11px;
  color: var(--ok);
  font-size: 11px;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.live-status[data-state="warn"] {
  color: var(--amber);
  background: var(--warn-soft);
}

.live-status[data-state="update"] {
  color: var(--blue);
}

.menu-shortcut {
  padding: 0 13px;
  color: var(--text);
}

.menu-shortcut:hover,
.menu-shortcut.active {
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.28);
}

.warning,
.alert,
.success {
  border-radius: var(--radius-card);
  padding: 10px 12px;
  line-height: 1.4;
}

.warning {
  background: var(--warn-soft);
  border: 1px solid #f5bd7a;
  color: #7a3b08;
}

.alert {
  background: #fff1f0;
  border: 1px solid #f3a49d;
  color: #941b12;
}

.success {
  background: #e9f8f0;
  border: 1px solid #91d8b4;
  color: #126641;
}

.compact {
  margin: 0;
}

.page-banner {
  margin-bottom: 10px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea {
  min-height: 44px;
  resize: vertical;
}

button,
.back,
.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  padding: 0 14px;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

button:hover,
.back:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.ghost,
.button-link.ghost {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

.ghost:hover,
.button-link.ghost:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.wide {
  width: 100%;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
.button-link:focus-visible,
.account-trigger:focus-visible,
.bubble-link:focus-visible,
.back:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  height: var(--workspace-height);
  max-height: var(--workspace-height);
  min-height: 0;
  overflow: hidden;
}

.sidebar,
.workspace-main,
.chat-panel {
  min-width: 0;
}

.sidebar,
.workspace-main {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.workspace-main {
  grid-template-rows: minmax(0, 1fr);
}

.sidebar-card,
.panel-card,
.chat-panel,
.detail,
.login-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.18);
}

.sidebar-card,
.panel-card,
.detail,
.login-panel {
  padding: 14px;
}

.sidebar-title,
.lane-head,
.chat-header,
.screen-head,
.ops-head,
.menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-title,
.lane-head,
.chat-header {
  margin-bottom: 12px;
}

.sidebar-title span,
.lane-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.primary-nav,
.thread-list,
.task-lane,
.approval-list,
.ops-list,
.security-panel,
.totp-enroll,
.totp-actions,
.panel-list,
.signal-list,
.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-item,
.thread-item,
.panel-item,
.project-card,
.agent-card,
.approval-card,
.security-panel,
.ops-item,
.signal,
.detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.64);
}

.nav-item {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 11px 12px 11px 16px;
  color: var(--text);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-item.active {
  background: var(--surface-tint);
  border-color: rgba(15, 118, 110, 0.24);
}

.nav-item.active::before {
  background: var(--accent);
}

.nav-item small,
.signal-label {
  color: var(--muted);
  font-size: 12px;
}

.thread-item,
.panel-item,
.project-card,
.approval-card,
.security-panel,
.ops-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.thread-item.active,
.ops-item-live {
  background: var(--surface-tint);
  border-color: rgba(15, 118, 110, 0.24);
}

.thread-item:hover,
.panel-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.26);
  box-shadow: var(--shadow-soft);
}

.thread-item p,
.agent-card p,
.ops-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.thread-top,
.thread-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.thread-top span,
.thread-meta span {
  color: var(--muted);
  font-size: 12px;
}

.section-grid {
  display: grid;
  gap: 12px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.section-grid-context {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 368px);
  align-items: stretch;
}

.context-panel {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.chat-feed {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  scroll-behavior: smooth;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.22)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.035), transparent 28%, rgba(49, 87, 164, 0.035));
}

.chat-feed::-webkit-scrollbar,
.panel-fill::-webkit-scrollbar,
.context-panel::-webkit-scrollbar {
  width: 10px;
}

.chat-feed::-webkit-scrollbar-thumb,
.panel-fill::-webkit-scrollbar-thumb,
.context-panel::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(100, 113, 125, 0.35);
  background-clip: padding-box;
}

.bubble {
  display: grid;
  gap: 9px;
  max-width: min(76%, 760px);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.08);
  overflow-wrap: anywhere;
}

.bubble p {
  line-height: 1.48;
}

.bubble-user {
  justify-self: end;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(180deg, #d9f2ec 0%, #c6e7e1 100%);
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-bottom-right-radius: 6px;
}

.bubble-system {
  justify-self: start;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(29, 41, 51, 0.14);
  border-bottom-left-radius: 6px;
}

.bubble-empty {
  justify-self: center;
  max-width: 520px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bubble-route,
.meta,
.metric-row,
.run-actions,
.approval-actions,
.detail-actions,
.composer-buttons,
.prepare-draft-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bubble-route span,
.bubble-link,
.inline-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
}

.bubble-link {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 13px;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-card {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.68);
}

.attachment-card strong {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.composer-dock {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 14px 12px;
  backdrop-filter: blur(18px) saturate(1.1);
}

.composer-dock form {
  gap: 8px;
}

.composer-dock textarea {
  min-height: 42px;
  max-height: 132px;
  border-radius: 14px;
  line-height: 20px;
  resize: none;
  overflow-y: hidden;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-hint {
  color: var(--muted);
  font-size: 12px;
}

.composer-buttons {
  justify-content: flex-end;
}

.file-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
}

.file-trigger span {
  color: var(--text);
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
}

.file-trigger input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.composer-dock form[data-submitting="true"] textarea {
  opacity: 0.72;
}

.panel-fill {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.screen-head {
  margin-bottom: 14px;
}

.screen-head form {
  min-width: fit-content;
}

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

.task-lane {
  align-content: start;
}

.project-grid,
.agent-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.project-card,
.agent-card {
  padding: 13px;
}

.agent-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--accent-soft), rgba(213, 230, 248, 0.92));
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--accent);
  font-size: 12px;
}

.metric-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.compact-row {
  margin-top: 8px;
}

.state-ok {
  color: var(--ok);
}

.state-warn {
  color: var(--amber);
}

.status-pill {
  color: var(--text) !important;
  font-weight: 820;
}

.result-preview,
.routing-box,
.result-box {
  width: 100%;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 10px 12px;
  line-height: 1.45;
}

.routing-box,
.result-box {
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.menu-screen {
  max-width: 780px;
}

.settings-form {
  max-width: 520px;
}

.logout-form {
  display: block;
}

.ops-panel {
  margin-top: 14px;
}

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

.ops-item p {
  line-height: 1.42;
}

.approval-card,
.security-panel {
  padding: 13px;
}

.totp-help {
  color: var(--text);
  line-height: 1.45;
}

.totp-secret-card,
.totp-uri-details {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.totp-secret-card span,
.totp-uri-details summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.totp-secret-card code,
.totp-uri-details code {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  padding: 10px;
  user-select: all;
}

.totp-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(430px, calc(100vw - 28px));
  padding: 20px;
}

.login-panel h1 {
  font-size: 34px;
}

.login-panel form {
  gap: 12px;
}

.detail {
  display: grid;
  flex: 1 1 auto;
  gap: 16px;
  min-height: 0;
  overflow: auto;
}

dl {
  display: grid;
  gap: 11px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.back {
  min-width: 42px;
  padding: 0 12px;
}

.account-menu {
  position: relative;
}

.account-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #0f8f83, #0b5f5a);
  font-size: 12px;
}

.account-name {
  font-weight: 760;
}

.menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.mobile-nav {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111713;
    --bg-2: #151b20;
    --surface: rgba(30, 38, 34, 0.82);
    --surface-solid: #1a211d;
    --surface-soft: rgba(27, 35, 31, 0.9);
    --surface-tint: rgba(20, 82, 76, 0.46);
    --text: #edf3ee;
    --muted: #a6b2ac;
    --line: rgba(237, 243, 238, 0.14);
    --line-strong: rgba(237, 243, 238, 0.22);
    --accent: #5fc9ba;
    --accent-strong: #9ee4dc;
    --accent-soft: rgba(38, 113, 102, 0.45);
    --blue: #9eb8ff;
    --amber: #f3b05d;
    --ok: #63d39e;
    --danger: #ff7a6b;
    --danger-soft: rgba(180, 35, 24, 0.18);
    --warn-soft: rgba(160, 93, 22, 0.18);
  }

  input,
  textarea,
  .sidebar-card,
  .panel-card,
  .chat-panel,
  .detail,
  .login-panel,
  .bubble-system,
  .composer-dock,
  .nav-item,
  .thread-item,
  .panel-item,
  .project-card,
  .agent-card,
  .approval-card,
  .security-panel,
  .ops-item {
    background-color: rgba(27, 35, 31, 0.72);
  }

  .bubble-user {
    background: linear-gradient(180deg, rgba(30, 105, 95, 0.85), rgba(25, 82, 75, 0.9));
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 232px minmax(0, 1fr);
  }

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

  .context-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .task-lanes {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  :root {
    --workspace-height: calc(100dvh - 82px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  body {
    overflow: hidden;
  }

  .shell {
    padding: calc(8px + env(safe-area-inset-top)) 9px calc(72px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 48px;
    gap: 8px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 23px;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-block {
    gap: 9px;
  }

  .brand-block .muted,
  .counters {
    display: none;
  }

  .top-actions .menu-shortcut {
    display: none;
  }

  .live-status {
    min-width: 58px;
    min-height: 34px;
    padding: 0 9px;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    gap: 0;
  }

  .sidebar-card,
  .panel-card,
  .chat-feed,
  .composer-dock {
    padding-left: 12px;
    padding-right: 12px;
  }

  .chat-feed {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .bubble {
    padding: 11px 12px;
    border-radius: 16px;
  }

  .composer-dock {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .composer-dock textarea {
    min-height: 40px;
    max-height: 118px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .composer-actions {
    align-items: center;
  }

  .composer-hint,
  .chat-header .muted {
    display: none;
  }

  .file-trigger,
  button,
  .back,
  .button-link {
    min-height: 40px;
  }

  .file-trigger {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .prepare-draft-form button,
  .bubble-action button,
  .panel-item button,
  .screen-head form,
  .screen-head button,
  .ops-item form,
  .ops-item button {
    width: 100%;
  }

  .screen-head,
  .ops-head {
    display: grid;
  }

  .totp-actions {
    grid-template-columns: 1fr;
  }

  .sidebar-card,
  .panel-card,
  .chat-panel,
  .detail,
  .login-panel,
  .composer-dock,
  .mobile-nav {
    background-color: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(23, 32, 38, 0.16);
  }

  .mobile-nav a {
    display: grid;
    min-height: 42px;
    place-items: center;
    border-radius: 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 830;
  }

  .mobile-nav a.active {
    background: var(--accent-soft);
    color: var(--text);
  }
}

@media (prefers-color-scheme: dark) and (max-width: 760px) {
  .sidebar-card,
  .panel-card,
  .chat-panel,
  .detail,
  .login-panel,
  .composer-dock,
  .mobile-nav {
    background-color: rgba(27, 35, 31, 0.94);
  }
}

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