/* Shared rhythm for the five voice workspaces; keep hidden call shells untouched. */
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge, #page-voice-docs) {
  --voice-line: #dfe8e3;
  --voice-muted: #718078;
  max-width: 1440px;
  margin-inline: auto;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge, #page-voice-docs) > :is(.heading, .voice-debug-head, .target-model-head) {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 24px;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge, #page-voice-docs) > :is(.heading, .voice-debug-head, .target-model-head) h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -.5px;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge, #page-voice-docs) > :is(.heading, .voice-debug-head, .target-model-head) p {
  margin: 7px 0 0;
  color: var(--voice-muted);
  font-size: 13px;
  line-height: 1.7;
}
:is(#page-realtime, #page-voices, #page-knowledge) .panel,
#page-voice-debug :is(.voice-debug-form, .voice-debug-action, .voice-debug-session),
#page-voice-docs :is(.vd-toc, .vd-section) {
  border: 1px solid var(--voice-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 4px #233e3103, 0 8px 28px #233e3105;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge) .field > label {
  margin-bottom: 8px;
  color: #586b61;
  font-size: 13px;
  font-weight: 500;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge) .field > :is(input:not([type="checkbox"]):not([type="file"]), textarea) {
  box-sizing: border-box;
  border-radius: 10px;
  padding: 11px 14px;
  line-height: 1.6;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge) .usage-filter-trigger {
  min-height: 42px;
  border-radius: 10px;
}
:is(#page-voice-debug, #page-realtime, #page-voices, #page-knowledge) .btn {
  min-height: 40px;
  border-radius: 9px;
}

/* Configuration and calling are separate cards, with a compact idle state. */
#page-voice-debug .voice-debug-shell {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
#page-voice-debug .voice-debug-setup {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
#page-voice-debug .voice-debug-form { min-width: 0; padding: 24px; }
#page-voice-debug .voice-debug-form > p {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--voice-line);
  line-height: 1.7;
}
#page-voice-debug .voice-debug-form .form { gap: 20px; }
#page-voice-debug .voice-debug-grid { gap: 16px; }
#page-voice-debug .voice-debug-form textarea { min-height: 180px; resize: vertical; }
#page-voice-debug .voice-debug-form .field { min-width: 0; }
#page-voice-debug .voice-debug-form small { display: block; margin-top: 8px; line-height: 1.6; }
#page-voice-debug .voice-debug-decisions { gap: 10px 20px; padding: 14px; background: #f7faf8; }
#page-voice-debug .voice-debug-decisions label { margin: 0; }
#page-voice-debug .voice-debug-form .actions { padding-top: 18px; border-top: 1px solid var(--voice-line); }
#page-voice-debug .voice-debug-action {
  box-sizing: border-box;
  min-height: 300px;
  padding: 36px 24px;
  background: linear-gradient(160deg, #fff, #f0f7f3);
}
#page-voice-debug .voice-debug-mic {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  padding: 0;
  box-shadow: 0 0 0 10px #e8f2ed, 0 10px 24px #235c4526;
}
#page-voice-debug .voice-debug-mic:focus-visible { outline: 3px solid #377960; outline-offset: 13px; }
#page-voice-debug .voice-debug-action strong { margin-top: 30px; font-size: 17px; }
#page-voice-debug .voice-debug-action p { margin-top: 10px; line-height: 1.7; }
#page-voice-debug .voice-debug-error { overflow-wrap: anywhere; }
#page-voice-debug .voice-debug-session { min-height: 0; overflow: hidden; }
#page-voice-debug .voice-debug-chat { height: clamp(280px, 55vh, 540px); }
#page-voice-debug .voice-debug-controls { flex-wrap: wrap; }

