/*
 * Desktop Presence (Quick Input) surface — production port of the v22
 * UI/UX reference. Every colour derives from the application's canonical
 * appearance tokens (global.css + useTheme), so Settings > Appearance and
 * light/dark cascade in unchanged. 5px geometry, rectangular controls, glass
 * tiers by text density: bar < response < menus < drawer.
 */

.dp-root {
  --dp-blur: blur(26px) saturate(148%);
  --dp-blur-strong: blur(32px) saturate(156%);
  --dp-glass: rgba(var(--surface-primary-rgb), 0.55);
  --dp-glass-focus: rgba(var(--surface-primary-rgb), 0.66);
  --dp-glass-strong: rgba(var(--surface-abyss-rgb), 0.58);
  --dp-glass-deep: rgba(var(--surface-abyss-rgb), 0.66);
  --dp-edge: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --dp-line: var(--color-border-default);
  --dp-line-strong: rgba(var(--accent-rgb), 0.3);
  --dp-hover: rgba(var(--surface-elevated-rgb), 0.55);
  --dp-accent-wash: rgba(var(--accent-rgb), 0.08);
  --dp-accent-wash-soft: rgba(var(--accent-rgb), 0.045);
  --dp-shadow-2: 0 18px 38px rgba(0, 0, 0, 0.3);
  --dp-ambient-opacity: 0.62;

  position: fixed;
  inset: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-family: var(--font-family-sans, "Outfit", system-ui, sans-serif);
  user-select: none;
  background: transparent;
}
/* Appearance (v22 §1). Quick Input reads the tokens Settings > Appearance
   writes on <html> (the person's accent, palette and light or dark mode), so
   with Theme set to App, or to the app's own mode, nothing is redefined here.
   Only a Quick Input theme other than the app's (data-theme-override) swaps
   in that mode's canonical tokens: global.css @theme for dark, html.light
   for light, the white glass of v22 on a light desktop. */
.dp-root[data-theme="light"] {
  color-scheme: light;
}
.dp-root[data-theme="dark"] {
  color-scheme: dark;
}
.dp-root[data-theme-override="light"] {
  --color-brand-teal: #0e7490;
  --color-brand-cyan: #155e75;
  --color-border-active: var(--color-brand-teal);
  --accent-rgb: 14, 116, 144;
  --color-surface-abyss: #f7f8fa;
  --color-surface-primary: #f0f2f5;
  --color-surface-card: #e8ebef;
  --color-surface-elevated: #dce0e6;
  --surface-abyss-rgb: 247, 248, 250;
  --surface-primary-rgb: 240, 242, 245;
  --surface-card-rgb: 232, 235, 239;
  --surface-elevated-rgb: 220, 224, 230;
  --color-text-primary: #0f172a;
  --color-text-secondary: #1e293b;
  --color-text-muted: #475569;
  --color-brand-bio: #059669;
  --color-error: #dc2626;
  --color-warning: #d97706;
  --color-success: #059669;
  --color-border-default: rgba(var(--accent-rgb), 0.2);
}
.dp-root[data-theme-override="dark"] {
  --color-brand-teal: #06b6d4;
  --color-brand-cyan: #0e7490;
  --color-border-active: var(--color-brand-teal);
  --accent-rgb: 6, 182, 212;
  --color-surface-abyss: #0e0e0e;
  --color-surface-primary: #171717;
  --color-surface-card: #212121;
  --color-surface-elevated: #2b2b2b;
  --surface-abyss-rgb: 14, 14, 14;
  --surface-primary-rgb: 23, 23, 23;
  --surface-card-rgb: 33, 33, 33;
  --surface-elevated-rgb: 43, 43, 43;
  --color-text-primary: #ffffff;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-brand-bio: #00ff9d;
  --color-error: #f87171;
  --color-warning: #fbbf24;
  --color-success: #34d399;
  --color-border-default: rgba(var(--accent-rgb), 0.12);
}
.dp-root *,
.dp-root *::before,
.dp-root *::after {
  box-sizing: border-box;
}
:where(.dp-root) :where(button, input, textarea) {
  font: inherit;
}
.dp-root button {
  cursor: pointer;
}
.dp-root button:disabled {
  cursor: default;
  opacity: 0.38;
}
/* v22: every scrollbar is hidden; lists, the reply and the input still scroll. */
.dp-root *,
.dp-root *::before,
.dp-root *::after {
  scrollbar-width: none;
}
.dp-root *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
/* v22: the one focus ring, 1px teal just inside the control. */
.dp-root button:focus-visible,
.dp-root [tabindex]:focus-visible,
.dp-root [role="button"]:focus-visible,
.dp-root :is(.dp-input, .dp-search, .dp-cpsearch-input, .dp-composer textarea):focus-visible {
  outline: 1px solid var(--color-brand-teal);
  outline-offset: -2px;
}
/* Text fields may match :focus-visible after a pointer click in WebView2.
   Keep the caret and the bar's own edge, without the global focus outline. */
.dp-root[data-input-modality="pointer"]
  :is(.dp-input, .dp-search, .dp-cpsearch-input, .dp-composer textarea):focus {
  outline: 0;
  box-shadow: none;
}
.dp-root .dp-bar:focus {
  outline: 0;
}

/* The whole surface fades to ambient opacity while idle and is fully opaque
   while hovered, focused, read or interacted with. */
.dp-surface {
  position: absolute;
  inset: 0;
}
/* v22 §5: the bar and its panel sit at the ambient opacity in every form and
   come to full while hovered, focused or read. The controls menu and toasts
   are their own surfaces outside .dp-surface and stay fully opaque, so the
   fade previews live while it is set. */
