:root {
  --bg: #f7f7f4;
  --page: #ffffff;
  --page-soft: #f2f1ed;
  --line: rgba(42, 39, 33, 0.12);
  --line-soft: rgba(42, 39, 33, 0.08);
  --text: #27241f;
  --muted: #716d64;
  --muted-2: #9a958b;
  --blue: #3d6f8f;
  --blue-soft: #e9f1f2;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #b7782c;
  --purple: #8067a8;
  --notebook-sidebar: #f6f5f1;
  --notebook-panel: #fbfbf8;
  --notebook-ink: #2d2a24;
  --notebook-soft: #efede7;
  --notebook-hover: #eceae4;
  --notebook-shadow: 0 20px 48px rgba(38, 34, 26, 0.10);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="glass"] {
  --page-soft: rgba(247, 249, 252, 0.84);
  --line: rgba(195, 207, 222, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: var(--blue);
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.22);
  border-radius: 999px;
}

.login-screen {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: clamp(44px, 8vw, 124px);
  padding: clamp(28px, 7vw, 92px);
}

.login-brand {
  max-width: 650px;
  justify-self: center;
}

.brand-orb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff, #eaf4ff);
  color: var(--blue);
  font-size: 31px;
  font-weight: 860;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 24px 60px rgba(0, 122, 255, 0.12);
}

