/* ===================================================================
   Wall-E Session — Chat UI, Agent Badges, Tool Cards
   =================================================================== */

/* --- Agent color accents in session list --- */
.session-item[data-agent="walle"] {
  border-left: 3px solid #f59e0b;
  background: #1e1a0e;
}
.session-item[data-agent="walle"].active {
  box-shadow: 0 0 0 1px rgba(245,158,11,0.3);
}
.session-item[data-agent="claude"] {
  border-left: 3px solid #c084fc;
}
.session-item[data-agent="claude-desktop"] {
  border-left: 3px solid #d97757;
}
.session-item[data-agent="codex"] {
  border-left: 3px solid #22c55e;
}
.session-item[data-agent="gemini"] {
  border-left: 3px solid #3b82f6;
}
/* WP-7 (S-58): DeepSeek Harness — DeepSeek's signature blue #4D6BFE. */
.session-item[data-agent="dsh"] {
  border-left: 3px solid #4D6BFE;
}
.session-item[data-agent="shell"] {
  border-left: 3px solid #6b7280;
}

/* --- Agent badges --- */
.agent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
  white-space: nowrap;
}
.agent-badge.walle {
  background: rgba(245,158,11,0.18);
  color: #f59e0b;
}
.agent-badge.claude {
  background: rgba(192,132,252,0.18);
  color: #c084fc;
}
.agent-badge.claude-desktop {
  background: rgba(217,119,87,0.18);
  color: #d97757;
}
.agent-badge.codex {
  background: rgba(34,197,94,0.18);
  color: #22c55e;
}
.agent-badge.gemini {
  background: rgba(59,130,246,0.18);
  color: #3b82f6;
}
.agent-badge.shell {
  background: rgba(107,114,128,0.18);
  color: #6b7280;
}

/* --- Wall-E session container --- */
.walle-session {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg, #1a1b26);
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.walle-session:not(.active) {
  display: none;
}

/* Durable coding-goal truth. This is a sibling of both transcript surfaces,
   so history pagination and Web/Conversation switching cannot replace it. */
.walle-goal-strip-slot {
  flex: 0 0 auto;
  padding: 8px 14px 0;
  background: var(--bg, #1a1b26);
}
.walle-goal-strip-slot[hidden] { display: none; }
.walle-goal-strip {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.25);
  border-left: 3px solid #7aa2f7;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(36,40,59,0.96), rgba(31,35,53,0.94));
  box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}
.walle-goal-strip.tone-blocked,
.walle-goal-strip.tone-paused {
  border-color: rgba(224,175,104,0.38);
  border-left-color: #e0af68;
}
.walle-goal-strip.tone-success {
  border-color: rgba(158,206,106,0.35);
  border-left-color: #9ece6a;
}
.walle-goal-header,
.walle-goal-facts,
.walle-goal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.walle-goal-header { grid-column: 1; }
/* Collapse is controlled explicitly with [hidden] rather than <details>: three
   separate live measurements showed Chrome not applying its closed-state hiding
   here, with the body painting below a 36px "collapsed" strip. This is
   deterministic. */
.walle-goal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  margin-top: 8px;
}
.walle-goal-body[hidden] { display: none !important; }
/* Collapsed by default: the whole strip is one line until the reader opens it. */
.walle-goal-header[role="button"] {
  cursor: pointer;
  list-style: none;
  padding: 0;
}

