/* Plain-DOM stand-ins for Web Awesome's dropdown/popup behaviour used by the Control UI composer
   (see scripts/sync-composer-css.mjs). The Control UI's own rules (openclaw-composer.css) style
   everything else. */
.cc-dd { position: relative; display: inline-flex; align-items: center; }
.cc-dd > .cc-dd__menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  max-width: min(92vw, 420px);
  max-height: var(--chat-composer-popover-max-height, 70vh);
  overflow-y: auto;
  box-sizing: border-box;
}
/* open: the ported rule for each menu picks its own display/padding (zero-specificity fallback only) */
.cc-dd:not([open]) > .cc-dd__menu { display: none; }
:where(.cc-dd[open] > .cc-dd__menu) { display: block; padding: var(--menu-padding, 4px); }
.cc-dd--end > .cc-dd__menu { left: auto; right: 0; }
.cc-dd > .cc-dd__menu[hidden] { display: none; }

/* wa-dropdown-item stand-in: [icon] label … [details]. Zero specificity on purpose: the Control UI's own
   item rules (ported in openclaw-composer.css) must win; these only cover items it doesn't style. */
:where(.cc-item) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--menu-item-radius, 6px);
  color: var(--text);
  font-size: var(--control-ui-text-md, 14px);
  line-height: 1.2;
  cursor: pointer;
  outline: none;
  user-select: none;
}
:where(.cc-item:hover, .cc-item:focus-visible) { background: var(--menu-selected, rgba(var(--ink), .07)); }
:where(.cc-item[aria-disabled="true"]) { opacity: .5; cursor: default; }
:where(.cc-item > [slot="icon"]) { display: grid; place-items: center; }
:where(.cc-item > [slot="details"]) { display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
:where(.cc-item > .cc-item__label) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.cc-item > [slot="icon"] svg, .cc-item > [slot="details"] svg) { width: 16px; height: 16px; flex: none; }

/* the composer lives in ClawChats' own layout: let the box use the available width */
.input-area .agent-chat__input { width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box; }

/* checkbox switch used by "Hold to start dictation" */
.cc-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; background: color-mix(in srgb, var(--text-strong) 18%, transparent); transition: background .15s; flex: none; }
.cc-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cc-switch--on { background: var(--accent); }
.cc-switch--on::after { transform: translateX(12px); }

.chat-controls__permission-learn-more a { color: inherit; text-decoration: none; }

/* keep ClawChats' original composer fill (the Control UI's own surface is its popover colour) */
.input-area .agent-chat__input { --chat-composer-surface: var(--input-bg); background: var(--input-bg); }

/* context popover: anchored by wireDetailsPopover (fixed, so it never affects the ring's layout) */
.cc-context-popover { position: fixed; z-index: 70; box-sizing: border-box; }

/* Resting height = one line of text + the controls row; the box grows with the draft (the Control UI
   floors it at 112px, which leaves a blank second line). */
.input-area .agent-chat__input { --chat-composer-min-height: 0px; }

/* Headings and other non-interactive rows share the item grid but must not react to the pointer. */
.cc-item[role="presentation"], .cc-item:not([role]) { cursor: default; }
.cc-item[role="presentation"]:hover, .cc-item:not([role]):hover { background: transparent; }

/* provider brand marks (components.css in the Control UI) */
.provider-brand-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.provider-brand-icon:not(.provider-brand-icon--fallback) {
  background: currentColor;
  -webkit-mask: var(--provider-icon-url) center / contain no-repeat;
  mask: var(--provider-icon-url) center / contain no-repeat;
}
.provider-brand-icon--fallback { border: 1px solid color-mix(in srgb, currentColor 48%, transparent); border-radius: var(--radius-sm); font-weight: 700; line-height: 1; }
.provider-brand-icon[data-provider-icon="codex"] { color: var(--brand-codex); }
.provider-brand-icon[data-provider-icon="claude"] { color: var(--brand-claude); }
.provider-brand-icon[data-provider-icon="gemini"] { color: var(--brand-google); }
.provider-brand-icon[data-provider-icon="llamacpp"], .provider-brand-icon[data-provider-icon="lmstudio"], .provider-brand-icon[data-provider-icon="ollama"] { color: var(--text-strong); }

/* shortcut number in a model row (kbd component) */
.shortcut-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; color: var(--muted); font-family: var(--mono); font-size: 10px; line-height: 1; }

/* Full Access reads as danger, as in the Control UI where --accent is red: scope the token so the
   chip label/icon, the option icon and its check all follow. */
.chat-controls__permission-trigger--full,
.chat-controls__permission-option[data-chat-permission-option="full"] { --accent: var(--full-access); }
.chat-controls__permission-trigger--full { color: var(--full-access); }

