@font-face {
  font-family: "Barlow";
  src: url("/static/fonts/Barlow-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("/static/fonts/Barlow-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --arc-ink: oklch(0.13 0.016 256);
  --arc-base: oklch(0.16 0.02 256);
  --arc-panel-deep: oklch(0.185 0.02 256);
  --arc-panel: oklch(0.205 0.022 256);
  --arc-panel-alt: oklch(0.225 0.024 256);
  --arc-text: oklch(0.96 0.008 250);
  --arc-text-soft: oklch(0.80 0.014 250);
  --arc-text-mute: oklch(0.62 0.018 250);
  --arc-text-faint: oklch(0.52 0.018 250);
  --arc-border-hair: oklch(0.24 0.024 256);
  --arc-border-soft: oklch(0.27 0.025 256);
  --arc-border: oklch(0.30 0.03 256);
  --arc-border-strong: oklch(0.34 0.035 256);
  --arc-cyan: oklch(0.82 0.13 205);
  --arc-cyan-ink: oklch(0.14 0.02 256);
  --arc-green: oklch(0.80 0.15 150);
  --arc-amber: oklch(0.84 0.14 82);
  --arc-red: oklch(0.66 0.20 25);
  --arc-dim: oklch(0.62 0.018 250);
  --arc-squad-red: oklch(0.58 0.18 27);
  --arc-squad-blue: oklch(0.58 0.15 255);
  --arc-squad-gold: oklch(0.80 0.13 87);
  --arc-squad-silver: oklch(0.81 0.012 255);
  --arc-squad-black: oklch(0.34 0.012 256);
  --arc-squad-green: oklch(0.66 0.13 150);
  --arc-squad-gray: oklch(0.70 0.012 255);
  --arc-squad-pink: oklch(0.70 0.18 357);
  --glow-cyan: 0 0 14px oklch(0.82 0.13 205 / 0.5);
  --glow-green: 0 0 8px oklch(0.80 0.15 150);
  --glow-amber: 0 0 8px oklch(0.84 0.14 82);
  --glow-red: 0 0 8px oklch(0.66 0.20 25);
  --bg: var(--arc-base);
  --panel: var(--arc-panel);
  --panel2: var(--arc-panel-deep);
  --card: var(--arc-panel-alt);
  --line: color-mix(in oklch, var(--arc-border-hair) 72%, transparent);
  --line2: color-mix(in oklch, var(--arc-border) 78%, transparent);
  --txt: var(--arc-text-soft);
  --txt2: var(--arc-text);
  --muted: var(--arc-text-mute);
  --muted2: var(--arc-text-faint);
  --faint: var(--arc-text-faint);
  --field: var(--arc-panel-deep);
  --ok: var(--arc-green);
  --warn: var(--arc-amber);
  --pri: var(--arc-squad-gold);
  --pri2: var(--arc-squad-gold);
  --pri-wash: oklch(0.80 0.13 87 / 0.11);
  --pri-line: oklch(0.80 0.13 87 / 0.48);
  --on-pri: var(--arc-cyan-ink);
  --pri-grad: linear-gradient(180deg, oklch(0.86 0.12 87), var(--arc-squad-gold));
  --glow: oklch(0.80 0.13 87 / 0.13);
  --danger: var(--arc-red);
  --danger-wash: oklch(0.66 0.20 25 / 0.12);
  --shadow: 0 30px 80px -48px rgba(0, 0, 0, 0.9);
}

html[data-brand-theme="teams-capital"] {
  --arc-ink: #07101f;
  --arc-base: #0b1430;
  --arc-panel-deep: #0e1933;
  --arc-panel: #13203d;
  --arc-panel-alt: #182744;
  --arc-text: #f7f4ee;
  --arc-text-soft: #d9deea;
  --arc-text-mute: #929cb2;
  --arc-text-faint: #717d96;
  --arc-border-hair: #1c2b49;
  --arc-border-soft: #263756;
  --arc-border: #314363;
  --arc-border-strong: #415574;
  --arc-squad-gold: #c8a04a;
}

body[data-accent="blue"] {
  --pri: var(--arc-squad-blue);
  --pri2: oklch(0.70 0.13 255);
  --pri-wash: oklch(0.58 0.15 255 / 0.12);
  --pri-line: oklch(0.70 0.13 255 / 0.44);
  --pri-grad: linear-gradient(180deg, oklch(0.70 0.13 255), var(--arc-squad-blue));
  --glow: oklch(0.58 0.15 255 / 0.14);
}

body[data-accent="red"] {
  --pri: var(--arc-squad-red);
  --pri2: var(--arc-red);
  --pri-wash: oklch(0.58 0.18 27 / 0.15);
  --pri-line: oklch(0.66 0.20 25 / 0.62);
  --pri-grad: linear-gradient(180deg, var(--arc-red), var(--arc-squad-red));
  --glow: oklch(0.66 0.20 25 / 0.18);
}

body[data-accent="silver"] {
  --pri: var(--arc-squad-silver);
  --pri2: oklch(0.88 0.01 255);
  --pri-wash: oklch(0.81 0.012 255 / 0.1);
  --pri-line: oklch(0.81 0.012 255 / 0.42);
  --pri-grad: linear-gradient(180deg, oklch(0.88 0.01 255), var(--arc-squad-silver));
  --glow: oklch(0.81 0.012 255 / 0.1);
}

body.light {
  color-scheme: light;
  --bg: #f3f0e8;
  --panel: #fbf9f3;
  --panel2: #f6f2ea;
  --card: #ffffff;
  --line: rgba(30, 28, 42, 0.08);
  --line2: rgba(30, 28, 42, 0.14);
  --txt: #27324a;
  --txt2: #0e1a30;
  --muted: #6b7080;
  --muted2: #9a9078;
  --faint: #b0a78c;
  --field: #ffffff;
  --ok: #2fa074;
  --warn: #c99637;
  --pri: #b0823a;
  --pri2: #946a22;
  --pri-wash: rgba(176, 130, 58, 0.1);
  --pri-line: rgba(176, 130, 58, 0.38);
  --on-pri: #ffffff;
  --pri-grad: linear-gradient(160deg, #d3ab5e, #b0823a);
  --glow: rgba(176, 130, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  color: var(--txt);
  background: var(--bg);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.auth-required {
  display: block;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(58% 48% at 74% 18%, rgba(91, 141, 239, 0.12), transparent 62%),
    radial-gradient(46% 38% at 14% 86%, rgba(205, 161, 85, 0.08), transparent 60%),
    #05080f;
}

body.auth-required .sidebar,
body.auth-required .workspace,
body.auth-required #controls-panel,
body.auth-required #settings-modal,
body.auth-required #projects-modal,
body.auth-required #voice-panel {
  display: none !important;
}

body.auth-required #auth-screen {
  display: grid;
}

body.auth-ok #auth-screen {
  display: none !important;
}

body.onboarding-required {
  display: block;
  min-height: 100vh;
  overflow: auto;
  background: #eef1f6;
}

body.onboarding-required .sidebar,
body.onboarding-required .workspace,
body.onboarding-required #auth-screen,
body.onboarding-required #controls-panel,
body.onboarding-required #settings-modal,
body.onboarding-required #projects-modal,
body.onboarding-required #voice-panel {
  display: none !important;
}

body.onboarding-required #onboarding-screen:not([hidden]) {
  display: grid;
}

body.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line2);
  border: 3px solid transparent;
  border-radius: 10px;
  background-clip: content-box;
}

.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;
}

.sidebar {
  position: relative;
  z-index: 5;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px;
  overflow: hidden;
  background: var(--panel2);
  border-right: 1px solid var(--line);
  transition: padding 0.22s ease, border-color 0.22s ease;
}

body.sidebar-collapsed .sidebar {
  padding: 0;
  border-right: 0;
}

body.sidebar-collapsed .sidebar > * {
  visibility: hidden;
}

.brand-row,
.brand-lockup,
.sidebar-modebar,
.sidebar-modebar button,
.sidebar-action,
.topbar-leading,
.header-actions,
.preset-wrap,
.account-chip,
.presence-row,
.topbar {
  display: flex;
  align-items: center;
}

.brand-row {
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 12px;
}

.sidebar-modebar {
  min-height: 44px;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-modebar button {
  min-width: 0;
  height: 36px;
  flex: 1;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  color: var(--muted2);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.sidebar-modebar button.active {
  color: var(--txt2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-modebar svg {
  width: 16px;
  height: 16px;
}

.brand-lockup {
  min-width: 0;
  overflow: hidden;
  color: var(--pri);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-user-name {
  max-width: 150px;
  color: color-mix(in srgb, var(--pri2) 74%, #f4f0e5 26%);
  font-family: "Arial Black", "Impact", "DIN Condensed", "JetBrains Mono", ui-monospace, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.84;
}

.brand-logo {
  display: block;
  width: min(156px, 100%);
  height: 34px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo[hidden] {
  display: none;
}

#sidebar-toggle {
  width: 19px;
  height: 19px;
  border-radius: 6px;
}

#sidebar-toggle svg {
  width: 11px;
  height: 11px;
}

.main-sidebar-toggle {
  flex: none;
}

body:not(.sidebar-collapsed) .main-sidebar-toggle {
  display: none;
}

.section-label,
.conversation-meta,
.route-status,
.message-role,
.account-chip small {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--field);
}

.icon-button:hover {
  color: var(--txt);
  border-color: var(--pri-line);
}

.composer-tools-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--txt);
  background: var(--card);
  flex: none;
}

.composer-tools-trigger:hover,
.composer-tools-trigger[aria-expanded="true"] {
  color: var(--pri2);
  border-color: var(--pri-line);
  background: var(--pri-wash);
}

.new-chat,
#send {
  border: 0;
  color: var(--on-pri);
  background: var(--pri-grad);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  box-shadow: 0 12px 28px -18px var(--pri);
}

.sidebar-primary {
  display: grid;
  gap: 2px;
}

.sidebar-action {
  width: 100%;
  min-height: 38px;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  text-align: left;
}

.sidebar-action:hover {
  color: var(--txt2);
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-action:disabled {
  cursor: default;
  opacity: 0.58;
}

.sidebar-action:disabled:hover {
  color: var(--muted);
  background: transparent;
}

.sidebar-action svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.new-chat {
  min-height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.new-chat svg,
#send svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.3;
}

.sidebar-search label {
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
}

.sidebar-search label:focus-within,
.sidebar-search label:hover,
.conversation-item:hover {
  color: var(--txt);
  background: var(--panel);
  border-color: var(--line);
}

.sidebar-search svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.sidebar-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--txt);
  background: transparent;
  font: inherit;
}

.sidebar-search input::placeholder {
  color: var(--muted);
}

.sidebar-section {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 4px;
}

.section-label {
  margin: 0 8px 8px;
  color: var(--muted2);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.conversation-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: auto;
}

.conversation-empty {
  padding: 10px 12px;
  color: var(--muted2);
  font-size: 12px;
}

.conversation-item {
  position: relative;
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--txt);
  text-align: left;
}

.conversation-load {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.conversation-delete {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  background: transparent;
  opacity: 0;
}

.conversation-item:hover .conversation-delete,
.conversation-item:focus-within .conversation-delete {
  opacity: 1;
}

.conversation-delete:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.conversation-delete svg {
  width: 15px;
  height: 15px;
}

.conversation-item.active {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.conversation-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--pri);
}

.conversation-title {
  display: block;
  overflow: hidden;
  color: color-mix(in srgb, var(--txt) 88%, transparent);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  display: none;
  margin-top: 2px;
  color: var(--muted2);
  font-size: 10px;
}

.online-panel {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.online-heading {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  text-align: left;
}

.online-heading .section-label {
  margin: 0;
}

.online-heading strong {
  color: color-mix(in srgb, var(--ok) 76%, var(--muted));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.online-list {
  display: grid;
  gap: 3px;
}

.presence-row {
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
}

.presence-row > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.presence-row.empty {
  color: var(--muted2);
  font-size: 12px;
}

.presence-row strong,
.account-chip strong {
  display: block;
  overflow: hidden;
  color: var(--txt2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-row small,
.account-chip small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-message {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--field);
  flex: none;
}

.presence-message:hover {
  color: var(--pri2);
  border-color: var(--pri-line);
  background: var(--pri-wash);
}

.presence-message svg {
  width: 14px;
  height: 14px;
}

.avatar {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--panel2);
  border-radius: 999px;
  background: var(--ok);
}

.avatar.blue,
.avatar-blue {
  background: linear-gradient(135deg, #5b8def, #2f4a86);
}

.avatar.green,
.avatar-green {
  background: linear-gradient(135deg, #64c48b, #2f7d58);
}

.avatar.violet,
.avatar-violet {
  background: linear-gradient(135deg, #8a6fd4, #4a3a86);
}

.avatar.slate,
.avatar-slate {
  background: linear-gradient(135deg, #8c95a3, #48505d);
}

.avatar.rose,
.avatar-rose {
  background: linear-gradient(135deg, #d37b8d, #8d4054);
}

.avatar.gold,
.avatar.admin,
.avatar-gold {
  color: var(--on-pri);
  background: var(--pri-grad);
}

.account-chip {
  position: relative;
  width: 100%;
  gap: 10px;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--txt);
  background: var(--panel);
  text-align: left;
}

.account-chip:hover {
  border-color: var(--line2);
}

.account-copy {
  min-width: 0;
  flex: 1;
}

.popover {
  position: absolute;
  z-index: 20;
  right: 14px;
  bottom: 74px;
  width: 236px;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.popover button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--txt);
  background: transparent;
  text-align: left;
}

.popover button:hover {
  background: var(--card);
}

.popover button:disabled,
.tool-button:disabled,
#prompt:disabled,
#send:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.popover button:disabled:hover {
  background: transparent;
}

.composer-tools-menu {
  position: absolute;
  z-index: 24;
  left: 0;
  bottom: 44px;
  width: min(310px, calc(100vw - 42px));
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.composer-tools-menu[hidden] {
  display: none;
}

.composer-tools-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: var(--txt);
  background: transparent;
  text-align: left;
}

.composer-tools-menu button:hover {
  background: var(--card);
}

.composer-tools-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.composer-tools-menu button[aria-pressed="true"] small {
  color: var(--ok);
}

.composer-tools-menu button svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.composer-tools-menu button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-tools-menu button small {
  color: var(--muted2);
  font-size: 11px;
  font-weight: 700;
}

.composer-tools-separator {
  height: 1px;
  margin: 7px 8px;
  background: var(--line);
}

.workspace {
  position: relative;
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient::before {
  content: none;
  display: none;
}

.ambient::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -36%;
  width: 820px;
  height: 560px;
  border: 1px solid var(--pri);
  border-radius: 50%;
  opacity: 0.06;
  transform: rotate(-22deg);
}

.topbar {
  position: relative;
  z-index: 2;
  min-height: 78px;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-leading {
  min-width: 0;
  gap: 12px;
}

.sidebar-restore-button {
  flex: none;
}

.title-block {
  min-width: 0;
}

.product {
  color: var(--pri);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

h1 {
  margin: 2px 0 0;
  color: var(--txt2);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0;
}

.header-actions {
  gap: 10px;
}

.preset-wrap {
  min-width: 210px;
  height: 40px;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--field);
}

.route-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

#preset-select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--txt);
  background: transparent;
  font-size: 13.5px;
}

#preset-select option {
  color: var(--txt);
  background: var(--field);
}

.messages {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow: auto;
  padding: 30px 7vw 8px;
}

.empty {
  max-width: 780px;
  margin: 9vh auto 0;
  text-align: center;
  animation: fade-rise 0.45s ease both;
}

.empty-mark {
  width: 64px;
  height: auto;
  margin-bottom: 22px;
}

.empty-title {
  margin: 0;
  color: var(--txt2);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 0;
}

.empty-copy {
  max-width: 680px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.suggestions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  color: var(--txt);
  background: var(--card);
  box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.8);
}

.suggestions button:hover {
  border-color: var(--pri-line);
}

.message {
  max-width: 780px;
  margin: 0 auto 30px;
  display: grid;
  gap: 9px;
  animation: fade-rise 0.32s ease both;
}

.message-role {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.message.assistant .message-role::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--tenant-agent-mark, url("/brand/smartarc/favicon.svg")) center / contain no-repeat;
}

.message-body {
  max-width: 660px;
  color: var(--txt);
  font-size: 15.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.assistant .message-body:empty {
  min-height: 18px;
}

.message.assistant .message-body:empty::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--pri);
  animation: pulse 1.2s infinite;
}

.message.user {
  justify-items: end;
  text-align: right;
}

.message.user .message-body {
  max-width: 560px;
  padding: 13px 18px;
  border: 1px solid color-mix(in srgb, var(--pri) 18%, transparent);
  border-radius: 16px;
  color: var(--txt2);
  background: #161d38;
  text-align: left;
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.8);
}

body.light .message.user .message-body {
  color: #f3f4f8;
  background: #0e1a30;
  border-color: #0e1a30;
}

.message.error .message-body {
  color: var(--danger);
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.message-attachments img {
  width: 96px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
  background: var(--field);
}

.composer {
  position: relative;
  z-index: 2;
  padding: 16px 7vw 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 45%);
}

.composer form,
.route-status {
  max-width: 780px;
  margin: 0 auto;
}

.route-status {
  margin-bottom: 8px;
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
}

.composer-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 7px;
  border: 1px solid var(--line2);
  border-radius: 18px;
  background: color-mix(in srgb, var(--field) 92%, transparent);
  box-shadow: 0 18px 54px -42px rgba(0, 0, 0, 0.9);
}

#prompt {
  width: 100%;
  min-height: 52px;
  max-height: 220px;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: var(--txt);
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
}

#prompt::placeholder {
  color: var(--muted2);
}

.attachment-tray {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}

.attachment-tray[hidden] {
  display: none;
}

.attachment-chip {
  max-width: 210px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-grid;
  grid-template-columns: 28px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 3px;
  color: var(--txt);
  background: var(--card);
}

.attachment-chip img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.attachment-chip span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
}

.attachment-chip button:hover {
  color: var(--danger);
  background: var(--danger-wash);
}

.attachment-chip button svg {
  width: 14px;
  height: 14px;
}

#send {
  min-width: 92px;
  min-height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#send:disabled {
  cursor: wait;
  opacity: 0.68;
}

.controls-panel {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(390px, 100vw);
  height: 100vh;
  padding: 18px;
  overflow: auto;
  border-left: 1px solid var(--line2);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  animation: slide-in 0.18s ease both;
}

.direct-panel {
  --panel: #1d2638;
  --card: #243049;
  --field: #1a2336;
  --line: rgba(255, 255, 255, 0.1);
  --line2: rgba(205, 161, 85, 0.2);
  position: fixed;
  z-index: 31;
  top: auto;
  right: auto;
  bottom: 24px;
  left: auto;
  width: min(420px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 32px));
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border: 1px solid rgba(205, 161, 85, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(36, 48, 73, 0.98), rgba(27, 36, 55, 0.98)),
    var(--panel);
  box-shadow:
    0 28px 70px -44px rgba(0, 0, 0, 0.86),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  animation: pop-in 0.14s ease both;
}

.direct-panel .controls-head {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.direct-window-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.direct-window-actions .icon-button {
  width: 28px;
  height: 28px;
  border-color: color-mix(in srgb, var(--line2) 48%, transparent);
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  background: transparent;
}

.direct-window-actions .icon-button:hover {
  color: color-mix(in srgb, var(--pri2) 72%, var(--txt) 28%);
  background: color-mix(in srgb, var(--pri2) 7%, transparent);
}

.direct-panel.dragging .controls-head {
  cursor: grabbing;
}

body.direct-dragging {
  user-select: none;
}

.direct-panel[hidden] {
  display: none;
}

.direct-orb {
  position: fixed;
  z-index: 32;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.2), transparent 28%),
    color-mix(in srgb, var(--ok) 19%, var(--panel) 81%);
  box-shadow:
    0 0 20px -6px color-mix(in srgb, var(--ok) 62%, transparent),
    0 16px 34px -28px rgba(0, 0, 0, 0.9);
}

.direct-orb[hidden] {
  display: none;
}

.direct-orb span {
  width: 10px;
  height: 10px;
  border-radius: inherit;
  background: var(--ok);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ok) 78%, transparent);
}

.direct-orb.warm {
  border-color: color-mix(in srgb, var(--warn) 34%, transparent);
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.16), transparent 28%),
    color-mix(in srgb, var(--warn) 18%, var(--panel) 82%);
  box-shadow: 0 0 17px -7px color-mix(in srgb, var(--warn) 62%, transparent);
}

.direct-orb.warm span {
  background: var(--warn);
  box-shadow: 0 0 12px color-mix(in srgb, var(--warn) 70%, transparent);
}

.direct-orb.stale {
  border-color: color-mix(in srgb, var(--danger) 36%, transparent);
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.13), transparent 28%),
    color-mix(in srgb, var(--danger) 16%, var(--panel) 84%);
  box-shadow: 0 0 14px -8px color-mix(in srgb, var(--danger) 64%, transparent);
}

.direct-orb.stale span {
  background: var(--danger);
  box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 68%, transparent);
}

.direct-orb.dragging {
  cursor: grabbing;
}

.direct-panel.team-chat-mode .direct-form {
  display: none;
}

