/* Broker-only bounded workspace. Existing product colours and controls remain. */
html { height: 100%; }
body { height: 100vh; height: var(--workspace-height, 100dvh); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body > header { flex: 0 0 auto; padding: 10px 20px; min-height: 56px; }
body > footer { flex: 0 0 auto; margin-top: 0 !important; padding: 5px !important; }
.font-sliders { padding: 3px 20px; flex: 0 0 auto; }
.oracle-hero { flex: 0 0 auto; padding: 8px 20px; }
.workspace-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--line-strong); font-size: 13px; background: var(--bg-secondary); }
.workspace-views { display: none; }
.main-container { flex: 1 1 0; min-height: 0; height: auto; display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(400px, 1fr); grid-template-rows: auto minmax(0,1fr); overflow: hidden; position: relative; }
.deal-editor { grid-column: 1 / -1; min-width: 0; border-bottom: 1px solid var(--line-strong); background: var(--bg-secondary); z-index: 5; }
.deal-editor summary { cursor: pointer; padding: 10px 20px; font-weight: 600; font-size: 14px; }
.deal-editor summary span { font-weight: 400; color: var(--text-muted); margin-left: 12px; }
.deal-editor[open] summary { position: sticky; top: 0; z-index: 2; background: var(--bg-secondary); }
.deal-editor[open] { position: absolute; inset: 0 0 auto; max-height: 85%; display: flex; flex-direction: column; overflow: auto; box-shadow: 0 12px 24px #0002; }
.deal-editor .panel-left { width: 100%; min-width: 0; max-width: none; height: auto; overflow: visible; }
.deal-editor .panel-content { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 24px; overflow: visible; padding: 16px 20px; }
.deal-editor .form-section { min-width: 0; }
.panel-middle { grid-column: 1; grid-row: 2; width: auto; min-width: 0; max-width: none; max-height: none; min-height: 0; overflow: auto; padding: 20px; }
.panel-right { grid-column: 2; grid-row: 2; width: auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-right-header { flex: 0 0 auto; padding: 14px 20px; }
.workspace-chat-status { flex: 0 0 auto; font-size: 13px; padding: 8px 20px; border-bottom: 1px solid var(--line-strong); color: var(--text-muted); }
.chat-container { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 20px; overflow-anchor: none; }
.chat-input-container { flex: 0 0 auto; padding: 12px 16px; padding-bottom: max(12px,env(safe-area-inset-bottom)); }
.chat-input { font-size: 16px; max-height: 120px; }
.message-content { min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.message-content pre { white-space: pre-wrap; }
.message-content table { display: block; overflow: auto; max-width: 100%; }
.welcome-state { min-height: 0; padding: 20px 5px; }
.aor-table { min-width: 0; }
.aor-row { min-width: 0; }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#workspace-new-message { flex: 0 0 auto; align-self: center; padding: 6px 14px; cursor: pointer; }
@media (max-width: 759px) {
 body > header { padding: 8px 12px; min-height: 48px; gap: 8px; }
 .brand-tagline { display: none; }
 .header-actions { gap: 5px; flex-wrap: wrap; }
 .header-actions a { display: none; }
 .font-sliders { display: none; }
 .oracle-hero { padding: 6px 10px; }
 .oracle-hero-label, .oracle-hero-icon { display: none; }
 .oracle-hero-inner { gap: 6px; }
 .oracle-hero-input { min-width: 0; font-size: 16px; }
 .workspace-toolbar { padding: 8px 12px; flex-direction: column; gap: 3px; font-size: 12px; }
 .workspace-views { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line-strong); }
 .workspace-views button { padding: 8px 20px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg-secondary); color: var(--text-primary); }
 .workspace-views button[aria-pressed="true"] { background: var(--accent); color: white; }
 #workspace-chat-badge { font-size: 12px; }
 .main-container { grid-template-columns: minmax(0,1fr); }
 .panel-middle, .panel-right { grid-column: 1; grid-row: 2; }
 .main-container[data-view="results"] .panel-right, .main-container[data-view="chat"] .panel-middle { display: none; }
 .panel-middle { padding: 12px; }
 .deal-editor summary { padding: 9px 12px; }
 .deal-editor summary span { font-size: 12px; }
 .deal-editor .panel-content { grid-template-columns: minmax(0,1fr); }
 .panel-right-header { padding: 10px 12px; }
 .chat-messages { padding: 12px; }
 .chat-input-container { padding: 8px 12px; }
 .quick-prompts { flex-wrap: wrap; }
 .aor-thead { display: flex; flex-wrap: wrap; gap: 12px; }
 .aor-thead > :first-child { display: none; }
 .aor-trow { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px; }
 .aor-tcell-lender { grid-column: 1 / -1; }
 .aor-lender-name, .aor-lender-type { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
 .aor-trow > :nth-child(2)::before { content: 'Rate pcm: '; }
 .aor-trow > :nth-child(3)::before { content: 'Max LTV: '; }
 .aor-trow > :nth-child(4)::before { content: 'Speed: '; }
 .aor-num-col { text-align: left; font-size: 12px; }
 .panel-middle .always-on-results { padding: 10px 2px; }
 .aor-shortlist-head { flex-wrap: wrap; gap: 8px; }
 body > footer { font-size: 10px !important; }
}
/* Reclaim chrome when a mobile keyboard reduces the visual viewport. */
.workspace-compact > header, .workspace-compact > footer, .workspace-compact .workspace-toolbar { display: none; }
.workspace-compact .workspace-views { padding: 4px 12px; }
.workspace-compact .panel-right-header { padding: 6px 12px; }
.workspace-compact .chat-input-container .quick-prompts { display: none; }
@media (max-width: 759px) and (max-height: 600px) {
 body > header, body > footer, .workspace-toolbar { display: none; }
 .workspace-views { padding: 4px 12px; }
 .panel-right-header { padding: 6px 12px; }
 .chat-input-container .quick-prompts { display: none; }
}