.dp-surface .dp-bar,
.dp-surface .dp-panel .dp-layer,
.dp-surface .dp-popover {
  opacity: var(--dp-ambient-opacity);
  transition:
    opacity 0.16s ease,
    background 0.16s;
}
.dp-surface[data-engaged="true"] .dp-bar,
.dp-surface[data-engaged="true"] .dp-panel .dp-layer,
.dp-surface[data-engaged="true"] .dp-popover,
.dp-surface:has(
    .dp-bar:hover,
    .dp-bar:focus-within,
    .dp-panel .dp-layer:hover,
    .dp-panel .dp-layer:focus-within,
    .dp-popover:hover,
    .dp-popover:focus-within
  )
  .dp-bar,
.dp-surface:has(
    .dp-bar:hover,
    .dp-bar:focus-within,
    .dp-panel .dp-layer:hover,
    .dp-panel .dp-layer:focus-within,
    .dp-popover:hover,
    .dp-popover:focus-within
  )
  .dp-panel
  .dp-layer,
.dp-surface:has(
    .dp-bar:hover,
    .dp-bar:focus-within,
    .dp-panel .dp-layer:hover,
    .dp-panel .dp-layer:focus-within,
    .dp-popover:hover,
    .dp-popover:focus-within
  )
  .dp-popover {
  opacity: 1;
}
/* A notice is feedback on its own surface, like a v22 toast: never faded. */
.dp-surface .dp-panel .dp-layer.dp-notice-layer {
  opacity: 1;
}
/* Stepped aside for a handoff (v22): only the confirmation toast remains. */
.dp-surface[data-stepped-aside="true"] {
  visibility: hidden;
}

/* ---------------------------------------------------------------- bar */
.dp-bar {
  position: absolute;
  height: 48px;
  display: grid;
  grid-template-columns: 76px minmax(150px, 22%) minmax(0, 1fr) repeat(4, 38px);
  align-items: center;
  background: var(--dp-glass);
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
  border-radius: 6px;
  box-shadow: var(--dp-edge);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  transition: background 0.16s;
}
.dp-bar > * {
  min-width: 0;
}
/* Grab strips: the bar's top and bottom edges and both ends drag the bar,
   so it can be picked up without aiming for the gaps between controls. */
.dp-drag {
  position: absolute;
  z-index: 1;
  cursor: grab;
}
.dp-drag[data-edge="top"],
.dp-drag[data-edge="bottom"] {
  left: 0;
  right: 0;
  height: 9px;
}
.dp-drag[data-edge="top"] {
  top: 0;
}
.dp-drag[data-edge="bottom"] {
  bottom: 0;
}
.dp-drag[data-edge="left"],
.dp-drag[data-edge="right"] {
  top: 0;
  bottom: 0;
  width: 9px;
}
.dp-drag[data-edge="left"] {
  left: 0;
}
.dp-drag[data-edge="right"] {
  right: 0;
}
.dp-bar[data-form="minimal"] .dp-drag[data-edge="left"],
.dp-bar[data-form="minimal"] .dp-drag[data-edge="right"] {
  width: 14px;
}
.dp-bar[data-dragging="true"] .dp-drag,
.dp-context:active {
  cursor: grabbing;
}
.dp-bar:focus-within {
  background: var(--dp-glass-focus);
}
.dp-bar[data-dragging="true"] {
  cursor: grabbing;
}
.dp-bar[data-form="minimal"] {
  grid-template-columns: minmax(0, 1fr);
}
.dp-bar[data-form="span"] {
  grid-template-columns: 76px minmax(180px, 24%) minmax(0, 1fr) repeat(4, 38px);
  border-radius: 0;
  cursor: default;
}
.dp-bar[data-form="span"] .dp-context {
  cursor: pointer;
}
/* A Companion's view has no voice chat: three buttons (voice input, history,
   send). */
.dp-bar[data-voice-chat="off"] {
  grid-template-columns: 76px minmax(150px, 22%) minmax(0, 1fr) repeat(3, 38px);
}
.dp-bar[data-form="span"][data-voice-chat="off"] {
  grid-template-columns: 76px minmax(180px, 24%) minmax(0, 1fr) repeat(3, 38px);
}
/* A Companion's view without desktop context: no AUTO or context chip, the
   input takes their room. */
.dp-bar[data-context="off"],
.dp-bar[data-form="span"][data-context="off"] {
  grid-template-columns: minmax(0, 1fr) repeat(3, 38px);
}
.dp-bar[data-context="off"] .dp-input {
  padding-left: 14px;
}

.dp-auto,
.dp-context {
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--color-brand-teal);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
}
.dp-auto {
  padding: 0 11px;
  border-right: 1px solid var(--dp-line);
  gap: 6px;
}
.dp-auto:hover,
.dp-auto[aria-expanded="true"],
.dp-context:hover,
.dp-context[aria-expanded="true"] {
  background: var(--dp-accent-wash);
}
.dp-auto-label {
  font-size: 12px;
  line-height: 1;
  color: var(--color-brand-teal);
}
.dp-caret {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-right: 1.25px solid var(--color-text-muted);
  border-bottom: 1.25px solid var(--color-text-muted);
  transform: translateY(-1px) rotate(45deg);
  opacity: 0.88;
}
[aria-expanded="true"] > .dp-caret {
  transform: translateY(1px) rotate(225deg);
}
.dp-context {
  width: 100%;
  padding: 0 11px;
  border-right: 1px solid var(--dp-line);
  cursor: grab;
}
.dp-context-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--color-brand-teal);
}
/* Shown only when more than one source is in effect (v22). */
.dp-context-count {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0 1px;
  color: var(--color-brand-cyan);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.dp-input {
  display: block;
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  padding: 13px 11px 11px;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
  user-select: text;
  cursor: text;
}
.dp-input::placeholder {
  color: var(--color-text-muted);
}
.dp-bar[data-form="minimal"] .dp-input {
  padding-left: 14px;
  padding-right: 14px;
}

.dp-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.dp-btn svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}
/* v22: the voice chat bars are drawn a little larger. */
.dp-voice-chat-btn svg {
  width: 18px;
  height: 18px;
}
.dp-btn:hover:not(:disabled) {
  background: var(--dp-hover);
  color: var(--color-text-primary);
}
/* The active mic stays teal on the accent wash while the pointer rests on
   it, as it does right after the press that started it (v22). */
