:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --line: #dce2e6;
  --text: #172026;
  --muted: #65737e;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #b42318;
  --bubble-user: #e8f0ff;
  --bubble-assistant: #ffffff;
  --sidebar: #eef2f3;
  --field: #ffffff;
  --subtle: #f7f9fc;
  --subtle-hover: #edf3ff;
  --limits-border: #c8d8f5;
  --limits-bg: #f5f8ff;
  --limits-text: #31558f;
  --danger-border: #f1b4ae;
  --danger-bg: #fff4f2;
  --danger-hover: #fee4e1;
  --icon-bg: #dde5e7;
  --link: #1d5fd1;
  --quote-border: #a9c1ea;
  --quote-text: #40516e;
  --code-bg: #eef2f3;
  --code-block: #f5f7f8;
  --table-border: #cfd9dd;
  --table-head: #edf3ff;
  --table-head-text: #264b85;
  --table-alt: #f8faf9;
  --user-border: #b9cdf2;
  --approval-bg: #fffaf0;
  --approval-card: #fffdf7;
  --approval-border: #efd59a;
  --chip-close: #dce7fa;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111719;
  --panel: #1a2225;
  --line: #354247;
  --text: #e6edef;
  --muted: #9aa9af;
  --accent: #2563eb;
  --accent-dark: #3b82f6;
  --danger: #ff958d;
  --bubble-user: #172f59;
  --bubble-assistant: #1b2427;
  --sidebar: #151d20;
  --field: #202a2e;
  --subtle: #202a2e;
  --subtle-hover: #29364a;
  --limits-border: #34568f;
  --limits-bg: #192740;
  --limits-text: #b6cff8;
  --danger-border: #74433f;
  --danger-bg: #382422;
  --danger-hover: #4a2b28;
  --icon-bg: #263236;
  --link: #7db0ff;
  --quote-border: #5578b4;
  --quote-text: #becbe0;
  --code-bg: #273136;
  --code-block: #12191c;
  --table-border: #3b494e;
  --table-head: #21385f;
  --table-head-text: #d3e2fb;
  --table-alt: #202a2d;
  --user-border: #3867ad;
  --approval-bg: #292619;
  --approval-card: #25241d;
  --approval-border: #6b5d35;
  --chip-close: #2d4266;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  min-height: 0;
  overflow: hidden;
}

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

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.brand-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.primary,
.danger,
.icon-button,
.attach-button,
.stop-button {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 14px;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-dark);
}

.danger {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.secondary {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: var(--subtle);
  color: var(--text);
}

.attach-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--subtle);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.stop-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.stop-button:hover {
  background: var(--danger-hover);
}

.stop-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.attach-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--icon-bg);
  color: var(--text);
}

.mobile-menu-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: var(--field);
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.mobile-menu-button span + span {
  margin-top: 5px;
}

.limits-panel {
  border: 1px solid var(--limits-border);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--limits-bg);
  color: var(--limits-text);
  font-size: 12px;
  line-height: 1.35;
}

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

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: stretch;
}

.conversation {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-row:hover .conversation,
.conversation-row.active .conversation,
.conversation:hover {
  border-color: var(--line);
  background: var(--panel);
}

.conversation strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.conversation-heading strong {
  min-width: 0;
  flex: 1;
}

.conversation-type,
.workspace-type {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.35;
}

.conversation-type.general,
.workspace-type.general,
.conversation-type.project,
.workspace-type.project {
  background: var(--code-bg);
}

.conversation-type.project,
.workspace-type.project {
  border-color: var(--limits-border);
  color: var(--limits-text);
}

.conversation span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.login-panel,
.empty-state,
.chat-panel {
  height: 100%;
  min-height: 0;
}

.login-panel,
.empty-state {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-box h1,
.empty-state h1 {
  margin: 0;
  font-size: 22px;
}

.login-box input,
.title-input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
}

.login-box input,
.title-input {
  height: 40px;
  padding: 0 11px;
}

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

.chat-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.chat-settings {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.model-setting,
.reasoning-setting,
.fast-mode-setting {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.model-setting select,
.reasoning-setting select {
  height: 38px;
  max-width: 160px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 28px 0 9px;
  background: var(--field);
  color: var(--text);
}

.model-setting select {
  max-width: 180px;
}

.fast-mode-setting {
  min-height: 38px;
  cursor: pointer;
}

.fast-mode-setting input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--icon-bg);
  transition: background 120ms ease, border-color 120ms ease;
}

.toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 120ms ease, background 120ms ease;
}