.login-brand h1 {
  margin: 26px 0 14px;
  font-size: clamp(58px, 8vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.078em;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.62;
}

.login-pills {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-pills span,
.chip,
.quick-row button,
.theme-buttons button,
.ghost-action {
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #4b627c;
}

.login-card {
  width: min(100%, 470px);
  padding: 8px 0;
  background: transparent;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: -0.055em;
}

.muted,
.login-card .muted {
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.login-card input:not([type="checkbox"]) {
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: rgba(235, 241, 249, 0.78);
  color: var(--text);
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(208, 218, 231, 0.72);
}

.setting-row input,
.setting-row select {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.login-card input:focus,
.search-box input:focus,
.setting-row input:focus,
.setting-row select:focus,
textarea:focus {
  box-shadow: 0 3px 0 -1px rgba(0, 122, 255, 0.42);
}

.primary,
.new-session-btn,
.send-btn {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1687ff, var(--blue));
  color: #fff;
  font-weight: 760;
  box-shadow: 0 16px 34px rgba(0, 122, 255, 0.18);
}

.login-card .primary {
  width: 100%;
  min-height: 56px;
  margin-top: 26px;
  font-size: 17px;
}

.login-foot {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.check-row {
  margin: 0 !important;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
}

.error-note,
.composer-error,
.notice-line {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 18px;
  background: rgba(255, 241, 240, 0.86);
  color: #b42318;
}

.notice-line {
  margin: 0 clamp(16px, 4vw, 56px);
  background: rgba(231, 241, 255, 0.88);
  color: #175cd3;
}

.session-tools {
  margin: 0 clamp(16px, 4vw, 56px) 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  animation: itemIn 220ms ease both;
}

.workspace-inspector {
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.workspace-inspector > header,
.workspace-file-preview > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-inspector > header > div,
.workspace-file-preview > header > div {
  min-width: 0;
  flex: 1;
}

.workspace-inspector strong,
.workspace-file-preview strong {
  display: block;
  font-size: 14px;
}

.workspace-inspector small,
.workspace-file-preview small,
.workspace-muted {
  color: var(--muted);
  font-size: 12px;
}

.workspace-error {
  color: var(--red);
  font-size: 12px;
  font-weight: 720;
}

.workspace-status-line,
.workspace-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-status-line span,
.workspace-counts span {
  min-height: 26px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(238, 244, 251, 0.72);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.workspace-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
}

.workspace-files,
.workspace-diff,
.workspace-file-preview pre {
  min-height: 0;
  overflow: auto;
}

.workspace-files {
  max-height: 180px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.workspace-files button {
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  background: rgba(242, 245, 249, 0.72);
  color: var(--text);
  text-align: left;
}

.workspace-files button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.workspace-files button em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.workspace-diff {
  max-height: 220px;
  border-radius: 12px;
  background: rgba(246, 248, 250, 0.72);
}

.workspace-diff-file {
  min-width: 0;
  padding: 10px;
}

.workspace-diff-file + .workspace-diff-file {
  border-top: 1px solid var(--line-soft);
}

.workspace-diff pre,
.workspace-file-preview pre {
  max-width: 100%;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.06);
  color: #172033;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.workspace-file-preview {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.artifact-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.artifact-panel > header,
.artifact-content > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.artifact-panel strong,
.artifact-content strong {
  display: block;
  font-size: 14px;
}

.artifact-panel small,
.artifact-content small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.artifact-panel-inline {
  padding: 10px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.035);
}

.artifact-panel-page {
  min-height: calc(100dvh - 128px);
}

.artifact-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(170px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
}

.artifact-layout.wide {
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
}

.artifact-list {
  min-width: 0;
  max-height: 260px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
}

.artifact-layout.wide .artifact-list {
  max-height: calc(100dvh - 190px);
}

.artifact-item {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.artifact-item.active {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(236, 244, 255, 0.82);
}

.artifact-main {
  min-width: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  color: var(--text);
  text-align: left;
}

.artifact-kind {
  grid-row: span 2;
  width: 38px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(23, 32, 51, 0.08);
  color: #344054;
  font-size: 10px;
  font-weight: 820;
}

.artifact-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 760;
}

.artifact-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.artifact-actions,
.artifact-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.artifact-actions {
  padding-right: 6px;
}

.artifact-preview {
  min-width: 0;
  overflow: auto;
  border-radius: 12px;
  background: rgba(246, 248, 250, 0.72);
}

.artifact-content {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.artifact-content pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.06);
  color: #172033;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.artifact-image {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.artifact-loading {
  display: grid;
  gap: 8px;
}

.artifact-loading span {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.36), rgba(148, 163, 184, 0.18));
}

.workspace-terminal {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.workspace-terminal > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.terminal-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 8px;
  align-items: center;
}

.terminal-form input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.terminal-actions .mini-btn {
  gap: 6px;
}

.terminal-output {
  max-height: 220px;
  min-height: 120px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 10px;
  background: #101828;
  color: #e4edf7;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.tool-head div,
.tool-head span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tool-head strong {
  font-size: 16px;
}

.tool-head small,
.tool-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.compact-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.compact-field span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 760;
}

.compact-field select,
.compact-field input {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  outline: none;
}

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

.tool-actions button,
.command-grid button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(238, 244, 251, 0.86);
  color: #344054;
  font-weight: 700;
}

.context-package-mini {
  width: auto;
  min-width: 84px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

#save-session-settings {
  background: var(--blue);
  color: #fff;
}

.desktop-shell {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: linear-gradient(90deg, rgba(246, 249, 253, 0.94), rgba(255, 255, 255, 0.98) 38%, #fff 100%);
}

.session-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(246, 249, 253, 0.82), rgba(238, 244, 251, 0.74));
  backdrop-filter: blur(22px);
}

.workspace-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sessions-head {
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px 16px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.title-row h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.07em;
}

.title-row p,
.settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.icon-btn,
.mini-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
}

.search-box {
  min-height: 46px;
  margin-top: 20px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: rgba(231, 238, 247, 0.72);
  color: #8aa0ba;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.view-tabs,
.filter-row {
  margin-top: 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.view-tabs button,
.filter-row button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.view-tabs button.active,
.chip.active {
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue);
}

.new-session-btn {
  width: 100%;
  margin-top: 14px;
}

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

.session-card {
  position: relative;
  min-width: 0;
  min-height: 100px;
  padding: 15px 8px 15px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 20px;
  background: transparent;
  animation: itemIn 340ms cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.session-card::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.session-card:hover {
  background: rgba(255, 255, 255, 0.48);
}

.session-card.active {
  background: linear-gradient(90deg, rgba(0, 122, 255, 0.10), rgba(255, 255, 255, 0.48) 62%, transparent);
}

.session-card.active::before {
  background: var(--blue);
}

.session-card.skeleton {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.36);
}

.session-card.skeleton span,
.loading-lines span {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5ebf3, #f7f9fc, #e5ebf3);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.session-card.skeleton span:nth-child(1),
.loading-lines span:nth-child(1) {
  width: 62%;
}

.session-card.skeleton span:nth-child(2),
.loading-lines span:nth-child(2) {
  width: 86%;
}

.session-card.skeleton span:nth-child(3),
.loading-lines span:nth-child(3) {
  width: 42%;
}

.session-main {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  text-align: left;
  background: transparent;
}

.session-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-summary {
  color: #6b7c93;
  font-size: 14px;
  line-height: 1.46;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.session-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8aa0ba;
  font-size: 12px;
}

.session-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 7px;
}

.session-card .mini-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  color: #71839a;
}

