/* Shared polish for the native Report, Document and Worksheet workspaces. */
#HPOReportStudio{
  --rs-border:#d7e0eb;--rs-ink:#172b4d;--rs-muted:#64748b;--rs-accent:#2563eb;
  background:#e8edf4;color:var(--rs-ink)
}
#HPOReportStudio .rs-shell{grid-template-rows:auto auto minmax(0,1fr)!important}
#HPOReportStudio .rs-header{min-height:54px!important;padding:7px 14px!important;background:#fff!important;border-bottom:1px solid var(--rs-border);box-shadow:0 2px 8px #0f172a0a}
#HPOReportStudio .rs-header strong{font-size:15px!important;letter-spacing:.01em}
#HPOReportStudio .rs-header span,#HPOReportStudio .rs-header small{line-height:1.35}
#HPOReportStudio .rs-toolbar{display:grid!important;grid-template-rows:minmax(38px,auto) minmax(38px,auto) auto!important;gap:4px!important;padding:5px 10px!important;background:#f8fafc!important;border-bottom:1px solid var(--rs-border)}
#HPOReportStudio .rs-commandbar,#HPOReportStudio .rs-tools{min-width:0!important;min-height:32px!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#b8c5d6 transparent;align-items:center!important;gap:5px!important;padding:1px 1px 4px!important}
#HPOReportStudio .rs-commandbar>*,#HPOReportStudio .rs-tools>*{flex:0 0 auto!important}
#HPOReportStudio .rs-tabs{flex-wrap:nowrap!important;align-items:center!important;white-space:nowrap}
#HPOReportStudio .rs-tabs button{min-height:32px;padding:6px 11px!important;border-radius:6px 6px 0 0}
#HPOReportStudio .rs-version-actions{flex-wrap:nowrap!important;min-width:max-content!important;align-items:center!important;gap:5px!important}
#HPOReportStudio .rs-status{min-height:18px!important;line-height:1.4!important;white-space:normal!important;color:var(--rs-muted);padding:1px 2px}
#HPOReportStudio .rs-main{grid-template-columns:minmax(205px,225px) minmax(0,1fr) minmax(245px,275px)!important;min-height:0!important;overflow:hidden!important;background:#e8edf4}
#HPOReportStudio .rs-left,#HPOReportStudio .rs-right{min-width:0!important;min-height:0!important;overflow:auto!important;overscroll-behavior:contain;background:#fff}
#HPOReportStudio .rs-left{border-right:1px solid var(--rs-border)!important}
#HPOReportStudio .rs-right{border-left:1px solid var(--rs-border)!important}
#HPOReportStudio .rs-panel-title{position:sticky;top:0;z-index:8;padding:10px 12px!important;background:#f8fafc!important;color:#334155;border-bottom:1px solid var(--rs-border)}
#HPOReportStudio .rs-inspector-tabs{position:sticky;top:39px;z-index:7;background:#fff;padding:6px 7px;border-bottom:1px solid #edf1f6}
#HPOReportStudio .rs-stage{min-width:0!important;min-height:0!important;grid-template-rows:auto minmax(0,1fr)!important;background:#e8edf4!important}
#HPOReportStudio .rs-stage-head{min-height:42px;height:auto!important;gap:8px;flex-wrap:wrap;padding:6px 12px!important;color:#334155}
#HPOReportStudio .rs-stage-head small{flex:1 1 100%;line-height:1.35}
#HPOReportStudio .rs-scroll{min-width:0!important;min-height:0!important;overflow:auto!important;padding:28px clamp(18px,3vw,48px) 48px!important;scrollbar-gutter:stable;overscroll-behavior:contain}
#HPOReportStudio .rs-canvas{margin:0 auto!important}
#HPOReportStudio .rs-page{box-shadow:0 8px 28px #0f172a26,0 0 0 1px #cbd5e1}
#HPOReportStudio .rs-right label{font-size:11px!important;line-height:1.35}
#HPOReportStudio .rs-right input,#HPOReportStudio .rs-right select,#HPOReportStudio .rs-right textarea{min-height:32px;border-color:#cbd5e1;transition:border-color .12s ease,box-shadow .12s ease}
#HPOReportStudio .rs-right input:focus,#HPOReportStudio .rs-right select:focus,#HPOReportStudio .rs-right textarea:focus{outline:0;border-color:#60a5fa;box-shadow:0 0 0 3px #3b82f61c}
#HPOReportStudio .rs-element.selected{outline:2px solid var(--rs-accent)!important;outline-offset:2px;box-shadow:0 0 0 4px #2563eb20}
#HPOReportStudio .rs-history-btn:focus-visible,#HPOReportStudio button:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
#HPOReportStudio.rs-inspector-collapsed .rs-main{grid-template-columns:0 minmax(0,1fr) minmax(245px,275px)!important}
@media(max-width:1120px){
  #HPOReportStudio .rs-main{grid-template-columns:minmax(180px,205px) minmax(0,1fr) minmax(220px,245px)!important}
  #HPOReportStudio.rs-inspector-collapsed .rs-main{grid-template-columns:0 minmax(0,1fr) minmax(220px,245px)!important}
}
@media(max-width:850px){
  #HPOReportStudio .rs-main{grid-template-columns:minmax(0,1fr) minmax(225px,30vw)!important;grid-template-rows:minmax(42vh,1fr) minmax(190px,30vh)!important;overflow:auto!important}
  #HPOReportStudio .rs-stage{grid-column:1;grid-row:1;min-height:42vh!important}
  #HPOReportStudio .rs-left{grid-column:1;grid-row:2;border-top:1px solid var(--rs-border)!important}
  #HPOReportStudio .rs-right{grid-column:2;grid-row:1 / span 2;border-left:1px solid var(--rs-border)!important}
  #HPOReportStudio.rs-inspector-collapsed .rs-main{grid-template-columns:minmax(0,1fr) minmax(225px,30vw)!important}
  #HPOReportStudio.rs-inspector-collapsed .rs-left{display:none!important}
}
@media(max-width:620px){
  #HPOReportStudio .rs-main,#HPOReportStudio.rs-inspector-collapsed .rs-main{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(52vh,1fr) minmax(200px,28vh) minmax(200px,28vh)!important}
  #HPOReportStudio .rs-stage{grid-column:1;grid-row:1;min-height:52vh!important}
  #HPOReportStudio .rs-left{grid-column:1;grid-row:2;display:block!important;border-top:1px solid var(--rs-border)!important}
  #HPOReportStudio .rs-right{grid-column:1;grid-row:3;border-left:0!important;border-top:1px solid var(--rs-border)!important}
  #HPOReportStudio.rs-inspector-collapsed .rs-left{display:none!important}
  #HPOReportStudio .rs-header span{display:none!important}
  #HPOReportStudio .rs-scroll{padding:24px 14px 36px!important}
}