/* Management cards use consistent headers, compact notices and bounded transcripts. */
#page-realtime > .panel { margin-bottom: 20px; padding: 24px; }
#page-realtime .voice-mgmt-transcript > .target-model-head { margin: 0 0 18px; gap: 8px 16px; flex-wrap: wrap; }
#page-realtime .voice-mgmt-transcript h3 { margin: 0; }
#page-realtime #voiceMgmtLiveTranscript {
  box-sizing: border-box;
  height: 320px;
  padding: 20px;
  border: 1px solid var(--voice-line);
  border-radius: 12px;
  background: #f7faf8;
}
#page-realtime #voiceMgmtLiveTranscript > .muted:only-child { margin: auto; text-align: center; }
#page-voices .voice-binding-panel { margin-bottom: 20px; }
#page-voices .voice-create-panel > h3,
#page-knowledge .knowledge-editor .panel > h3 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--voice-line);
}
#page-voices #voiceDropZone { border-color: #a7c3b5; border-radius: 12px; }
#page-voices .voice-record-actions { padding: 12px 14px; background: #f7faf8; border-radius: 10px; }
#page-voices .voice-list-header,
#page-knowledge .knowledge-list-header { padding-bottom: 18px; border-bottom: 1px solid var(--voice-line); }
:is(#page-voices, #page-knowledge) .table-wrap { border-radius: 12px; }
:is(#page-voices, #page-knowledge) tbody tr:hover { background: #f6faf8; }
#page-knowledge .knowledge-guidance-row { padding: 18px; border-radius: 12px; background: #f7faf8; }
#page-knowledge .knowledge-editor .panel > .form > .row { gap: 20px; }
#page-knowledge .knowledge-form-actions { padding-top: 16px; border-top: 1px solid var(--voice-line); }

/* A sticky table of contents and readable, independently framed chapters. */
#page-voice-docs .voice-docs-body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  max-width: 1240px;
}
#page-voice-docs .vd-toc {
  grid-column: 1;
  grid-row: 1 / span 10;
  align-self: start;
  position: sticky;
  top: 90px;
  margin: 0;
  padding: 20px;
}
#page-voice-docs .vd-toc h3 { margin-bottom: 14px; color: #355c49; }
#page-voice-docs .vd-toc ol { padding-left: 20px; }
#page-voice-docs .vd-toc li { padding: 6px 0; line-height: 1.5; }
#page-voice-docs .vd-toc a:hover { text-decoration: underline; }
#page-voice-docs .vd-section {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  padding: 24px;
  scroll-margin-top: 90px;
  overflow-wrap: anywhere;
}
#page-voice-docs .vd-section h2 { padding-bottom: 14px; margin-bottom: 18px; border-color: var(--voice-line); }
#page-voice-docs .vd-section pre { max-width: 100%; box-sizing: border-box; overflow-x: auto; border-radius: 10px; }
#page-voice-docs .vd-section table { display: block; max-width: 100%; overflow-x: auto; }

@media (max-width: 1000px) {
  #page-voice-debug .voice-debug-setup { grid-template-columns: minmax(0, 1fr); }
  #page-voice-debug .voice-debug-action { min-height: 240px; }
  #page-voice-docs .voice-docs-body { grid-template-columns: minmax(0, 1fr); }
  #page-voice-docs .vd-toc { position: static; grid-row: auto; }
  #page-voice-docs .vd-toc ol { columns: 2; column-gap: 32px; }
  #page-voice-docs .vd-section { grid-column: 1; }
}
@media (max-width: 600px) {
  #page-voice-debug .voice-debug-form,
  #page-realtime > .panel,
  #page-voice-docs .vd-section { padding: 16px; }
  #page-voice-debug .voice-debug-grid { grid-template-columns: minmax(0, 1fr); }
  #page-voice-debug .voice-debug-form textarea { min-height: 160px; }
  #page-voice-debug .voice-debug-action { min-height: 240px; }
  #page-voice-debug .voice-debug-form .actions .btn { width: 100%; }
  #page-knowledge .knowledge-guidance-row { padding: 12px; }
  #page-voice-docs .vd-toc ol { columns: 1; }
}