.fast-mode-setting input:checked + .toggle-track {
  border-color: var(--accent);
  background: var(--accent);
}

.fast-mode-setting input:checked + .toggle-track span {
  transform: translateX(14px);
  background: #ffffff;
}

.fast-mode-setting input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fast-mode-setting:has(input:disabled),
.model-setting:has(select:disabled),
.reasoning-setting:has(select:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.workspace-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--subtle);
  overflow-x: auto;
}

@media (min-width: 761px) and (max-width: 1150px) {
  .chat-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-settings {
    justify-content: flex-start;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .model-setting,
  .reasoning-setting {
    flex: 1 1 0;
    min-width: 0;
  }

  .model-setting > span,
  .reasoning-setting > span,
  .fast-mode-setting > span:last-child {
    display: none;
  }

  .model-setting select,
  .reasoning-setting select {
    width: 100%;
    max-width: none;
  }

  #deleteButton {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  #deleteButton::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
  }
}

.workspace-type {
  padding: 4px 9px;
  font-size: 10px;
  white-space: nowrap;
}

.workspace-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.workspace-value small,
.workspace-note {
  color: var(--muted);
  font-size: 11px;
}

.workspace-value code {
  display: block;
  max-width: min(34vw, 430px);
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
}

.workspace-value .copy-button {
  width: 24px;
  height: 24px;
}

.workspace-dirty {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--approval-bg);
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.handoff-button {
  flex: 0 0 auto;
  min-height: 30px;
  margin-left: auto;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.handoff-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.handoff-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(8 14 16 / 0.72);
}

.new-chat-modal {
  width: min(680px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.28);
}

.new-chat-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.new-chat-modal h2,
.new-chat-modal p {
  margin: 0;
}

.new-chat-modal h2 {
  font-size: 22px;
}

.new-chat-modal-header p {
  margin-top: 4px;
  color: var(--muted);
}

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

.chat-type-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--subtle);
  color: var(--text);
  text-align: left;
}

.chat-type-card:hover,
.chat-type-card:focus-visible {
  border-color: var(--accent);
  background: var(--subtle-hover);
  outline: none;
}

.chat-type-card:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat-type-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--icon-bg);
  color: var(--text);
  font-size: 22px;
}

.chat-type-card.project .chat-type-icon {
  background: var(--code-bg);
  color: var(--link);
}

.chat-type-card strong,
.chat-type-card small {
  display: block;
}

.chat-type-card strong {
  margin-bottom: 3px;
  font-size: 16px;
}

.chat-type-card small {
  color: var(--muted);
  line-height: 1.4;
}

.new-chat-modal > .error {
  margin-top: 12px;
}

.workspace-project-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.workspace-project-form label,
.new-workspace-fields {
  display: grid;
  gap: 5px;
}

.workspace-project-form label > span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-project-form input,
.workspace-project-form select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--field);
  color: var(--text);
}