.direct-panel .controls-head span {
  display: block;
  margin-top: 3px;
  color: #9ca5b8;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.direct-messages {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}

.direct-empty {
  margin: auto;
  color: var(--muted2);
  font-size: 13px;
}

.direct-message {
  max-width: 86%;
  display: grid;
  gap: 4px;
}

.direct-message.mine {
  align-self: end;
}

.direct-message.theirs {
  align-self: start;
}

.direct-message.system {
  max-width: 100%;
  align-self: stretch;
}

.direct-message span {
  color: var(--muted2);
  font-size: 10px;
}

.direct-message p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--txt);
  background: rgba(36, 48, 73, 0.94);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.direct-message.system p {
  border-color: color-mix(in srgb, var(--pri2) 18%, transparent);
  color: color-mix(in srgb, var(--txt) 80%, transparent);
  background: color-mix(in srgb, var(--panel2) 84%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.direct-message.mine p {
  color: var(--on-pri);
  border-color: transparent;
  background: var(--pri-grad);
}

.direct-form {
  display: grid;
  gap: 10px;
}

.direct-form textarea {
  width: 100%;
  min-height: 78px;
  max-height: 170px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  outline: 0;
  resize: vertical;
  padding: 11px 13px;
  color: var(--txt);
  background: rgba(26, 35, 54, 0.96);
}

.direct-form button {
  height: 40px;
  border: 0;
  border-radius: 11px;
  color: var(--on-pri);
  background: var(--pri-grad);
  font-weight: 800;
}

.controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.controls-head strong {
  padding: 8px 14px;
  border-radius: 11px;
  color: var(--txt2);
  background: var(--card);
  font-size: 20px;
}

.controls-panel section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.panel-row,
.params-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-row strong {
  color: var(--txt2);
  font-size: 16px;
}

.panel-row span,
.params-list small {
  color: var(--muted2);
}

.tuning-toggle,
.tuning-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  margin-top: 12px;
  color: var(--txt);
  font-size: 13.5px;
}

.tuning-toggle input,
.tuning-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--pri);
}

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

.tuning-grid label,
.tuning-stop {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted2);
  font-size: 12px;
}

.tuning-grid label > span,
.tuning-stop > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
  color: var(--muted);
}

.tuning-grid output {
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

.tuning-grid input[type="number"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 0 10px;
  outline: 0;
  color: var(--txt);
  background: var(--field);
}

.tuning-grid input[type="range"] {
  width: 100%;
  accent-color: var(--pri);
}

.tuning-check {
  align-self: end;
  min-height: 36px;
  margin: 0;
}

.controls-panel textarea {
  width: 100%;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  outline: 0;
  resize: vertical;
  color: var(--txt);
  background: var(--field);
}

.tuning-stop textarea {
  margin-top: 0;
  resize: vertical;
}

.params-list {
  display: grid;
  margin-top: 4px;
}

.params-list div {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--txt);
  font-size: 13.5px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--pri);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-screen,
.modal-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(22px);
  animation: fade-rise 0.2s ease both;
}

.auth-screen[hidden],
.modal-overlay[hidden] {
  display: none;
}

.auth-screen {
  grid-template-columns: minmax(260px, 430px) minmax(300px, 430px);
  gap: 18px;
}

.auth-brand-panel,
.auth-card,
.settings-shell {
  border: 1px solid var(--line2);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.auth-brand-panel,
.auth-card {
  width: 100%;
  min-height: 430px;
  border-radius: 24px;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--pri) 18%, transparent), transparent 46%),
    color-mix(in srgb, var(--panel2) 96%, transparent);
}

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

.auth-lockup img {
  width: 148px;
  height: auto;
}

.auth-lockup span,
.auth-copy,
.auth-card p,
.setting-row span,
.hsep-card small,
.hsep-hero p {
  color: var(--muted);
}

.auth-brand-panel h2 {
  max-width: 380px;
  margin: 0;
  color: var(--txt2);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-copy {
  max-width: 350px;
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.auth-dismiss {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-card h3,
.settings-head h2,
.hsep-hero h3 {
  margin: 0;
  color: var(--txt2);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.auth-card h3 {
  max-width: 320px;
  font-size: 31px;
  line-height: 1.08;
}

.auth-card p:not(.eyebrow) {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.sso-button {
  min-height: 48px;
  border: 1px solid var(--line2);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  color: var(--txt);
  background: var(--field);
  text-decoration: none;
  font-weight: 700;
}

.sso-button.primary {
  color: var(--on-pri);
  background: var(--pri-grad);
  border-color: transparent;
}

.sso-button:hover {
  border-color: var(--pri-line);
}

.auth-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.auth-foot span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.settings-shell {
  width: min(880px, 94vw);
  max-height: min(760px, 92vh);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel2) 72%, transparent);
}

.settings-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.settings-nav button.active,
.settings-nav button:hover {
  color: var(--txt2);
  background: var(--card);
}

.settings-main {
  min-width: 0;
  overflow: auto;
  padding: 24px;
}

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

.settings-head h2 {
  font-size: 28px;
}

.settings-panel {
  display: none;
}

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

.profile-editor {
  display: grid;
  gap: 16px;
  max-width: 440px;
}

.profile-preview {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--field) 78%, transparent);
}

.profile-preview .avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 13px;
}

.profile-preview strong,
.profile-preview span {
  display: block;
}

.profile-preview strong {
  color: var(--txt2);
  font-size: 15px;
}

.profile-preview span {
  margin-top: 3px;
  color: var(--muted2);
  font-size: 12px;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.profile-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line2);
  border-radius: 11px;
  outline: 0;
  padding: 0 12px;
  color: var(--txt);
  background: var(--field);
}

.profile-field input:focus {
  border-color: var(--pri-line);
}

.avatar-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-swatch {
  width: 34px;
  height: 34px;
  border: 2px solid transparent;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.avatar-swatch.active {
  border-color: var(--pri2);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--pri) 18%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.setting-row,
.hsep-hero,
.hsep-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--field) 78%, transparent);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
}

.setting-row strong {
  display: block;
  color: var(--txt2);
  font-size: 15px;
}

.setting-row span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.pill {
  min-width: max-content;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ok) 34%, transparent);
  border-radius: 999px;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill.muted {
  border-color: var(--line2);
  color: var(--muted);
  background: var(--panel);
}

.hsep-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.hsep-hero h3 {
  font-size: 22px;
}

.hsep-hero p {
  max-width: 500px;
  margin: 8px 0 0;
  line-height: 1.5;
}

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

.hsep-card {
  padding: 15px;
}

.hsep-card span,
.hsep-card small {
  display: block;
  font-size: 12px;
}

.hsep-card strong {
  display: block;
  margin: 8px 0;
  color: var(--txt2);
  font-size: 22px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.segmented button.active {
  color: var(--on-pri);
  background: var(--pri-grad);
}

.segmented button:disabled {
  cursor: not-allowed;
}

.toggle {
  width: 40px;
  height: 22px;
  padding: 3px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--panel);
}

.toggle::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.toggle.on {
  border-color: color-mix(in srgb, var(--ok) 32%, transparent);
  background: color-mix(in srgb, var(--ok) 12%, var(--panel));
}

.toggle.on::before {
  background: var(--ok);
  transform: translateX(16px);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.settings-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  color: var(--on-pri);
  background: var(--pri-grad);
  font-weight: 800;
}

/* Brand-system fidelity pass for the first-party web chat. */
body {
  background:
    radial-gradient(62% 54% at 78% 8%, rgba(91, 141, 239, 0.045), transparent 58%),
    var(--bg);
}

.sidebar {
  gap: 10px;
  padding: 16px 12px 12px;
  background: #111827;
  --txt: #e9edf7;
  --txt2: #ffffff;
  --muted: #a4adc2;
  --muted2: #78839d;
  --faint: #657084;
  --panel: #172033;
  --panel2: #111827;
  --field: #151e31;
  --line: rgba(255, 255, 255, 0.075);
  --line2: rgba(255, 255, 255, 0.12);
  --ok: #54d6a0;
  color: var(--txt);
}

.new-chat {
  min-height: 38px;
  height: auto;
  margin-top: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.conversation-item {
  min-height: 38px;
  border-radius: 9px;
}

.conversation-item.active {
  background: rgba(255, 255, 255, 0.055);
}

.account-chip {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.topbar {
  min-height: 74px;
  padding: 15px 28px 14px;
  background: rgba(18, 24, 38, 0.76);
}

h1 {
  font-size: 25px;
}

.preset-wrap {
  min-width: 196px;
  height: 40px;
  border-radius: 9px;
  background: #172032;
}

.messages {
  padding: 28px 7vw 120px;
}

.message {
  max-width: 720px;
  margin-bottom: 26px;
}

.message.intro .message-body,
.message.assistant:not(.intro) .message-body {
  max-width: 720px;
  padding: 18px 20px;
  border: 1px solid rgba(136, 158, 196, 0.18);
  border-radius: 13px;
  background: rgba(23, 31, 48, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.message-role {
  color: var(--muted2);
}

.message.assistant .message-role::before {
  width: 14px;
  height: 14px;
}

.message.user .message-body {
  border-radius: 13px;
  background: #202b45;
}

.prompt-chips {
  max-width: 720px;
  margin: -6px auto 0;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.prompt-chips button {
  max-width: min(560px, 100%);
  min-height: 48px;
  border: 1px solid rgba(136, 158, 196, 0.16);
  border-radius: 13px;
  padding: 0 18px;
  color: var(--txt);
  background: #202940;
  text-align: left;
}

.prompt-chips button:hover {
  border-color: var(--pri-line);
}

.empty-footnote {
  max-width: 720px;
  margin: 80px auto 0;
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-align: center;
}

.composer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 7vw 18px;
}

.route-status {
  max-width: 720px;
}

.composer form {
  max-width: 720px;
}

.composer-box {
  grid-template-columns: 1fr 46px;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(27, 35, 54, 0.92);
  backdrop-filter: blur(18px);
}

.prompt-stack {
  min-width: 0;
}

#prompt {
  min-height: 42px;
  padding: 8px 7px 5px;
  font-size: 15.5px;
}

.composer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 0 6px;
}

.composer-tools {
  position: relative;
  flex: none;
}

.composer-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

body.light.auth-ok {
  background:
    radial-gradient(64% 54% at 76% 0%, rgba(205, 161, 85, 0.08), transparent 60%),
    #f6f3eb;
}

body.light .workspace {
  background: #f6f3eb;
}

body.light .sidebar {
  --txt: #2b2d31;
  --txt2: #17191d;
  --muted: #66655d;
  --muted2: #8b8578;
  --faint: #a09a8b;
  --panel: #eee9df;
  --panel2: #f1ece3;
  --field: #fbf8f1;
  --line: rgba(38, 35, 29, 0.1);
  --line2: rgba(38, 35, 29, 0.16);
  --ok: #328865;
  color: var(--txt);
  border-right-color: rgba(38, 35, 29, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12)),
    #f1ece3;
}

body.light .brand-lockup {
  color: #9a6f2f;
}

body.light .brand-user-name {
  color: #8d6630;
}

body.light .sidebar-modebar {
  border-color: rgba(38, 35, 29, 0.11);
  background: rgba(255, 255, 255, 0.46);
}

body.light .sidebar-modebar button {
  color: #8b8578;
}

body.light .sidebar-modebar button.active {
  color: #252525;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(38, 35, 29, 0.08),
    0 8px 22px -20px rgba(38, 35, 29, 0.45);
}

body.light .sidebar-action {
  color: #66655d;
}

body.light .sidebar-action:hover,
body.light .sidebar-search label:hover,
body.light .sidebar-search label:focus-within,
body.light .conversation-item:hover {
  color: #252525;
  border-color: rgba(38, 35, 29, 0.08);
  background: rgba(255, 255, 255, 0.48);
}

body.light .sidebar-action:disabled:hover {
  color: #66655d;
  background: transparent;
}

body.light .sidebar-search input,
body.light .conversation-title,
body.light .presence-row strong,
body.light .account-chip strong {
  color: #252525;
}

body.light .sidebar-search input::placeholder,
body.light .section-label,
body.light .presence-row small,
body.light .account-chip small,
body.light .conversation-empty {
  color: #8b8578;
}

body.light .conversation-item.active {
  background: rgba(255, 255, 255, 0.64);
}

body.light .online-panel,
body.light .account-chip {
  border-color: rgba(38, 35, 29, 0.1);
}

body.light .account-chip {
  color: #252525;
  background: rgba(255, 255, 255, 0.5);
}

body.light .presence-message {
  color: #767064;
  border-color: rgba(38, 35, 29, 0.1);
  background: rgba(255, 255, 255, 0.44);
}

body.light .topbar {
  border-bottom-color: rgba(22, 29, 47, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px -26px rgba(22, 29, 47, 0.45);
}

body.light .icon-button,
body.light .preset-wrap {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.14);
  background: #ffffff;
  box-shadow: 0 8px 22px -20px rgba(22, 29, 47, 0.45);
}

body.light .icon-button:hover,
body.light .preset-wrap:hover {
  color: #0e1a30;
  border-color: rgba(176, 130, 58, 0.48);
}

body.light .sidebar-restore-button {
  background: #ffffff;
}

body.light #preset-select {
  color: #18233a;
}

body.light #preset-select option {
  color: #18233a;
  background: #ffffff;
}

body.light .message.intro .message-body,
body.light .message.assistant:not(.intro) .message-body {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px -38px rgba(22, 29, 47, 0.42);
}

body.light .message-role,
body.light .route-status,
body.light .empty-footnote {
  color: #7a725f;
}

body.light .composer {
  background: linear-gradient(180deg, rgba(246, 243, 235, 0), #f6f3eb 42%);
}

body.light .composer-box {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.13);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 54px -38px rgba(22, 29, 47, 0.5);
}

body.light .composer-tools-trigger,
body.light .composer-tools-menu,
body.light .popover,
body.light .controls-panel {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.13);
  background: rgba(255, 255, 255, 0.92);
}

body.light .composer-tools-menu button,
body.light .popover button {
  color: #18233a;
}

body.light .composer-tools-menu button:hover,
body.light .popover button:hover {
  background: #f1ece3;
}

body.light .direct-panel {
  --panel: #f3eee5;
  --card: #ffffff;
  --field: #fbf8f1;
  --line: rgba(38, 35, 29, 0.1);
  --line2: rgba(176, 130, 58, 0.24);
  color: #20242c;
  border-color: rgba(176, 130, 58, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 239, 230, 0.98)),
    var(--panel);
  box-shadow:
    0 30px 76px -48px rgba(38, 35, 29, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light .direct-panel .controls-head span,
body.light .direct-message span {
  color: #8b8578;
}

body.light .direct-message p {
  color: #20242c;
  border-color: rgba(38, 35, 29, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

body.light .direct-message.mine p {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(160deg, #c49a4f, #a9772f);
}

body.light .direct-form textarea {
  color: #20242c;
  border-color: rgba(38, 35, 29, 0.13);
  background: #fbf8f1;
}

body.light .profile-preview {
  border-color: rgba(38, 35, 29, 0.1);
  background: rgba(255, 255, 255, 0.64);
}

body.light .profile-preview strong,
body.light .profile-field input {
  color: #20242c;
}

body.light .profile-preview span,
body.light .profile-field {
  color: #8b8578;
}

body.light .profile-field input {
  border-color: rgba(38, 35, 29, 0.13);
  background: #fbf8f1;
}

body.light #prompt {
  color: #18233a;
}

body.light #prompt::placeholder,
body.light .composer-meta > span {
  color: #7a8191;
}

body.light .attachment-chip {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.12);
  background: #ffffff;
}

.tool-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #0d1631;
}

.tool-button:hover {
  color: var(--txt);
  border-color: var(--pri-line);
}

#send {
  min-width: 46px;
  min-height: 46px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  align-self: end;
  box-shadow: 0 12px 24px -10px rgba(205, 161, 85, 0.85);
}

#send svg {
  width: 18px;
  height: 18px;
}

.auth-screen {
  grid-template-columns: 1.04fr 0.96fr;
  gap: 0;
  width: 100vw;
  height: 100vh;
  padding: clamp(16px, 4vw, 42px);
  background: #05080f;
}

