/* Screen layouts only: printed OHADA pages retain their document dimensions. */
@media screen {
  html { -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-padding-top:90px; }
  .shell,main,#content,#content > *, .context-controls,.panel,.settings-page,.pro-space { min-width:0; }
  #content { max-width:100%; }
  #content :is(h1,h2,h3,h4,p,label,.note,.check,.callout),.active-company-name { overflow-wrap:anywhere; }
  .top,.panel-head,.export-bar,.context-controls,.pro-status { gap:12px; }
  .action,.tabs button,.pro-tabs button,.balance-pagination button { min-height:44px; white-space:normal; line-height:1.4; justify-content:center; }
  .finance-scroll-region { position:relative; max-width:100%; min-width:0; overflow:auto; overscroll-behavior-x:contain; scrollbar-width:auto; border-radius:inherit; }
  .finance-scroll-region:focus-visible { outline:3px solid #599a7b; outline-offset:2px; }
  .finance-scroll-region table { margin-bottom:0; }
  /* Reconciliation controls must not inherit statement column proportions.
     Keep readable cells inside the existing touch/keyboard scroll region. */
  .brw-finance-ui .coherence-panel .table-wrap table.coherence-table { width:100%; min-width:1100px; table-layout:auto; }
  .brw-finance-ui .coherence-panel .coherence-table :is(th,td) { width:auto; height:auto; vertical-align:top; word-break:normal; overflow-wrap:normal; }
  .brw-finance-ui .coherence-panel .coherence-table :is(th,td):first-child { min-width:280px; white-space:normal; }
  .brw-finance-ui .coherence-panel .coherence-table td.label { overflow-wrap:break-word; }
  .brw-finance-ui .coherence-panel .coherence-table :is(th,td):nth-child(5) { min-width:175px; }
  .brw-finance-ui .coherence-panel .coherence-table :is(th,td):last-child { min-width:150px; }
  .brw-finance-ui .coherence-panel .coherence-table :is(.num,.coherence-status,.action) { white-space:nowrap; word-break:normal; overflow-wrap:normal; }
  .brw-finance-ui .coherence-panel .coherence-table .num { min-width:125px; font-variant-numeric:tabular-nums; }

  .finance-scroll-hint { position:sticky; left:0; width:100%; max-width:42rem; box-sizing:border-box; margin:0; padding:10px 14px; font-size:12px; line-height:1.5; color:#426057; background:#eff6f2; border-bottom:1px solid #d7e6de; white-space:normal; }
  .finance-scroll-hint[hidden] { display:none; }
  #content :is(.cards,.executive-cards,.finance-analysis-summary,.pro-metrics) > * { min-width:0; }
  #content :is(input,select,textarea) { box-sizing:border-box; max-width:100%; }
  #content :is(.id-grid,.settings-fields,.pro-form,.profile-form) :is(input,select,textarea) { min-width:0; width:100%; }
  dialog { box-sizing:border-box; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; overscroll-behavior:contain; }
  .suite-finance-banner { flex-wrap:wrap; gap:12px; padding-inline:max(16px,env(safe-area-inset-left)); }
  .suite-finance-banner nav { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
  .suite-finance-banner a { overflow-wrap:anywhere; }
  @media(min-width:901px) and (max-width:1200px) {
    .navigation-ready main { padding-inline:22px; }
    .navigation-ready main > .top { flex-wrap:wrap; }
    .top > div:first-child { flex:1 1 320px; min-width:0; }
    .context-controls { flex:1 1 260px; justify-content:flex-start; }
    #content :is(.executive-cards,.cards,.finance-analysis-summary) { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .settings-page .settings-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
  @media(max-width:900px) {
    .navigation-ready main { padding-inline:max(16px,env(safe-area-inset-left)); padding-bottom:calc(32px + env(safe-area-inset-bottom)); }
    .navigation-ready .app-mobile-toolbar { margin-inline:calc(-1 * max(16px,env(safe-area-inset-left))); padding-left:max(16px,env(safe-area-inset-left)); padding-top:calc(9px + env(safe-area-inset-top)); }
    .navigation-ready .side { padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
    .navigation-ready .app-menu-open,.navigation-ready .side .nav-close { min-height:44px; }
    .navigation-ready .side .nav-close { min-width:44px; width:44px; height:44px; }
    .context-controls { width:100%; justify-content:flex-start; gap:8px; }
    .active-company-name { max-width:100%; flex:1 1 100%; }
    .top .pill { max-width:100%; white-space:normal; }
    #content :is(input,select,textarea),dialog :is(input,select,textarea) { font-size:16px; }
    .finance-scroll-region { max-height:65dvh; -webkit-overflow-scrolling:touch; }
    .finance-scroll-region table { font-size:13px; }
    .finance-scroll-region :is(th,td) { padding:11px 12px; }
    .settings-page .settings-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .statement-meta > div:last-child { min-width:0; max-width:100%; }
    .company-create > label { min-width:0; flex:1 1 220px; }
    .profile-photo-editor { flex-wrap:wrap; }
  }
  @media(max-width:600px) {
    .navigation-ready main { padding-inline:max(12px,env(safe-area-inset-left)); }
    .navigation-ready .app-mobile-toolbar { margin-inline:calc(-1 * max(12px,env(safe-area-inset-left))); padding-left:max(12px,env(safe-area-inset-left)); }
    .navigation-ready .top h1 { font-size:clamp(23px,7vw,28px); }
    .top,.panel-head,.statement-meta { align-items:stretch; }
    body:has(.common-launch) > header { flex-wrap:wrap; padding:14px; gap:12px; }
    body:has(.common-launch) > header nav { overflow-wrap:anywhere; line-height:1.7; }
    .panel-head > :is(div,select,input),.panel-head > .search { width:100%; min-width:0; max-width:100%; }
    #content :is(.id-grid,.settings-fields,.profile-form,.pro-form,.finance-indicators,.insight-grid,.subscription-facts) { grid-template-columns:minmax(0,1fr)!important; }
    .settings-page .settings-index { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #content :is(.export-bar,.dashboard-lead-actions) { display:flex!important; flex-wrap:wrap; gap:8px; }
    #content :is(.export-bar,.dashboard-lead-actions) > * { flex:1 1 145px; min-width:0; }
    .model-sheet .statement-meta { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; padding-inline:14px; font-size:12px; }
    .statement-meta > div:last-child { margin-left:0; text-align:left; }
    .model-sheet .statement-meta > div:last-child { justify-self:start; text-align:left; }
    .company-create { padding:16px; align-items:stretch; }
    .company-create > label,.company-create > button { flex-basis:100%; }
    .company-create input { min-width:0; width:100%; }
    .settings-content input[type=email] { min-width:0; width:100%; }
    .settings-content label { min-width:0; max-width:100%; flex:1 1 100%; }
    .pro-account { flex-wrap:wrap; }
    .pro-account > * { min-width:0; overflow-wrap:anywhere; }
    .balance-pagination > div { flex-wrap:wrap; }
    dialog { max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
    .confirm-actions { display:flex; flex-wrap:wrap; }
    .confirm-actions > button { flex:1 1 140px; min-height:44px; }
  }
  @media(max-width:380px) {
    #content :is(.cards,.executive-cards,.finance-analysis-summary,.settings-index) { grid-template-columns:minmax(0,1fr)!important; }
    .card strong,.executive-card > strong { overflow-wrap:anywhere; }
  }
}
@media print {
  .finance-scroll-hint { display:none!important; }
  .finance-scroll-region { max-height:none!important; overflow:visible!important; }
}