.dp-btn[aria-pressed="true"],
.dp-btn[aria-pressed="true"]:hover:not(:disabled) {
  color: var(--color-brand-teal);
  background: var(--dp-accent-wash);
}
/* Text glyphs (v22): history ≡ at the 16px base, send ↗ at 17px, stop ■ at 13px. */
.dp-history-btn {
  font-size: 16px;
}
.dp-send {
  color: var(--color-brand-teal);
  font-size: 17px;
}
.dp-send[data-stop="true"] {
  font-size: 13px;
  color: var(--color-text-secondary);
}
/* ------------------------------------------------------------- panels */
.dp-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.dp-panel[data-placement="above"] {
  justify-content: flex-end;
}
/* The response or history: 8px from the bar, so 2px under an overlay. */
.dp-panel-base {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
/* Above the bar the stack sits against the bar, so a response easing shut
   closes toward it. */
.dp-panel[data-placement="above"] > .dp-panel-base {
  justify-content: flex-end;
}
.dp-panel[data-placement="below"] > .dp-panel-base[data-under-overlay="true"] {
  margin-top: 2px;
}
.dp-panel[data-placement="above"] > .dp-panel-base[data-under-overlay="true"] {
  margin-bottom: 2px;
}
/* Voice, the expanded editor or a picker: 6px from the bar, over the response. */
.dp-panel-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.dp-panel[data-placement="below"] > .dp-panel-overlay,
.dp-panel[data-placement="left"] > .dp-panel-overlay,
.dp-panel[data-placement="right"] > .dp-panel-overlay {
  top: 0;
}
.dp-panel[data-placement="above"] > .dp-panel-overlay {
  bottom: 0;
}
/* Voice and the editor are as tall as their content, which the panel measures. */
.dp-panel-overlay > .dp-layer {
  flex: 0 0 auto;
}
/* Voice chat's strip is the first layer of the stack, as tall as its content:
   the notice, decisions and response stay in view under it. */
.dp-panel-base > .dp-layer.dp-voice-chat {
  flex: 0 0 auto;
}
/* Only the response projection, with its history drawer, is selectable text
   (v22); menus, pickers, the voice strip and the editor's chrome never are. */
.dp-layer {
  min-height: 0;
  background: var(--dp-glass-strong);
  backdrop-filter: var(--dp-blur-strong);
  -webkit-backdrop-filter: var(--dp-blur-strong);
  border-radius: 4px;
  box-shadow: var(--dp-edge), var(--dp-shadow-2);
}
.dp-response,
.dp-history {
  user-select: text;
}
/* Every attached surface (response, decisions, editor, voice) carries the
   accent line on the edge that faces the bar (v22 §6, §7, §11). Notices
   keep the toast's own hairline instead. */
.dp-panel[data-placement="below"] .dp-layer:not(.dp-notice-layer) {
  border-top: 1px solid var(--dp-line-strong);
}
.dp-panel[data-placement="above"] .dp-layer:not(.dp-notice-layer) {
  border-bottom: 1px solid var(--dp-line-strong);
}
.dp-panel[data-placement="right"] .dp-layer:not(.dp-notice-layer) {
  border-left: 1px solid var(--dp-line-strong);
}
.dp-panel[data-placement="left"] .dp-layer:not(.dp-notice-layer) {
  border-right: 1px solid var(--dp-line-strong);
}
.dp-layer + .dp-layer {
  margin-top: 4px;
}
.dp-layer-deep {
  background: var(--dp-glass-deep);
}
/* History fills the projection; notices and decisions are always whole. */
.dp-history-layer {
  flex: 1 1 auto;
}
.dp-notice-layer,
.dp-decision-layer {
  flex: 0 0 auto;
}

/* --------------------------------------------------------- response */
/* v22 §7: the projection eases between its full height (never under 112px)
   and the 39px strip: max-height and padding over 0.2s. */
.dp-response-layer {
  overflow: hidden;
}
.dp-response-layer:not([data-collapsed="true"]) {
  min-height: 112px;
}
.dp-surface .dp-panel .dp-layer.dp-response-layer {
  transition:
    opacity 0.16s ease,
    background 0.16s,
    max-height 0.2s;
}
.dp-response {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  row-gap: 10px;
  padding: 12px 14px 11px;
  min-height: 0;
  position: relative;
  transition: padding 0.2s;
}
.dp-response[data-collapsed="true"] {
  grid-template-rows: auto;
  /* Fills the reserved collapsed height (COLLAPSED_HEIGHT less the 1px edge). */
  min-height: 38px;
  align-content: center;
  padding: 5px 8px 5px 14px;
  cursor: pointer;
}
.dp-response[data-collapsed="true"] .dp-meta-left {
  gap: 8px;
}
.dp-response[data-collapsed="true"] .dp-collapsed-summary {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.dp-meta {
  min-height: 27px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 16px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 10px;
}
.dp-meta-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.dp-meta-left strong {
  min-width: 0;
  color: var(--color-brand-teal);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* "2 sources" beside the context a turn was sent with (v22). */
.dp-context-proof {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 8px;
}
.dp-meta-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* The state reads in the meta row's own muted colour (v22). */
.dp-state {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 3px;
  white-space: nowrap;
}
.dp-icon {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text-muted);
  display: grid;
  place-items: center;
}
.dp-icon:hover {
  background: var(--dp-hover);
  color: var(--color-text-primary);
}
.dp-reply {
  min-height: 20px;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-right: 2px;
}
/* Keep latest response: the latest reply stays open but compact (v22). */
.dp-response[data-mode="keep_latest"] .dp-reply {
  max-height: 72px;
}
.dp-reply[data-working="true"]::after {
  content: " \25AE";
  color: var(--color-brand-teal);
  animation: dp-blink 0.9s step-end infinite;
}
@keyframes dp-blink {
  50% {
    opacity: 0;
  }
}
/* Reply typography (v22 §7): the shell's renderer, at Quick Input's compact
   13px reading scale. These rules are unlayered, so they set the size over
   the renderer's utility classes. */
.dp-reply p,
.dp-reply .chat-paragraph,
.dp-reply .chat-heading {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
}
.dp-reply .chat-heading {
  font-weight: 650;
  color: var(--color-text-primary);
}
.dp-reply .chat-list {
  margin: 4px 0 10px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
}
.dp-reply .chat-list .chat-list {
  margin: 3px 0 0;
}
.dp-reply .chat-list-item {
  margin: 3px 0;
}
.dp-reply :is(p, .chat-paragraph, .chat-heading, .chat-list, .dp-code):last-child {
  margin-bottom: 0;
}
.dp-reply strong,
.dp-reply .chat-strong {
  font-weight: 650;
  color: var(--color-text-primary);
}
.dp-reply code,
.dp-reply .chat-inline-code {
  font: 11px/1.45 var(--font-family-mono, ui-monospace, monospace);
  background: rgba(var(--surface-elevated-rgb), 0.6);
  padding: 1px 3px;
  border-radius: 3px;
  color: var(--color-text-secondary);
}
/* Code: a flat block with only the accent rule on its left (v22). */
.dp-reply .dp-code {
  margin: 8px 0 10px;
  padding: 9px 10px;
  background: rgba(var(--surface-abyss-rgb), 0.55);
  border-left: 1px solid var(--dp-line-strong);
  overflow: auto;
  white-space: pre;
  max-width: 100%;
}
.dp-reply .dp-code code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}
/* What v22's projection has no block for (tables, quotes, images, task
   checks, rules) reads flat on its 13px scale: never a bordered card, a
   tinted box or the shell's 14px text. The renderer sets some of these
   inline, so those few declarations must be important. */
.dp-reply .chat-table-wrap {
  margin: 4px 0 10px;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
}
.dp-reply .chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}
.dp-reply .chat-table__head {
  padding: 4px 10px 5px 0;
  background: transparent;
  border-bottom: 1px solid var(--dp-line);
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
}
.dp-reply .chat-table__cell {
  padding: 5px 10px 5px 0;
  border-bottom: 1px solid var(--dp-line);
}
.dp-reply .chat-table__row:hover {
  background: transparent;
}
.dp-reply .chat-table__row:last-child .chat-table__cell {
  border-bottom: 0;
}
.dp-reply .chat-blockquote {
  margin: 4px 0 10px;
  padding: 0 0 0 10px !important;
  background: transparent !important;
  border: 0;
  border-left: 1px solid var(--dp-line-strong) !important;
  border-radius: 0;
}
.dp-reply .chat-blockquote__body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.dp-reply .chat-blockquote__body > :last-child {
  margin-bottom: 0;
}
.dp-reply .chat-inline-image {
  margin: 6px 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.dp-reply .chat-inline-image img {
  max-height: 160px;
}
.dp-reply .chat-task-check {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  font-size: 8px;
  line-height: 10px;
}
.dp-reply hr {
  margin: 8px 0;
}
.dp-reply-plain {
  white-space: pre-wrap;
}
.dp-reply-empty {
  color: var(--color-text-muted);
  font-size: 11px;
}
/* Home's activity in the Home view: what its Agents told it and its own
   lines, each with its sender. Plain rows, no badges. */
.dp-home-activity {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  row-gap: 2px;
}
.dp-home-activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.45;
}
.dp-home-activity-row:hover {
  background: var(--dp-hover);
}
.dp-home-activity-row:focus-visible {
  outline: 1px solid var(--dp-line-strong);
  outline-offset: -1px;
}
.dp-home-activity-sender {
  color: var(--color-text-primary);
  font-weight: 600;
  white-space: nowrap;
}
.dp-home-activity-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* What the turn's tools are doing, muted beside its context. */
.dp-activity {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-muted);
  font-size: 10px;
}
.dp-latest {
  position: absolute;
  right: 14px;
  bottom: 42px;
  height: 25px;
  border: 0;
  border-radius: 3px;
  background: rgba(var(--surface-primary-rgb), 0.8);
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  color: var(--color-brand-teal);
  font-size: 9px;
  padding: 0 8px;
}
.dp-footer {
  min-height: 27px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 12px;
  align-items: center;
  color: var(--color-text-secondary);
  font-size: 10px;
}
.dp-actions {
  min-width: 0;
  display: flex;
  gap: 11px;
  row-gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
}
.dp-actions button {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 3px 0;
  white-space: nowrap;
}
.dp-actions button:hover {
  color: var(--color-brand-teal);
}
.dp-actions button[data-primary="true"] {
  color: var(--color-brand-teal);
}
/* Open in Companion (v22 companion-link): teal text, a little quieter than
   the primary action beside it. While it opens it reads Opening… and keeps
   its focus (aria-disabled, never disabled). */
