.live-strip {
  grid-row: 4;
  display: block;
  width: min(760px, calc(100% - 20px));
  min-width: 0;
  min-height: 18px;
  margin: 0 auto 4px;
  padding: 0 4px;
  overflow: hidden;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: var(--font-size-secondary, 12px);
  line-height: 1.35;
}

.live-strip[hidden] { display: none; }
.native-activity-control { justify-self: start; max-width: 100%; margin-bottom: 4px; }

.live-activity-summary {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-activity-summary-wave {
  font: inherit;
  line-height: inherit;
  white-space: pre;
}

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

.live-activity-glyph {
  display: inline-block;
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
  opacity: .78;
  transform: translateY(0);
}

.live-strip.is-active .live-activity-glyph {
  animation: loomrail-live-activity-text-wave 1000ms ease-in-out infinite;
  animation-delay: var(--wave-delay, 0ms);
}

.live-strip[data-fast="true"],
.composer-runtime-summary[data-fast="true"] { --activity-wave-color: var(--amber); }

@keyframes loomrail-live-activity-text-wave {
  0%, 18%, 100% { color: inherit; opacity: .78; transform: translateY(0); }
  9% { color: var(--activity-wave-color, var(--mint)); opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .live-strip.is-active .live-activity-glyph,
  .composer-runtime-summary[data-live-animation="true"] .live-activity-glyph { animation: none; opacity: 1; }
}

.live-strip[data-state="disconnected"],
.live-strip[data-state="paused"],
.live-strip[data-state="unavailable"] { color: var(--amber); }

.live-strip[data-state="updating"] { color: var(--mint); }

.composer-shell {
  position: relative;
  grid-row: 5;
  padding: 5px max(18px, calc((100% - 780px) / 2)) calc(8px + var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}

.composer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  max-width: 760px;
  height: auto;
  min-height: 44px;
  margin-inline: auto;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

.composer-icon-control,
.composer-control-card {
  position: relative;
  height: auto;
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.composer-icon-control {
  display: grid;
  width: 44px;
  min-width: 44px;
  padding: 0;
  place-items: center;
  border-radius: 0;
}

.composer-icon-control::before {
  position: absolute;
  width: 28px;
  height: 28px;
  background: transparent;
  border-radius: 999px;
  content: "";
}

.composer-icon-control svg {
  z-index: 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.composer-control-card {
  display: flex;
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 44px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: 7px;
  font-size: var(--font-size-secondary);
  font-weight: 650;
  overflow-wrap: anywhere;
  white-space: normal;
}

.composer-control-card::before {
  position: absolute;
  z-index: 0;
  inset: 7px 0;
  background: transparent;
  border-radius: 7px;
  content: "";
}

.composer-icon-control:hover::before,
.composer-icon-control:focus-visible::before,
.composer-control-card:hover::before,
.composer-control-card[aria-expanded="true"]::before {
  background: rgb(122 199 167 / .1);
}

.composer-control-card > * { position: relative; z-index: 1; }
.composer-chip-label { display: none; }
.composer-chip-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.composer-icon-control:disabled,
.composer-control-card:disabled { cursor: default; opacity: .45; }

/* Usage opens from the thread ⋯ menu; the toolbar keeps only its state source. */
.composer-controls .usage-control { display: none; }
.composer-controls .usage-control::before { background: rgb(133 141 147 / .18); }
.composer-controls .usage-control[data-risk="normal"]::before {
  background: rgb(122 199 167 / 0.22);
}

.composer-controls .usage-control[data-risk="warn"]::before {
  background: rgb(229 177 70 / 0.24);
}

.composer-controls .usage-control[data-risk="high"]::before,
.composer-controls .usage-control[data-risk="critical"]::before {
  background: rgb(241 135 125 / 0.24);
}

/* One editor above three fixed action slots; the primary capture never moves. */
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
  min-height: 48px;
  padding: 1px 3px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--mint) 55%, var(--line));
}

.composer textarea {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  max-height: 132px;
  min-height: 44px;
  padding: 10px 6px 7px;
  resize: none;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: var(--faint);
  font-size: calc(13px * var(--font-scale));
  white-space: nowrap;
}

.composer textarea[aria-readonly="true"] {
  pointer-events: none;
}

.composer-attachment-tools {
  grid-column: 1;
  grid-row: 4;
  display: flex;
}

#composer-screenshot[hidden] { display: none; }
#composer-screenshot svg { width: 16px; height: 16px; }

.attachment-picker-cell {
  position: relative;
  width: 44px;
  height: 44px;
}

.attachment-picker-cell .icon-button {
  position: absolute;
  inset: 0;
}

.attachment-picker-cell .icon-button svg {
  width: 16px;
  height: 16px;
}

.attachment-picker-cell input[type="file"] {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.attachment-picker-cell input[type="file"]:disabled { cursor: default; }

.composer-attachment-list {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  max-width: 100%;
  padding: 4px 3px 1px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.composer-attachment-list[hidden] { display: none; }
.composer-attachment-list::-webkit-scrollbar { display: none; }

.composer-attachment {
  display: grid;
  flex: 0 0 min(240px, 76vw);
  grid-template-columns: 38px minmax(0, 1fr) 44px;
  min-height: 46px;
  align-items: center;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  overflow: hidden;
}

.composer-attachment > img {
  width: 38px;
  height: 38px;
  margin-inline-start: 4px;
  object-fit: cover;
  border-radius: 8px;
}

.composer-attachment > span {
  display: grid;
  min-width: 0;
  padding-inline: 8px 2px;
}

.composer-attachment > .composer-file-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  font-size: 26px;
}

.composer-attachment strong,
.composer-attachment small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment strong { font-size: calc(11px * var(--font-scale)); }
.composer-attachment small { color: var(--faint); font-size: calc(9px * var(--font-scale)); }

.composer-attachment > button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.composer-voice-cell { display: contents; }

.composer-voice-cell .icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.composer-voice-cancel {
  grid-column: 3; grid-row: 2; justify-self: end; min-height: 44px;
  padding: 0 8px; border: 0; background: transparent; color: var(--muted); font: inherit;
}
.composer-voice-cancel[hidden] { display: none; }
.composer-voice {
  position: relative; grid-column: 2; grid-row: 4; width: 60px; height: 60px;
  border-radius: 50%; background: color-mix(in srgb, var(--mint) 20%, var(--surface));
}
.composer-voice-cell .composer-voice svg { width: 24px; height: 24px; }
.composer-voice-cell .icon-button:is(:disabled, [aria-disabled="true"]) { cursor: default; opacity: 0.45; }

/* Both entries render the one voice session inside their own button face: preparing
 * pulses the microphone, recording shows real-level bars, finishing a stop square and
 * transcription busy dots. Shape, not only color, distinguishes each state. */
:is(.composer-open-control, .composer-voice) :is(.voice-record-icon, .voice-stop-icon, .voice-level-glyph, .voice-busy-glyph) { display: none; }
.composer-voice:not(:is([data-voice-state="recording"], [data-voice-state="finishing"], [data-voice-state="transcribing"])) .voice-record-icon,
:is(.composer-open-control, .composer-voice)[data-voice-state="preparing"] .voice-record-icon,
:is(.composer-open-control, .composer-voice)[data-voice-state="finishing"] .voice-stop-icon { display: block; }
:is(.composer-open-control, .composer-voice)[data-voice-state="recording"] .voice-level-glyph,
:is(.composer-open-control, .composer-voice)[data-voice-state="transcribing"] .voice-busy-glyph { display: flex; }
.composer-open-control:is([data-voice-state="preparing"], [data-voice-state="recording"], [data-voice-state="finishing"], [data-voice-state="transcribing"]) .entry-chat-icon { display: none; }
:is(.composer-open-control, .composer-voice)[data-voice-state] .voice-stop-icon { fill: currentColor; stroke: none; }
.composer-voice:is([data-voice-state="recording"], [data-voice-state="finishing"])::before {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--red);
  border-radius: 8px;
  content: "";
}
:is(.composer-open-control, .composer-voice):is([data-voice-state="recording"], [data-voice-state="finishing"])[aria-expanded="false"],
.composer-voice:is([data-voice-state="recording"], [data-voice-state="finishing"]) { color: #fff; }

.voice-level-glyph,
.voice-busy-glyph {
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 17px;
  height: 17px;
}
/* One RMS level from the actual PCM frames scales every bar; silence rests at the floor. */
.voice-level-glyph > i {
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(calc(.2 + .8 * var(--voice-level, 0) * var(--voice-bar, 1)));
  transition: transform 80ms linear;
}
.voice-level-glyph > i:nth-child(odd) { --voice-bar: .65; }
.voice-busy-glyph > i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .composer-open-control[data-voice-state="preparing"]::before,
  .composer-voice[data-voice-state="preparing"] .voice-record-icon { animation: voice-preparing-pulse 900ms ease-in-out infinite alternate; }
  .voice-busy-glyph > i { animation: voice-busy-dot 1s ease-in-out infinite; }
  .voice-busy-glyph > i:nth-child(2) { animation-delay: 150ms; }
  .voice-busy-glyph > i:nth-child(3) { animation-delay: 300ms; }
}
/* Reduced motion keeps each state's static shape; the meter stops following the level. */
@media (prefers-reduced-motion: reduce) {
  .voice-level-glyph > i { transform: scaleY(.6); transition: none; }
}
@keyframes voice-preparing-pulse { from { opacity: .55; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
@keyframes voice-busy-dot { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }

.composer-voice-status {
  display: grid;
  grid-column: 1 / 3;
  grid-row: 2;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  padding: 2px 6px;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.composer-voice-status:has(#composer-voice-copy:empty) { display: none; }

.composer-voice-status[data-kind="recording"] { color: var(--red); font-variant-numeric: tabular-nums; }
.composer-voice-status[data-kind="warning"] {
  grid-column: 1 / -1;
  grid-row: 2;
  height: auto;
  min-height: 44px;
}

.send-button {
  position: relative;
  display: grid;
  grid-column: 3;
  grid-row: 4;
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--mint-ink);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.send-button::before {
  position: absolute;
  width: 38px;
  height: 38px;
  background: var(--mint);
  border-radius: 11px;
  content: "";
}

.send-button svg {
  position: relative;
  z-index: 1;
  width: 16px;
}

.composer-note {
  display: none;
  visibility: hidden;
  block-size: 2lh;
  margin: 4px 2px 0;
  color: var(--faint);
  font-size: var(--font-size-secondary);
  line-height: 1.5;
  overflow: hidden;
  text-align: center;
}

.composer-note[data-error="true"],
.composer-note[data-pending="true"] {
  display: block;
  visibility: visible;
  max-height: 96px;
  overflow: auto;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: var(--font-size-secondary);
  line-height: 1.5;
  text-align: start;
  user-select: text;
}

.composer-note[data-error="true"] { block-size: auto; }

.composer-note details { margin-top: 2px; }
.composer-note summary { min-height: 32px; color: var(--muted); cursor: pointer; }
.composer-note details code { display: block; overflow-wrap: anywhere; color: var(--text-secondary); white-space: pre-wrap; }

.history-more {
  display: block;
  min-height: 44px;
  margin: 4px auto 12px;
  color: var(--mint-bright);
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Role color always accompanies a visible name, in both themes. */
[data-product-role="product"] { --product-role-color: #80b9ff; }
[data-product-role="coproduct"] { --product-role-color: #c4a5ff; }
html[data-theme="light"] [data-product-role="product"] { --product-role-color: #175caa; }
html[data-theme="light"] [data-product-role="coproduct"] { --product-role-color: #7139a6; }
#detail-title[data-product-role]:not([data-product-role=""])::after,
.row-title strong[data-product-role]:not([data-product-role=""])::after {
  content: attr(data-role-label);
  color: var(--product-role-color);
  font-size: calc(10px * var(--font-scale));
  font-weight: 600;
  margin-inline-start: 7px;
  white-space: nowrap;
}
.composer-task-card-control[data-product-role]:not([data-product-role=""]) {
  color: var(--product-role-color);
}
.product-thread-label { display: none; }
#detail-title[data-product-role]:not([data-product-role=""]) { color: var(--product-role-color); }

/* Show a separate role label only when the title does not already contain it.
 * The role color and complete title preserve identity when a suffix clips. */
html.embed-hermes #detail-title[data-product-role]:not([data-product-role=""])[data-role-label]:not([data-role-label=""])::before {
  content: attr(data-role-label);
  color: var(--product-role-color);
  font-size: calc(10px * var(--font-scale));
  font-weight: 600;
  margin-inline-end: 6px;
}
html.embed-hermes #detail-title[data-product-role]:not([data-product-role=""])::after { content: none; }

/* One Composer design at every width: a single toolbar row opens the input
 * panel and the model button opens one settings panel. */
.composer-controls {
  flex-wrap: nowrap;
  align-items: center;
}

.composer-control-card { display: none; }

/* Model may truncate; effort and existing touch targets remain visible. */
.composer-controls > .composer-icon-control,
.composer-controls > .composer-open-control { min-width: 44px; }

.composer-runtime-summary {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  font-size: min(var(--font-size-secondary), 14px);
}

/* Shared display speed spans only the status segment, including idle activity. */
.composer-runtime-summary[data-speed="priority"]::after,
.composer-runtime-summary[data-speed="ultrafast"]::after {
  position: absolute;
  inset-inline: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e9932d, #ffbf47, #ffe07a, #e9932d);
  background-size: 200% 100%;
  pointer-events: none;
  content: "";
}
.composer-runtime-summary[data-speed="ultrafast"]::after {
  background-image: linear-gradient(90deg, #ef5350, #ffab40, #ffee58, #66bb6a, #26c6da, #5c6bc0, #ab47bc, #ef5350);
}
@media (prefers-reduced-motion: no-preference) {
  .composer-runtime-summary[data-live-animation="true"][data-speed="priority"]::after,
  .composer-runtime-summary[data-live-animation="true"][data-speed="ultrafast"]::after {
    animation: composer-ultra-fast-flow 1400ms linear infinite;
  }
}
@keyframes composer-ultra-fast-flow {
  to { background-position: -200% 0; }
}

.composer-runtime-label {
  display: flex;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 44px;
  max-width: calc(100% - 3em - 6px);
  min-height: 44px;
  padding: 4px 2px;
  align-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: min(var(--font-size-secondary), 14px);
  font-weight: 650;
  line-height: 1.25;
  text-align: start;
  cursor: pointer;
}

.composer-runtime-label > span {
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
}

.composer-runtime-summary > span,
.runtime-rate-trigger > span { white-space: nowrap; }

/* A real focusable entry over the status text; the model button keeps its own hit area. */
.runtime-rate-trigger {
  display: flex;
  flex: 1 1 0;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  align-items: center;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  line-height: inherit;
  text-align: start;
  cursor: pointer;
}
.runtime-rate-trigger:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.thread-rate-popover[hidden] { display: none; }
.thread-rate-popover { position: fixed; z-index: 35; max-height: min(70dvh, 460px); overflow: auto; overscroll-behavior: contain; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel, var(--bg)); color: var(--text); box-shadow: 0 12px 36px rgb(0 0 0 / .22); font-size: var(--font-size-secondary); line-height: 1.5; overflow-wrap: anywhere; }
.thread-rate-popover header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-rate-popover h2 { margin: 0; font-size: 1em; font-weight: 650; }
.thread-rate-popover header button { flex: 0 0 44px; width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.thread-rate-popover button:focus-visible, .thread-rate-popover summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.thread-rate-heading, .thread-rate-window-title { margin: 8px 0 0; font-weight: 600; }
.thread-rate-heading span, .thread-rate-window-title span { color: var(--muted); font-weight: 500; }
.thread-rate-figure { margin: 2px 0; font-size: 1.5em; font-weight: 650; font-variant-numeric: tabular-nums; }
.thread-rate-figure small { font-size: .6em; color: var(--muted); font-weight: 500; }
.thread-rate-meta { margin: 2px 0; color: var(--muted); }
.thread-rate-meta button, .thread-rate-details button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-soft); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.thread-rate-details summary { min-height: 32px; align-content: center; cursor: pointer; color: var(--muted); }
.thread-rate-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 4px 0; }
.thread-rate-details dt { color: var(--muted); }
.thread-rate-details dd { margin: 0; }
.thread-rate-live, .thread-rate-rolling { margin-top: 8px; border-top: 1px solid var(--line-soft); }
.thread-rate-live .thread-rate-figure { font-size: 1.15em; }

#runtime-label-effort,
#runtime-label-detail {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 500;
}

#runtime-label-model { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#runtime-label-effort { line-height: 1.45; }
.composer-runtime-summary[data-live="false"] #runtime-label-detail::after { content: " · 空闲"; }

/* Idle keeps its activity label; live activity owns the remaining space. */
.composer-runtime-summary[data-live="true"] #runtime-label-detail:empty { display: none; }
.composer-runtime-summary[data-runtime-detail="true"] { flex-wrap: wrap; }
.composer-runtime-summary[data-runtime-detail="true"] #runtime-label-detail {
  order: 1;
  flex: 0 1 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.runtime-label-activity {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.runtime-label-activity[hidden] { display: none; }
/* Glyphs retain their .78 opacity/wave. Use a stronger neutral in light
 * mode so the composited text still meets ordinary-text contrast. */
html[data-theme="light"] .composer-runtime-summary:not([data-live-state="disconnected"],
  [data-live-state="paused"], [data-live-state="unavailable"]) .runtime-label-activity {
  color: var(--text-secondary);
}
.composer-runtime-summary[data-live-state="disconnected"] .runtime-label-activity,
.composer-runtime-summary[data-live-state="paused"] .runtime-label-activity,
.composer-runtime-summary[data-live-state="unavailable"] .runtime-label-activity { color: var(--amber); }
.composer-runtime-summary[data-live-animation="true"] .live-activity-glyph {
  animation: loomrail-live-activity-text-wave 1000ms ease-in-out infinite;
  animation-delay: var(--wave-delay, 0ms);
}

.runtime-status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-inline: 2px 0;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 50%;
}
.runtime-status-dot[data-risk="high"],
.runtime-status-dot[data-risk="critical"] { background: var(--red); }

/* The strip keeps announcing for screen readers without taking a row. */
.live-strip:not([hidden]) {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
#thread-task-stop { display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; min-width: 44px; margin-inline: 4px 8px; padding: 0 8px;
  color: var(--text); background: transparent; border: 0; border-radius: 8px; font: inherit; flex: none; }
#thread-task-stop[hidden] { display: none; }
#thread-task-stop svg { width: 14px; height: 14px; fill: currentColor; }
#thread-task-stop:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.send-button[data-voice-busy="true"] { visibility: hidden; pointer-events: none; }

.composer-runtime-label:hover,
.composer-runtime-label[aria-expanded="true"] { background: rgb(122 199 167 / .1); }
.composer-runtime-label:disabled { cursor: default; opacity: 1; }

.composer-open-control {
  position: relative;
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--mint-ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.composer-open-control[data-voice-state="preparing"][aria-expanded="false"]::before { background: var(--amber); }
.composer-open-control:is([data-voice-state="recording"], [data-voice-state="finishing"])[aria-expanded="false"]::before { background: var(--red); }
/* The entry's announcement region is screen-reader only; the open panel announces its own status. */
.composer-shell[data-mobile-composer="open"] > .composer-hold-status { display: none; }

/* The original mint chat button, reduced to the Product switch's size. */
.composer-open-control::before {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--mint);
  border-radius: 8px;
  content: "";
}

.composer-open-control[aria-disabled="true"] { cursor: default; opacity: .45; }

.composer-open-control svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
}

.composer-open-control[data-draft="true"]::after {
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  background: var(--amber);
  border: 2px solid var(--bg);
  border-radius: 50%;
  content: "";
}

.composer-shell[data-mobile-composer="closed"] .composer-panel,
.composer-shell[data-mobile-composer="open"] .composer-controls { display: none; }

.composer-shell[data-mobile-composer="open"] {
  border-top-color: var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgb(0 0 0 / .22);
}

.composer-panel {
  display: grid;
  gap: 4px;
}

/* An error reads above the input, clear of the toast and keyboard. */
.composer-panel > .composer-note { order: -1; }
.composer-panel > .composer-panel-header { order: -2; }

.composer-panel-header {
  position: relative;
  display: flex;
  min-height: 48px;
  padding-top: 6px;
  align-items: center;
  gap: 8px;
  touch-action: none;
}

.composer-panel-grip {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 36px;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  transform: translateX(-50%);
}

.composer-panel-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-start: 4px;
}

.composer-panel-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-base);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-panel-runtime-summary {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: var(--font-size-secondary);
}

#composer-panel-runtime {
  flex: 0 1 auto;
  min-width: 44px;
  max-width: 60%;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--font-size-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The one runtime panel keeps the sheet's inner spacing; phones dock it to the bottom edge. */
.composer-runtime-menu[data-kind="all"] { padding: 0 14px 14px; }

@media (max-width: 820px) {
  .composer-runtime-menu[data-kind="all"] {
    top: auto !important;
    right: 0;
    bottom: 0;
    left: 0 !important;
    width: 100% !important;
    max-height: min(82dvh, 640px);
    padding: 0 max(14px, var(--safe-right)) calc(14px + var(--safe-bottom)) max(14px, var(--safe-left));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
}

html:not([data-theme="light"]) .composer-open-control { color: var(--text); }
html:not([data-theme="light"]) .composer-open-control::before { background: #29483e; }


html.native-content-geometry .composer-shell {
  padding-inline: calc(var(--column-content-left) + max(18px, (100% - var(--column-content-left) - var(--column-content-right) - 780px) / 2))
    calc(var(--column-content-right) + max(18px, (100% - var(--column-content-left) - var(--column-content-right) - 780px) / 2));
}
@media (max-width: 820px) {
  html.native-content-geometry .composer-shell {
    padding-inline: calc(10px + var(--column-content-left)) calc(10px + var(--column-content-right));
  }
  html.native-content-geometry .composer-runtime-menu[data-kind="all"] {
    left: var(--content-left) !important;
    right: var(--content-right);
    width: var(--content-width) !important;
    padding-inline: 14px;
  }
}

.visual-task-status { position: relative; display: flex; flex: 0 0 auto; align-items: center; margin-inline: 4px; }
.visual-task-status[hidden],.visual-task-details[hidden] { display: none; }
.visual-task-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 9px; border: 1px solid var(--line-soft); border-radius: 24px; color: var(--mint-bright, var(--mint)); background: var(--panel, var(--bg)); box-shadow: 0 3px 12px rgb(0 0 0 / .12); font: inherit; font-size: min(var(--font-size-secondary, 12px), 13px); cursor: pointer; white-space: nowrap; }
.visual-task-trigger time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.visual-task-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; }
.visual-task-status[data-phase="active"] .visual-task-icon { animation: visual-assistant-pulse 2400ms ease-in-out infinite; }
.visual-task-status[data-phase="failed"] .visual-task-trigger { color: var(--red); }
.visual-task-status[data-phase="unknown"] .visual-task-trigger { color: var(--amber); }
.visual-task-status[data-phase="not_started"] .visual-task-trigger { color: var(--muted); }
.visual-task-details { position: fixed; z-index: 35; max-height: min(60dvh, 400px); overflow: auto; overscroll-behavior: contain; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel, var(--bg)); color: var(--text); box-shadow: 0 12px 36px rgb(0 0 0 / .22); font-size: var(--font-size-secondary); line-height: 1.5; overflow-wrap: anywhere; }
.visual-task-details header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.visual-task-details button { flex: 0 0 44px; width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.visual-task-details p { margin: 8px 0; }
.visual-task-details pre { white-space: pre-wrap; font: inherit; }
.visual-task-details summary { min-height: 44px; align-content: center; cursor: pointer; }
.visual-task-trigger:focus-visible,.visual-task-details button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.composer-panel-header:has(.visual-task-status:not([hidden])) .composer-panel-runtime-summary { overflow: hidden; }
.composer-controls:has(.visual-task-status:not([hidden])) .composer-runtime-summary { flex-basis: 0; }
/* Share the existing 44px control height when the capsule leaves little width.
 * Model and effort stay in the same button; activity keeps its own visible slot. */
@media (max-width: 400px) {
  .composer-controls:has(.visual-task-status:not([hidden])) .composer-runtime-summary { gap: 0; }
  .composer-controls:has(.visual-task-status:not([hidden])) .composer-runtime-label {
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr);
    gap: 0 3px;
    max-width: calc(100% - 2em);
    padding-inline: 0;
    outline-offset: 0;
  }
  .composer-controls:has(.visual-task-status:not([hidden])) .runtime-status-dot {
    grid-column: 1;
    grid-row: 1;
    margin-inline: 0;
  }
  .composer-controls:has(.visual-task-status:not([hidden])) #runtime-label-model { grid-column: 2; grid-row: 1; }
  .composer-controls:has(.visual-task-status:not([hidden])) #runtime-label-effort { grid-column: 1 / -1; grid-row: 2; }
  .composer-controls:has(.visual-task-status:not([hidden])) .runtime-label-activity { padding-inline-start: 2px; }
  .composer-controls:has(.visual-task-status:not([hidden])) #runtime-label-detail { transform: translateX(2px); }
  .composer-controls:has(.visual-task-status:not([hidden])) .composer-runtime-summary[data-live="false"] #runtime-label-detail::after { content: "空闲"; }
}
@keyframes visual-assistant-pulse { 0%,100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .visual-task-status[data-phase="active"] .visual-task-icon { animation: none; } }
.composer-runtime-explain { margin: 4px 0 0; color: var(--muted); font-size: var(--font-size-secondary); }
.composer-runtime-explain summary { min-height: 32px; align-content: center; cursor: pointer; }
.composer-runtime-explain dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 4px 0; }
.composer-runtime-explain dd { margin: 0; overflow-wrap: anywhere; }
