/* Invoiced UI refinement — theme palettes remain controlled by the four presets. */
html .shell,html .sidebar,html .topbar,html .page,html .footer{
  font-kerning:normal;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;
}
.nav-link,.btn,.theme-picker-button,.theme-picker-option{letter-spacing:0;font-family:inherit}
.page :is(h1,h2,h3),.sidebar :is(h1,h2,h3){text-wrap:balance}
.page p,.page td,.page label{line-height:1.55}
.theme-picker-option strong,.theme-picker-option small,.theme-picker-intro strong,.theme-picker-intro small,.theme-picker-foot{font-family:inherit}
html[data-ui-theme="ivory"] .theme-picker-menu{background:#fffdf8;border-color:#ddcebb;color:#5b4835}
html[data-ui-theme="ivory"] .theme-picker-option{color:#5b4835}
html[data-ui-theme="ivory"] .theme-picker-option strong{color:#5b4835}
html[data-ui-theme="ivory"] .theme-picker-option[aria-checked="true"]{background:#f2e8d7;border-color:#d8c7aa}
html[data-ui-theme="azure"] .theme-picker-menu{background:#f8fbfe;border-color:#c9dce9;color:#1c4760}
html[data-ui-theme="azure"] .theme-picker-option{color:#1c4760}
html[data-ui-theme="azure"] .theme-picker-option strong{color:#1c4760}
html[data-ui-theme="azure"] .theme-picker-option[aria-checked="true"]{background:#dfedf7;border-color:#b5d5ea}
html[data-ui-theme="contrast"] .theme-picker-menu{background:#fff;color:#111;border:2px solid #111}
html[data-ui-theme="contrast"] .theme-picker-option strong{color:#111}
html[data-ui-theme="contrast"] .theme-picker-option[aria-checked="true"]{background:#fff3ac;border-color:#111}
.finance-pro-hint .finance-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
@media(max-width:850px){.finance-pro-hint .finance-actions{justify-content:flex-start}}
.trial-banner{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:14px 28px 0;padding:13px 18px;background:#f2f6f1;border:1px solid #c8dccc;border-left:4px solid #46775d;border-radius:8px;color:#294334}
.trial-banner[hidden]{display:none!important}
.trial-banner strong{display:block;font-size:13px;font-weight:750;letter-spacing:0}
.trial-banner small{display:block;font-size:11px;color:#61766a;margin-top:3px}
.trial-banner-action{flex:none;display:inline-flex;align-items:center;justify-content:center;padding:9px 14px;background:#255b47;color:#fff;text-decoration:none;border-radius:6px;font-size:11px;font-weight:700}
.trial-banner.expired{background:#fff5ed;border-color:#ead1ba;border-left-color:#a16b43}
.trial-banner.expired .trial-banner-action{background:#805a39}
html[data-ui-theme="ivory"] .trial-banner{background:#faf4ea;border-color:#e4d7c6;color:#5b4731}
html[data-ui-theme="azure"] .trial-banner{background:#edf5fb;border-color:#c6dcea;color:#234963}
html[data-ui-theme="contrast"] .trial-banner{background:#fff7ce;border:2px solid #111;color:#111}
@media(max-width:620px){.trial-banner{margin:12px 12px 0;align-items:stretch;flex-direction:column}.trial-banner-action{align-self:flex-start}}

/* Help stays out of the invoice editor: compact, accessible bottom-right launcher. */
#studioMount .tax-chat-shell{position:fixed!important;inset:auto 18px 18px auto!important;margin:0!important;display:block!important;z-index:1400!important}
#studioMount .tax-chat-launch{display:flex!important;align-items:center!important;justify-content:center!important;gap:0!important;width:48px!important;height:48px!important;min-width:48px!important;padding:0!important;border-radius:50%!important;font-size:0!important;box-shadow:0 8px 22px #152e2752!important;overflow:hidden!important}
#studioMount .tax-chat-launch .tax-chat-dot{width:30px!important;height:30px!important;font-size:21px!important;line-height:30px!important;flex:none!important}
#studioMount .tax-chat-launch small{display:none!important}
#studioMount .tax-chat-panel{position:absolute!important;top:auto!important;right:0!important;bottom:60px!important;width:min(370px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;max-height:min(610px,calc(100dvh - 94px))!important;overflow:auto!important;z-index:1401!important}
#studioMount .studio-preview-expand{white-space:nowrap;font-size:11px!important;padding:8px 10px!important;margin-left:auto!important}
body.studio-preview-lock{overflow:hidden!important}
#studioMount.studio-preview-fullscreen .studio-preview-panel{position:fixed!important;inset:0!important;width:100vw!important;max-width:none!important;height:100dvh!important;z-index:1300!important;overflow:hidden!important;border-radius:0!important;background:#f4f7f4!important;display:flex!important;flex-direction:column!important;padding:14px max(14px,3vw)!important}
#studioMount.studio-preview-fullscreen .studio-preview-head{flex:none!important;display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:12px!important}
#studioMount.studio-preview-fullscreen .studio-paper-wrap{flex:1!important;min-height:0!important;max-height:none!important;width:100%!important;overflow:auto!important;display:block!important;text-align:center!important;padding:18px!important}
#studioMount.studio-preview-fullscreen .studio-paper-wrap #studioPaper{transform:none!important;zoom:1!important;margin:0 auto!important;width:794px!important;max-width:none!important;text-align:left!important}
#studioMount.studio-preview-fullscreen .studio-preview-actions{display:flex!important;flex:none!important;justify-content:center!important;margin-top:8px!important}
#studioMount.studio-preview-fullscreen .studio-fineprint{display:none!important}
@media(max-width:720px){#studioMount .tax-chat-shell{right:12px!important;bottom:12px!important}#studioMount .tax-chat-panel{bottom:58px!important}#studioMount.studio-preview-fullscreen .studio-preview-panel{padding:10px!important}#studioMount.studio-preview-fullscreen .studio-paper-wrap{padding:9px!important}#studioMount.studio-preview-fullscreen .studio-preview-head .studio-due{display:none!important}}
@media print{#studioMount .tax-chat-shell,#studioMount .studio-preview-expand{display:none!important}}

/* Owner staging review: prevent the top-bar from widening the app viewport. */
html,body{max-width:100%;overflow-x:clip}
.shell{width:100%;max-width:100vw;min-width:0}
.main-wrap,.topbar,.top-actions,.page,#pageContent{min-width:0}
.topbar{gap:clamp(8px,1.1vw,16px);padding-inline:clamp(14px,1.9vw,34px)}
.top-actions{gap:clamp(6px,.8vw,11px)}
.topbar .crumb{min-width:0;flex:1;overflow:hidden;white-space:nowrap}
.topbar .crumb strong{overflow:hidden;text-overflow:ellipsis}
.topbar .search-trigger{min-width:40px;max-width:185px}
.page .finance-layout,.page .finance-kpi-grid,.page .finance-grid{max-width:100%;min-width:0}
.page :is(.finance-panel,.finance-kpi,.finance-hint){min-width:0}
@media(max-width:1540px){.topbar .search-trigger{max-width:48px;padding-inline:11px}.topbar .search-trigger span,.topbar .search-trigger kbd{display:none}.top-actions .theme-picker-current{max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .nav-tour{font-size:11px}}
@media(max-width:1000px){.topbar .crumb{display:none}.topbar .top-actions{margin-left:auto}.topbar .top-add{padding-inline:10px}}
@media(max-width:600px){.page .finance-switcher{max-width:100%;overflow-x:auto}.page .finance-switcher>*{white-space:nowrap}}

/* Desktop responsive repair: browser zoom also reduces the effective CSS viewport.
   Keep the navigation inside its grid cell instead of widening the entire page. */
.shell,.main-wrap,#pageContent,.page,.topbar,.top-actions{box-sizing:border-box}
.main-wrap,#pageContent,.page{max-width:100%;min-width:0}
.topbar{width:100%;max-width:100%;min-width:0}
.topbar .top-actions{min-width:0;max-width:100%;flex-shrink:1}
.topbar .top-actions>*{min-width:0}
.topbar .business-switch-trigger{max-width:clamp(76px,10vw,150px)}
.topbar .business-switch-trigger #activeBusinessName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.topbar .top-add{flex-shrink:0;white-space:nowrap}
.owner-intelligence-grid{align-items:start}
.owner-intelligence-grid>*{min-width:0;max-width:100%}
.owner-data-head{min-width:0;flex-wrap:wrap}
.owner-data-head h3,.owner-data-head small{min-width:0;overflow-wrap:anywhere}
.owner-item-split{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:801px) and (max-width:1540px){
  .topbar .crumb{display:none}
  .topbar .top-actions{margin-left:auto;gap:clamp(5px,.6vw,10px)}
  .topbar .theme-control-label{display:none}
  .topbar .theme-switcher{min-width:0;width:clamp(112px,11vw,158px)}
  .topbar .theme-picker-button{min-width:0;padding-inline:8px;gap:6px}
  .topbar .search-trigger{flex:0 0 42px;width:42px;min-width:42px;max-width:42px;padding:0 9px}
  .topbar .search-trigger span:not(:first-child),.topbar .search-trigger kbd{display:none}
  .owner-intelligence-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .owner-intelligence-card:last-child{grid-column:1/-1}
}
@media (min-width:801px) and (max-width:1100px){
  .topbar .tour-launch{font-size:0;padding-inline:9px;min-width:48px}
  .topbar .tour-launch::after{content:'Tour';font-size:11px}
  .topbar .theme-switcher{width:118px}
  .owner-intelligence-grid{grid-template-columns:minmax(0,1fr)}
  .owner-intelligence-card:last-child{grid-column:auto}
}
@media (max-width:800px){
  .owner-intelligence-grid{grid-template-columns:minmax(0,1fr)}
  .owner-intelligence-card:last-child{grid-column:auto}
  .owner-item-split{gap:10px}
}