.chat-controls__effort-zap[hidden] { display: none; }

/* The Control UI's base type (base.css body + form-control reset), which the ported component rules assume. */
.input-area { font-size: calc(14px * var(--control-ui-text-scale, 1)); line-height: 1.55; letter-spacing: -0.01em; color: var(--text); }
:where(.input-area) :where(button, input, textarea, select) { font-family: inherit; letter-spacing: normal; }
:where(.input-area) :where(button) { font-size: inherit; line-height: inherit; }

/* "Learn more" in the permissions title is a 10px aside (the Control UI renders it in a menu item's details slot) */
.chat-controls__permission-learn-more { font-size: 10px; line-height: 1.2; }

.chat-controls__permission-heading { border-radius: 3px; }

/* Permission rows: wa-dropdown-item keeps the icon part from shrinking and gives it a 24px slot (16px icon + 8px).
   Without that a long description squeezes the icon (rows misalign). */
.chat-controls__permission-option-icon { flex: 0 0 16px; margin-right: 8px; }
.chat-controls__permission-option-state { font-size: 11px; line-height: 1.2; }

.chat-controls__trigger-provider-slot { display: contents; }

/* in the composer the mark is neutral (the brand colours are for the picker list) */
.agent-chat__input .chat-controls__trigger-provider-icon[data-provider-icon] { color: var(--chat-composer-secondary); }

/* working spinner (components.css .btn__spinner) */
.btn__spinner { width: 12px; height: 12px; flex: 0 0 auto; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; border-radius: var(--radius-full); animation: btn-spinner-spin 0.7s linear infinite; }
@keyframes btn-spinner-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn__spinner { animation: none; } }
/* the chevron is rotated 180deg in its resting state; keep the spinner upright */
.chat-controls__inline-select-chevron:has(> .btn__spinner) { transform: none; }

/* question dock: same column as the composer, with the Control UI's gap above the box */
.input-area .agent-chat__question-dock { width: 100%; max-width: 760px; margin: 0 auto 8px; box-sizing: border-box; }
.agent-chat__question-dock[hidden] { display: none; }
.agent-chat__question-dock .chat-question-panel { animation-name: cc-fade-in; }
@keyframes cc-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* question card additions of 10.5+ (ui/src/styles/chat/question-card.css of 2026.11.6); the generated openclaw-composer.css is the 9.7 sheet */
.chat-question-panel__header { display: grid; gap: 2px; }
.chat-question-panel__source { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--control-ui-text-sm); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.chat-question-panel__source a { overflow: hidden; color: var(--text); text-overflow: ellipsis; }
.chat-question-panel__thumbnail { display: grid; place-items: center; flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius-md); background: color-mix(in srgb, var(--text-strong) 6%, var(--panel)); color: var(--muted); }
.chat-question-panel__thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.chat-question-panel__option:has(> .chat-question-panel__thumbnail) { grid-template-columns: 18px 64px minmax(0, 1fr) auto; }
.chat-question-panel__option-copy { overflow-wrap: anywhere; }
.chat-question-panel__option-label { display: block; font-size: var(--control-ui-text-sm); font-weight: 600; line-height: 1.35; }
.chat-question-panel__external-image { font-size: calc(var(--control-ui-text-sm) - 1px); color: var(--muted); overflow-wrap: anywhere; }
.chat-question-panel__resource-actions { display: grid; gap: 8px; }
.chat-question-panel__resource-preview { max-height: 320px; overflow: auto; white-space: pre-wrap; }
.chat-question-panel__resource-image { max-width: 100%; max-height: 320px; object-fit: contain; }
/* base.css form-control reset (input, textarea, select { font: inherit; color: inherit }): without it the answer field
   draws in the browser's default black text, unreadable on the dark card */
:where(.agent-chat__question-dock, .agent-chat__disabled-banner) :where(input, textarea, select) { font: inherit; color: inherit; }
/* masked answer with its show/hide toggle */
.chat-question-panel__secret { position: relative; display: flex; flex: 1; min-width: 0; }
/* components.css `.field span` (the label's muted 13px) also matches this wrapper, so the typed value came out muted and small
   (the Control UI 11.6 has the same rule); what the user types reads as full text, like the hosts field */
