:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #05070b;
  --panel-2: #0b0f17;
  --line: #1b2230;
  --line-strong: #2a3448;
  --text: #f4f7fb;
  --muted: #9ba6b7;
  --dim: #6f7b8f;
  --blue: #2f86ff;
  --blue-soft: #0b2448;
  --red: #ff6f8b;
  --green: #54d18a;
  --amber: #f5c15d;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme-mode="extra_dark"] {
  --bg: #000;
  --panel: #010101;
  --panel-2: #030303;
  --line: #11161e;
  --line-strong: #1b2430;
  --muted: #8992a1;
  --dim: #5f6878;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.sign-in-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
  padding: 24px;
}

.sign-in-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(420px, calc(100vw - 48px));
  background: transparent;
  padding: 0;
}

.sign-in-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}

.sign-in-logo {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
}

.sign-in-lockup h1 {
  margin: 0;
  color: #f7f8fb;
  font-size: clamp(38px, 8vw, 54px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
}

.sign-in-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  color: #647084;
  font-size: 13px;
  font-weight: 700;
}

.sign-in-mode button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #9da8ba;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  padding: 0 2px 4px;
}

.sign-in-mode button.active {
  border-color: rgba(57, 130, 249, 0.75);
  color: #f3f7ff;
}

.sign-in-form {
  display: grid;
  gap: 12px;
  width: min(330px, 100%);
}

.sign-in-form label {
  display: grid;
  gap: 6px;
  color: #a4afc0;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sign-in-form input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #f4f7fb;
  font-size: 14px;
  font-weight: 540;
  letter-spacing: 0;
  outline: 0;
  padding: 0 2px;
  text-transform: none;
}

.sign-in-form input:focus {
  border-color: rgba(57, 130, 249, 0.86);
}

.sign-in-password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.sign-in-password-field button {
  min-height: 32px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #9da8ba;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 0 2px 4px;
}

.sign-in-password-field button:hover,
.sign-in-password-field button:focus-visible {
  border-color: rgba(57, 130, 249, 0.72);
  color: #fff;
  outline: 0;
}

.sign-in-password-hint {
  margin: -2px 0 0;
  color: #7d8797;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
}

.sign-in-submit {
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid rgba(57, 130, 249, 0.78);
  background: transparent;
  color: #f5f8ff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  margin-top: 2px;
  padding: 0 4px 7px;
}

.sign-in-submit:hover,
.sign-in-submit:focus-visible {
  border-color: #8bbcff;
  outline: 0;
}

.sign-in-actions {
  display: grid;
  gap: 10px;
  width: min(320px, 100%);
}

.sign-in-provider-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #f1f5fb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 660;
  padding: 0 14px;
  text-align: center;
}

.sign-in-provider-button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  justify-self: start;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e6ff;
  font-size: 10px;
  font-weight: 760;
}

.sign-in-create-link {
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid rgba(57, 130, 249, 0.55);
  background: transparent;
  color: #d9e7ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  padding: 0 2px 4px;
}

.sign-in-provider-button:hover,
.sign-in-provider-button:focus-visible,
.sign-in-create-link:hover,
.sign-in-create-link:focus-visible {
  border-color: rgba(139, 188, 255, 0.86);
  color: #ffffff;
  outline: 0;
}

.sign-in-provider-button:disabled,
.sign-in-create-link:disabled {
  cursor: wait;
  opacity: .58;
}

.sign-in-card em:not(:empty) {
  display: block;
  max-width: 340px;
  color: #8a94a5;
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
  text-align: center;
}

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

button {
  color: inherit;
}

.coherence-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px 1fr;
  background: #000;
}

.top-rail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid #141820;
}

.surface-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #1f2633;
  border-radius: 999px;
  padding: 3px;
  background: #020305;
}

.surface-pill-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 20px;
  background: #f3f6fb;
  color: #05070a;
  font-weight: 800;
  cursor: default;
}

.brand-logo {
  justify-self: end;
  width: 78px;
  height: auto;
  opacity: .86;
}

.top-rail-action {
  justify-self: end;
  border: 1px solid #202838;
  border-radius: 999px;
  background: #02050a;
  color: #dce7f8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 16px;
}

.workspace {
  --left-rail-width: 38px;
  --right-rail-width: 38px;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: var(--left-rail-width) minmax(0, 1fr) var(--right-rail-width);
  border-bottom: 1px solid #0e1218;
}

.workspace.left-open {
  --left-rail-width: 280px;
}

.workspace.right-open {
  --right-rail-width: 320px;
}

.chat-sidebar,
.session-sidebar {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-color: #151b24;
  background: #010203;
}

.chat-sidebar {
  border-right: 1px solid #151b24;
}

.session-sidebar {
  border-left: 1px solid #151b24;
}

.chat-sidebar.collapsed,
.session-sidebar.collapsed {
  width: 100%;
}

.chat-sidebar.collapsed .sidebar-body,
.session-sidebar.collapsed .session-content {
  display: none;
}

