/* Approved Studio shell. Existing controls retain their IDs, handlers and permissions. */
.studio-shell { background:var(--bg); }
.studio-shell .app-shell { padding:0; margin:0 0 0 58px; width:calc(100% - 58px); max-width:none; }
.studio-rail-brand { position:fixed; left:0; top:0; width:58px; height:76px; display:grid; place-items:center; border-right:1px solid var(--line); background:var(--bg); z-index:10; }
.studio-rail-brand img { width:28px; height:28px; object-fit:contain; }
.studio-shell .topbar { display:none; }
.studio-shell .studio-rail-brand { border:0; border-right:1px solid var(--line); cursor:pointer; }
.studio-shell .studio-rail-brand:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; }
.studio-shell .studio-rail-actions { position:fixed; left:0; bottom:12px; z-index:20; width:58px; padding:8px 6px; border-top:1px solid var(--line); display:flex; flex-direction:column; align-items:center; gap:6px; }
.studio-shell .studio-rail-actions .topbar__meta { display:flex; flex-direction:column; gap:6px; }
.studio-shell .studio-rail-actions .comment-toolbar { display:contents; }
.studio-shell .studio-rail-actions .identity,.studio-shell .studio-rail-actions #apiStatusBadge { display:none; }
.studio-shell .studio-rail-actions button { display:flex; align-items:center; justify-content:center; width:40px; height:36px; min-height:36px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--muted); }
.studio-shell .studio-rail-actions button:hover { color:var(--text); background:var(--surface-hover); }
.studio-shell .studio-rail-actions #manualCallButton { color:var(--accent-text); background:var(--accent-soft); }
.studio-shell .studio-rail-actions button:disabled { pointer-events:auto; }
.studio-shell .studio-rail-actions [hidden] { display:none!important; }
.studio-rail-tooltip { position:fixed; z-index:1000; pointer-events:none; max-width:240px; padding:9px 12px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--text); font-size:11px; font-weight:500; line-height:1.4; box-shadow:0 4px 12px rgb(0 0 0 / .14),0 16px 40px rgb(0 0 0 / .12); opacity:0; transform:translate(-4px,-50%); transition:opacity 100ms ease,transform 140ms cubic-bezier(.2,.8,.2,1); }
.studio-rail-tooltip.is-visible { opacity:1; transform:translate(0,-50%); }
.studio-rail-tooltip.below { transform:translateY(-4px); }
.studio-rail-tooltip.below.is-visible { transform:translateY(0); }
.studio-shell .workspace-brand__mark { display:none; }
.studio-shell .workspace-brand__name { font-size:12px; }
.studio-shell #workspaceTitle { font-size:10px; }
.studio-shell .topbar__meta { gap:8px; }
.studio-shell .identity strong { font-size:11px; }
.studio-shell .button { border-radius:5px; min-height:32px; font-size:12px; padding:5px 10px; box-shadow:none; }
.studio-shell .topbar .button,.studio-shell .context-panel .workspace-search-toggle { background:var(--surface); color:var(--text); border:1px solid var(--line); }
.studio-shell .icon-button { border-radius:5px; }
.studio-shell .badge { font-size:10px; padding:3px 7px; border-radius:4px; }
.studio-shell .eyebrow { font-size:10px; font-weight:500; }
.studio-shell .studio-icon { display:inline-flex; align-items:center; flex-shrink:0; }
.studio-shell .studio-icon svg { width:18px; height:18px; }
.studio-shell .app-navigation,.studio-shell .admin-navigation {
  position:fixed; inset:76px auto auto 0; z-index:10; display:flex; flex-direction:column; min-height:0;
  align-items:center; flex-wrap:nowrap; gap:10px; width:58px; margin:0; padding:18px 6px;
  border:0; border-right:1px solid var(--line); border-radius:0; background:var(--bg); overflow:visible;
}
.studio-shell #adminWorkspace .admin-navigation { margin:0; }
.studio-shell .app-navigation__brand { display:none; }
.studio-shell .app-navigation button,.studio-shell #adminWorkspace .admin-navigation button {
  width:40px; height:40px; min-height:40px; padding:0; margin:0; display:flex; justify-content:center; align-items:center;
  border:0; background:transparent; color:var(--muted); border-radius:6px;
}
.studio-shell .studio-nav-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.studio-shell .app-navigation button.is-active,.studio-shell #adminWorkspace .admin-navigation button[aria-pressed=true] { background:var(--accent-soft); color:var(--accent-text); }
.studio-shell .app-navigation button:hover,.studio-shell #adminWorkspace .admin-navigation button:hover { background:var(--surface-hover); color:var(--text); }
.studio-shell .workspace-toolbar { min-height:52px; padding:0 18px; background:var(--surface); border-bottom:1px solid var(--line); }
.studio-shell .listener-strip { width:100%; padding:0; gap:12px; }
.studio-shell .workspace-toolbar #listenerStatusText { display:block; max-width:240px; font-size:11px; }
.studio-shell .workspace-toolbar .listener-pulse { display:block; }
.studio-shell .call-selectors .compact-field span { font-size:10px; }
.studio-shell .compact-field select { font-size:11px; max-width:240px; }
.studio-shell .call-workspace { padding:0; gap:0; }
.studio-shell .workspace-products { flex-shrink:0; min-height:62px; padding:10px 18px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:var(--bg); }
.studio-shell .workspace-section-heading h2 { font-size:10px; text-transform:uppercase; font-weight:500; letter-spacing:.06em; }
.studio-shell .workspace-product-list { gap:10px; }
.studio-shell .workspace-product,.studio-shell .workspace-product:first-child { flex:0 0 240px; padding:9px 14px; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.studio-shell .workspace-product:first-child { border-color:color-mix(in srgb,var(--accent),transparent 65%); }
.studio-shell .workspace-product h3 { font-size:11px; }
.studio-shell .workspace-product .priority { display:none; }
.studio-shell .product-data,.studio-shell .product-outcome { font-size:10px; }
.studio-shell .call-workspace .call-grid { gap:0; grid-template-columns:clamp(270px,21vw,340px) minmax(0,1fr) clamp(300px,24vw,410px); }
.studio-shell .call-grid .panel { border:0; border-radius:0; box-shadow:none; height:100%; padding:18px; }
.studio-shell .call-grid .context-panel { display:flex; flex-direction:column; gap:0; background:var(--bg); border-right:1px solid var(--line); overflow-y:auto; scrollbar-gutter:stable; }
.studio-shell .context-panel .panel__header { flex-shrink:0; padding:0; margin-bottom:8px; }
.studio-shell .context-panel .panel__header>div:first-child { display:block; }
.studio-shell #leadTitle { font-size:14px; line-height:1.4; }
.studio-shell #leadCompany { display:block; font-size:10px; margin-top:3px; }
.studio-shell #workspaceDealTitle { font-size:10px; color:var(--muted); margin:0 0 10px; }
.studio-shell #leadContextList { display:grid; grid-template-columns:1fr 1fr; padding:0; margin:0 0 12px; gap:8px 14px; flex-shrink:0; }
.studio-shell #leadContextList>div { padding:0; margin:0; border:0; display:block; }
.studio-shell #leadContextList>div:last-child { display:none; }
.studio-shell #leadContextList dt { font-size:9px; color:var(--faint); }
.studio-shell #leadContextList dd { margin:3px 0 0; font-size:10px; line-height:1.35; }
.studio-shell #previousContacts:empty { display:none; }
.studio-shell .context-panel .call-subsection { display:flex; flex-direction:column; flex:1; min-height:max-content; padding:12px 0 0; margin:0; border-top:1px solid var(--line); }
.studio-shell .context-panel .subsection-heading { margin:0 0 8px; flex-shrink:0; }
.studio-shell #qualificationTitle { font-size:12px; }
.studio-shell #qualificationList { display:grid; grid-template-rows:repeat(var(--studio-fact-count,8),minmax(min-content,1fr)); align-content:stretch; flex:1; min-height:0; gap:0; }
.studio-shell .workspace-fact { position:relative; min-height:0; display:flex; flex-direction:column; justify-content:center; padding:4px 8px; border:0; border-bottom:1px solid var(--line); border-radius:4px; transition:background 140ms ease; }
.studio-shell .workspace-fact:hover,.studio-shell .workspace-fact:focus-within { background:var(--accent-soft); }
.studio-shell .workspace-fact header { font-size:10px; line-height:1.3; color:var(--muted); display:flex; flex-wrap:nowrap; }
.studio-shell .workspace-fact header strong { font-weight:400; }
.studio-shell .workspace-fact .fact-state { font-size:9px; line-height:1.3; color:var(--faint); }
.studio-shell .workspace-fact .fact-state { white-space:nowrap; }
.studio-shell .workspace-fact p { font-size:12px; line-height:1.4; margin:4px 0 0; padding-right:20px; display:block; }
.studio-shell .workspace-fact p small { font-size:9px; margin-left:8px; }
.studio-shell .workspace-fact.is-required.is-missing p,.studio-shell .workspace-fact.is-required.is-missing .fact-state { color:var(--warning); }
.studio-fact-edit { position:absolute; right:6px; bottom:6px; width:22px; height:22px; opacity:0; }
.studio-shell .workspace-fact:hover .studio-fact-edit,.studio-shell .workspace-fact:focus-within .studio-fact-edit { opacity:1; }
.studio-shell .call-grid .coach-panel[data-view=live] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:12px; padding:24px clamp(22px,2.5vw,48px); container-type:size; overflow:hidden; }
.studio-shell .coach-panel[data-view=live]>.panel__header { grid-row:1; margin:0; align-self:start; }
.studio-shell #workspaceCoachTitle { font-size:12px; margin-top:5px; }
/* Natural flow keeps arbitrarily long cues out of neighboring landmarks. */
.studio-shell .coach-panel[data-view=live]>.workspace-cue-sequence { grid-row:2; display:flex; flex-direction:column; justify-content:safe center; min-height:0; gap:18px; padding:18px 0; overflow-y:auto; scrollbar-gutter:stable; }
.studio-shell .previous-cue { align-self:stretch; max-width:480px; max-height:clamp(64px,18cqh,144px); overflow-y:auto; overflow-wrap:anywhere; font-size:12px; line-height:1.6; }
.studio-shell .previous-cue span,.studio-shell .return-to-script span { font-size:9px; font-weight:500; margin-bottom:7px; }
.studio-shell .coach-panel[data-view=live] .coach-answers { align-self:stretch; display:flex; flex-direction:column; gap:16px; flex:none; }
.studio-shell .script-guide .subsection-heading { align-items:center; flex-wrap:wrap; gap:8px; }
.studio-shell #scriptGuideTitle { font-size:10px; white-space:normal; overflow-wrap:anywhere; line-height:1.4; min-width:0; }
.studio-shell .script-navigation-controls { margin-left:auto; }
.studio-shell .coach-panel[data-view=live] .coach-prompt { font-size:clamp(20px,min(1.7vw,3.8cqh),32px); line-height:1.35; letter-spacing:-.025em; border-left-color:var(--accent); padding-left:18px; max-width:none; overflow-wrap:anywhere; }
.studio-shell .coach-panel.is-question .coach-prompt { border-left-color:#649ef8; }
.studio-shell .coach-panel.is-objection .coach-prompt { border-left-color:var(--danger); }
.studio-shell .workspace-evidence { grid-row:3; font-size:10px; }
.studio-shell .return-to-script { align-self:start; font-size:12px; max-width:480px; line-height:1.5; overflow-wrap:anywhere; }
.studio-shell .coach-panel[data-view=live]>.last-customer { grid-row:3; min-height:0; max-height:clamp(80px,18cqh,144px); overflow-y:auto; padding:12px 14px; margin:0; border-radius:5px; }
.studio-shell .last-customer .eyebrow { font-size:9px; }
.studio-shell .last-customer p:last-child { font-size:11px; line-height:1.6; color:var(--text); font-weight:400; }
.studio-shell .call-grid .live-panel { padding:18px 18px 0; border-left:1px solid var(--line); display:flex; flex-direction:column; background:var(--bg); }
.studio-shell .live-panel .panel__header { margin:0 0 16px; flex-shrink:0; }
.studio-shell .live-panel h2 { font-size:12px; }
.studio-conversation-tabs { display:flex; gap:18px; border-bottom:1px solid var(--line); flex-shrink:0; }
.studio-conversation-tabs button { border:0; background:transparent; padding:0 0 10px; font-size:10px; color:var(--muted); border-bottom:2px solid transparent; cursor:pointer; }
.studio-conversation-tabs button[aria-selected=true] { color:var(--text); border-bottom-color:var(--accent); }
.studio-shell .transcript-shell { flex:1; min-height:0; }
.studio-shell .transcript-list { scrollbar-gutter:stable; }
.studio-shell .transcript-item { padding:18px 0; border:0; border-bottom:1px solid var(--line); background:transparent; }
.studio-shell .transcript-item>span { font-size:10px; font-weight:500; }
.studio-shell .transcript-item p { font-size:12px; line-height:1.7; }
.studio-events { flex:1; min-height:0; overflow:auto; }
.studio-event { padding:16px 0; border-bottom:1px solid var(--line); }
.studio-event header { display:flex; justify-content:space-between; gap:10px; font-size:10px; color:var(--muted); }
.studio-event p { font-size:12px; line-height:1.6; margin-top:8px; }
.studio-voice-status { display:flex; flex-wrap:wrap; gap:12px; padding:12px 18px; margin:0 -18px; border-top:1px solid var(--line); flex-shrink:0; font-size:10px; }
.studio-voice-status>span { display:flex; align-items:center; gap:6px; color:var(--muted); }
.studio-voice-status .studio-icon svg { width:14px; height:14px; }
.studio-voice-status small { font-size:9px; color:var(--faint); }
.studio-voice-status .has-voice small { color:var(--success); }
.studio-shell #adminWorkspace { padding:24px 32px; background:var(--bg); }
.studio-shell #adminWorkspace .panel { border:1px solid var(--line); border-radius:6px; background:var(--surface); box-shadow:none; }
.studio-shell #adminWorkspace .admin-workspace-heading h2 { font-size:22px; letter-spacing:-.04em; }
.studio-shell #adminWorkspace .admin-navigation+.workspace-grid { margin-top:0; }
.studio-shell #adminWorkspace .workspace-grid--admin { gap:16px; }
.studio-shell #adminWorkspace .admin-content-grid { display:block; }
.studio-shell #adminWorkspace .admin-content-grid>section { margin-top:18px; }
.studio-shell #adminWorkspace[data-studio-content=scripts] .admin-content-grid>section:not(:has(#adminScriptList)) { display:none; }
.studio-shell #adminWorkspace:not([data-studio-content=scripts]) .admin-content-grid>section:has(#adminScriptList) { display:none; }
.studio-shell #adminWorkspace .admin-products-panel[aria-label="Контент компании"]>.panel__header { display:none; }
.studio-shell #adminWorkspace .panel__header { margin-bottom:16px; padding-bottom:14px; }
.studio-shell #adminWorkspace .panel__header h2 { font-size:14px; }
.studio-shell .admin-table { border-collapse:collapse; }
.studio-shell .admin-table th { font-size:10px; font-weight:500; color:var(--muted); background:var(--bg); }
.studio-shell .admin-table td { font-size:12px; padding:12px 14px; border-bottom:1px solid var(--line); }
.studio-shell .admin-table tbody tr:hover { background:var(--surface-hover); }
.studio-shell .manager-page:not(.call-workspace) { padding:24px 32px; }
.studio-shell .panel,.studio-shell .modal-card { box-shadow:none; border-radius:6px; }
.studio-shell input,.studio-shell textarea,.studio-shell select { border-radius:5px; }
.studio-shell .history-workspace-bar { padding:8px 18px; border-radius:0; }
@media(min-width:901px) and (max-height:850px) {
  .studio-shell .call-grid .panel { padding:12px 16px; }
  .studio-shell .context-panel>* { zoom:1; }
  .studio-shell #workspaceDealTitle { margin-bottom:6px; }
  .studio-shell #leadContextList { gap:5px 12px; margin-bottom:6px; }
  .studio-shell .context-panel .call-subsection { padding-top:8px; }
  .studio-shell .workspace-fact { padding:2px 6px; }
  .studio-shell .workspace-fact header { font-size:9px; line-height:1.15; }
  .studio-shell .workspace-fact p { font-size:11px; line-height:1.2; margin-top:2px; }
  .studio-shell .workspace-fact .fact-state,.studio-shell .workspace-fact p small { font-size:8px; }
  .studio-shell .call-grid .coach-panel[data-view=live] { padding:18px 24px; }
  .studio-shell .coach-panel[data-view=live]>.workspace-cue-sequence { padding:12px 0; gap:16px; }
  .studio-shell .previous-cue { font-size:11px; }
  .studio-shell .studio-voice-status { margin-inline:-16px; padding-inline:16px; }
}
@media(max-width:1100px) and (min-width:901px) {
  .studio-shell .call-workspace .call-grid { grid-template-columns:240px minmax(0,1fr) 270px; }
  .studio-shell .workspace-toolbar #listenerStatusText { display:none; }
}
@media(max-width:900px) {
  .studio-shell .app-shell { margin-left:0; width:100%; height:auto; }
  .studio-shell .studio-rail-brand { display:none; }
  .studio-shell .app-navigation,.studio-shell .admin-navigation { position:static; width:auto; flex-direction:row; padding:4px; border:0; }
  .studio-shell .workspace-toolbar { display:flex; flex-wrap:wrap; padding:8px 14px; }
  .studio-shell .studio-rail-actions { position:static; width:100%; flex-direction:row; padding:6px 12px; border:0; }
  .studio-shell .studio-rail-actions .topbar__meta { flex-direction:row; flex-wrap:wrap; }
  .studio-shell .call-workspace .call-grid { display:flex; flex-direction:column; }
  .studio-shell .call-grid .coach-panel[data-view=live] { order:0; height:clamp(480px,90dvh,680px); min-height:0; flex:none; }
  .studio-shell .call-grid .context-panel { order:1; min-height:600px; border-top:1px solid var(--line); }
  .studio-shell .call-grid .live-panel { order:2; height:450px; min-height:450px; max-height:none; border-top:1px solid var(--line); }
  .studio-shell #qualificationList { min-height:420px; }
  .studio-shell .workspace-products { padding:12px; }
  .studio-shell .manager-page:not(.call-workspace),.studio-shell #adminWorkspace { padding:16px; }
  .studio-shell #adminWorkspace .admin-navigation { margin-bottom:16px; }
}
@media(prefers-reduced-motion:reduce) { .studio-shell .workspace-fact { transition:none; } }
@media(prefers-reduced-motion:reduce) { .studio-rail-tooltip { transition:none; } }