/* Document and worksheet designer layout. */
#templateDesignerModal.native-document-workspace{--tpl-border:#d7e0eb;--tpl-ink:#17324f;--tpl-muted:#64748b}
#templateDesignerModal.native-document-workspace .template-designer-shell{min-width:0!important;min-height:0!important;background:#eef2f7!important}
#templateDesignerModal.native-document-workspace .template-designer-head{gap:12px!important;align-items:center!important;box-shadow:0 2px 8px #102a430a}
#templateDesignerModal.native-document-workspace .tpl-doc-title{min-width:180px}
#templateDesignerModal.native-document-workspace .template-designer-head .action-row{min-width:0;gap:5px!important}
#templateDesignerModal.native-document-workspace .tpl-ribbon-tabs{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;border-bottom:1px solid var(--tpl-border)}
#templateDesignerModal.native-document-workspace .tpl-ribbon-tabs button{white-space:nowrap;min-height:32px}
#templateDesignerModal.native-document-workspace .tpl-ribbon{min-width:0;max-height:min(29vh,220px);overflow:auto!important;overscroll-behavior:contain;border-bottom:1px solid var(--tpl-border)}
#templateDesignerModal.native-document-workspace .tpl-ribbon-pane{min-width:max-content;align-items:stretch;gap:8px;padding:8px 10px!important}
#templateDesignerModal.native-document-workspace .tpl-ribbon-group{min-width:150px;max-width:360px;padding:8px!important;border:1px solid #e0e7ef;border-radius:9px;background:#fff;box-shadow:0 2px 5px #0f172a08}
#templateDesignerModal.native-document-workspace .tpl-ribbon-group>b{color:#52667b;font-size:10px;letter-spacing:.04em;text-transform:uppercase}
#templateDesignerModal.native-document-workspace .tpl-ribbon-note{max-width:330px;align-self:stretch;border-radius:9px;background:#edf5ff;color:#3f5d79}
#templateDesignerModal.native-document-workspace .tpl-formula-bar{min-width:0;grid-template-columns:minmax(72px,110px) 32px 28px minmax(120px,1fr) 34px minmax(60px,auto)!important;gap:5px!important;border-bottom:1px solid var(--tpl-border)}
#templateDesignerModal.native-document-workspace .tpl-formula-bar input{min-width:0;min-height:32px}
#templateDesignerModal.native-document-workspace .workbook-main{grid-template-columns:minmax(0,1fr) minmax(245px,275px)!important;min-width:0!important;min-height:0!important;overflow:hidden!important;background:#e8edf4}
#templateDesignerModal.native-document-workspace .tpl-work{min-width:0!important;min-height:0!important;overflow:hidden!important}
#templateDesignerModal.native-document-workspace .tpl-grid-wrap{min-width:0!important;min-height:0!important;scrollbar-gutter:stable;overscroll-behavior:contain}
#templateDesignerModal.native-document-workspace .word-block.selected{outline:2px solid #2563eb!important;outline-offset:2px;box-shadow:0 0 0 4px #2563eb20!important}
#templateDesignerModal.native-document-workspace .tpl-properties{min-width:0!important;max-height:100%;overflow:auto!important;overscroll-behavior:contain;border-left:1px solid var(--tpl-border)!important;padding:10px!important}
#templateDesignerModal.native-document-workspace .tpl-property-card{border-color:#e0e7ef;border-radius:10px;padding:10px!important;box-shadow:0 2px 7px #102a4307}
#templateDesignerModal.native-document-workspace .tpl-property-card label{line-height:1.35}
#templateDesignerModal.native-document-workspace .tpl-property-card input:focus,#templateDesignerModal.native-document-workspace .tpl-property-card select:focus,#templateDesignerModal.native-document-workspace .tpl-property-card textarea:focus{outline:0;border-color:#60a5fa;box-shadow:0 0 0 3px #3b82f61c}
#templateDesignerModal.native-document-workspace .tpl-bottom-bar{min-width:0!important}
#templateDesignerModal.native-document-workspace .tpl-sheet-tabs{min-width:0!important;overflow:auto!important;scrollbar-width:thin;overscroll-behavior-x:contain}
#templateDesignerModal.native-document-workspace .tpl-sheet-tab{min-height:28px}
#templateDesignerModal.native-document-workspace .tpl-worksheet-tools{min-width:0;max-height:88px;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin}
#templateDesignerModal.native-document-workspace .tpl-live-sheet td.selected{outline:2px solid #2563eb!important;outline-offset:-2px;z-index:4}
#templateDesignerModal.native-document-workspace .tpl-live-sheet td.selected-range:not(.selected){box-shadow:inset 0 0 0 1px #2563eb7a, inset 0 0 0 999px #2563eb0a}
#templateDesignerModal.native-document-workspace button:focus-visible,#templateDesignerModal.native-document-workspace input:focus-visible,#templateDesignerModal.native-document-workspace select:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
@media(max-width:1050px){
  #templateDesignerModal.native-document-workspace .template-designer-head .action-row{overflow-x:auto!important;overflow-y:hidden!important;max-width:65vw;flex-wrap:nowrap!important;scrollbar-width:thin}
  #templateDesignerModal.native-document-workspace .tpl-ribbon{max-height:24vh}
  #templateDesignerModal.native-document-workspace .workbook-main{grid-template-columns:minmax(0,1fr) minmax(220px,25vw)!important}
}
@media(max-width:800px){
  #templateDesignerModal.native-document-workspace .workbook-main{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(240px,1fr) minmax(150px,22vh)!important;overflow:auto!important}
  #templateDesignerModal.native-document-workspace .tpl-work{grid-row:1;min-height:240px!important}
  #templateDesignerModal.native-document-workspace .tpl-properties{display:block!important;grid-row:2;max-height:22vh!important;border-left:0!important;border-top:1px solid var(--tpl-border)!important}
  #templateDesignerModal.native-document-workspace .tpl-formula-bar{grid-template-columns:minmax(65px,80px) 28px minmax(100px,1fr) 32px!important}
  #templateDesignerModal.native-document-workspace .tpl-formula-bar .tpl-fx,#templateDesignerModal.native-document-workspace .tpl-formula-bar .tpl-selection-label{display:none!important}
}
@media(max-width:560px){
  #templateDesignerModal.native-document-workspace .template-designer-head .action-row{max-width:100%!important}
  #templateDesignerModal.native-document-workspace .tpl-doc-title span,#templateDesignerModal.native-document-workspace .tpl-last-modified{display:none!important}
  #templateDesignerModal.native-document-workspace .tpl-ribbon{max-height:20vh}
  #templateDesignerModal.native-document-workspace .tpl-properties{max-height:25vh!important}
}