.panel-title {
  color: #b8c3d7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.sidebar-body,
.session-content {
  height: calc(100vh - 118px);
  overflow: auto;
  padding: 8px 14px 18px;
}

.sidebar-section {
  margin-bottom: 16px;
}

.sidebar-section summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.text-action {
  margin: 10px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.item-list {
  display: grid;
  gap: 6px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0 8px 10px;
  border-left: 2px solid transparent;
  color: #c4cede;
  font-size: 12px;
  font-weight: 700;
}

.list-item.active {
  border-left-color: var(--blue);
  color: #fff;
}

.list-item button {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.conversation {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 72px 1fr auto;
  border-left: 1px solid #080b10;
  border-right: 1px solid #080b10;
}

.entry-hero {
  position: absolute;
  inset: 72px 0 180px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.entry-lockup {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.entry-logo {
  width: 34px;
  height: 34px;
}

.entry-lockup h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.reliability-control {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border: 1px solid #1d2432;
  border-radius: 999px;
  background: #030508;
  color: #c9d2e2;
  font-size: 12px;
  font-weight: 800;
}

.learn-more-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #dce4f2;
  font-weight: 900;
  cursor: pointer;
}

.coherence-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.coherence-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 30px;
  height: 16px;
  padding: 2px;
  border: 1px solid #b95b70;
  border-radius: 999px;
  background: #3c101a;
}

.switch-thumb {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f57991;
  transition: transform .16s ease, background .16s ease;
}

.coherence-switch input:checked + .switch-track {
  border-color: #4ccf8b;
  background: #0c3a25;
}

.coherence-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(14px);
  background: #68e39d;
}

.coherence-switch strong {
  min-width: 24px;
  color: var(--red);
  font-size: 11px;
}

.coherence-switch input:checked ~ strong {
  color: var(--green);
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 70px min(9vw, 120px) 32px;
}

.message {
  max-width: 720px;
  margin: 0 0 34px;
  padding-left: 16px;
  border-left: 2px solid #1d2533;
}

.message.user {
  margin-left: auto;
  border-left: 0;
  border-right: 2px solid #1d2533;
  padding-left: 0;
  padding-right: 16px;
  text-align: left;
}

.message.assistant.repaired {
  border-left-color: var(--green);
}

.message.assistant.repaired .message-text {
  color: #cbf7dc;
}

.message.assistant.guided {
  border-left-color: var(--amber);
}

.message.assistant.error {
  border-left-color: var(--red);
}

.message-speaker {
  margin-bottom: 8px;
  color: #aeb8ca;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.message-text {
  white-space: pre-wrap;
  color: #f6f8fc;
  font-size: 15px;
  line-height: 1.56;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.badge {
  color: var(--blue);
}

.badge.repaired {
  color: var(--green);
}

.badge.guided {
  color: var(--amber);
}

.badge.error {
  color: var(--red);
}

.details-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.composer {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto 28px;
  padding: 18px 20px 12px;
  border: 1px solid #2a2f3b;
  border-radius: 28px;
  background: #1e2026;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .42);
}

.composer > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.composer textarea {
  width: 100%;
  min-height: 68px;
  max-height: 180px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f8fafc;
  font-size: 15px;
}

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

.composer-left-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.model-selector,
.provider-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9e1ee;
  font-size: 11px;
  font-weight: 900;
}

.composer-link-button {
  max-width: 260px;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: #d9e1ee;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select,
input,
textarea {
  border: 1px solid #303846;
  background: #111722;
  color: #f4f7fb;
  border-radius: 6px;
}

select {
  max-width: 230px;
  padding: 5px 28px 5px 8px;
}

.context-menu {
  position: relative;
}

.context-menu summary {
  color: #e3e9f4;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.context-menu summary::-webkit-details-marker {
  display: none;
}

.context-menu-body {
  position: absolute;
  left: 0;
  bottom: 28px;
  width: 280px;
  padding: 14px;
  border: 1px solid #273142;
  background: #070b12;
  z-index: 20;
}

.context-status,
.max-calls,
.output-footnote {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.send-button,
.primary-button,
.upgrade-button {
  min-width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 50%;
  background: #333941;
  color: #f6f8fb;
  cursor: pointer;
  font-weight: 900;
}

.primary-button,
.upgrade-button {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--blue);
}

.send-button[data-send-state="busy"] {
  background: #5b2632;
}

.send-button[data-send-state="busy"] span::after {
  content: "";
}

.output-footnote {
  margin: 8px 0 0;
  text-align: center;
}

.side-panel {
  padding: 14px 0;
  border-bottom: 1px solid #151b24;
}

.side-panel-primary {
  padding: 15px 0;
}

.repair-focus-panel {
  border-bottom-color: #1f2a3a;
}

.side-panel-disclosure {
  padding: 0;
}

.side-panel-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
  color: #b8c3d7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  list-style: none;
  text-transform: uppercase;
}

.side-panel-disclosure summary::-webkit-details-marker {
  display: none;
}

.side-panel-disclosure summary::after {
  content: "›";
  color: var(--blue);
  font-size: 17px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .16s ease;
}

.side-panel-disclosure[open] summary::after {
  transform: rotate(90deg);
}

.guided-boundary-note {
  color: #8e9aaa !important;
  font-weight: 800;
}

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

.guided-input-form label {
  display: grid;
  gap: 6px;
  color: #9ca8bb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: none;
}

.guided-input-form textarea,
.guided-input-form input,
.guided-input-form select {
  max-width: none;
  width: 100%;
  border-color: rgba(171, 186, 205, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: #f7fbff;
  text-transform: none;
  letter-spacing: 0;
}

.guided-input-form textarea {
  min-height: 92px;
  resize: vertical;
}

.guided-input-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.guided-input-actions button {
  border: 1px solid rgba(171, 186, 205, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #e9f1fb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
}

.guided-helper-status {
  min-height: 16px;
}

.guided-helper-status[data-tone="success"] {
  color: #8ee6ad !important;
}

.guided-helper-status[data-tone="error"] {
  color: #ff8a9c !important;
}

.settings-status-grid span {
  overflow: hidden;
  color: #edf4ff;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #161f2d;
  background: #03060d;
}

.settings-section h3 {
  margin: 0;
  color: #b8c3d7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

.settings-grid label,
.settings-boundary-note {
  color: #cbd5e4;
}

.settings-grid label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settings-grid select,
.settings-grid input {
  max-width: none;
  width: 100%;
  text-transform: none;
  letter-spacing: 0;
}

.settings-role-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #1b2535;
  background: #050911;
}

.settings-boundary-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-save-button {
  justify-self: end;
  border-radius: 999px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: hidden;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 72px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid #2a3448;
  background: #090d15;
}

.modal-panel.wide {
  width: min(920px, calc(100vw - 40px));
}

.modal-panel h2 {
  margin: 0;
  font-size: 18px;
}

.modal-panel label {
  display: grid;
  gap: 6px;
  color: #cbd5e4;
  font-size: 12px;
  font-weight: 900;
}

.modal-panel input,
.modal-panel textarea,
.modal-panel select {
  width: 100%;
  padding: 10px;
}

.modal-panel textarea {
  min-height: 120px;
  resize: vertical;
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid #2a3448;
  background: transparent;
  color: #d8e1ef;
  cursor: pointer;
}

.compare-body {
  display: grid;
  gap: 16px;
}

.compare-block {
  display: grid;
  gap: 8px;
}

.compare-block pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #030508;
  border: 1px solid #18202d;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .workspace {
    --left-rail-width: 38px;
    --right-rail-width: 38px;
  }

  .entry-lockup h1 {
    font-size: 34px;
  }

  .messages {
    padding-inline: 24px;
  }

  .settings-grid,
  .settings-role-summary,
  .settings-status-grid {
    grid-template-columns: 1fr;
  }

}

/* Product shell visual contract: restored from the final Testing App v3
   Coherence surface without importing Lab runtime or storage. */
:root {
  --page: #000000;
  --rail: #030508;
  --panel: #0d1118;
  --panel-soft: #070a10;
  --line: rgba(224, 232, 242, 0.075);
  --line-strong: rgba(171, 186, 205, 0.30);
  --text: #f0f4fa;
  --muted: #aeb8c6;
  --dim: #667181;
  --accent: #d7dee8;
  --electric-blue: #3982f9;
  --electric-blue-soft: rgba(57, 130, 249, 0.14);
  --electric-blue-line: rgba(57, 130, 249, 0.62);
  --electric-green: #39ff14;
  --electric-green-soft: rgba(57, 255, 20, 0.10);
  --electric-green-line: rgba(57, 255, 20, 0.58);
  --danger: #ff5f6d;
  --danger-soft: rgba(255, 95, 109, 0.12);
  --danger-line: rgba(255, 95, 109, 0.62);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  --shell-shadow: none;
}

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

body {
  background: #000000;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.coherence-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.top-rail {
  position: relative;
  z-index: 200;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 18px 9px 22px;
  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.surface-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.surface-pill-button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f3f6fb;
  color: #050608;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.01em;
  padding: 0 14px;
}

.top-rail-action {
  display: none;
}

.top-rail-action:hover {
  display: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: min(24vw, 220px);
  object-fit: contain;
  object-position: right center;
  opacity: 0.92;
}

.workspace {
  --left-rail-width: 36px;
  --right-rail-width: 36px;
  display: grid;
  grid-template-columns: var(--left-rail-width) minmax(0, 1fr) var(--right-rail-width);
  gap: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.workspace.left-open {
  --left-rail-width: minmax(218px, 250px);
}

.workspace.right-open {
  --right-rail-width: minmax(168px, 196px);
}

.chat-sidebar,
.session-sidebar,
.conversation {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.68);
}

.chat-sidebar {
  display: grid;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  padding: 14px;
  overflow: hidden;
}

.session-sidebar {
  display: grid;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.075);
  padding: 14px;
  overflow: hidden;
}

.chat-sidebar.collapsed {
  padding: 8px 6px;
}

.session-sidebar.collapsed {
  padding: 8px 6px;
}

.chat-sidebar.collapsed .sidebar-body,
.session-sidebar.collapsed .session-content {
  display: none;
}

.panel-title {
  color: #d7dee8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-body,
.session-content {
  display: grid;
  align-content: start;
  gap: 12px;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.sidebar-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.sidebar-section summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  color: var(--electric-blue);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  list-style: none;
  text-transform: none;
}

.sidebar-section summary::-webkit-details-marker {
  display: none;
}

.sidebar-section summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--electric-blue);
  transform: rotate(90deg);
  transition: transform 120ms ease;
}