.field .chat-question-panel__secret { color: var(--text); font-size: inherit; font-weight: inherit; }
.chat-question-panel__secret input { width: 100%; min-width: 0; padding-right: 42px; }
.chat-question-panel__secret-toggle { position: absolute; inset: 0 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: var(--cursor-action); }
.chat-question-panel__secret-toggle:hover:not(:disabled) { color: var(--text); background: var(--panel-hover); }
.chat-question-panel__secret-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.chat-question-panel__secret-toggle:disabled { opacity: 0.5; }
.chat-question-panel__secret-toggle svg { width: 18px; height: 18px; }
/* kbd component (components/kbd.css + solid/kbd.tsx; 9.7: components/kbd-styles.ts) */
.shortcut-kbd:where(:not([hidden])) { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.shortcut-kbd > span + span { margin-inline-start: 0.15em; }
.kbd__text { text-box: trim-both cap alphabetic; }
.shortcut-kbd::before { content: ""; height: 1lh; }

/* base.css corner enhancement for buttons (.btn.btn { radius 10px × scale; superellipse }) */
:where(.agent-chat__question-dock) .btn.btn { border-radius: calc(10px * var(--openclaw-corner-radius-scale, 1)); corner-shape: var(--chat-composer-corner-shape, round); }

/* resolved-question summary sits in the chat column like an assistant message */
.question-summary-row { width: 100%; max-width: 920px; margin: 0 auto; padding: 6px 32px; box-sizing: border-box; }
.chat-question-summary { letter-spacing: -0.14px; }

/* context popover: approximate note (ClawChats addition) */
.context-usage__note { margin: -2px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Project / folder picker (frontend/chat/folder-picker.js): the Control UI's new-session project chip in
   a row above the composer. Ported from ui/src/styles/new-session.css (.new-session-page__triggers,
   __trigger, __picker-popover, __menu-title, __project-search, __browser*), session-menu.css and
   layout.css (.session-menu__*). The Control UI's popover flips above the trigger when there is no room
   below; here the row sits at the bottom, so the menu always opens upward. */
.chat-place-row {
  --menu-item-height: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 6px;
  padding: 0;
  box-sizing: border-box;
}
@media (pointer: coarse) { .chat-place-row { --menu-item-height: 44px; } }
.project-sheet { --menu-item-height: 28px; } /* the project sheet's menus reuse these rows */
@media (pointer: coarse) { .project-sheet { --menu-item-height: 44px; } }
.chat-place-row[hidden] { display: none; }
.chat-place-row .new-session-page__select { position: relative; }
/* Agent picker (several agents only) and "Save as project default" (pushed to the row's end). */
.chat-place-row .new-session-page__select[hidden],
.chat-place-row .chat-preset-btn[hidden] { display: none; }
.chat-place-row .chat-preset-btn { margin-inline-start: auto; }
/* Incognito (ClawChats; the Control UI keeps it in the page corner): a new-chat choice like the others here.
   The row is gone after the first send, so the chip goes with it. */
.chat-place-row .chat-incognito-chip[hidden] { display: none; }
.chat-place-row .new-session-page__trigger.chat-incognito-chip.active,
.chat-place-row .new-session-page__trigger.chat-incognito-chip.active:hover:not(:disabled):not([aria-disabled="true"]) {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.14);
}
.chat-place-row .chat-incognito-chip.active .new-session-page__target-icon { color: #8b5cf6; }
.chat-place-row .chat-preset-btn.new-session-page__runtime { color: var(--muted); }
.chat-place-row .new-session-page__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: var(--cursor-action, pointer);
  user-select: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
}
.chat-place-row .new-session-page__trigger:hover:not(:disabled):not([aria-disabled="true"]),
.chat-place-row .new-session-page__trigger[aria-expanded="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-hover) 84%, transparent);
}
/* An open chat's folder: informational, as the Control UI's runtime chip. */
.chat-place-row .new-session-page__runtime { color: var(--text); cursor: default; }
.chat-place-row .new-session-page__trigger-label {
  max-width: min(40vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-place-row .new-session-page__target-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 14px; width: 14px; height: 14px; color: var(--muted); }
.chat-place-row .new-session-page__trigger-chevron { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-inline-start: 2px; color: var(--muted); opacity: 0.8; }
.chat-place-row .new-session-page__trigger-chevron[hidden] { display: none; }
.chat-place-row .new-session-page__target-icon svg,
.chat-place-row .new-session-page__trigger-chevron svg,
.chat-folder-menu .new-session-page__browser-nav svg,
.chat-folder-menu .session-menu__icon svg,
.chat-folder-menu .session-menu__check svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7px; stroke-linecap: round; stroke-linejoin: round; }
.chat-place-row .new-session-page__trigger > .new-session-page__target-icon svg { stroke-width: 1.5px; }
.chat-place-row .new-session-page__trigger-chevron svg { width: 10px; height: 10px; stroke-width: 1.5px; }

/* Menu panel: the Control UI's wa-popover.new-session-page__select::part(body). */
.chat-place-picker > .cc-dd__menu.chat-folder-menu {
  min-width: 224px;
  width: min(320px, calc(100vw - 24px));
  max-width: min(320px, calc(100vw - 24px));
  padding: var(--menu-padding, 4px);
  border: 1px solid var(--overlay-border);
  border-radius: var(--menu-radius, var(--radius-md));
  background: var(--bg-elevated);
  box-shadow: var(--overlay-shadow);
}
.chat-place-picker > .cc-dd__menu.chat-folder-menu[data-view="browser"] { padding: 0; overflow: hidden; }
.chat-folder-menu .new-session-page__menu-title {
  padding: 4px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chat-folder-menu .new-session-page__picker-root > .new-session-page__menu-title:not(:first-child) { margin-top: 8px; }
.chat-folder-menu .new-session-page__project-search { display: block; padding: 4px 8px 6px; }
.chat-folder-menu .new-session-page__project-search input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.chat-folder-menu .new-session-page__project-search input:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.chat-folder-menu .new-session-page__project-status,
.chat-folder-menu .new-session-page__project-error { padding: 5px 8px; font-size: 11px; line-height: 1.4; }
.chat-folder-menu .new-session-page__project-status { color: var(--muted); }
.chat-folder-menu .new-session-page__project-error { color: var(--danger); }
.chat-folder-menu .new-session-page__menu-note { padding: 4px 8px 6px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.chat-folder-menu .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Rows: session-menu.css + layout.css. */
.chat-folder-menu .session-menu__item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--menu-item-height);
  padding: 0 8px;
  border: none;
  border-radius: var(--menu-item-radius, 6px);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: var(--cursor-action, pointer);
  outline: none;
}
.chat-folder-menu .session-menu__item:hover:not([aria-disabled="true"]),
.chat-folder-menu .session-menu__item:focus-visible { background: var(--bg-hover); }
.chat-folder-menu .session-menu__item[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; }
.chat-folder-menu .session-menu__icon,
.chat-folder-menu .session-menu__check { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; flex: 0 0 auto; }
.chat-folder-menu .session-menu__icon { color: var(--muted); }
.chat-folder-menu .session-menu__check { color: var(--accent); }
.chat-folder-menu .session-menu__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-folder-menu .session-menu__sub { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--control-ui-text-xs, 11px); text-overflow: ellipsis; white-space: nowrap; }
.chat-folder-menu .new-session-page__menu-chevron { display: inline-flex; margin-left: auto; color: var(--muted); }
.chat-folder-menu .new-session-page__menu-chevron svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7px; stroke-linecap: round; stroke-linejoin: round; }

