.workspace-mentions {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: var(--block-inset);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-background);
  color: var(--text);
  box-shadow: 0 8px 28px #0006;
}
.workspace-mention-option {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.workspace-mention-option:is(:hover, [aria-selected='true']) {
  background: var(--control-active-surface);
}
.workspace-mention-option small,
.workspace-mention-note {
  color: var(--muted-text);
  font-size: 12px;
}
.workspace-mention-note {
  padding: 8px;
}

.composer-input {
  position: relative;
  display: flow-root;
  height: 140px;
  min-height: 114px;
  padding: var(--block-inset);
  padding-bottom: var(--composer-footer, 43px);
  resize: none;
  overflow: hidden;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-background);
}
#screen-keyboard {
  align-self: center;
  flex: none;
  width: min(100%, 680px);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-background);
}
.screen-keyboard-row {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
}
.screen-keyboard-row:last-child {
  margin-bottom: 0;
}
.screen-keyboard-row button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 0 2px;
  background: var(--control-background);
  color: var(--text);
}
.screen-keyboard-row button[data-key='Space'] {
  flex-grow: 4;
}
.screen-keyboard-row button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--page-background);
}
body.focus-mode:not(.focus-composer-visible) #screen-keyboard {
  display: none;
}
.composer-draft-status[hidden] {
  display: none;
}
body:not(.focus-mode) main:has(> #workspace:not([hidden])) {
  padding-bottom: max(var(--component-gap), env(safe-area-inset-bottom));
}
.composer-draft-status {
  color: var(--muted-text);
}
.composer-draft-status:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}
.composer-draft-label {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.composer-draft-status[data-state='saving'] {
  color: var(--accent);
}
.composer-draft-status[data-state='error'] {
  color: var(--warning);
}
.composer-input:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
#prompt[data-feedback='error'] {
  box-shadow: none;
}
.composer-input:has(#prompt[data-feedback='error']) {
  border-color: var(--warning);
}
#prompt,
.prompt-measure {
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  margin: 0;
  outline: none;
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
}
.prompt-measure {
  position: fixed;
  top: 0;
  left: 0;
  height: 0;
  min-height: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
}
.composer-side {
  position: absolute;
  bottom: var(--block-inset);
  right: var(--block-inset);
  display: flex;
  flex-direction: column-reverse;
  width: max-content;
  max-width: calc(100% - 2 * var(--block-inset));
  z-index: 1;
}
#composer-tools {
  position: static;
  display: flex;
  max-width: 100%;
}
#composer-tools button {
  flex-shrink: 1;
  min-width: 0;
  margin: 0;
}
#composer-tools #compose-record[aria-pressed='true'] {
  box-shadow: inset 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
#compose-record:is([aria-pressed='true'], [aria-busy='true']) svg,
#request-tools button[aria-busy='true'] svg,
#queue-toggle[aria-busy='true'] svg {
  opacity: 1;
  filter: drop-shadow(0 0 4px currentColor);
}
#composer-attachments:empty {
  display: none;
}
#composer-attachments {
  position: static;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.composer-thumbnail {
  position: relative;
}
#composer-attachments > .composer-thumbnail {
  flex-basis: 48px;
  width: 48px;
}
.composer-thumbnail + .composer-thumbnail {
  border-left-color: var(--control-divider);
}
#composer-attachments .composer-image-remove {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: start center;
  width: 24px;
  height: var(--control-height);
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}
#composer-attachments .composer-image-remove:hover:not(:disabled) {
  background: var(--control-hover-surface);
  color: var(--control-text);
}
#composer-attachments .composer-image-remove:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
#composer-files {
  display: none;
}

#composer-attachments .composer-image-preview {
  display: block;
  justify-self: start;
  width: calc(100% - 24px);
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.speech-token-controls {
  display: flex;
  margin-top: 6px;
  border-radius: 7px;
  background: var(--control-background);
}
.speech-token-controls input {
  min-width: 0;
  border-radius: 7px 0 0 7px;
  border: 1px solid var(--border);
  padding: 10px 12px;
}
.speech-token-controls .speech-token-actions {
  border-radius: 0 7px 7px 0;
}
.speech-token-actions button:first-child {
  border-radius: 0;
}
.speech-token-controls button {
  margin: 0;
}

.speech-token-actions {
  grid-template-columns: 34px repeat(2, auto);
}
.speech-token-actions button:not(:first-child):not(:last-child) {
  border-radius: 0;
}
#speech-paste {
  display: grid;
  place-items: center;
  padding-inline: 0;
}
#speech-paste svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-field {
  position: relative;
}
#composer-resize {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 64px;
  height: 24px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  border-radius: 5px;
  color: var(--muted-text);
}
#composer-resize::after {
  content: '';
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.45;
}
#composer-resize:hover::after,
#composer-resize:focus-visible::after,
.composer-field[data-resizing] #composer-resize::after {
  opacity: 1;
  color: var(--accent);
}
#composer-resize:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

#composer-tools #compose-record[aria-busy='true'],
#request-tools button[aria-busy='true'],
#queue-controls #queue-toggle[aria-busy='true'] {
  position: relative;
  opacity: 1;
  color: var(--accent);
  background: var(--control-active-surface);
  box-shadow: inset 0 0 0 1px var(--accent);
  cursor: progress;
}
#compose-record[aria-busy='true']::before,
#request-tools button[aria-busy='true']::before,
#queue-toggle[aria-busy='true']::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 2px solid currentcolor;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: voice-processing 1.2s linear infinite;
  pointer-events: none;
}
@keyframes voice-processing {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #compose-record[aria-busy='true']::before,
  #request-tools button[aria-busy='true']::before,
  #queue-toggle[aria-busy='true']::before {
    animation: none;
  }
}

.credential-flow {
  margin: 8px 0 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#speech-settings {
  margin-top: var(--component-gap);
}
#speech-settings .settings-note {
  font-size: 12px;
}
#credential-status {
  margin: 8px 12px;
}
.credential-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}
.credential-table caption {
  text-align: left;
  color: var(--muted-text);
  padding-bottom: 12px;
}
.credential-table th,
.credential-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.credential-table th:first-child {
  width: 36%;
}
.credential-table th:nth-child(2) {
  width: 28%;
}
.credential-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted-text);
}
.credential-active {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 600px) {
  .credential-table,
  .credential-table tbody,
  .credential-table caption {
    display: block;
  }
  .credential-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
  .credential-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px;
  }
  .credential-table td {
    padding: 4px;
    border: 0;
    font-size: 13px;
  }
  .credential-table td:last-child {
    grid-column: 1 / -1;
    color: var(--muted-text);
  }
  .speech-token-controls {
    flex-wrap: wrap;
  }
  .speech-token-controls input {
    flex: 1 0 100%;
    border-radius: 7px 7px 0 0;
  }
  .speech-token-controls .speech-token-actions {
    width: 100%;
    grid-template-columns: 40px repeat(2, minmax(0, 1fr));
    border-radius: 0 0 7px 7px;
  }
  .speech-token-actions button:first-child {
    border-radius: 0 0 0 7px;
  }
  .speech-token-actions button:last-child {
    border-radius: 0 0 7px;
  }
}