.session-card.active .mini-btn,
.session-card:hover .mini-btn {
  background: rgba(255, 255, 255, 0.72);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 740;
}

.status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  animation: pulse 1.2s infinite;
}

.status-badge.blue {
  background: #eaf4ff;
  color: var(--blue);
}

.status-badge.green {
  background: #eafaf0;
  color: #1f9d55;
}

.status-badge.red {
  background: #fff1f0;
  color: var(--red);
}

.status-badge.purple {
  background: #f6edff;
  color: var(--purple);
}

.status-badge.gray {
  background: #f1f5f9;
  color: #64748b;
}

.chat-pane,
.settings-page,
.reports-page,
.admin-page,
.capabilities-page {
  height: 100dvh;
  min-width: 0;
  background:
    radial-gradient(circle at 78% 4%, rgba(0, 122, 255, 0.04), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

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

.chat-head {
  min-height: 74px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 24px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
}

.chat-title {
  min-width: 0;
  flex: 1;
}

.chat-title h2 {
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.messages,
.timeline {
  min-height: 0;
  padding: clamp(22px, 4vw, 44px) clamp(20px, 5vw, 74px) 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: auto;
}

.message,
.work-card {
  max-width: min(880px, 86%);
  animation: itemIn 300ms cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.message.assistant {
  align-self: flex-start;
  padding: 8px 0;
}

.message.user {
  align-self: flex-end;
  max-width: min(680px, 70%);
  padding: 14px 16px;
  border-radius: 24px 24px 8px 24px;
  background: linear-gradient(180deg, #e5f1ff, #d8ebff);
  box-shadow: 0 10px 28px rgba(0, 122, 255, 0.09);
}

.message.error,
.work-card {
  align-self: flex-start;
  padding: 14px 0 14px 16px;
  border-left: 3px solid var(--line);
  background: transparent;
}

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

.message-label {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #101828;
  font-size: 13px;
  font-weight: 780;
}

.message-label span {
  color: #7a8aa0;
  font-weight: 500;
}

.message-body {
  color: #263244;
  font-size: 16px;
  line-height: 1.78;
}

.message-body p {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.code-block,
.work-card pre,
.report-content pre {
  max-width: 100%;
  margin: 10px 0 0;
  padding: 14px;
  overflow-x: auto;
  border: 0;
  border-radius: 18px;
  background: rgba(242, 245, 249, 0.88);
  color: #172033;
  font: 13px/1.58 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.work-title {
  font-weight: 760;
}

.approval-actions,
.action-line,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.approval-actions {
  margin-top: 12px;
}

.approval-actions button,
.retry-btn,
.logout-btn,
.stop-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(238, 244, 251, 0.88);
  color: #344054;
}

.retry-btn {
  margin-top: 12px;
  color: var(--red);
}

.composer {
  padding: 12px clamp(16px, 4vw, 56px) calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(246, 249, 253, 0.94) 35%, rgba(246, 249, 253, 0.98));
  backdrop-filter: blur(22px);
}

.composer-status {
  max-width: 980px;
  margin: 0 auto 8px;
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.composer-status span {
  min-height: 24px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.composer-status[data-tone="work"] span,
.composer-status[data-tone="warn"] span {
  color: var(--blue);
}

.composer-status[data-tone="danger"] span {
  color: var(--red);
}

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

.quick-row,
.attachment-strip {
  max-width: 980px;
  margin: 0 auto 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.quick-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.attachment-strip span {
  min-height: 34px;
  padding: 0 8px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(231, 241, 255, 0.86);
  color: #175cd3;
  font-size: 13px;
}

.attachment-strip button {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #175cd3;
}

.queued-messages {
  width: min(100%, 980px);
  margin: 0 auto 8px;
  display: grid;
  gap: 6px;
}

.queue-guide,
.queued-message-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(155, 139, 111, 0.22);
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.88);
  color: #5f5648;
  font-size: 12px;
  line-height: 1.35;
}

.queue-guide {
  justify-content: flex-start;
}

.queue-guide strong {
  color: #2d2a24;
}

.queued-message-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queued-message-row button {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: transparent;
  color: #8a5a18;
  font-size: 12px;
}

.composer-row {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(31, 41, 55, 0.075);
}

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

.composer-row textarea {
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  padding: 12px 4px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.send-btn,
.stop-btn,
.queue-btn {
  width: 48px;
  height: 44px;
  padding: 0;
}

.send-btn.with-label,
.queue-btn {
  width: auto;
  min-width: 104px;
  padding: 0 14px;
}

.stop-btn {
  background: #fff1f0;
  color: var(--red);
}

.queue-btn {
  background: #fff8e8;
  color: #8a5a18;
}

.empty-chat,
.empty-list {
  display: grid;
  place-items: center;
}

.empty-list {
  min-height: 45vh;
  padding: 24px;
  text-align: center;
}

.empty-hero,
.empty-inline {
  text-align: center;
  color: var(--muted);
}

.empty-plus {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-size: 58px;
  font-weight: 260;
}

.empty-hero h2,
.empty-list h2,
.settings-head h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 31px;
  letter-spacing: -0.058em;
}

.empty-hero .primary {
  margin-top: 18px;
}

.settings-page,
.reports-page,
.admin-page,
.capabilities-page {
  padding: calc(env(safe-area-inset-top, 0px) + 24px) clamp(20px, 5vw, 56px) calc(26px + var(--safe-bottom));
  overflow: auto;
}

.settings-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.settings-form,
.admin-layout {
  display: grid;
  gap: 28px;
}

.admin-project-form {
  padding: 16px 0;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line-soft);
}

.admin-project-form:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.admin-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-form-head span,
.switch-row {
  min-width: 0;
}

.admin-form-head strong,
.admin-form-head small {
  display: block;
}

.admin-form-head strong {
  color: var(--text);
  font-size: 15px;
}

.admin-form-head small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

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

.admin-form-grid label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-form-grid span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 720;
}

.admin-form-grid input,
.admin-form-grid select {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  outline: none;
}

.open-section {
  display: grid;
  gap: 0;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 760;
}

.setting-row,
.plain-row {
  width: 100%;
  min-height: 68px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
}

.open-section .setting-row:first-of-type,
.open-section .plain-row:first-of-type {
  border-top-color: var(--line);
}

.input-row {
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
}

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

.setting-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
}

.setting-copy,
.plain-row span,
.report-item span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.setting-copy strong,
.setting-copy small,
.plain-row strong,
.plain-row small,
.report-item strong,
.report-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-copy small,
.plain-row small,
.report-item small {
  color: var(--muted);
}

.security-head {
  min-height: 48px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.security-audit-head {
  margin-top: 10px;
}

.security-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.security-head strong {
  color: var(--text);
  font-size: 15px;
}

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

.security-list {
  display: grid;
}

.security-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.compact-action {
  min-height: 32px;
  padding-inline: 11px;
  font-size: 12px;
}

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

.logout-btn {
  background: #fff1f0;
  color: var(--red);
  font-weight: 760;
}

.ghost-action.danger {
  color: var(--red);
}

.capability-hero {
  margin-bottom: 24px;
  padding: 0 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.capability-hero div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.capability-hero span,
.capability-hero small {
  color: var(--muted);
}

.capability-hero strong {
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: -0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-list {
  display: grid;
  gap: 0;
}

.capability-row {
  min-height: 84px;
  padding: 13px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(80px, auto);
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  background: transparent;
  color: var(--text);
}

.capability-row span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.capability-row strong,
.capability-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-row small {
  color: var(--muted);
}

.capability-row em {
  max-width: 180px;
  color: var(--blue);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-section {
  margin-top: 28px;
}

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

.command-grid button {
  min-height: 62px;
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  border-radius: 18px;
}

.command-grid small {
  color: var(--muted);
}

.ecosystem-panel {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ecosystem-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ecosystem-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.ecosystem-metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ecosystem-metric {
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.ecosystem-metric strong,
.ecosystem-metric span,
.ecosystem-metric small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-metric strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.ecosystem-metric span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.ecosystem-metric small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
}

.ecosystem-tabs {
  margin-top: 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
}

.ecosystem-tabs button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.ecosystem-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.ecosystem-content {
  min-height: 88px;
}

.ecosystem-list {
  display: grid;
  gap: 0;
}

.ecosystem-row {
  min-width: 0;
  min-height: 62px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(58px, auto) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
}

.ecosystem-row span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ecosystem-row strong,
.ecosystem-row small,
.ecosystem-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-row strong {
  color: var(--text);
  font-size: 13px;
}

.ecosystem-row small {
  color: var(--muted);
  font-size: 12px;
}

.ecosystem-row em {
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  text-align: right;
}

.ecosystem-row .ghost-action {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.ecosystem-empty,
.ecosystem-errors {
  padding: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.ecosystem-oauth {
  margin-top: 10px;
  min-width: 0;
  padding: 9px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.ecosystem-oauth a {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-config-form {
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.ecosystem-config-form label {
  display: grid;
  gap: 5px;
}

.ecosystem-config-form span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 760;
}

.ecosystem-config-form input,
.ecosystem-config-form textarea {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  outline: none;
  resize: vertical;
}

.report-layout {
  min-height: calc(100dvh - 128px);
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
}

.report-index {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0;
}

.report-item {
  min-height: 72px;
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  background: transparent;
  color: var(--text);
}

.report-item.active strong {
  color: var(--blue);
}

.report-time {
  color: var(--muted-2);
  font-size: 12px;
}

.report-reader {
  min-width: 0;
  overflow: auto;
}

.report-content header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.report-content h2 {
  margin: 0 0 6px;
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: 0;
}

.report-content p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.report-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.72;
}

.loading-lines {
  gap: 12px;
}

.mobile-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

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

.bottom-nav {
  min-height: calc(66px + var(--safe-bottom));
  padding: 8px 8px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px);
}

.bottom-nav button {
  min-height: 48px;
  display: grid;
  place-items: center;
  grid-template-rows: 20px 16px;
  gap: 2px;
  border-radius: 16px;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.bottom-nav button.active {
  background: #edf5ff;
  color: var(--blue);
}

@media (min-width: 820px) {
.notebook-shell {
  grid-template-columns: 348px minmax(0, 1fr);
  background: var(--notebook-panel);
}

.notebook-sidebar {
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background: var(--notebook-sidebar);
  backdrop-filter: none;
  color: var(--notebook-ink);
}

.sidebar-brand {
  min-height: 70px;
  padding: 16px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand h1 {
  margin: 0;
  color: #11100d;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 860;
  letter-spacing: 0;
}

.sidebar-collapse,
.sidebar-add,
.sidebar-account-menu {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: #4a463f;
}

.sidebar-collapse:hover,
.sidebar-add:hover,
.sidebar-account-menu:hover {
  background: var(--notebook-hover);
}

.sidebar-nav {
  padding: 2px 12px 12px;
  display: grid;
  gap: 3px;
}

.sidebar-nav-item {
  min-height: 36px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 10px;
  background: transparent;
  color: #45413a;
  text-align: left;
  font-size: 15px;
  font-weight: 520;
}

.sidebar-nav-item svg,
.sidebar-project svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.85;
}

.sidebar-nav-item.active,
.sidebar-nav-item:hover {
  background: var(--notebook-hover);
}

.sidebar-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.sidebar-search input::placeholder {
  color: #45413a;
  opacity: 1;
}

.sidebar-section {
  min-width: 0;
  padding: 0 12px 12px;
}

.sidebar-section-title {
  min-height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font: 680 14px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

.sidebar-project {
  min-height: 38px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #45413a;
  font-size: 15px;
}

.sidebar-project span,
.sidebar-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-recents {
  min-height: 0;
  overflow: auto;
}

.notebook-sidebar .session-list {
  height: 100%;
  padding: 0;
  gap: 2px;
}

.notebook-sidebar .session-card {
  min-height: 38px;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px;
  border-radius: 9px;
  animation: none;
}

.notebook-sidebar .session-card.compact {
  grid-template-columns: minmax(0, 1fr);
}

.notebook-sidebar .session-card::before,
.notebook-sidebar .session-summary,
.notebook-sidebar .session-meta,
.notebook-sidebar .status-badge,
.notebook-sidebar .session-card .mini-btn[data-favorite] {
  display: none;
}

.notebook-sidebar .session-card.active,
.notebook-sidebar .session-card:hover {
  background: var(--notebook-hover);
}

.notebook-sidebar .session-main {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}

.notebook-sidebar .session-title {
  color: #45413a;
  font-size: 14px;
  font-weight: 520;
}

.notebook-sidebar .session-side {
  align-content: center;
  justify-items: center;
}

.notebook-sidebar .session-card .mini-btn[data-archive] {
  width: 30px;
  height: 30px;
  color: #55514a;
}

.notebook-sidebar .empty-list {
  min-height: 120px;
  padding: 12px 10px;
  place-items: start;
  text-align: left;
}

.notebook-sidebar .empty-plus {
  display: none;
}

.notebook-sidebar .empty-list h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.notebook-sidebar .empty-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.session-list-more {
  padding: 10px 12px 4px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-account {
  min-height: 74px;
  padding: 10px 20px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
}

.account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #383426;
  color: #fff;
  font-weight: 820;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: #2d2a24;
  font-size: 17px;
}

.account-copy small {
  color: var(--muted);
  font: 500 14px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

.notebook-workspace {
  background: #fbfbf8;
}

.workbench-page {
  --tool-page-max: 1080px;
  display: grid;
  align-content: start;
  gap: 18px;
  background: #fbfbf8;
  color: var(--notebook-ink);
}

.workbench-page > * {
  width: min(100%, var(--tool-page-max));
  margin-inline: auto;
}

.tool-page-head {
  min-height: 58px;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tool-page-head h1 {
  margin: 0 0 4px;
  font: 760 22px/1.15 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

.tool-page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-hero {
  margin-bottom: 0;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.tool-hero strong {
  font-size: 20px;
  letter-spacing: 0;
}

.tool-hero .primary {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 10px;
  font-size: 13px;
}

.tool-list {
  border-top: 0;
}

.tool-row {
  min-height: 64px;
  padding: 10px 0;
  grid-template-columns: 38px minmax(0, 1fr) minmax(84px, auto);
}

.tool-row .setting-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(231, 226, 216, 0.72);
  color: #575146;
}

.tool-row .setting-icon svg {
  width: 17px;
  height: 17px;
}

.tool-row strong {
  font-size: 14px;
}

.tool-row small {
  font-size: 12px;
}

.tool-row em {
  max-width: 220px;
  color: #575146;
  font-size: 12px;
}

.workbench-page .open-section {
  gap: 0;
}

.workbench-page .section-kicker {
  margin: 2px 0 8px;
  color: #777166;
  font-size: 12px;
}

.workbench-page .setting-row,
.workbench-page .plain-row {
  min-height: 58px;
  padding-block: 10px;
}

.workbench-page .setting-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(231, 226, 216, 0.72);
  color: #575146;
}

.workbench-page .setting-icon svg {
  width: 17px;
  height: 17px;
}

.workbench-page .setting-copy strong,
.workbench-page .plain-row strong,
.workbench-page .report-item strong {
  font-size: 14px;
}

.workbench-page .setting-copy small,
.workbench-page .plain-row small,
.workbench-page .report-item small {
  font-size: 12px;
}

.workbench-page .command-section {
  margin-top: 10px;
}

.workbench-page .command-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.workbench-page .command-grid button {
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: #3f3b35;
}

.workbench-page .command-grid strong {
  font-size: 13px;
}

.workbench-page .command-grid small {
  font-size: 11px;
}

.notebook-chat {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  background: #fbfbf8;
}

.notebook-chat .chat-head {
  min-height: 62px;
  padding: 14px 36px 10px;
  background: transparent;
  backdrop-filter: none;
}

.notebook-chat .chat-title h2 {
  font: 700 18px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

.notebook-chat .chat-title .status-badge {
  display: none;
}

.notebook-chat .icon-btn {
  background: transparent;
  color: #55514a;
}

.notebook-chat .icon-btn:hover {
  background: var(--notebook-hover);
}

.chat-panels {
  width: auto;
  max-width: none;
  justify-self: stretch;
  max-height: min(32dvh, 340px);
  margin: 0 max(32px, calc((100% - 1040px) / 2));
  padding: 0 0 10px;
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 0;
}

.chat-panels:empty {
  display: block;
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.chat-panels .notice-line,
.chat-panels .session-tools,
.chat-panels .workspace-inspector {
  width: 100%;
  margin: 0;
}

.chat-panels .notice-line {
  border-radius: 10px;
  background: rgba(232, 239, 241, 0.78);
  color: #3d5960;
  font-size: 12px;
}

.chat-panels .session-tools {
  padding: 12px 0;
}

.chat-panels .workspace-inspector {
  background: rgba(255, 255, 255, 0.62);
}

.chat-canvas {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: auto;
  max-width: none;
  justify-self: stretch;
  margin: 0 max(32px, calc((100% - 1040px) / 2));
  padding: 34px 24px 40px;
  gap: 48px;
  background: transparent;
}

.notebook-chat .message {
  animation: none;
}

.timeline-history-note {
  width: min(100%, 640px);
  min-height: 34px;
  margin: -12px auto 0;
  padding: 0 2px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.timeline-history-note button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--notebook-hover);
  color: #4a453c;
  font-size: 12px;
  font-weight: 720;
}

.notebook-chat .message.assistant {
  width: min(640px, 76%);
  max-width: 640px;
  align-self: center;
  padding: 0;
}

.notebook-chat .message.user {
  max-width: min(480px, 44%);
  padding: 16px 16px;
  border-radius: 14px;
  background: var(--notebook-soft);
  color: var(--notebook-ink);
  box-shadow: none;
}

.notebook-chat .message-label {
  display: none;
}

.notebook-chat .message-body {
  color: #343029;
  font-size: 15px;
  line-height: 1.68;
}

.notebook-chat .message.user .message-body {
  font-size: 15px;
  line-height: 1.45;
}

.notebook-chat .message.error,
.notebook-chat .work-card {
  width: min(100%, 1100px);
  max-width: 1100px;
  align-self: center;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
}

.composer-tray {
  width: auto;
  max-width: none;
  justify-self: stretch;
  margin: 0 max(32px, calc((100% - 1040px) / 2));
  padding: 0;
  padding-bottom: calc(18px + var(--safe-bottom));
  background: transparent;
  backdrop-filter: none;
}

.composer-tray .composer-status {
  max-width: none;
  margin: 0 0 10px;
  justify-content: center;
}

.composer-tray .composer-status span {
  background: transparent;
  color: var(--muted);
}

.composer-tray .attachment-strip {
  max-width: none;
  margin-bottom: 10px;
}

.composer-tray .composer-row {
  max-width: none;
  min-height: 126px;
  padding: 20px 24px 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--notebook-shadow);
}

.composer-tray .composer-row textarea {
  min-height: 44px;
  max-height: 180px;
  padding: 0;
  font-size: 15px;
  line-height: 1.5;
}

.composer-tray .composer-row textarea::placeholder {
  color: #9d978d;
}

.composer-tool-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.composer-tray .composer-leading-tools,
.composer-tray .composer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.composer-tray .icon-btn,
.composer-tray .send-btn,
.composer-tray .stop-btn,
.composer-tray .queue-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: #6f6a60;
}

.composer-tray .icon-btn:hover,
.composer-tray .send-btn:hover,
.composer-tray .stop-btn:hover,
.composer-tray .queue-btn:hover {
  background: var(--notebook-hover);
  color: #2d2a24;
}

.composer-tray .send-btn.with-label,
.composer-tray .queue-btn {
  width: auto;
  min-width: 104px;
  padding: 0 10px;
}

.composer-model-pill {
  color: #3f3b35;
  font: 700 14px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}
}

@media (max-width: 819px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-content: center;
    padding: max(26px, env(safe-area-inset-top)) 24px max(34px, env(safe-area-inset-bottom));
  }

  .login-brand {
    display: none;
  }

  .login-card {
    width: min(100%, 430px);
    margin: auto;
    padding: 10px 0;
  }

  .login-card::before {
    content: "Codex";
    display: block;
    margin-bottom: 14px;
    color: var(--text);
    font-size: 42px;
    font-weight: 860;
    text-align: center;
    letter-spacing: -0.065em;
  }

  .login-card h2,
  .login-card .muted {
    text-align: center;
  }

  .sessions-head {
    padding-inline: 18px;
  }

  .session-list {
    padding: 4px 12px 20px;
  }

  .session-card {
    min-height: 104px;
    padding: 16px 10px 16px 20px;
    background: rgba(255, 255, 255, 0.32);
  }

  .chat-pane,
  .settings-page,
  .reports-page,
  .admin-page,
  .capabilities-page {
    height: 100%;
  }

  .notebook-chat {
    height: 100%;
  }

  .chat-head {
    padding-inline: 14px;
  }

  .messages,
  .timeline {
    padding: 16px 14px 18px;
  }

  .chat-panels {
    width: auto;
    margin-inline: 14px;
    max-height: min(38dvh, 300px);
  }

  .chat-canvas {
    margin-inline: 14px;
    padding: 22px 14px 26px;
    gap: 28px;
  }

  .message,
  .work-card {
    max-width: 100%;
  }

  .message.assistant {
    max-width: 92%;
    padding-left: 4px;
  }

  .message.user {
    max-width: 86%;
  }

  .composer {
    padding-inline: 12px;
  }

  .composer-tray {
    width: auto;
    margin-inline: 12px;
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  .composer-tray .composer-row {
    min-height: 112px;
    border-radius: 24px;
  }

  .quick-row,
  .attachment-strip {
    padding-inline: 2px;
  }

  .settings-page,
  .reports-page,
  .admin-page,
  .capabilities-page {
    padding-inline: 18px;
  }

  .session-tools {
    margin-inline: 14px;
    max-height: 42dvh;
    overflow: auto;
  }

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

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .artifact-layout,
  .artifact-layout.wide {
    grid-template-columns: 1fr;
  }

  .artifact-panel-page {
    min-height: 0;
  }

  .artifact-layout.wide .artifact-list,
  .artifact-list {
    max-height: 220px;
  }

  .artifact-content pre {
    max-height: 300px;
  }

  .workspace-diff {
    max-height: 180px;
  }

  .terminal-form {
    grid-template-columns: minmax(0, 1fr) 34px 34px;
  }

  .terminal-output {
    max-height: 180px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-head {
    align-items: flex-start;
  }

  .capability-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .capability-hero .primary {
    width: 100%;
  }

  .capability-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .capability-row em {
    grid-column: 2;
    max-width: 100%;
    text-align: left;
  }

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

  .ecosystem-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .ecosystem-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .ecosystem-row em,
  .ecosystem-row .ghost-action {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
    text-align: left;
  }

  .ecosystem-oauth {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .report-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .report-reader {
    overflow: visible;
  }
}

@media (hover: hover) {
  button,
  .session-card,
  .report-item {
    transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, color 180ms ease;
  }

  button:hover,
  .session-card:hover,
  .report-item:hover {
    transform: translateY(-1px);
  }
}

button:active,
.session-card:active,
.report-item:active {
  transform: scale(0.985);
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.16);
  }
}
