:root {
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #26352f;
  background: #f8faf7;
  --line: #dde4dc;
  --muted: #77837a;
  --green: #2e624a;
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
}
body {
  margin: 0;
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
}
button:hover {
  background: #edf3e9;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding: 10px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #789f84;
  outline-offset: 2px;
}
textarea {
  resize: vertical;
}
aside {
  width: 224px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: #f0f4ed;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #26352f;
  text-decoration: none;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand small {
  font-size: 8px;
  letter-spacing: 1px;
  border: 1px solid #bccbbb;
  padding: 2px 4px;
  border-radius: 3px;
  margin-top: 5px;
}
.section-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.4px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 38px 0 12px;
}
.section-label button {
  font-size: 19px;
  padding: 0 6px;
  background: none;
  border: 0;
}
#workspaces {
  overflow: auto;
}
.workspace {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  background: transparent;
  border: 1px solid transparent;
  padding: 10px;
}
.workspace.active {
  background: white;
  border-color: var(--line);
  box-shadow: 0 2px 4px #283e2f05;
}
.workspace small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom > button {
  display: block;
  border: 0;
  background: none;
  font-size: 12px;
  padding: 7px 0;
}
#connection {
  color: var(--green);
  font-size: 11px;
  margin: 15px 0;
}
#context {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 22px;
  font-size: 11px;
}
#context b {
  letter-spacing: 1px;
  font-size: 9px;
}
#context .count {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -1px;
}
#context .counts {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-top: 8px;
}
.meter {
  height: 4px;
  background: #dbe4d7;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.meter div {
  height: 100%;
  background: #639277;
}
main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
main > header,
#tabs {
  --line: #405149;
  --muted: #b5c4bb;
  --green: #b9e2c7;
  color: #f0f6f1;
  background: #25372e;
}
body[data-mode="light"] main > header,
body[data-mode="light"] #tabs {
  --line: #dde4dc;
  --muted: #637368;
  --green: #2e624a;
  color: #26352f;
  background: #f1f6ef;
}
main > header .header-actions button,
main > header .header-actions select {
  background: inherit;
}
main > header .header-actions button:hover {
  background: #ffffff18;
}
main > header select option {
  color: #26352f;
  background: #f1f6ef;
}
header {
  padding: 25px 30px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
}
h1 {
  font-size: 23px;
  letter-spacing: -0.7px;
  margin: 5px 0 0;
  font-weight: 550;
}
.header-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.header-actions button,
.header-actions select {
  font-size: 11px;
  padding: 7px 10px;
}
#tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  min-height: 44px;
  overflow: auto;
  gap: 4px;
}
#tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
#tabs button.active {
  border-bottom-color: var(--green);
  color: var(--green);
}
.close {
  margin-left: 12px;
  color: #9aa69c;
}
#view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 25px 30px;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 9px 24px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
#notice {
  margin: 10px 30px 0;
  padding: 10px 14px;
  background: #fff2d6;
  border: 1px solid #e9d4a2;
  border-radius: 7px;
  white-space: pre-wrap;
  font-size: 12px;
}
.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1000px;
  margin: auto;
}
.messages {
  flex: 1;
  overflow: auto;
  padding-bottom: 20px;
}
.welcome {
  padding: 70px 30px 50px;
  max-width: 650px;
}
.welcome .symbol {
  color: #78977b;
  font-size: 42px;
}
.welcome h2 {
  font-size: 34px;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 15px 0;
}
.welcome p {
  color: var(--muted);
  max-width: 450px;
}
.chips {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.chips button {
  font-size: 11px;
}
.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.7;
}
.message.user {
  background: #edf2e9;
  margin-left: 12%;
}
.message.assistant {
  background: white;
  margin-right: 5%;
}
.message .role {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 7px;
}
.events {
  font:
    11px/1.6 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f1f4ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  max-height: 240px;
  overflow: auto;
}
.composer {
  background: white;
  border: 1px solid #cbd8c9;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 3px 14px #29402706;
}
.composer textarea {
  width: 100%;
  min-height: 70px;
  max-height: 250px;
  border: 0;
  resize: vertical;
  padding: 4px;
}
.composer textarea:focus {
  outline: none;
}
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.composer-actions .hint {
  font-size: 10px;
  color: var(--muted);
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #224e39;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}
.toolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
.muted {
  color: var(--muted);
}
.terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  min-width: 300px;
}
.terminal {
  background: #fff;
  border: 1px solid #ccd7c9;
  border-radius: 9px;
  overflow: hidden;
  min-width: 300px;
  min-height: 300px;
  resize: vertical;
  height: 340px;
  display: flex;
  flex-direction: column;
}
.terminal header {
  min-height: 38px;
  padding: 4px 6px;
  background: #e8efe6;
  border-bottom: 1px solid #ccd7c9;
}
.terminal.idle header { background: #eeeeee; }
.terminal.running header { background: #e8efe6; }
.terminal.exited { opacity: .5; }
.terminal-card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.terminal-card-actions .icon-button {
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}
.terminal-archive { opacity: .5; }
.terminal pre {
  font:
    12px/1.4 Menlo,
    Consolas,
    monospace;
  flex: 1;
  padding: 10px;
  margin: 0;
  overflow: auto;
  white-space: pre;
  outline: none;
}
.terminal pre:focus {
  box-shadow: inset 0 0 0 2px #80a28a;
}
.terminal .input-row {
  display: flex;
  padding: 6px;
  gap: 5px;
  border-top: 1px solid var(--line);
}
.terminal input {
  width: 100%;
  font-size: 11px;
  padding: 4px;
}
.terminal .input-row button {
  padding: 3px 8px;
  font-size: 11px;
}
.settings {
  max-width: 650px;
}
.settings h2 {
  font-weight: 500;
  margin-top: 0;
}
.field {
  display: block;
  margin-bottom: 20px;
}
.field span {
  display: block;
  font-weight: 550;
  font-size: 12px;
  margin-bottom: 6px;
}
.field input:not([type="checkbox"]),
.field select {
  width: 100%;
}
.field small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row > * {
  flex: 1;
}
.settings hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 27px 0;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.file-list button {
  display: flex;
  text-align: left;
  justify-content: space-between;
  background: white;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.file-list small {
  color: var(--muted);
}
.editor {
  width: 100%;
  min-height: 70vh;
  font:
    12px/1.6 ui-monospace,
    monospace;
  white-space: pre;
  tab-size: 4;
}
.preview {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  margin: auto;
}
.webframe {
  width: 100%;
  height: calc(100% - 55px);
  min-height: 450px;
  border: 1px solid var(--line);
  background: white;
}
.logs {
  display: flex;
  flex-direction: column;
  font:
    11px/1.6 ui-monospace,
    monospace;
}
.log-entry {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.log-entry:first-child { padding-top: 2px; }
.log-meta-line {
  display: block;
  margin: 0 0 7px 18px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.log-tool-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.log-tool-name { font-weight: 750; color: var(--text); }
.log-tool-meta { color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.log-progress-time { color: var(--muted); font-size: 12px; }
.log-main-task { margin-top: 2px; font-weight: 700; }
.log-current-task { margin-top: 2px; color: #236b45; }
.log-call-summary { white-space: pre-wrap; }
.log-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  margin-left: 18px;
}
.log-kind { color: var(--muted); font-weight: 650; }
.log-message { overflow-wrap: anywhere; }
.log-summary { cursor: pointer; }
.log-summary::marker { color: var(--muted); }
.log-summary .log-head {
  display: inline-grid;
  width: calc(100% - 36px);
  vertical-align: top;
}
.log-task-stats,
.log-context,
.log-call-summary {
  display: block;
  margin: 5px 0 0 18px;
  overflow-wrap: anywhere;
}
.log-task-stats,
.log-context { color: var(--muted); font-size: 12px; }
.log-call-summary { color: #314038; }
.log-preview {
  display: block;
  margin: 6px 0 0 18px;
  color: #405149;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.log-output-label {
  margin: 10px 0 -3px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.log-full {
  margin: 9px 0 2px 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f6f1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 50vh;
  overflow: auto;
}
.log-task-filter { position: relative; flex: 0 0 auto !important; }
.log-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.log-filter-icon::-webkit-details-marker { display: none; }
.log-task-filter[open] .log-filter-icon { background: var(--soft); }
.log-task-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 55vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.log-task-filter-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  text-align: left;
}
.log-task-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-task-filter-count {
  flex: 0 0 auto;
  color: var(--muted);
  font: 11px/1.2 ui-monospace, monospace;
  white-space: nowrap;
}
.log-task-filter-menu button.selected { font-weight: 700; background: var(--soft); }
.log-page-button { min-width: 34px; font-size: 20px; line-height: 1; }
.log-page-info {
  min-width: 42px;
  align-self: center;
  color: var(--muted);
  font: 12px/1 ui-monospace, monospace;
  text-align: center;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  min-width: 360px;
  box-shadow: 0 20px 70px #15351c30;
}
dialog::backdrop {
  background: #1c2a2344;
}
dialog h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 20px;
}
dialog label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
dialog input {
  width: 100%;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.empty {
  margin: 50px auto;
  max-width: 500px;
  color: var(--muted);
}
a {
  color: var(--green);
}
.recording {
  color: #a33c32;
}
.audio-result {
  margin-top: 12px;
  width: 100%;
}
@media (max-width: 900px) {
  aside {
    width: 180px;
    padding: 20px 12px;
  }
  header {
    padding: 20px;
    flex-wrap: wrap;
  }
  #view {
    padding: 20px;
  }
  .header-actions {
    gap: 5px;
  }
  footer span:last-child {
    display: inline;
  }
}
@media (max-width: 620px) {
  aside {
    width: 65px;
    padding: 15px 5px;
  }
  .brand {
    justify-content: center;
  }
  .brand span,
  .brand small,
  .section-label,
  .workspace small,
  .sidebar-bottom > button,
  #context,
  .sidebar-bottom #connection {
    display: none;
  }
  .workspace {
    font-size: 10px;
    padding: 7px 3px;
    overflow: hidden;
  }
  .brand {
    font-size: 27px;
  }
  #workspaces {
    margin-top: 30px;
  }
  .welcome {
    padding: 25px 0;
  }
  .welcome h2 {
    font-size: 28px;
  }
  .composer-actions .hint {
    display: none;
  }
  h1 {
    font-size: 20px;
  }
  .terminal-grid {
    grid-template-columns: 1fr;
  }
  #view {
    padding: 15px;
  }
}
/* Compact workspace chrome. */
aside { width: 192px; padding: 12px 10px; background: #f5f6f3; }
.sidebar-tools { display: flex; align-items: center; gap: 6px; min-height: 36px; color: var(--muted); }
.sidebar-tools > span:first-child { margin-right: auto; padding: 6px; font-size: 20px; }
.sidebar-tools button { border: 0; background: transparent; padding: 5px 8px; font-size: 18px; }
#logs-nav { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
#logs-nav.log-activity-new {
  background: #174f86;
  color: white;
  box-shadow: 0 0 0 1px #174f86;
}
#logs-nav.log-activity-recent {
  background: #d9ebfb;
  color: #174f86;
  box-shadow: 0 0 0 1px #9fc6e8;
}
#workspaces { margin-top: 12px; }
.workspace { padding: 8px 10px; margin-bottom: 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace.active { box-shadow: none; }
.sidebar-bottom #context { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 6px; margin: 0 0 6px; font-size: 12px; background: transparent; }
.context-total { color: var(--muted); font-size: 11px; padding-left: 20px; }
#connection { margin: 0 4px 0 auto; font-size: 10px; }
main > header.workspace-heading { padding: 10px 18px 0; border: 0; min-height: 32px; font: 11px/1.6 ui-monospace, monospace; }
#workspace-title { overflow-wrap: anywhere; user-select: text; opacity: .75; }
#tabs { min-height: 42px; padding: 0 10px; gap: 0; flex-shrink: 0; }
#tabs .new-tab { font-size: 21px; padding: 2px 10px; margin-right: 5px; }
#tabs button:hover { background: #ffffff12; }
#view { padding: 20px 24px; }
footer { padding: 5px 18px; border: 0; }
.welcome { padding: 65px 10px 35px; }
.welcome h2 { font-size: 28px; }
.welcome p:empty { display: none; }
.popup-menu { position: fixed; z-index: 20; width: 210px; border: 1px solid var(--line); background: #fff; border-radius: 10px; box-shadow: 0 8px 30px #17241c20; padding: 5px; }
.popup-menu[hidden] { display: none; }
.popup-menu button { display: block; width: 100%; text-align: left; border: 0; font-size: 12px; }
.context-section { font-size: 12px; font-weight: 600; margin: 26px 0 10px; }
.context-entry { display: grid; grid-template-columns: minmax(100px, 1fr) auto; gap: 5px 20px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.context-path { overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.context-bar { grid-column: 1/-1; height: 3px; background: #edf1eb; }
.context-bar div { height: 100%; background: #8aa48f; }
.toolbar h2 { font-size: 14px; }
.terminal-grid { min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.terminal { min-width: 0; box-shadow: none; }
@media (max-width: 620px) {
  aside { width: 120px; padding: 10px 6px; }
  .workspace { font-size: 12px; padding: 8px 6px; }
  #workspaces { margin-top: 12px; }
  .sidebar-bottom #context { display: flex; font-size: 10px; }
  .sidebar-bottom #connection { display: block; }
  #view { padding: 14px; }
  .composer-actions { flex-wrap: wrap; }
  .context-entry { grid-template-columns: 1fr; }
  .context-bar { grid-column: 1; }
  dialog { min-width: 0; width: calc(100% - 24px); }
}

/* Shared file browser and interactive PTY surfaces. */
.icon-button { width: 32px; height: 32px; padding: 3px; display: inline-grid; place-items: center; flex-shrink: 0; font-size: 17px; }
.file-browser { display: flex; flex-direction: column; min-height: 220px; height: 100%; min-width: 0; }
.browser-toolbar, .dock-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.browser-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px ui-monospace, monospace; }
.tree-rows { flex: 1; min-height: 100px; overflow: auto; padding: 8px 0; }
.tree-row { display: flex; align-items: center; gap: 12px; min-height: 33px; cursor: pointer; border-radius: 4px; font-size: 12px; }
.tree-row:hover, .tree-row:focus-visible { background: #edf3e9; outline: none; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-metrics { font-size: 11px; color: var(--muted); flex-shrink: 0; padding-right: 8px; font-variant-numeric: tabular-nums; }
.new-file .tree-name { color: #287adb; }
.context-summary { margin: 10px 0 2px; font-size: 11px; }
.folder-picker { width: min(780px, 90vw); }
.folder-picker .file-browser { height: min(65vh, 600px); }
.terminal-surface { flex: 1; min-height: 0; min-width: 0; background: #17221d; padding: 8px; overflow: hidden; }
.file-terminal-dock { height: 300px; min-height: 180px; flex-shrink: 0; display: flex; flex-direction: column; border: 1px solid var(--line); resize: vertical; overflow: hidden; }
.file-terminal-dock[hidden] { display: none; }
.dock-toolbar { padding: 5px 8px; }
.dock-toolbar select { flex: 1; min-width: 0; padding: 4px; }
.settings textarea { width: 100%; min-height: 210px; font: 12px/1.6 ui-monospace, monospace; }
.composer select { max-width: 220px; padding: 5px 8px; font-size: 12px; }
.terminal-surface { display: flex; flex-direction: column; position: relative; }
.vt-viewport { flex: 1; position: relative; min-height: 0; overflow: auto; font: 13px/19px Menlo, monospace; color: #e0ebe5; touch-action: pan-x pan-y; }
.terminal .vt-screen, .vt-screen { margin: 0; padding: 0; background: transparent; color: inherit; font: inherit; overflow: visible; white-space: pre; min-height: 100%; user-select: text; }
.vt-row { height: 19px; }
.vt-cursor { position: absolute; width: 1ch; height: 19px; background: #c5dfbd80; pointer-events: none; }
.vt-cursor[hidden] { display: none; }
.vt-input { position: absolute; left: 8px; bottom: 40px; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: .01; resize: none; font-size: 16px; }
.vt-keys { display: flex; gap: 6px; padding-top: 6px; }
.vt-keys button { color: #dce8e0; border-color: #43514a; background: transparent; font-size: 12px; min-width: 38px; }
.vt-keys.ctrl-active button:nth-child(3) { background: #43634e; }
.terminal-surface[data-copy]::after { content: attr(data-copy); position: absolute; top: 8px; right: 12px; color: #b6d3bf; background: #17221d; font-size: 11px; pointer-events: none; }
@media (max-width: 600px) { .vt-keys button { min-height: 40px; } .tree-metrics { font-size: 10px; } .browser-toolbar { flex-wrap: wrap; } }
.vt-keys { flex-wrap: wrap; flex-shrink: 0; }
.vt-keys button { width: auto; padding: 3px 8px; }

#login-dialog { width: min(420px, calc(100vw - 40px)); }
#login-form { display: flex; flex-direction: column; gap: 12px; }
.login-help { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#login-error { color: #c54b4b; margin: 0; }
body.authenticating > aside, body.authenticating > main { visibility: hidden; }
#dev-badge { position: fixed; top: 7px; right: 10px; z-index: 1001; padding: 2px 6px; border: 1px solid #f0f6f199; border-radius: 4px; color: #f0f6f1; background: #25372e; font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
#dev-badge[hidden] { display: none; }

.folder-picker .browser-toolbar { flex-wrap: wrap; }
.folder-picker input.browser-path { flex: 1 1 65%; width: auto; padding: 8px; }
.folder-picker .tree-rows { min-height: 0; overflow-y: auto; }
.path-suggestions { max-height: 180px; overflow-y: auto; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.path-suggestions button { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }
.history-session { display: block; text-align: left; width: 100%; margin: 8px 0; white-space: normal; overflow-wrap: anywhere; }
.task-usage { font-size: 12px; line-height: 1.7; padding: 8px 0; }
.git-diff { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; padding: 12px; background: #0002; }

.thinking-menu { position:fixed; z-index:1000; display:flex; flex-direction:column; min-width:120px; padding:6px; background:var(--panel, #202124); color:var(--text, #eee); border:1px solid #666; border-radius:10px; box-shadow:0 6px 30px #0006; }
.thinking-menu button { text-align:right; touch-action:none; padding:8px 12px; }
.thinking-menu .hover, .thinking-menu .chosen { background:#45618a; color:white; }
#run-job { touch-action:none; }
footer { gap:12px; flex-wrap:wrap; }

.git-subtabs [aria-selected="true"], .git-list .chosen { background: #30435b; }
.git-panes {display:grid;grid-template-columns:minmax(180px,30%) minmax(0,1fr);gap:16px;margin-top:12px}
.git-list {display:flex;flex-direction:column;gap:4px;min-width:0}.git-list button{text-align:left;white-space:normal;overflow-wrap:anywhere}
.git-file {display:flex;align-items:center;gap:8px;width:100%}.git-filename {flex:1;min-width:0}.git-count{white-space:nowrap;font:12px monospace;color:#a7c5e8}.git-detail{min-width:0}.git-diff{overflow:auto}.diff-add{color:#94dfac}.diff-delete{color:#ffaaaa}.diff-hunk{color:#9bbce9}
@media(max-width:650px){.git-panes{grid-template-columns:1fr}.git-list{max-height:240px;overflow:auto}}

.request-details { margin-top:12px; font-size:12px; white-space:normal; }
.request-details summary { cursor:pointer; }
.request-details pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:240px; overflow:auto; }

.thinking-menu { background:#fff; color:#26352f; border-color:#aab9ad; }
.thinking-menu .muted { color:#526158; }
.thinking-menu button { background:#fff; color:#26352f; }
.thinking-menu button:hover, .thinking-menu button:focus-visible { background:#e5eee2; color:#183a28; }
.thinking-menu button.hover, .thinking-menu button.chosen { background:#2e624a; color:#fff; }
.agent-events { font:inherit; white-space:normal; max-height:480px; }
.event-step { margin:16px 0 6px; border-bottom:1px solid var(--line); padding-bottom:6px; }
.event-review { color:#526158; font-size:12px; margin:4px 0; }
.event-answer { white-space:pre-wrap; margin:12px 0; }
.event-detail { margin:8px 0; padding:8px 10px; background:#fff; border:1px solid var(--line); border-radius:6px; }
.event-detail summary { cursor:pointer; font-weight:500; }
.event-detail pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
.agent-tag { margin:8px 0; border:1px solid var(--line); border-radius:8px; background:#fff; }
.agent-tag summary { cursor:pointer; padding:8px 10px; font-weight:500; }
.agent-tag-body { padding:0 10px 10px; }
.agent-tag-code { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; background:#f0f3ee; padding:10px; border-radius:6px; }
.agent-tag-score { color:#246648; font-weight:600; }
.agent-tag-done { color:#246648; font-weight:600; }
.agent-tag-pending { color:#8a5a20; font-weight:600; }
.event-error { color:#a32626; }

footer { color:#526158; row-gap:3px; flex-shrink:0; }
#provider-label { overflow-wrap:anywhere; }

.markdown { white-space:normal; overflow-wrap:anywhere; line-height:1.6; }
.markdown p { white-space:pre-wrap; margin:0.6em 0; }
.markdown pre { white-space:pre; overflow:auto; padding:12px; background:#f0f3ee; border-radius:6px; }
.markdown code { font-family:monospace; }
.markdown blockquote { border-left:3px solid #8ca88f; margin-left:0; padding-left:16px; }
.markdown a { color:#246648; text-decoration:underline; }
.markdown h1, .markdown h2, .markdown h3 { margin:0.8em 0 0.4em; }
.agent-activity .agent-events { max-height:none; }

.iteration-message { max-width:none; margin:12px 0; padding:16px; border:1px solid #d0dbd2; border-radius:10px; }
.iteration-message .request-details { margin-bottom:12px; }
.request-usage { font-size:12px; border-top:1px solid #d0dbd2; padding-top:8px; }

.request-part { margin: 8px 0 8px 12px; padding-left: 8px; border-left: 1px solid var(--border); }

.context-tree-folder > summary { display: flex; align-items: center; gap: 8px; }
.context-tree-folder > summary::before { content: "▸"; }
.context-tree-folder[open] > summary::before { content: "▾"; }
.context-tree-file { display: flex; gap: 12px; padding: 6px 0 6px 20px; }
.context-tree-name { overflow-wrap: anywhere; }
.context-tree-tokens { margin-left: auto; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-preview-popup { position: fixed; inset: auto 24px 24px auto; margin: 0; width: min(560px, 80vw); max-height: 65vh; padding: 12px; z-index: 100; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; box-shadow: 0 12px 48px #0005; }
.file-preview-body { overflow: auto; max-height: 48vh; }
.file-preview-body pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.file-preview-body .preview { max-width: 100%; max-height: 45vh; }
.context-excluded .tree-name, .context-excluded .tree-metrics { color: var(--muted); }
/* Agent updates must not anchor the viewport to newly inserted requests. */
.messages { overflow-anchor: none; }

/* Focused terminal controls and collapsible sidebar. */
#sidebar { transition: width .16s ease, padding .16s ease; }
#sidebar .sidebar-toggle { margin-right: auto; border: 0; background: transparent; font-size: 20px; padding: 5px 8px; }
#sidebar.collapsed { width: 52px; padding-inline: 7px; }
#sidebar.collapsed .sidebar-bottom,
#sidebar.collapsed #add-workspace { display: none; }
#sidebar.collapsed #workspaces { display: block; width: 100%; overflow-y: auto; overflow-x: hidden; }
#sidebar.collapsed .workspace {
  width: 38px;
  height: 38px;
  margin: 4px auto;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0;
  border-radius: 9px;
}
#sidebar.collapsed .workspace::before {
  content: attr(data-initial);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}
#sidebar.collapsed .sidebar-tools { justify-content: center; }
#sidebar.collapsed .sidebar-toggle { margin: 0; }
.terminal { height: 500px; }
.terminal-new { width: 34px; height: 30px; margin: 0 0 8px; padding: 0; }
.terminal.focused { box-shadow: 0 0 0 2px #789f84; }


/* Keep bottom controls inside the visible mobile viewport and give terminal views scroll runway. */
#sidebar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
footer {
  position: relative;
  z-index: 6;
  background: #f8faf7;
  padding-bottom: max(5px, env(safe-area-inset-bottom));
}
.terminal-scroll-spacer {
  height: 90vh;
  min-height: 90vh;
  width: 100%;
  pointer-events: none;
}