.auth-brand-panel,
.auth-card {
  min-height: min(680px, calc(100vh - 84px));
  border-radius: 0;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.auth-brand-panel {
  position: relative;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 18px 0 0 18px;
  background:
    radial-gradient(circle at -8% -12%, rgba(205, 161, 85, 0.14), transparent 42%),
    #0a0f20;
}

.auth-orbit {
  position: absolute;
  right: -16%;
  bottom: 23%;
  width: 620px;
  height: 86px;
  border-top: 1px solid rgba(205, 161, 85, 0.12);
  border-radius: 50%;
  transform: rotate(-2deg);
  pointer-events: none;
}

.auth-lockup span {
  color: var(--pri);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.auth-brand-panel h2 {
  max-width: 500px;
  color: #ffffff;
  font-size: clamp(42px, 5vw, 56px);
  line-height: 1.02;
}

.auth-brand-panel h2 span {
  color: var(--pri2);
}

.auth-copy {
  max-width: 475px;
  margin-top: 22px;
  color: var(--txt);
  font-size: 17px;
  line-height: 1.58;
}

.auth-powered {
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

.auth-card {
  justify-content: center;
  padding: clamp(28px, 5vw, 76px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 18px 18px 0;
  background: #0c1426;
}

.auth-dismiss {
  opacity: 0.5;
}

.auth-card h3 {
  font-size: 26px;
}

.auth-card p:not(.eyebrow) {
  color: var(--muted);
}

.sso-button,
.sso-button.primary {
  height: 46px;
  border-radius: 11px;
  color: var(--txt);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.13);
  justify-content: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.auth-divider span {
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.09);
}

.auth-divider em {
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

.auth-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.auth-field input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  outline: 0;
  padding: 0 15px;
  color: var(--txt);
  background: #0d1428;
}

.auth-field input:focus {
  border-color: var(--pri-line);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 3px 0 18px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.check-mark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--pri);
  border-radius: 5px;
  background: rgba(205, 161, 85, 0.15);
}

.auth-row a {
  color: var(--pri2);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.signin-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-pri);
  background: var(--pri-grad);
  box-shadow: 0 12px 26px -10px rgba(205, 161, 85, 0.8);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-foot {
  justify-content: center;
}

.auth-foot svg {
  width: 13px;
  height: 13px;
}

.settings-shell {
  width: min(920px, 100%);
  max-height: min(620px, 92vh);
  border-radius: 18px;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--panel);
}

.settings-nav {
  padding: 20px 14px;
}

.settings-main {
  padding: 0 24px 24px;
}

.settings-head {
  margin: 0 -6px 8px;
  padding: 14px 0 0;
  justify-content: flex-end;
}

.settings-head .eyebrow,
.settings-head h2 {
  display: none;
}

.settings-panel.active {
  gap: 0;
}

.hsep-hero.reference {
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.hsep-lock {
  width: 40px;
  height: 40px;
  border: 1px solid var(--pri-line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pri);
  background: var(--pri-wash);
  flex: none;
}

.hsep-hero h3 {
  font-size: 17px;
}

.hsep-hero p:not(.eyebrow) {
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setting-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 0;
  background: transparent;
}

.setting-row.compact {
  min-height: 50px;
}

.setting-row.compact > strong {
  color: var(--txt);
  font-size: 14px;
}

.settings-subhead {
  margin: 22px 0 4px;
  color: var(--txt2);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

.value-chip {
  min-width: max-content;
  height: 36px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--txt);
  background: var(--field);
  font-size: 13px;
  font-weight: 650;
}

.segmented {
  border-radius: 10px;
}

.segmented button {
  border-radius: 7px;
}

.risk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.risk-row span {
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.risk-row strong {
  min-width: 0;
  flex: 1;
  color: var(--txt);
  font-size: 13.5px;
  font-weight: 500;
}

.risk-row em {
  color: var(--muted2);
  font-style: normal;
}

.risk-row small {
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.risk-row.elevated span {
  border-color: var(--pri-line);
  color: var(--pri2);
  background: var(--pri-wash);
}

.risk-row.elevated small {
  color: var(--pri2);
  font-weight: 700;
}

.device-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.device-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel2);
  flex: none;
}

.device-card div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.device-card strong {
  display: block;
  color: var(--txt2);
  font-size: 13.5px;
}

.device-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.device-card em {
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--ok);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.auth-screen {
  grid-template-columns: minmax(280px, 920px);
  place-items: center;
  place-content: center;
  width: 100vw;
  min-height: 100dvh;
  height: auto;
  padding: 24px;
  background:
    radial-gradient(52% 44% at 78% 16%, rgba(91, 141, 239, 0.1), transparent 60%),
    rgba(5, 8, 15, 0.94);
}

.auth-shell {
  width: min(920px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  border: 1px solid var(--line2);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(8, 14, 31, 0.9);
  box-shadow: 0 40px 100px -44px rgba(0, 0, 0, 0.9);
}

.web-login-brand {
  min-height: 480px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background:
    radial-gradient(60% 52% at 12% 6%, rgba(205, 161, 85, 0.15), transparent 58%),
    radial-gradient(72% 62% at 100% 0%, rgba(91, 141, 239, 0.11), transparent 62%),
    #080e1f;
}

.web-login-brand .auth-lockup img {
  width: 40px;
}

.web-login-brand .auth-lockup span {
  text-transform: none;
}

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

.auth-status-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.auth-status-grid span,
.auth-status-grid strong {
  display: block;
}

.auth-status-grid span {
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-status-grid strong {
  overflow: hidden;
  margin-top: 6px;
  color: var(--txt2);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.auth-required .auth-screen {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  backdrop-filter: none;
}

.auth-card.simple-login {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  display: block;
  padding: clamp(28px, 4vw, 42px);
  background: #0c1426;
  box-shadow: none;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-connect {
  color: var(--muted2);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.auth-field.readonly {
  margin: 0;
}

.auth-mark {
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
}

.auth-card.simple-login h3 {
  margin: 0;
  font-size: 30px;
}

.auth-card.simple-login p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.auth-card.simple-login .signin-button {
  margin-top: 0;
}

.auth-card.simple-login .auth-foot {
  justify-content: flex-start;
  margin-top: 18px;
}

/* Compact TEAMS session gate. Keep this after the broader auth variants. */
.auth-screen {
  grid-template-columns: minmax(280px, 520px);
  padding: 18px;
  background: #05080f;
}

.auth-shell {
  width: min(520px, calc(100vw - 36px));
  grid-template-columns: 1fr;
  border-color: rgba(84, 104, 135, 0.36);
  border-radius: 8px;
  background: rgba(12, 18, 30, 0.96);
  box-shadow: 0 28px 72px -52px rgba(0, 0, 0, 0.95);
}

.web-login-brand {
  min-height: 0;
  border: 0;
  border-bottom: 1px solid rgba(84, 104, 135, 0.28);
  border-radius: 0;
  padding: 22px 24px 18px;
  background: rgba(12, 18, 30, 0.96);
}

.web-login-brand .auth-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-login-brand .auth-lockup img {
  width: 24px;
}

.web-login-brand .auth-lockup span {
  color: rgba(205, 161, 85, 0.86);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-brand-panel h2 {
  margin-top: 18px;
  max-width: none;
  color: rgba(244, 247, 252, 0.94);
  font-size: 30px;
  line-height: 1.08;
}

.auth-copy {
  max-width: 360px;
  margin-top: 8px;
  color: rgba(145, 158, 188, 0.9);
  font-size: 14px;
  line-height: 1.45;
}

.auth-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 22px;
}

.auth-status-grid div {
  border-color: rgba(84, 104, 135, 0.28);
  border-radius: 7px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.018);
}

.auth-status-grid span {
  font-size: 8px;
  letter-spacing: 0.1em;
}

.auth-status-grid strong {
  margin-top: 4px;
  font-size: 11px;
}

.auth-card.simple-login {
  padding: 24px;
  background: rgba(9, 14, 24, 0.98);
}

.auth-mark {
  display: block;
  width: 118px;
  height: auto;
  margin-bottom: 18px;
  opacity: 0.92;
}

.auth-card.simple-login h3 {
  color: rgba(244, 247, 252, 0.94);
  font-size: 23px;
}

.auth-card.simple-login p:not(.eyebrow) {
  max-width: 340px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  gap: 10px;
  margin-top: 20px;
}

.auth-connect {
  color: rgba(145, 158, 188, 0.62);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card.simple-login .signin-button {
  height: 42px;
  border: 1px solid rgba(205, 161, 85, 0.46);
  border-radius: 999px;
  color: rgba(255, 222, 145, 0.94);
  background: rgba(205, 161, 85, 0.08);
  box-shadow: none;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card.simple-login .signin-button:hover {
  border-color: rgba(205, 161, 85, 0.68);
  background: rgba(205, 161, 85, 0.12);
  box-shadow: 0 0 22px -14px rgba(205, 161, 85, 0.95);
}

.auth-card.simple-login .auth-foot {
  margin-top: 16px;
  color: rgba(145, 158, 188, 0.68);
  font-size: 10px;
}

/* Minimal final login gate. */
.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 20px;
  background: #05080f;
}

.auth-shell {
  width: min(380px, calc(100vw - 40px));
  display: block;
  border: 1px solid rgba(84, 104, 135, 0.34);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 15, 26, 0.98);
  box-shadow: 0 24px 70px -54px rgba(0, 0, 0, 0.95);
}

.auth-card.simple-login {
  width: 100%;
  min-height: 0;
  border: 0;
  display: block;
  padding: 28px;
  background: transparent;
}

.auth-mark {
  display: block;
  width: 118px;
  height: auto;
  margin: 0 0 18px;
  opacity: 0.9;
}

.auth-card.simple-login .eyebrow {
  margin: 0 0 9px;
  color: rgba(205, 161, 85, 0.82);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.auth-card.simple-login h3 {
  margin: 0;
  color: rgba(244, 247, 252, 0.94);
  font-size: 22px;
  line-height: 1.12;
}

.auth-card.simple-login p:not(.eyebrow) {
  max-width: 300px;
  margin: 9px 0 0;
  color: rgba(145, 158, 188, 0.86);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  margin-top: 22px;
}

.auth-card.simple-login .signin-button {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(205, 161, 85, 0.48);
  border-radius: 6px;
  color: rgba(255, 225, 154, 0.94);
  background: rgba(205, 161, 85, 0.08);
  box-shadow: none;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card.simple-login .signin-button:hover {
  border-color: rgba(205, 161, 85, 0.68);
  background: rgba(205, 161, 85, 0.12);
}

.auth-card.simple-login .auth-foot {
  justify-content: flex-start;
  margin-top: 18px;
  color: rgba(145, 158, 188, 0.62);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .sidebar > * {
    visibility: visible;
  }

  .topbar {
    padding: 14px 16px;
  }

  .topbar-leading {
    width: 100%;
  }

  .title-block {
    min-width: 0;
  }

  h1 {
    font-size: 20px;
  }

  .header-actions {
    gap: 6px;
  }

  .preset-wrap {
    min-width: 0;
    width: 150px;
  }

  .messages {
    padding: 24px 18px 8px;
  }

  .composer {
    padding: 14px 18px 18px;
  }

  .auth-screen {
    grid-template-columns: 1fr;
    place-content: center;
    place-items: center;
    min-height: 100dvh;
    height: auto;
    overflow: auto;
  }

  .auth-brand-panel,
  .auth-card {
    min-height: auto;
    border-radius: 18px;
  }

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

  .web-login-brand {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-shell {
    grid-template-columns: 1fr;
    max-height: 94vh;
  }

  .settings-nav {
    flex-direction: row;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav button {
    min-width: max-content;
  }

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

@media (max-width: 560px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-leading {
    align-items: center;
  }

  .preset-wrap {
    width: 100%;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .composer-box {
    grid-template-columns: 1fr;
  }

  #send {
    width: 100%;
  }

  .suggestions {
    justify-content: stretch;
  }

  .suggestions button {
    width: 100%;
  }

  .auth-screen,
  .modal-overlay {
    padding: 12px;
  }

  .auth-brand-panel,
  .auth-card,
  .settings-main {
    padding: 20px;
  }

  .auth-shell {
    width: calc(100vw - 24px);
  }

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

  .auth-brand-panel h2 {
    font-size: 34px;
  }

  .setting-row,
  .hsep-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}

.composer-model {
  flex: none;
  min-width: min(190px, 42vw);
}

.composer-model select {
  width: 100%;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 28px 0 10px;
  color: var(--muted);
  background: transparent;
  outline: none;
}

.composer-model select:hover,
.composer-model select:focus {
  color: var(--txt);
  border-color: var(--line2);
  background: rgba(255, 255, 255, 0.035);
}

.composer-model option {
  color: #141a28;
  background: #ffffff;
}

.composer-mic,
.composer-agent {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--muted);
  background: transparent;
}

.composer-agent {
  color: var(--pri2);
  border-color: rgba(205, 161, 85, 0.2);
  background: rgba(205, 161, 85, 0.08);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.composer-mic:hover,
.composer-agent:hover {
  color: var(--txt);
  border-color: var(--line2);
  background: rgba(255, 255, 255, 0.035);
}

.composer-mic.recording {
  color: #ffffff;
  border-color: rgba(239, 143, 143, 0.52);
  background: rgba(239, 143, 143, 0.28);
  box-shadow: 0 0 0 3px rgba(239, 143, 143, 0.12);
}

.composer-mic:disabled,
.composer-agent:disabled,
.composer-model select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#send {
  color: var(--pri2);
  background: rgba(205, 161, 85, 0.14);
  border: 1px solid rgba(205, 161, 85, 0.24);
  box-shadow: none;
}

#send:hover {
  color: var(--on-pri);
  background: var(--pri-grad);
  border-color: transparent;
  box-shadow: 0 12px 28px -20px var(--pri);
}

.projects-shell {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line2);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
}

.library-shell {
  width: min(660px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line2);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
}

.projects-shell .settings-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.projects-list,
.library-list {
  min-height: 180px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.project-row,
.projects-empty,
.library-row,
.library-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--txt);
  background: var(--card);
}

.project-row,
.library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.project-join {
  min-width: 74px;
  min-height: 34px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--txt);
  background: transparent;
}

.project-join:hover {
  border-color: var(--pri-line);
  background: var(--pri-wash);
}

.project-join.joined {
  color: var(--pri2);
  border-color: var(--pri-line);
  background: rgba(205, 161, 85, 0.1);
}

.project-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.project-row div span,
.projects-empty,
.library-row div span,
.library-empty {
  color: var(--muted);
  font-size: 12px;
}

.library-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.library-status {
  flex: none;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.library-status.enabled {
  color: var(--ok);
  border-color: rgba(84, 214, 160, 0.34);
}

.voice-panel {
  position: fixed;
  z-index: 32;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.5);
  backdrop-filter: blur(9px);
  animation: pop-in 0.14s ease both;
}

.voice-panel[hidden] {
  display: none;
}

.voice-phone {
  position: relative;
  width: min(410px, calc(100vw - 28px));
  max-height: min(850px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid rgba(205, 161, 85, 0.2);
  border-radius: 30px;
  padding: 18px;
  color: #e9edf7;
  background:
    radial-gradient(125% 78% at 50% -2%, #15223f 0%, #0a0f20 58%),
    #0a0f20;
  box-shadow:
    0 34px 90px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.voice-phone-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(205, 161, 85, 0.16), transparent 62%);
  pointer-events: none;
}

.voice-dialog-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
}

.voice-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e9edf7;
  font-size: 15px;
  font-weight: 700;
}

.voice-lockup img {
  width: 20px;
  height: 20px;
}

.voice-dialog-head .icon-button {
  justify-self: end;
  color: #a4adc2;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.voice-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 13px;
  padding-top: 26px;
  color: #cfd6e6;
}

.voice-body p {
  margin: 0;
  line-height: 1.45;
}

.voice-agent-hero {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.voice-avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
}

.voice-avatar-wrap span {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(205, 161, 85, 0.48);
  border-radius: 999px;
  animation: voice-pulse 2.8s ease-out infinite;
}

.voice-avatar-wrap span + span {
  animation-delay: 1.4s;
}

.voice-avatar {
  position: relative;
  width: 94px;
  height: 94px;
  border: 1px solid rgba(231, 205, 138, 0.32);
  border-radius: 999px;
  object-fit: cover;
  background: rgba(205, 161, 85, 0.08);
}

.voice-avatar-wrap i {
  position: absolute;
  right: 10px;
  bottom: 6px;
  width: 16px;
  height: 16px;
  border: 3px solid #0a0f20;
  border-radius: 999px;
  background: #36d07f;
  box-shadow: 0 0 0 6px rgba(54, 208, 127, 0.08);
}

.voice-agent-hero strong {
  color: #ffffff;
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
}

.voice-agent-hero small {
  color: #cda155;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.voice-wave {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.voice-wave span {
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e7cd8a, #cda155);
  transform-origin: center;
  animation: voice-wave 0.9s ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-duration: 1.1s; animation-delay: 0.15s; }
.voice-wave span:nth-child(3) { animation-duration: 0.8s; animation-delay: 0.3s; }
.voice-wave span:nth-child(4) { animation-duration: 1.2s; animation-delay: 0.05s; }
.voice-wave span:nth-child(5) { animation-duration: 0.95s; animation-delay: 0.4s; }
.voice-wave span:nth-child(6) { animation-duration: 1.05s; animation-delay: 0.2s; }
.voice-wave span:nth-child(7) { animation-duration: 0.85s; animation-delay: 0.35s; }
.voice-wave span:nth-child(8) { animation-duration: 1.15s; animation-delay: 0.1s; }

#voice-status {
  color: #a4adc2;
  font-size: 13px;
}

.voice-transcript {
  display: grid;
  gap: 6px;
  text-align: center;
}

.voice-transcript[hidden],
.voice-gate-card[hidden] {
  display: none;
}

.voice-transcript span {
  color: #737c93;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.voice-transcript p {
  color: #e9edf7;
  font-size: 15.5px;
}

.voice-thread {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 2px;
}

.voice-thread[hidden] {
  display: none;
}

.voice-turn {
  display: grid;
  gap: 4px;
}

.voice-turn span {
  color: #737c93;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.voice-turn p {
  width: fit-content;
  max-width: 92%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 11px;
  color: #dfe6f2;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.voice-turn.user {
  justify-items: end;
}

.voice-turn.user span {
  text-align: right;
}

.voice-turn.user p {
  border-color: rgba(205, 161, 85, 0.22);
  color: #fff7df;
  background: rgba(205, 161, 85, 0.1);
}

.voice-gate-card {
  border: 1px solid rgba(205, 161, 85, 0.4);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(205, 161, 85, 0.07);
}

.voice-gate-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e7cd8a;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.voice-gate-title svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.voice-gate-card > p {
  margin-top: 9px;
  color: #cfd6e6;
  font-size: 13px;
}

.voice-gate-card button {
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  border: 0;
  border-radius: 11px;
  padding: 0 12px;
  color: #0a0f20;
  background: linear-gradient(180deg, #e7cd8a, #cda155);
  font-size: 13px;
  font-weight: 750;
}

.voice-gate-card button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.voice-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.voice-form textarea {
  min-height: 42px;
  max-height: 92px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 11px;
  color: #e9edf7;
  background: rgba(0, 0, 0, 0.18);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.voice-form textarea:focus {
  border-color: rgba(205, 161, 85, 0.42);
  box-shadow: 0 0 0 3px rgba(205, 161, 85, 0.09);
}

.voice-form button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(205, 161, 85, 0.22);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #e7cd8a;
  background: rgba(205, 161, 85, 0.09);
}

.voice-form button:hover:not(:disabled) {
  color: #0a0f20;
  border-color: transparent;
  background: linear-gradient(180deg, #e7cd8a, #cda155);
}

.voice-form button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.voice-form textarea:disabled,
.voice-form button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.voice-footnote {
  color: #737c93;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#voice-audio {
  width: 100%;
  height: 34px;
}

@keyframes voice-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.86);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes voice-wave {
  0%,
  100% {
    transform: scaleY(0.28);
  }

  50% {
    transform: scaleY(1);
  }
}

body.light .composer-model select,
body.light .composer-mic,
body.light .composer-agent {
  color: #6b7080;
}

body.light .composer-model select:hover,
body.light .composer-model select:focus,
body.light .composer-mic:hover,
body.light .composer-agent:hover {
  color: #18233a;
  background: #f1ece3;
  border-color: rgba(22, 29, 47, 0.12);
}

body.light #send {
  color: #946a22;
  background: rgba(176, 130, 58, 0.1);
  border-color: rgba(176, 130, 58, 0.22);
}

body.light #send:hover {
  color: #ffffff;
}

body.light .projects-shell,
body.light .project-row,
body.light .projects-empty,
body.light .library-shell,
body.light .library-row,
body.light .library-empty {
  color: #18233a;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(22, 29, 47, 0.12);
}

body.light .voice-panel {
  background: rgba(244, 241, 233, 0.58);
}

body.light .voice-phone {
  color: #1d2e35;
  border-color: rgba(176, 130, 58, 0.24);
  background:
    radial-gradient(125% 78% at 50% -2%, rgba(231, 205, 138, 0.28), transparent 60%),
    #fffdf8;
}

body.light .voice-lockup,
body.light .voice-agent-hero strong,
body.light .voice-transcript p,
body.light .voice-turn p,
body.light .voice-form textarea {
  color: #0d1a33;
}

body.light #voice-status,
body.light .voice-body,
body.light .voice-gate-card > p {
  color: #5d687d;
}

body.light .voice-gate-card {
  background: rgba(231, 205, 138, 0.13);
}

body.light .voice-form textarea,
body.light .voice-turn p {
  border-color: rgba(22, 29, 47, 0.12);
  background: rgba(255, 255, 255, 0.66);
}

body.light .voice-turn.user p {
  color: #523b11;
  border-color: rgba(176, 130, 58, 0.22);
  background: rgba(231, 205, 138, 0.18);
}

body.light .voice-avatar-wrap i {
  border-color: #fffdf8;
}

@media (max-width: 720px) {
  .composer-model {
    min-width: 150px;
    flex: 1 1 150px;
  }

  .voice-panel {
    width: calc(100vw - 24px);
  }
}

/* Final composer cleanup overrides. */
.composer {
  padding: 0 clamp(16px, 4vw, 44px) clamp(16px, 3.2vh, 30px);
}

.route-status {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto 6px;
  color: var(--faint);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.composer-box {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(24, 30, 43, 0.82);
  box-shadow: 0 22px 58px -44px rgba(0, 0, 0, 0.85);
}

#prompt {
  min-height: 34px;
  max-height: 170px;
  padding: 6px 6px 3px;
  color: var(--txt);
  font-size: 14px;
  line-height: 1.45;
}

#prompt::placeholder {
  color: var(--muted2);
}

.composer-meta {
  gap: 5px;
  padding: 0 0 0 2px;
}

.composer-meta > span {
  display: none;
}

.composer-tools-trigger,
.composer-mic,
.composer-agent {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  color: var(--muted);
}

.composer-tools-trigger svg,
.composer-mic svg,
.composer-agent svg {
  width: 15px;
  height: 15px;
}

.composer-agent {
  font-size: 11px;
  color: var(--pri2);
  border-color: rgba(205, 161, 85, 0.16);
  background: rgba(205, 161, 85, 0.06);
}

.composer-model {
  min-width: 132px;
  margin-left: auto;
}

.composer-model select {
  height: 29px;
  border-radius: 8px;
  padding-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

#send {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  align-self: end;
  border-radius: 11px;
  color: rgba(231, 205, 138, 0.92);
  background: rgba(205, 161, 85, 0.1);
  border: 1px solid rgba(205, 161, 85, 0.18);
  box-shadow: none;
}

#send svg {
  width: 15px;
  height: 15px;
}

.composer-tools-menu {
  bottom: 36px;
  width: min(284px, calc(100vw - 38px));
  padding: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.composer-tools-menu button {
  min-height: 34px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  border-radius: 8px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.composer-tools-menu button:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.055);
}

.composer-tools-menu button svg {
  width: 15px;
  height: 15px;
  color: var(--muted2);
}

.composer-tools-menu button small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: lowercase;
}

.composer-tools-separator {
  margin: 5px 8px;
}

.attachment-tray {
  gap: 5px;
}

body.light .route-status {
  color: #a39a84;
}

body.light .composer-box {
  border-color: rgba(22, 29, 47, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 20px 54px -42px rgba(22, 29, 47, 0.42);
}

body.light .composer-tools-menu {
  background: rgba(255, 255, 255, 0.94);
}

body.light .composer-tools-menu button {
  color: #6b7080;
}

body.light .composer-tools-menu button:hover {
  color: #18233a;
  background: #f3eee5;
}

@media (max-width: 560px) {
  .composer-box {
    grid-template-columns: 1fr;
  }

  #send {
    width: 31px;
  }

  .composer-model {
    min-width: 118px;
  }
}

/* Final composer polish: one status row, compact vertical footprint, voice-panel buffer. */
.composer {
  padding-bottom: 24px;
}

.composer form {
  max-width: none;
}

.composer-box {
  grid-template-columns: 1fr;
  width: min(820px, calc(100vw - 40px));
  gap: 0;
  padding: 12px 14px 12px;
  border-radius: 16px;
}

.prompt-stack {
  display: grid;
  gap: 8px;
}

#prompt {
  min-height: 42px;
  max-height: 116px;
  padding: 5px 2px 0;
  resize: none;
  overflow-y: auto;
}

.composer-meta {
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  padding: 0;
}

.composer-tools,
.composer-model,
.composer-mic,
.composer-agent,
#send {
  align-self: center;
}

.composer-model {
  min-width: 136px;
  margin-left: auto;
}

.composer-tools-trigger,
.composer-mic,
.composer-agent,
#send {
  width: 31px;
  height: 31px;
  min-width: 31px;
  min-height: 31px;
  border-radius: 9px;
}

#send {
  margin: 0;
  color: rgba(231, 205, 138, 0.88);
  background: rgba(205, 161, 85, 0.075);
  border-color: rgba(205, 161, 85, 0.16);
}

#send:hover {
  color: rgba(255, 245, 220, 0.96);
  background: rgba(205, 161, 85, 0.18);
  border-color: rgba(205, 161, 85, 0.28);
  box-shadow: none;
}

.attachment-tray {
  margin: 0;
}

.voice-panel {
  padding-bottom: max(104px, env(safe-area-inset-bottom));
}

@media (max-width: 560px) {
  .composer-box {
    width: min(100% - 22px, 820px);
  }

  .composer-meta {
    gap: 5px;
  }

  .composer-model {
    min-width: 106px;
  }
}

/* Final settings modal polish: quiet typography and controls. */
.settings-shell {
  width: min(860px, 92vw);
  max-height: min(560px, 88vh);
  grid-template-columns: 168px minmax(0, 1fr);
  border: 1px solid rgba(145, 158, 188, 0.16);
  border-radius: 14px;
  background: rgba(19, 25, 39, 0.96);
  box-shadow: 0 26px 70px -52px rgba(0, 0, 0, 0.86);
}

.settings-nav {
  gap: 2px;
  padding: 16px 12px;
  background: rgba(13, 19, 32, 0.58);
}

.settings-nav button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted2);
  font-size: 13px;
  font-weight: 520;
}

.settings-nav button.active,
.settings-nav button:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.045);
}

.settings-main {
  padding: 16px 22px 18px;
}

.settings-head {
  margin: 0 0 6px;
  padding: 0;
}

#settings-close {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: var(--muted2);
  border-color: rgba(145, 158, 188, 0.16);
  background: transparent;
  box-shadow: none;
}

#settings-close:hover {
  color: var(--txt);
  border-color: rgba(145, 158, 188, 0.26);
  background: rgba(255, 255, 255, 0.04);
}

.settings-panel.active {
  gap: 0;
}

.setting-row {
  min-height: 66px;
  gap: 14px;
  padding: 12px 0;
  border-bottom-color: rgba(145, 158, 188, 0.12);
}

.setting-row strong {
  color: rgba(242, 244, 250, 0.92);
  font-size: 13.5px;
  font-weight: 650;
}

.setting-row span {
  margin-top: 3px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.35;
}

