.coach-image-tools button, .coach-image-order button { min-height: 44px; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ink-800); color: var(--text); font-size: .875rem; }
.coach-image-tools button[aria-pressed="true"] { background: var(--rose-wash); border-color: var(--rose-400); color: var(--text); }
.coach-tray { margin-bottom: .5rem; }
.coach-attachments { display: flex; align-items: center; gap: .5rem; overflow-x: auto; padding-block: .25rem; }
.coach-attachment { position: relative; flex: 0 0 64px; width: 64px; height: 64px; padding: 0; background: var(--ink-800); color: var(--text); border-radius: var(--radius-sm); overflow: hidden; }
.coach-attachment img { display: block; width: 64px; height: 64px; object-fit: cover; object-position: top; }
.coach-attachment > span { position: absolute; bottom: 0; left: 0; right: 0; padding: 2px 4px; background: var(--ink-950); color: var(--text); font-size: .875rem; line-height: 1.4; text-align: center; }
.coach-upload-info-button { display: grid; align-content: center; flex: 0 0 80px; height: 64px; padding: .25rem; background: transparent; color: var(--muted); font-size: .875rem; line-height: 1.5; text-align: center; }
.coach-upload-info-button > :last-child { color: var(--rose-300); text-decoration: underline; text-underline-offset: 3px; }
.coach-image-order { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.coach-image-order > span { flex: 1; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.coach-footnote, .coach-status { font-size: .78rem; color: #d5c7d0; line-height: 1.65; margin: .5rem 0; overflow-wrap: anywhere; }
.coach-status { color: #f0b4ce; }
.coach-status button { color: #ffcee3; text-decoration: underline; padding: .25rem .5rem; background: transparent; min-height: 44px; }
.coach-dialog { width: min(100% - 1.25rem, 42rem); max-height: calc(100dvh - 2rem); }
.coach-dialog .dialog-body { overflow-wrap: anywhere; }
.coach-dialog .dialog-heading p { font-size: .85rem; color: #d5c7d0; margin-top: .4rem; }
.coach-dialog details { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .75rem; }
.coach-dialog summary { cursor: pointer; min-height: 44px; color: #ffc7e0; }
.coach-line { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.coach-line-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .4rem; }
.coach-line select { min-height: 44px; max-width: 7rem; background: var(--ink-800); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .3rem; }
.coach-line input { width: 8rem; min-height: 44px; background: var(--ink-800); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .35rem; }
.coach-line textarea, .coach-dialog .coach-notes { width: 100%; min-height: 4.8rem; resize: vertical; background: var(--ink-800); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .65rem; font-size: .9rem; line-height: 1.6; }
.coach-line button { min-height: 44px; padding: .25rem .5rem; font-size: .78rem; color: #ffc7e0; background: transparent; }
.coach-line .coach-line-delete { margin-left: auto; color: #edc2cd; }
.coach-warning { color: #ffe0aa; line-height: 1.65; margin: .5rem 0; font-size: .85rem; }
.coach-acknowledge { display: flex; align-items: flex-start; gap: .5rem; min-height: 44px; margin: 1rem 0; font-size: .85rem; line-height: 1.6; }
.coach-acknowledge input { margin-top: .35rem; accent-color: #e078a7; }
.coach-review-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: #d5c7d0; font-size: .8rem; margin-bottom: .5rem; }
.coach-review-meta button { min-height: 44px; background: transparent; color: #ffc7e0; padding: .4rem; }
.coach-summary { white-space: pre-wrap; color: var(--text); line-height: 1.8; font-size: .9rem; }
.coach-details { border-top: 1px solid var(--line); padding-top: .85rem; margin-top: 1rem; }
.coach-details summary { min-height: 44px; cursor: pointer; color: #ffc7e0; font-size: .85rem; }
.coach-details h4 { font-size: .88rem; margin: 1rem 0 .5rem; }
.coach-details p, .coach-details li { font-size: .85rem; line-height: 1.8; color: #e1d5dd; white-space: pre-wrap; }
.coach-details ul { padding-left: 1.1rem; }
.coach-review-item { overflow-wrap: anywhere; }
.coach-review-item p { font-size: 1rem; }
.coach-review-item + .coach-review-item { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: 1rem; }
.coach-methods { margin-top: 1rem; }
.coach-methods li { overflow-wrap: anywhere; }
.coach-evidence { display: block; width: 100%; text-align: left; background: transparent; color: #ffc7e0; padding: .65rem 0; line-height: 1.65; min-height: 44px; font-size: .85rem; }
.coach-source-image { max-width: 100%; height: auto; display: block; margin-top: .75rem; }
.coach-source-quote { white-space: pre-wrap; line-height: 1.8; border-top: 1px solid var(--line); padding-top: .7rem; }
.coach-image-tools { display: flex; gap: .5rem; margin-bottom: .5rem; }
.coach-canvas-scroll { max-height: 45dvh; overflow: auto; background: #201820; }
#coach-image-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.coach-region-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: .75rem 0; }
.coach-region-fields label { font-size: .8rem; color: #d5c7d0; }
.coach-region-fields input { width: 100%; min-height: 44px; background: var(--ink-800); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: .4rem; }
.coach-dialog .primary-btn { margin-top: .8rem; }
.coach-stale { color: #ffe0aa; margin-top: .7rem; font-size: .8rem; }
.coach-tools button:disabled, .coach-dialog button:disabled { opacity: .55; cursor: not-allowed; }

/* Reading owns the viewport; controls expand only for the current action. */
:root { --coach-keyboard-inset: 0px; --app-header-height: 4.6rem; }
#view-chat { padding-top: 0; }
.coach-session-bar { position: sticky; top: var(--app-header-height); z-index: 26; display: flex; align-items: center; gap: .25rem; min-height: 48px; margin-inline: -1rem; padding: 2px 1rem; background: var(--ink-950); border-bottom: 1px solid var(--line); }
.coach-session-bar .session-select { display: flex; align-items: center; gap: .375rem; flex: 1; min-width: 0; min-height: 44px; padding: 0; font-size: .875rem; }
.coach-session-bar .session-select > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-session-bar .session-select svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.coach-context-button { min-width: 44px; min-height: 44px; padding: .25rem; background: transparent; color: var(--muted); font-size: .875rem; }
.coach-menu { position: relative; flex: 0 0 auto; }
.coach-menu summary, .script-adjust summary { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: .25rem; padding: .25rem .5rem; color: var(--rose-300); font-size: .875rem; list-style: none; cursor: pointer; }
.coach-menu summary::-webkit-details-marker, .script-adjust summary::-webkit-details-marker { display: none; }
.coach-menu summary svg, .script-adjust summary svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.coach-menu-options, .script-adjust-options { position: absolute; right: 0; z-index: 31; min-width: 11rem; padding: .25rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--ink-800); box-shadow: 0 8px 24px #00000040; }
.coach-menu-options { top: calc(100% + .25rem); }
.coach-menu-options button, .script-adjust-options button { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: flex-start; padding: .5rem .75rem; background: transparent; color: var(--text); font-size: .875rem; text-align: left; border: 0; border-radius: var(--radius-sm); }
.coach-menu-options button[aria-pressed="true"] { background: var(--rose-wash); color: var(--rose-300); }
#view-chat .scene-strip { margin-top: 1rem; }
.coach-composer { min-height: 0; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background: var(--ink-950); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.coach-composer .composer-form { grid-template-columns: 44px minmax(0, 1fr) 52px; gap: 8px; align-items: end; }
.coach-composer .coach-upload { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--ink-800); color: var(--text); }
.coach-composer .coach-upload svg { width: 1.25rem; height: 1.25rem; }
.coach-composer .composer-field textarea { min-height: 44px; max-height: calc(4.5em + 20px); padding: 9px 10px; font-size: 1rem; line-height: 1.5; caret-color: var(--rose-300); }
.coach-composer .composer-field textarea::placeholder { color: var(--muted); }
.coach-composer .send-btn { width: 52px; min-width: 52px; min-height: 44px; height: 44px; padding: 0; font-size: .875rem; border-radius: var(--radius-md); }
.coach-composer .coach-status { max-height: 20dvh; overflow-y: auto; margin: 0 0 .5rem; }
#app-shell.coach-keyboard-open[data-current-view="chat"] .bottom-nav { display: none; }
#app-shell.coach-keyboard-open[data-current-view="chat"] .coach-composer { bottom: var(--coach-keyboard-inset); }
#app-shell.coach-keyboard-open #view-chat { padding-bottom: calc(var(--composer-height) + var(--coach-keyboard-inset) + 1rem); }
.assistant-response .script-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.assistant-response .script-actions .is-copy, .assistant-response .script-actions > :last-child { grid-column: auto; }
.script-adjust { position: relative; min-width: 0; }
.script-adjust summary { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ink-800); color: var(--text-soft); font-weight: 700; }
.script-adjust-options { bottom: calc(100% + .5rem); }
.script-adjust summary[aria-disabled="true"] { cursor: wait; opacity: .55; }
.coach-menu summary:focus-visible, .script-adjust summary:focus-visible, .coach-session-bar button:focus-visible, .coach-composer button:focus-visible, .coach-attachment:focus-visible, .coach-upload-info-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) { .coach-menu-options button:hover, .script-adjust-options button:hover { background: var(--rose-wash); } }
