/* The panel and its body-mounted file menu have roles independent of page theme. */
:is(.project-panel, .project-dock, .files-menu) {
  color-scheme: dark;
  --bg: var(--prototype-panel-bg);
  --surface: var(--prototype-panel-input);
  --surface-raised: var(--prototype-panel-hover);
  --fg: var(--prototype-panel-fg);
  --ink-2: var(--prototype-panel-fg);
  --fg-muted: var(--prototype-panel-muted);
  --fg-subtle: var(--prototype-panel-muted);
  --line: var(--prototype-panel-line);
  --line-strong: var(--prototype-panel-muted);
  --line-2: var(--prototype-panel-line);
  --brand: var(--prototype-panel-accent);
  --brand-subtle: var(--prototype-panel-hover);
  --brand-wash-2: var(--prototype-panel-hover);
  --brand-line: var(--prototype-panel-accent);
  --focus: var(--prototype-panel-accent);
  --link: var(--prototype-panel-accent);
  --success: var(--prototype-panel-success);
  --success-fg: var(--prototype-panel-success);
  --warning: var(--prototype-panel-warning);
  --warning-fg: var(--prototype-panel-warning);
  --danger: var(--prototype-panel-danger);
  --danger-fg: var(--prototype-panel-danger);
  --danger-bg: var(--prototype-panel-hover);
  --shadow-lg: var(--prototype-panel-shadow);
  /* Existing dark syntax colours, independent of page theme. */
  --syn-comment: #b4afbb;
  --syn-keyword: #ff7bde;
  --syn-function: #de7bff;
  --syn-variable: #ff5d8f;
  --syn-string: #8cff7b;
  --syn-number: #ffb20d;
  --syn-type: #ffe27b;
  --syn-operator: #3eacff;
  --syn-punctuation: var(--prototype-panel-fg);
  color: var(--fg);
}
.project-panel :is(input, select, textarea) {
  color: var(--fg);
  background-color: var(--prototype-panel-input);
}
.project-panel input::placeholder,
.project-panel textarea::placeholder {
  color: var(--prototype-panel-muted);
  opacity: 1;
}
.project-panel :is(input, select, textarea, button, a, summary):focus-visible,
.files-menu :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  box-shadow: none;
}
.project-panel :is(a, button, summary):hover .files-tree-size,
.project-panel [aria-current="true"] .files-tree-size,
.project-panel .file-glyph-ext {
  color: var(--prototype-panel-muted-hover);
}
.project-panel .prose a {
  color: var(--link);
}
.project-panel button.primary {
  background: var(--prototype-panel-accent);
  color: var(--prototype-panel-bg);
}
.project-panel button.primary:hover:not(:disabled) {
  box-shadow: none;
}
.project-panel .panel-composer-input:disabled {
  background: var(--prototype-panel-input);
}
.project-panel button:disabled {
  opacity: 0.7;
}

/* Toolbox panel, Files tree and dock. Shared conversation styles remain in chrome.css. */
.panel-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Bounded, not min-height: the tree scrolls inside so the selected file's block stays pinned at the bottom. */
  height: 100%;
}
.panel-files-tools {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}
.panel-files .panel-files-search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.panel-files .panel-files-search > .icon {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.panel-files .panel-files-search .file-search {
  display: block;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 8px 0 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.panel-files .panel-files-tools > .icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg-muted);
}
.panel-files .panel-files-tools > .icon-button:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--fg);
}
.panel-files .panel-files-tools > .icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 959px) {
  .panel-files .panel-files-search .file-search,
  .panel-files .panel-files-tools > .icon-button {
    min-height: 44px;
  }
  .panel-files .panel-files-tools > .icon-button {
    min-width: 44px;
  }
}
.panel-files .files-tree-scroll {
  flex: 1;
  /* Below this floor the tree would clip its rows; the panel body scrolls the section instead. */
  min-height: 120px;
  margin-right: -8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.panel-files [data-file-row] .files-row-menu {
  margin-right: 0;
}
.panel-file-current {
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  padding-top: 10px;
}
.panel-file-path {
  font-weight: 500;
  margin: 0;
  overflow-wrap: anywhere;
}
.panel-file-current .row-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
/* Full buys room, not measure — except the tree, which uses the space it has. */
.project-layout[data-panel-state="full"] .panel-files {
  max-width: none;
}
.files-tree-scroll .files-directory {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.files-directory > summary,
.files-tree-scroll [data-file-select] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--fg);
  text-decoration: none;
  margin: 2px 0;
  min-width: 0;
}
.files-directory > summary {
  font-weight: 500;
  list-style: none;
}
.files-directory > summary::-webkit-details-marker,
.files-directory > summary::after {
  display: none;
}
.files-directory > summary .icon:first-child {
  width: 12px;
  flex-basis: 12px;
}
.files-directory[open] > summary .icon:first-child {
  transform: rotate(90deg);
}
.files-directory > summary:hover,
.files-tree-scroll [data-file-select]:hover,
.files-tree-scroll [aria-current="true"] {
  background: var(--surface-raised);
}
.files-tree-scroll [aria-current="true"] {
  font-weight: 500;
  /* The selected row's edge marks it — the panel-list pattern (2px accent, not a filled chip). */
  box-shadow: inset 2px 0 0 var(--brand);
}
.files-tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-tree-size {
  flex-shrink: 0;
  color: var(--fg-muted);
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* A file's glyph: the type icon carrying its own extension badge, so two documents of different types (a
   Markdown file and a Word file, say) don't read as one mark. */