.pill {
  min-width: auto;
  padding: 4px 8px;
  border-color: rgba(84, 214, 160, 0.22);
  border-radius: 8px;
  color: rgba(149, 224, 193, 0.82);
  background: rgba(84, 214, 160, 0.055);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.pill.muted {
  color: var(--muted2);
  border-color: rgba(145, 158, 188, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.toggle {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  opacity: 0.7;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

#settings-save {
  min-width: 72px;
  min-height: 34px;
  border: 1px solid rgba(205, 161, 85, 0.18);
  border-radius: 9px;
  padding: 0 14px;
  color: rgba(232, 209, 158, 0.9);
  background: rgba(205, 161, 85, 0.08);
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

#settings-save:hover {
  color: rgba(255, 245, 220, 0.96);
  background: rgba(205, 161, 85, 0.14);
}

.profile-save {
  justify-self: start;
  min-height: 32px;
  border: 1px solid rgba(205, 161, 85, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(232, 209, 158, 0.86);
  background: rgba(205, 161, 85, 0.07);
  font-size: 12px;
  font-weight: 620;
}

.profile-save:hover {
  color: rgba(255, 245, 220, 0.94);
  background: rgba(205, 161, 85, 0.13);
}

.profile-save:disabled,
#settings-save:disabled {
  cursor: wait;
  opacity: 0.55;
}

body.light .settings-shell {
  color: #18233a;
  border-color: rgba(22, 29, 47, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 68px -52px rgba(22, 29, 47, 0.5);
}

body.light .settings-nav {
  background: rgba(244, 239, 230, 0.64);
}

body.light .settings-nav button.active,
body.light .settings-nav button:hover,
body.light #settings-close:hover {
  background: rgba(22, 29, 47, 0.045);
}

body.light .setting-row {
  border-bottom-color: rgba(22, 29, 47, 0.09);
}

body.light .setting-row strong {
  color: #172033;
}

/* Quiet UI pass: all open menus, panels, modal buttons, avatars, and composer width. */
.composer-box {
  width: min(740px, calc(100vw - 40px));
  min-height: 112px;
  padding: 12px 14px 11px;
  border-radius: 16px;
  background: rgba(20, 27, 42, 0.84);
  box-shadow: 0 18px 48px -44px rgba(0, 0, 0, 0.85);
}

#prompt {
  min-height: 44px;
  max-height: 104px;
  padding: 7px 2px 9px;
  font-size: 14px;
  line-height: 1.42;
}

.composer-meta {
  min-height: 32px;
}

.composer-model {
  min-width: 124px;
}

.composer-model select {
  height: 31px;
  border-radius: 8px;
  color: rgba(202, 209, 225, 0.76);
  font-size: 13px;
}

.composer-model option,
.preset-wrap option {
  color: #e9edf7;
  background: #151b29;
}

.new-chat,
.sidebar-modebar button.active,
.sidebar-action,
.account-chip,
.presence-row,
.project-row,
.library-row,
.projects-empty,
.library-empty,
.profile-preview,
.setting-row {
  box-shadow: none;
}

.new-chat {
  color: rgba(231, 205, 138, 0.86);
  border-color: rgba(205, 161, 85, 0.14);
  background: rgba(205, 161, 85, 0.075);
  font-size: 13px;
  font-weight: 640;
}

.new-chat:hover {
  color: rgba(255, 245, 220, 0.94);
  border-color: rgba(205, 161, 85, 0.22);
  background: rgba(205, 161, 85, 0.12);
}

.sidebar-modebar button.active {
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-action:hover,
.presence-row:hover,
.account-chip:hover {
  background: rgba(255, 255, 255, 0.035);
}

.online-heading .section-label,
.section-label {
  color: rgba(158, 169, 194, 0.76);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.presence-row strong,
.account-chip strong {
  color: rgba(238, 241, 248, 0.9);
  font-size: 13px;
  font-weight: 650;
}

.presence-row small,
.account-chip small {
  color: rgba(150, 160, 184, 0.72);
  font-size: 9px;
}

.avatar,
.avatar.blue,
.avatar-blue,
.avatar.green,
.avatar-green,
.avatar.violet,
.avatar-violet,
.avatar.slate,
.avatar-slate,
.avatar.rose,
.avatar-rose,
.avatar.gold,
.avatar.admin,
.avatar-gold {
  color: rgba(246, 248, 252, 0.92);
  background: linear-gradient(145deg, rgba(86, 101, 132, 0.92), rgba(53, 63, 86, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.avatar::after {
  width: 8px;
  height: 8px;
  background: rgba(84, 214, 160, 0.88);
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.96);
}

.avatar-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  opacity: 0.78;
}

.avatar-swatch.active {
  opacity: 1;
  border-color: rgba(231, 205, 138, 0.62);
  box-shadow: 0 0 0 2px rgba(205, 161, 85, 0.1);
}

.popover,
.composer-tools-menu,
.controls-panel,
.direct-panel,
.projects-shell,
.library-shell,
.voice-phone,
.settings-shell {
  border-color: rgba(145, 158, 188, 0.14);
  background: rgba(18, 24, 37, 0.96);
  box-shadow: 0 24px 64px -50px rgba(0, 0, 0, 0.84);
}

.popover,
.composer-tools-menu {
  border-radius: 12px;
  padding: 6px;
}

.popover button,
.composer-tools-menu button {
  min-height: 34px;
  border-radius: 8px;
  gap: 9px;
  padding: 0 8px;
  color: rgba(229, 234, 244, 0.86);
  font-size: 13px;
  font-weight: 520;
}

.popover button:hover,
.composer-tools-menu button:hover {
  color: rgba(247, 249, 253, 0.96);
  background: rgba(255, 255, 255, 0.045);
}

.composer-tools-menu button svg,
.popover button svg {
  width: 15px;
  height: 15px;
  color: rgba(162, 173, 197, 0.76);
}

.composer-tools-menu button small {
  color: rgba(148, 158, 181, 0.7);
  font-size: 9.5px;
  font-weight: 600;
}

.composer-tools-separator {
  margin: 5px 7px;
  background: rgba(145, 158, 188, 0.1);
}

.controls-panel {
  width: min(350px, 100vw);
  padding: 15px;
}

.controls-head {
  margin-bottom: 12px;
}

.controls-head strong {
  padding: 0;
  color: rgba(242, 244, 250, 0.9);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.controls-panel section {
  padding: 11px 0;
}

.panel-row strong {
  font-size: 13px;
  font-weight: 650;
}

.panel-row span,
.params-list small {
  font-size: 12px;
}

.tuning-grid {
  gap: 9px;
}

.tuning-grid input[type="number"],
.controls-panel textarea,
.direct-form textarea,
.profile-field input {
  min-height: 34px;
  border-radius: 9px;
  border-color: rgba(145, 158, 188, 0.14);
  background: rgba(10, 15, 26, 0.32);
  font-size: 12.5px;
}

.settings-actions button,
.direct-form button,
.project-join,
.voice-gate-card button {
  min-height: 32px;
  border: 1px solid rgba(205, 161, 85, 0.15);
  border-radius: 9px;
  padding: 0 12px;
  color: rgba(231, 205, 138, 0.88);
  background: rgba(205, 161, 85, 0.07);
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: none;
}

.settings-actions button:hover,
.direct-form button:hover,
.project-join:hover,
.voice-gate-card button:hover:not(:disabled) {
  color: rgba(255, 245, 220, 0.96);
  border-color: rgba(205, 161, 85, 0.24);
  background: rgba(205, 161, 85, 0.12);
}

.direct-panel {
  --panel: #182132;
  --card: #1d273a;
  --field: #131b2a;
  width: min(390px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  gap: 11px;
  padding: 15px;
  border-color: rgba(205, 161, 85, 0.13);
  background: rgba(21, 28, 42, 0.97);
}

.direct-message p,
.direct-message.mine p {
  color: rgba(234, 239, 249, 0.9);
  border-color: rgba(145, 158, 188, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.direct-message.mine p {
  border-color: rgba(205, 161, 85, 0.14);
  background: rgba(205, 161, 85, 0.075);
}

.projects-shell,
.library-shell {
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
}

.project-row,
.projects-empty,
.library-row,
.library-empty {
  border-color: rgba(145, 158, 188, 0.12);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.library-status {
  border-color: rgba(145, 158, 188, 0.13);
  color: rgba(154, 164, 188, 0.74);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
}

.library-status.enabled {
  color: rgba(149, 224, 193, 0.8);
  border-color: rgba(84, 214, 160, 0.18);
}

.voice-phone {
  width: min(380px, calc(100vw - 28px));
  border-radius: 24px;
  background: rgba(15, 21, 34, 0.97);
}

.voice-phone-glow {
  opacity: 0.42;
}

.voice-form button,
#send,
.composer-agent {
  color: rgba(231, 205, 138, 0.86);
  border-color: rgba(205, 161, 85, 0.15);
  background: rgba(205, 161, 85, 0.065);
  box-shadow: none;
}

.voice-form button:hover:not(:disabled),
#send:hover,
.composer-agent:hover {
  color: rgba(255, 245, 220, 0.95);
  border-color: rgba(205, 161, 85, 0.24);
  background: rgba(205, 161, 85, 0.12);
  box-shadow: none;
}

body.light .composer-box,
body.light .popover,
body.light .composer-tools-menu,
body.light .controls-panel,
body.light .direct-panel,
body.light .projects-shell,
body.light .library-shell,
body.light .settings-shell {
  border-color: rgba(23, 32, 51, 0.11);
  background: rgba(250, 248, 243, 0.96);
  box-shadow: 0 24px 60px -50px rgba(23, 32, 51, 0.42);
}

body.light .new-chat,
body.light .settings-actions button,
body.light .direct-form button,
body.light .project-join,
body.light #send,
body.light .composer-agent,
body.light .voice-form button {
  color: #7a5c26;
  border-color: rgba(122, 92, 38, 0.16);
  background: rgba(205, 161, 85, 0.08);
}

body.light .popover button:hover,
body.light .composer-tools-menu button:hover,
body.light .sidebar-action:hover,
body.light .presence-row:hover,
body.light .account-chip:hover {
  background: rgba(23, 32, 51, 0.045);
}

body.light .direct-message p,
body.light .direct-message.mine p,
body.light .project-row,
body.light .projects-empty,
body.light .library-row,
body.light .library-empty {
  border-color: rgba(23, 32, 51, 0.09);
  background: rgba(23, 32, 51, 0.035);
}

@media (max-width: 560px) {
  .composer-box {
    width: min(100% - 22px, 740px);
    min-height: 108px;
  }
}

/* Compact quote topbar: no redundant main menu brand or collapse icon. */
.topbar {
  min-height: 58px;
  padding: 10px 18px;
  justify-content: initial;
}

.header-actions {
  position: absolute;
  top: 50%;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
}

.topbar .preset-wrap {
  min-width: 176px;
  height: 34px;
  border-radius: 9px;
  background: rgba(21, 29, 46, 0.82);
}

.topbar .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.topbar-quote {
  position: absolute;
  left: 43%;
  max-width: min(560px, calc(100% - 430px));
  transform: translateX(-50%);
  color: rgba(231, 205, 138, 0.68);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.12vw, 16px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.topbar-quote::before,
.topbar-quote::after {
  color: rgba(231, 205, 138, 0.46);
}

.topbar-quote::before {
  content: open-quote;
}

.topbar-quote::after {
  content: close-quote;
}

.topbar .product,
.topbar h1 {
  display: none;
}

body.light .topbar-quote {
  color: rgba(122, 92, 38, 0.66);
}

body.light .topbar-quote::before,
body.light .topbar-quote::after {
  color: rgba(122, 92, 38, 0.45);
}

body.sidebar-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding: 9px 6px;
  border-right: 1px solid var(--line);
}

body.sidebar-collapsed .sidebar > * {
  display: none;
}

body.sidebar-collapsed .sidebar .brand-row {
  display: flex;
  visibility: visible;
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar .brand-lockup {
  display: none;
}

body.sidebar-collapsed #sidebar-toggle {
  visibility: visible;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

/* Settings status indicators: dot plus quiet label, no colored buttons. */
.setting-row > .pill,
.setting-row > .toggle,
.setting-row > .status-label {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  flex: none;
  font-size: 9.5px;
  line-height: 1;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  color: rgba(150, 160, 184, 0.68);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 520;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.status-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(150, 160, 184, 0.52);
  box-shadow: none;
}

.status-label.active {
  color: rgba(156, 206, 185, 0.72);
}

.status-label.active::before {
  background: var(--arc-green);
  box-shadow: var(--glow-green);
}

.status-label.neutral::before {
  background: rgba(145, 158, 188, 0.58);
}

#settings-save {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 6px;
  color: rgba(202, 209, 225, 0.72);
  background: transparent;
  font-size: 12px;
  font-weight: 560;
}

#settings-save:hover {
  color: rgba(242, 244, 250, 0.9);
  background: rgba(255, 255, 255, 0.035);
}

body.light .status-label {
  color: rgba(86, 91, 106, 0.7);
}

body.light .status-label.active {
  color: rgba(47, 128, 95, 0.76);
}

body.light #settings-save {
  color: rgba(39, 50, 74, 0.7);
}

body.light #settings-save:hover {
  color: rgba(14, 26, 48, 0.9);
  background: rgba(23, 32, 51, 0.04);
}

/* Final topbar placement: quote left of the fixed route/action cluster. */
.topbar {
  min-height: 58px;
  padding: 10px 18px;
  align-items: center;
  flex-direction: row;
  gap: 0;
}

.topbar-quote {
  display: block;
  position: absolute;
  top: 50%;
  left: 41%;
  max-width: min(520px, calc(100% - 440px));
  transform: translate(-50%, -50%);
  color: rgba(231, 205, 138, 0.72);
}

.topbar .header-actions {
  position: absolute;
  top: 50%;
  right: 18px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  width: auto;
  transform: translateY(-50%);
}

.topbar .preset-wrap {
  width: 176px;
  min-width: 176px;
  height: 34px;
}

.topbar .icon-button {
  width: 34px;
  height: 34px;
}

/* Quiet sidebar modebar and empty chat state. */
.sidebar-modebar {
  min-height: 34px;
  gap: 2px;
  padding: 2px;
  border-color: rgba(145, 158, 188, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.sidebar-modebar button {
  height: 28px;
  border-radius: 7px;
  gap: 5px;
  color: rgba(150, 160, 184, 0.72);
  font-size: 11px;
  font-weight: 560;
}

.sidebar-modebar button svg {
  width: 13px;
  height: 13px;
}

.sidebar-modebar button.active {
  color: rgba(232, 236, 246, 0.88);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.sidebar-modebar button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.sidebar-primary {
  gap: 2px;
}

.sidebar-action {
  min-height: 32px;
  border-radius: 8px;
  color: rgba(185, 194, 214, 0.74);
  font-size: 12px;
  font-weight: 520;
}

.sidebar-action svg {
  width: 14px;
  height: 14px;
}

.sidebar-action:disabled {
  opacity: 0.38;
}

.messages {
  padding-top: 24px;
}

.message.intro {
  max-width: 760px;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 0;
}

.message.intro .message-role,
.empty-footnote {
  justify-content: flex-start;
  color: rgba(150, 160, 184, 0.72);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
}

.message.intro .message-role::before {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.message.intro .message-body {
  max-width: 760px;
  padding: 12px 14px;
  border-color: rgba(145, 158, 188, 0.13);
  border-radius: 11px;
  color: rgba(222, 228, 241, 0.8);
  background: rgba(20, 27, 42, 0.54);
  font-size: 14px;
  line-height: 1.55;
  box-shadow: none;
}

.empty-footnote {
  max-width: 760px;
  margin: 72px auto 0;
  justify-content: center;
  text-align: center;
  text-transform: none;
}

body.light .sidebar-modebar {
  border-color: rgba(23, 32, 51, 0.08);
  background: rgba(23, 32, 51, 0.018);
}

body.light .sidebar-modebar button.active,
body.light .sidebar-action:hover {
  background: rgba(23, 32, 51, 0.04);
}

body.light .message.intro .message-body {
  color: rgba(38, 43, 54, 0.78);
  border-color: rgba(23, 32, 51, 0.09);
  background: rgba(255, 255, 255, 0.46);
}

/* Two reminder quotes centered in the open header space before route controls. */
.topbar-quote {
  display: none;
}

.topbar-quotes {
  position: absolute;
  top: 50%;
  left: 18px;
  right: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 34px);
  transform: translateY(-50%);
  pointer-events: none;
}

.topbar-quotes span {
  min-width: 0;
  color: color-mix(in srgb, var(--pri2) 76%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 0.82vw, 14px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-quotes span::before,
.topbar-quotes span::after {
  color: color-mix(in srgb, var(--pri2) 48%, transparent);
}

.topbar-quotes span::before {
  content: open-quote;
}

.topbar-quotes span::after {
  content: close-quote;
}

body.light .topbar-quotes span {
  color: rgba(122, 92, 38, 0.66);
}

body.light .topbar-quotes span::before,
body.light .topbar-quotes span::after {
  color: rgba(122, 92, 38, 0.45);
}

/* Sidebar search and project picker cleanup. */
.sidebar-search {
  margin: 2px 0;
}

.sidebar-search label {
  height: 30px;
  gap: 7px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  color: rgba(150, 160, 184, 0.72);
  background: transparent;
}

.sidebar-search label:hover,
.sidebar-search label:focus-within {
  color: rgba(226, 232, 243, 0.88);
  border: 0;
  background: rgba(255, 255, 255, 0.025);
}

.sidebar-search svg {
  width: 13px;
  height: 13px;
}

.sidebar-search input {
  color: rgba(218, 225, 238, 0.82);
  font-size: 12px;
  font-weight: 430;
}

.sidebar-search input::placeholder {
  color: rgba(150, 160, 184, 0.62);
}

.projects-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.projects-picker label {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(145, 158, 188, 0.12);
  border-radius: 9px;
  padding: 0 10px;
  color: rgba(150, 160, 184, 0.72);
  background: rgba(255, 255, 255, 0.025);
}

.projects-picker svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.projects-picker input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: rgba(226, 232, 243, 0.88);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
}

.projects-picker input::placeholder {
  color: rgba(150, 160, 184, 0.62);
}

#projects-create {
  min-height: 34px;
  border: 1px solid rgba(205, 161, 85, 0.14);
  border-radius: 9px;
  padding: 0 12px;
  color: rgba(231, 205, 138, 0.82);
  background: rgba(205, 161, 85, 0.06);
  font-size: 12px;
  font-weight: 560;
}

#projects-create:hover {
  color: rgba(255, 245, 220, 0.94);
  background: rgba(205, 161, 85, 0.1);
}

.projects-list {
  min-height: 150px;
  gap: 6px;
}

.project-row,
.projects-empty {
  border-color: rgba(145, 158, 188, 0.1);
  border-radius: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.025);
}

.project-row strong {
  color: rgba(233, 238, 248, 0.88);
  font-size: 13px;
  font-weight: 600;
}

.project-row div span,
.projects-empty {
  color: rgba(150, 160, 184, 0.68);
  font-size: 11px;
}

.project-join {
  min-width: 56px;
  min-height: 28px;
  border: 0;
  padding: 0 6px;
  color: rgba(202, 209, 225, 0.74);
  background: transparent;
  font-size: 11.5px;
  font-weight: 520;
}

.project-join:hover {
  color: rgba(242, 244, 250, 0.92);
  background: rgba(255, 255, 255, 0.035);
}

.project-join.joined {
  color: rgba(156, 206, 185, 0.78);
  border-color: transparent;
  background: transparent;
}

body.light .sidebar-search label:hover,
body.light .sidebar-search label:focus-within,
body.light .projects-picker label,
body.light .project-row,
body.light .projects-empty {
  background: rgba(23, 32, 51, 0.035);
}

body.light .projects-picker input,
body.light .sidebar-search input,
body.light .project-row strong {
  color: rgba(39, 50, 74, 0.86);
}

/* Discreet trident accent control. */
.trident-trigger {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 4;
  width: 34px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: transparent;
  transform: translateY(-50%);
  opacity: 0.34;
}

.trident-trigger:hover,
.trident-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.028);
  opacity: 0.74;
}

.trident-trigger img {
  display: block;
  width: 27px;
  height: 15px;
  object-fit: contain;
  filter: saturate(0.8) sepia(0.18) brightness(0.94);
  transform: translateY(1px);
}

html[data-brand-theme="teams-capital"] .trident-trigger img {
  width: 20px;
  height: 20px;
  filter: none;
  transform: none;
}

html[data-brand-theme="teams-capital"] .chat-card-config,
html[data-brand-theme="teams-capital"] .chat-route-select {
  display: none;
}

.accent-menu {
  position: absolute;
  z-index: 40;
  top: 44px;
  left: 12px;
  width: 172px;
  border: 1px solid rgba(145, 158, 188, 0.13);
  border-radius: 10px;
  padding: 8px;
  background: rgba(7, 13, 27, 0.96);
  box-shadow: 0 22px 54px -42px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
}

.accent-menu[hidden],
.accent-pin-form[hidden],
.accent-choices[hidden] {
  display: none;
}

.accent-pin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.accent-pin-form label {
  display: grid;
  gap: 4px;
}

.accent-pin-form span {
  color: rgba(150, 160, 184, 0.68);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accent-pin-form input {
  width: 100%;
  height: 28px;
  border: 1px solid rgba(145, 158, 188, 0.13);
  border-radius: 8px;
  outline: 0;
  padding: 0 8px;
  color: rgba(226, 232, 243, 0.88);
  background: rgba(255, 255, 255, 0.028);
  font: inherit;
  font-size: 12px;
}

.accent-pin-form button {
  height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  color: color-mix(in srgb, var(--pri2) 78%, transparent);
  background: rgba(255, 255, 255, 0.028);
  font-size: 10.5px;
}

.accent-choices {
  display: grid;
  gap: 3px;
}

.accent-choices button {
  height: 28px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: rgba(202, 209, 225, 0.72);
  background: transparent;
  font-size: 11.5px;
  text-align: left;
}

.accent-choices button:hover,
.accent-choices button.active {
  color: rgba(242, 244, 250, 0.9);
  background: rgba(255, 255, 255, 0.035);
}

.accent-choices span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--pri2);
  box-shadow: 0 0 9px color-mix(in srgb, var(--pri2) 42%, transparent);
}

.accent-choices [data-accent="gold"] span { background: #e7cd8a; }
.accent-choices [data-accent="blue"] span { background: #9fb9f2; }
.accent-choices [data-accent="red"] span { background: #ff5a64; }
.accent-choices [data-accent="silver"] span { background: #d2dae6; }

body.light .accent-menu {
  background: rgba(250, 248, 243, 0.96);
}

body.light .accent-pin-form input,
body.light .accent-pin-form button,
body.light .accent-choices button:hover,
body.light .accent-choices button.active {
  background: rgba(23, 32, 51, 0.04);
}

/* Wire-style session ticker replacing the old empty-state card. */
.wire-ticker {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 48px));
  min-height: 24px;
  margin: 18px auto 0;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0;
  color: rgba(148, 157, 181, 0.66);
  background: transparent;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  line-height: 1.6;
  text-align: center;
}

.wire-mark {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pri2) 68%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--pri2) 32%, transparent);
  opacity: 0.82;
}

#wire-ticker-text::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1.08em;
  margin-left: 5px;
  vertical-align: -0.15em;
  background: rgba(148, 157, 181, 0.44);
  animation: wire-caret 0.95s steps(1) infinite;
}

.messages {
  padding-top: 18px;
}

.messages:empty {
  overflow: hidden;
}

body.light .wire-ticker {
  color: rgba(89, 99, 121, 0.66);
  background: transparent;
}

body.light #wire-ticker-text::after {
  background: rgba(89, 99, 121, 0.38);
}

@keyframes wire-caret {
  50% {
    opacity: 0;
  }
}

/* Compact composer height pass. */
.composer-box {
  min-height: 88px;
  padding: 9px 12px 8px;
  border-radius: 14px;
}

.prompt-stack {
  gap: 5px;
}

#prompt {
  min-height: 32px;
  max-height: 82px;
  padding: 2px 2px 0;
  line-height: 1.34;
}

.composer-meta {
  min-height: 30px;
}

.composer-tools-trigger,
.composer-mic,
.composer-agent,
#send {
  width: 29px;
  height: 29px;
  min-width: 29px;
  min-height: 29px;
}