/* Folder browser. The list has a fixed height (the Control UI caps it at 240px): the panel opens
   upward, so a list that grew or shrank between folders would move the header under the pointer. */
.chat-folder-menu .new-session-page__browser { overflow: hidden; }
.chat-folder-menu .new-session-page__browser-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.chat-folder-menu .new-session-page__browser-nav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  cursor: var(--cursor-action, pointer);
}
.chat-folder-menu .new-session-page__browser-nav:hover:not(:disabled) { background: color-mix(in srgb, var(--bg-hover) 84%, transparent); color: var(--text); }
.chat-folder-menu .new-session-page__browser-path {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0; border: 0; background: transparent;
  font: inherit; font-size: 12px; color: var(--text); outline: none;
}
.chat-folder-menu .new-session-page__browser-loading { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.chat-folder-menu .new-session-page__browser-list {
  display: flex; flex-direction: column;
  height: 240px; padding: 4px; box-sizing: border-box; overflow-y: auto;
}
.chat-folder-menu .new-session-page__browser-entry {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 6px 8px; min-height: var(--menu-item-height);
  border: 0; border-radius: var(--menu-item-radius, 6px);
  background: transparent; color: var(--text);
  font: inherit; font-size: 13px; text-align: left;
  cursor: var(--cursor-action, pointer);
}
.chat-folder-menu .new-session-page__browser-entry:hover,
.chat-folder-menu .new-session-page__browser-entry--active { background: var(--bg-hover); }
.chat-folder-menu .new-session-page__browser-entry--hidden { color: var(--muted); }
.chat-folder-menu .new-session-page__target-icon { display: inline-flex; color: var(--muted); }
.chat-folder-menu .new-session-page__target-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7px; stroke-linecap: round; stroke-linejoin: round; }
.chat-folder-menu .new-session-page__browser-empty { padding: 10px; font-size: 12px; color: var(--muted); }
.chat-folder-menu .new-session-page__browser-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); }
.chat-folder-menu .new-session-page__error { padding: 8px 10px 0; font-size: 12px; color: var(--danger); }
.chat-folder-menu .new-session-page__browser-use {
  padding: 6px 14px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: var(--primary); color: var(--primary-foreground);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: var(--cursor-action, pointer);
}
.chat-folder-menu .new-session-page__browser-use:disabled { opacity: 0.5; cursor: default; }