.file-glyph {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.file-glyph .icon {
  width: 18px;
  height: 18px;
}
/* The badge hangs off the icon's bottom-right corner — a thin strip of overlap, so the mark stays readable. */
.file-glyph-ext {
  position: absolute;
  right: -3px;
  bottom: -7px;
  padding: 0 2px;
  border-radius: 3px;
  background: var(--surface-raised);
  color: var(--fg-muted);
  font-size: 6.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: uppercase;
}
.files-tree-children {
  margin-top: 0;
  margin-left: 16px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.files-tree-children .files-tree-children .files-tree-children {
  margin-left: 4px;
  padding-left: 4px;
}
/* Past the fourth level the rail stops indenting — the three-class nesting rule above would still win on equal
   specificity, so the flat rule is stated in the same nested form and, ordered after it, prevails. */
.files-tree-children .files-tree-children.files-tree-flat {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
/* A file row carries its … action at the end of the same line; quiet until the row or the button is addressed. */
[data-file-row] {
  display: flex;
  align-items: center;
  min-width: 0;
}
[data-file-row] [data-file-select] {
  flex: 1;
}
[data-file-row] .files-row-menu {
  flex-shrink: 0;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  margin: 0 4px 0 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--fg-muted);
  display: grid;
  place-items: center;
}
/* The action stays quiet until the row is hovered or the button is reached — on touch, where there's no
   hover, it stays visible. It keeps its seat either way, so nothing shifts when it appears. */
@media (hover: hover) {
  [data-file-row] .files-row-menu {
    opacity: 0;
  }
}
[data-file-row] .files-row-menu .icon {
  width: 16px;
  height: 16px;
}
[data-file-row]:hover .files-row-menu,
[data-file-row]:focus-within .files-row-menu,
[data-file-row] .files-row-menu:focus-visible,
[data-file-row] .files-row-menu[aria-expanded="true"] {
  opacity: 1;
}
[data-file-row]:hover .files-row-menu,
[data-file-row] .files-row-menu:focus-visible,
[data-file-row] .files-row-menu[aria-expanded="true"] {
  background: var(--surface-raised);
  color: var(--fg);
}
/* The floating menu the row's … opens: the selected-file block's same actions, each with its label. */
.files-menu {
  position: fixed;
  z-index: 500;
  min-width: 200px;
  max-width: 280px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.files-menu-name {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 12px;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.files-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--fg);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.files-menu-item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--fg-muted);
}
.files-menu-item:hover,
.files-menu-item:focus-visible {
  background: var(--surface-raised);
}
.files-menu-item:hover .icon,
.files-menu-item:focus-visible .icon {
  color: var(--fg);
}
.files-menu-item.danger,
.files-menu-item.danger .icon {
  color: var(--danger);
}
.files-menu-item.danger:hover {
  background: var(--danger-bg);
}
.project-panel[hidden] {
  /* The class's flex display would override the attribute's own rule; a closed panel must not keep its links on
     the focus order. */
  display: none;
}
.project-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.project-panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  height: 40px;
  justify-content: space-between;
  padding: 0 8px 0 16px;
}
.project-panel-head:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.project-panel-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}
.project-panel-controls {
  display: flex;
  gap: 2px;
}
.project-panel-control {
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--fg-muted);
  height: 32px;
  min-height: 32px;
  padding: 0;
  width: 32px;
}
.project-panel-control:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--fg);
}
.project-panel-control:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.project-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}
/* The author, 2026-11-12: the content takes the panel's width at every size, Full included (it was held to 648px). */

/* The file tree: 6 from a group's name to its first row, 12 between rows, 24 between groups. */
.panel-group + .panel-group {
  margin-top: 24px;
}
.panel-group-name {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px;
}
.panel-group-name code {
  font-family: var(--font-code);
  overflow-wrap: anywhere;
}
.panel-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel-file {
  border-radius: 10px;
  color: var(--fg);
  display: flex;
  font-size: 13px;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.4;
  padding: 6px 8px;
  text-decoration: none;
}
a.panel-file:hover {
  background: var(--surface-raised);
}
a.panel-file:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.panel-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.panel-file-kind {
  color: var(--fg-muted);
  flex: 0 0 auto;
  font-family: var(--font-code);
}
.panel-blank-lead {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}
.panel-blank-body {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 8px 0 0;
}
/* The start steps in the panel keep the inspector register, and a command wraps rather than scrolling sideways. */
.project-panel .setup-steps {
  gap: 16px;
  margin: 16px 0;
}
.project-panel .setup-steps > li > h3 {
  font-size: 13px;
}
.project-panel .setup-steps p {
  font-size: 13px;
  line-height: 1.4;
}
.project-panel .setup-steps .command-line code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.panel-retry {
  font-size: 13px;
  margin-top: 12px;
}

/* The AIUS section (Dmytro, 2026-09-20): a thread in the body, the grounding line and the composer in the foot.
   Grouping follows the prototype: 4 inside a turn's label pair, 8 between its sentences, 32 between turns. */
.project-panel-foot {
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  padding: 12px 16px 16px;
}
/* The author, 2026-11-12: the message field widens with the panel (only the transcript keeps its column); on a wide
   Full the computer choice stands to the field's right, 12px off it, both the card's height, and Send widens to keep
   its proportion at that height. The notes below span both. */