.sidebar-section:not([open]) summary::before {
  transform: rotate(0deg);
}

.text-action {
  min-height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
  padding: 0;
}

.text-action:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.item-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 2px;
  min-height: 0;
  overflow: visible;
  padding: 2px 0;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  max-height: 34px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  padding: 0 6px 0 8px;
}

.list-item:hover,
.list-item.active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.list-item button {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
  border: 0;
  background: #000000;
  box-shadow: none;
}

.reliability-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #b8bec9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 5px 7px 5px 13px;
  white-space: nowrap;
}

.learn-more-link {
  min-height: auto;
  border: 0;
  background: transparent;
  color: #b8bec9;
  font-size: inherit;
  font-weight: 850;
  letter-spacing: inherit;
  padding: 0;
}

.learn-more-link:hover,
.learn-more-link:focus-visible {
  background: transparent;
  color: var(--electric-blue);
}

.coherence-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch-track {
  width: 30px;
  height: 16px;
  padding: 2px;
  border: 1px solid #b95b70;
  border-radius: 999px;
  background: #3c101a;
}

.switch-thumb {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f57991;
  transition: transform .16s ease, background .16s ease;
}

.coherence-switch input:checked + .switch-track {
  border-color: #4ccf8b;
  background: #0c3a25;
}

.coherence-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(14px);
  background: #68e39d;
}

.coherence-switch strong {
  min-width: 24px;
  color: var(--danger);
  font-size: 11px;
}

.coherence-switch input:checked ~ strong {
  color: var(--electric-green);
}

.entry-hero {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  align-self: center;
  min-height: min(42vh, 360px);
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  isolation: isolate;
}

.entry-hero[hidden] {
  display: none;
}

.entry-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.entry-logo {
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
  clip-path: circle(50%);
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.16))
    drop-shadow(0 0 22px rgba(57, 130, 249, 0.07));
}

.entry-lockup h1 {
  color: #fbfcff;
  font-size: clamp(30px, 3.2vw, 45px);
  font-weight: 760;
  line-height: 1;
}

.messages {
  grid-column: 1;
  grid-row: 3;
  display: grid;
  align-content: start;
  gap: 20px;
  width: calc(100% - 44px);
  max-width: 760px;
  min-height: 0;
  justify-self: center;
  overflow: auto;
  padding: 28px 0;
  scrollbar-color: rgba(171, 186, 205, 0.38) transparent;
}

.message {
  display: grid;
  gap: 6px;
  max-width: min(760px, 92%);
  margin: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  padding-left: 14px;
}

.message.user {
  justify-self: end;
  max-width: min(700px, 80%);
  border-right: 2px solid rgba(255, 255, 255, 0.14);
  border-left: 0;
  padding-right: 14px;
  padding-left: 0;
}

.message.assistant.repaired {
  border-color: rgba(57, 255, 20, 0.64);
}

.message.assistant.guided {
  border-color: rgba(57, 130, 249, 0.82);
}

.message.assistant.error {
  border-color: var(--danger-line);
}

.message-speaker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.06em;
}

.message-text {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.58;
  padding: 0;
  box-shadow: none;
}

.message.user .message-text {
  color: #edf2f8;
}

.message.assistant.repaired .message-text {
  color: #e7ffe2;
}

.message.assistant.guided .message-text {
  color: #eef5ff;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.message-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message-action {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(174, 184, 198, 0.78);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 0;
}

.message-action:hover,
.message-action:focus-visible {
  color: #dcdcff;
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-action:disabled {
  color: rgba(174, 184, 198, 0.42);
  cursor: default;
  text-decoration: none;
}

.badge {
  color: #b9caff;
}

.badge.repaired {
  color: var(--electric-green);
}

.badge.guided,
.details-link {
  color: var(--electric-blue);
}

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

.details-link {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 850;
  padding: 0;
}

.details-link:hover {
  background: transparent;
  color: #dcdcff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.composer {
  grid-column: 1;
  grid-row: 4;
  width: calc(100% - 44px);
  max-width: 760px;
  justify-self: center;
  align-self: end;
  display: grid;
  gap: 6px;
  margin: 0 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 28px;
  background: rgba(31, 32, 36, 0.92);
  box-shadow:
    0 18px 58px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 12px 14px 10px;
}

.composer > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.composer textarea {
  min-height: 64px;
  max-height: 190px;
  resize: vertical;
  border: 0;
  border-radius: 18px;
  outline: 0;
  background: transparent;
  color: #f4f7fb;
  font-size: 14px;
  padding: 7px 6px;
}

.composer textarea::placeholder {
  color: #9aa0aa;
}

.pending-document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.pending-document-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 260px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #c8d0dc;
  font-size: 10.5px;
  font-weight: 720;
  padding: 4px 8px;
}

.pending-document-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-document-chip button,
.composer-utility-button {
  border: 0;
  background: transparent;
  color: #dce5f2;
  cursor: pointer;
  font: inherit;
}

.pending-document-chip button {
  color: #8f96a3;
  padding: 0;
}

.turn-stage-status {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 22px;
  overflow: hidden;
  color: #8f96a3;
  font-size: 10.5px;
  line-height: 1.25;
  padding: 0 6px;
}

.turn-stage-status[hidden],
.turn-stage-status[data-visible="false"] {
  display: none;
}

.turn-stage-dot {
  width: 6px;
  min-width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #8f96a3;
  box-shadow: 0 0 0 3px rgba(143, 150, 163, 0.10);
}

.turn-stage-status strong {
  color: #dce5f2;
  font-size: 10.5px;
  font-weight: 820;
  white-space: nowrap;
}

.turn-stage-status span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-stage-status[data-tone="active"] .turn-stage-dot {
  background: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(43, 133, 255, 0.12);
}

.turn-stage-status[data-tone="success"] .turn-stage-dot {
  background: #4bd07b;
  box-shadow: 0 0 0 3px rgba(75, 208, 123, 0.12);
}

.turn-stage-status[data-tone="warn"] .turn-stage-dot {
  background: #f2b84b;
  box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.12);
}

.turn-stage-status[data-tone="error"] .turn-stage-dot {
  background: #ff6f8d;
  box-shadow: 0 0 0 3px rgba(255, 111, 141, 0.12);
}

.coherence-shell[data-admin-visual-takeover-active] .composer,
.coherence-shell[data-admin-visual-takeover-active] .chat-sidebar {
  outline: 1px solid rgba(43, 133, 255, 0.14);
}

.models-menu.locked summary,
.app-menu.locked summary {
  pointer-events: none;
  color: #798293;
}

