/* Talk (realtime voice call): the pieces of the Control UI's stylesheet that the composer port
   (openclaw-composer.css) doesn't carry. Ported from base.css .sr-only, components.css .callout*,
   chat/layout.css .agent-chat__voice-turn*. The Control UI's --accent is its brand red; here the
   live call keeps ClawChats' accent and the user's turn tint uses the same relationship
   (accent over the page background). */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* components.css .callout (Talk's "Connecting voice input…" row and the error row's dismiss) */
.input-area .callout {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  user-select: text;
}

.input-area .callout__content {
  min-width: 0;
  flex: 1;
}

.input-area .callout__dismiss {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: currentColor;
  cursor: pointer;
}

.input-area .callout__dismiss:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.input-area .callout__dismiss svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* chat/layout.css: the live voice turns at the end of the transcript */
.agent-chat__voice-turns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 4px 8px;
  background: transparent;
}

/* Flex row, not grid: WebKit never re-runs shrink-to-fit sizing for a grid flex-item while streamed
   text grows, freezing the turn at first-delta width. */
.agent-chat__voice-turn {
  display: flex;
  gap: 8px;
  align-items: baseline;
  max-width: min(100%, 780px);
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border-color) 55%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-primary) 82%, transparent);
}

.agent-chat__voice-turn--user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent-color) 10%, var(--bg-primary));
}

.agent-chat__voice-turn--assistant {
  align-self: flex-start;
}

.agent-chat__voice-turn-speaker {
  flex: 0 0 auto;
  min-width: 56px;
  max-width: 200px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chat__voice-turn-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.agent-chat__voice-turn-stream {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-color);
  opacity: 0.7;
}

/* Settings → Voice (settings/talk-settings.js): status badge, provider segmented control, stacked row */
.settings-view .talk-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
.settings-view .talk-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--settings-line-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.settings-view .talk-status--ok { color: #22c55e; border-color: color-mix(in srgb, #22c55e 40%, transparent); }
.settings-view .talk-status--warn { color: #f59e0b; border-color: color-mix(in srgb, #f59e0b 40%, transparent); }
.settings-view .talk-row--stacked { flex-direction: column; align-items: stretch; }
.settings-view .talk-row--stacked .settings-row__control { justify-content: flex-start; width: 100%; max-width: 100%; }
.settings-view .talk-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--settings-line-strong);
  border-radius: 10px;
  background-color: var(--settings-control);
}
.settings-view .talk-segmented__btn {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.settings-view .talk-segmented__btn:hover:not(:disabled) { color: var(--text-primary); }
.settings-view .talk-segmented__btn--active { background: color-mix(in srgb, var(--text-primary) 12%, transparent); color: var(--text-primary); font-weight: 600; }
.settings-view .talk-segmented__btn:disabled { opacity: 0.55; cursor: default; }
.settings-view .talk-segmented__btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent-color) 60%, transparent); outline-offset: 1px; }
