/* Robot preferences own their save action; camera activation is session-only. */
#wf-settings-tab-robot .wf-robot-settings-icon { display: inline-grid; place-items: center; inline-size: 28px; block-size: 28px; }
#wf-settings-tab-robot .wf-robot-settings-icon svg { inline-size: 22px; block-size: 22px; }
#stab-robot { min-inline-size: 0; color: var(--text); }
#stab-robot .wf-robot-settings-hint,
#stab-robot .wf-robot-camera-hint { margin: 0; color: var(--text2); font-size: 13px; line-height: 1.7; }
#stab-robot .wf-robot-settings-preview { display: grid; place-items: center; min-block-size: 96px; margin-block: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--brand-primary) 4%, var(--card)); }
#stab-robot .wf-robot-settings-preview .wf-robot-display { inline-size: min(100%, 240px); block-size: 90px; }
#stab-robot .wf-robot-settings-preview .wf-robot-face { max-block-size: 90px; }
#stab-robot .wf-robot-preferences { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
#stab-robot .wf-robot-preference { display: flex; align-items: center; gap: 12px; min-block-size: 48px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); font-size: 13px; cursor: pointer; }
#stab-robot .wf-robot-preference input { flex: 0 0 20px; inline-size: 20px; block-size: 20px; accent-color: var(--brand-primary); }
#stab-robot .wf-robot-sensitivity { display: grid; gap: 8px; font-size: 13px; }
#stab-robot .wf-robot-sensitivity select { box-sizing: border-box; inline-size: 100%; min-block-size: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; background: var(--card); color: var(--text); font: inherit; }
#stab-robot .wf-robot-settings-save { display: grid; gap: 6px; margin-block-start: 16px; }
html body #stab-robot :is(.wf-robot-settings-save-button, .wf-robot-camera-toggle) { display: flex; align-items: center; justify-content: center; min-block-size: 46px; inline-size: 100%; margin: 0; padding: 10px 14px; border: 1px solid var(--brand-primary); border-radius: 12px; background: var(--brand-primary); color: #fff; font: inherit; font-size: 13px; font-weight: 650; line-height: 1.4; cursor: pointer; box-shadow: none; white-space: normal; }
#stab-robot :is(.wf-robot-settings-save-button, .wf-robot-camera-toggle):focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
#stab-robot .wf-robot-settings-save-button:disabled { opacity: .6; cursor: wait; }
#stab-robot .wf-robot-settings-feedback { min-block-size: 20px; margin: 0; color: var(--text2); font-size: 12px; line-height: 1.6; }
#stab-robot :is(.wf-robot-movement-settings,.wf-robot-camera-settings) { min-inline-size: 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
#stab-robot :is(.wf-robot-movement-settings,.wf-robot-camera-settings) summary { color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.6; cursor: pointer; }
#stab-robot :is(.wf-robot-movement-settings,.wf-robot-camera-settings)[open] > :not(summary) { margin-block-start: 12px; }
#stab-robot :is(.wf-robot-movement-settings,.wf-robot-camera-settings):not([open]) > :not(summary) { display: none; }
#stab-robot .wf-robot-movement-settings .wf-robot-preference { border: 0; padding-inline: 0; }
#stab-robot .wf-robot-camera-settings { margin-block-start: 16px; }
#stab-robot .wf-robot-camera-preview { display: block; inline-size: min(100%, 176px); aspect-ratio: 4 / 3; justify-self: center; object-fit: cover; border-radius: 12px; background: var(--card); transform: scaleX(-1); }
#stab-robot .wf-robot-camera-preview[hidden] { display: none; }
html body #stab-robot .wf-robot-camera-toggle { background: color-mix(in srgb, var(--brand-primary) 8%, var(--card)); color: var(--text); border-color: color-mix(in srgb, var(--brand-primary) 30%, var(--border)); }
html body #stab-robot .wf-robot-camera-toggle[aria-checked="true"] { background: var(--brand-primary); color: #fff; }
#stab-robot .wf-robot-camera-status { margin: 0; color: var(--text2); font-size: 12px; line-height: 1.7; }
#stab-robot .wf-robot-voice-settings { margin-block: 12px 16px; }
#stab-robot .wf-robot-voice-settings[hidden] { display: none; }
#stab-robot .wf-robot-voice-list { display: grid; gap: 10px; }
#stab-robot .wf-robot-voice-row { min-inline-size: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--brand-primary) 4%, var(--card)); }
#stab-robot .wf-robot-voice-row strong { color: var(--text); font-size: 14px; }
html body #stab-robot .wf-robot-voice-action { max-inline-size: 100%; min-block-size: 44px; margin: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 12px; line-height: 1.4; white-space: normal; cursor: pointer; }
#stab-robot .wf-robot-voice-action:disabled { opacity: .55; cursor: default; }
#stab-robot .wf-robot-voice-status { grid-column: 1 / -1; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.6; }
#stab-robot .wf-robot-engine-status { grid-column: 1 / -1; margin: 0; color: var(--text2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#stab-robot .wf-robot-engine-status[data-state="ready"] { color: var(--brand-primary); font-weight: 600; }
#stab-robot .wf-robot-engine-status[data-state="error"] { padding-inline-start: 10px; border-inline-start: 3px solid var(--danger,#c75050); color: var(--text); }
#stab-robot :is(.wf-robot-voice-action,.wf-robot-engine-status)[hidden] { display: none !important; }
#stab-robot .wf-robot-voice-row progress { grid-column: 1 / -1; inline-size: 100%; block-size: 7px; accent-color: var(--brand-primary); }
#stab-robot .wf-robot-voice-row progress[hidden] { display: none; }
#stab-robot .wf-robot-voice-links { grid-column: 1 / -1; display: flex; gap: 12px; }
#stab-robot .wf-robot-voice-links a { color: var(--brand-primary); font-size: 10px; line-height: 1.6; }
#stab-robot .wf-robot-speech-controls { min-inline-size: 0; padding-block-end: 6px; }
#stab-robot .wf-robot-speech-controls h3 { margin: 0 0 10px; font-size: 15px; }
#stab-robot .wf-robot-selected-voice { display: inline-block; padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand-primary) 10%, var(--card)); text-align: start; color: var(--brand-primary); font-size: 12px; font-weight: 600; }
#stab-robot .wf-robot-speech-range { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-block: 14px; font-size: 13px; }
#stab-robot .wf-robot-speech-range input { grid-column: 1 / -1; min-inline-size: 0; width: 100%; margin-inline: 0; accent-color: var(--brand-primary); direction: ltr; }
#stab-robot .wf-robot-speech-range output { font-variant-numeric: tabular-nums; direction: ltr; }
#stab-robot .wf-robot-speech-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 14px; }
#stab-robot .wf-robot-speech-actions button { flex: 1 1 140px; max-inline-size: 100%; margin: 0; padding: 10px 12px; min-block-size: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 12px; line-height: 1.5; white-space: normal; cursor: pointer; }
#stab-robot .wf-robot-speech-actions [data-wf-reading-preview="true"] { border-color: var(--brand-primary); background: var(--brand-primary); color: #fff; font-weight: 650; }
#stab-robot :is(.wf-robot-speech-actions button,.wf-robot-voice-action,summary):focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
#stab-robot .wf-robot-recording-hint { margin: 4px 0 0; color: var(--text2); font-size: 11px; line-height: 1.7; }
#stab-robot .wf-robot-reading-preview-status { min-block-size: 20px; margin: 6px 0 0; color: var(--text2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#stab-robot .wf-robot-voice-row[data-backend="reference"] { border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border)); }
#stab-robot .wf-robot-reference-hint { grid-column: 1 / -1; margin: 4px 0; color: var(--text2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#stab-robot .wf-robot-reference-hint[hidden] { display: none; }
@media (max-width: 480px) {
  #stab-robot .wf-robot-speech-actions button { flex: 1 1 100%; }
  #stab-robot .wf-robot-voice-row[data-backend="reference"] { grid-template-columns: minmax(0, 1fr); }
  #stab-robot .wf-robot-voice-row[data-backend="reference"] .wf-robot-voice-action { justify-self: start; }
}