#prompt::placeholder {
  color: rgba(150, 160, 184, 0.46);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-style: italic;
  font-weight: 360;
  letter-spacing: 0.02em;
}

.composer-left-actions,
.composer-right-actions {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 7px;
}

.composer-left-actions {
  justify-content: flex-start;
}

.composer-right-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.composer-meta {
  justify-content: space-between;
}

.composer-model {
  margin-left: 0;
}

.attachment-tray {
  flex: 1 1 auto;
  min-width: 0;
}

/* Comms card voice panel. The prior Spuds card is preserved under reference/cards. */
.voice-comms-shell.voice-phone {
  width: min(860px, calc(100vw - 42px));
  max-height: min(620px, calc(100vh - 64px));
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}

.voice-comms-head {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(145, 158, 188, 0.09);
}

.voice-comms-head .voice-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.voice-comms-head .voice-lockup span {
  color: rgba(232, 236, 246, 0.86);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.voice-comms-head .voice-lockup small {
  color: rgba(150, 160, 184, 0.56);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.voice-comms-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
  gap: 12px;
  padding: 12px;
  overflow: auto;
}

.voice-comms-card {
  min-width: 0;
  border: 1px solid rgba(145, 158, 188, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
}

.voice-comms-card-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(145, 158, 188, 0.08);
}

.voice-comms-card-head span {
  color: rgba(232, 236, 246, 0.84);
  font-size: 13px;
  font-weight: 620;
}

.voice-comms-card-head em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid color-mix(in srgb, var(--pri2) 26%, rgba(145, 158, 188, 0.1));
  border-radius: 999px;
  padding: 0 8px;
  color: color-mix(in srgb, var(--pri2) 72%, rgba(232, 236, 246, 0.78));
  background: color-mix(in srgb, var(--pri2) 8%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voice-agent-channel {
  display: flex;
  flex-direction: column;
}

.voice-agent-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 14px 12px;
}

.voice-agent-row .voice-avatar-wrap {
  width: 76px;
  height: 76px;
}

.voice-agent-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-agent-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.voice-agent-title strong {
  color: rgba(245, 247, 252, 0.92);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: 0.02em;
}

.voice-agent-title small {
  color: rgba(150, 160, 184, 0.62);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.voice-agent-meta {
  color: color-mix(in srgb, var(--pri2) 72%, rgba(150, 160, 184, 0.72));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.voice-agent-main #voice-status {
  min-height: 46px;
  margin: 0;
  border: 1px solid rgba(145, 158, 188, 0.08);
  border-radius: 8px;
  padding: 10px 11px;
  color: rgba(202, 209, 225, 0.74);
  background: rgba(0, 0, 0, 0.1);
  font-size: 12.5px;
  line-height: 1.45;
}

.voice-agent-main .voice-wave {
  justify-content: flex-start;
  margin: 0;
}

.voice-agent-channel .voice-transcript,
.voice-agent-channel .voice-thread,
.voice-agent-channel .voice-gate-card,
.voice-agent-channel .voice-form {
  margin-left: 14px;
  margin-right: 14px;
}

.voice-agent-channel .voice-form {
  margin-top: auto;
  margin-bottom: 14px;
}

.voice-operator-strip {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(145, 158, 188, 0.08);
}

.voice-operator-strip span,
.voice-operator-strip button,
.voice-human-thread article > span {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 164, 255, 0.28);
  border-radius: 8px;
  color: rgba(194, 211, 255, 0.9);
  background: rgba(122, 164, 255, 0.1);
  font-size: 10px;
  font-weight: 700;
}

.voice-operator-strip button {
  cursor: pointer;
  appearance: none;
  padding: 0;
}

.voice-operator-strip button.selected {
  border-color: rgba(244, 190, 82, 0.62);
  color: rgba(250, 216, 145, 0.96);
  background: rgba(244, 190, 82, 0.13);
  box-shadow: 0 0 18px rgba(244, 190, 82, 0.18);
}

.voice-operator-strip i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 9px rgba(91, 220, 154, 0.45);
}

.voice-human-thread {
  min-height: 128px;
  max-height: 128px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 12px;
}

.voice-human-thread article {
  display: flex;
  gap: 9px;
}

.voice-human-thread p {
  margin: 0;
  color: rgba(202, 209, 225, 0.72);
  font-size: 12.5px;
  line-height: 1.42;
}

.voice-human-thread b {
  display: block;
  margin-bottom: 2px;
  color: rgba(232, 236, 246, 0.84);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 580;
  letter-spacing: 0.08em;
}

.voice-human-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 12px;
  border-top: 1px solid rgba(145, 158, 188, 0.08);
}

.voice-human-compose span,
.voice-human-compose input {
  flex: 1;
  color: rgba(150, 160, 184, 0.58);
  font-size: 12px;
  font-style: italic;
}

.voice-human-compose input {
  min-width: 0;
  height: 28px;
  border: 1px solid rgba(145, 158, 188, 0.1);
  border-radius: 8px;
  padding: 0 9px;
  color: rgba(232, 236, 246, 0.84);
  background: rgba(255, 255, 255, 0.025);
  outline: none;
  font-style: normal;
}

.voice-human-compose input:focus {
  border-color: rgba(244, 190, 82, 0.44);
  box-shadow: 0 0 0 2px rgba(244, 190, 82, 0.09);
}

.voice-human-compose button {
  width: 32px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(145, 158, 188, 0.1);
  border-radius: 8px;
  color: rgba(150, 160, 184, 0.58);
  background: rgba(255, 255, 255, 0.025);
}

.voice-human-compose button:not(:disabled) {
  border-color: rgba(244, 190, 82, 0.42);
  color: rgba(244, 190, 82, 0.92);
  background: rgba(244, 190, 82, 0.08);
  cursor: pointer;
}

.voice-human-compose svg {
  width: 14px;
  height: 14px;
}

.voice-comms-body > .voice-footnote,
.voice-comms-body > #voice-audio {
  grid-column: 1 / -1;
}

body.light .voice-comms-card {
  border-color: rgba(23, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.34);
}

body.light .voice-comms-card-head,
body.light .voice-operator-strip,
body.light .voice-human-compose {
  border-color: rgba(23, 32, 51, 0.08);
}

body.light .voice-comms-card-head span,
body.light .voice-agent-title strong,
body.light .voice-human-thread b {
  color: rgba(39, 50, 74, 0.82);
}

body.light .voice-agent-main #voice-status,
body.light .voice-human-thread p {
  color: rgba(75, 83, 101, 0.74);
  background: rgba(23, 32, 51, 0.035);
}

body.light .voice-human-compose span,
body.light .voice-human-compose input {
  color: rgba(75, 83, 101, 0.58);
}

@media (max-width: 760px) {
  .voice-comms-body {
    grid-template-columns: 1fr;
  }

  .voice-agent-row {
    grid-template-columns: 1fr;
  }

  .voice-agent-row .voice-avatar-wrap {
    margin: 0 auto;
  }
}

body.light #prompt::placeholder {
  color: rgba(75, 83, 101, 0.45);
}

/* Clean chat transcript and sidebar icon/list controls. */
.message {
  max-width: 760px;
  margin-bottom: 28px;
}

.message-role {
  color: rgba(150, 160, 184, 0.54);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.18em;
}

.message.assistant .message-role::before {
  width: 10px;
  height: 10px;
  opacity: 0.62;
}

.message.assistant:not(.intro) .message-body,
.message.intro .message-body {
  max-width: 760px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(218, 225, 238, 0.76);
  background: transparent;
  box-shadow: none;
  font-size: 14.5px;
  line-height: 1.66;
}

.message.user .message-body {
  max-width: min(520px, 78vw);
  padding: 9px 13px;
  border: 1px solid rgba(145, 158, 188, 0.08);
  border-radius: 14px;
  color: rgba(235, 239, 248, 0.88);
  background: rgba(122, 164, 255, 0.075);
  box-shadow: none;
}

.message.error .message-body {
  color: var(--danger);
}

body.light .message.assistant:not(.intro) .message-body,
body.light .message.intro .message-body {
  color: rgba(39, 50, 74, 0.76);
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.light .message.user .message-body {
  color: rgba(14, 26, 48, 0.86);
  border-color: rgba(23, 32, 51, 0.07);
  background: rgba(122, 164, 255, 0.09);
}

.sidebar-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  margin: -2px 0 4px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.sidebar-view-toggle button {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: rgba(150, 160, 184, 0.52);
  background: transparent;
}

.sidebar-view-toggle button:hover,
.sidebar-view-toggle button[aria-pressed="true"] {
  color: rgba(226, 232, 243, 0.78);
  background: rgba(255, 255, 255, 0.028);
}

.sidebar-view-toggle svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.sidebar-primary .sidebar-action,
.sidebar-search label {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-primary .sidebar-action:hover,
.sidebar-search label:hover,
.sidebar-search label:focus-within {
  background: rgba(255, 255, 255, 0.025);
}

.sidebar-primary .sidebar-action svg,
.sidebar-search svg {
  color: var(--arc-cyan);
  opacity: 0.68;
  stroke-width: 2;
}

.sidebar-icon-mode .sidebar-primary {
  grid-template-columns: repeat(5, 1fr);
  display: grid;
  gap: 5px;
}

.sidebar-icon-mode .sidebar-primary .sidebar-action {
  min-height: 36px;
  justify-content: center;
  padding: 0;
}

.sidebar-icon-mode .sidebar-primary .sidebar-action span {
  display: none;
}

.sidebar-icon-mode .sidebar-primary .sidebar-action svg {
  width: 16px;
  height: 16px;
}

.sidebar-icon-mode .sidebar-search label {
  width: 36px;
  justify-content: center;
}

.sidebar-icon-mode .sidebar-search input {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

body.light .sidebar-view-toggle button:hover,
body.light .sidebar-view-toggle button[aria-pressed="true"],
body.light .sidebar-primary .sidebar-action:hover,
body.light .sidebar-search label:hover,
body.light .sidebar-search label:focus-within {
  background: rgba(23, 32, 51, 0.035);
}

body.light .sidebar-primary .sidebar-action svg,
body.light .sidebar-search svg {
  color: rgba(48, 113, 163, 0.78);
}

#profile-save.profile-save {
  min-height: 32px;
  border: 1px solid rgba(205, 161, 85, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(232, 209, 158, 0.86);
  background: rgba(205, 161, 85, 0.07);
  font-size: 12px;
  font-weight: 620;
}

#profile-save.profile-save:hover {
  color: rgba(255, 245, 220, 0.94);
  background: rgba(205, 161, 85, 0.13);
}

.appearance-controls {
  display: grid;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(145, 158, 188, 0.08);
}

.appearance-control {
  gap: 8px;
}

.appearance-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(206, 213, 229, 0.78);
  font-size: 12px;
  font-weight: 520;
}

.appearance-control output {
  color: rgba(150, 160, 184, 0.62);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.08em;
}

.appearance-control input[type="range"] {
  width: 100%;
  height: 18px;
  accent-color: var(--pri2);
  background: transparent;
}

.appearance-control input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(145, 158, 188, 0.16);
}

.appearance-control input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 1px solid rgba(231, 205, 138, 0.36);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pri2) 72%, var(--bg));
  box-shadow: 0 0 0 3px rgba(205, 161, 85, 0.06);
}

body.light .appearance-controls {
  border-bottom-color: rgba(23, 32, 51, 0.07);
}

body.light .appearance-control span {
  color: rgba(39, 50, 74, 0.72);
}

body.light .appearance-control output {
  color: rgba(75, 83, 101, 0.58);
}

.appearance-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.appearance-heading strong {
  color: rgba(226, 232, 243, 0.8);
  font-size: 12px;
  font-weight: 560;
}

.appearance-heading span {
  color: rgba(150, 160, 184, 0.62);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.background-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.background-swatch {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(145, 158, 188, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: rgba(202, 209, 225, 0.68);
  background: rgba(255, 255, 255, 0.018);
  font-size: 11px;
  font-weight: 520;
  text-align: left;
}

.background-swatch:hover,
.background-swatch.active {
  color: rgba(242, 244, 250, 0.88);
  border-color: rgba(145, 158, 188, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.background-swatch.active {
  border-color: color-mix(in srgb, var(--pri2) 34%, rgba(145, 158, 188, 0.18));
}

.background-swatch span {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  flex: none;
}

.background-swatch[data-shade="ink"] span { background: var(--arc-ink); }
.background-swatch[data-shade="base"] span { background: var(--arc-base); }
.background-swatch[data-shade="deep"] span { background: var(--arc-panel-deep); }
.background-swatch[data-shade="panel"] span { background: var(--arc-panel); }
.background-swatch[data-shade="alt"] span { background: var(--arc-panel-alt); }
.background-swatch[data-shade="black"] span { background: #000; }

body.light .appearance-heading strong {
  color: rgba(39, 50, 74, 0.74);
}

body.light .background-swatch {
  color: rgba(75, 83, 101, 0.68);
  border-color: rgba(23, 32, 51, 0.08);
  background: rgba(23, 32, 51, 0.025);
}

body.light .background-swatch:hover,
body.light .background-swatch.active {
  color: rgba(14, 26, 48, 0.88);
  background: rgba(23, 32, 51, 0.045);
}

/* Header mission clock replacing quote strip. */
.topbar-quotes,
.topbar-quote {
  display: none !important;
}

.header-clock {
  position: absolute;
  top: 50%;
  left: 18px;
  right: 300px;
  width: auto;
  max-width: none;
  margin: 0 auto;
  transform: translateY(-50%);
}

.arc-clock {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.arc-clock__col {
  min-width: 82px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  text-align: center;
}

.arc-clock__col + .arc-clock__col {
  border-left: 0;
}

.arc-clock__label {
  color: rgba(150, 160, 184, 0.58);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7.5px;
  font-weight: 520;
  letter-spacing: 0.16em;
  line-height: 1.1;
  white-space: nowrap;
}

.arc-clock__value {
  color: rgba(232, 236, 246, 0.86);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
}

.arc-clock__value--utc,
.arc-clock__value--zulu {
  color: color-mix(in srgb, var(--pri2) 68%, rgba(232, 236, 246, 0.78));
}

body.light .arc-clock {
  background: transparent;
}

body.light .arc-clock__col + .arc-clock__col {
  border-left-color: transparent;
}

body.light .arc-clock__label {
  color: rgba(75, 83, 101, 0.56);
}

body.light .arc-clock__value {
  color: rgba(39, 50, 74, 0.8);
}

body.light .arc-clock__value--utc,
body.light .arc-clock__value--zulu {
  color: color-mix(in srgb, var(--pri2) 68%, rgba(39, 50, 74, 0.76));
}

@media (max-width: 940px) {
  .header-clock {
    display: none;
  }
}

/* Custom preset picker: menu labels stay descriptive, selected state shows route alias. */
.preset-picker {
  position: relative;
}

.preset-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.preset-trigger {
  width: 100%;
  height: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: rgba(226, 232, 243, 0.84);
  background: transparent;
  font-size: 12px;
  font-weight: 520;
}

.preset-trigger svg {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: rgba(150, 160, 184, 0.64);
  stroke-width: 1.8;
}

.preset-display {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-dot {
  background: var(--arc-red);
  box-shadow: var(--glow-red);
  animation: route-breathe 2.4s ease-in-out infinite;
}

.route-dot[data-status="warming"] {
  background: var(--arc-amber);
  box-shadow: var(--glow-amber);
}

.route-dot[data-status="gtg"] {
  background: var(--arc-green);
  box-shadow: var(--glow-green);
}

.route-dot[data-status="off"] {
  animation-duration: 3.4s;
}

@keyframes route-breathe {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.preset-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 7px);
  right: 0;
  width: 224px;
  border: 1px solid rgba(145, 158, 188, 0.13);
  border-radius: 10px;
  padding: 6px;
  background: color-mix(in srgb, var(--panel) 94%, black);
  box-shadow: 0 22px 54px -42px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(18px);
}

.preset-menu[hidden] {
  display: none;
}

.preset-menu-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  color: rgba(218, 225, 238, 0.82);
  background: transparent;
  text-align: left;
}

.preset-menu-item:hover,
.preset-menu-item.active {
  background: rgba(255, 255, 255, 0.04);
}

.preset-menu-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.preset-menu-copy strong,
.preset-menu-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-menu-copy strong {
  color: rgba(236, 240, 248, 0.88);
  font-size: 12px;
  font-weight: 570;
}

.preset-menu-copy small {
  color: rgba(150, 160, 184, 0.62);
  font-size: 10.5px;
  font-weight: 440;
}

.composer-model.preset-picker {
  min-width: 112px;
  max-width: 168px;
}

.composer-preset-trigger {
  justify-content: flex-start;
  min-height: 29px;
  border: 0;
  border-radius: 8px;
  padding: 0 4px 0 7px;
}

.composer-preset-menu {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
}

.single-agent-form #composer-preset-status-light {
  display: none;
}

.single-agent-form .composer-preset-trigger {
  justify-content: flex-end;
  gap: 6px;
  padding: 0;
  color: color-mix(in srgb, var(--pri2) 86%, rgba(232, 236, 246, 0.14));
  background: transparent;
}

.single-agent-form #composer-preset-display {
  color: color-mix(in srgb, var(--pri2) 88%, rgba(255, 255, 255, 0.18));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px color-mix(in srgb, var(--pri2) 54%, transparent),
    0 0 18px color-mix(in srgb, var(--pri2) 28%, transparent);
}

.single-agent-form .composer-preset-trigger svg {
  width: 11px;
  height: 11px;
  margin-left: 0;
  color: color-mix(in srgb, var(--pri2) 62%, rgba(150, 160, 184, 0.52));
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--pri2) 35%, transparent));
}

.single-agent-form .preset-menu {
  width: 236px;
  max-width: min(236px, calc(100vw - 32px));
}

.single-agent-form .preset-menu button,
.single-agent-form .preset-menu-item {
  width: 100%;
  height: auto;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  place-items: initial;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  color: rgba(218, 225, 238, 0.82);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.single-agent-form .preset-menu button:hover,
.single-agent-form .preset-menu-item:hover,
.single-agent-form .preset-menu-item.active {
  color: rgba(236, 240, 248, 0.9);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}

.single-agent-form .preset-menu .route-dot {
  width: 7px;
  height: 7px;
}

body.light .preset-trigger {
  color: rgba(39, 50, 74, 0.78);
}

body.light .preset-menu {
  background: rgba(250, 248, 243, 0.96);
  box-shadow: 0 22px 54px -44px rgba(23, 32, 51, 0.42);
}

body.light .preset-menu-item:hover,
body.light .preset-menu-item.active {
  background: rgba(23, 32, 51, 0.04);
}

body.light .preset-menu-copy strong {
  color: rgba(39, 50, 74, 0.86);
}

body.light .preset-menu-copy small {
  color: rgba(75, 83, 101, 0.62);
}

/* Final selector quieting: aliases should read as status text, not boxed controls. */
.topbar .preset-wrap,
.preset-wrap {
  width: auto;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.preset-trigger,
.composer-preset-trigger {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.preset-trigger:hover,
.preset-trigger[aria-expanded="true"],
.composer-preset-trigger:hover,
.composer-preset-trigger[aria-expanded="true"] {
  color: rgba(242, 244, 250, 0.9);
  background: transparent;
}

.topbar .preset-trigger {
  min-width: 104px;
}

.topbar #preset-status-light {
  display: none;
}

.topbar #preset-display {
  color: color-mix(in srgb, var(--pri2) 88%, rgba(255, 255, 255, 0.18));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px color-mix(in srgb, var(--pri2) 54%, transparent),
    0 0 18px color-mix(in srgb, var(--pri2) 28%, transparent);
}

.topbar .preset-trigger svg {
  width: 11px;
  height: 11px;
  margin-left: 6px;
  color: color-mix(in srgb, var(--pri2) 62%, rgba(150, 160, 184, 0.52));
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--pri2) 35%, transparent));
}

.composer-model.preset-picker {
  min-width: 88px;
  max-width: 138px;
}

body.light .preset-trigger:hover,
body.light .preset-trigger[aria-expanded="true"],
body.light .composer-preset-trigger:hover,
body.light .composer-preset-trigger[aria-expanded="true"] {
  color: rgba(14, 26, 48, 0.88);
  background: transparent;
}