.new-workspace-fields {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.workspace-project-form > .primary {
  grid-column: 2;
  grid-row: 1;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.load-older-messages {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 8px 14px;
  cursor: pointer;
}

.load-older-messages:hover {
  color: var(--text);
  border-color: var(--accent);
}

.message {
  display: grid;
  gap: 5px;
  max-width: 850px;
}

.message.user {
  align-self: end;
}

.message.assistant {
  align-self: start;
}

.message .meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.message .meta span {
  min-width: 0;
}

.copy-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.copy-button:hover,
.copy-button.copied {
  border-color: var(--line);
  background: var(--subtle-hover);
  color: var(--text);
}

.message .bubble {
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: var(--bubble-assistant);
}

.message-content {
  min-width: 0;
  white-space: normal;
}

.message-content > :first-child {
  margin-top: 0;
}

.message-content > :last-child {
  margin-bottom: 0;
}

.message-content p,
.message-content ul,
.message-content ol,
.message-content blockquote,
.message-content pre {
  margin: 0 0 10px;
}

.message-content ul,
.message-content ol {
  padding-left: 22px;
}

.message-content li + li {
  margin-top: 4px;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 14px 0 7px;
  letter-spacing: 0;
  line-height: 1.3;
}

.message-content h1 {
  font-size: 20px;
}

.message-content h2 {
  font-size: 18px;
}

.message-content h3 {
  font-size: 16px;
}

.message-content h4,
.message-content h5,
.message-content h6 {
  font-size: 15px;
}

.message-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-content blockquote {
  border-left: 3px solid var(--quote-border);
  padding: 3px 0 3px 11px;
  color: var(--quote-text);
}

.message-content code {
  border-radius: 4px;
  padding: 2px 5px;
  background: var(--code-bg);
  font: 0.9em/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.message-content pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  padding: 10px 11px;
  background: var(--code-block);
  white-space: pre;
}

.message-content pre code {
  padding: 0;
  background: transparent;
  font-size: 13px;
}

.message-content hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--line);
}

.message-content input[type="checkbox"] {
  margin: 0 6px 0 0;
  accent-color: var(--accent);
  pointer-events: none;
}

.message-table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  background: var(--field);
}

.message-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  white-space: normal;
  font-size: 14px;
  line-height: 1.4;
}

.message-table th,
.message-table td {
  min-width: 110px;
  max-width: 360px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
}

.message-table th {
  background: var(--table-head);
  color: var(--table-head-text);
  font-weight: 650;
}

.message-table th:last-child,
.message-table td:last-child {
  border-right: 0;
}

.message-table tbody tr:last-child td {
  border-bottom: 0;
}

.message-table tbody tr:nth-child(even) {
  background: var(--table-alt);
}

.agent-trace {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin-top: 10px;
}

.trace-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: var(--subtle);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.trace-toggle:hover,
.trace-toggle.open {
  background: var(--subtle-hover);
  color: var(--text);
}

.trace-toggle.open {
  transform: rotate(180deg);
}

.trace-panel {
  display: grid;
  gap: 8px;
  justify-self: stretch;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--quote-text);
  font-size: 13px;
  line-height: 1.45;
}

.trace-entry {
  border-left: 2px solid var(--limits-border);
  padding-left: 9px;
}

.message-attachments {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.message-attachment {
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--table-border);
  border-radius: 7px;
  padding: 7px 9px;
  background: var(--subtle);
  color: var(--text);
  text-decoration: none;
  white-space: normal;
}

.message.user .bubble {
  border-color: var(--user-border);
  background: var(--bubble-user);
}

.message.pending .bubble {
  color: var(--muted);
}

.approval-panel {
  display: grid;
  gap: 10px;
  max-height: 34vh;
  overflow: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--approval-bg);
}

.approval-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--approval-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--approval-card);
}

.approval-card pre {
  max-width: min(760px, 60vw);
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.user-input-request {
  display: grid;
  gap: 12px;
}

.user-input-request label {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-input-request input,
.user-input-request select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.mcp-elicitation-request p {
  margin: 8px 0;
  color: var(--text);
  white-space: pre-wrap;
}

.mcp-elicitation-request small {
  color: var(--muted);
}

.elicitation-link {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-weight: 700;
}

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

.composer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.composer.is-pending {
  grid-template-columns: 1fr auto auto auto;
}

.attachment-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 7px;
  border: 1px solid var(--limits-border);
  border-radius: 999px;
  padding: 5px 8px 5px 10px;
  background: var(--limits-bg);
  color: var(--limits-text);
  font-size: 12px;
}

.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--chip-close);
  color: var(--text);
}

.composer textarea {
  min-height: 74px;
  max-height: 220px;
  resize: vertical;
  padding: 10px 11px;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.hidden {
  display: none;
}

.landing-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
  background: #f7f4ef;
  color: #151f24;
  font-size: 16px;
}