.dp-actions button.dp-companion-link {
  color: var(--color-brand-teal);
  opacity: 0.88;
}
.dp-actions button[aria-disabled="true"] {
  cursor: default;
}
.dp-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.dp-tool {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text-muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.dp-tool svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dp-tool:hover,
.dp-tool[aria-pressed="true"] {
  background: var(--dp-accent-wash);
  color: var(--color-brand-teal);
}
.dp-collapsed-summary {
  color: var(--color-text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Notices take the v22 toast's look (§12): deep glass, a hairline all round,
   11px secondary text and a 10px teal action, fading up into place. */
.dp-notice-layer {
  background: var(--dp-glass-deep);
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
  border: 1px solid var(--dp-line);
  border-radius: 5px;
  box-shadow: none;
  animation: dp-toast-in 0.15s ease;
}
.dp-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.dp-notice-text {
  min-width: 0;
  flex: 1 1 auto;
}
/* A send not answered yet shows as ordinary progress, under any notice. */
.dp-notice + .dp-notice {
  border-top: 1px solid var(--dp-line);
}
.dp-notice button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--color-brand-teal);
  padding: 0;
  font-size: 10px;
}

/* ---------------------------------------------------------- history */
/* v22 §8: the drawer fills the response projection, on its glass (never the
   deeper menu tier), and slides in from 8px below over 0.18s. */
.dp-layer[data-overlay="history"] {
  overflow: hidden;
}
.dp-history {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 14px;
  height: 100%;
  animation: dp-history-in 0.18s ease both;
}
/* Closing over a response still in view: the drawer slides back out over it,
   clear of the response's header row, and is gone after 0.18s. */
.dp-layer[data-history-closing="true"] {
  position: relative;
  overflow: hidden;
}
.dp-history[data-closing="true"] {
  position: absolute;
  z-index: 5;
  inset: 42px 0 0 0;
  height: auto;
  pointer-events: none;
  animation: dp-history-out 0.18s ease both;
}
@keyframes dp-history-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes dp-history-out {
  from {
    transform: none;
    opacity: 1;
  }
  to {
    transform: translateY(8px);
    opacity: 0;
  }
}
.dp-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 7px;
}
.dp-history-head strong {
  font-size: 11px;
  color: var(--color-text-primary);
}
/* The close × is 28px square at the 16px base size (v22). */
.dp-history-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 16px;
  padding: 0;
}
.dp-history-close:hover {
  background: var(--dp-hover);
  color: var(--color-text-primary);
}
.dp-search {
  flex: 0 0 auto;
  width: calc(100% - 2px);
  height: 31px;
  margin: 0 1px;
  border: 0;
  border-radius: 4px;
  background: rgba(var(--surface-elevated-rgb), 0.4);
  color: var(--color-text-secondary);
  outline: 0;
  padding: 0 9px;
  font-size: 10px;
  user-select: text;
}
.dp-search:focus {
  background: rgba(var(--surface-elevated-rgb), 0.58);
}
.dp-search::placeholder {
  color: var(--color-text-muted);
}
.dp-conversations {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
  margin-top: 8px;
}
.dp-conversation {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 9px;
  text-align: left;
  position: relative;
}
.dp-conversation:hover,
.dp-conversation[aria-current="true"],
.dp-conversation:focus-visible {
  background: var(--dp-accent-wash);
  border-color: var(--dp-line);
}
/* The title keeps 17px clear for the unread mark. */
.dp-conversation strong {
  display: block;
  padding-right: 17px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-primary);
}
/* "Chrome · Now": one line, ending in an ellipsis when it runs long. */
.dp-conversation small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-conversation-preview {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* A response that finished while another conversation was open here. */
.dp-conv-unread {
  position: absolute;
  right: 8px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand-teal);
}
/* "＋ New conversation" reads at the 16px base size (v22). */
.dp-history-new {
  flex: 0 0 auto;
  margin-top: 8px;
  height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-brand-teal);
  text-align: left;
  padding: 0 4px;
  font-size: 16px;
}
.dp-history-new:hover {
  background: var(--dp-accent-wash-soft);
}
.dp-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 10px;
}
/* The drawer's two lists, Conversations and Working Groups: where Quick
   Input sends. Rectangular, the chosen one in the accent. */