.walle-goal-header[role="button"]::after {
  content: '▸';
  margin-left: auto;
  flex: 0 0 auto;
  opacity: 0.55;
  font-size: 10px;
}
.walle-goal-strip.is-open > .walle-goal-header::after { content: '▾'; }
/* The objective rides in the summary as a single truncated line. */
.walle-goal-objective-inline {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--fg-dim, #9aa5ce);
  font-size: 12px;
}
.walle-goal-kicker {
  color: #f2b86b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.walle-goal-status {
  color: var(--fg, #c0caf5);
  font-size: 12px;
  font-weight: 750;
}
.walle-goal-objective {
  grid-column: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--fg, #c0caf5);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-goal-facts {
  grid-column: 1;
  flex-wrap: wrap;
  color: var(--fg-dim, #9aa5ce);
  font-size: 11px;
}
.walle-goal-facts > span + span::before { content: '·'; margin-right: 8px; color: #565f89; }
.walle-goal-blocker {
  grid-column: 1;
  color: #e0af68;
  font-size: 11px;
  font-weight: 650;
}
.walle-goal-attempts {
  grid-column: 1;
  color: var(--fg-dim, #9aa5ce);
  font-size: 11px;
}
.walle-goal-attempts summary { cursor: pointer; width: fit-content; }
.walle-goal-attempt-row { display: block; padding: 3px 0 0 14px; }
.walle-goal-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}
.walle-goal-actions button {
  border: 1px solid rgba(122,162,247,0.28);
  border-radius: 6px;
  padding: 5px 10px;
  background: rgba(122,162,247,0.12);
  color: #a9bffb;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.walle-goal-actions button:hover:not(:disabled) { background: rgba(122,162,247,0.2); }
.walle-goal-actions button:disabled { cursor: default; opacity: 0.55; }
.walle-goal-actions .walle-goal-secondary-action {
  border-color: rgba(224,175,104,0.28);
  background: rgba(224,175,104,0.08);
  color: #e0af68;
}
.walle-goal-strip > .walle-external-interaction {
  grid-column: 1 / -1;
}
.walle-external-interaction {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(224,175,104,0.42);
  border-left: 3px solid #e0af68;
  border-radius: 8px;
  background: rgba(224,175,104,0.08);
  color: var(--fg, #c0caf5);
}
.walle-external-interaction.tone-sensitive {
  border-color: rgba(187,154,247,0.48);
  border-left-color: #bb9af7;
  background: rgba(187,154,247,0.09);
}
.walle-external-interaction.tone-continuing {
  border-color: rgba(122,162,247,0.4);
  border-left-color: #7aa2f7;
  background: rgba(122,162,247,0.08);
}
.walle-external-interaction.tone-blocked {
  border-color: rgba(247,118,142,0.4);
  border-left-color: #f7768e;
  background: rgba(247,118,142,0.08);
}
.walle-external-interaction-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.walle-external-interaction-title {
  min-width: 0;
  margin: 0;
  color: var(--fg, #c0caf5);
  font-size: 14px;
  font-weight: 780;
  overflow-wrap: anywhere;
}
.walle-external-interaction-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #f6c177;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.walle-external-interaction-detail {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--fg, #c0caf5);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.walle-external-interaction-facts,
.walle-external-interaction-privacy {
  margin: 6px 0 0;
  color: var(--fg-dim, #9aa5ce);
  font-size: 11px;
}
.walle-external-interaction-shield {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(187,154,247,0.13);
  color: #d8c7ff;
  font-size: 12px;
  font-weight: 680;
}
.walle-external-interaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.walle-external-interaction-more { position: relative; min-width: 0; }
.walle-external-interaction-more > summary {
  box-sizing: border-box;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(122,162,247,0.38);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}
.walle-external-interaction-more > summary::-webkit-details-marker { display: none; }
.walle-external-interaction-more-menu {
  display: grid;
  gap: 6px;
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border, #3b4261);
  border-radius: 8px;
  background: var(--bg-card, #24283b);
  box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
.walle-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;
}
.walle-external-interaction-confirm {
  display: grid; gap: 8px; margin-top: 12px; padding: 10px;
  border: 1px solid currentColor; border-radius: 8px;
}
.walle-external-interaction-action,
.walle-external-interaction-fallback button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid rgba(122,162,247,0.38);
  border-radius: 8px;
  background: rgba(122,162,247,0.12);
  color: var(--fg, #c0caf5);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}
.walle-external-interaction-action.primary {
  border-color: #7aa2f7;
  background: #7aa2f7;
  color: #111827;
}
.walle-external-interaction-action.danger {
  border-color: rgba(247,118,142,0.5);
  background: rgba(247,118,142,0.1);
  color: #fda4af;
}
.walle-external-interaction-action:hover:not(:disabled),
.walle-external-interaction-action:focus-visible,
.walle-external-interaction-fallback button:focus-visible {
  border-color: #a9bffb;
  outline: 2px solid rgba(122,162,247,0.42);
  outline-offset: 2px;
}
.walle-external-interaction[aria-busy="true"] .walle-external-interaction-action,
.walle-external-interaction-action:disabled { cursor: progress; opacity: 0.58; }
.walle-external-interaction-fallback {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.walle-external-interaction-fallback label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.walle-external-interaction-fallback textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 10px;
  border: 1px solid rgba(122,162,247,0.36);
  border-radius: 7px;
  background: rgba(15,19,36,0.8);
  color: var(--fg, #c0caf5);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.walle-external-interaction.is-compact {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-left-width: 2px;
}
.walle-external-interaction.is-compact .walle-external-interaction-status { flex: 1 1 auto; }
.walle-external-interaction.is-compact .walle-external-interaction-actions {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  margin-top: 0;
  overflow: visible;
}
.walle-external-interaction.is-compact .walle-external-interaction-action { white-space: nowrap; }
html[data-theme="light"] .walle-external-interaction {
  border-color: rgba(154,103,20,0.34);
  border-left-color: #985900;
  background: #fff8ea;
  color: #20242c;
}
html[data-theme="light"] .walle-external-interaction.tone-sensitive {
  border-color: rgba(104,71,166,0.36);
  border-left-color: #6847a6;
  background: #f6f1ff;
}
html[data-theme="light"] .walle-external-interaction-title,
html[data-theme="light"] .walle-external-interaction-detail { color: #20242c; }
html[data-theme="light"] .walle-external-interaction-badge { color: #744300; background: #fff8ea; }
html[data-theme="light"] .walle-external-interaction-action.danger {
  color: #8b1735; border-color: #8b1735; background: #fff;
}
html[data-theme="light"] .walle-external-interaction-facts,
html[data-theme="light"] .walle-external-interaction-privacy { color: #5d6574; }
html[data-theme="light"] .walle-external-interaction-shield {
  background: #eee8f8;
  color: #4f347f;
}
html[data-theme="light"] .walle-external-interaction-fallback textarea {
  background: #fff;
  color: #20242c;
}

/* --- Session header (Sprint 2: merged with toolbar; single chrome row) --- */
.walle-session-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-card, #24283b);
  border-bottom: 1px solid var(--border, #3b4261);
  flex-shrink: 0;
  min-height: 44px;
}
/* Overflow menu trigger (rare actions like Copy Command live here now). */
.walle-header-overflow {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--fg-dim, #565f89);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 8px;
  height: 24px;
  font-family: inherit;
}
.walle-header-overflow:hover,
.walle-header-overflow:focus-visible {
  background: rgba(255,255,255,0.05);
  color: var(--fg, #c0caf5);
  border-color: var(--border, #3b4261);
  outline: none;
}
.walle-header-overflow-menu {
  background: var(--bg-card, #24283b);
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 180px;
  padding: 4px;
}
.walle-header-overflow-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--fg, #c0caf5);
  text-align: left;
  padding: 6px 10px;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.walle-header-overflow-item:hover,
.walle-header-overflow-item:focus-visible {
  background: rgba(122, 162, 247, 0.12);
  outline: none;
}
/* Sectioned menu (CTM-consistent: grouped Session / Review labels + divider). */
.walle-header-overflow-section {
  padding: 6px 10px 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-dim, #565f89);
  user-select: none;
}
.walle-header-overflow-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border, #3b4261);
}
/* Compaction nudge — reuses the Claude/Codex `.compact-banner` (defined in
   index.html), but anchored to `.walle-session` below the 44px header. */
.walle-session > .walle-compact-banner {
  top: 52px;
  z-index: 12;
}
.walle-session-header .walle-icon {
  font-size: 22px;
  line-height: 1;
}
/* Single-row identity: title · folder · N msgs, vertically centred against the
   model chip / nav / ⋯ cluster on the right. The title yields space first
   (ellipsis); the short basename + count never need to shrink. */
.walle-session-header .session-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.walle-session-header .session-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg, #c0caf5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 3ch;
}
/* cwd · msgs meta now LEADS the right-aligned control cluster (no title/icon on
   the left — CTM-faithful), so it centre-aligns against the 24px chip/nav/⋯. */
.walle-session-header .session-meta {
  font-size: 12px;
  color: var(--fg-dim, #565f89);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  /* Clip a pathological long basename instead of overlapping the right-side
     chip. The edit-picker flow toggles this to `visible` while editing so the
     path-suggestions dropdown isn't cut off (see renderSessionCwdControl). */
  overflow: hidden;
}
.walle-session-header .session-meta-sep {
  flex: 0 0 auto;
  color: var(--fg-dim, #565f89);
  opacity: 0.55;
}
.walle-session-header .session-meta-count {
  flex: 0 0 auto;
}
.walle-lineage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(122,162,247,0.18);
  background: rgba(122,162,247,0.08);
  color: var(--fg-dim, #565f89);
  font-size: 11px;
}
/* Working directory: folder icon + basename, both opening the path picker. */
.walle-session-header .session-cwd {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.walle-session-header .session-cwd-icon {
  display: inline-flex;
  align-self: center;
  color: var(--fg-dim, #565f89);
  cursor: pointer;
  flex: 0 0 auto;
  transition: color 0.12s ease;
}
.walle-session-header .session-cwd:hover .session-cwd-icon,
.walle-session-header .session-cwd-icon:hover {
  color: var(--accent, #7aa2f7);
}
/* Working-directory path: brighter + clearly clickable (it opens a path picker). */
.walle-session-header .session-cwd-label {
  color: var(--fg-muted, #8b94bd);
  font-weight: 500;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px dashed color-mix(in srgb, var(--fg-muted, #8b94bd) 55%, transparent);
  transition: color 0.12s ease, border-color 0.12s ease;
}
.walle-session-header .session-cwd-label:hover,
.walle-session-header .session-cwd-label:focus-visible {
  color: var(--fg, #c0caf5);
  border-bottom-color: var(--accent, #7aa2f7);
  outline: none;
}
.walle-session-header .session-cwd-empty {
  font-style: italic;
  color: var(--fg-dim, #565f89);
}
/* Inline path picker (reuses the New Session picker harness) sized for the header row. */
.walle-session-header .session-cwd-picker {
  display: inline-block;
  vertical-align: middle;
  min-width: 340px;
  max-width: 60vw;
}
.walle-session-header .session-cwd-picker .ns-path-input-row input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg, #c0caf5);
  border: 1px solid var(--accent, #7aa2f7);
  border-radius: 5px;
  padding: 3px 104px 3px 8px;
  font-size: 12.5px;
}
.session-workspace-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 18, 0.58);
}
.session-workspace-modal {
  width: min(640px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: visible;
  background: var(--panel-bg, #1f2335);
  color: var(--fg, #c0caf5);
  border: 1px solid var(--border, #414868);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 18px;
}
.session-workspace-modal h2 {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}
.session-workspace-form {
  display: grid;
  gap: 12px;
}
.session-workspace-label {
  display: grid;
  gap: 6px;
  color: var(--fg-muted, #8b94bd);
  font-size: 12px;
  font-weight: 650;
}
.session-workspace-picker {
  position: relative;
}
.session-workspace-picker .ns-path-input-row input,
.session-workspace-branch-input,
.session-workspace-base-input {
  width: 100%;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg, #c0caf5);
  border: 1px solid var(--border, #414868);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.session-workspace-picker .ns-path-input-row input {
  padding-right: 108px;
}
.session-workspace-picker .ns-path-suggestions {
  z-index: 10045;
}
.session-workspace-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: var(--fg, #c0caf5);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.session-workspace-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}
.session-workspace-toggle span {
  min-width: 0;
}
.session-workspace-worktree-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
}
.session-workspace-branch-input:disabled,
.session-workspace-base-input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.session-workspace-status {
  min-height: 20px;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  line-height: 1.4;
}
.session-workspace-status.info {
  color: var(--accent, #7aa2f7);
}
.session-workspace-status.error {
  color: var(--danger, #f7768e);
}
.session-workspace-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.session-workspace-actions button {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.session-workspace-secondary {
  color: var(--fg-muted, #8b94bd);
  background: transparent;
  border: 1px solid var(--border, #414868);
}
.session-workspace-primary {
  color: #101421;
  background: var(--accent, #7aa2f7);
  border: 1px solid var(--accent, #7aa2f7);
}
.session-workspace-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}
@media (max-width: 700px) {
  .session-workspace-modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }
  .session-workspace-modal {
    width: 100%;
  }
  .session-workspace-worktree-fields {
    grid-template-columns: 1fr;
  }
  .session-workspace-actions {
    justify-content: stretch;
  }
  .session-workspace-actions button {
    flex: 1 1 0;
  }
}

.walle-prompt-purge-progress {
  min-height: 40px;
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 9px 10px;
  border-left: 3px solid var(--yellow, #e0af68);
  background: color-mix(in srgb, var(--yellow, #e0af68) 9%, transparent);
  color: var(--fg, #c0caf5);
  font-weight: 650;
}

.walle-purge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 13, 0.76);
}

.walle-purge-dialog {
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border, #3b4261);
  border-radius: 8px;
  background: var(--bg2, #1f2335);
  color: var(--fg, #c0caf5);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.walle-purge-dialog h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

.walle-purge-dialog p { margin: 0; line-height: 1.55; }
.walle-purge-impact { margin: 16px 0; padding-left: 22px; }
.walle-purge-impact li + li { margin-top: 5px; }
.walle-purge-boundary { margin-top: 16px !important; color: var(--fg-dim, #7f89ad); font-size: 12px; }
.walle-purge-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.walle-purge-confirm { min-width: 132px; background: var(--red, #f7768e); color: #11131d; }

@media (max-width: 520px) {
  .walle-purge-backdrop { padding: 12px; }
  .walle-purge-dialog { max-height: calc(100vh - 24px); padding: 16px; }
  .walle-purge-actions { flex-direction: column-reverse; }
  .walle-purge-actions button { width: 100%; min-height: 42px; }
}
.walle-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.walle-prompt-nav .walle-response-toggle {
  width: auto;
  min-width: 62px;
  padding: 0 8px;
  white-space: nowrap;
}
.walle-session-header .model-select {
  background: var(--bg, #1a1b26);
  color: var(--fg, #c0caf5);
  border: 1px solid var(--border, #3b4261);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  max-width: 180px;
}
/* Model chip — mirrors the Claude/Codex `.model-switch-chip` (glyph + short name
   + dim "· tokens · ctx%" badge), but stays clickable as the Wall-E model picker. */
.walle-model-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 320px;
  height: 24px;
  padding: 0 8px;
  background: var(--bg-input, var(--bg, #1a1b26));
  color: var(--fg, #c0caf5);
  border: 1px solid var(--border, #3b4261);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.walle-model-picker-btn.toolbar {
  margin-left: auto;
  min-width: 0;
}
.walle-model-picker-btn:hover,
.walle-model-picker-btn:focus-visible {
  border-color: #7aa2f7;
  outline: none;
  box-shadow: 0 0 0 1px rgba(122,162,247,0.25);
}
.walle-model-picker-provider {
  color: #7aa2f7;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}
.walle-model-picker-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-model-picker-arrow {
  flex-shrink: 0;
  margin-left: 4px;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  line-height: 1;
}
.walle-model-picker-token {
  min-width: 0;
  flex-shrink: 0;
  overflow: hidden;
}
/* Match CTM's dim token badge exactly: tabular-nums, no monospace, inherits 11px. */
.walle-model-picker-token .model-token-badge {
  display: inline-block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg-dim, #7a82a8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: baseline;
}
.walle-model-picker-token .model-token-badge.ctx-full {
  color: var(--warning, #e0af68);
}
.walle-stat-badge {
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--fg-dim, #565f89);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #3b4261);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}
.walle-stat-badge.cost {
  color: #e0af68;
}

.walle-model-popover {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  max-height: min(620px, calc(100vh - 24px));
  background: #181b28;
  color: var(--fg, #c0caf5);
  border: 1px solid #3b4261;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  overflow: hidden;
}
.walle-model-panes {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
  min-height: 360px;
  overflow: hidden;
}
.walle-model-search {
  flex: 0 0 auto;
  margin: 10px;
  height: 34px;
  padding: 6px 10px;
  background: #11131d;
  color: var(--fg, #c0caf5);
  border: 1px solid #3b4261;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.walle-model-search:focus {
  border-color: #7aa2f7;
  box-shadow: 0 0 0 1px rgba(122,162,247,0.25);
}
.walle-model-list {
  overflow-y: auto;
  padding: 0 8px 8px;
  border-right: 1px solid #30364f;
}
.walle-model-config {
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
  background: #151824;
}
.walle-model-config-eyebrow,
.walle-model-effort-label {
  color: #8f98c7;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.walle-model-config-title {
  margin-top: 8px;
  color: var(--fg, #c0caf5);
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.walle-model-config-provider {
  margin-top: 5px;
  color: #8f98c7;
  font-size: 12px;
  line-height: 1.4;
}
.walle-model-effort-label {
  margin-top: 24px;
}
.walle-model-effort-choices {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.walle-model-effort-choice,
.walle-model-effort-fixed {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #3b4261;
  border-radius: 6px;
  background: #1b1f2f;
  color: var(--fg, #c0caf5);
  font: inherit;
  font-size: 12px;
  text-align: left;
}
.walle-model-effort-choice {
  cursor: pointer;
}
.walle-model-effort-choice:hover,
.walle-model-effort-choice:focus-visible,
.walle-model-effort-choice.selected {
  border-color: #7aa2f7;
  background: rgba(122,162,247,0.14);
  outline: none;
}
.walle-model-effort-note {
  margin-top: 10px;
  color: #8f98c7;
  font-size: 11px;
  line-height: 1.4;
}
.walle-model-section-title {
  padding: 9px 6px 5px;
  color: #8f98c7;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.walle-model-row {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: transparent;
  color: var(--fg, #c0caf5);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.walle-model-row:hover,
.walle-model-row:focus-visible,
.walle-model-row.kb-active,
.walle-model-row.selected {
  background: rgba(122,162,247,0.12);
  border-color: rgba(122,162,247,0.35);
  outline: none;
}
.walle-model-row-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.walle-model-row-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.walle-model-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.walle-model-cancel,
.walle-model-apply {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #3b4261;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.walle-model-cancel { background: transparent; color: var(--fg, #c0caf5); }
.walle-model-apply { background: #7aa2f7; border-color: #7aa2f7; color: #11131d; font-weight: 700; }
@media (max-width: 680px) {
  .walle-model-panes {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 1fr) auto;
    min-height: 0;
    overflow-y: auto;
  }
  .walle-model-list {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid #30364f;
  }
  .walle-model-config { overflow: visible; }
  .walle-model-footer { align-items: flex-start; gap: 8px; }
  .walle-model-source-note { min-width: 0; }
}
.walle-smart-routing-row {
  min-height: 46px;
}
.walle-smart-routing-copy,
.walle-model-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.walle-smart-routing-desc,
.walle-model-row-desc {
  min-width: 0;
  color: #8f98c7;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-smart-routing-agent-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 8px;
}
.walle-smart-routing-agent-label {
  color: #8f98c7;
  font-size: 11px;
  font-weight: 700;
  margin-right: 2px;
}
.walle-smart-routing-agent-btn {
  flex: 0 0 auto;
  background: transparent;
  color: #a9b1d6;
  border: 1px solid #3b4261;
  border-radius: 5px;
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.walle-smart-routing-agent-btn:hover,
.walle-smart-routing-agent-btn:focus-visible,
.walle-smart-routing-agent-btn.selected {
  color: var(--fg, #c0caf5);
  border-color: #7aa2f7;
  background: rgba(122,162,247,0.12);
  outline: none;
}
.walle-model-tag {
  flex: 0 0 auto;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: #a9b1d6;
  font-size: 10px;
  font-weight: 600;
}
.walle-model-tag.accent {
  background: rgba(34,197,94,0.14);
  color: #22c55e;
}
.walle-model-tag.muted {
  background: rgba(224,175,104,0.12);
  color: #e0af68;
}
.walle-model-tag.compact {
  background: rgba(122,162,247,0.14);
  color: #7aa2f7;
}
.walle-model-tag.route {
  max-width: 180px;
  background: rgba(122,162,247,0.14);
  color: #7aa2f7;
}
/* The route count is its own box: only the label is ellipsized. */
.walle-model-tag.has-suffix { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.walle-model-tag-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.walle-model-tag-suffix { flex: 0 0 auto; white-space: nowrap; }
/* U-4 caveat: the amber warning tone (same family as --warning), readable on both themes. */
.walle-model-tag.caveat {
  background: rgba(224,175,104,0.14);
  color: var(--warning, #e0af68);
}
html[data-theme="light"] .walle-model-tag.caveat {
  background: rgba(146,64,14,0.12);
  color: #92400e;
}
button.walle-model-tag {
  border: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}
button.walle-model-tag:focus-visible {
  outline: 1px solid #7aa2f7;
  outline-offset: 1px;
}
.walle-model-banner {
  font-size: 12px;
  color: #a9b1d6;
  padding: 2px 2px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.walle-model-banner button {
  background: none;
  border: 0;
  padding: 0;
  color: #7aa2f7;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
}
.walle-model-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid #2f354f;
  background: rgba(255,255,255,0.02);
}
.walle-model-source-note {
  min-width: 0;
  color: #8f98c7;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-model-legacy-toggle {
  flex: 0 0 auto;
  background: transparent;
  color: #8f98c7;
  border: 1px solid #3b4261;
  border-radius: 5px;
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.walle-model-legacy-toggle:hover {
  color: var(--fg, #c0caf5);
  border-color: #7aa2f7;
}
.walle-model-empty {
  padding: 18px 8px;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  text-align: center;
}

/* CtmModelPicker (public/js/model-picker.js): tab strip, inline apply error, options. */
.walle-model-row[role="option"].blocked { cursor: not-allowed; opacity: 0.6; }
.walle-model-row.kb-active { outline: 1px solid rgba(122,162,247,0.55); outline-offset: -1px; }
.ctm-model-picker-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid #30364f;
}
.ctm-model-picker-tab {
  padding: 6px 12px;
  background: transparent;
  color: #8f98c7;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ctm-model-picker-tab:hover,
.ctm-model-picker-tab:focus-visible { color: var(--fg, #c0caf5); outline: none; }
.ctm-model-picker-tab.selected {
  color: var(--fg, #c0caf5);
  background: #151824;
  border-color: #30364f;
  font-weight: 700;
}
/* Role options (R2-U2): the tablist drawn as two large Lead / Delegate options under a heading. */
.ctm-model-picker-tabs-heading {
  padding: 10px 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg, #c0caf5);
}
.ctm-model-picker-tabs.ctm-model-picker-roles {
  gap: 8px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid #30364f;
}
.ctm-model-picker-roles .ctm-model-picker-role {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid #30364f;
  border-radius: 8px;
  font-weight: 400;
}
.ctm-model-picker-roles .ctm-model-picker-role.selected {
  background: rgba(122,162,247,0.16);
  border-color: rgba(122,162,247,0.65);
  font-weight: 700;
}
.ctm-model-picker-role-dot { flex: 0 0 auto; line-height: 1.3; color: #7aa2f7; }
.ctm-model-picker-role-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ctm-model-picker-role-name { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.ctm-model-picker-role-purpose { font-size: 11px; font-weight: 400; color: #8f98c7; }
.ctm-model-picker-role-value { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctm-model-picker-alert {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #f7768e;
  background: rgba(247,118,142,0.08);
  border-top: 1px solid rgba(247,118,142,0.35);
  font-size: 12px;
}
.ctm-model-picker-alert[hidden] { display: none; }
.walle-model-popover button:disabled { opacity: 0.55; cursor: default; }
/* Delegate tab precedence ladder (public/js/session-model-picker.js): the winning rung is marked. */
.ctm-delegate-ladder { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; font-size: 12px; color: var(--fg-dim, #565f89); }
.ctm-delegate-rung.ctm-rung-winning { color: var(--fg, #c0caf5); font-weight: 700; }
/* WP-2 D-4 status strip (the Delegate tab's banner): In use / Your default with links. */
.ctm-delegate-strip { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 12px; color: #a9b1d6; }
.ctm-delegate-strip .ctm-delegate-strip-link {
  border: 0;
  padding: 0;
  background: none;
  color: #7aa2f7;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline dotted;
}
.ctm-delegate-strip .ctm-delegate-strip-link:hover,
.ctm-delegate-strip .ctm-delegate-strip-link:focus-visible { color: var(--fg, #c0caf5); outline: none; }
.ctm-delegate-strip .walle-model-tag { flex: 0 0 auto; margin-left: 4px; }
/* WP-2 D-5 route pane: the Route: opener, the back button and the radio-style route rows. */
button.walle-model-effort-note.ctm-route-line,
button.walle-model-effort-note.ctm-route-back {
  border: 0;
  padding: 0;
  background: none;
  color: #7aa2f7;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline dotted;
  text-align: left;
}
button.walle-model-effort-note.ctm-route-line:hover,
button.walle-model-effort-note.ctm-route-line:focus-visible,
button.walle-model-effort-note.ctm-route-back:hover,
button.walle-model-effort-note.ctm-route-back:focus-visible { color: var(--fg, #c0caf5); outline: none; }
.ctm-delegate-routes { display: grid; gap: 6px; margin-top: 8px; }
.ctm-delegate-route {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 7px 10px;
  border: 1px solid #3b4261;
  border-radius: 6px;
  background: #1b1f2f;
  color: var(--fg, #c0caf5);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ctm-delegate-route:hover,
.ctm-delegate-route:focus-visible,
.ctm-delegate-route[aria-checked="true"] {
  border-color: #7aa2f7;
  background: rgba(122,162,247,0.14);
  outline: none;
}
.ctm-delegate-route:disabled { opacity: 0.55; cursor: default; }
.ctm-delegate-route-facts { color: #8f98c7; font-size: 11px; }

/* --- Chat messages area --- */
.walle-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  outline: none; /* no focus ring — keyboard events redirect to input */
  overflow-anchor: none;
}
.walle-messages:not([data-walle-history-has-older="true"]):has(> .walle-turn)::before {
  content: '';
  flex: 1 0 0;
}
.walle-turn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  /* WP-3: the column, not the answer body, owns the readable measure — see
     the design's D-7 (the 2026-08-20 fix pinned the measure to the body,
     which is why short answers still floated in the middle of the panel). */
  max-width: var(--walle-turn-measure, 84ch);
  margin-inline: auto;
  border: 1px solid rgba(59,66,97,0.72);
  border-radius: 10px;
  background: rgba(18,21,34,0.42);
  padding: 6px;
}
.walle-turn.latest-prompt-turn {
  border-color: rgba(122,162,247,0.36);
  background: rgba(20,24,40,0.56);
}
.walle-turn.setup-turn {
  border-style: dashed;
}
/* WP-3 carryover: a turn with no prompt bubble whose output couldn't be
   attributed to a prompt — labeled like .setup-turn's label (same
   .walle-turn-setup-label rule below already gives it the font-size/dim
   color), plus an 8px top margin so it doesn't sit flush against the card
   edge. */
.walle-turn-unattributed .walle-turn-setup-label {
  margin-top: 8px;
}
.walle-turn-prompt {
  min-width: 0;
}
.walle-turn-prompt .walle-msg {
  background: rgba(122,162,247,0.055);
  border-left-color: rgba(122,162,247,0.55);
}
.walle-turn-setup-label {
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  text-transform: uppercase;
}
.walle-turn-responses {
  margin-left: 40px;
  padding-left: 10px;
  border-left: 1px solid rgba(122,162,247,0.18);
  min-width: 0;
}
.walle-turn-responses > summary {
  list-style: none;
}
.walle-turn-responses > summary::-webkit-details-marker {
  display: none;
}
.walle-turn-response-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  max-width: 100%;
  border-radius: 6px;
  color: var(--fg-dim, #565f89);
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.walle-turn-response-summary:hover,
.walle-turn-response-summary:focus-visible {
  background: rgba(122,162,247,0.07);
  color: var(--fg, #c0caf5);
  outline: none;
}
.walle-turn-chevron {
  color: var(--fg-dim, #565f89);
  font-size: 9px;
  transition: transform 0.15s ease;
}
.walle-turn-responses[open] .walle-turn-chevron {
  transform: rotate(90deg);
}
.walle-turn-response-label {
  color: var(--fg, #c0caf5);
  font-weight: 700;
}
.walle-turn-response-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-turn-response-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-top: 6px;
}
/* Change 2: a coding-turn's assistant answer renders straight into the
   responses body — no avatar column — so its card shares the same left
   edge as the activity cards above it instead of sitting ~38px further
   right (28px avatar + 10px gap). The .walle-turn-responses rail above
   (margin-left/padding-left) is unaffected; this only removes the extra
   per-answer offset. */
.walle-turn-answer {
  min-width: 0;
}
.walle-turn-narration {
  min-width: 0;
  color: var(--fg, #c0caf5);
}
.walle-turn-narration.compact {
  padding: 3px 8px;
  border-left: 2px solid var(--border, #37415f);
  color: var(--fg-dim, #9aa5ce);
  font-size: 12px;
}
.walle-turn-narration.substantive {
  padding: 10px 12px;
  border: 1px solid var(--border, #37415f);
  border-radius: 6px;
  background: var(--bg-panel, #1f2335);
}
.walle-live-narration { white-space: pre-wrap; }
.walle-turn-narration-body > :first-child { margin-top: 0; }
.walle-turn-narration-body > :last-child { margin-bottom: 0; }
.walle-turn-empty {
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  padding: 4px 0 8px;
}
/* WP-3 carryover: "No response recorded" — same size/color as the base
   .walle-turn-empty rule above (shared with "Waiting for Wall-E
   response…"), just italic so the two states read distinctly. */
.walle-turn-empty-no-response {
  font-style: italic;
}
.walle-inline-workbar-slot {
  padding: 0;
  background: transparent;
}
.walle-inline-workbar-slot .walle-workbar {
  margin: 0 0 8px;
}
@media (max-width: 760px) {
  .walle-turn-responses {
    margin-left: 0;
  }
}

.walle-composer-resize {
  flex: 0 0 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card, #24283b);
  border-top: 1px solid var(--border, #3b4261);
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.walle-composer-resize-grip {
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: rgba(122,162,247,0.28);
  box-shadow: 0 0 0 1px rgba(122,162,247,0.08);
  opacity: 0.68;
  transition: width 0.12s ease, background 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}
.walle-composer-resize:hover,
.walle-composer-resize:focus-visible,
.walle-composer-resize.dragging {
  background: color-mix(in srgb, var(--bg-card, #24283b) 82%, #7aa2f7);
  border-top-color: rgba(122,162,247,0.6);
  outline: none;
}
.walle-composer-resize:hover .walle-composer-resize-grip,
.walle-composer-resize:focus-visible .walle-composer-resize-grip,
.walle-composer-resize.dragging .walle-composer-resize-grip {
  width: 74px;
  background: rgba(122,162,247,0.76);
  box-shadow: 0 0 0 2px rgba(122,162,247,0.14);
  opacity: 1;
}
body.walle-composer-resizing {
  cursor: row-resize;
  user-select: none;
}

/* Sprint 3: empty-state — shown only when a session opens with zero
   messages. Three example chips that prefill the input on click. */
.walle-empty-state {
  margin: auto;
  padding: 24px 16px;
  text-align: center;
  user-select: none;
}
.walle-empty-headline {
  font-size: 13px;
  color: var(--fg-dim, #565f89);
  margin-bottom: 12px;
}
.walle-empty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.walle-empty-chip {
  background: var(--bg-card, #24283b);
  border: 1px solid var(--border, #3b4261);
  color: var(--fg, #c0caf5);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.walle-empty-chip:hover,
.walle-empty-chip:focus-visible {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--fg, #c0caf5);
  outline: none;
}

.walle-history-notice-state {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 34px;
  margin: 10px 12px;
  padding: 7px 10px;
  border: 1px solid rgba(122,162,247,0.22);
  border-radius: 6px;
  background: rgba(122,162,247,0.06);
  color: var(--fg-muted, #8f98c7);
  font-size: 12px;
  line-height: 1.35;
}
.walle-history-loading-state {
  margin: auto;
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid rgba(122,162,247,0.26);
  border-radius: 8px;
  background: var(--bg-card, #24283b);
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
  text-align: left;
  user-select: none;
}
.walle-history-content-status {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  margin: 0 10px 8px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(122,162,247,0.18);
  background: var(--bg, #1a1b26);
  color: var(--fg-muted, #8f98c7);
  font-size: 12px;
}
.walle-history-recent-boundary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 14px 12px;
  color: var(--fg-muted, #8f98c7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.walle-history-recent-boundary::before,
.walle-history-recent-boundary::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(122,162,247,0.22);
}
.walle-present-sentinel {
  width: 100%;
  height: 1px;
  min-height: 1px;
  overflow: hidden;
  pointer-events: none;
}
.walle-history-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(122,162,247,0.28);
  background: rgba(122,162,247,0.10);
  color: #9ab5ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.walle-history-loading-badge.error {
  border-color: rgba(248,113,113,0.34);
  background: rgba(248,113,113,0.10);
  color: #fca5a5;
}
.walle-history-error-retry {
  margin-top: 14px;
}
.walle-history-loading-spinner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(154,181,255,0.25);
  border-top-color: #9ab5ff;
  animation: walle-history-spin 0.85s linear infinite;
}
.walle-history-loading-title {
  color: var(--fg, #c0caf5);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}
.walle-history-loading-copy {
  color: var(--fg-muted, #8f98c7);
  font-size: 13px;
  line-height: 1.45;
}
@keyframes walle-history-spin {
  to { transform: rotate(360deg); }
}

.walle-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
  padding: 6px 10px 6px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background 0.12s ease;
}
/* Subtle role differentiation: assistant gets a small bg lift + amber rail
   so it visually anchors as the agent's reply. User stays transparent. */
.walle-msg[data-walle-role="assistant"] {
  background: rgba(245, 158, 11, 0.04);
  border-left-color: rgba(245, 158, 11, 0.5);
}
.walle-msg[data-walle-role="user"] {
  background: transparent;
  border-left-color: transparent;
}

/* Date divider — sits between messages on day boundaries. Slack/Discord style. */
.walle-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 4px;
  position: relative;
  user-select: none;
}
.walle-date-divider::before,
.walle-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #3b4261);
  opacity: 0.5;
}
.walle-date-divider span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #565f89);
  background: transparent;
  padding: 0 12px;
}
.walle-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.walle-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}
.walle-msg-avatar.user {
  background: #4a9eff;
}
.walle-msg-avatar.assistant {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.walle-msg-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg, #c0caf5);
}
.walle-msg-time {
  font-size: 11px;
  color: var(--fg-dim, #565f89);
}

.walle-outbox-state {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 16px;
}

.walle-outbox-state.pending {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
}

.walle-outbox-state.failed {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  color: var(--danger);
}

.walle-outbox-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.walle-msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}
.walle-msg:hover .walle-msg-actions,
.walle-msg:focus-within .walle-msg-actions {
  opacity: 1;
}
.walle-msg-action,
.walle-branch-btn {
  height: 22px;
  border: 1px solid rgba(122,162,247,0.28);
  border-radius: 4px;
  background: rgba(26,27,38,0.72);
  color: var(--accent, #7aa2f7);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  padding: 0 7px;
  cursor: pointer;
}
.walle-msg-action:hover,
.walle-msg-action:focus-visible,
.walle-branch-btn:hover,
.walle-branch-btn:focus-visible {
  border-color: rgba(122,162,247,0.68);
  background: rgba(65,72,104,0.78);
  color: var(--fg, #c0caf5);
  outline: none;
}
.walle-msg-action.danger {
  color: var(--red, #f7768e);
  border-color: rgba(247,118,142,0.28);
}
.walle-msg-action.danger:hover,
.walle-msg-action.danger:focus-visible {
  border-color: rgba(247,118,142,0.7);
}
.walle-msg-action:disabled {
  opacity: 0.42;
  cursor: default;
}
.walle-msg-more {
  position: relative;
}
.walle-msg-more > summary {
  width: 24px;
  padding: 0;
  text-align: center;
  list-style: none;
}
.walle-msg-more > summary::-webkit-details-marker {
  display: none;
}
.walle-msg-more-menu {
  position: absolute;
  top: 26px;
  right: 0;
  z-index: 12;
  padding: 4px;
  border: 1px solid rgba(122,162,247,0.28);
  border-radius: 5px;
  background: var(--bg, #1a1b26);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.walle-msg-more-menu .walle-msg-action {
  width: max-content;
  white-space: nowrap;
}
.walle-branch-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 2px;
}
.walle-branch-btn {
  width: 22px;
  padding: 0;
}
.walle-branch-btn:disabled {
  opacity: 0.42;
  cursor: default;
}
.walle-branch-label {
  min-width: 32px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-dim, #565f89);
}
.walle-attempt-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.walle-attempt-picker {
  min-width: 180px;
  max-width: 100%;
  height: 26px;
  border: 1px solid rgba(122,162,247,0.28);
  border-radius: 4px;
  background: rgba(26,27,38,0.72);
  color: var(--fg, #c0caf5);
  font-size: 11px;
}
.walle-attempt-label {
  color: var(--fg-dim, #565f89);
  font-size: 11px;
}
.walle-msg-model {
  font-size: 10px;
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}
.walle-msg-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg, #c0caf5);
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
  min-width: 0;
  user-select: text;
  cursor: text;
}
.walle-msg-body p { margin: 0 0 8px; }
.walle-msg-body p:last-child { margin-bottom: 0; }
.walle-msg-body hr {
  border: 0;
  height: 1px;
  margin: 10px 0;
  background: linear-gradient(90deg, rgba(86,95,137,0), rgba(86,95,137,0.48), rgba(86,95,137,0));
}
.walle-msg-body hr:first-child { margin-top: 6px; }
.walle-msg-body hr:last-child { margin-bottom: 6px; }
.walle-copy-block {
  position: relative;
  margin: 8px 0;
}
.walle-msg-body pre {
  background: var(--bg, #1a1b26);
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12px;
  margin: 8px 0;
}
.walle-copy-block pre {
  margin: 0;
  padding-right: 68px;
  min-height: 28px;
}
.walle-copy-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(122,162,247,0.35);
  border-radius: 4px;
  background: rgba(26,27,38,0.92);
  color: #7aa2f7;
  font-size: 11px;
  font-weight: 600;
  line-height: 22px;
  cursor: pointer;
  z-index: 1;
}
.walle-copy-btn:hover {
  border-color: rgba(122,162,247,0.75);
  background: rgba(41,46,66,0.96);
  color: #c0caf5;
}
.walle-copy-btn:disabled {
  cursor: default;
  opacity: 0.78;
}
.walle-msg-body code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9em;
  background: rgba(255,255,255,0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.walle-msg-body pre code {
  background: none;
  padding: 0;
}
.walle-msg-body table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  width: 100%;
}
.walle-msg-body th,
.walle-msg-body td {
  border: 1px solid var(--border, #3b4261);
  padding: 4px 8px;
  text-align: left;
}
.walle-msg-body th {
  background: rgba(255,255,255,0.04);
  font-weight: 600;
}
.walle-msg-body ul,
.walle-msg-body ol {
  margin: 4px 0 8px 18px;
}
.walle-msg-body li {
  margin-bottom: 2px;
}
.walle-msg-body blockquote {
  border-left: 3px solid var(--border, #3b4261);
  padding-left: 10px;
  margin: 6px 0;
  color: var(--fg-dim, #565f89);
}
.walle-answer-card {
  margin: 8px 0;
  border: 1px solid rgba(122,162,247,0.22);
  border-left: 3px solid rgba(122,162,247,0.68);
  border-radius: 10px;
  background: rgba(26,27,38,0.48);
  overflow: hidden;
}
.walle-answer-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(122,162,247,0.14);
  background: linear-gradient(180deg, rgba(122,162,247,0.065), transparent);
}
.walle-answer-card-header.answer {
  border-bottom-color: rgba(125,207,255,0.16);
}
.walle-answer-card-header.summary {
  border-bottom-color: rgba(158,206,106,0.16);
}
.walle-answer-card-header.missing {
  border-bottom-color: rgba(247,118,142,0.16);
}
.walle-external-action-audit-card {
  border-color: rgba(224,175,104,0.3);
  border-left-color: rgba(224,175,104,0.82);
  background: rgba(38,31,24,0.5);
}
.walle-external-action-audit-card .walle-answer-card-header {
  border-bottom-color: rgba(224,175,104,0.2);
  background: rgba(224,175,104,0.07);
}
.walle-external-action-audit-card .walle-msg-body {
  color: var(--fg-muted, #a9b1d6);
  font-size: 13px;
}
.walle-answer-card-title {
  /* Quiet label register (uppercase, tracked, muted) — the card's CONTENT is
     the loud element, not its chrome. 800-weight 12px read as a shouty chip. */
  color: var(--fg-dim, #9aa5ce);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Change 2: the "Wall-E" name (+ model chip, when it differs from the
   session default) that used to live in the .walle-msg avatar row now
   folds into the answer card header, ahead of the "Final answer" title. */
.walle-answer-card-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.walle-answer-card-identity-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--fg, #c0caf5);
  white-space: nowrap;
}
.walle-answer-card-copy-btn {
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(122,162,247,0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}
.walle-answer-card-copy-btn:hover {
  border-color: rgba(122,162,247,0.7);
  color: var(--fg, #c0caf5);
}
.walle-answer-card-copy-btn:disabled {
  cursor: default;
  opacity: 0.78;
}
.walle-answer-card-badge {
  border: 1px solid rgba(122,162,247,0.28);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(122,162,247,0.08);
  color: var(--fg-dim, #565f89);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.walle-answer-card-header.missing .walle-answer-card-badge {
  border-color: rgba(247,118,142,0.32);
  background: rgba(247,118,142,0.10);
  color: #f7768e;
}
.walle-answer-card-time {
  margin-left: auto;
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.walle-final-answer-card {
  border-left-color: rgba(125,207,255,0.72);
}
/* The final answer renders as a DOCUMENT, not a chat bubble: readable measure
   (~72ch), 14.5px/1.65 body, and headings scaled DOWN so a heading-heavy model
   summary (Claude) keeps one voice inside the card while a terse bullet list
   (Codex/GLM) still scans. Section separation comes from top-margin dominance
   and an h2 hairline, not from big type. The CJK tail in the font stack keeps
   GLM output (mixed CJK/Latin) on a proper CJK face instead of fallback glyphs. */
.walle-final-answer-body {
  /* WP-3: the measure now lives on `.walle-turn` (D-7); this body just fills
     the column instead of centring a narrower one inside it. */
  padding: 13px 16px 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
}
.walle-final-answer-body p { margin: 0 0 9px; }
.walle-final-answer-body h1,
.walle-final-answer-body h2,
.walle-final-answer-body h3,
.walle-final-answer-body h4 {
  margin: 1.25em 0 0.4em;
  line-height: 1.3;
  font-weight: 650;
  color: var(--fg, #c0caf5);
}
.walle-final-answer-body h1 { font-size: 1.24em; }
.walle-final-answer-body h2 {
  font-size: 1.13em;
  padding-top: 0.55em;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.walle-final-answer-body h3 { font-size: 1.04em; }
.walle-final-answer-body h4 { font-size: 1em; color: var(--fg-dim, #9aa5ce); }
.walle-final-answer-body h1:first-child,
.walle-final-answer-body h2:first-child,
.walle-final-answer-body h3:first-child,
.walle-final-answer-body h4:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.walle-final-answer-body strong {
  /* 700 bold blooms on dark backgrounds; 600 keeps emphasis without shouting. */
  font-weight: 600;
}
.walle-final-answer-body ul,
.walle-final-answer-body ol {
  margin: 4px 0 10px 20px;
}
.walle-final-answer-body li { margin-bottom: 4px; }
.walle-final-answer-body li > ul,
.walle-final-answer-body li > ol { margin-bottom: 4px; }
.walle-final-answer-body code {
  font-size: 0.88em;
  background: rgba(255,255,255,0.07);
  padding: 1.5px 5px;
  border-radius: 4px;
}
.walle-final-answer-body pre { font-size: 12.5px; overflow-x: auto; max-width: 100%; }
.walle-final-answer-body pre code { background: none; padding: 0; }
.walle-final-answer-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  font-size: 13px;
}
.walle-final-answer-body th,
.walle-final-answer-body td {
  /* Row hairlines only — full grids read as spreadsheets. */
  border: 0;
  border-bottom: 1px solid var(--border, #3b4261);
  padding: 5px 10px;
}
.walle-final-answer-body th { background: none; }
.walle-answer-card-copy {
  display: grid;
  gap: 5px;
  padding: 10px 12px 11px;
  color: var(--fg, #c0caf5);
  font-size: 12.5px;
  line-height: 1.5;
}
.walle-answer-card-copy strong {
  color: var(--fg, #c0caf5);
}
.walle-edit-card {
  border: 1px solid rgba(122,162,247,0.34);
  background: rgba(26,27,38,0.56);
  border-radius: 6px;
  padding: 8px;
}
.walle-edit-input {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--border, #3b4261);
  border-radius: 5px;
  background: rgba(15,17,26,0.78);
  color: var(--fg, #c0caf5);
  font: inherit;
  line-height: 1.5;
  padding: 8px 10px;
  outline: none;
}
.walle-edit-input:focus {
  border-color: var(--accent, #7aa2f7);
  box-shadow: 0 0 0 2px rgba(122,162,247,0.18);
}
.walle-edit-hint {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--fg-dim, #565f89);
}
.walle-edit-worktree {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--fg-muted, #9aa5ce);
  font-size: 12px;
}
.walle-edit-worktree input {
  width: 14px;
  height: 14px;
}
.walle-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.walle-canonical-projection-card {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  background: rgba(26, 27, 38, 0.48);
}
.walle-canonical-projection-card dl {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 4px 10px;
  margin: 8px 0;
  font-size: 12px;
}
.walle-canonical-projection-card dt { color: var(--fg-dim, #565f89); }
.walle-canonical-projection-card dd { margin: 0; overflow-wrap: anywhere; }
.walle-canonical-projection-card pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}
.walle-canonical-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --- Tool cards (Sprint 2: per-tool left-rail color for fast scannability) --- */
.walle-tool-card {
  background: var(--bg, #1a1b26);
  border: 1px solid var(--border, #3b4261);
  border-left: 2px solid #565f89;
  border-radius: 6px;
  margin: 6px 0;
  overflow: hidden;
}
/* Color the left rail by tool kind so a stack of 9 tool calls is scannable. */
.walle-tool-card[data-tool-name="run_shell"],
.walle-tool-card[data-tool-name="shell"],
.walle-tool-card[data-tool-name="bash"] { border-left-color: #a78bfa; }
.walle-tool-card[data-tool-name="read_file"],
.walle-tool-card[data-tool-name="glob"],
.walle-tool-card[data-tool-name="list_directory"],
.walle-tool-card[data-tool-name="ls"] { border-left-color: #7aa2f7; }
.walle-tool-card[data-tool-name="grep_files"],
.walle-tool-card[data-tool-name="grep"] { border-left-color: #7dcfff; }
.walle-tool-card[data-tool-name="edit_file"],
.walle-tool-card[data-tool-name="write_file"],
.walle-tool-card[data-tool-name="edit"],
.walle-tool-card[data-tool-name="write"] { border-left-color: #9ece6a; }
.walle-tool-card[data-tool-name="think"] { border-left-color: #e0af68; }
.walle-tool-card[data-tool-name="search_memories"] { border-left-color: #bb9af7; }
.walle-tool-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.walle-tool-header:hover,
.walle-tool-header:focus-visible {
  background: rgba(255,255,255,0.03);
  outline: none;
}
.walle-tool-arrow {
  font-size: 10px;
  color: var(--fg-dim, #565f89);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.walle-tool-card[data-expanded="true"] .walle-tool-arrow {
  transform: rotate(90deg);
}
.walle-tool-name {
  font-weight: 600;
  font-size: 12px;
  color: #a78bfa;
}
.walle-tool-summary {
  font-size: 12px;
  color: var(--fg, #c0caf5);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-tool-summary:empty {
  display: none;
}
/* Right-aligned duration chip — tertiary, dim, just enough signal. */
.walle-tool-duration {
  font-size: 10px;
  color: var(--fg-dim, #565f89);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.walle-tool-status {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.walle-tool-status.done {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.walle-tool-status.working {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.walle-tool-status.error {
  background: rgba(247,118,142,0.15);
  color: #f7768e;
}
.walle-tool-output,
.walle-tool-detail {
  display: none;
  padding: 8px 10px;
  border-top: 1px solid var(--border, #3b4261);
  background: linear-gradient(180deg, rgba(22,22,30,0.96), rgba(18,19,28,0.98));
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg, #c0caf5);
}
.walle-tool-output:empty { display: none !important; }
.walle-tool-card[data-expanded="true"] .walle-tool-output,
.walle-tool-card[data-expanded="true"] > .walle-tool-detail,
.walle-live-activity-item[open] > .walle-tool-detail {
  display: block;
}
.walle-tool-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.walle-tool-detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border: 1px solid rgba(122,162,247,0.18);
  border-radius: 999px;
  background: rgba(122,162,247,0.08);
  color: var(--fg-dim, #565f89);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.walle-tool-detail-chip.name {
  color: #a78bfa;
}
.walle-tool-detail-chip.done {
  border-color: rgba(158,206,106,0.28);
  background: rgba(158,206,106,0.10);
  color: #9ece6a;
}
.walle-tool-detail-chip.working {
  border-color: rgba(224,175,104,0.32);
  background: rgba(224,175,104,0.12);
  color: #e0af68;
}
.walle-tool-detail-chip.error {
  border-color: rgba(247,118,142,0.34);
  background: rgba(247,118,142,0.12);
  color: #f7768e;
}
.walle-tool-detail-chip.stopped {
  border-color: rgba(156,163,175,0.34);
  background: rgba(156,163,175,0.12);
  color: #9ca3af;
}
.walle-tool-detail-chip.interrupted {
  border-color: rgba(156,163,175,0.34);
  background: rgba(156,163,175,0.12);
  color: #9ca3af;
}
/* A tool card blocked on the user's approval — amber, matching the WORK-bar chip. */
.walle-tool-detail-chip.awaiting_permission {
  border-color: rgba(251,191,36,0.5);
  background: rgba(251,191,36,0.14);
  color: #fbbf24;
}
.walle-tool-detail-summary {
  margin: 2px 0 8px;
  color: var(--fg, #c0caf5);
  font-size: 12px;
}
.walle-tool-detail-section {
  margin-top: 8px;
}
.walle-tool-detail-label {
  margin-bottom: 4px;
  color: var(--fg-dim, #565f89);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.walle-tool-detail-pre {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(122,162,247,0.18);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(15,17,26,0.95), rgba(12,14,22,0.96)),
    radial-gradient(circle at 0 0, rgba(122,162,247,0.12), transparent 34%);
  color: var(--fg, #c0caf5);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 260px;
}
.walle-tool-detail-pre.output {
  max-height: 320px;
}
.walle-tool-detail-empty {
  color: var(--fg-dim, #565f89);
  font-size: 12px;
}

.walle-live-activity {
  margin: 10px 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border, #3b4261);
  border-left: 2px solid #e0af68;
  border-radius: 6px;
  background: rgba(36, 40, 59, 0.52);
}
.walle-live-activity-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
/* Change 3: the completed/stopped variant renders as <details>/<summary> so
   it collapses by default — reset the native marker/cursor the same way the
   turn-responses and per-step <details> summaries already do. */
.walle-live-activity > summary.walle-live-activity-header {
  cursor: pointer;
  list-style: none;
}
.walle-live-activity > summary.walle-live-activity-header::-webkit-details-marker {
  display: none;
}
.walle-live-activity-chevron {
  color: var(--fg-dim, #565f89);
  font-size: 9px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.walle-live-activity[open] .walle-live-activity-chevron {
  transform: rotate(90deg);
}
.walle-live-activity-title {
  color: #c0caf5;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.walle-live-activity-summary {
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* WP-V1: a terminal (interrupted) card's summary is the mandatory "what
   happened / nothing is running now" sentence — let it wrap instead of
   ellipsis-truncating like the old muted 1-line copy did. */
.walle-live-activity-summary.walle-terminal-detail {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  color: var(--fg, #c0caf5);
}
/* WP-V1 status vocabulary (design doc §4): interruption is invisible today —
   `.stopped` was stamped but had no rule at all. Family classes color-code
   the card by what actually happened (mapping: interrupted-by-user = blue/
   neutral "waiting on you", stopped-early = amber "needs you", failed /
   interrupted-infra = red "genuine failure"); `.stopped` alone (pre-WP-V2
   history with no usable terminal info) still gets a visible amber tell
   instead of silently blending into a completed card. */
.walle-live-activity.stopped {
  border-left-color: #e0af68;
  background: rgba(224, 175, 104, 0.06);
}
.walle-live-activity.walle-terminal-stopped-user {
  border-left-color: #7aa2f7;
  background: rgba(122, 162, 247, 0.08);
}
.walle-live-activity.walle-terminal-stopped-early {
  border-left-color: #e0af68;
  background: rgba(224, 175, 104, 0.08);
}
.walle-live-activity.walle-terminal-failed,
.walle-live-activity.walle-terminal-interrupted-infra {
  border-left-color: #f7768e;
  background: rgba(247, 118, 142, 0.08);
}
.walle-live-activity.walle-terminal-legacy {
  border-left-color: #e0af68;
  background: rgba(224, 175, 104, 0.06);
}

.walle-live-activity.walle-terminal-completed-caveat {
  border-color: var(--warning, #d9a441);
}

.walle-live-activity.walle-terminal-completed-caveat .walle-live-activity-title {
  color: var(--warning, #d9a441);
}
.walle-live-activity.walle-terminal-stopped-user .walle-live-activity-title {
  color: #7aa2f7;
}
.walle-live-activity.walle-terminal-stopped-early .walle-live-activity-title,
.walle-live-activity.walle-terminal-legacy .walle-live-activity-title {
  color: #e0af68;
}
.walle-live-activity.walle-terminal-failed .walle-live-activity-title,
.walle-live-activity.walle-terminal-interrupted-infra .walle-live-activity-title {
  color: #f7768e;
}
/* Defensive fallback for agent-ui-primitives.js's generic
   data-status="cancelled" stamp (createActivity) when, for whatever reason,
   no family class was added — never render a totally unstyled stopped card. */
.walle-live-activity[data-status="cancelled"] {
  border-left-color: #e0af68;
}
.walle-live-activity-stepmeta {
  margin-top: 3px;
  color: var(--fg-dim, #565f89);
  font-size: 11px;
}
.walle-live-focus {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 2px solid #7aa2f7;
  background: rgba(122, 162, 247, 0.07);
}
.walle-live-focus.reasoning {
  border-left-color: #bb9af7;
  background: rgba(187, 154, 247, 0.07);
}
.walle-live-focus-label {
  color: var(--fg-dim, #8b93b3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.walle-live-focus-body {
  margin-top: 3px;
  color: var(--fg, #c0caf5);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.walle-live-activity-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  /* Append-only progress log (WS1): show every step, but cap the panel height and
     scroll internally (pinned to the newest step) so a long turn reads like a
     scrollback without pushing the composer off-screen. */
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.walle-provider-attempts {
  margin-top: 8px;
  border-top: 1px solid rgba(122, 162, 247, 0.14);
  padding-top: 7px;
  color: var(--fg-muted, #8b93b3);
  font-size: 11px;
}
.walle-provider-attempts > summary {
  cursor: pointer;
  color: #e0af68;
  font-weight: 700;
}
.walle-provider-attempt {
  margin-top: 5px;
  padding-left: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
/* A segmented panel replays the turn's story (narration → tools → narration);
   give the prose room to read instead of a 340px letterbox. */
.walle-live-activity.has-narration .walle-live-activity-list {
  max-height: 60vh;
}
.walle-activity-narration {
  padding: 3px 2px 3px 22px;
}
.walle-activity-narration .walle-activity-narration-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg, #c0caf5);
}
.walle-activity-segments-dropped {
  color: var(--fg-dim, #565f89);
  font-size: 11.5px;
}
/* Reasoning uses the shared MR thinking pill (.thinking-block); this scopes its
   width/indent inside the activity list. The -fallback variant renders when MR
   hasn't loaded. */
.walle-live-activity-list .walle-activity-reasoning {
  margin: 2px 0 2px 22px;
}
.walle-activity-reasoning-fallback {
  border-left: 2px solid var(--border, #3b4261);
  padding: 2px 8px;
}
.walle-activity-reasoning-fallback > summary {
  cursor: pointer;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  list-style: none;
}
.walle-activity-reasoning-fallback > summary::-webkit-details-marker { display: none; }
.walle-activity-reasoning-fallback .walle-activity-reasoning-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-dim, #9aa5ce);
  padding: 4px 0 2px;
}
.walle-live-activity-item {
  display: block;
}
.walle-live-activity-item > summary {
  list-style: none;
}
.walle-live-activity-item > summary::-webkit-details-marker {
  display: none;
}
.walle-live-activity-row {
  display: grid;
  grid-template-columns: 12px 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  border-radius: 5px;
  cursor: pointer;
  padding: 1px 2px;
}
.walle-live-activity-row:hover,
.walle-live-activity-row:focus-visible,
.walle-live-activity-item[open] > .walle-live-activity-row {
  background: rgba(255,255,255,0.035);
  outline: none;
}
.walle-live-activity-arrow {
  color: var(--fg-dim, #565f89);
  font-size: 9px;
  transition: transform 0.16s ease;
}
.walle-live-activity-item[open] .walle-live-activity-arrow {
  transform: rotate(90deg);
}
.walle-live-activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #e0af68;
  box-shadow: 0 0 0 3px rgba(224, 175, 104, 0.12);
}
.walle-live-activity-row.done .walle-live-activity-dot {
  background: #9ece6a;
  box-shadow: 0 0 0 3px rgba(158, 206, 106, 0.12);
}
.walle-live-activity-row.error .walle-live-activity-dot {
  background: #f7768e;
  box-shadow: 0 0 0 3px rgba(247, 118, 142, 0.13);
}
.walle-live-activity-row.stopped .walle-live-activity-dot {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.12);
}
/* WP-V1 fixes V7: a call still 'working'/'awaiting_permission' when its turn
   ends is settled to 'interrupted' (never left reading "Wall-E is thinking"
   inside a dead card) — same neutral gray as .stopped, distinct status word. */
.walle-live-activity-row.interrupted .walle-live-activity-dot {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.12);
}
.walle-live-activity-main {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.walle-live-activity-name {
  color: #c0caf5;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.walle-live-activity-text {
  color: var(--fg, #c0caf5);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-live-activity-text:empty {
  display: none;
}
.walle-live-activity-meta,
.walle-live-activity-more {
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.walle-live-activity-row.working .walle-live-activity-meta {
  color: #e0af68;
}
.walle-live-activity-row.error .walle-live-activity-meta {
  color: #f7768e;
}
.walle-live-activity-row.stopped .walle-live-activity-meta {
  color: #9ca3af;
}
.walle-live-activity-row.interrupted .walle-live-activity-meta {
  color: #9ca3af;
}
.walle-live-activity-hidden {
  display: grid;
  gap: 5px;
}
.walle-live-activity-hidden[hidden] {
  display: none !important;
}
.walle-live-activity-more {
  width: max-content;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(122,162,247,0.08);
  color: var(--fg-dim, #565f89);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.walle-live-activity-more:hover,
.walle-live-activity-more:focus-visible {
  background: rgba(122,162,247,0.16);
  color: var(--fg, #c0caf5);
  outline: none;
}
.walle-live-activity-detail {
  margin: 3px 0 5px 20px;
  border: 1px solid rgba(122,162,247,0.16);
  border-radius: 8px;
}
/* Change 3: cwd fact folded off the removed synthesized summary card. */
.walle-live-activity-footer {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(122,162,247,0.14);
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  overflow-wrap: anywhere;
}

/* WP-V3: one-click Resume/Retry/Details on a terminal (interrupted) card —
   reuses the approval/permission-card action-row pattern (walle-perm-actions). */
.walle-terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.walle-terminal-action-btn {
  border: 1px solid var(--border, #3b4261);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg, #c0caf5);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.walle-terminal-action-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}
.walle-terminal-action-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.walle-terminal-action-btn.primary {
  border-color: rgba(122, 162, 247, 0.55);
  background: rgba(122, 162, 247, 0.14);
  color: #cfe0ff;
}
.walle-terminal-action-btn.primary:hover {
  background: rgba(122, 162, 247, 0.22);
}
.walle-terminal-details {
  flex-basis: 100%;
}
.walle-terminal-details > summary {
  cursor: pointer;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  list-style: none;
}
.walle-terminal-details > summary::-webkit-details-marker {
  display: none;
}
.walle-terminal-details-pre {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(122,162,247,0.16);
  border-radius: 6px;
  background: rgba(11,13,17,0.6);
  color: var(--fg-dim, #9aa5ce);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

/* WP-V3: composer-adjacent persistent affordance — a slim in-flow bar (not
   the .compact-banner absolute overlay, which anchors near the top) sitting
   just above the composer while the last turn ended interrupted. */
.walle-interrupted-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 7px 11px;
  border: 1px solid rgba(224, 175, 104, 0.4);
  border-left: 3px solid #e0af68;
  border-radius: 7px;
  background: rgba(224, 175, 104, 0.08);
  color: #e0af68;
  font-size: 12px;
}
.walle-interrupted-banner[hidden] {
  display: none;
}
.walle-interrupted-banner-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-interrupted-banner-resume {
  flex: 0 0 auto;
  border: 1px solid rgba(224, 175, 104, 0.5);
  background: rgba(224, 175, 104, 0.14);
  color: #e0af68;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
}
.walle-interrupted-banner-resume:hover {
  background: rgba(224, 175, 104, 0.22);
}
.walle-interrupted-banner-resume:disabled {
  opacity: 0.6;
  cursor: default;
}

/* WP-V5: one-line affordance appended under a queue item stranded against an
   interrupted session — same amber "waiting on you" tone as
   .walle-interrupted-banner so a stranded queued prompt reads as part of
   the same story, not a separate error. */
.walle-queue-stranded-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(224, 175, 104, 0.3);
  color: #e0af68;
  font-size: 11px;
  font-weight: 600;
}
.walle-queue-stranded-action {
  border: none;
  background: none;
  padding: 0;
  color: #e0af68;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.walle-queue-stranded-action:hover {
  color: #f2c689;
}
.walle-queue-stranded-action:disabled {
  opacity: 0.6;
  cursor: default;
  text-decoration: none;
}

.walle-final-narration {
  border-left-color: rgba(187,154,247,0.62);
  background: rgba(187,154,247,0.04);
}
.walle-final-narration > summary {
  list-style: none;
  cursor: pointer;
}
.walle-final-narration > summary::-webkit-details-marker {
  display: none;
}
.walle-final-narration > summary:hover,
.walle-final-narration > summary:focus-visible {
  outline: none;
}
.walle-final-narration-body {
  margin: 0;
  padding: 9px 12px 11px;
  border-top: 1px solid rgba(122,162,247,0.12);
  color: var(--fg-dim, #565f89);
  font-size: 12px;
}

.walle-tool-group {
  background: var(--bg, #1a1b26);
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  margin: 6px 0;
  overflow: hidden;
}
.walle-tool-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.walle-tool-group-header:hover,
.walle-tool-group-header:focus-visible {
  background: rgba(255,255,255,0.035);
  outline: none;
}
.walle-tool-group-arrow {
  font-size: 10px;
  color: var(--fg-dim, #565f89);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.walle-tool-group[data-expanded="true"] .walle-tool-group-arrow {
  transform: rotate(90deg);
}
.walle-tool-group-title {
  color: #c0caf5;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.walle-tool-group-summary {
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.walle-tool-group-status {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.walle-tool-group-status.error {
  background: rgba(247,118,142,0.15);
  color: #f7768e;
}
.walle-tool-group-body {
  display: none;
  border-top: 1px solid var(--border, #3b4261);
  padding: 6px 8px 8px;
}
.walle-tool-group[data-expanded="true"] .walle-tool-group-body {
  display: block;
}
.walle-tool-group-body .walle-tool-card {
  margin: 4px 0;
}

/* Spinner for in-progress tool calls */
.walle-tool-status.working::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1.5px solid rgba(245,158,11,0.3);
  border-top-color: #f59e0b;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  animation: walle-spin 0.8s linear infinite;
}
@keyframes walle-spin {
  to { transform: rotate(360deg); }
}

/* --- Composer persist wrapper (WI-1) ---
   Wraps the resize handle + input bar + hints so they can be built ONCE per
   session container and never detached again (detaching a focused element
   blurs it — that repeated blur on every websocket-driven re-render was the
   root cause of disrupted typing). `display: contents` means this wrapper
   generates no box of its own: its children remain direct flex items of
   `.walle-session`, so the existing flex-column layout below is unaffected. */
.walle-composer-persist {
  display: contents;
}

/* --- Input bar --- */
.walle-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px 12px;
  background: var(--bg-card, #24283b);
  border-top: 0;
  flex-shrink: 0;
  align-items: flex-end;
}
.walle-input-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* WP-5 (C-2): scope composer layout recalculation to this subtree so a
     forced reflow inside it (e.g. resizeComposerTextarea's height:'auto'
     measure) doesn't have to walk the rest of the page. Verified safe: no
     descendant (queue preview, attachment thumbs, composer toolbar/textarea,
     markdown preview) uses position:fixed/absolute expecting a containing
     block OUTSIDE this element -- the model picker, header overflow menu,
     slash-picker and prompt-submission tray are all appended to
     document.body / the session header, not this subtree. */
  contain: layout;
}
.walle-composer-attachments {
  display: flex;
}
.walle-queue-preview {
  display: none;
}
.walle-workbar-slot {
  flex: 0 0 auto;
  padding: 0 16px;
  background:
    linear-gradient(180deg, rgba(15,19,36,0), rgba(15,19,36,0.26)),
    var(--bg, #1a1b26);
}
.walle-workbar {
  margin: 0 0 6px;
  border: 1px solid rgba(122,162,247,0.20);
  border-radius: 9px;
  background: rgba(19,22,38,0.74);
  box-shadow: none;
  color: var(--fg, #c0caf5);
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
}
.walle-workbar.expanded {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
}
.walle-workbar-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}
.walle-workbar-kicker {
  color: #f6c177;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.walle-work-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(122,162,247,0.22);
  border-radius: 999px;
  background: rgba(122,162,247,0.09);
  color: #b9c8ff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.walle-work-chip.active { color: #bbf7d0; border-color: rgba(34,197,94,0.34); background: rgba(34,197,94,0.12); }
.walle-work-chip.shell { color: #fde68a; border-color: rgba(245,158,11,0.34); background: rgba(245,158,11,0.11); }
.walle-work-chip.agent { color: #a5f3fc; border-color: rgba(34,211,238,0.30); background: rgba(34,211,238,0.10); }
.walle-work-chip.tool { color: #bfdbfe; border-color: rgba(96,165,250,0.30); background: rgba(96,165,250,0.10); }
.walle-work-chip.skill { color: #ddd6fe; border-color: rgba(167,139,250,0.30); background: rgba(167,139,250,0.10); }
.walle-work-chip.queued { color: #fed7aa; border-color: rgba(251,146,60,0.30); background: rgba(251,146,60,0.10); }
.walle-work-chip.lagging {
  color: var(--fg-muted, #8b93b3);
  border-color: rgba(139,147,179,0.22);
  background: rgba(139,147,179,0.07);
  font-weight: 700;
}
/* Approval-blocked: amber + a gentle pulse so it never reads as a calm "running". */
.walle-work-chip.awaiting {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.55);
  background: rgba(251,191,36,0.16);
  animation: walle-awaiting-pulse 1.6s ease-in-out infinite;
}
@keyframes walle-awaiting-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.0); }
  50% { box-shadow: 0 0 0 3px rgba(251,191,36,0.16); }
}
.walle-workbar-summary.awaiting { color: #fbbf24; }
/* WP-V4: a provider retry — amber + pulse like .awaiting (both mean "not
   actually working right now"), but a distinct label so it never reads as
   the same thing as an approval block. */
.walle-work-chip.retrying {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.55);
  background: rgba(251,191,36,0.16);
  animation: walle-awaiting-pulse 1.6s ease-in-out infinite;
}
/* WP-V4: the WORK bar's live status lines. Retry/wait detail is additive:
   elapsed time remains visible while the provider is reconnecting or slow. */
.walle-workbar-liveness {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-muted, #8b93b3);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.walle-workbar-liveness.retrying {
  color: #fbbf24;
  font-weight: 700;
}
.walle-workbar-liveness.waiting {
  color: #e0af68;
}
.walle-workbar-liveness.stale {
  color: #fbbf24;
  font-weight: 700;
}
.walle-workbar-perm-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.walle-workbar-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}
.walle-workbar-perm-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(251,191,36,0.5);
  background: rgba(251,191,36,0.14);
  color: #fde68a;
  white-space: nowrap;
  flex: 0 0 auto;
}
.walle-workbar-perm-btn.deny {
  border-color: rgba(248,113,113,0.5);
  background: rgba(248,113,113,0.12);
  color: #fca5a5;
}
.walle-workbar-perm-btn:hover:not(:disabled) { filter: brightness(1.2); }
.walle-workbar-perm-btn:disabled { opacity: 0.5; cursor: default; }
.walle-work-chip.done,
.walle-work-chip.isolated {
  color: var(--fg-dim, #7f849c);
  border-color: rgba(127,132,156,0.22);
  background: rgba(127,132,156,0.08);
}
.walle-workbar-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg, #c0caf5);
  font-size: 12px;
  font-weight: 650;
}
.walle-workbar-usage {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-muted, #8b93b3);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-top: 4px;
  border-top: 1px solid rgba(122,162,247,0.16);
}
.walle-workbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.walle-workbar-actions button,
.walle-work-row-actions button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(122,162,247,0.34);
  border-radius: 9px;
  background: rgba(122,162,247,0.12);
  color: var(--fg, #c0caf5);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.walle-workbar-actions button:hover,
.walle-workbar-actions button:focus-visible,
.walle-work-row-actions button:hover,
.walle-work-row-actions button:focus-visible {
  border-color: rgba(122,162,247,0.72);
  outline: none;
}
.walle-workbar-actions button.danger,
.walle-workbar-stop,
.walle-work-row-actions button.danger {
  border-color: rgba(247,118,142,0.38);
  background: rgba(247,118,142,0.12);
  color: #fecdd3;
}
.walle-work-drawer {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(122,162,247,0.16);
}
@media (max-width: 900px) {
  .walle-workbar,
  .walle-workbar.expanded {
    grid-template-columns: minmax(0, 1fr);
  }
  .walle-workbar-summary,
  .walle-workbar-controls {
    grid-column: 1 / -1;
  }
  .walle-workbar-controls {
    justify-self: stretch;
  }
}
@media (max-width: 680px) {
  .walle-external-interaction-status,
  .walle-external-interaction.is-compact {
    align-items: flex-start;
    flex-direction: column;
  }
  .walle-external-interaction-actions,
  .walle-external-interaction.is-compact .walle-external-interaction-actions {
    width: 100%;
    overflow: visible;
  }
  .walle-external-interaction-action { flex: 0 1 auto; max-width: 100%; }
  .walle-external-interaction:not(.is-compact) .walle-external-interaction-action.primary {
    flex: 1 0 100%; width: 100%;
  }
  .walle-external-interaction.is-compact .walle-external-interaction-actions {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
  }
  .walle-external-interaction.is-compact .walle-external-interaction-action.primary { width: 100%; }
  .walle-external-interaction-more-menu { left: 0; right: auto; max-width: calc(100vw - 32px); }
}
.walle-work-drawer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.walle-work-drawer-head strong {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.walle-work-drawer-head span {
  color: var(--fg-dim, #565f89);
  font-size: 11px;
}
.walle-work-drawer-liveness {
  margin: 0 0 10px;
  padding: 7px 9px;
  border: 1px solid rgba(158,206,106,0.24);
  border-radius: 5px;
  background: rgba(158,206,106,0.07);
  color: #b9e98b;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.walle-work-group {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.walle-work-group-title {
  color: #f6c177;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.walle-work-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(122,162,247,0.14);
  border-radius: 11px;
  background: rgba(12,15,29,0.42);
}
.walle-work-row.completed {
  opacity: 0.72;
}
.walle-work-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #a3e635;
  box-shadow: 0 0 0 4px rgba(163,230,53,0.08);
}
.walle-work-row.failed .walle-work-dot,
.walle-work-row.cancelled .walle-work-dot,
.walle-work-row.stopped .walle-work-dot {
  background: #f7768e;
  box-shadow: 0 0 0 4px rgba(247,118,142,0.10);
}
.walle-work-row.completed .walle-work-dot {
  background: #7aa2f7;
  box-shadow: 0 0 0 4px rgba(122,162,247,0.08);
}
.walle-work-row-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.walle-work-row-title,
.walle-work-row-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-work-row-title {
  font-size: 12px;
  font-weight: 800;
}
.walle-work-row-meta,
.walle-work-row-preview,
.walle-work-empty {
  color: var(--fg-dim, #7f849c);
  font-size: 11px;
}
.walle-work-focus {
  outline: 2px solid rgba(245,158,11,0.75);
  outline-offset: 3px;
}
.walle-queued-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(245,158,11,0.34);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  background: rgba(245,158,11,0.08);
}
.walle-queued-body {
  min-width: 0;
}
.walle-queued-label {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.walle-queued-title {
  margin-top: 2px;
  color: var(--fg, #c0caf5);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-queued-reason {
  margin-top: 2px;
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  line-height: 1.35;
}
.walle-queued-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.walle-queued-actions button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(122,162,247,0.34);
  border-radius: 7px;
  background: rgba(122,162,247,0.10);
  color: var(--fg, #c0caf5);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.walle-queued-actions button:hover,
.walle-queued-actions button:focus-visible {
  border-color: rgba(122,162,247,0.70);
  outline: none;
}
.walle-queued-actions button.danger {
  border-color: rgba(247,118,142,0.34);
  background: rgba(247,118,142,0.10);
  color: #fca5a5;
}

/* ── Thin one-line queue status above the composer (replaces the yellow card) ── */
.walle-queue-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(122, 162, 247, 0.28);
  background: rgba(122, 162, 247, 0.07);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-dim, #a9b1d6);
}
.walle-queue-status.waiting {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fcd34d;
}
.walle-queue-status-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walle-queue-status-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}
.walle-queue-status-btn {
  border: 1px solid var(--border, #3b4261);
  background: rgba(122, 162, 247, 0.10);
  color: #c0caf5;
  border-radius: 5px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.walle-queue-status-btn:hover,
.walle-queue-status-btn:focus-visible {
  border-color: #7aa2f7;
  outline: none;
}
.walle-queue-status-btn.danger {
  border-color: rgba(247, 118, 142, 0.34);
  background: rgba(247, 118, 142, 0.10);
  color: #fca5a5;
}
.walle-composer-shell {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(122,162,247,0.06), rgba(15,19,36,0.06)),
    var(--bg, #1a1b26);
  border: 1px solid var(--border, #3b4261);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.walle-composer-shell:focus-within {
  border-color: rgba(245,158,11,0.88);
  box-shadow:
    0 0 0 1px rgba(245,158,11,0.18),
    0 10px 28px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.walle-command-picker {
  display: grid;
  max-height: 180px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(86,95,137,0.48);
  background: var(--bg, #1a1b26);
}
.walle-command-picker[hidden] {
  display: none;
}
.walle-command-picker-item {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg, #c0caf5);
  text-align: left;
  cursor: pointer;
}
.walle-command-picker-item:hover,
.walle-command-picker-item.active {
  background: rgba(122,162,247,0.14);
}
.walle-command-picker-name {
  color: #7aa2f7;
  font-family: var(--mono, monospace);
  font-weight: 700;
}
.walle-command-picker-description {
  min-width: 0;
  color: var(--muted, #7982a9);
  font-size: 11px;
  line-height: 1.35;
}
.walle-md-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(59,66,97,0.78);
  background: rgba(36,40,59,0.78);
  overflow-x: auto;
  scrollbar-width: thin;
}
.walle-md-toolbar-group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-right: 6px;
  margin-right: 2px;
  border-right: 1px solid rgba(86,95,137,0.35);
}
.walle-md-toolbar-group:last-child {
  border-right: 0;
  margin-left: auto;
  padding-right: 0;
}
.walle-md-btn {
  height: 26px;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-dim, #565f89);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}
.walle-md-btn:hover,
.walle-md-btn:focus-visible {
  background: rgba(122,162,247,0.14);
  border-color: rgba(122,162,247,0.36);
  color: var(--fg, #c0caf5);
  outline: none;
}
.walle-md-btn:active {
  transform: translateY(1px);
}
.walle-md-btn.active,
.walle-md-btn[aria-pressed="true"] {
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.48);
  color: #fbbf24;
}
.walle-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 8px;
}
.walle-attachment-strip.composer {
  margin: 0;
}
.walle-attachment-strip.message,
.walle-attachment-strip.queue {
  gap: 10px;
  margin: 8px 0 10px;
}
.walle-attachment-thumb {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  background: var(--bg, #1a1b26);
  overflow: hidden;
  cursor: zoom-in;
}
.walle-attachment-thumb:hover,
.walle-attachment-thumb:focus-visible {
  border-color: #7aa2f7;
  outline: none;
  box-shadow: 0 0 0 1px rgba(122,162,247,0.25);
}
.walle-attachment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.walle-attachment-strip.message .walle-attachment-thumb {
  width: min(220px, 100%);
  height: 156px;
  border-radius: 8px;
  background: rgba(13, 18, 34, 0.92);
}
.walle-attachment-strip.queue .walle-attachment-thumb {
  width: min(180px, 100%);
  height: 126px;
  border-radius: 8px;
  background: rgba(13, 18, 34, 0.92);
}
.walle-attachment-strip.message .walle-attachment-thumb img,
.walle-attachment-strip.queue .walle-attachment-thumb img {
  object-fit: contain;
}
.walle-attachment-thumb--pending {
  cursor: progress;
  display: flex;
  align-items: center;
  justify-content: center;
}
.walle-attachment-thumb--pending:hover,
.walle-attachment-thumb--pending:focus-visible {
  border-color: var(--border, #3b4261);
  box-shadow: none;
}
.walle-attachment-thumb--failed {
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(247, 118, 142, 0.75);
}
.walle-attachment-retry {
  position: absolute;
  left: 4px;
  top: 4px;
  border: 1px solid rgba(247, 118, 142, 0.8);
  border-radius: 4px;
  padding: 2px 4px;
  background: rgba(26, 27, 38, 0.94);
  color: #f7768e;
  font-size: 9px;
  line-height: 12px;
  cursor: pointer;
}
.walle-attachment-retry:focus-visible {
  outline: 1px solid #f7768e;
  outline-offset: 1px;
}
.walle-attachment-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(122, 162, 247, 0.25);
  border-top-color: #7aa2f7;
  animation: walle-attachment-spin 0.7s linear infinite;
}
@keyframes walle-attachment-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .walle-attachment-spinner { animation-duration: 1.6s; }
  .walle-history-loading-spinner { animation: none; }
}
.walle-attachment-token {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  padding: 1px 3px;
  background: rgba(10, 14, 28, 0.74);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 13px;
  pointer-events: none;
}
.walle-attachment-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(247,118,142,0.95);
  color: #fff;
  font-size: 13px;
  line-height: 15px;
  font-weight: 700;
  cursor: pointer;
}
.walle-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  color: var(--fg, #c0caf5);
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: min(38vh, 260px);
  line-height: 1.45;
  outline: none;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.walle-input:focus {
  outline: none;
}
.walle-input::placeholder {
  color: var(--fg-dim, #565f89);
}
.walle-input.is-scrollable {
  overflow-y: auto;
}
.walle-md-preview {
  border-top: 1px solid rgba(59,66,97,0.78);
  padding: 10px 12px 12px;
  max-height: min(34vh, 220px);
  overflow: auto;
  background: rgba(15,19,36,0.58);
  color: var(--fg, #c0caf5);
  font-size: 13px;
  line-height: 1.5;
}
.walle-md-preview.open {
  display: block;
}
.walle-md-preview-empty {
  color: var(--fg-dim, #565f89);
  font-style: italic;
}
.walle-md-preview > :first-child {
  margin-top: 0;
}
.walle-md-preview > :last-child {
  margin-bottom: 0;
}
.walle-md-preview pre {
  background: rgba(0,0,0,0.24);
  border: 1px solid rgba(86,95,137,0.35);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
}
.walle-md-preview code {
  background: rgba(122,162,247,0.12);
  border-radius: 4px;
  padding: 1px 4px;
}
.walle-md-preview pre code {
  background: transparent;
  padding: 0;
}
.walle-attach-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border, #3b4261);
  border-radius: 8px;
  background: var(--bg, #1a1b26);
  color: var(--fg, #c0caf5);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.walle-attach-btn:hover,
.walle-attach-btn:focus-visible {
  border-color: #7aa2f7;
  outline: none;
}
.walle-attach-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.walle-send-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.walle-interject-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.14);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.walle-interject-btn:hover,
.walle-interject-btn:focus-visible {
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(96, 165, 250, 0.8);
}

.walle-interject-btn[hidden] {
  display: none;
}
.walle-send-btn:hover {
  opacity: 0.9;
}
.walle-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.walle-input-hints {
  font-size: 10px;
  color: var(--fg-dim, #565f89);
  padding: 0 16px 6px;
  background: var(--bg-card, #24283b);
  flex-shrink: 0;
}
.walle-composer-busy-hint {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(251,191,36,0.24);
  background: rgba(251,191,36,0.08);
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.35;
}
.walle-composer-busy-hint[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .walle-goal-strip-slot { padding: 7px 10px 0; }
  .walle-goal-body { grid-template-columns: 1fr; }
  .walle-goal-actions { grid-column: 1; grid-row: auto; justify-content: flex-end; }
  .walle-goal-objective { white-space: normal; }
  .walle-input-bar {
    gap: 6px;
    padding: 8px 10px 10px;
  }
  .walle-md-toolbar {
    padding: 5px 6px;
  }
  .walle-md-btn {
    height: 30px;
    min-width: 34px;
    padding: 0 9px;
  }
  .walle-input {
    font-size: 16px;
    min-height: 48px;
    max-height: 32vh;
  }
  .walle-workbar-slot {
    padding: 0 10px;
  }
  .walle-workbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .walle-workbar-summary {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .walle-work-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }
  .walle-work-row-actions {
    grid-column: 2;
  }
  .walle-send-btn {
    min-height: 40px;
    padding: 8px 13px;
  }
}
.walle-msg-body img {
  max-width: min(560px, 100%);
  max-height: 360px;
  border: 1px solid var(--border, #3b4261);
  border-radius: 6px;
  cursor: zoom-in;
}
.walle-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(5, 8, 15, 0.88);
  cursor: zoom-out;
}
.walle-image-viewer img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  cursor: default;
}

/* --- Thinking indicator --- */
.walle-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--fg-dim, #565f89);
  font-size: 13px;
}
.walle-thinking-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  animation: walle-dot-bounce 1.4s ease-in-out infinite;
}
.walle-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.walle-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes walle-dot-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* --- Reasoning blocks (D-9/D-11, walle-session-view-truth §5/§6): visible
   "Thinking" cards rendered before the activity panel — intentionally NOT
   named .walle-thinking (that class is the loading-dots "Wall-E is
   thinking…" indicator above, removed wholesale by removeThinking() at
   ~10 call sites; reusing it here would delete these blocks mid-stream). */
.walle-reasoning-blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.walle-reasoning-block {
  color: var(--fg-dim, #565f89);
  font-style: italic;
}
.walle-reasoning-block > summary {
  cursor: pointer;
  list-style: none;
}
.walle-reasoning-block > summary::-webkit-details-marker {
  display: none;
}
.walle-reasoning-block-header {
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  font-weight: 700;
}
.walle-reasoning-block-body {
  padding-top: 4px;
  font-size: 12px;
}
.walle-reasoning-state {
  padding: 4px 0;
  color: var(--fg-dim, #565f89);
  font-size: 12px;
  font-style: italic;
}

/* --- Turn thinking disclosure (D-3/D-4, walle-web-view-turn-card-redesign §5):
   the ONE per-turn "Thinking" <details> that hosts the .walle-reasoning-block
   nodes above, mounted as the first child of the turn's answer card / failed
   panel. */
.walle-turn-thinking { border-bottom: 1px solid rgba(122,162,247,0.14); padding: 6px 11px; color: var(--fg-dim, #565f89); font-size: 12px; }
.walle-turn-thinking > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.walle-turn-thinking > summary::-webkit-details-marker { display: none; }
.walle-turn-thinking > summary::before { content: '▸'; display: inline-block; transition: transform .12s ease; }
.walle-turn-thinking[open] > summary::before { transform: rotate(90deg); }
.walle-turn-thinking-label { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 11px; }
.walle-turn-thinking-body { padding: 6px 0 2px 16px; font-style: italic; display: flex; flex-direction: column; gap: 8px; }
.walle-turn-thinking-redacted { color: var(--fg-dim, #565f89); font-style: italic; }
.walle-answer-card-meta { color: var(--fg-dim, #565f89); font-size: 11px; font-weight: 500; }
.walle-turn-terminal-detail { padding: 6px 11px 0; color: var(--fg-dim, #565f89); font-size: 12px; }
.walle-kind-note { padding: 4px 0; color: var(--fg-dim, #565f89); font-size: 12px; }

/* --- Error notice --- */
.walle-error-notice {
  background: rgba(247,118,142,0.12);
  border: 1px solid rgba(247,118,142,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  color: #f7768e;
  font-size: 13px;
  margin: 6px 0;
}
.walle-error-notice.provider {
  border-left: 3px solid #f7768e;
  color: #f2c0c8;
}
.walle-error-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 3px;
}
.walle-error-body {
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.walle-error-details {
  margin-top: 6px;
  color: #d7dde8;
}
.walle-error-details summary {
  cursor: pointer;
  color: #9fb0c8;
}
.walle-error-details pre {
  margin: 6px 0 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.4;
}
.walle-error-actions {
  margin-top: 8px;
}
.walle-session-action-btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border, #414868);
  background: var(--bg-light, #24283b);
  color: var(--fg, #c0caf5);
  cursor: pointer;
  font-size: 12px;
}
.walle-session-action-btn.primary {
  background: var(--accent, #7aa2f7);
  border-color: var(--accent, #7aa2f7);
  color: #111827;
  font-weight: 700;
}

/* Permission Request Card */
.walle-perm-audit {
  margin: 4px 48px;
  padding-left: 9px;
  border-left: 2px solid color-mix(in srgb, #f59e0b 55%, transparent);
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.5;
}
.walle-perm-card {
  margin: 8px 48px 8px 48px;
  padding: 12px 14px;
  border: 1px solid #f59e0b44;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-light) 90%, #f59e0b 10%);
}
.walle-perm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
}
.walle-perm-detail {
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 4px;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.walle-perm-detail code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}
.walle-perm-reason {
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 10px;
}
.walle-perm-actions {
  display: flex;
  gap: 8px;
}
.walle-perm-actions button {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.walle-perm-actions button:hover {
  border-color: var(--fg-dim);
}
.walle-perm-actions .perm-allow-once {
  background: #22c55e22;
  border-color: #22c55e44;
  color: #22c55e;
}
.walle-perm-actions .perm-allow-once:hover {
  background: #22c55e33;
}
.walle-perm-actions .perm-allow-always {
  background: #3b82f622;
  border-color: #3b82f644;
  color: #3b82f6;
}
.walle-perm-actions .perm-allow-always:hover {
  background: #3b82f633;
}
.walle-perm-actions .perm-deny {
  background: #ef444422;
  border-color: #ef444444;
  color: #ef4444;
}
.walle-perm-actions .perm-deny:hover {
  background: #ef444433;
}
.walle-perm-card.resolved {
  opacity: 0.6;
  pointer-events: none;
}
.walle-perm-card.resolved .walle-perm-actions {
  display: none;
}
.walle-perm-card.resolved::after {
  content: attr(data-resolved);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
}
.walle-perm-card.resolved.perm-approved::after {
  color: #22c55e;
}
.walle-perm-card.resolved.perm-denied::after {
  color: #ef4444;
}
.walle-perm-card.resolved.perm-expired::after {
  color: #9ca3af;
}
/* Transient state between click and the server's authoritative outcome. The card
   is dimmed and shows "Submitting…" but is NOT yet styled as approved/denied — an
   orphaned card must not look successful before we know it resumed. */
.walle-perm-card.perm-pending {
  opacity: 0.7;
}
.walle-perm-card.perm-pending .walle-perm-actions {
  opacity: 0.5;
  pointer-events: none;
}
.walle-perm-card.perm-pending::after {
  content: attr(data-pending);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  color: #9ca3af;
}
/* D-4d — a card that reaches [data-status="resolving"] (post-click, pre-ack)
   shows a spinner so unclickable Allow/Deny reads as "in flight", not
   broken. [data-error] is the shared primitive's re-arm fallback (D-4b):
   the ack timer fired with no terminal outcome — the card came back to
   'pending' with buttons re-enabled and this text explaining why. */
.walle-perm-card[data-status="resolving"] {
  position: relative;
}
.walle-perm-card[data-status="resolving"]::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  border-top-color: transparent;
  animation: walle-perm-spin 0.8s linear infinite;
}
@keyframes walle-perm-spin {
  to { transform: rotate(360deg); }
}
.walle-perm-card[data-error] {
  border-color: #ef444488;
}
.walle-perm-card .perm-error {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #ef4444;
}
@media (prefers-reduced-motion: reduce) {
  .walle-perm-card[data-status="resolving"]::before {
    animation: none;
  }
}

/* Light theme for Wall-E chat/session chrome. Terminal sessions now resolve
   through the shared xterm theme contract; these selectors cover Wall-E's DOM
   chat UI. */
html[data-theme="light"] .session-item[data-agent="walle"] {
  background: #fff8e7;
}
html[data-theme="light"] .session-item[data-agent="walle"].active {
  box-shadow: 0 0 0 1px rgba(154,103,0,0.28);
}
html[data-theme="light"] .agent-badge.walle {
  background: rgba(154,103,0,0.12);
  color: #8a5700;
}
html[data-theme="light"] .walle-session,
html[data-theme="light"] .walle-messages {
  background: var(--bg);
}
html[data-theme="light"] .walle-turn {
  background: rgba(255,255,255,0.68);
  border-color: rgba(148,163,184,0.42);
}
html[data-theme="light"] .walle-turn.latest-prompt-turn {
  background: rgba(248,250,252,0.9);
  border-color: rgba(37,99,235,0.24);
}
html[data-theme="light"] .walle-turn-prompt .walle-msg {
  background: rgba(37,99,235,0.055);
  border-left-color: rgba(37,99,235,0.34);
}
html[data-theme="light"] .walle-turn-responses {
  border-left-color: rgba(37,99,235,0.16);
}
html[data-theme="light"] .walle-turn-response-summary:hover,
html[data-theme="light"] .walle-turn-response-summary:focus-visible {
  background: rgba(37,99,235,0.06);
}
html[data-theme="light"] .walle-session-header,
html[data-theme="light"] .walle-input-bar,
html[data-theme="light"] .walle-input-hints,
html[data-theme="light"] .walle-md-toolbar,
html[data-theme="light"] .walle-composer-resize {
  background: var(--bg-card);
}
html[data-theme="light"] .walle-composer-resize-grip {
  background: rgba(37,99,235,0.22);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.08);
}
html[data-theme="light"] .walle-composer-resize:hover,
html[data-theme="light"] .walle-composer-resize:focus-visible,
html[data-theme="light"] .walle-composer-resize.dragging {
  background: color-mix(in srgb, var(--bg-card) 86%, #2563eb);
  border-top-color: rgba(37,99,235,0.45);
}
html[data-theme="light"] .walle-composer-resize:hover .walle-composer-resize-grip,
html[data-theme="light"] .walle-composer-resize:focus-visible .walle-composer-resize-grip,
html[data-theme="light"] .walle-composer-resize.dragging .walle-composer-resize-grip {
  background: rgba(37,99,235,0.58);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}
html[data-theme="light"] .walle-composer-shell {
  background: var(--bg-input);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}
html[data-theme="light"] .walle-composer-shell:focus-within {
  border-color: rgba(154,103,0,0.55);
  box-shadow:
    0 0 0 2px rgba(154,103,0,0.08),
    0 8px 22px rgba(34,49,73,0.08),
    inset 0 1px 0 rgba(255,255,255,0.72);
}
html[data-theme="light"] .walle-queued-card {
  background: rgba(146,64,14,0.06);
  border-color: rgba(146,64,14,0.22);
  border-left-color: #b45309;
}
html[data-theme="light"] .walle-workbar-slot {
  background: var(--bg);
}
html[data-theme="light"] .walle-goal-strip-slot { background: var(--bg); }
html[data-theme="light"] .walle-goal-strip {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(246,248,252,0.96));
  border-color: rgba(59,102,224,0.2);
  box-shadow: 0 8px 22px rgba(34,49,73,0.08);
}
html[data-theme="light"] .walle-goal-status,
html[data-theme="light"] .walle-goal-objective { color: #1e293b; }
html[data-theme="light"] .walle-goal-facts,
html[data-theme="light"] .walle-goal-attempts { color: #64748b; }
html[data-theme="light"] .walle-workbar {
  background:
    radial-gradient(circle at 18px 10px, rgba(180,83,9,0.10), transparent 150px),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(246,248,252,0.94));
  border-color: rgba(59,102,224,0.20);
  box-shadow: 0 12px 28px rgba(34,49,73,0.10), inset 0 1px 0 rgba(255,255,255,0.9);
}
html[data-theme="light"] .walle-workbar-kicker,
html[data-theme="light"] .walle-work-group-title {
  color: #92400e;
}
html[data-theme="light"] .walle-work-chip {
  background: rgba(59,102,224,0.06);
  color: #334155;
}
html[data-theme="light"] .walle-work-chip.active { color: #166534; background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.22); }
html[data-theme="light"] .walle-work-chip.shell { color: #92400e; background: rgba(180,83,9,0.08); border-color: rgba(180,83,9,0.22); }
html[data-theme="light"] .walle-work-chip.done,
html[data-theme="light"] .walle-work-chip.isolated {
  color: #64748b;
  background: rgba(100,116,139,0.06);
}
html[data-theme="light"] .walle-work-row {
  background: rgba(255,255,255,0.66);
  border-color: rgba(59,102,224,0.14);
}
html[data-theme="light"] .walle-workbar-actions button,
html[data-theme="light"] .walle-work-row-actions button {
  background: rgba(59,102,224,0.08);
  color: var(--accent);
}
html[data-theme="light"] .walle-workbar-actions button.danger,
html[data-theme="light"] .walle-workbar-stop,
html[data-theme="light"] .walle-work-row-actions button.danger {
  background: rgba(185,28,28,0.08);
  color: var(--red);
}
html[data-theme="light"] .walle-queued-label {
  color: #92400e;
}
html[data-theme="light"] .walle-queued-actions button {
  background: rgba(59,102,224,0.08);
  color: var(--accent);
}
html[data-theme="light"] .walle-queued-actions button.danger {
  background: rgba(185,28,28,0.08);
  color: var(--red);
}
html[data-theme="light"] .walle-md-toolbar {
  border-bottom-color: var(--border);
}
html[data-theme="light"] .walle-header-overflow:hover,
html[data-theme="light"] .walle-header-overflow:focus-visible,
html[data-theme="light"] .walle-header-overflow-item:hover,
html[data-theme="light"] .walle-header-overflow-item:focus-visible,
html[data-theme="light"] .walle-tool-header:hover,
html[data-theme="light"] .walle-empty-chip:hover,
html[data-theme="light"] .walle-empty-chip:focus-visible {
  background: var(--bg-hover);
}
html[data-theme="light"] .walle-header-overflow-menu,
html[data-theme="light"] .walle-model-picker-menu,
html[data-theme="light"] .walle-tool-card,
html[data-theme="light"] .walle-tool-group,
html[data-theme="light"] .walle-empty-chip,
html[data-theme="light"] .walle-history-loading-state,
html[data-theme="light"] .walle-history-notice-state,
html[data-theme="light"] .walle-input,
html[data-theme="light"] .walle-edit-card,
html[data-theme="light"] .walle-session-header .model-select,
html[data-theme="light"] .walle-model-picker-btn {
  background: var(--bg-card);
}
html[data-theme="light"] .walle-history-notice-state {
  border-color: rgba(37,99,235,0.18);
  background: rgba(37,99,235,0.04);
}
html[data-theme="light"] .walle-history-content-status {
  background: var(--bg, #f6f8fc);
  border-color: rgba(37,99,235,0.14);
}
html[data-theme="light"] .walle-history-loading-badge {
  border-color: rgba(37,99,235,0.22);
  background: rgba(37,99,235,0.07);
  color: #2454c6;
}
html[data-theme="light"] .walle-history-loading-spinner {
  border-color: rgba(37,99,235,0.18);
  border-top-color: #2563eb;
}
html[data-theme="light"] .walle-history-loading-copy {
  color: var(--fg-muted);
}
html[data-theme="light"] .walle-history-loading-line {
  background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(37,99,235,0.18), rgba(37,99,235,0.06));
  background-size: 180% 100%;
}
html[data-theme="light"] .walle-edit-input {
  background: var(--bg-input);
  color: var(--fg);
}
html[data-theme="light"] .walle-msg-action,
html[data-theme="light"] .walle-branch-btn {
  background: rgba(255,255,255,0.88);
  color: var(--accent);
}
html[data-theme="light"] .walle-msg-action:hover,
html[data-theme="light"] .walle-msg-action:focus-visible,
html[data-theme="light"] .walle-branch-btn:hover,
html[data-theme="light"] .walle-branch-btn:focus-visible {
  background: var(--bg-hover);
  color: var(--fg);
}
html[data-theme="light"] .walle-msg[data-walle-role="assistant"] {
  background: rgba(146,64,14,0.045);
  border-left-color: rgba(146,64,14,0.28);
}
html[data-theme="light"] .walle-answer-card {
  background: rgba(255,255,255,0.86);
  border-color: rgba(37,99,235,0.18);
  border-left-color: rgba(37,99,235,0.48);
}
html[data-theme="light"] .walle-external-action-audit-card {
  border-color: rgba(151,99,24,0.3);
  border-left-color: rgba(151,99,24,0.76);
  background: rgba(255,248,233,0.9);
}
html[data-theme="light"] .walle-external-action-audit-card .walle-answer-card-header {
  border-bottom-color: rgba(151,99,24,0.18);
  background: rgba(151,99,24,0.06);
}
html[data-theme="light"] .walle-answer-card-header {
  background: linear-gradient(180deg, rgba(37,99,235,0.055), transparent);
  border-bottom-color: rgba(37,99,235,0.12);
}
html[data-theme="light"] .walle-answer-card-badge {
  background: rgba(37,99,235,0.07);
  border-color: rgba(37,99,235,0.18);
  color: var(--fg-muted);
}
html[data-theme="light"] .walle-answer-card-header.missing .walle-answer-card-badge {
  background: rgba(185,28,28,0.07);
  border-color: rgba(185,28,28,0.20);
  color: var(--red);
}
html[data-theme="light"] .walle-final-answer-card {
  border-left-color: rgba(2,132,199,0.48);
}
html[data-theme="light"] .walle-final-answer-body h2 {
  border-top-color: rgba(15,23,42,0.10);
}
html[data-theme="light"] .walle-final-answer-body code {
  background: var(--code-bg);
}
html[data-theme="light"] .walle-final-narration {
  background: rgba(124,58,237,0.04);
  border-left-color: rgba(124,58,237,0.42);
}
html[data-theme="light"] .walle-msg-body code {
  background: var(--code-bg);
}
html[data-theme="light"] .walle-msg-body pre,
html[data-theme="light"] .walle-tool-output,
html[data-theme="light"] .walle-tool-detail,
html[data-theme="light"] .walle-tool-group-body,
html[data-theme="light"] .walle-perm-detail code {
  background: #f1f3f6;
  border: 1px solid rgba(15,23,42,0.06);
}
html[data-theme="light"] .walle-tool-detail-pre {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98)),
    radial-gradient(circle at 0 0, rgba(37,99,235,0.08), transparent 34%);
  border-color: rgba(15,23,42,0.10);
  color: #1e293b;
}
html[data-theme="light"] .walle-live-activity-row:hover,
html[data-theme="light"] .walle-live-activity-row:focus-visible,
html[data-theme="light"] .walle-live-activity-item[open] > .walle-live-activity-row {
  background: rgba(15,23,42,0.045);
}
html[data-theme="light"] .walle-live-activity-more {
  background: rgba(37,99,235,0.08);
}
html[data-theme="light"] .walle-live-activity-more:hover,
html[data-theme="light"] .walle-live-activity-more:focus-visible {
  background: rgba(37,99,235,0.14);
  color: var(--fg);
}
html[data-theme="light"] .walle-msg-body th {
  background: var(--bg-lighter);
}
html[data-theme="light"] .walle-copy-btn {
  background: rgba(255,255,255,0.94);
  color: var(--accent);
}
html[data-theme="light"] .walle-copy-btn:hover {
  background: var(--accent);
  color: var(--accent-fg);
}
html[data-theme="light"] .walle-error-notice.provider {
  color: #7f1d1d;
}
html[data-theme="light"] .walle-error-title {
  color: #7f1d1d;
}
html[data-theme="light"] .walle-error-details,
html[data-theme="light"] .walle-error-details summary,
html[data-theme="light"] .walle-error-details pre {
  color: #334155;
}
html[data-theme="light"] .walle-image-viewer {
  background: var(--overlay-bg);
}

/* ── Coding summary card (WS2) ─────────────────────────────────────────────
   Deterministic, actionable wrap-up pinned atop a completed coding turn. Built
   by MR.renderCodingSummaryHtml; data from coding-run-controller buildCodingSummary. */
.coding-summary-card{
  border:1px solid var(--border,#3b4261);border-radius:10px;
  background:var(--bg-card,#24283b);
  margin:8px 0 12px;overflow:hidden;
  box-shadow:0 3px 12px rgba(0,0,0,.22);
}
.coding-summary-card .csum-top{
  display:flex;align-items:center;gap:9px;padding:9px 13px;
  border-bottom:1px solid var(--border,#3b4261);
  background:linear-gradient(180deg,rgba(122,162,247,.07),transparent);
}
.coding-summary-card .csum-badge{
  font-size:11px;font-weight:700;letter-spacing:.02em;padding:3px 9px;border-radius:999px;
}
.coding-summary-card .csum-badge.changed{background:rgba(224,175,104,.16);color:#e0af68;border:1px solid rgba(224,175,104,.4)}
.coding-summary-card .csum-badge.ok{background:rgba(158,206,106,.16);color:#9ece6a;border:1px solid rgba(158,206,106,.4)}
.coding-summary-card .csum-badge.err{background:rgba(247,118,142,.16);color:#f7768e;border:1px solid rgba(247,118,142,.42)}
/* S-19: answered_from_context / partial_answer reuse the same gold "caution"
   token the .changed badge already uses — a distinct, non-failure warning,
   not a de-emphasized one. */
.coding-summary-card .csum-badge.warn{background:rgba(224,175,104,.16);color:var(--yellow,#e0af68);border:1px solid rgba(224,175,104,.4)}
.coding-summary-card .csum-verify{font-size:11px;font-weight:600}
.coding-summary-card .csum-verify.ok{color:#9ece6a}
/* S-21 (design doc D-8): was #787c99 — dimmer than body text, so an
   "unverified" turn read as de-emphasized rather than a caution. Recolored
   to the stylesheet's existing warning/yellow token (var(--yellow), used
   elsewhere in this file at .csum-badge.changed / .agent-step-card.is-running
   / .agent-step-tool-row[data-status="running"]) instead of inventing a new
   hex. */
.coding-summary-card .csum-verify.warn{color:var(--yellow,#e0af68)}
/* "not applicable" is a genuine non-claim ("nothing to verify"), not a
   caution — keep it de-emphasized with the old dim tone. */
.coding-summary-card .csum-verify.muted{color:#787c99}
.coding-summary-card .csum-sec{padding:9px 13px;border-bottom:1px solid var(--border,#3b4261)}
.coding-summary-card .csum-sec:last-child{border-bottom:0}
.coding-summary-card .csum-lbl{
  font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
  color:var(--fg-dim,#565f89);margin-bottom:6px;
}
.coding-summary-card .csum-file{display:flex;align-items:baseline;gap:8px;
  font-family:var(--mono,ui-monospace,Menlo,monospace);font-size:12.5px;padding:1.5px 0}
.coding-summary-card .csum-mk{color:#9ece6a;flex:0 0 auto}
.coding-summary-card .csum-path{color:#7dcfff;word-break:break-all}
.coding-summary-card .csum-runbox{
  background:var(--bg,#1a1b26);border:1px solid var(--border,#3b4261);border-radius:7px;
  padding:8px 10px;font-family:var(--mono,ui-monospace,Menlo,monospace);font-size:12px;
}
.coding-summary-card .csum-url{margin-bottom:3px}
.coding-summary-card .csum-url a{color:#7dcfff;text-decoration:none}
.coding-summary-card .csum-url a:hover{text-decoration:underline}
.coding-summary-card .csum-cwd{color:var(--fg-dim,#565f89)}
.coding-summary-card .csum-note{color:var(--fg,#c0caf5)}
.coding-summary-card .csum-source{padding:2px 0;word-break:break-word}
.coding-summary-card .csum-source-tool{color:#bb9af7;font-weight:700}
.coding-summary-card .csum-source-detail{color:var(--fg,#c0caf5)}
html[data-theme="light"] .coding-summary-card{background:#fff}
html[data-theme="light"] .coding-summary-card .csum-runbox{background:#f4f5fb}
.walle-web-surface {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.walle-history-jump-present {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  border: 1px solid var(--accent, #7aa2f7);
  border-radius: 6px;
  background: var(--bg, #1a1b26);
  color: var(--fg, #c0caf5);
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}
.walle-history-jump-present[hidden] { display: none; }
.walle-history-jump-present:hover {
  background: var(--bg-hl, #24283b);
}
.walle-history-jump-present:focus-visible {
  outline: 3px solid rgba(122,162,247,0.42);
  outline-offset: 2px;
}
.walle-web-surface[hidden] { display: none; }
.walle-conversation-surface {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.walle-surface-views {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  vertical-align: middle;
}
.walle-surface-view {
  min-height: 24px;
  min-width: 42px;
  padding: 3px 9px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--fg-dim);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.walle-surface-view:last-child { border-right: 0; }
.walle-surface-view:hover,
.walle-surface-view:focus-visible { color: var(--fg); background: var(--bg-hover); outline: none; }
.walle-surface-view.active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}
.walle-session-details-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--fg-dim);
  font: 700 12px/1 var(--font-ui, sans-serif);
  cursor: pointer;
}
.walle-session-details-close:hover,
.walle-session-details-close:focus-visible {
  color: var(--fg);
  border-color: var(--accent);
  outline: none;
}
.walle-session-details-drawer {
  position: absolute;
  z-index: 45;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, calc(100% - 24px));
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--bg-card, #24283b);
  box-shadow: -14px 0 32px rgba(0, 0, 0, 0.34);
  color: var(--fg);
}
.walle-session-details-drawer[hidden] { display: none; }
.walle-session-details-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card, #24283b);
}
.walle-session-details-header h2,
.walle-session-details-section h3 { margin: 0; letter-spacing: 0; }
.walle-session-details-header h2 { font-size: 14px; }
.walle-session-details-section {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.walle-session-details-section h3 {
  margin-bottom: 10px;
  color: var(--fg-dim);
  font-size: 11px;
  text-transform: uppercase;
}
.walle-session-details-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.walle-session-details-row + .walle-session-details-row { border-top: 1px solid var(--border); }
.walle-session-details-row span,
.walle-session-details-row small,
.walle-session-details-empty { color: var(--fg-dim); }
.walle-session-details-row .walle-msg-action { align-self: flex-start; }
.walle-session-details-evidence {
  display: grid;
  grid-template-columns: minmax(90px, 0.42fr) minmax(0, 1fr);
  gap: 3px 8px;
  margin: 5px 0 0;
}
.walle-session-details-evidence dt { color: var(--fg-dim); }
.walle-session-details-evidence dd { margin: 0; overflow-wrap: anywhere; }
.walle-session-details-input { margin-top: 5px; }
.walle-session-details-input summary { color: var(--accent); cursor: pointer; }
.walle-session-details-input pre {
  max-height: 260px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}
.walle-session-details-empty { margin: 0; font-size: 12px; }
.walle-session-details-retry {
  min-height: 28px;
  margin-top: 9px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font: 600 12px/1 var(--font-ui, sans-serif);
  cursor: pointer;
}
.walle-session-details-retry:hover,
.walle-session-details-retry:focus-visible {
  border-color: var(--accent);
  color: var(--fg);
  outline: none;
}
.walle-session-inline-activity {
  flex: 0 0 auto;
  margin: 0 12px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-dim);
  font-size: 11px;
}
.walle-session-inline-activity > summary {
  min-height: 30px;
  padding: 7px 10px;
  cursor: pointer;
}
.walle-session-inline-activity-body {
  padding: 0 10px 10px;
  border-top: 1px solid var(--border);
}
@media (max-width: 620px) {
  .walle-session-details-drawer { width: 100%; }
  .walle-session-header .session-meta-count,
  .walle-session-header .session-meta-sep:first-of-type { display: none; }
}
.walle-history-diagnostics {
  margin: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg-dim);
  font-size: 11px;
}
.walle-history-diagnostics summary { padding: 7px 9px; cursor: pointer; }
.walle-history-diagnostic-list { border-top: 1px solid var(--border); }
.walle-history-diagnostic { padding: 7px 9px; white-space: pre-wrap; }
.walle-history-diagnostic + .walle-history-diagnostic { border-top: 1px solid var(--border); }
.walle-history-integrity-banner {
  margin: 10px 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 52%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning, #f59e0b) 12%, transparent);
  color: var(--text-primary, #e5e7eb);
  font-size: 12px;
  line-height: 1.4;
}

/* Shared reasoning-led operational timeline: Review, Conversation, Wall-E. */
.agent-step-group {
  margin: 10px 0;
  border-top: 1px solid var(--border, #3b4261);
  border-bottom: 1px solid var(--border, #3b4261);
  color: var(--fg, #c0caf5);
}
.agent-group-header {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg-dim, #7f89ad);
  font-size: 11px;
}
.agent-group-header > div:first-child,
.agent-group-time { display: flex; align-items: center; gap: 8px; }
.agent-group-header strong { color: var(--fg, #c0caf5); font-size: 12px; }
.agent-group-time { justify-content: flex-end; white-space: nowrap; }
.agent-group-time strong { color: var(--blue, #7aa2f7); }
.agent-step-list { display: grid; gap: 8px; padding: 0 0 10px; }
.agent-step-card {
  min-width: 0;
  border: 1px solid var(--border, #3b4261);
  border-left: 3px solid var(--blue, #7aa2f7);
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg2, #1f2335) 82%, transparent);
  overflow: hidden;
}
.agent-step-card.agent-step-progress { border-left-color: var(--green, #9ece6a); }
.agent-step-card.agent-step-tools-only { border-left-color: var(--cyan, #7dcfff); }
.agent-step-card.is-running { border-left-color: var(--yellow, #e0af68); }
.agent-step-card.is-error,
.agent-step-card.is-interrupted { border-left-color: var(--red, #f7768e); }
.agent-step-header {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #3b4261) 70%, transparent);
}
.agent-step-label { font-weight: 700; color: var(--fg, #c0caf5); }
.agent-step-time { color: var(--fg-dim, #7f89ad); font-size: 10px; white-space: nowrap; }
.agent-step-body { padding: 9px 10px; line-height: 1.55; }
.agent-step-body > .thinking-block,
.agent-step-body > .review-msg {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.agent-step-tools { border-top: 1px solid color-mix(in srgb, var(--border, #3b4261) 70%, transparent); }
.agent-step-tools > summary {
  min-height: 32px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--cyan, #7dcfff);
  font-size: 11px;
  font-weight: 700;
}
.agent-tool-status { color: var(--fg-dim, #7f89ad); font-size: 10px; font-weight: 500; }
.agent-step-tool-list { border-top: 1px solid color-mix(in srgb, var(--border, #3b4261) 55%, transparent); }
.agent-step-tool-row { padding: 7px 10px 9px; }
.agent-step-tool-row + .agent-step-tool-row { border-top: 1px solid color-mix(in srgb, var(--border, #3b4261) 55%, transparent); }
.agent-step-tool-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--fg-dim, #7f89ad); font-size: 10px; }
.agent-step-tool-row > .tool-card,
.agent-step-tool-row > .walle-live-activity-item,
.agent-step-tool-row > .walle-live-activity-detail {
  margin: 5px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.agent-step-tool-row > .tool-card > .msg-header { display: none; }
.agent-step-tool-row > .tool-card > .msg-text { display: block; padding: 4px 0 0; }
.agent-step-tool-row > .agent-step-tool-detail > summary { display: none; }
.agent-step-tool-row > .agent-step-tool-detail > .walle-live-activity-detail { display: block; padding: 4px 0 0; }
.agent-step-tool-row[data-status="error"] .agent-step-tool-meta { color: var(--red, #f7768e); }
.agent-step-tool-row[data-status="running"] .agent-step-tool-meta { color: var(--yellow, #e0af68); }
html[data-theme="light"] .agent-step-card { background: #fff; }

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

@media (max-width: 700px) {
  .agent-group-header,
  .agent-step-header { align-items: flex-start; }
  .agent-group-header { flex-direction: column; gap: 3px; }
  .agent-group-time { width: 100%; justify-content: space-between; }
  .agent-step-time { white-space: normal; text-align: right; }
}
