/*
 * Jeus hosted: the web UI's styles. Light and dark themes (the device's,
 * or the one picked in Settings: <html data-theme="light|dark">), and a
 * layout that works from phone width up. System fonts only: the page's
 * Content-Security-Policy allows no outside fonts.
 */

/* ─── Theme tokens ─────────────────────────────────────────────────────── */

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --text: #1b2230;
  --muted: #5a6474;
  --border: #d9dee6;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --accent-soft: #e0f2ef;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #15803d;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --user-bubble: #e7f0fb;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1216;
    --surface: #161a20;
    --surface-2: #1d222a;
    --surface-3: #262c36;
    --text: #e5e8ee;
    --muted: #9aa3b1;
    --border: #2c333e;
    --accent: #2cc2b0;
    --accent-text: #04201c;
    --accent-soft: #123a36;
    --danger: #f27a6e;
    --danger-soft: #3a1714;
    --success: #4ade80;
    --warn: #f0b45a;
    --warn-soft: #362611;
    --user-bubble: #1c2a3d;
    --focus: #7aa7ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1d222a;
  --surface-3: #262c36;
  --text: #e5e8ee;
  --muted: #9aa3b1;
  --border: #2c333e;
  --accent: #2cc2b0;
  --accent-text: #04201c;
  --accent-soft: #123a36;
  --danger: #f27a6e;
  --danger-soft: #3a1714;
  --success: #4ade80;
  --warn: #f0b45a;
  --warn-soft: #362611;
  --user-bubble: #1c2a3d;
  --focus: #7aa7ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ─── Base ─────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

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

.spacer {
  flex: 1 1 auto;
}

pre,
code {
  font-family: var(--mono);
  font-size: 13px;
}

/* ─── Buttons and fields ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}

.btn.danger:hover {
  background: var(--danger-soft);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.danger.ghost {
  border-color: transparent;
}

select,
input[type="text"],
input[type="password"],
input[type="url"],
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 36px;
}

select {
  padding-right: 28px;
  max-width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ─── Loading and sign-in views ───────────────────────────────────────── */

.center-view {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.signin-card {
  max-width: 440px;
  padding: 28px 24px;
}

.brand-big {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--accent);
}

/* ─── App shell ───────────────────────────────────────────────────────── */

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-right: 6px;
}

.pickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.picker-label {
  font-size: 13px;
  color: var(--muted);
}

#model-select {
  max-width: 220px;
}

#model-custom {
  width: 180px;
}

.gpu-toggle {
  font-size: 14px;
  color: var(--muted);
}

.gpu-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.user-email {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  margin: 0;
}

.narrow-only {
  display: none;
}

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
}

/* ─── Files panel ─────────────────────────────────────────────────────── */

.files-panel {
  width: 290px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  overflow: hidden;
}

.files-panel.dropping {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: var(--accent-soft);
}

.files-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.files-head h2 {
  margin: 0;
  font-size: 16px;
}

.files-hint {
  margin: 6px 4px 8px;
}

.tree,
.tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}

.tree-children {
  padding-left: 14px;
  border-left: 1px solid var(--border);
  margin-left: 12px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  min-height: 32px;
}

.tree-row:hover {
  background: var(--surface-2);
}

.tree-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
}

.tree-name.folder::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--muted);
  transition: transform 0.12s ease;
}

.tree-name.folder[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.tree-name.folder {
  font-weight: 600;
}

.tree-name.file::before {
  content: "";
  display: inline-block;
  width: 1em;
}

.tree-size {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tree-actions {
  flex: 0 0 auto;
  display: inline-flex;
  opacity: 0.55;
}

.tree-row:hover .tree-actions,
.tree-row:focus-within .tree-actions {
  opacity: 1;
}

.tree-empty {
  padding: 4px 8px;
}

.files-status {
  margin: 8px 4px 0;
  min-height: 1.2em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.scrim {
  display: none;
}

/* ─── Chat ────────────────────────────────────────────────────────────── */

.chat {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-log > * {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.welcome h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.welcome p {
  margin: 6px 0;
  color: var(--muted);
}

.welcome-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--text) !important;
}

.msg.user {
  display: flex;
  justify-content: flex-end;
}

.msg.user .bubble {
  max-width: min(680px, 92%);
  background: var(--user-bubble);
  border-radius: 14px 14px 4px 14px;
  padding: 8px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg.agent {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px 12px;
}

.msg-head {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 2px;
}

.agent-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

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

.dots {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dots,
  .step[data-status="in_progress"] .step-icon {
    animation: none;
  }
}

.notice {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.turn-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.turn-note.error {
  color: var(--danger);
  overflow-wrap: anywhere;
}

/* Markdown from Jeus (sanitized). */
.md {
  overflow-wrap: anywhere;
  min-width: 0;
}

.md.plain {
  white-space: pre-wrap;
}

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

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

.md p,
.md ul,
.md ol,
.md blockquote,
.md pre,
.md table {
  margin: 0.6em 0;
}

.md h1,
.md h2,
.md h3,
.md h4 {
  margin: 0.9em 0 0.4em;
}

.md h1 {
  font-size: 1.35em;
}

.md h2 {
  font-size: 1.2em;
}

.md h3,
.md h4 {
  font-size: 1.05em;
}

.md code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.md pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}

.md pre code {
  background: none;
  padding: 0;
}

.md blockquote {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  color: var(--muted);
}

.md table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.md th,
.md td {
  border: 1px solid var(--border);
  padding: 4px 10px;
  text-align: left;
}

.md th {
  background: var(--surface-2);
}

.md img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: zoom-in;
}

.md hr {
  border: 0;
  border-top: 1px solid var(--border);
}

/* Thinking: collapsed by default. */
.thought {
  font-size: 13px;
  color: var(--muted);
}

.thought summary {
  cursor: pointer;
  font-style: italic;
}

.thought-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 6px 0 2px 12px;
  border-left: 2px solid var(--border);
  margin-top: 4px;
}

/* Tool calls: compact steps. */
.step-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
}

.step summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
}

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