.landing-page a {
  color: inherit;
  text-decoration: none;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(21, 31, 36, 0.1);
  background: rgba(247, 244, 239, 0.9);
  backdrop-filter: blur(16px);
}

.landing-logo,
.landing-nav,
.landing-actions,
.landing-metrics,
.landing-result {
  display: flex;
  align-items: center;
}

.landing-logo {
  gap: 10px;
  font-weight: 750;
}

.landing-logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
}

.landing-nav {
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  color: #43525a;
  font-size: 14px;
}

.landing-nav a:hover {
  color: #151f24;
}

.landing-login,
.landing-primary,
.landing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 650;
}

.landing-login,
.landing-secondary {
  border: 1px solid rgba(21, 31, 36, 0.14);
  background: rgba(255, 255, 255, 0.76);
}

.landing-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
}

.landing-secondary {
  color: #1d2c33;
}

.landing-hero {
  position: relative;
  min-height: calc(100svh - 132px);
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(44px, 8vw, 92px) clamp(18px, 4vw, 56px);
}

.landing-hero-image,
.landing-hero-overlay {
  position: absolute;
  inset: 0;
}

.landing-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-hero-overlay {
  background:
    linear-gradient(90deg, rgba(247, 244, 239, 0.96) 0%, rgba(247, 244, 239, 0.86) 30%, rgba(247, 244, 239, 0.2) 66%),
    linear-gradient(180deg, rgba(247, 244, 239, 0) 70%, #f7f4ef 100%);
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: min(660px, 100%);
}

.landing-eyebrow {
  margin: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-hero h1,
.landing-section h2 {
  margin: 0;
  color: #10191e;
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-hero h1 {
  max-width: 10ch;
  font-size: clamp(52px, 8vw, 112px);
}

.landing-lead {
  max-width: 640px;
  margin: 0;
  color: #324149;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.42;
}

.landing-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.landing-metrics {
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
}

.landing-metrics div {
  min-width: 150px;
  border: 1px solid rgba(21, 31, 36, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.landing-metrics dt {
  color: #10191e;
  font-size: 24px;
  font-weight: 780;
}

.landing-metrics dd {
  margin: 2px 0 0;
  color: #5c6a70;
  font-size: 13px;
}

.landing-section {
  padding: clamp(54px, 8vw, 96px) clamp(18px, 4vw, 56px);
}

.landing-section-heading {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-bottom: 28px;
}

.landing-section h2 {
  font-size: clamp(34px, 4vw, 58px);
}

.workflow-grid,
.feature-grid {
  display: grid;
  gap: 14px;
}

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

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

.workflow-grid article,
.feature-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 190px;
  border: 1px solid rgba(21, 31, 36, 0.1);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
}

.workflow-grid span {
  color: #c57d2c;
  font-size: 13px;
  font-weight: 800;
}

.workflow-grid h3,
.feature-grid h3 {
  margin: 0;
  color: #10191e;
  font-size: 20px;
  line-height: 1.18;
}

.workflow-grid p,
.feature-grid p,
.landing-result p {
  margin: 0;
  color: #536269;
}

.landing-band {
  background: #eaf0ed;
}

.landing-result {
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid rgba(21, 31, 36, 0.1);
  background: #151f24;
  color: #ffffff;
}

.landing-result > div {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.landing-result h2 {
  color: #ffffff;
}

.landing-result p {
  max-width: 680px;
  color: #cad3d4;
  font-size: 18px;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    gap: 10px;
    min-height: auto;
    max-height: none;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .mobile-menu-button {
    display: block;
  }

  .mobile-menu-button.hidden {
    display: none;
  }

  .sidebar .limits-panel,
  .sidebar .primary,
  .sidebar .conversation-list {
    display: none;
  }

  body.mobile-menu-open .sidebar .limits-panel {
    display: block;
  }

  .sidebar .limits-panel.hidden {
    display: none;
  }

  body.mobile-menu-open .sidebar .primary,
  body.mobile-menu-open .sidebar .conversation-list {
    display: flex;
  }

  body.mobile-menu-open .sidebar .primary {
    align-items: center;
    justify-content: center;
  }

  .conversation-list {
    max-height: 180px;
  }

  .chat-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .chat-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .model-setting > span,
  .reasoning-setting > span {
    display: none;
  }

  .model-setting select,
  .reasoning-setting select {
    width: 100%;
    max-width: none;
  }

  .fast-mode-setting {
    padding: 0 4px;
  }

  .fast-mode-setting > span:last-child {
    display: none;
  }

  #deleteButton {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  #deleteButton::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
  }

  .workspace-project-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .new-workspace-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-project-form > .primary {
    grid-column: 1;
    grid-row: auto;
  }

  .workspace-bar {
    gap: 8px;
    padding: 7px 10px;
  }

  .workspace-value code {
    max-width: 180px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .new-chat-modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .login-panel,
  .empty-state,
  .chat-panel {
    height: 100%;
    min-height: 0;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .composer.is-pending {
    grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
  }

  .attachment-list {
    grid-column: 1 / -1;
  }

  .composer textarea {
    grid-column: 1;
    min-height: 54px;
    max-height: 150px;
    padding: 9px 10px;
  }

  .attach-button,
  #stopButton,
  #sendButton {
    width: 42px;
    min-width: 42px;
    height: auto;
    min-height: 54px;
    padding: 0;
    justify-self: end;
    align-self: stretch;
  }

  .attach-button {
    grid-column: 2;
  }

  #stopButton {
    grid-column: 3;
    font-size: 15px;
  }

  #sendButton {
    grid-column: 3;
    font-size: 0;
  }

  .composer.is-pending #sendButton {
    grid-column: 4;
  }

  .attach-button .button-label,
  #sendButton .button-label {
    font-size: 0;
  }

  .attach-button .button-label::before {
    content: "+";
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
  }

  #sendButton::before {
    content: "↑";
    font-size: 25px;
    line-height: 1;
  }

  .approval-card {
    grid-template-columns: 1fr;
  }

  .approval-card pre {
    max-width: 100%;
  }

  .landing-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 64px;
    padding: 0 16px;
  }

  .landing-nav {
    display: none;
  }

  .landing-login {
    min-height: 38px;
    padding: 0 12px;
  }

  .landing-hero {
    min-height: calc(100svh - 120px);
    padding: 46px 16px 58px;
  }

  .landing-hero-overlay {
    background:
      linear-gradient(180deg, rgba(247, 244, 239, 0.98) 0%, rgba(247, 244, 239, 0.9) 54%, rgba(247, 244, 239, 0.32) 100%),
      linear-gradient(90deg, rgba(247, 244, 239, 0.94), rgba(247, 244, 239, 0.22));
  }

  .landing-hero-content {
    gap: 18px;
  }

  .landing-hero h1 {
    font-size: clamp(48px, 18vw, 74px);
  }

  .landing-actions,
  .landing-primary,
  .landing-secondary {
    width: 100%;
  }

  .landing-metrics div {
    width: 100%;
  }

  .workflow-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid article,
  .feature-grid article {
    min-height: 0;
  }

  .landing-result {
    display: grid;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .workflow-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Project workspace shell, October 2026. Existing conversation renderers remain intact. */
:root { --sidebar:#f3f6fc; }
.shell { grid-template-columns:260px minmax(0,1fr) 280px; }
.sidebar { padding:20px 14px; gap:16px; }
.brand-copy strong { font-size:16px; }
.brand-actions { gap:3px; }
.project-picker label,.project-dialog-label { color:var(--muted);font-size:11px;font-weight:650;letter-spacing:.04em; }
.project-picker select { width:100%;max-width:100%;background:var(--field);color:var(--text);border:1px solid var(--line);border-radius:11px;padding:13px 9px;margin-top:7px;font-weight:650; }
.project-add { background:transparent;border:0;color:var(--accent);padding:10px 2px;text-align:left;font-size:12px; }
.project-dialog-label { padding:0 8px; }
.project-context { min-width:0;border-left:1px solid var(--line);background:var(--panel);padding:24px 20px;overflow:auto; }
.context-heading { display:flex;justify-content:space-between;align-items:center;font-size:12px; }
#closeContext { display:none; }
.project-context h2 { font-size:20px;overflow-wrap:anywhere;margin:24px 0 7px; }
#contextDescription { color:var(--muted);font-size:12px;line-height:1.7;overflow-wrap:anywhere; }
.context-tabs { display:flex;gap:16px;border-bottom:1px solid var(--line);margin:24px 0 14px; }
.context-tabs button { border:0;background:none;padding:8px 0;color:var(--muted);border-bottom:2px solid transparent; }
.context-tabs button.active { border-color:var(--accent);color:var(--accent); }
#contextList { font-size:12px;color:var(--muted);overflow-wrap:anywhere; }
.context-document { display:block;width:100%;background:transparent;border:0;border-bottom:1px solid var(--line);color:var(--text);text-align:left;padding:13px 0; }
.context-document strong,.context-document small { display:block;overflow-wrap:anywhere; }
.context-document small { font-size:10px;color:var(--muted);margin-top:4px; }
.context-note { padding:14px;border:1px solid var(--limits-border);background:var(--limits-bg);color:var(--limits-text);border-radius:10px;font-size:11px;line-height:1.7;margin-top:24px; }
.context-toggle { display:none; }
.document-modal { width:min(850px,100%); }
.document-modal .markdown { font-size:14px;line-height:1.7;overflow-wrap:anywhere; }
.document-modal pre { overflow:auto;max-width:100%; }
.document-modal table { display:block;overflow:auto; }
.new-workspace-fields textarea { min-height:90px;resize:vertical; }
.delivery-status { grid-column:1/-1;color:var(--muted);font-size:11px;margin:0; }
.delivery-status:empty { display:none; }
.chat,.chat-panel { min-width:0; }
@media(max-width:1200px) {
 .shell { grid-template-columns:250px minmax(0,1fr); }
 .project-context { display:none; }
 .project-context.visible { display:block;position:fixed;inset:0 0 0 auto;width:min(330px,100vw);z-index:15;box-shadow:-20px 0 60px #14243c33; }
 #closeContext,.context-toggle { display:block; }
 .context-toggle { border:1px solid var(--line);border-radius:8px;padding:7px 10px;background:var(--panel);color:var(--text); }
}
@media(max-width:760px) {
 .shell { grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr); }
 .sidebar { padding:10px 12px;gap:8px;position:relative; }
 .brand { padding-right:92px; }
 .brand-copy strong { font-size:14px; }
 .brand-copy span { font-size:10px; }
 .brand-actions { gap:2px; }
 .brand-actions .icon-button { width:30px;min-width:30px;padding:4px; }
 .context-toggle { position:absolute;top:14px;right:10px;min-height:34px;font-size:11px; }
 .sidebar .project-picker,.sidebar .project-dialog-label { display:none; }
 body.mobile-menu-open .sidebar .project-picker,body.mobile-menu-open .sidebar .project-dialog-label { display:block; }
 body.mobile-menu-open .sidebar { max-height:75dvh;overflow:auto; }
 .conversation-list { max-height:28dvh;flex-shrink:0; }
 .chat-header { padding:9px; }
 .chat-settings { gap:6px; }
 .project-context.visible { width:min(330px,100vw); }
 .composer { grid-template-columns:minmax(0,1fr) 38px 38px;gap:5px;padding:8px; }
 .composer.is-pending { grid-template-columns:minmax(0,1fr) 38px 38px 38px; }
 .attach-button,#stopButton,#sendButton { width:38px;min-width:38px; }
 .composer textarea { min-width:0; }
}
.workspace-project-form textarea { width:100%;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:var(--field);color:var(--text); }
.message-delivery { margin-left:8px;font-size:10px;color:var(--muted); }
.workspace-project-form { grid-template-columns:minmax(0,1fr); }
.new-workspace-fields { grid-template-columns:minmax(0,1fr); }
.workspace-project-form > .primary { grid-column:1;grid-row:auto; }