/* Help page and text-only support chat. */
.HPO-help-grid{display:grid;grid-template-columns:minmax(300px,1fr) minmax(340px,1fr);align-items:start;gap:18px}
.HPO-help-grid>.HPO-help-card{grid-row:1 / span 2;min-width:0}
.HPO-ai-card-host{min-width:0;max-width:100%}
.HPO-help-assistant{display:flex;flex-direction:column;gap:12px;min-width:0;padding:18px;border:1px solid #d8e2ee;border-radius:16px;background:linear-gradient(160deg,#fff,#f8fbff);box-shadow:0 10px 28px #1831530d}
.help-ai-heading{display:flex;align-items:flex-start;gap:12px}
.help-ai-heading h3{margin:0 0 4px;color:#173b5e}
.help-ai-heading p{margin:0;color:#53687d;line-height:1.45}
.help-ai-mark{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:#e6f0ff;color:#2563eb;font-size:21px}
.help-ai-log{display:flex;flex-direction:column;gap:9px;min-height:210px;max-height:42vh;overflow:auto;padding:4px 3px;scrollbar-gutter:stable;overscroll-behavior:contain}
.help-ai-welcome{margin:0;padding:12px 14px;border:1px solid #dce6f0;border-radius:12px;background:#fff;color:#53687d;line-height:1.5}
.help-ai-message{max-width:94%;padding:10px 13px;border:1px solid #dce6f0;border-radius:13px;background:#fff;color:#243b53;overflow-wrap:anywhere}
.help-ai-message.user{align-self:flex-end;border-color:#c6dcfb;background:#edf5ff}
.help-ai-message strong{font-size:.78rem;color:#45617d}
.help-ai-message p{margin:4px 0 0;white-space:pre-wrap;line-height:1.5}
.help-ai-waiting,.help-ai-error{margin:0;padding:10px 13px;border-radius:11px;line-height:1.45}
.help-ai-waiting{align-self:flex-start;background:#eef4fb;color:#49627b;animation:helpPulse 1.2s ease-in-out infinite alternate}
.help-ai-error{border:1px solid #fed7aa;background:#fff7ed;color:#9a3412}
.help-ai-retry{align-self:flex-start}
.help-ai-form{padding:10px;border:1px solid #d6e0eb;border-radius:12px;background:#fff}
.help-ai-form textarea{display:block;width:100%;min-height:58px;max-height:180px;resize:vertical;border:0;outline:0;background:transparent;color:#172b4d;font:inherit;line-height:1.45}
.help-ai-form-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:8px;border-top:1px solid #edf1f5}
.help-ai-form-footer small,.help-ai-privacy{color:#64748b;font-size:.78rem;line-height:1.4}
.help-ai-privacy{margin:0}
@keyframes helpPulse{from{opacity:.7}to{opacity:1}}
@media(max-width:900px){.HPO-help-grid{grid-template-columns:minmax(0,1fr)}.HPO-help-grid>.HPO-help-card{grid-row:auto}.help-ai-log{max-height:38vh}}
@media(prefers-reduced-motion:reduce){.help-ai-waiting{animation:none}}