.step-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
}

.step[data-status="in_progress"] .step-icon {
  border-color: var(--accent);
  border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}

.step[data-status="completed"] .step-icon {
  border-color: var(--success);
  background: var(--success);
}

.step[data-status="failed"] .step-icon {
  border-color: var(--danger);
  background: var(--danger);
}

.step[data-status="cancelled"] .step-icon {
  border-style: dashed;
}

.step-kind {
  flex: 0 0 auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 6px;
}

.step-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
}

.step-status {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
}

.step[data-status="failed"] .step-status {
  color: var(--danger);
}

.step-body {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.code {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 340px;
  overflow: auto;
}

.code.command {
  color: var(--text);
}

.step-image {
  max-width: 100%;
  border-radius: 6px;
}

.diff {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diff-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.diff-side {
  min-width: 0;
}

.diff-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.diff-side.before .diff-label {
  color: var(--danger);
}

.diff-side.after .diff-label {
  color: var(--success);
}

/* Permission questions. */
.permission {
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 8px 12px;
}

.permission-question {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.permission .code {
  margin-bottom: 8px;
}

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

.permission-answer {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* The plan, as a checklist. */
.plan {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.plan-head {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 0;
}

.plan-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 2px solid var(--muted);
  border-radius: 3px;
}

.plan-list li[data-status="in_progress"] .plan-icon {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
}

.plan-list li[data-status="completed"] .plan-icon {
  border-color: var(--success);
  background: var(--success);
}

.plan-list li[data-status="completed"] .plan-text {
  color: var(--muted);
  text-decoration: line-through;
}

/* Examples. */
.examples {
  width: 100%;
  max-width: 892px;
  margin: 0 auto;
  padding: 0 16px;
}

.examples summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}

.chip-group h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 6px 0 4px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}

.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* The composer. */
.composer {
  width: 100%;
  max-width: 892px;
  margin: 0 auto;
  padding: 8px 16px 14px;
}

.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  min-height: 56px;
  max-height: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.status {
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ─── Dialogs ─────────────────────────────────────────────────────────── */

dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

dialog::backdrop {
  background: rgba(10, 14, 20, 0.5);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
}

.dialog-body h2 {
  margin: 0;
  font-size: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

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

.hint {
  margin: 0;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
}

.hint.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.settings-message {
  margin: 0;
  font-size: 14px;
  color: var(--warn);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#preview {
  width: min(960px, calc(100vw - 32px));
}

.preview-body {
  max-height: calc(100vh - 34px);
  min-height: 0;
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preview-head h2 {
  font-size: 15px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#preview-note {
  margin: 0;
}

.preview-content {
  min-height: 0;
  overflow: auto;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;
  background: #fff;
  border-radius: 6px;
}

.table-scroll {
  overflow: auto;
  max-height: 70vh;
}

.preview-table {
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.preview-table th,
.preview-table td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  text-align: left;
}

.preview-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
}

.preview-text {
  max-height: 70vh;
}

/* ─── Narrow screens (phones) ─────────────────────────────────────────── */

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .topbar {
    padding: 8px 16px;
  }

  .narrow-only {
    display: inline-flex;
  }

  /* The email and the Admin link are in Settings instead. */
  .user-email,
  #admin-link {
    display: none;
  }

  /* The pickers take one row of their own under the buttons; their labels
     stay for screen readers only. */
  .pickers {
    order: 10;
    flex-basis: 100%;
    gap: 6px;
  }

  .picker-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .picker:first-child {
    flex: 1 1 140px;
    min-width: 0;
  }

  #model-select {
    width: 100%;
    max-width: none;
  }

  #model-custom {
    width: 36vw;
  }

  /* The status line above the buttons. */
  .composer-actions .status {
    flex-basis: 100%;
  }

  /* The files panel slides in from the left. */
  .files-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(320px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }

  .layout.files-open .files-panel {
    transform: none;
  }

  .layout.files-open .scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(10, 14, 20, 0.45);
  }

  .tree-actions {
    opacity: 1;
  }

  .chat-log {
    padding: 14px 16px 8px;
  }

  .msg.agent {
    padding: 8px 12px 10px;
  }

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

  .chips {
    max-height: 120px;
  }

  .composer {
    padding: 6px 16px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .files-panel {
    transition: none;
  }
}