@media (min-width: 1280px) {
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) {
    --composer-min: 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    column-gap: 12px;
    align-items: stretch;
  }
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) > * {
    grid-column: 1 / -1;
  }
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) > .panel-composer {
    /* The composer sets its own minimum; here it takes the card's. */
    --composer-min: 50px;
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) > .panel-ground {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    box-sizing: border-box;
    min-height: var(--composer-min);
    display: flex;
    align-items: center;
  }
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) .panel-ground-field {
    flex: 1 1 auto;
  }
  .project-layout[data-panel-state="full"] .project-panel-foot:has(.panel-ground:not(:empty)) .panel-composer-send {
    width: 64px;
    min-width: 64px;
  }
}
.panel-turns {
  display: flex;
  flex-direction: column;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel-turn {
  font-size: 13px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The reader's turn takes a rule, not a ground: a speaker is not a sunken thing. */
.panel-turn[data-role="reader"] {
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}
.panel-turn p,
.panel-turn .prose > * {
  margin: 8px 0 0;
}
.panel-turn .prose {
  font-size: 13px;
  line-height: 1.55;
}
.panel-turn .prose :is(h1, h2, h3, h4, h5, h6) {
  font-size: 13px;
  font-weight: 600;
}
.panel-turn .prose :is(ul, ol) {
  padding-left: 18px;
}
.panel-turn-who {
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 400;
  margin: 0 !important;
}
.panel-turn-who + * {
  margin-top: 4px !important;
}
.panel-permission {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 24px;
  padding: 12px;
}
.panel-permission-lead {
  font-weight: 600;
  margin: 0;
}
.panel-permission-detail {
  background: var(--surface-raised);
  border-radius: 8px;
  font-family: var(--font-code);
  font-size: 12px;
  margin: 8px 0 0;
  max-height: 160px;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 8px;
  white-space: pre-wrap;
}
.panel-permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.panel-permission-actions button,
.panel-stop {
  font-size: 13px;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
}
/* A question the agent asks: its options to choose from, then a field for the person's own answer. */
.panel-question-item {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}
.panel-question-item + .panel-question-item {
  margin-top: 16px;
}
.panel-question-item legend {
  padding: 0;
}
.panel-question-option {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.panel-question-option input {
  flex: none;
  margin: 2px 0 0;
  padding: 0;
  width: auto;
}
.panel-question-option > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.panel-question-label {
  overflow-wrap: anywhere;
}
.panel-question-description {
  color: var(--fg-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.panel-question-own {
  display: block;
  margin-top: 8px;
}
.panel-question-own input {
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  min-height: 32px;
  padding: 6px 12px;
  width: 100%;
}
.panel-question-secret,
.panel-turn-cut {
  color: var(--fg-muted);
  margin: 8px 0 0;
}
.panel-working {
  align-items: center;
  color: var(--fg-muted);
  display: flex;
  font-size: 13px;
  gap: 8px;
  margin: 24px 0 0;
}
.panel-chat-note {
  margin: 0 0 16px;
}
/* The thread reads as it is written: turns arrive with a short rise, the reply being written ends in a caret, and the
   work in progress pulses. Nothing moves for someone who asked for reduced motion. */
.panel-thread {
  position: relative;
}
.panel-thread-head {
  position: sticky;
  top: -16px;
  z-index: 1;
  background: var(--prototype-panel-bg);
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.panel-thread-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.panel-thread-action,
.panel-ground-new {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  padding: 0;
  width: 28px;
}
.panel-thread-action:hover,
.panel-ground-new:hover {
  background: var(--brand-subtle);
  color: var(--fg);
}
.panel-thread-action .icon,
.panel-ground-new .icon {
  width: 16px;
  height: 16px;
}
.panel-ground-new[aria-pressed="true"] {
  color: var(--brand);
}
.panel-copy-note {
  color: var(--fg-muted);
  font-size: 12px;
}
.panel-copy-note:empty {
  display: none;
}
.panel-offline {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 0;
}
.panel-offline code {
  font-family: var(--font-code);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.panel-offline .panel-offline-copy {
  font-size: 12px;
  margin-left: 4px;
  min-height: 24px;
  padding: 0 8px;
}
.panel-offline .panel-copy-note {
  margin-left: 6px;
}
.panel-confirm {
  color: var(--fg-muted);
  font-size: 12px;
}
.panel-thread-actions button:not(.panel-thread-action) {
  font-size: 12px;
  min-height: 28px;
  padding: 2px 10px;
}
.panel-turn-enter {
  animation: panel-turn-in 180ms ease-out both;
}
@keyframes panel-turn-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.panel-turn-sending {
  opacity: 0.7;
}
.panel-turn-state {
  color: var(--fg-subtle);
  font-weight: 400;
  margin-left: 8px;
}
.panel-turn-who {
  align-items: center;
  display: flex;
  gap: 8px;
}
.panel-turn-actions {
  margin: 4px 0 0 !important;
}
.panel-turn-copy {
  background: none;
  border: 0;
  color: var(--fg-subtle);
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  min-height: 0;
  opacity: 0;
  padding: 0 4px;
  transition: opacity 120ms ease;
}
.panel-turn:hover .panel-turn-copy,
.panel-turn-copy:focus-visible {
  opacity: 1;
}
.panel-turn-copy:hover {
  color: var(--fg);
}
.panel-caret {
  animation: panel-caret-blink 1s steps(1) infinite;
  background: currentColor;
  display: inline-block;
  height: 1.05em;
  margin-left: 2px;
  opacity: 0.7;
  vertical-align: text-bottom;
  width: 7px;
}
@keyframes panel-caret-blink {
  50% {
    opacity: 0;
  }
}
.panel-status:empty {
  display: none;
}
.panel-working {
  flex-wrap: wrap;
}
.panel-shimmer {
  animation: aius-shimmer 1.6s linear infinite;
  background: linear-gradient(90deg, var(--fg-muted) 30%, var(--fg) 50%, var(--fg-muted) 70%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.panel-elapsed {
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.panel-jump {
  align-items: center;
  border-radius: 999px;
  bottom: 12px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  display: inline-flex;
  font-size: 12px;
  gap: 4px;
  left: 50%;
  min-height: 28px;
  padding: 2px 12px;
  position: sticky;
  transform: translateX(-50%);
}
.panel-jump[hidden] {
  display: none;
}
.panel-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}
.panel-suggestion {
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  min-height: 32px;
  padding: 4px 12px;
  text-align: left;
}
@media (prefers-reduced-motion: reduce) {
  .panel-turn-enter,
  .panel-caret,
  .panel-shimmer,
  .panel-tool .panel-tool-mark,
  .panel-tool .panel-tool-mark::before {
    animation: none;
  }
  .panel-shimmer {
    background: none;
    color: var(--fg-muted);
  }
}

/* A project's conversations: the recent ones to reopen, and where the open one runs. */
.panel-conversations-title {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 24px 0 4px;
}
.panel-conversations {
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel-conversation {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 8px 0;
  text-align: left;
  width: 100%;
}
.panel-conversation:hover .panel-conversation-title {
  text-decoration: underline;
}
.panel-conversation-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.panel-conversation-meta,
.panel-conversation-where {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.4;
}
.panel-conversation-where {
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.panel-conversation-usage:not(:empty) {
  color: var(--fg-muted);
  font-size: 12px;
  margin: -12px 0 16px;
}
/* The conversation's totals take their own line under where it runs, not a squeezed column beside it. */
.panel-thread-head {
  flex-wrap: wrap;
}
.panel-thread-head > .panel-conversation-where {
  flex: 1 1 0;
}
.panel-thread-head > .panel-conversation-usage:not(:empty) {
  flex-basis: 100%;
  order: 3;
}
.panel-ground {
  align-items: center;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 4px 12px;
  line-height: 1.4;
  margin: 0 0 8px;
  min-width: 0;
}
.panel-ground:empty {
  display: none;
}
.panel-ground-field {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}
.panel-ground-field select {
  font-size: 13px;
  height: 28px;
  max-width: 190px;
  min-height: 28px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-composer {
  align-items: flex-end;
  display: flex;
  gap: 8px;
}
.panel-composer-input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--fg);
  flex: 1 1 auto;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  max-height: 160px;
  min-height: 36px;
  min-width: 0;
  padding: 8px 12px;
  resize: none;
}
.panel-composer-input::placeholder {
  color: var(--fg-muted);
}
.panel-composer-input:focus-visible {
  border-color: var(--brand);
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.panel-composer-input:disabled {
  background: var(--surface-raised);
}
.panel-composer-menu {
  background: var(--surface-raised, var(--bg));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  margin-top: 6px;
  padding: 10px 12px;
}
.panel-composer-menu-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.panel-composer-menu-label {
  color: var(--fg-muted);
  display: block;
  font-size: 11px;
  font-weight: 600;
}
.panel-composer-menu-icons {
  display: flex;
  gap: 4px;
}
.panel-composer-menu-icon {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--fg-muted);
  display: inline-flex;
  font: inherit;
  font-size: 11px;
  height: 22px;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0;
  width: 22px;
}
.panel-composer-menu-icon:not(:disabled):hover {
  border-color: var(--line-strong);
  color: var(--fg);
}
.panel-composer-menu-icon:disabled {
  opacity: 0.4;
}
.panel-composer-language {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  width: 100%;
}
.panel-composer-send {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--fg-muted);
  display: flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}
.panel-composer-dictate {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--fg-muted);
  display: flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}
.panel-composer-dictate:hover,
.panel-composer-dictate:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}
.panel-composer-dictate.is-recording {
  animation: dictate-pulse 1.6s ease-in-out infinite;
  border-color: var(--danger, #a64035);
  color: var(--danger, #a64035);
}
.panel-composer-dictate.is-paused {
  animation: none;
  border-color: var(--warning, #b07a2a);
  color: var(--warning, #b07a2a);
}
@keyframes dictate-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger, #a64035) 45%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel-composer-dictate.is-recording {
    animation: none;
  }
}
.panel-composer-level {
  background: var(--line);
  border-radius: 2px;
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  width: 100%;
}
.panel-composer-level i {
  background: var(--brand);
  border-radius: 2px;
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 80ms linear;
  width: 100%;
}
.panel-composer-dictate svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 18px;
}
.panel-composer-dictate svg[data-fill] {
  fill: currentColor;
  stroke: none;
}
[data-chat-dictation-status] {
  color: var(--fg-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.panel-composer-send:hover:not(:disabled) {
  border-color: var(--fg-muted);
  color: var(--fg);
}
.panel-composer-send .icon {
  width: 18px;
  height: 18px;
}
.panel-jump .icon {
  width: 14px;
  height: 14px;
}
.panel-chat-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
  margin: 8px 0 0;
}

/* The dock and panel share the floating plane. */
.project-dock {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-dock-tool {
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--fg-muted);
  height: 40px;
  min-height: 40px;
  padding: 0;
  width: 40px;
}
.project-dock-tool:hover:not(:disabled) {
  background: var(--line);
  color: var(--fg);
}
.project-dock-tool[aria-pressed="true"] {
  background: var(--brand-wash-2);
  color: var(--brand);
}
.project-dock-tool:focus-visible,
.project-mast-tool:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* Below 1280 the dock yields and the mast summons the panel, one handover at one breakpoint. */
.project-mast-tool {
  display: none;
}
@media (max-width: 1279px) {
  .project-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-dock {
    display: none;
  }
  .project-layout .report-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .mast-actions > .project-mast-tool {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--fg);
    display: inline-flex;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
  }
  .mast-actions > .project-mast-tool:hover:not(:disabled) {
    border-color: var(--line-strong);
    color: var(--fg);
  }
  .mast-actions > .project-mast-tool[aria-pressed="true"] {
    background: var(--brand-wash-2);
    border-color: var(--brand-line);
    color: var(--brand);
    font-weight: 600;
  }
}
@media (max-width: 959px) {
  .mast-actions > .project-mast-tool {
    height: 44px;
    min-height: 44px;
  }
}
/* On a phone the document's actions and the tabs don't fit one row, so the tabs take their own row under the actions
   and every tab stays in sight. (The tools left the mast for the bottom dock on 2026-11-12.) */
@media (max-width: 479px) {
  body:has(.project-layout) {
    --mast-height: 88px;
  }
  /* The server's first view has the tabs alone; the row the actions will take is kept, so nothing moves when they
     arrive. */
  body:has(.project-layout) .mast {
    flex-wrap: wrap;
    row-gap: 0;
    min-height: calc(var(--mast-height) + 1px);
    align-content: flex-end;
  }
  body:has(.project-layout) .mast .tabs {
    order: 2;
    flex: 1 0 100%;
    height: 44px;
  }
  body:has(.project-layout) .mast-actions {
    margin-left: auto;
  }
}
@media print {
  .project-layout {
    display: block;
  }
  .project-panel,
  .project-dock,
  .project-panel-resize,
  .project-mast-tool {
    display: none !important;
  }
  .project-layout[data-panel-state="full"] .project-content {
    display: block;
  }
}

/* Floating plane adapted from a10cd6c's report frame; state remains owned by the product controller. */
@media screen {
  .project-layout {
    --toolbox-gap: 12px;
    --toolbox-open-width: 0px;
    --toolbox-frame-width: var(--rail-width);
  }
  body.rail-slim .project-layout {
    --toolbox-frame-width: var(--rail-slim);
  }
  .project-layout[data-panel-state="side"] {
    --toolbox-open-width: var(--toolbox-side-width);
  }
  .project-layout[data-panel-state="full"] {
    /* The author, 2026-11-12: Full leaves the rail the same 12px it leaves the window's right edge. */
    --toolbox-open-width: calc(100vw - var(--toolbox-frame-width) - 2 * var(--toolbox-gap) - var(--dock-width));
  }
  .project-layout::after {
    content: "";
    position: fixed;
    inset: calc(var(--topbar) + var(--toolbox-gap)) var(--toolbox-gap) var(--toolbox-gap) auto;
    width: calc(var(--dock-width) + var(--toolbox-open-width));
    border-radius: 16px;
    background: var(--prototype-panel-bg);
    box-shadow: var(--prototype-panel-shadow);
    pointer-events: none;
    transition: width 320ms cubic-bezier(0.2, 0, 0, 1);
    z-index: 42;
  }
  .project-panel,
  .project-layout[data-panel-state="full"] .project-panel {
    position: fixed;
    inset: calc(var(--topbar) + var(--toolbox-gap)) var(--toolbox-gap) var(--toolbox-gap) auto;
    width: var(--toolbox-open-width);
    height: auto;
    background: transparent;
    border: 0;
    border-radius: 0 16px 16px 0;
    overflow: hidden;
    z-index: 43;
    /* The author, 2026-11-12: the contents travel with the plane's edge instead of popping in. `hidden` is
       display:none, so the width starts from 0 (@starting-style) and the display flip waits out the close. */
    transition:
      width 320ms cubic-bezier(0.2, 0, 0, 1),
      display 320ms allow-discrete;
  }
  @starting-style {
    .project-panel,
    .project-layout[data-panel-state="full"] .project-panel {
      width: 0;
    }
  }
  /* The rows keep their open width while the panel's width moves, so nothing rewraps mid-slide; the panel clips. */
  .project-panel > * {
    min-width: min(var(--toolbox-side-width), 100vw - 2 * var(--toolbox-gap));
  }
  /* The author, 2026-11-12: Files takes the chat's compact head, 8px around the 32px controls. */
  .project-panel-head {
    height: auto;
    min-height: 48px;
    padding: 8px 8px 8px 16px;
    border-radius: 0 16px 0 0;
  }
  .project-panel-head:focus-visible {
    outline-offset: -4px;
  }
  .project-dock {
    position: fixed;
    inset: calc(var(--topbar) + var(--toolbox-gap)) calc(var(--toolbox-gap) + var(--toolbox-open-width))
      var(--toolbox-gap) auto;
    width: var(--dock-width);
    height: auto;
    padding: 8px 0;
    background: transparent;
    border: 0;
    z-index: 43;
    transition: right 320ms cubic-bezier(0.2, 0, 0, 1);
  }
  /* The edge is the handle (prototype a10cd6c report.css §3): an 8px hit area on the sheet's edge facing the
     document, drawn only as a 2px accent line on hover, while dragging and on keyboard focus; short of the corners. */
  .project-panel-resize {
    position: fixed;
    top: calc(var(--topbar) + var(--toolbox-gap) + 16px);
    bottom: calc(var(--toolbox-gap) + 16px);
    right: calc(var(--toolbox-gap) + var(--dock-width) + var(--toolbox-open-width) - 4px);
    width: 8px;
    cursor: col-resize;
    touch-action: none;
    z-index: 44;
    transition: right 320ms cubic-bezier(0.2, 0, 0, 1);
  }
  .project-panel-resize::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 3px;
    width: 2px;
    border-radius: 999px;
    background: var(--prototype-panel-accent);
    opacity: 0;
    transition: opacity 120ms ease;
  }
  .project-panel-resize:hover::before,
  .project-panel-resize:focus-visible::before,
  .project-layout[data-panel-resizing] .project-panel-resize::before {
    opacity: 1;
  }
  .project-panel-resize:focus-visible {
    outline: none;
  }
  .project-layout[data-panel-resizing]::after,
  .project-layout[data-panel-resizing] .project-panel,
  .project-layout[data-panel-resizing] .project-dock,
  .project-layout[data-panel-resizing] .project-panel-resize {
    transition: none;
  }
  :root:has(.project-layout[data-panel-resizing]),
  :root:has(.project-layout[data-panel-resizing]) * {
    cursor: col-resize;
    user-select: none;
  }
  @media (max-width: 1279px) {
    .project-panel-resize {
      display: none;
    }
  }
  .project-layout:not([data-panel-state="closed"]) .project-dock {
    border-right: 1px solid var(--line);
  }
  /* The author, 2026-11-12: below 1280 the same black plane lies along the bottom of the screen. The dock is its
     bottom row, horizontal, and the panel rises out of it (bottom to top), as the desktop plane widens out of its
     dock. The mast no longer carries the tools. */
  @media (max-width: 1279px) {
    /* The author, 2026-11-12: not the full width. Closed, the plane is a pill around the dock's tools, centred at the
       bottom; open, it widens to at most 640px (the whole width only where the screen is narrower) and rises. */
    .project-layout {
      --toolbox-frame-width: var(--rail-width);
      --toolbox-dock-height: 56px;
      --toolbox-open-height: 0px;
      --toolbox-bottom: calc(var(--toolbox-gap) + env(safe-area-inset-bottom, 0px));
      --toolbox-avail: calc(100vw - var(--toolbox-frame-width) - 2 * var(--toolbox-gap));
      --toolbox-plane: 112px;
      --toolbox-left: calc(
        var(--toolbox-frame-width) + var(--toolbox-gap) + (var(--toolbox-avail) - var(--toolbox-plane)) / 2
      );
    }
    .project-layout[data-panel-state="full"] {
      --toolbox-plane: min(var(--toolbox-avail), 640px);
      --toolbox-open-height: calc(
        100dvh - var(--topbar) - var(--toolbox-gap) - var(--toolbox-bottom) - var(--toolbox-dock-height)
      );
    }
    /* The page scrolls clear of the plane. */
    .project-content {
      padding-bottom: calc(var(--toolbox-dock-height) + var(--toolbox-bottom) + var(--toolbox-gap));
    }
    .project-layout::after {
      inset: auto auto var(--toolbox-bottom) var(--toolbox-left);
      width: var(--toolbox-plane);
      height: calc(var(--toolbox-dock-height) + var(--toolbox-open-height));
      border-radius: 16px;
      transition:
        height 320ms cubic-bezier(0.2, 0, 0, 1),
        width 320ms cubic-bezier(0.2, 0, 0, 1),
        left 320ms cubic-bezier(0.2, 0, 0, 1);
    }
    .project-panel,
    .project-layout[data-panel-state="full"] .project-panel {
      inset: auto auto calc(var(--toolbox-bottom) + var(--toolbox-dock-height)) var(--toolbox-left);
      width: var(--toolbox-plane);
      height: var(--toolbox-open-height);
      border-radius: 16px 16px 0 0;
      transition:
        height 320ms cubic-bezier(0.2, 0, 0, 1),
        width 320ms cubic-bezier(0.2, 0, 0, 1),
        left 320ms cubic-bezier(0.2, 0, 0, 1),
        display 320ms allow-discrete;
    }
    .project-panel > * {
      min-width: 0;
    }
    .project-panel-head {
      border-radius: 16px 16px 0 0;
    }
    .project-dock {
      display: flex;
      inset: auto auto var(--toolbox-bottom) var(--toolbox-left);
      width: var(--toolbox-plane);
      height: var(--toolbox-dock-height);
      flex-direction: row;
      justify-content: center;
      gap: 8px;
      padding: 0 8px;
      box-sizing: border-box;
      transition:
        width 320ms cubic-bezier(0.2, 0, 0, 1),
        left 320ms cubic-bezier(0.2, 0, 0, 1);
    }
    .project-dock-tool {
      width: 44px;
      height: 44px;
    }
    .project-layout:not([data-panel-state="closed"]) .project-dock {
      border-right: 0;
      border-top: 1px solid var(--line);
    }
    .mast-actions > .project-mast-tool {
      display: none;
    }
  }
  @media (max-width: 1279px) {
    @starting-style {
      .project-panel,
      .project-layout[data-panel-state="full"] .project-panel {
        /* It starts as the closed pill, so it widens and rises together with the plane. */
        --toolbox-plane: 112px;
        width: var(--toolbox-plane);
        height: 0;
      }
    }
  }
  @media (max-width: 959px) {
    .project-layout,
    body.rail-slim .project-layout {
      --toolbox-frame-width: 0px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .project-layout::after,
    .project-panel,
    .project-dock,
    .project-panel-resize,
    .project-panel-resize::before {
      transition: none;
    }
  }
}

/* Conversation navigation stays outside the scrolling transcript. */
.panel-chat-navigation {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-chat-navigation-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.panel-chat-strip {
  display: flex;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
.panel-chat-card,
.panel-chat-overflow-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  color: var(--fg);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.panel-chat-card {
  flex: 0 0 140px;
  width: 140px;
}
.panel-chat-card[aria-pressed="true"] {
  border-color: var(--focus);
}
.panel-chat-card-title {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-chat-card-meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-muted);
  font-size: 12px;
}
.panel-chat-overflow-toggle {
  box-sizing: border-box;
  align-self: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--fg);
  cursor: pointer;
}
.panel-chat-overflow-toggle .icon {
  width: 16px;
  height: 16px;
}
.panel-chat-overflow {
  position: absolute;
  z-index: 5;
  top: 100%;
  right: 16px;
  width: min(280px, calc(100% - 32px));
  max-height: min(50vh, 400px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 8px 24px #0008;
}
.panel-chat-overflow-item {
  width: 100%;
  border: 0;
}
.panel-chat-overflow-item .panel-chat-card-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.panel-chat-selected {
  display: flex;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
  min-width: 0;
}
.panel-chat-selected details {
  flex: 1;
  min-width: 0;
}
.panel-chat-selected summary {
  cursor: pointer;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.panel-chat-selected p {
  max-height: 8em;
  overflow: auto;
  overflow-wrap: anywhere;
}
.panel-chat-selected-actions {
  display: flex;
  gap: 4px;
}
.panel-chat-tooltip {
  pointer-events: none;
  position: absolute;
  z-index: 6;
  top: 100%;
  left: 16px;
  right: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--fg);
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px #0008;
}

/* AIUS title and panel controls sit above the conversation strip. */
.project-layout[data-panel-section="aius"] .project-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  height: auto;
  min-height: 40px;
  align-items: center;
  padding: 8px 8px 8px 16px;
}
.project-layout[data-panel-section="aius"] .project-panel-title {
  display: block;
  grid-column: 1;
  grid-row: 1;
}
.project-layout[data-panel-section="aius"] .project-panel-controls {
  flex: 0 0 auto;
}
.project-layout[data-panel-section="aius"] .panel-chat-navigation {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 0 0 2px;
  /* The strip uses the head's 8px right inset on the left too, so every pixel goes to the tabs (the author, 2026-11-12). */
  margin-left: -8px;
  border: 0;
}
.panel-ground:not(:empty) {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
}
.panel-ground-field {
  width: 100%;
  align-items: center;
  gap: 6px;
}
.panel-ground-icon {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
}
.panel-ground-icon svg {
  width: 22px;
  height: 22px;
}
.panel-ground-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.panel-ground-label,
.panel-ground-status {
  color: var(--fg-muted);
  font-size: 12px;
}
.panel-chat-selected summary {
  font-size: 12px;
  color: var(--fg-muted);
}
.panel-ground-content [data-chat-computer-name],
.panel-ground-content select {
  color: var(--fg);
  font-weight: 600;
}
@media (max-width: 959px) {
  .panel-chat-selected summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Conversation actions belong to the selected tab; the chevron lists every conversation. */
.panel-chat-card-wrap {
  position: relative;
  flex: 0 0 min(176px, 100%);
  min-width: 0;
}
.panel-chat-card-wrap .panel-chat-card {
  width: 100%;
  height: 100%;
  padding: 5px 14px;
}
.panel-chat-card-wrap:has(.panel-chat-actions-toggle) .panel-chat-card {
  padding-right: 36px;
}
/* The author, 2026-11-12: the open conversation reads as chosen at once, its menu visible; any other tab shows its
   menu on hover. Touch has no hover, so there only the open tab carries it. */
.panel-chat-card-wrap .panel-chat-card[aria-pressed="true"] {
  background: var(--surface);
}
.panel-chat-card-wrap:not(:has([aria-pressed="true"])) .panel-chat-actions-toggle {
  visibility: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .panel-chat-card-wrap:hover .panel-chat-actions-toggle {
    visibility: visible;
  }
}
.panel-chat-actions-toggle:hover {
  background: var(--surface-raised);
}
.panel-chat-actions-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.panel-chat-actions-toggle .icon {
  width: 18px;
  height: 18px;
}
.panel-chat-actions,
.panel-chat-copy-note {
  position: absolute;
  z-index: 7;
  top: 100%;
  width: min(260px, 100%);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 8px 24px #0008;
}
.panel-chat-actions p {
  margin: 0;
  padding: 8px;
  max-height: 6em;
  overflow: auto;
  color: var(--fg-muted);
  overflow-wrap: anywhere;
}
/* A mouse reads a cut title from the tab's tooltip; the menu repeats it only for touch, which has no hover. */
@media (hover: hover) and (pointer: fine) {
  .panel-chat-actions p {
    display: none;
  }
}
/* Tabs settle on a whole tab at the start of the strip instead of leaving a sliver beside New. */
.panel-chat-strip {
  scroll-snap-type: x proximity;
}
.panel-chat-card-wrap {
  scroll-snap-align: start;
}
.panel-chat-actions a {
  text-decoration: none;
}
/* The author, 2026-11-12: the list of every conversation hangs from its chevron, right edges flush, 6px below it
   like the tab menu. The AIUS strip has no side padding, so the list's 16px inset was the misalignment. */
.project-layout[data-panel-section="aius"] .panel-chat-overflow {
  right: 0;
  margin-top: 4px;
}
/* The copy confirmation sits where the menu was (placed by remote-chat.ts), as wide as its words. */
.panel-chat-navigation .panel-chat-copy-note {
  width: max-content;
  max-width: min(260px, 100%);
  margin-top: 4px;
  padding: 9px 12px;
}
.panel-chat-navigation .panel-chat-copy-note:empty {
  display: none;
}
.panel-chat-actions a:hover,
.panel-chat-actions a:focus-visible {
  background: var(--surface);
}
.panel-chat-actions button,
.panel-chat-actions a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.panel-chat-actions button:hover,
.panel-chat-actions button:focus-visible {
  background: var(--surface);
}
.panel-chat-actions button.danger {
  color: var(--danger, #f0a0a0);
}
.panel-chat-actions .icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.panel-chat-copy-note {
  left: 0;
  width: auto;
  padding: 8px;
}
.panel-chat-copy-note:empty {
  display: none;
}
.panel-chat-overflow-item[aria-pressed="true"] {
  outline: 1px solid var(--focus);
}
.panel-chat-main-view {
  display: grid;
  place-items: center;
}
.panel-chat-main-view[hidden] {
  display: none;
}
@media (max-width: 959px) {
  .panel-chat-actions-toggle,
  .panel-chat-overflow-toggle {
    min-width: 44px;
    min-height: 44px;
  }
  .panel-chat-card-wrap:has(.panel-chat-actions-toggle) .panel-chat-card {
    padding-right: 50px;
  }
  .panel-chat-actions button {
    min-height: 44px;
  }
}

/* Current execution stays in the scrolling thread; the next-message computer and composer stay below it. */
.project-layout[data-panel-section="aius"] .project-panel-body {
  display: flex;
  flex-direction: column;
}
.panel-thread {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
.panel-thread > .panel-status {
  margin-top: auto;
}
.panel-working .panel-stop {
  margin-left: auto;
}
.panel-working {
  flex-wrap: nowrap;
}
.panel-working .panel-pulse {
  margin-right: 0;
}
.panel-working-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.panel-working .panel-elapsed,
.panel-working .panel-stop {
  flex: none;
}
.panel-ground-field {
  position: relative;
}
.panel-ground-content {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, max-content) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 0;
  align-items: center;
}
.panel-ground-choice {
  display: flex;
  align-items: center;
  min-width: 0;
}
.panel-ground-path,
.panel-ground-state {
  grid-column: 1 / -1;
  grid-row: 2;
  max-height: 3.6em;
  overflow: auto;
  overflow-wrap: anywhere;
  color: var(--fg-muted);
  font-size: 12px;
}
.panel-ground-choice select {
  field-sizing: content;
  width: auto;
  max-width: 100%;
  padding: 0;
  appearance: none;
  background: transparent;
  border: 0;
}
.panel-ground-choice > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: -20px;
  pointer-events: none;
}
/* The readiness dot sits right after the name, centred on its line; its hit area extends to the right, not the gap. */
.panel-computer-status-wrap {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  z-index: 1;
}
.panel-ground-chevron {
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  cursor: pointer;
}
.panel-ground-chevron .icon {
  width: 16px;
  height: 16px;
}
.panel-computer-status {
  border: 0;
  padding: 0;
  margin: 0;
}
.panel-computer-status summary {
  display: grid;
  align-items: center;
  justify-items: start;
  padding-left: 7px;
  width: 24px;
  height: 24px;
  margin: -4px 0;
  box-sizing: border-box;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
@media (max-width: 959px), (pointer: coarse) {
  .panel-computer-status summary {
    width: 44px;
    height: 44px;
    margin: -12px 0;
  }
}
.panel-computer-status summary::-webkit-details-marker {
  display: none;
}
/* Centred on the name's capitals, not its line box: the line box centre sits ~1.7px below them at 13px. */
.panel-computer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  transform: translateY(-0.12em);
}
.panel-computer-dot.is-ready {
  background: var(--success);
}
/* The author, 2026-11-12: the readiness tooltip belongs to its dot. It stands 6px above it, its text starting over the
   dot's left edge (7px into the hit area, minus the tooltip's 1px border and 10px padding), and grows to the right. */
.panel-computer-tooltip {
  display: none;
  position: absolute;
  left: -4px;
  bottom: calc(100% + 6px);
  z-index: 8;
  width: max-content;
  max-width: min(280px, 75vw);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--fg);
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px #0008;
}
.panel-computer-status[open] + .panel-computer-tooltip,
.panel-computer-status:not([data-dismissed]):is(:hover, :focus-within) + .panel-computer-tooltip {
  display: block;
}
.panel-composer {
  --composer-min: max(36px, calc(1.4em + 18px));
  font-size: 13px;
}
.panel-composer-input {
  box-sizing: border-box;
  min-height: var(--composer-min);
  overflow-y: auto;
}
.panel-composer-send {
  height: var(--composer-min);
  min-height: var(--composer-min);
}
.panel-composer-dictate {
  height: var(--composer-min);
  min-height: var(--composer-min);
}
.panel-composer-language {
  height: max(32px, calc(var(--composer-min) - 4px));
}
.panel-chat-readiness {
  color: var(--fg-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.panel-offline:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-offline-text {
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.panel-offline .panel-offline-copy,
.panel-working .panel-stop {
  flex: none;
  margin-left: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--fg);
  font-size: 13px;
}
.panel-composer-send:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--prototype-panel-bg);
}
.panel-composer-send:not(:disabled):hover {
  color: var(--prototype-panel-bg);
  filter: brightness(1.1);
}
.panel-composer-send:disabled {
  background: var(--surface-raised);
  border-color: var(--line);
  color: var(--fg-muted);
}
@media (max-width: 959px), (pointer: coarse) {
  .panel-composer {
    --composer-min: max(44px, calc(1.4em + 18px));
  }
  .panel-composer-send {
    width: 44px;
  }
  .panel-composer-dictate {
    width: 44px;
  }
  .panel-offline .panel-offline-copy,
  .panel-working .panel-stop,
  .panel-permission-actions button {
    min-height: 44px;
    height: auto;
  }
}

/* Author review, 12 November (second round). */
/* Tabs match New and the list chevron (44px); title and computer sit closer together. */
.panel-chat-navigation-row {
  align-items: center;
}
/* The tab menu is as wide as its labels, so its right edge can meet the tab's. */
.panel-chat-actions {
  width: max-content;
  max-width: min(260px, 100%);
}
/* The menu and the full-title tooltip stand off the tab by the strip's own 6px gap instead of touching it. */
.panel-chat-actions,
.panel-chat-tooltip {
  margin-top: 4px;
} /* + the row's 2px bottom padding = 6px */
.panel-chat-navigation-row > .panel-chat-overflow-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
.panel-chat-card-wrap {
  height: 44px;
}
/* One conversation: its tab takes the whole row and there is no list to open (the author, 2026-11-12). */
.panel-chat-strip > .panel-chat-card-wrap:only-child {
  flex: 1 1 auto;
}
.panel-chat-card-wrap .panel-chat-card {
  padding: 4px 12px;
  justify-content: center;
  gap: 1px;
  line-height: 1.25;
}
.panel-chat-card-meta {
  line-height: 1.25;
}
/* The computer card: name and path read as one block with even space above, between and below. */
.panel-ground:not(:empty) {
  padding: 7px 0 7px 10px;
}
.panel-ground-content {
  gap: 1px 0;
  line-height: 1.3;
}
.panel-ground-choice select,
.panel-ground-field select {
  height: auto;
  min-height: 0;
  line-height: 1.3;
}
/* The chooser chevron shares the Send button's vertical axis: same width, flush with the card's right edge. */
.project-panel-foot {
  --composer-min: max(36px, calc(1.4em + 18px));
}
.panel-ground-chevron {
  flex: 0 0 var(--composer-min);
  width: var(--composer-min);
  height: 32px;
  align-self: center;
}
/* Execution status: no dot; the phase and its elapsed time read as one line, left-aligned, with Stop at the right. */
.panel-working {
  margin-top: 16px;
  margin-bottom: -6px;
  gap: 10px;
}
.panel-working-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.panel-working .panel-elapsed:not(:empty)::before {
  content: " · ";
}
/* Send is the panel's one primary, as in the pinned prototype (report.css E2p): brand-600 → brand-700 from the top,
   a brand-700 edge, a lit top edge, a small brand shadow, white glyph; pressing sinks it 1px. */
.panel-composer-send:not(:disabled) {
  background: linear-gradient(180deg, var(--prototype-panel-primary-top), var(--prototype-panel-primary));
  border: 1px solid var(--prototype-panel-primary);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.28),
    0 1px 2px rgb(var(--prototype-panel-primary-rgb) / 0.45);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.panel-composer-send:not(:disabled):hover {
  color: #fff;
  filter: none;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.28),
    0 2px 6px rgb(var(--prototype-panel-primary-rgb) / 0.55);
}
.panel-composer-send:not(:disabled):active {
  transform: translateY(1px);
}
.panel-composer-send:focus-visible {
  outline: 2px solid var(--prototype-panel-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .panel-composer-send:not(:disabled) {
    transition: none;
  }
  .panel-composer-send:not(:disabled):active {
    transform: none;
  }
}
@media (max-width: 959px), (pointer: coarse) {
  .project-panel-foot {
    --composer-min: max(44px, calc(1.4em + 18px));
  }
  .panel-ground-chevron {
    height: 44px;
    margin-block: -6px;
  }
}

/* /models and /mcps: the terminal's pickers, a native dialog that fits a phone as well as a desk. */
.panel-picker {
  width: min(600px, calc(100vw - 24px));
  max-height: min(82vh, 760px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.22);
  overflow: hidden;
}
.panel-picker[open] {
  display: flex;
  flex-direction: column;
}
.panel-picker::backdrop {
  background: rgb(0 0 0 / 0.35);
  backdrop-filter: blur(2px);
}
.panel-picker form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 16px;
}
.panel-picker header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -16px;
  padding: 14px 16px 10px;
  background: var(--bg);
}
.panel-picker h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.panel-picker-find {
  position: sticky;
  top: 50px;
  z-index: 1;
  width: 100%;
  margin-bottom: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface, var(--bg));
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}
.panel-picker-find:focus-visible {
  outline: 2px solid var(--focus, #7100bd);
  outline-offset: 1px;
}
.panel-picker h3 {
  margin: 14px 0 6px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.panel-picker-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.panel-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: baseline;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
}
.panel-picker-item > span {
  font-size: 14px;
  font-weight: 500;
}
.panel-picker-item small {
  grid-column: 1 / -1;
  color: var(--fg-muted);
  font-size: 12.5px;
  line-height: 1.4;
}
/* AIUS's price per million tokens in and out, on the name's line like the TUI picker's footer. */
.panel-picker-item small.panel-picker-price {
  grid-column: 2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.panel-picker-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 12.5px;
}
.panel-picker-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-subtle, #999);
}
.panel-picker-status[data-state="on"]::before {
  background: var(--success, #0c5a1f);
}
button.panel-picker-item {
  cursor: pointer;
}
button.panel-picker-item:hover,
button.panel-picker-item:focus-visible {
  background: var(--surface-raised);
  outline: none;
}
.panel-picker-item[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}
.panel-picker-item[aria-pressed="true"] > span::after {
  content: "  ✓";
  color: var(--success, #0c5a1f);
}
.panel-picker-note {
  margin: 12px 0 0;
  color: var(--fg-muted);
  font-size: 13px;
}
.panel-picker-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg-muted);
  font-size: 20px;
  cursor: pointer;
}
.panel-picker-close:hover {
  background: var(--surface-raised);
  color: var(--fg);
}
.panel-picker-reset {
  align-self: flex-start;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 640px) {
  .panel-picker {
    width: 100vw;
    max-width: 100vw;
    max-height: 88vh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }
  .panel-picker-item {
    padding: 11px 12px;
  }
}
/* "/" beside the field: the commands Light runs, as a menu above it. */
.panel-composer {
  position: relative;
}
.panel-composer-commands {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg-muted);
  font: 600 15px/1 var(--font-mono, ui-monospace, monospace);
  cursor: pointer;
}
.panel-composer-commands:hover,
.panel-composer-commands[aria-expanded="true"] {
  background: var(--surface-raised);
  color: var(--fg);
}
.panel-commands {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 12px;
  width: min(420px, 100%);
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.16);
}
.panel-commands[hidden] {
  display: none;
}
.panel-command {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  justify-content: start;
  justify-items: start;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.panel-command > span {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 600;
}
.panel-command small {
  overflow: hidden;
  max-width: 100%;
  color: var(--fg-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-command:hover,
.panel-command[aria-selected="true"] {
  background: var(--surface-raised);
}
.panel-command[aria-disabled="true"] > span {
  color: var(--fg-muted);
}
.panel-commands {
  max-height: min(420px, 60vh);
  overflow-y: auto;
}
.panel-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}
.panel-picker-tab {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.panel-picker-tab[aria-selected="true"] {
  border-color: var(--focus, #7100bd);
  color: var(--fg);
  font-weight: 600;
}
.panel-picker-tab:focus-visible {
  outline: 2px solid var(--focus, #7100bd);
  outline-offset: 1px;
}