.dp-history-tabs {
  display: flex;
  min-width: 0;
  gap: 2px;
}
.dp-history-tabs button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.dp-history-tabs button:hover {
  color: var(--color-text-primary);
  background: var(--dp-accent-wash-soft);
}
.dp-history-tabs button[aria-selected="true"] {
  color: var(--color-brand-teal);
  font-weight: 600;
}

/* A Working Group chosen to send to: its recent messages, one after another,
   the author above the words. */
.dp-group-line + .dp-group-line {
  margin-top: 9px;
}
.dp-group-author {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.dp-group-line[data-own="true"] .dp-group-author {
  color: var(--color-brand-teal);
}
.dp-group-line[data-sending="true"] .dp-group-text {
  color: var(--color-text-secondary);
}
.dp-group-text {
  display: block;
}

/* ---------------------------------------------------- pickers & menus */
/* AUTO and context pickers (v22 §9): popovers under their triggers, over the
   response, each its own native region. As tall as their content. */
.dp-popover {
  position: absolute;
  z-index: 15;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--dp-glass-deep);
  backdrop-filter: var(--dp-blur-strong);
  -webkit-backdrop-filter: var(--dp-blur-strong);
  border: 0;
  border-radius: 5px;
  box-shadow:
    var(--dp-edge),
    0 20px 42px rgba(0, 0, 0, 0.42);
  color: var(--color-text-primary);
  font-size: 11px;
}
.dp-menu {
  padding: 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
/* The AUTO rows keep their explanatory line (v22). */
.dp-menu[data-picker="auto"] .dp-item {
  min-height: 40px;
  padding: 7px 9px;
}
/* "Find an app": a magnifier and an underline, never a filled box. */
.dp-cpsearch {
  flex: 0 0 auto;
  height: 32px;
  margin: 2px 5px 7px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  background: rgba(var(--surface-elevated-rgb), 0.3);
  border-bottom: 1px solid var(--dp-line);
}
.dp-root[data-input-modality="keyboard"] .dp-cpsearch:focus-within {
  border-bottom-color: var(--dp-line-strong);
}
.dp-cpsearch svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--color-text-muted);
  stroke-width: 1.6;
  margin-left: 4px;
}
.dp-cpsearch-input {
  min-width: 0;
  width: 100%;
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 10px;
  padding: 0 5px;
  user-select: text;
}
.dp-cpsearch-input::placeholder {
  color: var(--color-text-muted);
}
/* The source list scrolls, not the picker, so the header stays put. */
.dp-cpapps {
  display: grid;
  gap: 1px;
  min-height: 0;
  max-height: 288px;
  overflow-y: auto;
}
/* A source row is its name and its availability, on one line. */
.dp-src {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.dp-src strong {
  min-width: 0;
}
.dp-src-status {
  flex: 0 0 auto;
  font-size: 9px;
  color: var(--color-text-muted);
}
.dp-cpapps .dp-check {
  justify-self: start;
}
.dp-cpempty {
  padding: 28px 8px;
}
.dp-cvclear {
  flex: 0 0 auto;
  width: 100%;
  height: 28px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  text-align: left;
  padding: 0 9px;
  border-radius: 3px;
  font-size: 11px;
}
.dp-cvclear:hover {
  background: var(--dp-accent-wash-soft);
  color: var(--color-brand-teal);
}
/* v22 §9 Companions panel, pinned to the bottom of the context picker: a
   hairline above it, no fill, no border on its actions (5px radius). */
.dp-cpcompanion {
  flex: 0 0 auto;
  margin: 7px -1px -1px;
  padding: 9px 8px 8px;
  background: transparent;
  border-top: 1px solid var(--dp-line);
}
.dp-cpcompanion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--color-text-primary);
}
.dp-cpcompanion-head strong {
  font-size: 11px;
  font-weight: 600;
}
.dp-cpcompanion-head span {
  font-size: 9px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-cpcompanion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.dp-cpcompanion-action {
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-brand-teal);
  padding: 0 8px;
  text-align: left;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-cpcompanion-action:hover:not(:disabled) {
  background: var(--dp-accent-wash-soft);
}
.dp-cpcompanion-action:disabled {
  opacity: 0.35;
  cursor: default;
}
.dp-cpcompanion-action[aria-disabled="true"] {
  cursor: default;
}
.dp-cpcompanion-action:focus-visible {
  outline: 1px solid var(--color-brand-teal);
  outline-offset: -1px;
}
/* v22 §17: one column on a compact display. */
.dp-root[data-display-width="compact"] .dp-cpcompanion-actions {
  grid-template-columns: 1fr;
}
.dp-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 7px;
}
.dp-menu-head span:last-child {
  color: var(--color-text-muted);
  font-size: 9px;
}
.dp-label {
  padding: 7px 8px 4px;
  color: var(--color-text-muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dp-item {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 12px;
  align-items: center;
  padding: 5px 9px;
  text-align: left;
}
.dp-item:hover,
.dp-item:focus-visible {
  background: var(--dp-hover);
}
/* The chosen behaviour, or a source chosen manually (never Auto's own pick). */
.dp-item[role="radio"][aria-checked="true"],
.dp-item[data-selected="true"] {
  background: var(--dp-accent-wash-soft);
}
.dp-item > span:first-child {
  min-width: 0;
}
.dp-item strong {
  display: block;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-primary);
}
.dp-item small {
  display: block;
  min-width: 0;
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.dp-check {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 2px;
  background: rgba(var(--surface-elevated-rgb), 0.3);
  display: grid;
  place-items: center;
  justify-self: end;
  transition:
    border-color 0.12s,
    background 0.12s;
  pointer-events: none;
}
.dp-check::after {
  content: "";
  width: 6px;
  height: 3px;
  border-left: 1.5px solid var(--color-brand-teal);
  border-bottom: 1.5px solid var(--color-brand-teal);
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.dp-check[data-checked="true"] {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: var(--dp-accent-wash);
}
.dp-check[data-checked="true"]::after {
  opacity: 1;
}
/* The source Auto is using now: checked, with a lighter edge (v22). */
.dp-check[data-auto="true"] {
  border-color: rgba(var(--accent-rgb), 0.34);
}
.dp-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--dp-line);
}
.dp-foot {
  padding: 8px 9px 4px;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.4;
}
.dp-menu-row {
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  text-align: left;
  border-radius: 4px;
}
.dp-menu-row:hover,
.dp-menu-row:focus-visible {
  background: var(--dp-hover);
}
.dp-menu-row[data-danger="true"] {
  color: var(--color-error);
}
.dp-menu-row .dp-key {
  color: var(--color-text-muted);
  font-size: 9px;
}
.dp-subgroup {
  padding: 6px 12px;
}
.dp-subtitle {
  color: var(--color-text-muted);
  font-size: 9px;
  min-height: 22px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
}
.dp-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 3px;
}
.dp-segments button {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 4px;
  padding: 8px 6px;
  font-size: 11px;
}
.dp-segments button:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: var(--dp-accent-wash-soft);
}
.dp-segments button[aria-checked="true"] {
  color: var(--color-brand-teal);
  font-weight: 600;
}
.dp-segments button:disabled {
  opacity: 0.28;
}

