/* One compact command bar; the conversation keeps the rest of the screen. */
.call-view[data-role="therapist"] {
    --chat-width: clamp(310px, 24vw, 350px);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}
.call-view[data-role="therapist"] .call-topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    min-height: 68px;
    padding: max(10px, env(safe-area-inset-top)) 20px 10px;
    border: 0;
    background: var(--paper);
}
.call-view[data-role="therapist"] .therapist-call-header { flex: 1; gap: 10px; }
.call-view[data-role="therapist"] .therapist-call-header > div { min-width: 0; }
.call-view[data-role="therapist"] .call-context-symbol { flex: 0 0 30px; width: 30px; height: 38px; border: 0; border-radius: 0; background: transparent; }
.call-view[data-role="therapist"] .call-context-symbol .brand-mark { width: 27px; height: 34px; }
.call-view[data-role="therapist"] .call-header-label { overflow: hidden; max-width: 280px; color: var(--green); font: 500 12px/1.3 var(--sans); letter-spacing: -.015em; text-transform: none; text-overflow: ellipsis; white-space: nowrap; }
.call-view[data-role="therapist"] .call-header-label > span:first-child { padding-inline: 4px; color: #9da68f; }
.call-view[data-role="therapist"] .call-topbar h1 { max-width: 330px; margin-top: 2px; font-size: 25px; line-height: 1.08; }
.call-view[data-role="therapist"] .session-clock { gap: 18px; padding: 2px 18px; border: 0; border-inline: 1px solid var(--room-line); }
.call-view[data-role="therapist"] .session-clock > div { gap: 3px; min-width: 54px; }
.call-view[data-role="therapist"] .session-clock span { color: var(--room-secondary); font-size: 10px; line-height: 1.3; }
.call-view[data-role="therapist"] .session-clock time { font-size: 15px; font-weight: 500; letter-spacing: -.025em; }
.call-view[data-role="therapist"] .session-clock.is-overtime > div:last-child time,
.call-view[data-role="therapist"] .session-clock.is-overtime > div:last-child span { color: #955f49; }
.call-view[data-role="therapist"] .call-badges { order: 5; flex-basis: 100%; justify-content: flex-end; }
.call-view[data-role="therapist"] .call-topbar:has(.capture-badge:not([hidden])) { row-gap: 7px; }
.call-view[data-role="therapist"] .call-toolbar { flex: 0 0 auto; gap: 6px; width: auto; margin: 0; padding: 0; position: static; transform: none; background: transparent; box-shadow: none; }
.call-view[data-role="therapist"] .tool-button { min-height: 40px; min-width: 40px; padding: 9px 10px; font-size: 12px; }
.call-view[data-role="therapist"] .workspace-toggle { position: relative; }
.call-view[data-role="therapist"] .toolbar-media { gap: 2px; padding: 3px; margin-left: 4px; border: 1px solid var(--room-line); border-radius: 15px; background: #fffefaaa; }
.call-view[data-role="therapist"] .toolbar-media .tool-button { width: 38px; min-width: 38px; min-height: 38px; padding: 8px; border-radius: 10px; }
.call-view[data-role="therapist"] .toolbar-media .tool-button > span { display: none; }
.call-view[data-role="therapist"] .toolbar-end { gap: 5px; margin: 0 0 0 4px; padding: 0 0 0 8px; border-left: 1px solid var(--room-line); }
.call-view[data-role="therapist"] .tool-leave { color: #7c675b; }
.call-view[data-role="therapist"] .tool-leave > span { display: none; }
.call-view[data-role="therapist"] .tool-leave:hover { background: #f0e8de; }
.call-view[data-role="therapist"] .tool-close { padding-inline: 13px; border-color: #995f4f; background: #995f4f; color: #fffdf8; }
.call-view[data-role="therapist"] .tool-close:hover { border-color: #8c5444; background: #8c5444; }
.call-view[data-role="therapist"] .tool-close:active { background: #7f4c3e; }
.call-view[data-role="therapist"] .tool-close .icon { width: 13px; height: 13px; font-size: 13px; }

/* Workspace surfaces. The coordinated camera/panel layout lives in therapist-workspace.css. */
.call-view[data-role="therapist"] .video-area { height: 100%; min-height: 0; padding: 0; background: var(--paper); }
.call-view[data-role="therapist"] .call-status { top: 16px; left: 16px; }
.call-view[data-role="therapist"] .feed-actions .feed-capture { border-color: #fffefa80; background: #f8f7f2; color: var(--ink); }
.call-view[data-role="therapist"] .feed-actions .feed-capture:hover { background: white; }
.therapist-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--room-line); border-radius: var(--room-radius); background: var(--surface); box-shadow: 0 2px 8px #34483d05; }
.workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 18px; }
.workspace-heading h2 { font: 500 16px/1.4 var(--sans); letter-spacing: -.02em; }
.workspace-heading p { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--room-secondary); font-size: 11px; line-height: 1.5; }
.workspace-heading p .icon { width: 10px; height: 10px; font-size: 10px; }
.workspace-heading > button { margin-top: -4px; margin-right: -5px; }
.workspace-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px 12px; padding: 11px 12px; border: 1px solid #e5d9bf; border-radius: 12px; background: #f8f1e3; color: #755e44; font-size: 12px; line-height: 1.5; }
.workspace-error button { flex-shrink: 0; border: 0; background: transparent; color: #526747; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.workspace-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex-shrink: 0; gap: 3px; padding: 4px; margin: 0 16px 4px; border: 1px solid #e3e6d9; border-radius: 13px; background: #eef0e6; }
.workspace-tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #69745f; font-size: 12px; font-weight: 500; transition: background 160ms ease, color 160ms ease; }
.workspace-tab .icon { width: 13px; height: 13px; font-size: 13px; }
.workspace-tab:hover { background: #e5eadb; color: var(--green); }
.workspace-tab[aria-selected="true"] { border-color: #dfe4d4; background: #fffefa; color: #405a39; box-shadow: 0 1px 3px #34483d0a; }
.workspace-tab:focus-visible { outline: 2px solid #71875f; outline-offset: 1px; }
.workspace-panel { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 23px 20px 24px; scrollbar-width: thin; scrollbar-color: #bac6ad transparent; }
.workspace-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-section-heading h3, .file-heading h3 { font: 500 14px/1.5 var(--sans); letter-spacing: -.015em; }
.workspace-explanation { margin-top: 7px; color: var(--room-secondary); font-size: 12px; line-height: 1.65; }
.workspace-autosave { display: flex; align-items: center; gap: 5px; color: var(--room-secondary); font-size: 10px; white-space: nowrap; }
.workspace-autosave .icon { width: 9px; height: 9px; font-size: 9px; }
.workspace-empty { padding: 20px 16px; border: 1px solid #e5e8dc; border-radius: 13px; background: #f6f7ef; color: #687165; font-size: 12px; line-height: 1.7; }
#workspace-panel-notes { display: flex; flex-direction: column; }
#session-notes { display: block; flex: 1; width: 100%; min-height: 200px; margin-top: 17px; padding: 16px; resize: none; border: 1px solid #dfe4d5; border-radius: 14px; outline: none; background: #fffefa; color: var(--ink); font: 400 14px/1.8 var(--sans); }
#session-notes:focus { border-color: #93a881; box-shadow: 0 0 0 3px #c9d5bd40; }
#session-notes::placeholder { color: #6c735f; }
.notes-save-status { margin-top: 10px; color: var(--room-secondary); font-size: 11px; line-height: 1.5; }
.capture-instruction { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; padding: 13px; border: 1px solid #e0e7d4; border-radius: 13px; background: #f0f3e8; }
.capture-instruction-icon { display: grid; place-items: center; flex: 0 0 26px; height: 28px; color: #6e855c; }
.capture-instruction-icon .icon { width: 16px; height: 16px; font-size: 16px; }
.capture-instruction p { color: #5d7052; font-size: 12px; line-height: 1.6; }
.capture-settings { margin-top: 24px; padding-block: 20px 5px; border-block: 1px solid #e2e6d8; }
.settings-heading { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; font-weight: 500; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 13px; }
.setting-row + .setting-row { border-top: 1px solid #e8eadf; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row small { display: block; margin-top: 4px; color: var(--room-secondary); font-size: 11px; line-height: 1.5; }
.settings-note { padding-bottom: 12px; color: var(--room-secondary); font-size: 11px; line-height: 1.6; }
.file-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 23px; }
.file-heading > span { display: grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 6px; border-radius: 8px; background: #edf1e5; color: #5f7352; font-size: 11px; }
.therapist-panel .snapshot-gallery .empty-gallery { color: var(--room-secondary); font-size: 12px; line-height: 1.7; }
.therapist-panel .snapshot-card { border-color: #dfe4d5; border-radius: 12px; background: #f4f6ec; }
.therapist-panel .snapshot-card span { padding: 8px 10px; font-size: 11px; }

/* Chat arrives from the left; the clinical workspace stays on the right. */
.call-view[data-role="therapist"] .conversation-panel { left: var(--room-gutter); right: auto; top: var(--conversation-top, 68px); bottom: max(12px, env(safe-area-inset-bottom)); width: var(--chat-width); overflow: hidden; border: 1px solid var(--room-line); border-radius: var(--room-radius); background: var(--surface); box-shadow: 0 2px 8px #34483d05; animation: therapist-chat-arrive 180ms ease-out; }
.call-view[data-role="therapist"]:has(.conversation-panel:not([hidden])) .call-body { padding-left: calc(var(--chat-width) + var(--room-gutter) * 2); }
.call-view[data-role="therapist"] .conversation-notification { left: 24px; right: auto; bottom: 24px; }
.call-view[data-role="therapist"] .therapist-request { left: 26px; max-width: calc(100vw - 52px); border-color: #d2dec5; background: #f3f7eb; }
.call-view[data-role="therapist"] .therapist-request > div > span { color: #627454; font-size: 11px; }
.call-view[data-role="therapist"] .therapist-request strong { font-size: 14px; }
.call-view[data-role="therapist"] .therapist-request > button { min-height: 36px; font-size: 11px; }
.call-view[data-role="therapist"]:has(.conversation-panel:not([hidden])) .therapist-request { left: calc(var(--chat-width) + 26px); }
@keyframes therapist-chat-arrive { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 1360px) {
    .call-view[data-role="therapist"]:has(.conversation-panel:not([hidden])) .call-body { padding-left: var(--room-gutter); }
    .call-view[data-role="therapist"] .conversation-panel { box-shadow: 0 8px 36px #263b2026; }
    .call-view[data-role="therapist"] .call-topbar { gap: 12px; padding-inline: 16px; }
    .call-view[data-role="therapist"] .session-clock { gap: 13px; padding-inline: 14px; }
    .call-view[data-role="therapist"] .call-topbar h1 { max-width: 250px; font-size: 23px; }
}
@media (max-width: 1180px) {
    .call-view[data-role="therapist"] .workspace-toggle > span,
    .call-view[data-role="therapist"] .conversation-controls .tool-button > span:not(.chat-unread) { display: none; }
    .call-view[data-role="therapist"] .call-header-label { max-width: 230px; }
    .call-view[data-role="therapist"] .call-toolbar { gap: 3px; }
    .call-view[data-role="therapist"] .session-clock { padding-inline: 12px; }
}
@media (max-width: 1000px) {
    .call-view[data-role="therapist"] .call-header-label { max-width: 190px; }
    .call-view[data-role="therapist"] .call-topbar h1 { max-width: 190px; }
    .call-view[data-role="therapist"] #camera-layout-label { display: none; }
    .call-view[data-role="therapist"] .camera-layout-button { width: 44px; min-height: 44px; padding: 10px; }
}
@media (max-width: 820px) {
    .call-view[data-role="therapist"] .call-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
    .call-view[data-role="therapist"] .therapist-call-header { grid-column: 1; grid-row: 1; }
    .call-view[data-role="therapist"] .call-topbar h1 { max-width: none; font-size: 23px; }
    .call-view[data-role="therapist"] .call-header-label { max-width: none; font-size: 11px; }
    .call-view[data-role="therapist"] .session-clock { grid-column: 2; grid-row: 1; gap: 12px; padding: 0; border: 0; }
    .call-view[data-role="therapist"] .session-clock > div { min-width: 48px; }
    .call-view[data-role="therapist"] .session-clock time { font-size: 14px; }
    .call-view[data-role="therapist"] .call-toolbar { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; padding-left: 52px; gap: 7px; }
    .call-view[data-role="therapist"] .camera-layout-control { grid-column: 1; grid-row: 2; justify-self: start; z-index: 1; }
    .call-view[data-role="therapist"] .toolbar-media { margin-left: auto; }
    .call-view[data-role="therapist"] .toolbar-end { padding-left: 8px; margin-left: 1px; }
    .call-view[data-role="therapist"] .call-badges { grid-column: 1 / -1; grid-row: 3; }
    .call-view[data-role="therapist"] .conversation-panel { width: min(350px, calc(100% - var(--room-gutter) * 2)); }
    .call-view[data-role="therapist"]:has(.conversation-panel:not([hidden])) .therapist-request { left: 20px; top: calc(var(--conversation-top, 110px) + 10px); z-index: 16; }
}
@media (max-width: 620px) {
    .call-view[data-role="therapist"] { --room-gutter: 8px; --room-radius: 18px; }
    .call-view[data-role="therapist"] .call-topbar { padding-inline: 12px; }
    .call-view[data-role="therapist"] .therapist-call-header { gap: 7px; }
    .call-view[data-role="therapist"] .call-context-symbol { width: 24px; flex-basis: 24px; }
    .call-view[data-role="therapist"] .call-context-symbol .brand-mark { width: 22px; height: 28px; }
    .call-view[data-role="therapist"] .call-topbar h1 { font-size: 21px; }
    .call-view[data-role="therapist"] .call-toolbar { gap: 3px; padding-left: 44px; }
    .call-view[data-role="therapist"] .tool-button { width: 40px; min-width: 40px; min-height: 44px; padding: 9px; }
    .call-view[data-role="therapist"] .toolbar-media { padding: 2px; gap: 0; margin-left: auto; }
    .call-view[data-role="therapist"] .toolbar-media .tool-button { width: 40px; min-width: 40px; min-height: 40px; }
    .call-view[data-role="therapist"] .toolbar-end { gap: 2px; padding-left: 4px; }
    .call-view[data-role="therapist"] .tool-close { width: auto; min-width: 0; padding-inline: 10px; }
    .call-view[data-role="therapist"] .tool-close > span { font-size: 11px; }
    .call-view[data-role="therapist"] .tool-close .icon { display: none; }
    .call-view[data-role="therapist"] .conversation-panel { top: auto; max-height: calc(100dvh - var(--conversation-top, 122px) - 12px); height: min(580px, 76dvh); }
    .call-view[data-role="therapist"] .chat-heading { padding: 18px 18px 12px; }
    .call-view[data-role="therapist"] .chat-composer textarea,
    #session-notes { font-size: 16px; }
    .workspace-heading { padding: 18px 18px 14px; }
    .workspace-panel { padding: 20px 18px; }
    .workspace-tab { min-height: 40px; }
    .call-view[data-role="therapist"] .therapist-request { left: 16px; max-width: calc(100vw - 32px); }
    .call-view[data-role="therapist"] .therapist-request strong { font-size: 13px; }
}
@media (max-width: 380px) {
    .call-view[data-role="therapist"] .call-toolbar { padding-left: 40px; gap: 0; }
    .call-view[data-role="therapist"] .toolbar-end { border: 0; padding-left: 0; margin-left: 0; }
    .call-view[data-role="therapist"] .tool-close { width: 40px; padding: 10px; }
    .call-view[data-role="therapist"] .tool-close .icon { display: inline-flex; }
    .call-view[data-role="therapist"] .tool-close > span { display: none; }
}
