/* Only the Audio settings surface; other tabs and media geometry are untouched. */
.voice-settings { --voice-line:rgba(var(--theme-accent-rgb,105,134,169),0.22); --voice-muted:var(--theme-text-secondary,#a9bdd6); container-type:inline-size; }
.call-shell:has(.voice-settings) { grid-template-rows:112px minmax(0,1fr) auto; }
/* The empty popover host must not reserve a fourth grid row under this panel. */
.call-shell:has(.voice-settings) > #participant-volume-host { display:contents; }
.call-workspace.panel-open:has(> .voice-settings) { grid-template-columns:40px 114px 16px minmax(0,1fr) 20px; }
.call-workspace.panel-open > .voice-settings { grid-column:4; grid-row:1; width:100%; height:100%; max-height:none; z-index:2; align-self:stretch; }
/* Hidden media must not allocate an implicit grid column behind settings.
   Keep the DOM and media ownership intact while excluding it from layout. */
#app > .call-shell > .call-workspace:has(> .voice-settings) > .call-main { display:none; }
.home-settings-overlay .voice-settings { width:min(1100px,calc(100vw - 40px)); height:min(1000px,calc(100dvh - 40px)); }
.voice-settings .panel-header { display:flex; gap:18px; }
.voice-settings .panel-header h2 { margin:0; font-size:24px; }
.voice-settings .panel-header > small { margin-left:auto; font-size:12px; color:var(--voice-muted); text-align:right; }
.voice-settings .icon-button { -webkit-app-region:no-drag; flex:none; }
.voice-settings .settings-tabs { display:flex; gap:8px; padding:0 16px; }
.voice-settings .settings-tabs button { min-width:110px; min-height:45px; font-size:14px; }
.voice-settings .settings-tabs button.is-active { border-color:var(--theme-accent,#884dff); background:var(--theme-selection,#27204f); }
.voice-settings .voice-fields { display:flex; flex-direction:column; gap:14px; padding:18px; }
.voice-fields > * { flex-shrink:0; }
.voice-settings .button-primary { color:var(--theme-on-primary,#fff); background:linear-gradient(110deg,var(--theme-primary,#753bfa),var(--theme-primary,#684aff)); }
.voice-top { display:grid; grid-template-columns:1.05fr 1fr; gap:14px; }
.voice-card { min-width:0; padding:16px; border:1px solid var(--voice-line); border-radius:14px; background:rgba(var(--theme-surface-card-rgb,7,18,27),0.64); }
.voice-card h3 { margin:0 0 12px; font-size:17px; }
.voice-field { display:flex; flex-direction:column; gap:7px; min-width:0; color:var(--voice-muted); font-size:13px; }
.voice-field > span { display:flex; justify-content:space-between; gap:8px; }
.voice-field select { width:100%; min-width:0; }
.voice-settings select { color:var(--theme-text-primary,#f1f5ff); padding:0 12px; }
.voice-settings input[type=range] { width:100%; margin:9px 0; accent-color:var(--theme-accent,#8854ff); }
.voice-device-row { display:grid; grid-template-columns:minmax(0,1fr) 36px; align-items:end; gap:8px; margin-bottom:14px; }
.voice-test-card { display:flex; gap:18px; align-items:center; border:1px solid var(--voice-line); background:rgba(var(--theme-surface-card-rgb,21,32,46),0.48); border-radius:12px; padding:15px; margin-top:14px; }
.voice-test-symbol { display:grid; place-items:center; flex:none; width:72px; height:72px; border:2px solid var(--theme-accent,#7041db); border-radius:50%; color:var(--theme-accent,#9564ff); }
.voice-test-symbol svg { width:30px; height:30px; }
.voice-test-card p { color:var(--voice-muted); margin:6px 0 12px; line-height:1.45; font-size:13px; }
.voice-test-actions { display:flex; flex-wrap:wrap; gap:6px; }
.voice-test-actions .button { min-height:36px; padding:0 16px; }
#voice-test-status { display:block; font-size:12px; color:var(--theme-accent,#b8a8ff); margin-top:5px; }
.voice-level-title { display:flex; justify-content:space-between; gap:12px; }
.voice-level-title h3 small { font-size:12px; font-weight:400; color:var(--voice-muted); }
#voice-capture-status { font-size:11px; color:var(--theme-success-text,#75eec1); text-align:right; }
.voice-bars { display:flex; align-items:stretch; gap:5px; height:82px; margin:12px 0 18px; }
.voice-bars i { flex:1; border-radius:3px; background:var(--theme-surface-card,#1a293b); }
.voice-bars i.lit { background:linear-gradient(var(--theme-success,#68ebbb),var(--theme-success,#2ad994)); }
.voice-meter-row { display:grid; grid-template-columns:130px minmax(0,1fr) 70px; gap:10px; align-items:center; margin:10px 0; font-size:12px; color:var(--voice-muted); }
.voice-meter-row output { text-align:right; }
.voice-settings meter { width:100%; height:12px; display:block; }
.voice-settings meter::-webkit-meter-bar { background:var(--theme-surface-card,#1e2c3d); border:1px solid var(--theme-border-subtle,#304259); border-radius:7px; }
.voice-settings meter::-webkit-meter-optimum-value { background:var(--theme-success,#46e5a9); border-radius:7px; }
#voice-input-meter::-webkit-meter-optimum-value,#voice-peak-meter::-webkit-meter-optimum-value { background:var(--theme-accent,#844cff); }
#voice-noise-meter::-webkit-meter-optimum-value { background:var(--theme-surface-interactive,#788aa5); }
.voice-output-meters { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:20px; }
.voice-output-meters > div { padding:12px; border:1px solid var(--voice-line); border-radius:11px; font-size:12px; }
.voice-output-meters output { display:block; text-align:right; margin:4px 0 7px; color:var(--voice-muted); }
#voice-gate-status { display:block; margin-top:10px; color:var(--voice-muted); font-size:11px; }
.voice-profiles { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.voice-profile { min-height:102px; display:flex; align-items:center; gap:13px; padding:14px; border:1px solid var(--voice-line); border-radius:12px; background:var(--theme-surface-card,#0d1b28); color:var(--theme-text-primary,#eaf1ff); text-align:left; cursor:pointer; }
.voice-profile > svg { width:30px; height:30px; flex:none; color:var(--theme-text-secondary,#bed1ec); }
.voice-profile strong { font-size:13px; }
.voice-profile small { display:block; margin-top:6px; color:var(--voice-muted); font-size:12px; line-height:1.4; }
.voice-profile.selected { border-color:var(--theme-accent,#9653ff); box-shadow:inset 0 0 0 1px var(--theme-accent-shadow,#9653ff); background:linear-gradient(125deg,var(--theme-selection,#2c2057),var(--theme-selection,#17233c)); }
.voice-processing,.voice-advanced-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.voice-control { display:flex; flex-direction:column; gap:8px; min-width:0; justify-content:center; border:1px solid var(--voice-line); border-radius:12px; padding:14px 18px; background:rgba(var(--theme-surface-card-rgb,16,30,42),0.55); }
.voice-control strong { font-size:13px; }
.voice-control small,.voice-advanced small { display:block; color:var(--voice-muted); font-size:12px; line-height:1.4; }
.voice-toggle { flex-direction:row; justify-content:space-between; align-items:center; gap:15px; }
.voice-settings .voice-toggle input { appearance:none; width:46px; min-width:46px; height:26px; min-height:26px; border-radius:20px; background:var(--theme-input,#2b3749); cursor:pointer; position:relative; }
.voice-settings .voice-toggle input::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:var(--theme-knob,#f2edff); }
.voice-settings .voice-toggle input:checked { background:var(--theme-accent,#8045fa); }
.voice-settings .voice-toggle input:checked::after { left:23px; }
.voice-inline { display:flex; gap:8px; align-items:center; color:var(--voice-muted); font-size:12px; }
.voice-settings .voice-inline input { min-height:16px; width:16px; accent-color:var(--theme-accent,#8650ff); }
.voice-advanced { border:1px solid var(--voice-line); border-radius:12px; margin-top:12px; }
.voice-advanced summary { display:flex; align-items:center; gap:16px; cursor:pointer; padding:16px; }
.voice-advanced summary > svg { width:25px; height:25px; }
.voice-advanced summary > svg:last-child { margin-left:auto; width:18px; }
.voice-advanced summary small { margin-top:5px; }
.voice-advanced-grid { padding:0 18px 18px; }
.voice-footer { display:flex; justify-content:space-between; gap:12px; padding:4px; }
#voice-diagnostics { white-space:pre-wrap; overflow-wrap:anywhere; margin:0; color:var(--voice-muted); font-size:12px; }
@media(max-width:1100px) {
  .voice-profiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .voice-top { grid-template-columns:1fr; }
  .voice-levels { min-height:290px; }
}
@media(max-width:760px) {
  .call-shell:has(.voice-settings) { grid-template-rows:70px minmax(0,1fr) auto; }
  .call-workspace.panel-open:has(> .voice-settings) { grid-template-columns:64px minmax(0,1fr); }
  .call-workspace.panel-open > .voice-settings { grid-column:2; }
  .voice-settings .panel-header { padding:12px; gap:8px; }
  .voice-settings .panel-header h2 { font-size:19px; }
  .voice-settings .panel-header > small { font-size:10px; }
  .voice-settings .settings-tabs { overflow-x:auto; padding:0 8px; gap:0; }
  .voice-settings .settings-tabs button { min-width:72px; }
  .voice-settings .voice-fields { padding:10px; }
  .voice-processing,.voice-advanced-grid { grid-template-columns:1fr; }
  .voice-profile { padding:10px; }
  .voice-profile > svg,.voice-test-symbol { display:none; }
  .voice-meter-row { grid-template-columns:105px minmax(0,1fr) 66px; gap:5px; }
  .voice-footer { flex-wrap:wrap; }
}

/* The settings pane may be narrow even when the window itself is wide. */
@container (max-width:1100px) {
  .voice-top { grid-template-columns:minmax(0,1fr); }
  .voice-profiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container (max-width:680px) {
  .voice-processing,.voice-advanced-grid { grid-template-columns:minmax(0,1fr); }
}
@container (max-width:480px) {
  .voice-profiles,.voice-output-meters { grid-template-columns:minmax(0,1fr); }
  .voice-test-symbol { display:none; }
  .voice-footer { flex-wrap:wrap; }
  .voice-meter-row { grid-template-columns:minmax(0,1fr) auto; }
  .voice-meter-row meter { grid-column:1 / -1; grid-row:2; }
  .voice-settings .settings-tabs { flex-wrap:wrap; overflow-x:visible; }
  .voice-settings .settings-tabs button { flex:1 1 calc(50% - 8px); min-width:0; }
}

/* DeepFilterNet voice surface. */
.voice-engine-card { padding:22px; border:1px solid var(--voice-line); border-radius:18px; background:linear-gradient(120deg,rgba(var(--theme-accent-rgb,105,134,169),.13),rgba(var(--theme-surface-card-rgb,7,18,27),.5)); }
.voice-engine-heading { display:flex; align-items:center; gap:16px; }
.voice-engine-icon { display:grid; place-items:center; width:56px; height:56px; flex:none; border-radius:16px; background:rgba(var(--theme-accent-rgb,105,134,169),.14); color:var(--theme-accent); }
.voice-engine-icon svg { width:30px; height:30px; }
.voice-engine-heading h3 { margin:5px 0 7px; font-size:23px; letter-spacing:-.5px; }
.voice-engine-heading small { font-size:10px; letter-spacing:2px; color:var(--voice-muted); }
.voice-engine-heading p { margin:0; color:var(--voice-muted); font-size:13px; line-height:1.5; }
.voice-local-badge { margin-left:auto; padding:6px 10px; border:1px solid var(--voice-line); border-radius:20px; font-size:11px; color:var(--voice-muted); }
.voice-engine-status { margin-top:17px; padding-top:13px; border-top:1px solid var(--voice-line); font-size:12px; color:var(--theme-text-secondary); }
.voice-engine-warning { margin:12px 0 0; font-size:12px; line-height:1.5; color:var(--theme-warning,#ffd170); }
.voice-neural-strength { padding:15px; border:1px solid var(--voice-line); border-radius:12px; background:rgba(var(--theme-accent-rgb,105,134,169),.06); }
.voice-engine-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.voice-engine-metrics > span { display:flex; flex-direction:column; gap:6px; padding:12px; border:1px solid var(--voice-line); border-radius:10px; font-size:12px; color:var(--voice-muted); }
.voice-engine-metrics b { font-weight:600; color:var(--theme-text-primary); overflow-wrap:anywhere; }
.voice-settings .voice-sliders { grid-template-columns:1fr; }
@container (max-width:520px) {
  .voice-engine-card { padding:16px; }
  .voice-engine-heading { gap:10px; align-items:flex-start; }
  .voice-engine-icon { width:40px; height:40px; border-radius:12px; }
  .voice-engine-heading h3 { font-size:19px; }
  .voice-local-badge { display:none; }
  .voice-engine-metrics { grid-template-columns:1fr; }
}

/* Keep the compact-panel geometry safeguards, with room for DeepFilter controls. */
#app > .call-shell > .call-workspace.panel-open > .settings-popover.voice-settings[class] { --media-settings-width:1100px; }
.settings-popover.voice-settings .voice-main-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:12px; align-items:start; }
.settings-popover.voice-settings .voice-main-grid .voice-devices,
.settings-popover.voice-settings .voice-main-grid .voice-test-layout { grid-template-columns:minmax(0,1fr); }
.settings-popover.voice-settings .voice-main-grid .voice-levels { min-height:0; border-left:0; border-top:1px solid var(--voice-line); padding:14px 0 0; }
.settings-popover.voice-settings .voice-main-grid .voice-processing { display:grid; grid-template-columns:minmax(0,1fr); }
.settings-popover.voice-settings .voice-main-grid .voice-processing-row { grid-template-columns:minmax(0,1fr); gap:8px; }
.settings-popover.voice-settings .voice-main-grid .voice-neural-strength { padding:12px; }
.settings-popover.voice-settings .voice-main-grid .voice-sliders { margin-top:0; }
@container media-settings (max-width:850px) {
  .settings-popover.voice-settings .voice-main-grid { grid-template-columns:minmax(0,1fr); }
}

.settings-popover.voice-settings .voice-engine-card { padding:16px 20px; }
.settings-popover.voice-settings .voice-engine-status { margin-top:10px; padding-top:10px; }
@container media-settings (min-width:960px) {
  .settings-popover.voice-settings .voice-card .voice-profiles { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(min-width:761px) {
  #app > .call-shell > .call-workspace.panel-open > .settings-popover.voice-settings[class][aria-label] { height:min(100%,800px); }
}