/* Accent-aware icon rail. */
.sidebar svg,
.sidebar-primary .sidebar-action svg,
.sidebar-search svg,
.sidebar-modebar button svg,
.sidebar-view-toggle svg,
.presence-message svg,
.account-chip > svg {
  color: color-mix(in srgb, var(--pri2) 76%, var(--muted) 24%);
}

.sidebar-action:disabled svg,
.sidebar-modebar button:disabled svg {
  color: color-mix(in srgb, var(--muted2) 82%, transparent);
}

.sidebar-modebar button.active svg,
.sidebar-action:hover svg,
.sidebar-search label:hover svg,
.sidebar-search label:focus-within svg,
.sidebar-view-toggle button[aria-pressed="true"] svg,
.presence-message:hover svg,
.account-chip:hover > svg {
  color: var(--pri2);
}

body.light .sidebar svg,
body.light .sidebar-primary .sidebar-action svg,
body.light .sidebar-search svg,
body.light .sidebar-modebar button svg,
body.light .sidebar-view-toggle svg,
body.light .presence-message svg,
body.light .account-chip > svg {
  color: color-mix(in srgb, var(--pri2) 70%, #27324a 30%);
}

body.sidebar-icon-mode {
  grid-template-columns: 68px minmax(0, 1fr);
}

body.sidebar-icon-mode .sidebar {
  gap: 9px;
  padding: 12px 8px;
  align-items: center;
  overflow: visible;
}

body.sidebar-icon-mode .sidebar [data-tooltip] {
  position: relative;
}

body.sidebar-icon-mode .sidebar [data-tooltip]::before,
body.sidebar-icon-mode .sidebar [data-tooltip]::after {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

body.sidebar-icon-mode .sidebar [data-tooltip]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--panel) 92%, #000 8%);
  transform: translateY(-50%) translateX(-6px) rotate(45deg);
  box-shadow: -1px 1px 0 color-mix(in srgb, var(--pri2) 28%, transparent);
}

body.sidebar-icon-mode .sidebar [data-tooltip]::after {
  content: attr(data-tooltip);
  width: max-content;
  max-width: 220px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--pri2) 20%, transparent);
  border-radius: 6px;
  color: color-mix(in srgb, var(--txt2) 86%, transparent);
  background: color-mix(in srgb, var(--panel) 92%, #000 8%);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 16px 36px -28px rgba(0, 0, 0, 0.9);
}

body.sidebar-icon-mode .sidebar [data-tooltip]:hover::before,
body.sidebar-icon-mode .sidebar [data-tooltip]:hover::after,
body.sidebar-icon-mode .sidebar [data-tooltip]:focus-visible::before,
body.sidebar-icon-mode .sidebar [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

body.sidebar-icon-mode .sidebar [data-tooltip]:hover::before,
body.sidebar-icon-mode .sidebar [data-tooltip]:focus-visible::before {
  transform: translateY(-50%) translateX(-6px) rotate(45deg);
}

body.sidebar-icon-mode .brand-row {
  width: 100%;
  justify-content: center;
  padding: 0 0 4px;
}

body.sidebar-icon-mode .brand-lockup {
  display: none;
}

body.sidebar-icon-mode #sidebar-toggle {
  width: 24px;
  height: 24px;
  margin: 0 auto;
}

body.sidebar-icon-mode #sidebar-toggle svg {
  width: 12px;
  height: 12px;
}

body.sidebar-icon-mode .sidebar-modebar {
  width: 38px;
  min-height: 0;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.sidebar-icon-mode .sidebar-modebar button {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  padding: 0;
}

body.sidebar-icon-mode .sidebar-modebar button span {
  display: none;
}

body.sidebar-icon-mode .sidebar-view-toggle {
  width: 38px;
  justify-content: center;
  margin: 0;
}

body.sidebar-icon-mode .sidebar-view-toggle #sidebar-icon-view {
  display: none;
}

body.sidebar-icon-mode .sidebar-primary {
  width: 38px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

body.sidebar-icon-mode .sidebar-primary .sidebar-action,
body.sidebar-icon-mode .new-chat {
  width: 36px;
  min-height: 36px;
  border-radius: 9px;
  padding: 0;
  justify-content: center;
}

body.sidebar-icon-mode .sidebar-primary .sidebar-action span,
body.sidebar-icon-mode .new-chat span {
  display: none;
}

body.sidebar-icon-mode .sidebar-primary .sidebar-action svg,
body.sidebar-icon-mode .new-chat svg {
  width: 16px;
  height: 16px;
}

body.sidebar-icon-mode .sidebar-search {
  width: 38px;
  margin: 0;
}

body.sidebar-icon-mode .sidebar-search label {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

body.sidebar-icon-mode .sidebar-search input {
  position: absolute;
  width: 1px;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-icon-mode .sidebar-section {
  width: 38px;
  flex: 1;
  align-items: center;
  margin: 0;
}

body.sidebar-icon-mode .section-label,
body.sidebar-icon-mode .conversation-title,
body.sidebar-icon-mode .conversation-meta,
body.sidebar-icon-mode .conversation-delete {
  display: none;
}

body.sidebar-icon-mode .conversation-list {
  width: 38px;
  align-items: center;
  gap: 4px;
  overflow-x: hidden;
}

body.sidebar-icon-mode .conversation-empty {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  padding: 0;
  color: transparent;
  background: color-mix(in srgb, var(--muted2) 42%, transparent);
}

body.sidebar-icon-mode .conversation-item {
  width: 36px;
  min-height: 34px;
  display: flex;
  justify-content: center;
  padding: 0;
}

body.sidebar-icon-mode .conversation-load {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
}

body.sidebar-icon-mode .conversation-load::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1.7px solid color-mix(in srgb, var(--pri2) 72%, var(--muted) 28%);
  border-radius: 4px;
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--pri2) 18%, transparent);
}

body.sidebar-icon-mode .conversation-item.active::before {
  left: 1px;
  top: 8px;
  bottom: 8px;
}

body.sidebar-icon-mode .online-panel {
  width: 38px;
  padding-top: 8px;
}

body.sidebar-icon-mode .online-heading {
  width: 36px;
  min-height: 28px;
  justify-content: center;
  padding: 0;
}

body.sidebar-icon-mode .online-heading strong {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  color: transparent;
  background: var(--ok);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 72%, transparent);
}

body.sidebar-icon-mode .online-list {
  justify-items: center;
  gap: 5px;
}

body.sidebar-icon-mode .presence-row {
  position: relative;
  width: 36px;
  min-height: 34px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

body.sidebar-icon-mode .presence-row > span:nth-child(2),
body.sidebar-icon-mode .presence-row.empty {
  display: none;
}

body.sidebar-icon-mode .presence-message {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  color: var(--pri2);
  background: color-mix(in srgb, var(--panel2) 84%, transparent);
}

body.sidebar-icon-mode .presence-message svg {
  width: 10px;
  height: 10px;
}

body.sidebar-icon-mode .account-chip {
  width: 38px;
  min-height: 38px;
  justify-content: center;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

body.sidebar-icon-mode .account-copy,
body.sidebar-icon-mode .account-chip > svg {
  display: none;
}

body.sidebar-icon-mode .avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 10px;
}

body.sidebar-icon-mode .avatar::after {
  width: 7px;
  height: 7px;
  right: -1px;
  bottom: -1px;
}

/* Projects picker cleanup. */
.projects-shell {
  width: min(520px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 32px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-radius: 13px;
}

.projects-shell .settings-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin: 0;
}

.projects-shell .settings-head .eyebrow {
  margin: 0 0 5px;
  color: color-mix(in srgb, var(--pri2) 70%, var(--muted) 30%);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.projects-shell .settings-head h2 {
  margin: 0;
  color: color-mix(in srgb, var(--txt2) 88%, transparent);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
}

.projects-shell .settings-head span {
  max-width: 430px;
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 12px;
  line-height: 1.35;
}

.projects-shell #projects-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.projects-picker {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
  margin: 2px 0 0;
}

.projects-picker label {
  height: 32px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line2) 58%, transparent);
  border-radius: 8px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--field) 68%, transparent);
}

.projects-picker label:focus-within,
.projects-picker label:hover {
  border-color: color-mix(in srgb, var(--pri2) 22%, transparent);
  background: color-mix(in srgb, var(--field) 82%, transparent);
}

.projects-picker input {
  height: 100%;
  color: color-mix(in srgb, var(--txt) 86%, transparent);
  font-size: 12px;
}

#projects-create {
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--pri2) 15%, transparent);
  border-radius: 8px;
  padding: 0 10px;
  color: color-mix(in srgb, var(--pri2) 78%, var(--txt) 22%);
  background: color-mix(in srgb, var(--pri2) 7%, transparent);
  font-size: 11.5px;
  font-weight: 560;
}

#projects-create:hover {
  border-color: color-mix(in srgb, var(--pri2) 25%, transparent);
  background: color-mix(in srgb, var(--pri2) 11%, transparent);
}

.projects-list {
  min-height: 0;
  gap: 2px;
  padding: 2px 0;
}

.project-row,
.projects-empty {
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 0;
  padding: 8px 2px 8px 0;
  background: transparent;
}

.projects-empty {
  display: flex;
  align-items: center;
  min-height: 58px;
}

.project-row:hover {
  background: color-mix(in srgb, var(--txt2) 2.4%, transparent);
}

.project-row div {
  gap: 2px;
}

.project-row strong {
  color: color-mix(in srgb, var(--txt2) 88%, transparent);
  font-size: 12.5px;
  font-weight: 560;
}

.project-row div span,
.projects-empty {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-size: 10.5px;
}

.project-join {
  min-width: 52px;
  min-height: 26px;
  border: 0;
  border-radius: 7px;
  padding: 0 7px;
  color: color-mix(in srgb, var(--txt) 70%, transparent);
  background: transparent;
  font-size: 11px;
  font-weight: 560;
}

.project-join:hover {
  color: color-mix(in srgb, var(--pri2) 82%, var(--txt) 18%);
  background: color-mix(in srgb, var(--pri2) 8%, transparent);
}

.project-join.joined {
  color: color-mix(in srgb, var(--ok) 72%, var(--txt) 28%);
  background: transparent;
}

.projects-shell .settings-actions {
  justify-content: end;
  padding-top: 2px;
  border-top: 0;
}

.projects-shell #projects-reload {
  min-height: 28px;
  border: 0;
  padding: 0 2px;
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  background: transparent;
  font-size: 11px;
  font-weight: 520;
}

.projects-shell #projects-reload:hover {
  color: color-mix(in srgb, var(--pri2) 72%, var(--txt) 28%);
  background: transparent;
}

/* Team room rail and operator page. */
.team-room-card {
  margin: 2px 0 4px;
  padding: 10px 0 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
}

.team-room-heading {
  min-height: 28px;
  padding: 0 4px 8px;
  cursor: pointer;
}

.team-room-heading .section-label {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.team-room-heading strong {
  min-width: 18px;
  text-align: right;
}

.team-room-roster {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 3px;
}

.team-room-roster .presence-row {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--txt) 84%, transparent);
  background: transparent;
  cursor: pointer;
}

.team-room-roster .presence-row:hover {
  background: color-mix(in srgb, var(--pri2) 7%, transparent);
}

.team-room-roster .presence-row.dormant {
  opacity: 0.62;
}

.team-room-roster .avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 11px;
}

.avatar.dormant::after {
  background: var(--warn);
  box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 54%, transparent);
}

.team-room-roster .presence-more {
  border: 1px solid color-mix(in srgb, var(--line2) 60%, transparent);
  color: color-mix(in srgb, var(--muted) 84%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.team-room-roster .presence-row.empty {
  width: auto;
  min-width: 0;
  padding: 0 2px;
  color: color-mix(in srgb, var(--muted2) 78%, transparent);
  font-size: 11px;
}

.team-room-page {
  min-height: 0;
  overflow: hidden;
  padding: clamp(14px, 2.4vw, 28px);
}

.team-room-page[hidden] {
  display: none;
}

.team-room-shell {
  width: min(980px, 100%);
  min-height: min(560px, calc(100vh - 170px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.team-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  padding-bottom: 10px;
}

.team-room-head .eyebrow {
  margin: 0 0 4px;
  color: color-mix(in srgb, var(--pri2) 74%, var(--muted) 26%);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.team-room-head h1 {
  margin: 0;
  color: color-mix(in srgb, var(--txt2) 90%, transparent);
  font-size: 18px;
  font-weight: 620;
  letter-spacing: 0;
}

.team-room-head span {
  display: block;
  max-width: 560px;
  margin-top: 2px;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.team-room-page-roster {
  position: relative;
  min-height: 340px;
}

.team-room-empty {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
}

.team-room-empty {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
  font-size: 11px;
}

.team-room-operator-orb {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.team-room-operator-orb.dragging {
  cursor: grabbing;
  z-index: 3;
}

.team-room-headshot {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--line2) 56%, transparent),
    0 0 0 7px rgba(122, 164, 255, 0.06),
    0 18px 34px -24px rgba(0, 0, 0, 0.86);
}

.team-room-operator-orb:hover .team-room-headshot,
.team-room-operator-orb.dragging .team-room-headshot {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--pri2) 52%, transparent),
    0 0 0 8px rgba(122, 164, 255, 0.09),
    0 0 24px rgba(122, 164, 255, 0.18),
    0 18px 34px -24px rgba(0, 0, 0, 0.86);
}

.team-room-operator-orb.dormant .team-room-headshot {
  opacity: 0.72;
}

body.sidebar-icon-mode .team-room-card {
  width: 38px;
  padding: 8px 0;
}

body.sidebar-icon-mode .team-room-heading {
  width: 36px;
  min-height: 24px;
  justify-content: center;
  padding: 0 0 7px;
}

body.sidebar-icon-mode .team-room-heading strong {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  color: transparent;
  background: var(--ok);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 72%, transparent);
}

body.sidebar-icon-mode .team-room-roster {
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

body.sidebar-icon-mode .team-room-roster .presence-row {
  width: 36px;
  height: 34px;
}

/* Floating bubble rail: icon mode should read like loose widgets, not a mini sidebar. */
.sidebar-modebar {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-modebar button {
  border-radius: 999px;
}

.sidebar-modebar button.active {
  background: color-mix(in srgb, var(--pri2) 10%, transparent);
  box-shadow: none;
}

body.sidebar-icon-mode {
  grid-template-columns: 58px minmax(0, 1fr);
}

body.sidebar-icon-mode .sidebar {
  width: 58px;
  gap: 8px;
  padding: 12px 8px;
  align-items: center;
  overflow: visible;
  background: transparent;
  border-right: 0;
  box-shadow: none;
}

body.sidebar-icon-mode .brand-row {
  width: 42px;
  padding: 0;
  justify-content: center;
}

body.sidebar-icon-mode #sidebar-toggle {
  display: none;
}

body.sidebar-icon-mode .sidebar-view-toggle {
  width: 38px;
  margin: 0 0 2px;
  padding: 0;
  justify-content: center;
}

body.sidebar-icon-mode .sidebar-view-toggle button {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--pri2) 15%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--pri2) 78%, var(--muted) 22%);
  background: color-mix(in srgb, var(--panel) 54%, transparent);
  box-shadow: 0 14px 30px -26px rgba(0, 0, 0, 0.9);
}

body.sidebar-icon-mode .sidebar-view-toggle button:hover,
body.sidebar-icon-mode .sidebar-view-toggle button[aria-pressed="true"] {
  color: color-mix(in srgb, var(--txt2) 88%, transparent);
  background: color-mix(in srgb, var(--pri2) 12%, transparent);
}

body.sidebar-icon-mode .sidebar-view-toggle #sidebar-icon-view {
  display: none;
}

body.sidebar-icon-mode .sidebar-modebar,
body.sidebar-icon-mode .sidebar-primary,
body.sidebar-icon-mode .sidebar-search,
body.sidebar-icon-mode .sidebar-section,
body.sidebar-icon-mode .team-room-card,
body.sidebar-icon-mode .account-chip {
  width: 42px;
}

body.sidebar-icon-mode .sidebar-modebar {
  min-height: 0;
  flex-direction: column;
  gap: 7px;
  padding: 0;
}

body.sidebar-icon-mode .sidebar-modebar button,
body.sidebar-icon-mode .sidebar-primary .sidebar-action,
body.sidebar-icon-mode .new-chat,
body.sidebar-icon-mode .sidebar-search label,
body.sidebar-icon-mode .account-chip {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--pri2) 11%, transparent);
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  color: color-mix(in srgb, var(--muted) 86%, transparent);
  background: color-mix(in srgb, var(--panel) 46%, transparent);
  box-shadow: 0 16px 34px -30px rgba(0, 0, 0, 0.86);
}

body.sidebar-icon-mode .sidebar-modebar button.active,
body.sidebar-icon-mode .sidebar-primary .sidebar-action:hover,
body.sidebar-icon-mode .new-chat:hover,
body.sidebar-icon-mode .sidebar-search label:hover,
body.sidebar-icon-mode .sidebar-search label:focus-within,
body.sidebar-icon-mode .account-chip:hover {
  color: color-mix(in srgb, var(--txt2) 90%, transparent);
  border-color: color-mix(in srgb, var(--pri2) 24%, transparent);
  background: color-mix(in srgb, var(--pri2) 10%, transparent);
}

body.sidebar-icon-mode .sidebar-modebar button span,
body.sidebar-icon-mode .sidebar-primary .sidebar-action span,
body.sidebar-icon-mode .new-chat span,
body.sidebar-icon-mode .account-copy,
body.sidebar-icon-mode .account-chip > svg {
  display: none;
}

body.sidebar-icon-mode .sidebar-modebar svg,
body.sidebar-icon-mode .sidebar-primary .sidebar-action svg,
body.sidebar-icon-mode .new-chat svg,
body.sidebar-icon-mode .sidebar-search svg,
body.sidebar-icon-mode .account-chip .avatar {
  width: 16px;
  height: 16px;
}

body.sidebar-icon-mode .sidebar-primary {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body.sidebar-icon-mode .sidebar-primary .sidebar-action:disabled {
  opacity: 0.38;
}

body.sidebar-icon-mode .team-room-card {
  margin: 4px 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
}

body.sidebar-icon-mode .team-room-heading {
  width: 38px;
  min-height: 18px;
  padding: 0;
  justify-content: center;
}

body.sidebar-icon-mode .team-room-heading .section-label {
  display: none;
}

body.sidebar-icon-mode .team-room-heading strong {
  width: 7px;
  min-width: 7px;
  height: 7px;
  border-radius: 999px;
  color: transparent;
  background: var(--ok);
  box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 72%, transparent);
}

body.sidebar-icon-mode .team-room-roster {
  width: 42px;
  max-height: 250px;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

body.sidebar-icon-mode .team-room-roster .presence-row {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 44%, transparent);
}

body.sidebar-icon-mode .team-room-roster .presence-row:hover {
  background: color-mix(in srgb, var(--pri2) 10%, transparent);
}

body.sidebar-icon-mode .team-room-roster .avatar,
body.sidebar-icon-mode .account-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 10px;
}

body.sidebar-icon-mode .team-room-roster .presence-row > span:nth-child(2),
body.sidebar-icon-mode .team-room-roster .presence-message,
body.sidebar-icon-mode .team-room-roster .presence-row.empty {
  display: none;
}

body.sidebar-icon-mode .sidebar-search {
  margin: 0;
}

body.sidebar-icon-mode .sidebar-search input {
  position: absolute;
  width: 1px;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-icon-mode .sidebar-section {
  flex: 1;
  margin: 0;
  align-items: center;
}

body.sidebar-icon-mode .conversation-list {
  width: 42px;
  align-items: center;
  gap: 6px;
  overflow-x: visible;
}

body.sidebar-icon-mode .conversation-item {
  width: 38px;
  min-height: 38px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 34%, transparent);
}

body.sidebar-icon-mode .conversation-load {
  width: 38px;
  min-height: 38px;
}

body.sidebar-icon-mode .conversation-load::before {
  border-radius: 999px;
}

body.sidebar-icon-mode .conversation-empty {
  display: none;
}

body.sidebar-icon-mode .account-chip {
  margin-top: 0;
}

body.light.sidebar-icon-mode .sidebar-view-toggle button,
body.light.sidebar-icon-mode .sidebar-modebar button,
body.light.sidebar-icon-mode .sidebar-primary .sidebar-action,
body.light.sidebar-icon-mode .new-chat,
body.light.sidebar-icon-mode .sidebar-search label,
body.light.sidebar-icon-mode .account-chip,
body.light.sidebar-icon-mode .team-room-roster .presence-row,
body.light.sidebar-icon-mode .conversation-item {
  background: color-mix(in srgb, #fff 70%, transparent);
  box-shadow: 0 12px 28px -26px rgba(23, 32, 51, 0.28);
}

/* Match the header to the floating rail: no shaded band, no frame. */
.topbar {
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

body.light .topbar {
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

/* Multi-card chat workspace built from the comms-card substrate. */
.workspace {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.floating-chat-workspace {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 24px 18px;
  overflow: hidden;
}

.floating-chat-workspace[hidden] {
  display: none;
}

.single-agent-workspace {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 16px 24px 24px;
  overflow: hidden;
}

.single-agent-workspace[hidden] {
  display: none;
}

.single-agent-shell {
  width: min(980px, 100%);
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  box-sizing: border-box;
  border: 1px solid rgba(84, 104, 135, 0.46);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(15, 22, 34, 0.97);
  box-shadow:
    inset 0 0 0 1px rgba(145, 158, 188, 0.04),
    0 22px 52px -42px rgba(0, 0, 0, 0.92);
}

.single-agent-head {
  min-height: 52px;
  border-bottom: 1px solid rgba(145, 158, 188, 0.1);
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.single-agent-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.single-agent-head strong {
  color: rgba(232, 236, 246, 0.86);
  font-size: 10.5px;
}

.single-agent-actions {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.single-agent-actions .icon-button {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--pri2) 76%, rgba(232, 236, 246, 0.84));
  background: color-mix(in srgb, var(--pri2) 9%, rgba(255, 255, 255, 0.03));
}

.single-agent-actions .single-session-reset {
  color: rgba(246, 154, 144, 0.9);
  border-color: rgba(246, 154, 144, 0.22);
  background: rgba(246, 154, 144, 0.07);
}

.single-agent-actions .single-session-reset:hover {
  border-color: rgba(246, 154, 144, 0.48);
  background: rgba(246, 154, 144, 0.13);
}

.single-route-status {
  max-width: 132px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-agent-messages {
  padding: 24px clamp(18px, 5vw, 56px) 18px;
}

.single-agent-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  border-top: 1px solid rgba(145, 158, 188, 0.1);
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) minmax(108px, auto) 34px 38px;
  align-items: end;
  gap: 8px;
  padding: 10px 14px 14px;
  background: rgba(2, 6, 12, 0.46);
}

.single-agent-form .attachment-tray {
  grid-column: 1 / -1;
  order: -1;
}

.single-agent-form #prompt {
  min-height: 38px;
  max-height: 150px;
  border: 1px solid rgba(145, 158, 188, 0.16);
  border-radius: 12px;
  padding: 8px 10px;
  color: rgba(232, 236, 246, 0.9);
  background: rgba(2, 6, 12, 0.56);
}

.single-agent-form .composer-model {
  min-width: 108px;
}

.single-agent-form .composer-preset-trigger {
  width: 100%;
  max-width: 138px;
  height: 34px;
}

.single-agent-form .composer-tools-trigger,
.single-agent-form .composer-mic,
.single-agent-form .composer-agent,
.single-agent-form #send {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 10px;
}

.single-agent-form #send {
  width: 38px;
  min-width: 38px;
}