/* ------------------------------------------- controls menu (v22 §10) */
/* Opened at the pointer as its own native region, outside the ambient fade.
   As tall as its content; past the work area height less 62px it scrolls. */
.dp-ctxmenu {
  position: absolute;
  z-index: 20;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  background: var(--dp-glass-deep);
  backdrop-filter: var(--dp-blur-strong);
  -webkit-backdrop-filter: var(--dp-blur-strong);
  border: 0;
  border-radius: 6px;
  box-shadow:
    var(--dp-edge),
    0 20px 45px rgba(0, 0, 0, 0.46);
  color: var(--color-text-primary);
  font-size: 11px;
}
.dp-ctxmenu .dp-sep {
  margin: 8px 4px;
}
.dp-check-mark {
  color: var(--color-brand-teal);
}
/* Response visibility: square check rows, never round radios. */
.dp-radios {
  display: grid;
  gap: 7px;
}
.dp-radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--color-text-secondary);
  padding: 4px 0 4px 20px;
}
.dp-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dp-radio::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translateY(-50%);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 2px;
}
.dp-radio:has(input:checked)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 5px;
  height: 3px;
  border-left: 1.5px solid var(--color-brand-teal);
  border-bottom: 1.5px solid var(--color-brand-teal);
  transform: translateY(-65%) rotate(-45deg);
}
.dp-radio:has(input:focus-visible)::before {
  outline: 1px solid var(--color-brand-teal);
}
.dp-opacity {
  display: grid;
  grid-template-columns: auto 1fr 34px;
  align-items: center;
  gap: 9px;
  color: var(--color-text-secondary);
  font-size: 11px;
}
.dp-opacity input {
  width: 100%;
  accent-color: var(--color-brand-teal);
}
/* Actions and Keyboard shortcuts: independent disclosures with a caret. */
.dp-disclosure {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
.dp-disclosure:hover {
  color: var(--color-text-primary);
}
.dp-disclosure-caret {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.8;
  transition: transform 0.15s ease;
}
.dp-disclosure[aria-expanded="false"] .dp-disclosure-caret {
  transform: translateY(0) rotate(-45deg);
}
.dp-disclosure-body {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}
.dp-disclosure-body[hidden] {
  display: none;
}
.dp-disclosure-body .dp-menu-row {
  padding: 0;
}
.dp-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.dp-shortcut-row span:last-child {
  color: var(--color-text-muted);
  font-size: 9px;
  white-space: nowrap;
}

/* ------------------------------------------------- toasts (v22 §12) */
/* Bottom centre of the display, its own native region, never faded. */
.dp-toast {
  position: absolute;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  background: var(--dp-glass-deep);
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
  border: 1px solid var(--dp-line);
  border-radius: 5px;
  color: var(--color-text-secondary);
  font-size: 11px;
  transition:
    opacity 0.15s,
    transform 0.15s;
  animation: dp-toast-in 0.15s ease;
}
.dp-toast[data-measuring="true"] {
  visibility: hidden;
  animation: none;
}
.dp-toast[data-leaving="true"] {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
.dp-toast-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes dp-toast-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* --------------------------------------------- composer & voice strip */
/* Keyboard hint (v22 §6): 8px muted text 3px under the bar's right end,
   easing in from 2px above over 0.15s while Quick Input has focus and back
   out the same way when focus leaves. Uncovered by a closing panel it is
   simply there again. */
.dp-composer-note {
  position: absolute;
  z-index: 1;
  text-align: right;
  white-space: nowrap;
  font-size: 8px;
  color: var(--color-text-muted);
  opacity: 0.7;
  pointer-events: none;
  animation: dp-note-in 0.15s ease both;
}
.dp-composer-note[data-phase="shown"] {
  animation: none;
}
.dp-composer-note[data-phase="leaving"] {
  animation: dp-note-out 0.15s ease both;
}
@keyframes dp-note-in {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 0.7;
    transform: none;
  }
}
@keyframes dp-note-out {
  from {
    opacity: 0.7;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-2px);
  }
}
/* The expanded editor (v22 §6): deep glass on the regular blur. */
.dp-layer.dp-composer-layer {
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
}
.dp-composer {
  padding: 8px;
}
.dp-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: end;
  gap: 5px;
}
/* Grows with its text from 72px to 132px, then scrolls. */
.dp-composer textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  max-height: 132px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1.45;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
}
.dp-composer-send {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-brand-teal);
  font-size: 16px;
  display: grid;
  place-items: center;
}
.dp-composer-send:hover {
  background: var(--dp-accent-wash);
}
.dp-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 4px 7px 0;
  color: var(--color-text-muted);
  font-size: 9px;
}
.dp-composer-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-composer-foot button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  padding: 2px 0;
  font-size: 9px;
  white-space: nowrap;
}
.dp-composer-foot button:hover {
  color: var(--color-brand-teal);
}
/* The voice strip (v22 §11): one 48px box with its accent edge, on deep
   glass and the regular blur. */