.composer-actions {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.composer-left-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.composer-link-button,
.composer-utility-button,
.models-menu summary,
.context-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: min(52vw, 310px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e9edf4;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 760;
  padding: 0;
}

.composer-link-button:hover,
.composer-utility-button:hover,
.models-menu summary:hover,
.context-menu summary:hover {
  color: #ffffff;
}

.composer-utility-button {
  justify-content: center;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  font-size: 15px;
  line-height: 1;
}

.models-menu,
.context-menu {
  position: relative;
}

.models-menu summary,
.context-menu summary {
  gap: 8px;
  list-style: none;
}

.models-menu summary::-webkit-details-marker,
.context-menu summary::-webkit-details-marker {
  display: none;
}

.models-menu summary::after,
.context-menu summary::after {
  content: "";
  width: 10px;
  height: 7px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23a8adb7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 7px no-repeat;
}

.models-menu summary strong {
  max-width: 160px;
  color: #9aa2b0;
  font-size: 10px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.models-menu-body,
.context-menu-body {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  z-index: 20;
  width: min(320px, 78vw);
  border: 1px solid rgba(80, 137, 225, 0.20);
  border-radius: 8px;
  background: rgba(3, 4, 6, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
  padding: 12px;
}

.models-menu-body {
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 48px));
}

.models-menu:not([open]) .models-menu-body {
  display: none;
}

.models-menu-body label {
  display: grid;
  gap: 6px;
  color: #d7dee8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-route-card {
  display: grid;
  gap: 8px;
  padding: 2px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.model-route-card:last-of-type,
.model-collider-row:last-child,
.particle-observer-panel:last-child {
  border-bottom: 0;
}

.model-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #eef3fb;
  font-size: 10px;
  font-weight: 860;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-auto-switch {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  color: #aeb6c4 !important;
  font-size: 9.5px !important;
  font-weight: 780 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer;
}

.model-auto-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-auto-switch > span {
  width: 26px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
}

.model-auto-switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #8993a3;
  transition: transform 0.16s ease, background 0.16s ease;
}

.model-auto-switch input:checked + span {
  border-color: rgba(44, 133, 255, 0.46);
  background: rgba(44, 133, 255, 0.18);
}

.model-auto-switch input:checked + span::after {
  transform: translateX(12px);
  background: #2d8cff;
}

.model-auto-switch strong {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.model-auto-badge {
  color: #8fbfff;
  font-size: 9.5px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: none;
}

.model-manual-panel,
.model-collider-row {
  margin-top: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.models-menu-body[data-collider-mode="default_collider"] .model-collider-row {
  padding-bottom: 0;
  border-bottom: 0;
}

.models-menu-body select {
  width: 100%;
  max-width: none;
  min-height: 34px;
  border-color: rgba(130, 165, 220, 0.20);
  border-radius: 6px;
  background-color: #070a0f;
  text-transform: none;
  letter-spacing: 0;
}

.models-menu-body em {
  color: #8e96a5;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.models-settings-link {
  justify-self: start;
}

.max-calls,
.output-footnote {
  color: #737985;
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.04em;
}

.max-calls {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #8e96a5;
  padding-left: 10px;
  white-space: nowrap;
}

.output-footnote {
  justify-self: center;
  margin: 0;
}

.send-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f3f6fb;
  color: #050608;
  padding: 0;
}

.send-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.send-button::before,
.send-button::after {
  content: "";
  position: absolute;
  display: block;
}

.send-button[data-send-state="send"]::before {
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translate(-50%, -58%) rotate(45deg);
}

.send-button[data-send-state="send"]::after {
  top: 50%;
  left: 50%;
  width: 2px;
  height: 15px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -40%);
}

.send-button[data-send-state="stop"]::before {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: currentColor;
}

.send-button:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #6f7582;
}

.guided-boundary-note {
  margin: 0;
  color: #8e9aaa !important;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.guided-boundary-note {
  font-size: 12px !important;
  color: #758399 !important;
}

.guided-input-form textarea,
.guided-input-form input,
.guided-input-form select {
  width: 100%;
  max-width: none;
  border: 1px solid rgba(171, 186, 205, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.028);
  color: #eff5fd;
  padding: 10px;
}

.guided-input-form label {
  color: #9ca8bb;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: none;
}

.guided-input-actions button {
  min-height: 32px;
  border: 1px solid rgba(171, 186, 205, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #dfe9f8;
  font-size: 10px;
  font-weight: 840;
  letter-spacing: 0.04em;
}

.guided-input-actions button[data-document-upload-button="true"] {
  min-width: 36px;
  padding: 7px 10px;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1;
}

.guided-thread {
  gap: 0;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.guided-thread-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid rgba(57, 130, 249, 0.22);
  color: #edf5ff;
  padding: 2px 0 8px;
}

.guided-thread-summary::-webkit-details-marker {
  display: none;
}

.guided-thread-summary span {
  color: #f5f8ff;
  font-size: 13px;
  font-weight: 840;
}

.guided-thread-summary b {
  color: var(--electric-blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: right;
}

.guided-thread-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.guided-thread-message {
  color: #dbe7f8;
  font-size: 13.5px;
  line-height: 1.55;
}

.guided-thread-message.helper {
  border-left: 1px solid rgba(57, 130, 249, 0.48);
  padding-left: 12px;
}

.guided-thread .guided-boundary-note {
  color: #8f9db0 !important;
  font-size: 12px !important;
  line-height: 1.45;
}

.guided-thread .guided-input-form {
  gap: 9px;
}

.guided-thread .guided-input-form textarea,
.guided-thread .guided-input-form input,
.guided-thread .guided-input-form select {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.024);
}

.guided-thread .guided-input-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.modal-panel {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  background: rgba(14, 17, 24, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .56);
}

@media (max-width: 760px) {
  .coherence-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .top-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
    gap: 10px;
  }

  .surface-pill {
    margin: 0;
  }

  .brand-logo {
    justify-self: end;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .chat-sidebar.collapsed,
  .session-sidebar.collapsed {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.075);
  }

  .conversation {
    min-height: calc(100svh - 200px);
  }
}

@media (max-width: 680px) {
  .top-rail {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    padding: 8px 10px;
  }

  .brand-logo {
    justify-self: start;
    max-width: 112px;
  }

  .workspace {
    gap: 0;
  }

  .reliability-control {
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .entry-hero {
    min-height: 260px;
    padding: 0 14px;
  }

  .messages,
  .composer {
    width: calc(100% - 20px);
  }

  .composer {
    border-radius: 22px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .composer textarea {
    min-height: 72px;
  }

  .composer-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .composer-left-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .context-menu-body {
    right: 0;
    left: auto;
    width: min(320px, calc(100vw - 36px));
  }
}

/* Product shell correction: restore the old Coherence rail discipline while keeping new wiring. */
.top-rail {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 18px 9px 22px;
}

.surface-pill {
  display: none !important;
}

.brand-logo {
  justify-self: start;
  height: 34px;
  max-width: min(26vw, 220px);
  object-position: left center;
}

.app-menu {
  position: relative;
  z-index: 210;
  justify-self: end;
  margin-left: auto;
}

.app-menu summary {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f1f5fb;
  cursor: pointer;
  list-style: none;
  padding: 0;
}

.app-menu summary::-webkit-details-marker {
  display: none;
}

.app-menu summary span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 0;
  background: currentColor;
}

.app-menu summary:hover,
.app-menu[open] summary {
  color: var(--electric-blue);
}

.app-menu-body {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 220;
  display: grid;
  gap: 3px;
  width: 236px;
  border: 1px solid rgba(171, 186, 205, 0.18);
  background: rgba(5, 7, 11, 0.98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.52);
  min-height: 28px;
  padding: 8px;
}

.workspace {
  position: relative;
  z-index: 1;
  --left-rail-open-width: 250px;
  --right-rail-open-width: 196px;
  --left-rail-width: 36px;
  --right-rail-width: 36px;
  grid-template-columns: var(--left-rail-width) minmax(0, 1fr) var(--right-rail-width);
}

.workspace.left-open {
  --left-rail-width: var(--left-rail-open-width);
}

.workspace.right-open {
  --right-rail-width: var(--right-rail-open-width);
}

.chat-sidebar,
.session-sidebar {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.68);
  overflow: hidden;
}