#stab-robot .wf-robot-speech-actions button[data-action] {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:44px;
}
#stab-robot .wf-robot-speech-actions button[data-action]::before {
  content:"";display:inline-block;flex:none;box-sizing:border-box;width:14px;height:14px;
}
#stab-robot .wf-robot-speech-actions button:is([data-action="play"],[data-action="resume"])::before {
  background:currentColor;clip-path:polygon(10% 0%,100% 50%,10% 100%);
}
#stab-robot .wf-robot-speech-actions button[data-action="pause"]::before {
  border-inline:4px solid currentColor;
}
#stab-robot .wf-robot-speech-actions button[data-action="stop"]::before {
  width:12px;height:12px;border-radius:2px;background:currentColor;
}
#stab-robot .wf-robot-speech-actions [data-wf-reading-preview] {
  background:var(--brand-primary);border-color:var(--brand-primary);color:#fff;
}
#stab-robot .wf-robot-speech-actions .wf-robot-saved-preview {min-height:44px;}
@media(max-width:480px) {
  #stab-robot .wf-robot-speech-actions button[data-action] {flex:1 1 auto;}
  #stab-robot .wf-robot-speech-actions .wf-robot-saved-preview {flex:1 1 100%;}
}
#stab-robot .wf-robot-rate-preview {display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin-block:-4px 12px;}
#stab-robot .wf-robot-rate-preview p {flex:1 1 160px;margin:0;color:var(--text2);font-size:12px;line-height:1.6;}
#stab-robot .wf-robot-restore-rate {min-height:44px;max-width:100%;padding:7px 10px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--ui-accent);font:inherit;font-size:12px;cursor:pointer;}
#stab-robot .wf-robot-restore-rate:disabled {opacity:.55;cursor:default;}
#stab-robot .wf-robot-restore-rate:focus-visible {outline:2px solid var(--brand-primary);outline-offset:2px;}