.dp-layer.dp-voice {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  backdrop-filter: var(--dp-blur);
  -webkit-backdrop-filter: var(--dp-blur);
}
/* v22 §17: narrower wave on a display 960px wide or less; at 620px or less
   the actions take their own right-aligned row. */
.dp-root[data-display-width="narrow"] .dp-layer.dp-voice {
  grid-template-columns: auto 50px minmax(0, 1fr) auto;
}
.dp-root[data-display-width="compact"] .dp-layer.dp-voice {
  grid-template-columns: auto 48px minmax(0, 1fr);
  gap: 7px;
}
.dp-root[data-display-width="compact"] .dp-voice-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.dp-voice-live {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-size: 10px;
}
.dp-voice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand-teal);
  box-shadow: 0 0 0 3px var(--dp-accent-wash);
  animation: dp-voice-pulse 1.2s ease-in-out infinite;
}
.dp-voice-dot[data-muted="true"] {
  background: var(--color-text-muted);
  box-shadow: none;
  animation: none;
}
.dp-voice-time {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.dp-voice-wave {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
/* The wave moves whenever the strip shows (v22); its keyframes carry the fade. */
.dp-voice-wave i {
  display: block;
  width: 2px;
  height: 7px;
  background: var(--color-brand-teal);
  border-radius: 1px;
  animation: dp-voice-wave 1s ease-in-out infinite;
}
.dp-voice-wave i:nth-child(2),
.dp-voice-wave i:nth-child(6) {
  animation-delay: 0.12s;
}
.dp-voice-wave i:nth-child(3),
.dp-voice-wave i:nth-child(5) {
  animation-delay: 0.24s;
}
.dp-voice-wave i:nth-child(4) {
  animation-delay: 0.36s;
}
/* Nobody is being listened to (muted, or paused while a turn runs, a
   decision waits or a reply is read aloud): the wave rests. */
.dp-voice-wave[data-paused="true"] i {
  animation: none;
  height: 7px;
  opacity: 0.45;
}
.dp-voice-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 10px;
}
.dp-voice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dp-voice-actions button {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  padding: 4px 0;
  font-size: 10px;
}
.dp-voice-actions button:last-child {
  color: var(--color-brand-teal);
}
.dp-voice-actions button:hover:not([aria-disabled="true"]) {
  color: var(--color-text-primary);
}
.dp-voice-actions button[aria-disabled="true"] {
  cursor: default;
}

/* ------------------------------------------- first-run hint (v22 §12) */
/* Bottom-right of the display until first use; fades down and out. */
.dp-hint {
  position: absolute;
  white-space: nowrap;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 10px;
  background: rgba(var(--surface-abyss-rgb), 0.42);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  transition:
    opacity 0.35s,
    transform 0.35s;
}
.dp-hint[data-dismissed="true"] {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
@keyframes dp-voice-wave {
  0%,
  100% {
    height: 6px;
    opacity: 0.45;
  }
  50% {
    height: 20px;
    opacity: 1;
  }
}
@keyframes dp-voice-pulse {
  50% {
    opacity: 0.45;
  }
}

/* ---------------------------------------------------------- decisions */
/* On the v22 type scale: a 9px muted label, the 11px request and 10px text
   actions 11px apart, on the response's padding. No warning colours. */
.dp-decision {
  padding: 12px 14px 11px;
  display: grid;
  gap: 8px;
  font-size: 11px;
}
.dp-decision-title {
  color: var(--color-text-muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.dp-decision-body {
  color: var(--color-text-primary);
  line-height: 1.45;
}
/* A decision decided only from its full review: the request's own plain
   facts, label beside value, scrolling within a bounded height. */
.dp-decision-review {
  display: grid;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
  outline: none;
  font-size: 10px;
  line-height: 1.4;
}
.dp-decision-review:focus-visible {
  box-shadow: 0 0 0 1px var(--color-brand-teal);
  border-radius: 5px;
}
.dp-decision-review dl {
  display: grid;
  gap: 4px;
  margin: 0;
}
.dp-decision-review-row {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 10px;
}
.dp-decision-review dt {
  color: var(--color-text-muted);
}
.dp-decision-review dd {
  margin: 0;
  color: var(--color-text-primary);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.dp-decision-review p {
  margin: 0;
  color: var(--color-text-secondary);
}

.dp-decision-actions,
.dp-decision-more {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 10px;
}
.dp-decision-more {
  padding: 6px 14px 8px;
  color: var(--color-text-secondary);
}
.dp-decision-actions button,
.dp-decision-more button {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 3px 0;
  font-size: 10px;
}
.dp-decision-actions button:hover:not(:disabled),
.dp-decision-more button:hover {
  color: var(--color-brand-teal);
}
.dp-decision-actions button[data-primary="true"],
.dp-decision-more button[data-primary="true"] {
  color: var(--color-brand-teal);
}

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

/* ------------------------------------------------------ accessibility */
@media (prefers-reduced-motion: reduce) {
  .dp-surface .dp-bar,
  .dp-surface .dp-panel .dp-layer,
  .dp-surface .dp-panel .dp-layer.dp-response-layer,
  .dp-surface .dp-popover,
  .dp-response,
  .dp-toast,
  .dp-hint,
  .dp-disclosure-caret,
  .dp-check {
    transition: none;
  }
  .dp-reply[data-working="true"]::after,
  .dp-voice-dot,
  .dp-voice-wave i,
  .dp-toast,
  .dp-notice-layer,
  .dp-history {
    animation: none;
  }
  /* History opens and closes at once: nothing is left to slide out. */
  .dp-history[data-closing="true"] {
    display: none;
  }
}
/* When the OS asks for less transparency every surface becomes solid. The
   ambient fade is kept: it is opacity, not translucency of the glass. */
@media (prefers-reduced-transparency: reduce) {
  .dp-bar,
  .dp-layer,
  .dp-popover,
  .dp-ctxmenu,
  .dp-toast,
  .dp-hint,
  .dp-latest {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--color-surface-abyss) !important;
    background-image: none !important;
  }
}
/* High Contrast: system colours, visible borders, no translucency, and no
   state carried by colour alone: the live dot and the wave stay drawn in the
   highlight colour, and the active mic keeps an outline. */
@media (forced-colors: active) {
  .dp-surface .dp-bar,
  .dp-surface .dp-panel .dp-layer,
  .dp-surface .dp-popover {
    opacity: 1 !important;
  }
  .dp-voice-dot,
  .dp-voice-wave i {
    forced-color-adjust: none;
    background: Highlight;
    box-shadow: none;
  }
  /* The microphone has closed while the words become text: a resting dot. */
  .dp-voice-dot[data-muted="true"] {
    background: GrayText;
  }
  .dp-btn[aria-pressed="true"],
  .dp-btn[aria-pressed="true"]:hover:not(:disabled),
  .dp-tool[aria-pressed="true"] {
    forced-color-adjust: none;
    color: Highlight;
    background: Canvas;
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
  .dp-bar,
  .dp-layer,
  .dp-popover,
  .dp-ctxmenu,
  .dp-toast,
  .dp-hint {
    background: Canvas !important;
    border: 1px solid CanvasText !important;
    backdrop-filter: none !important;
  }
  .dp-root button:focus-visible,
  .dp-root [tabindex]:focus-visible,
  .dp-root [role="button"]:focus-visible,
  .dp-root[data-input-modality="keyboard"]
    :is(.dp-input, .dp-search, .dp-cpsearch-input, .dp-composer textarea):focus-visible {
    outline: 2px solid Highlight;
  }
  /* Unavailable or busy is never shown by fading alone. */
  .dp-cpcompanion-action:disabled,
  .dp-cpcompanion-action[aria-disabled="true"],
  .dp-actions button[aria-disabled="true"] {
    color: GrayText;
    opacity: 1;
  }
}