.chat-sidebar {
  display: grid;
  align-content: start;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  padding: 14px;
}

.session-sidebar {
  display: grid;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.075);
  padding: 14px;
}

.chat-sidebar.collapsed,
.session-sidebar.collapsed {
  padding: 8px 6px;
}

.chat-sidebar.collapsed .sidebar-body,
.session-sidebar.collapsed .session-content {
  display: none;
}

.panel-title {
  color: #d7dee8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 14px;
  cursor: col-resize;
  background: transparent;
}

.sidebar-resize-handle:hover,
body.resizing-sidebar .sidebar-resize-handle {
  background: rgba(57, 130, 249, 0.16);
}

.sidebar-resize-handle-left {
  right: 0;
}

.sidebar-resize-handle-right {
  left: 0;
}

body.resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}

.sidebar-body,
.session-content {
  display: grid;
  align-content: start;
  gap: 12px;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.sidebar-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.sidebar-section summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  color: var(--electric-blue);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  list-style: none;
  text-transform: none;
}

.sidebar-section summary::-webkit-details-marker {
  display: none;
}

.sidebar-section summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--electric-blue);
  transform: rotate(90deg);
  transition: transform 120ms ease;
}

.sidebar-section:not([open]) summary::before {
  transform: rotate(0deg);
}

.history-search {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-search span {
  color: rgba(166, 178, 196, 0.72);
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.history-search input {
  width: 100%;
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0;
  background: transparent;
  color: #eef3fb;
  font-size: 11px;
  padding: 0 2px 4px;
}

.history-search input::placeholder {
  color: rgba(151, 163, 181, 0.62);
}

.history-search input:focus {
  border-bottom-color: rgba(57, 130, 249, 0.66);
  outline: 0;
}

.item-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 2px;
  min-height: 0;
  overflow: visible;
  padding: 2px 0;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  max-height: 34px;
  width: 100%;
  border: 0;
  border-left: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  padding: 0 6px 0 8px;
}

.list-item:hover,
.list-item.active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.list-item.empty {
  color: rgba(150, 156, 168, 0.62);
  font-style: italic;
  pointer-events: none;
}

.list-item button {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  padding: 0;
}

.list-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

.list-select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-action {
  color: var(--electric-blue) !important;
  opacity: 0;
}

.list-item:hover .list-action,
.list-item.active .list-action,
.list-action:focus-visible {
  opacity: 1;
}

.list-action:hover,
.list-action:focus-visible {
  color: #dcdcff !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.list-action.danger:hover,
.list-action.danger:focus-visible {
  color: var(--danger) !important;
}

.project-group {
  display: grid;
  gap: 2px;
}

.project-chat-list {
  display: grid;
  gap: 2px;
  padding-left: 10px;
}

.project-chat-item {
  min-height: 28px;
  max-height: 28px;
  color: #818a99;
}

.active-project-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(720px, calc(100% - 48px));
  margin: 0 auto 8px;
  color: #8f97a6;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.active-project-bar span {
  color: #cfd7e5;
  font-weight: 650;
}

.active-project-bar button {
  border: 0;
  border-bottom: 1px solid rgba(57, 130, 249, 0.42);
  border-radius: 0;
  background: transparent;
  color: var(--electric-blue);
  cursor: pointer;
  font-size: 11px;
  padding: 0 0 3px;
}

.active-project-bar button:hover,
.active-project-bar button:focus-visible {
  border-color: var(--electric-blue);
  color: #ffffff;
}

.composer-link-button,
.models-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: min(52vw, 310px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e9edf4;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 760;
  padding: 0;
}

.models-menu summary:hover {
  color: #ffffff;
}

.session-content {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 760px) {
  .top-rail {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .brand-logo {
    max-width: 132px;
  }

  .app-menu-body {
    right: 0;
  }


}

[hidden] {
  display: none !important;
}

.models-menu-body {
  width: min(360px, calc(100vw - 44px));
  gap: 10px;
  border-radius: 8px;
  padding: 12px;
}

.models-menu-body label {
  gap: 5px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.models-menu-body select {
  min-height: 32px;
  padding: 7px 28px 7px 9px;
  font-size: 11px;
  font-weight: 760;
}

.models-menu-body em {
  font-size: 9.5px;
  line-height: 1.3;
}

/* Launch polish: keep the final product shell compact and chat-native. */
.conversation {
  grid-template-rows: minmax(0, 1fr) auto;
}

.entry-hero {
  grid-row: 1;
}

.messages {
  grid-row: 1;
  padding: 22px 0 24px;
}

.composer {
  grid-row: 2;
  gap: 5px;
  padding: 10px 12px 9px;
}

.composer-actions {
  min-height: 30px;
  gap: 8px;
  align-items: center;
}

.composer-left-controls {
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.models-menu summary {
  min-height: 22px;
  border-radius: 0;
  background: transparent;
  color: #f0f2f5;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  padding: 0;
}

.models-menu summary strong {
  display: none;
}

.composer-reliability {
  align-items: center;
  gap: 8px;
  min-height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c4c9d3;
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0;
  padding: 0;
}

.composer-reliability > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.composer-reliability .learn-more-link {
  color: #8f96a3;
  font-size: inherit;
  font-weight: 720;
}

.composer-reliability .coherence-switch {
  gap: 6px;
}

.composer-reliability .switch-track {
  width: 28px;
  height: 15px;
}

.composer-reliability .switch-thumb {
  width: 9px;
  height: 9px;
}

.composer-reliability .coherence-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(13px);
}

.composer-reliability .coherence-switch strong {
  min-width: 48px;
  font-size: 10.5px;
  font-weight: 820;
}

.send-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
}

.send-button[data-send-state="send"]::before {
  width: 8px;
  height: 8px;
  border-top-width: 1.8px;
  border-left-width: 1.8px;
}

.send-button[data-send-state="send"]::after {
  width: 1.8px;
  height: 12px;
}

.send-button[data-send-state="stop"]::before {
  width: 9px;
  height: 9px;
}

.chat-sidebar {
  background: #000000;
  border-right-color: #151b24;
}

.sidebar-body {
  gap: 10px;
  padding: 14px 12px 12px;
}

.sidebar-section {
  gap: 5px;
}

.sidebar-section summary {
  min-height: 24px;
  color: #9d9fa6;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.sidebar-section summary::before {
  border-left-color: #8c8f97;
}

.text-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  width: 100%;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #f0f1f4;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0;
  padding: 0 12px;
}

.text-action::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #f3f4f7;
  font-size: 14px;
  font-weight: 520;
}

.text-action:hover,
.text-action:focus-visible {
  background: rgba(255, 255, 255, 0.085);
  color: #ffffff;
}