.single-agent-form .composer-tools-menu {
  width: min(320px, calc(100vw - 44px));
}

.single-agent-form .composer-tools-menu button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  width: 100%;
  box-sizing: border-box;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
}

.single-agent-form .composer-tools-menu button svg {
  grid-column: 1;
  grid-row: 1 / span 2;
  justify-self: center;
}

.single-agent-form .composer-tools-menu button span {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  justify-self: start;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-agent-form .composer-tools-menu button small {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  justify-self: start;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-agent-form.streaming #send {
  color: rgba(246, 154, 144, 0.95);
  border-color: rgba(246, 154, 144, 0.38);
  background: rgba(246, 154, 144, 0.1);
}

.single-agent-form.streaming #send:hover {
  border-color: rgba(246, 154, 144, 0.62);
  background: rgba(246, 154, 144, 0.16);
}

body.light .single-agent-shell {
  border-color: rgba(84, 104, 135, 0.58);
  background: rgba(15, 22, 34, 0.97);
}

body.light .single-agent-head,
body.light .single-agent-form {
  border-color: rgba(145, 158, 188, 0.1);
}

body.light .single-agent-head strong {
  color: rgba(232, 236, 246, 0.86);
}

body.light .single-agent-form #prompt {
  color: rgba(220, 226, 238, 0.86);
  border-color: rgba(145, 158, 188, 0.18);
  background: rgba(2, 6, 12, 0.5);
}

.topbar .preset-wrap {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar .preset-trigger,
.single-agent-form .composer-preset-trigger {
  width: auto;
  min-width: 0;
  max-width: none;
  height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: color-mix(in srgb, var(--pri2) 86%, rgba(232, 236, 246, 0.14));
  background: transparent;
  box-shadow: none;
}

.single-agent-form .composer-model {
  min-width: 0;
  max-width: max-content;
  justify-self: end;
}

.single-agent-form .composer-preset-trigger:hover,
.single-agent-form .composer-preset-trigger[aria-expanded="true"],
body.light .topbar .preset-trigger,
body.light .topbar .preset-trigger:hover,
body.light .topbar .preset-trigger[aria-expanded="true"],
body.light .single-agent-form .composer-preset-trigger,
body.light .single-agent-form .composer-preset-trigger:hover,
body.light .single-agent-form .composer-preset-trigger[aria-expanded="true"] {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.light .single-agent-shell .message-role {
  color: rgba(205, 161, 85, 0.78);
}

body.light .single-agent-shell .message.assistant:not(.intro) .message-body,
body.light .single-agent-shell .message.intro .message-body {
  color: rgba(220, 226, 238, 0.84);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.light .single-agent-shell .message.user .message-body {
  color: rgba(226, 232, 243, 0.88);
  border-color: rgba(122, 164, 255, 0.1);
  background: rgba(70, 94, 145, 0.18);
}

.floating-chat-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(150, 160, 184, 0.58);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floating-chat-bar > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.floating-chat-bar strong {
  color: rgba(232, 236, 246, 0.86);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.floating-chat-kicker {
  color: color-mix(in srgb, var(--pri2) 70%, rgba(150, 160, 184, 0.6));
}

.chat-launcher {
  flex: none;
  display: inline-flex;
  gap: 8px;
}

.chat-launcher button,
.chat-card-config button {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--pri2) 28%, rgba(145, 158, 188, 0.12));
  border-radius: 999px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: color-mix(in srgb, var(--pri2) 76%, rgba(232, 236, 246, 0.84));
  background: color-mix(in srgb, var(--pri2) 9%, rgba(255, 255, 255, 0.03));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-launcher button svg,
.chat-card-config button svg,
.agent-head-actions .icon-button svg,
.chat-card-actions .icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-card-config {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-card-mode-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-card-mode-switch button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(145, 158, 188, 0.16);
  border-radius: 999px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: rgba(150, 160, 184, 0.68);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.chat-card-mode-switch button.active {
  border-color: color-mix(in srgb, var(--warn) 48%, rgba(145, 158, 188, 0.12));
  color: color-mix(in srgb, var(--warn) 84%, #ffffff 8%);
  background: color-mix(in srgb, var(--warn) 9%, rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 15px -8px color-mix(in srgb, var(--warn) 74%, transparent);
}

.chat-card-mode-switch svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-card-clear {
  border-color: rgba(246, 170, 164, 0.22);
  color: rgba(246, 170, 164, 0.82);
  background: rgba(246, 170, 164, 0.035);
}

.chat-card-clear:hover {
  border-color: rgba(246, 170, 164, 0.46);
  color: rgba(255, 210, 204, 0.96);
  background: rgba(246, 170, 164, 0.09);
  box-shadow: 0 0 16px -9px rgba(246, 170, 164, 0.8);
}

.chat-card-config button {
  width: 28px;
  height: 28px;
}

.chat-card-grid {
  min-height: 0;
  position: relative;
  display: block;
  padding: 0 2px 4px;
  overflow: hidden;
}

.floating-chat-card {
  position: absolute;
  width: 620px;
  height: 342px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px -50px rgba(0, 0, 0, 0.86);
}

.floating-chat-card > .chat-comms-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(84, 104, 135, 0.42);
  border-radius: 8px;
  background: rgba(15, 22, 34, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(145, 158, 188, 0.04),
    0 22px 52px -42px rgba(0, 0, 0, 0.92);
}

.floating-chat-card[hidden] {
  display: none;
}

.floating-chat-card.dragging {
  opacity: 0.55;
  outline: 1px solid var(--pri-line);
  z-index: 4;
}

.floating-chat-card.resizing {
  outline: 1px solid color-mix(in srgb, var(--pri2) 58%, transparent);
}

.chat-card-primary {
  flex-basis: 620px;
  width: 620px;
  height: 342px;
  min-height: 0;
}

.chat-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: grab;
}

.chat-card-head:active {
  cursor: grabbing;
}

.chat-comms-body {
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.chat-comms-body .voice-comms-card-head {
  min-height: 82px;
  padding: 0 28px;
}

.chat-comms-body .voice-comms-card-head span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  color: rgba(245, 247, 252, 0.92);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: 0.2em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-comms-body .voice-comms-card-head span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 18px color-mix(in srgb, var(--ok) 58%, transparent);
}

.chat-comms-body .voice-comms-card-head em {
  min-height: 30px;
  border-color: color-mix(in srgb, var(--warn) 54%, rgba(145, 158, 188, 0.12));
  padding: 0 13px;
  color: color-mix(in srgb, var(--warn) 82%, #ffffff 10%);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.agent-head-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.agent-head-actions .icon-button,
.chat-card-actions .icon-button {
  width: 30px;
  height: 30px;
  flex: none;
}

.chat-card-close {
  color: rgba(246, 170, 164, 0.86);
}

.human-thread-toggle.active {
  color: color-mix(in srgb, var(--warn) 84%, #ffffff 8%);
  border-color: color-mix(in srgb, var(--warn) 48%, rgba(145, 158, 188, 0.12));
  background: color-mix(in srgb, var(--warn) 9%, transparent);
}

.chat-route-channel,
.chat-human-channel {
  min-height: 0;
}

.agent-channel-card {
  height: 100%;
  border-color: rgba(84, 104, 135, 0.58);
  border-radius: 8px;
  background: rgba(15, 22, 34, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(145, 158, 188, 0.08),
    0 0 0 1px rgba(84, 104, 135, 0.34);
}

.chat-human-channel {
  display: flex;
  flex-direction: column;
}

.floating-chat-card.human-thread-expanded .chat-human-channel {
  height: 100%;
}

.floating-chat-card.human-thread-expanded .voice-human-thread {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
}

.floating-chat-card.human-thread-expanded .voice-human-thread article {
  max-width: 100%;
}

.chat-route-row {
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 26px 18px;
}

.voice-agent-row .chat-window-avatar {
  width: 112px;
  height: 112px;
}

.voice-agent-avatar-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.agent-state-chip {
  min-height: 24px;
  border: 1px solid rgba(145, 158, 188, 0.36);
  border-radius: 4px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(150, 160, 184, 0.82);
  background: rgba(255, 255, 255, 0.035);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.agent-state-chip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.chat-window-avatar strong {
  position: absolute;
  inset: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--pri2) 42%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--pri2) 84%, rgba(232, 236, 246, 0.88));
  background: color-mix(in srgb, var(--pri2) 11%, rgba(255, 255, 255, 0.03));
  font-size: 10px;
  font-weight: 760;
}

.chat-window-avatar .voice-avatar {
  position: absolute;
  inset: 5px;
  z-index: 1;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border: 1px solid color-mix(in srgb, var(--pri2) 34%, transparent);
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
}

.chat-window-avatar i {
  z-index: 2;
}

.chat-card-wave {
  height: 14px;
  gap: 3px;
  margin: 1px 0 2px;
  opacity: 0.48;
}

.chat-card-wave span {
  width: 3px;
  height: 11px;
  animation: none !important;
  transform: scaleY(0.34);
}

.chat-route-channel .voice-agent-meta {
  color: color-mix(in srgb, var(--warn) 84%, #ffffff 8%);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.chat-route-channel .chat-window-status,
.chat-card-primary .messages {
  min-height: 96px;
  border: 1px solid rgba(5, 10, 18, 0.94);
  border-radius: 4px;
  padding: 18px 22px;
  color: rgba(144, 153, 170, 0.78);
  background: rgba(2, 6, 12, 0.88);
  font-size: 15px;
  font-style: italic;
  line-height: 1.45;
}

.chat-card-primary .messages {
  max-height: 96px;
  overflow: auto;
  font-style: normal;
}

.agent-channel-card .voice-agent-title strong {
  font-size: 28px;
  letter-spacing: 0;
}

.agent-channel-card .voice-agent-title small {
  font-size: 13px;
  color: rgba(150, 160, 184, 0.68);
}

.agent-channel-card .agent-voice-line {
  color: color-mix(in srgb, var(--warn) 88%, #ffffff 6%);
}

.agent-dialogue-well {
  width: 100%;
}

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

.agent-card-chat-thread.voice-human-thread {
  min-height: 76px;
  max-height: 76px;
  border: 1px solid rgba(5, 10, 18, 0.94);
  border-radius: 4px 4px 0 0;
  padding: 8px 9px;
  background: rgba(2, 6, 12, 0.82);
}

.agent-card-chat-compose.voice-human-compose {
  margin: 0;
  border: 1px solid rgba(5, 10, 18, 0.94);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  padding: 6px;
  background: rgba(2, 6, 12, 0.72);
}

.agent-card-chat-compose input {
  height: 26px;
  font-size: 11px;
}

.agent-card-chat-compose button {
  width: 30px;
  height: 26px;
}

.agent-transcript-block {
  width: 100%;
  min-height: 34px;
  margin-top: 7px;
  border: 1px solid rgba(145, 158, 188, 0.12);
  border-radius: 4px;
  padding: 6px 9px;
  display: grid;
  gap: 3px;
  background: rgba(2, 6, 12, 0.46);
}

.agent-transcript-block span {
  color: color-mix(in srgb, var(--warn) 74%, rgba(202, 209, 225, 0.5));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.agent-transcript-block p {
  margin: 0;
  color: rgba(202, 209, 225, 0.72);
  font-size: 10px;
  line-height: 1.35;
}

.agent-transcript-block.is-status p {
  color: color-mix(in srgb, var(--warn) 78%, rgba(232, 236, 246, 0.82));
  font-style: italic;
}

.chat-card-talkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: auto 26px 22px 144px;
}

.human-voice-row {
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(145, 158, 188, 0.08);
}

.human-voice-row .chat-card-wave {
  min-width: 52px;
  max-width: 62px;
  overflow: hidden;
}

.agent-control-row {
  margin: 0;
  padding-top: 8px;
}

.agent-control-row .chat-card-wave {
  min-width: 52px;
  max-width: 62px;
  overflow: hidden;
}

.chat-card-talkbar button {
  min-width: 238px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--warn) 58%, rgba(145, 158, 188, 0.12));
  border-radius: 999px;
  color: color-mix(in srgb, var(--warn) 82%, #ffffff 10%);
  background: color-mix(in srgb, var(--warn) 10%, rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px -12px color-mix(in srgb, var(--warn) 70%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.agent-hidden-composer {
  display: none;
}

/* Tight floating-card pass: keep these windows compact enough to tile. */
.floating-chat-card,
.chat-card-primary {
  width: 380px;
  height: 236px;
  flex-basis: 380px;
}

.chat-comms-body .voice-comms-card-head {
  min-height: 46px;
  padding: 0 12px;
}

.chat-comms-body .voice-comms-card-head span {
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.chat-comms-body .voice-comms-card-head span::before {
  width: 7px;
  height: 7px;
}

.chat-comms-body .voice-comms-card-head em {
  min-height: 24px;
  padding: 0 8px;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.agent-head-actions {
  gap: 5px;
}

.agent-head-actions .icon-button,
.chat-card-actions .icon-button,
.agent-head-config button {
  width: 24px;
  height: 24px;
}

.agent-head-config {
  flex: none;
  display: inline-flex;
}

.agent-channel-card .route-status {
  display: none;
}

.voice-agent-main > .chat-card-config {
  display: none;
}

.chat-route-row {
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px 10px;
}

.voice-agent-row .chat-window-avatar {
  width: 58px;
  height: 58px;
}

.voice-agent-avatar-stack {
  gap: 5px;
}

.agent-state-chip {
  min-height: 17px;
  padding: 0 6px;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.agent-state-chip i {
  width: 6px;
  height: 6px;
}

.chat-route-channel .chat-window-status,
.chat-card-primary .messages {
  min-height: 46px;
  max-height: 46px;
  padding: 9px 10px;
  font-size: 10px;
}

.agent-channel-card .voice-agent-title strong {
  font-size: 16px;
}

.agent-channel-card .voice-agent-title small {
  font-size: 8px;
}

.agent-control-row {
  padding-top: 2px;
}

.agent-control-row .chat-card-wave {
  min-width: 52px;
  max-width: 62px;
  overflow: hidden;
}

.chat-card-talkbar {
  gap: 10px;
}

.chat-card-talkbar button {
  min-width: 116px;
  height: 32px;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.chat-card-talkbar button::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 999px;
  vertical-align: -2px;
  background: color-mix(in srgb, var(--warn) 88%, #ffffff 12%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--warn) 78%, transparent);
}

.chat-window-status {
  margin: 0;
  color: rgba(202, 209, 225, 0.72);
  font-size: 12px;
  line-height: 1.38;
}

.chat-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid color-mix(in srgb, var(--pri2) 24%, rgba(145, 158, 188, 0.1));
  border-radius: 999px;
  padding: 0 8px;
  color: color-mix(in srgb, var(--pri2) 72%, rgba(232, 236, 246, 0.78));
  background: color-mix(in srgb, var(--pri2) 8%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.chat-identity,
.chat-card-actions,
.chat-card-meta,
.mini-composer {
  display: flex;
  align-items: center;
}

.chat-identity {
  min-width: 0;
  gap: 10px;
}

.chat-identity div {
  min-width: 0;
}

.chat-identity strong {
  display: block;
  overflow: hidden;
  color: rgba(245, 247, 252, 0.9);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-identity small {
  display: block;
  overflow: hidden;
  color: rgba(150, 160, 184, 0.58);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--pri2) 44%, rgba(145, 158, 188, 0.16));
  border-radius: 8px;
  color: color-mix(in srgb, var(--pri2) 76%, rgba(232, 236, 246, 0.8));
  background: color-mix(in srgb, var(--pri2) 12%, transparent);
  font-size: 10px;
  font-weight: 760;
}

.chat-avatar.human {
  color: rgba(194, 211, 255, 0.92);
  background: rgba(122, 164, 255, 0.1);
  border-color: rgba(122, 164, 255, 0.3);
}

.chat-card-actions {
  gap: 8px;
  flex: none;
}

.chat-card-primary .route-status {
  max-width: 180px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--pri2) 26%, rgba(145, 158, 188, 0.1));
  border-radius: 999px;
  padding: 0 8px;
  color: color-mix(in srgb, var(--pri2) 72%, rgba(232, 236, 246, 0.78));
  background: color-mix(in srgb, var(--pri2) 8%, transparent);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-card-meta {
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 0;
  color: color-mix(in srgb, var(--pri2) 68%, rgba(150, 160, 184, 0.72));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-route-select {
  min-width: 94px;
  max-width: 126px;
  border: 1px solid rgba(145, 158, 188, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
  color: rgba(232, 236, 246, 0.76);
  background: rgba(255, 255, 255, 0.035);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agent-channel-card .chat-route-select {
  display: none;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(150, 160, 184, 0.72);
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 48%, transparent);
}

.status-dot.live::before {
  background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 48%, transparent);
}

.status-dot.dormant::before {
  background: rgba(150, 160, 184, 0.5);
  box-shadow: none;
}

.mini-transcript.voice-human-thread {
  min-height: 98px;
  overflow: auto;
  padding: 12px;
}

.mini-transcript p {
  margin: 0;
  color: rgba(202, 209, 225, 0.72);
  font-size: 12.5px;
  line-height: 1.42;
}

.mini-transcript b {
  color: rgba(232, 236, 246, 0.84);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 580;
  letter-spacing: 0.08em;
}

.chat-card-foot {
  gap: 8px;
  margin-top: auto;
  padding: 9px 12px;
  border-top: 1px solid rgba(145, 158, 188, 0.08);
  color: rgba(150, 160, 184, 0.54);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-card-foot span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-card-primary .message {
  max-width: none;
  margin-bottom: 18px;
}

.chat-card-primary .message-body,
.chat-card-primary .message.assistant:not(.intro) .message-body,
.chat-card-primary .message.intro .message-body {
  max-width: none;
}

.chat-card-primary .chat-window-form,
.chat-card-primary .route-status {
  max-width: none;
}

.chat-card-primary .preset-native {
  display: none;
}

.chat-card-primary .composer-preset-trigger {
  max-width: 118px;
}

.chat-card-orb {
  position: fixed;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--ok) 42%, transparent);
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--pri2) 80%, rgba(232, 236, 246, 0.84));
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.68) 0 10%, transparent 23%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--ok) 86%, #ffffff 8%) 0 36%, color-mix(in srgb, var(--ok) 46%, var(--panel) 54%) 62%, color-mix(in srgb, var(--ok) 18%, var(--panel) 82%) 100%);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--ok) 10%, transparent),
    0 0 28px 2px color-mix(in srgb, var(--ok) 68%, transparent),
    0 16px 34px -24px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  font-size: 10px;
  font-weight: 760;
  cursor: grab;
  touch-action: none;
}

.chat-card-orb.dragging {
  cursor: grabbing;
  transform: scale(1.04);
}

.chat-card-orb span {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 58%);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--ok) 40%, transparent);
}

.chat-card-orb.warm {
  border-color: color-mix(in srgb, var(--warn) 48%, transparent);
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.6) 0 10%, transparent 23%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--warn) 88%, #ffffff 7%) 0 36%, color-mix(in srgb, var(--warn) 48%, var(--panel) 52%) 62%, color-mix(in srgb, var(--warn) 20%, var(--panel) 80%) 100%);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--warn) 10%, transparent),
    0 0 27px 2px color-mix(in srgb, var(--warn) 64%, transparent),
    0 16px 34px -24px rgba(0, 0, 0, 0.9);
}

.chat-card-orb.warm span {
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--warn) 40%, transparent);
}

.chat-card-orb.stale {
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.54) 0 10%, transparent 23%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--danger) 88%, #ffffff 6%) 0 36%, color-mix(in srgb, var(--danger) 48%, var(--panel) 52%) 62%, color-mix(in srgb, var(--danger) 20%, var(--panel) 80%) 100%);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--danger) 10%, transparent),
    0 0 24px 1px color-mix(in srgb, var(--danger) 62%, transparent),
    0 16px 34px -24px rgba(0, 0, 0, 0.9);
}

.chat-card-orb.stale span {
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--danger) 40%, transparent);
}

.chat-card-orb.human {
  color: rgba(194, 211, 255, 0.92);
  border-color: rgba(122, 164, 255, 0.52);
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.62) 0 10%, transparent 23%),
    radial-gradient(circle at 50% 56%, rgba(122, 164, 255, 0.9) 0 36%, rgba(66, 108, 220, 0.54) 62%, rgba(38, 56, 96, 0.86) 100%);
  box-shadow:
    0 0 0 5px rgba(122, 164, 255, 0.1),
    0 0 28px 2px rgba(122, 164, 255, 0.62),
    0 16px 34px -24px rgba(0, 0, 0, 0.9);
}

.chat-orb-dock {
  position: fixed;
  z-index: 31;
  inset: 0;
  pointer-events: none;
}