.item-list {
  gap: 1px;
}

.list-item {
  min-height: 30px;
  max-height: 30px;
  border-radius: 8px;
  color: #a2a4aa;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0;
  padding: 0 6px 0 10px;
}

.list-item:hover,
.list-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: #f0f1f4;
}

.list-action {
  color: #9ba3b1 !important;
  font-size: 10px;
  font-weight: 650;
}

.project-chat-item {
  min-height: 26px;
  max-height: 26px;
  color: #8d9098;
  font-size: 10.5px;
}

.modal-panel select,
.modal-panel input {
  min-height: 32px;
  padding: 7px 28px 7px 9px;
  font-size: 11px;
  font-weight: 760;
}

/* Product scaffold refinement: black shell, blue accents, minimal chrome. */
.modal {
  z-index: 500;
}

.app-menu summary {
  color: var(--electric-blue);
}

.app-menu summary:hover,
.app-menu[open] summary {
  color: #78b2ff;
}

.app-menu-body {
  gap: 4px;
  width: 252px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.62);
  padding: 10px;
}

.app-menu:not([open]) .app-menu-body {
  display: none;
}

.app-menu-account {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #d9e0ec;
  padding: 4px 4px 10px;
}

.app-menu-avatar {
  display: inline-block;
  width: 8px;
  height: 8px;
  justify-self: center;
  border-radius: 999px;
  background: #9ca4b1;
  box-shadow: 0 6px 0 #9ca4b1;
}

.app-menu-account strong,
.app-menu-account em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-account strong {
  font-size: 12px;
  font-weight: 650;
}

.app-menu-account em {
  color: #8b92a0;
  font-size: 10.5px;
  font-style: normal;
}

.app-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #c9ced8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.2;
  padding: 7px 4px;
  text-align: left;
}

.app-menu-row:hover,
.app-menu-row:focus-visible {
  color: #ffffff;
  background: rgba(57, 130, 249, 0.10);
  outline: 0;
}

.app-menu-row kbd,
.app-menu-row em {
  color: #8d96a5;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

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

.settings-panel {
  width: min(980px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: min(720px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0;
  border-color: rgba(255, 255, 255, 0.11);
  background: #000000;
  padding: 0;
  overflow: hidden;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #000000;
  padding: 16px 10px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.settings-nav strong {
  display: none;
}

.settings-nav-item {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #c5cbd6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 520;
  padding: 0 10px;
  text-align: left;
}

.settings-nav-item:hover,
.settings-nav-item.active {
  background: rgba(255, 255, 255, 0.035);
  color: #8bbcff;
}

.settings-content {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 44px 38px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.settings-content > *,
.settings-content * {
  max-width: 100%;
}

.settings-content h2,
.settings-content h3 {
  margin: 0;
  color: #f4f6fb;
  font-weight: 560;
}

.settings-content h2 {
  font-size: 18px;
  padding-bottom: 0;
}

.project-panel {
  width: min(920px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 48px));
  display: grid;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: #000000;
  border-color: rgba(255, 255, 255, 0.11);
  overflow: hidden;
  padding: 0;
}

.project-body {
  min-height: 0;
  overflow: auto;
  padding: 34px 48px 42px;
}

.project-form,
.project-knowledge,
.project-linked-chats {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0 0 22px;
}

.project-knowledge,
.project-linked-chats {
  padding-top: 22px;
}

.project-header {
  display: grid;
  gap: 5px;
  margin-bottom: 6px;
}

.project-header span {
  color: var(--electric-blue);
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-header h2 {
  margin: 0;
  color: #f4f6fb;
  font-size: 20px;
  font-weight: 620;
}

.project-header p,
.project-knowledge p,
.project-status {
  max-width: 720px;
  margin: 0;
  color: #969fac;
  font-size: 12px;
  line-height: 1.45;
}

.project-field {
  display: grid;
  gap: 7px;
}

.project-field span,
.project-knowledge-head strong,
.project-linked-chats > strong {
  color: #eef2f8;
  font-size: 12px;
  font-weight: 650;
}

.project-field input,
.project-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  color: #f3f6fb;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 0;
}

.project-field textarea {
  min-height: 84px;
  resize: vertical;
}

.project-field input:focus,
.project-field textarea:focus {
  border-color: rgba(57, 130, 249, 0.7);
  outline: none;
}

.project-actions,
.project-knowledge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-knowledge-head span {
  display: grid;
  gap: 2px;
}

.project-knowledge-head em,
.project-document-row em {
  color: #818997;
  font-size: 11px;
  font-style: normal;
}

.project-document-list {
  display: grid;
  gap: 4px;
}

.project-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 4px 0;
}

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

.project-document-row strong {
  overflow: hidden;
  color: #dfe5ef;
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-chat-link {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #c9d0dc;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.project-chat-link:hover,
.project-chat-link:focus-visible {
  background: rgba(255, 255, 255, 0.035);
  color: #ffffff;
}

.settings-intro {
  max-width: 720px;
  margin: 8px 0 22px;
  color: #979fac;
  font-size: 12px;
  line-height: 1.45;
}

.settings-hero-card,
.settings-form,
.settings-card,
.settings-plan-current {
  display: grid;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 0;
  background: transparent;
  padding: 14px 0 16px;
}

.settings-hero-card {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
}

.settings-avatar-large {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(57, 130, 249, 0.14);
  color: #d7e7ff;
  font-size: 12px;
  font-weight: 800;
}

.settings-hero-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-hero-card strong,
.settings-card strong,
.settings-plan-current strong {
  display: block;
  color: #f0f4fb;
  font-size: 13px;
  font-weight: 640;
}

.settings-hero-card > div span,
.settings-hero-card > div em,
.settings-card p,
.settings-card em,
.settings-plan-current p {
  margin: 0;
  color: #8f98a8;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.settings-form {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.settings-field {
  display: grid;
  gap: 6px;
  color: #aeb7c6;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-field input,
.settings-field select {
  min-height: 34px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #07090d;
  color: #edf3fb;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0;
  padding: 0 10px;
  text-transform: none;
}

.settings-checkbox {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  align-items: center;
  color: #b7bfce;
  font-size: 12px;
}

.settings-checkbox input {
  width: 14px;
  height: 14px;
}

.settings-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.settings-primary-button,
.settings-secondary-button {
  justify-self: start;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0;
  background: transparent;
  color: #eef6ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  padding: 0 2px 4px;
}

.settings-primary-button:hover,
.settings-secondary-button:hover {
  border-color: rgba(57, 130, 249, 0.78);
  background: transparent;
  color: #ffffff;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  column-gap: 30px;
  row-gap: 0;
  min-width: 0;
}

.settings-card.active,
.settings-plan-current {
  background: transparent;
}

.settings-card.active strong,
.settings-plan-current strong {
  color: #d9e9ff;
}

.settings-action-card {
  align-content: start;
}

.settings-action-card .settings-mini-button {
  justify-self: start;
}

.settings-pill {
  justify-self: start;
  color: #8bbcff;
  font-size: 10px;
  font-weight: 780;
  padding: 0;
  text-transform: uppercase;
}

.settings-block,
.settings-divider {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 18px 0;
}

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

.settings-block strong,
.settings-block span {
  display: block;
}

.settings-block strong {
  color: #dfe5ef;
  font-size: 13px;
  font-weight: 560;
}

.settings-block span,
.settings-divider p {
  margin: 0;
  color: #9299a7;
  font-size: 12px;
  line-height: 1.45;
}

.settings-block button,
.settings-divider button {
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid rgba(57, 130, 249, 0.42);
  border-radius: 0;
  background: transparent;
  color: #dfe7f5;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px 4px;
}

.settings-block button:hover,
.settings-divider button:hover {
  border-color: var(--electric-blue);
  color: #ffffff;
}

.workspace.left-open {
  --left-rail-width: var(--left-rail-open-width);
}

.composer-left-controls {
  justify-content: flex-start;
  padding-left: 4px;
}

.stream-footnote {
  max-width: 720px;
  margin: 8px auto 0;
  color: #737985;
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.04em;
  text-align: center;
}

.sidebar-section summary {
  color: var(--electric-blue);
  min-height: 22px;
  font-size: 10.5px;
  font-weight: 640;
}

.sidebar-section summary::before {
  border-left-color: var(--electric-blue);
}

.send-button {
  background: #f3f6fb;
  color: #050608;
}

.send-button:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.36);
}

.primary-action {
  margin-bottom: 4px;
}

.sidebar-body {
  gap: 8px;
}

.text-action {
  min-height: 31px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  font-size: 11px;
  font-weight: 620;
  padding: 0 10px;
}

.text-action::before {
  background: rgba(57, 130, 249, 0.24);
  color: var(--electric-blue);
}

.text-action:hover,
.text-action:focus-visible {
  background: rgba(255, 255, 255, 0.045);
}

.list-item {
  min-height: 28px;
  max-height: 28px;
  border-radius: 7px;
  background: transparent;
  color: #969ca8;
  font-size: 10.5px;
  font-weight: 590;
  padding: 0 4px 0 9px;
}

.list-item:hover,
.list-item.active {
  background: rgba(255, 255, 255, 0.028);
  color: #eef2f8;
}

.list-select {
  font-size: inherit;
  font-weight: inherit;
}

.chat-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: 4px;
}

.chat-icon-action {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #778296;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.list-item:hover .chat-icon-action,
.list-item.active .chat-icon-action,
.chat-icon-action:focus-visible {
  opacity: 1;
}

.chat-icon-action:hover,
.chat-icon-action:focus-visible {
  background: rgba(57, 130, 249, 0.10);
  color: #8bbcff;
  outline: 0;
}

.chat-icon-action.danger:hover,
.chat-icon-action.danger:focus-visible {
  background: rgba(255, 92, 122, 0.10);
  color: #ff8fa3;
}

.models-menu summary {
  padding-left: 8px;
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #dfe5ee;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.icon-button::before,
.icon-button::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.icon-button::before {
  transform: rotate(45deg);
}

.icon-button::after {
  transform: rotate(-45deg);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(57, 130, 249, 0.55);
  background: rgba(57, 130, 249, 0.12);
  color: #ffffff;
  outline: 0;
}

.app-menu-avatar {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  justify-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #dce7f6;
  box-shadow: none;
  font-size: 9px;
  font-weight: 800;
  overflow: hidden;
}

.app-menu-avatar.has-image,
.settings-avatar-large.has-image {
  background-position: center;
  background-size: cover;
  color: transparent;
}

.settings-hero-card {
  grid-template-columns: 46px minmax(0, 1fr);
}

.settings-avatar-large {
  width: 46px;
  height: 46px;
  overflow: hidden;
}

.avatar-upload-row {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2 / -1;
  gap: 8px;
  justify-content: flex-start;
}

.settings-ghost-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #9ba5b3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 620;
  padding: 0 8px;
}

.settings-ghost-button:hover,
.settings-ghost-button:focus-visible {
  color: #ffffff;
  outline: 0;
}

.settings-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: #8f98a8;
  font-size: 11px;
  line-height: 1.35;
}

.settings-status[data-tone="success"] {
  color: #94d7ac;
}

.settings-status[data-tone="error"] {
  color: #ff9aaa;
}

.settings-preferences-form,
.settings-privacy-form,
.settings-memory-form,
.settings-personalization-form {
  display: grid;
  gap: 18px;
}

.settings-personalization-form > .preference-section:first-child {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 12px;
}

.settings-personalization-form > .preference-section:first-child h3 {
  grid-column: 1 / -1;
}

.preference-section,
.settings-boundary-card {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 0 0 24px;
}

.settings-boundary-card {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background: transparent;
  padding: 16px 0;
}

.settings-boundary-card p {
  margin: 0;
  color: #9aa3b2;
  font-size: 12px;
  line-height: 1.45;
}

.settings-inline-value {
  justify-self: end;
  color: #8bbcff;
  font-size: 11px;
  font-weight: 720;
  text-align: right;
  text-transform: capitalize;
}

.settings-storage-meter {
  display: grid;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background: transparent;
  padding: 14px 0 18px;
}

.settings-storage-meter > div:first-child {
  display: grid;
  gap: 3px;
}

.settings-storage-meter strong {
  color: #f0f4fb;
  font-size: 15px;
  font-weight: 720;
}

.settings-storage-meter span {
  color: #8f98a8;
  font-size: 12px;
}

.settings-storage-bar {
  position: relative;
  overflow: hidden;
  height: 5px;
  background: rgba(255, 255, 255, 0.075);
}

.settings-storage-bar i {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--electric-blue);
}

.storage-card-grid .settings-card {
  min-height: 0;
}

.usage-window-grid .usage-window-card {
  min-height: 0;
}

.usage-window-card.danger {
  background: transparent;
}

.usage-recent-list {
  margin-top: 2px;
}

.usage-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 11px 14px;
  background: #030303;
}

.usage-recent-row + .usage-recent-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.usage-recent-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.usage-recent-row strong {
  overflow: hidden;
  color: #dce2ec;
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-recent-row em {
  overflow: hidden;
  color: #7f8999;
  font-size: 10.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-recent-row b {
  color: #8bbcff;
  font-size: 12px;
  font-weight: 720;
}

.settings-row-list {
  display: grid;
  gap: 1px;
  overflow: visible;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
}

.commercial-auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-width: 0;
  min-height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  padding: 13px 0;
  background: transparent;
}

.commercial-auth-row > div {
  min-width: 0;
}

.settings-inline-note {
  margin-top: 4px;
  padding: 12px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-inline-note strong {
  display: block;
  color: #eef3fb;
  font-size: 13px;
  font-weight: 620;
}

.settings-inline-note p {
  max-width: 820px;
  margin: 8px 0 0;
  color: rgba(224, 229, 238, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.commercial-auth-row strong {
  display: block;
  color: #dce2ec;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0;
}

.commercial-auth-row span {
  display: block;
  margin-top: 4px;
  color: rgba(224, 229, 238, 0.7);
  font-size: 12px;
  line-height: 1.35;
}

.commercial-auth-row em {
  display: block;
  margin-top: 5px;
  color: #7f8999;
  font-size: 11px;
  font-style: normal;
}

.commercial-auth-row b {
  justify-self: end;
  color: #8bbcff;
  font-size: 10.5px;
  font-weight: 720;
  text-align: right;
  text-transform: capitalize;
  white-space: nowrap;
}

.miscellaneous-list {
  gap: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin-top: 0;
}

.settings-catalog-row {
  grid-template-columns: minmax(0, 1fr) minmax(86px, max-content);
  min-height: 66px;
  align-items: start;
}

.settings-catalog-row b {
  max-width: 150px;
  color: #7caef5;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: normal;
}

.miscellaneous-list .settings-catalog-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  padding: 16px 0;
}

.settings-mini-button {
  max-width: 150px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0;
  background: transparent;
  color: #e5eaf2;
  font-size: 12px;
  font-weight: 700;
  padding: 0 2px 4px;
  white-space: nowrap;
}

.settings-mini-button:hover,
.settings-mini-button:focus-visible {
  border-color: rgba(57, 130, 249, 0.78);
  color: #fff;
  outline: 0;
}

.settings-mini-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 230px);
  gap: 24px;
  align-items: center;
  max-width: 100%;
}

.preference-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preference-row strong {
  color: #dce2ec;
  font-size: 14px;
  font-weight: 560;
}

.preference-row span {
  color: #8e96a5;
  font-size: 12px;
  line-height: 1.35;
}

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

.preference-choice {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 86px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background: transparent;
  appearance: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 10px 0 12px;
  text-align: center;
}

.preference-choice.active,
.preference-choice:hover {
  border-color: rgba(57, 130, 249, 0.5);
  background: transparent;
}

.preference-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preference-choice > * {
  pointer-events: none;
}

.preference-choice strong {
  color: #cfd7e4;
  font-size: 11px;
  font-weight: 560;
}

.preference-choice em {
  color: #6f7785;
  font-size: 10px;
  font-style: normal;
}

.theme-preview {
  display: grid;
  gap: 6px;
  width: 112px;
  height: 48px;
  border: 0;
  border-radius: 4px;
  background: #15171c;
  padding: 10px 18px;
}

.theme-preview[data-theme-preview="extra_dark"] {
  background: #020202;
}

.theme-preview i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.font-choice > span {
  display: grid;
  place-items: center;
  width: 112px;
  height: 48px;
  border: 0;
  border-radius: 0;
  color: #d5d7dc;
  font-size: 28px;
}

.font-choice:first-child > span {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.font-choice:last-child > span {
  font-family: Georgia, "Times New Roman", serif;
}

.settings-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  background: #080b10;
  color: #e6ebf4;
  font-size: 13px;
  font-weight: 520;
}

.settings-number-stepper {
  justify-self: end;
  width: 72px;
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: transparent;
  color: #e6ebf4;
  font-size: 13px;
  font-weight: 560;
  padding: 0 2px 0 8px;
}

.settings-number-stepper:focus {
  border-color: rgba(139, 188, 255, 0.74);
  outline: 0;
}

.settings-inline-note {
  display: grid;
  gap: 4px;
  max-width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  padding: 12px 0;
}

.settings-inline-note strong {
  color: #dce2ec;
  font-size: 13px;
  font-weight: 560;
}

.settings-inline-note span {
  color: #8e96a5;
  font-size: 12px;
  line-height: 1.4;
}

.settings-toggle {
  position: relative;
  display: inline-flex;
  justify-self: end;
  width: auto;
  overflow: hidden;
}

.settings-toggle input {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-track {
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 2px;
  transition: background 140ms ease;
}

.settings-toggle-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f3f7fb;
  transform: translateX(0);
  transition: transform 140ms ease;
}

.settings-toggle input:checked + .settings-toggle-track {
  background: rgba(100, 190, 205, 0.82);
}

.settings-toggle input:checked + .settings-toggle-track .settings-toggle-thumb {
  transform: translateX(16px);
}

.settings-personalization-form textarea {
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  background: #07090d;
  color: #eef3fb;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

:root[data-theme-mode="extra_dark"] .top-rail,
:root[data-theme-mode="extra_dark"] .workspace,
:root[data-theme-mode="extra_dark"] .chat-sidebar,
:root[data-theme-mode="extra_dark"] .session-sidebar,
:root[data-theme-mode="extra_dark"] .messages {
  background: #000;
}

:root[data-theme-mode="extra_dark"] .composer,
:root[data-theme-mode="extra_dark"] .app-menu-body,
:root[data-theme-mode="extra_dark"] .modal-panel,
:root[data-theme-mode="extra_dark"] .settings-panel,
:root[data-theme-mode="extra_dark"] .settings-nav {
  background: #010101;
}

:root[data-theme-mode="extra_dark"] .message,
:root[data-theme-mode="extra_dark"] .text-action,
:root[data-theme-mode="extra_dark"] .list-item:hover,
:root[data-theme-mode="extra_dark"] .list-item.active {
  background: #030303;
}

:root[data-theme-mode="extra_dark"] .settings-select,
:root[data-theme-mode="extra_dark"] .settings-field input,
:root[data-theme-mode="extra_dark"] .settings-field select,
:root[data-theme-mode="extra_dark"] .settings-personalization-form textarea,
:root[data-theme-mode="extra_dark"] .composer textarea {
  background: #000;
  border-color: rgba(255, 255, 255, 0.11);
}

:root[data-theme-mode="extra_dark"] .settings-card,
:root[data-theme-mode="extra_dark"] .settings-boundary-card,
:root[data-theme-mode="extra_dark"] .settings-inline-note,
:root[data-theme-mode="extra_dark"] .preference-section,
:root[data-theme-mode="extra_dark"] .app-menu-row:hover,
:root[data-theme-mode="extra_dark"] .app-menu-row:focus-visible,
:root[data-theme-mode="extra_dark"] .repair-review-column {
  background: #000;
}

:root[data-theme-mode="extra_dark"] .theme-preview,
:root[data-theme-mode="extra_dark"] .font-choice > span,
:root[data-theme-mode="extra_dark"] .repair-review-panel {
  background: #010101;
}

:root[data-answer-font="serif"] .message.assistant .message-text {
  font-family: Georgia, "Times New Roman", serif;
}

:root[data-answer-font="sans_serif"] .message.assistant .message-text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.repair-review-panel {
  width: min(900px, calc(100vw - 48px));
  background: #000;
  border-color: rgba(47, 134, 255, 0.32);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.repair-review-body {
  display: grid;
  gap: 18px;
}

.repair-review-header {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.repair-review-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.repair-review-header h2 {
  margin: 0;
  color: #f5f8ff;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: 0;
}

.repair-review-header p,
.repair-review-column p,
.repair-review-feedback span,
.repair-review-status {
  margin: 0;
  color: #9ba6b7;
  font-size: 12px;
  line-height: 1.55;
}

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

.repair-review-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 14px;
}

.repair-review-column strong,
.repair-review-feedback span {
  color: #e5ebf5;
  font-size: 12px;
  font-weight: 680;
}

.repair-review-column.repaired {
  border-top-color: rgba(84, 209, 138, 0.46);
}

.repair-review-feedback {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 14px;
}

.repair-review-feedback label {
  display: grid;
  gap: 10px;
}

.repair-review-feedback textarea {
  min-height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #05070b;
  color: #eef3fb;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.repair-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.repair-review-status[data-tone="error"] {
  color: var(--red);
}

.repair-review-status[data-tone="success"] {
  color: var(--green);
}

@media (max-width: 760px) {
  .settings-panel {
    grid-template-columns: 1fr;
    height: min(680px, calc(100vh - 32px));
  }

  .settings-nav {
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .settings-content {
    padding: 22px;
  }

  .settings-form,
  .settings-card-grid,
  .settings-personalization-form > .preference-section:first-child {
    grid-template-columns: 1fr;
  }

  .settings-hero-card,
  .preference-row {
    grid-template-columns: 1fr;
  }

  .avatar-upload-row,
  .settings-toggle {
    justify-self: start;
  }
}