.chat-orb-dock[hidden] {
  display: none;
}

.chat-card-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  border-radius: 6px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(150, 160, 184, 0.36) 49% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 64%, rgba(150, 160, 184, 0.24) 65% 70%, transparent 71%);
  opacity: 0.58;
}

.chat-card-resize:hover {
  opacity: 1;
}

body.light .floating-chat-bar strong,
body.light .chat-identity strong,
body.light .mini-transcript b {
  color: rgba(39, 50, 74, 0.84);
}

body.light .chat-identity small,
body.light .mini-transcript p,
body.light .chat-card-foot,
body.light .chat-route-select {
  color: rgba(75, 83, 101, 0.68);
}

body.light .floating-chat-card > .chat-comms-shell,
body.light .floating-chat-card .voice-comms-card,
body.light .floating-chat-card .agent-channel-card,
body.light .floating-chat-card .chat-human-channel {
  border-color: rgba(84, 104, 135, 0.58);
  background: rgba(15, 22, 34, 0.97);
}

body.light .floating-chat-card .voice-comms-card-head,
body.light .floating-chat-card .voice-operator-strip,
body.light .floating-chat-card .voice-human-compose {
  border-color: rgba(145, 158, 188, 0.1);
}

body.light .floating-chat-card .voice-comms-card-head span,
body.light .floating-chat-card .voice-agent-title strong,
body.light .floating-chat-card .voice-human-thread b,
body.light .floating-chat-card .chat-identity strong,
body.light .floating-chat-card .mini-transcript b {
  color: rgba(232, 236, 246, 0.86);
}

body.light .floating-chat-card .voice-agent-main #voice-status,
body.light .floating-chat-card .voice-human-thread p,
body.light .floating-chat-card .chat-identity small,
body.light .floating-chat-card .mini-transcript p,
body.light .floating-chat-card .chat-card-foot,
body.light .floating-chat-card .chat-route-select {
  color: rgba(202, 209, 225, 0.74);
}

body.light .floating-chat-card .voice-human-thread p {
  background: transparent;
}

body.light .floating-chat-card .agent-card-chat-thread.voice-human-thread,
body.light .floating-chat-card .agent-card-chat-compose.voice-human-compose {
  border-color: rgba(5, 10, 18, 0.94);
  background: rgba(2, 6, 12, 0.78);
}

body.light .floating-chat-card .voice-human-compose input {
  color: rgba(220, 226, 238, 0.78);
  border-color: rgba(145, 158, 188, 0.18);
  background: rgba(2, 6, 12, 0.44);
}

body.light .floating-chat-card .voice-human-compose input::placeholder {
  color: rgba(202, 209, 225, 0.48);
}

@media (max-width: 1120px) {
  .chat-card-grid {
    align-content: start;
  }
}

@media (max-width: 760px) {
  body.sidebar-collapsed .main-sidebar-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    display: inline-flex !important;
    visibility: visible;
  }

  body.sidebar-collapsed,
  body.sidebar-collapsed.sidebar-icon-mode {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .workspace,
  body.sidebar-collapsed.sidebar-icon-mode .workspace {
    grid-column: 1;
    width: 100vw;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  .floating-chat-workspace {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 12px 14px 14px;
  }

  .single-agent-workspace {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 12px 14px 14px;
  }

  .single-agent-shell {
    width: 100%;
  }

  .single-agent-head {
    min-height: 46px;
    padding: 0 10px 0 12px;
  }

  .single-agent-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .single-agent-messages {
    padding: 16px 12px 12px;
  }

  .single-agent-form {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    padding: 10px;
  }

  .single-agent-form .composer-mic,
  .single-agent-form .composer-agent {
    display: none;
  }

  .single-agent-form .composer-model {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }

  .single-agent-form .composer-preset-trigger {
    max-width: none;
  }

  .single-agent-form .composer-tools {
    grid-column: 1;
    grid-row: 2;
  }

  .single-agent-form #prompt {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .single-agent-form #send {
    grid-column: 3;
    grid-row: 2;
  }

  .floating-chat-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-card-grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow: auto;
  }

  .floating-chat-card,
  .chat-card-primary {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: min(100%, calc(100vw - 28px)) !important;
    min-width: 0;
    flex-basis: auto !important;
  }

  .floating-chat-card > .chat-comms-shell {
    min-width: 0;
  }

  .chat-card-primary {
    height: 500px;
  }
}

/* v40: translucent sidebar column and ordered icon rail groups. */
.sidebar {
  background: rgba(14, 22, 36, 0.68);
  border-right: 1px solid rgba(122, 164, 255, 0.08);
  box-shadow: 20px 0 52px -44px rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(18px);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 12px 8px;
  z-index: -1;
  border-radius: 16px;
  border: 1px solid rgba(122, 164, 255, 0.06);
  pointer-events: none;
}

body.light .sidebar {
  background: rgba(246, 248, 252, 0.72);
  border-right-color: rgba(23, 32, 51, 0.08);
  box-shadow: 20px 0 52px -44px rgba(23, 32, 51, 0.3);
}

#cowork-trigger svg {
  stroke-width: 1.8;
}

body.sidebar-icon-mode .sidebar {
  display: flex;
  flex-direction: column;
  padding: 12px 7px;
  background: transparent;
  backdrop-filter: none;
}

body.sidebar-icon-mode .sidebar::after {
  display: none;
}

body.sidebar-icon-mode .brand-row {
  order: 0;
}

body.sidebar-icon-mode .sidebar-modebar {
  order: 10;
  margin-top: 2px;
}

body.sidebar-icon-mode .sidebar-view-toggle {
  order: 20;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 42%, transparent);
}

body.sidebar-icon-mode .team-room-card {
  order: 30;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 42%, transparent);
}

body.sidebar-icon-mode .sidebar-primary {
  order: 40;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 42%, transparent);
}

body.sidebar-icon-mode .sidebar-search {
  order: 50;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 42%, transparent);
}

body.sidebar-icon-mode .sidebar-section {
  order: 60;
}

body.sidebar-icon-mode .account-chip {
  order: 90;
  margin-top: auto;
}

/* v41: compact PTT controls for agent voice cards. */
.chat-card-talkbar.agent-ptt-row {
  align-items: center;
  gap: 12px;
}

.agent-ptt-controls {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-card-talkbar .agent-ptt-mode,
.chat-card-talkbar .agent-ptt-button,
.chat-card-talkbar .agent-ptt-mute {
  min-width: 0;
  border-radius: 999px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.chat-card-talkbar .agent-ptt-mode::before,
.chat-card-talkbar .agent-ptt-button::before,
.chat-card-talkbar .agent-ptt-mute::before {
  display: none;
}

.chat-card-talkbar .agent-ptt-mode {
  width: 42px;
  height: 24px;
  border: 1px solid rgba(145, 158, 188, 0.18);
  color: rgba(202, 209, 225, 0.66);
  background: rgba(255, 255, 255, 0.025);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.chat-card-talkbar .agent-ptt-button {
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--warn) 62%, rgba(145, 158, 188, 0.12));
  color: color-mix(in srgb, var(--warn) 86%, #ffffff 10%);
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.24) 0 9%, transparent 24%),
    color-mix(in srgb, var(--warn) 10%, rgba(255, 255, 255, 0.02));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--warn) 8%, transparent),
    0 0 22px -10px color-mix(in srgb, var(--warn) 74%, transparent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.chat-card-talkbar .agent-ptt-mute {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(145, 158, 188, 0.15);
  color: rgba(202, 209, 225, 0.62);
  background: rgba(255, 255, 255, 0.025);
}

.chat-card-talkbar .agent-ptt-mute svg {
  width: 14px;
  height: 14px;
}

.agent-ptt-active .agent-ptt-button {
  color: rgba(255, 244, 214, 0.98);
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.42) 0 10%, transparent 25%),
    color-mix(in srgb, var(--warn) 28%, rgba(255, 255, 255, 0.02));
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--warn) 13%, transparent),
    0 0 30px -6px color-mix(in srgb, var(--warn) 82%, transparent);
}

.agent-capture-active .chat-card-wave {
  opacity: 1;
}

.agent-capture-active .chat-card-wave span {
  animation: voice-wave 0.72s ease-in-out infinite !important;
}

.agent-ptt-muted .agent-ptt-button {
  opacity: 0.45;
  cursor: not-allowed;
}

.agent-ptt-muted .agent-ptt-mute {
  border-color: color-mix(in srgb, var(--danger) 42%, rgba(145, 158, 188, 0.12));
  color: color-mix(in srgb, var(--danger) 72%, #ffffff 8%);
  background: color-mix(in srgb, var(--danger) 10%, rgba(255, 255, 255, 0.02));
}

.agent-ptt-active .agent-state-chip i {
  background: var(--warn);
  box-shadow: 0 0 9px color-mix(in srgb, var(--warn) 58%, transparent);
}

.agent-ptt-muted .agent-state-chip i {
  background: var(--danger);
  box-shadow: 0 0 9px color-mix(in srgb, var(--danger) 58%, transparent);
}

/* TEAMS Capital login boundary. Authentication mechanics remain unchanged. */
.auth-screen {
  isolation: isolate;
  overflow: hidden;
  padding: 32px 20px;
  background: #0c1220;
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
}

.auth-screen::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(12, 18, 32, 0.76);
}

.auth-teams-only {
  display: none;
}

html[data-brand-theme="teams-capital"] .auth-teams-only {
  display: block;
}

.auth-matrix {
  position: absolute;
  inset: -16vh 0;
  z-index: -2;
  overflow: hidden;
  color: #c9a24a;
  opacity: 0.13;
  pointer-events: none;
}

.auth-matrix span {
  position: absolute;
  top: -32vh;
  height: 148vh;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-orientation: upright;
  writing-mode: vertical-rl;
  animation: auth-matrix-fall 18s linear infinite;
}

.auth-matrix span:nth-child(1) { left: 3%; animation-delay: -2s; }
.auth-matrix span:nth-child(2) { left: 11%; animation-delay: -13s; animation-duration: 22s; }
.auth-matrix span:nth-child(3) { left: 20%; animation-delay: -7s; animation-duration: 16s; }
.auth-matrix span:nth-child(4) { left: 29%; animation-delay: -17s; animation-duration: 24s; }
.auth-matrix span:nth-child(5) { left: 38%; animation-delay: -4s; animation-duration: 20s; }
.auth-matrix span:nth-child(6) { left: 47%; animation-delay: -10s; animation-duration: 17s; }
.auth-matrix span:nth-child(7) { left: 56%; animation-delay: -19s; animation-duration: 25s; }
.auth-matrix span:nth-child(8) { left: 65%; animation-delay: -6s; animation-duration: 19s; }
.auth-matrix span:nth-child(9) { left: 74%; animation-delay: -15s; animation-duration: 23s; }
.auth-matrix span:nth-child(10) { left: 83%; animation-delay: -1s; animation-duration: 18s; }
.auth-matrix span:nth-child(11) { left: 91%; animation-delay: -11s; animation-duration: 21s; }
.auth-matrix span:nth-child(12) { left: 97%; animation-delay: -8s; animation-duration: 26s; }

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(380px, calc(100vw - 40px));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-brand-lockup {
  display: grid;
  min-height: 76px;
  place-items: center;
}

.auth-brand-logo {
  display: block;
  width: min(290px, 78vw);
  height: auto;
  max-height: 82px;
  object-fit: contain;
}

.auth-brand-logo[hidden],
.auth-brand-fallback[hidden] {
  display: none;
}

.auth-brand-fallback {
  color: #eef1f6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0;
}

.auth-eye-shell {
  width: 92px;
  height: 92px;
  margin: 20px auto 16px;
}

.auth-iris-eye {
  display: block;
  width: 92px;
  height: 92px;
}

.auth-iris-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: auth-iris-breathe 3s ease-in-out infinite;
}

.auth-iris-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: auth-iris-core 3s ease-in-out infinite;
}

.auth-iris-hot {
  animation: auth-iris-hot 2s ease-in-out infinite;
}

.auth-card.simple-login {
  padding: 20px 28px 4px;
  text-align: center;
  background: transparent;
}

.auth-card.simple-login h3 {
  color: #eef1f6;
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.auth-card.simple-login p:not(.eyebrow) {
  max-width: 320px;
  margin: 8px auto 0;
  color: #aeb5c4;
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  margin-top: 22px;
}

.auth-card.simple-login .signin-button {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(201, 162, 74, 0.72);
  border-radius: 6px;
  color: #0c1220;
  background: #c9a24a;
  box-shadow: none;
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.auth-card.simple-login .signin-button:hover {
  border-color: #e1c77f;
  color: #0c1220;
  background: #d6b568;
}

.auth-card.simple-login .signin-button:focus-visible {
  outline: 2px solid #eef1f6;
  outline-offset: 3px;
}

.auth-error {
  padding: 9px 10px;
  border-left: 2px solid #b75a50;
  color: #f0c8c2 !important;
  text-align: left;
  background: rgba(157, 66, 56, 0.12);
}

.auth-license {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  color: #8d94a5;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1.45;
}

.auth-license[hidden] {
  display: none;
}

.auth-license p {
  margin: 0;
}

/* Post-auth onboarding is deliberately separate from the login-only IRIS field. */
.onboarding-screen {
  position: fixed;
  z-index: 55;
  inset: 0;
  min-height: 100svh;
  overflow: auto;
  place-items: center;
  padding: 48px 20px;
  color: #0c1220;
  background: #eef1f6;
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
}

.onboarding-screen[hidden] {
  display: none;
}

.onboarding-shell {
  width: min(520px, calc(100vw - 40px));
}

.onboarding-brand {
  display: grid;
  min-height: 58px;
  margin-bottom: 34px;
  place-items: center;
}

.onboarding-brand-logo {
  display: block;
  width: min(270px, 72vw);
  max-height: 64px;
  padding: 9px 14px;
  border-radius: 6px;
  background: #0c1220;
  object-fit: contain;
}

.onboarding-brand-logo[hidden],
.onboarding-brand-fallback[hidden] {
  display: none;
}

.onboarding-brand-fallback {
  color: #0c1220;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
  letter-spacing: 0;
}

.onboarding-card {
  position: relative;
  padding: 34px 36px 30px;
  border: 1px solid rgba(12, 18, 32, 0.14);
  border-radius: 12px;
  background: #f8f9fb;
  box-shadow: 0 22px 56px -42px rgba(12, 18, 32, 0.38);
}

.onboarding-progress {
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 2px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: rgba(12, 18, 32, 0.08);
}

.onboarding-progress span {
  display: block;
  width: 14%;
  height: 100%;
  background: #c9a24a;
  transition: width 180ms ease;
}

.onboarding-client {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 34px;
  margin: 0 0 24px;
  color: #5f6879;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onboarding-client[hidden] {
  display: none;
}

.onboarding-client img {
  width: auto;
  height: 28px;
  max-width: 130px;
  object-fit: contain;
}

.onboarding-client img[hidden] {
  display: none;
}

.onboarding-eyebrow {
  margin: 0 0 10px;
  color: #a8842c;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.onboarding-card h1 {
  margin: 0;
  color: #0c1220;
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.onboarding-card h1:focus {
  outline: none;
}

.onboarding-description {
  max-width: 430px;
  margin: 14px 0 0;
  color: #5f6879;
  font-size: 15px;
  line-height: 1.55;
}

.onboarding-status {
  min-height: 20px;
  margin-top: 16px;
  color: #687181;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.onboarding-status:empty {
  display: none;
}

.onboarding-content {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.onboarding-content:empty {
  display: none;
}

.onboarding-note {
  margin: 0;
  padding: 13px 0 0;
  border-top: 1px solid rgba(12, 18, 32, 0.12);
  color: #5f6879;
  font-size: 14px;
  line-height: 1.5;
}

.onboarding-notice-summary {
  margin: 0;
  color: #303949;
  font-size: 15px;
  line-height: 1.55;
}

.onboarding-disclosure {
  justify-self: start;
  margin: 2px 0 4px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(168, 132, 44, 0.45);
  border-radius: 0;
  color: #7a6021;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

.onboarding-acknowledgements {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.onboarding-acknowledgement {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(12, 18, 32, 0.12);
  border-radius: 8px;
  color: #202a3a;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}

.onboarding-acknowledgement:focus-within {
  border-color: #a8842c;
  outline: 2px solid rgba(201, 162, 74, 0.18);
  outline-offset: 1px;
}

.onboarding-acknowledgement input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #a8842c;
}

.onboarding-matters {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.onboarding-matter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(12, 18, 32, 0.12);
  border-radius: 8px;
  color: #0c1220;
  text-align: left;
  background: #ffffff;
  box-shadow: none;
}

.onboarding-matter strong {
  font-size: 15px;
  font-weight: 600;
}

.onboarding-matter span {
  color: #687181;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboarding-matter[aria-checked="true"] {
  border-color: #a8842c;
  background: rgba(201, 162, 74, 0.07);
}

.onboarding-matter:disabled {
  color: #8d94a5;
  cursor: not-allowed;
  opacity: 0.72;
}

.onboarding-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(12, 18, 32, 0.12);
  border-radius: 8px;
  background: rgba(12, 18, 32, 0.12);
}

.onboarding-fact {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 12px;
  background: #ffffff;
}

.onboarding-fact span {
  color: #7a8290;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboarding-fact strong {
  color: #1b2535;
  font-size: 14px;
  font-weight: 600;
}

.onboarding-error {
  margin: 18px 0 0;
  padding: 11px 12px;
  border-left: 2px solid #a84841;
  color: #843b36;
  background: rgba(168, 72, 65, 0.07);
  font-size: 14px;
  line-height: 1.45;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 28px;
}

.onboarding-actions button,
.onboarding-signout {
  min-height: 44px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
}

.onboarding-actions button[hidden] {
  display: none;
}

.onboarding-primary {
  border: 1px solid #a8842c;
  color: #0c1220;
  background: #c9a24a;
  box-shadow: 0 9px 22px -16px rgba(12, 18, 32, 0.7);
}

.onboarding-primary:hover:not(:disabled) {
  border-color: #997520;
  background: #d3b15f;
}

.onboarding-primary:disabled {
  border-color: rgba(12, 18, 32, 0.12);
  color: #8a909c;
  background: #e1e4e9;
  box-shadow: none;
  cursor: not-allowed;
}

.onboarding-secondary {
  padding-inline: 18px;
  border: 1px solid rgba(12, 18, 32, 0.18);
  color: #253043;
  background: #ffffff;
  box-shadow: none;
}

.onboarding-tertiary {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 32px !important;
  padding: 0;
  border: 0;
  color: #687181;
  background: transparent;
  box-shadow: none;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.onboarding-signout {
  display: block;
  margin: 18px auto 0;
  padding: 0 4px;
  border: 0;
  color: #737b89;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.onboarding-actions button:focus-visible,
.onboarding-signout:focus-visible,
.onboarding-disclosure:focus-visible,
.onboarding-matter:focus-visible,
.onboarding-notice-dialog button:focus-visible {
  outline: 2px solid #a8842c;
  outline-offset: 3px;
}

.onboarding-notice-dialog {
  width: min(560px, calc(100vw - 40px));
  max-height: min(680px, calc(100svh - 40px));
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(12, 18, 32, 0.16);
  border-radius: 12px;
  color: #0c1220;
  background: #f8f9fb;
  box-shadow: 0 24px 64px -32px rgba(12, 18, 32, 0.5);
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
}

.onboarding-notice-dialog::backdrop {
  background: rgba(12, 18, 32, 0.58);
}

.onboarding-notice-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(12, 18, 32, 0.12);
}

.onboarding-notice-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.onboarding-notice-head button {
  margin: 0;
  padding: 5px 0;
  border: 0;
  color: #687181;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.onboarding-notice-content {
  display: grid;
  gap: 16px;
  padding: 22px 26px 28px;
  color: #303949;
  font-size: 15px;
  line-height: 1.6;
}

.onboarding-notice-content p,
.onboarding-notice-content ul {
  margin: 0;
}

.onboarding-notice-content ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

@keyframes auth-matrix-fall {
  from { transform: translateY(-22vh); }
  to { transform: translateY(42vh); }
}

@keyframes auth-iris-breathe {
  0%, 100% { opacity: 0.84; transform: scale(0.985); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes auth-iris-core {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
}

@keyframes auth-iris-hot {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@media (max-width: 520px) {
  .auth-screen {
    padding: 24px 16px;
  }

  .auth-shell {
    width: min(360px, calc(100vw - 32px));
  }

  .auth-brand-lockup {
    min-height: 62px;
  }

  .auth-brand-logo {
    width: min(260px, 76vw);
    max-height: 70px;
  }

  .auth-eye-shell,
  .auth-iris-eye {
    width: 80px;
    height: 80px;
  }

  .auth-card.simple-login {
    padding: 18px 8px 4px;
  }

  .onboarding-screen {
    place-items: stretch;
    padding: max(22px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  }

  .onboarding-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    min-height: calc(100svh - max(42px, env(safe-area-inset-top)) - max(40px, env(safe-area-inset-bottom)));
  }

  .onboarding-brand {
    min-height: 48px;
    margin-bottom: 22px;
  }

  .onboarding-brand-logo {
    width: min(240px, 70vw);
    max-height: 52px;
  }

  .onboarding-brand-fallback {
    font-size: 26px;
  }

  .onboarding-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 30px 22px 20px;
  }

  .onboarding-content {
    overflow: auto;
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
    margin-top: auto;
    padding-top: 26px;
  }

  .onboarding-actions button {
    width: 100%;
    min-height: 48px;
  }

  .onboarding-tertiary {
    justify-self: stretch;
    text-align: center;
  }

  .onboarding-facts {
    grid-template-columns: 1fr;
  }

  .onboarding-notice-dialog {
    width: calc(100vw - 32px);
    max-height: calc(100svh - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-matrix span,
  .auth-iris-pulse,
  .auth-iris-core,
  .auth-iris-hot {
    animation: none !important;
  }

  .auth-matrix {
    opacity: 0.08;
  }

  .onboarding-progress span {
    transition: none;
  }
}
