/* BRAVOVIA Standalone v1.2.8 — settings-driven screen typography + semantic-safe contrast.
   SCREEN ONLY. It deliberately does NOT repaint semantic financial cells/cards.
   Print/PDF renderers and accounting formulas are outside this stylesheet. */

:root{
  --brv-screen-font:"Segoe UI",Arial,sans-serif;
  --brv-screen-body-size:13px;
  --brv-screen-table-size:12px;
  --brv-screen-label-size:12px;
  --brv-screen-control-size:13px;
  --brv-screen-small-size:11px;
  --brv-screen-h1-size:25px;
  --brv-screen-h2-size:20px;
  --brv-screen-h3-size:16px;
  --brv-screen-placeholder:#64748b;
  --brv-screen-neutral-muted:#475569;
  --brv-screen-nav-muted:#94a3b8;
  --brv-screen-link:#1d4ed8;
}

@media screen{
  /* Typography is user-controlled. It changes size/family only, never financial meaning/colors. */
  body.brv-ui-atlas{font-family:var(--brv-screen-font)}

  body.brv-typo-scope-both .ipl-front-app,
  body.brv-typo-scope-frontend .ipl-front-app{
    font-family:var(--brv-screen-font);
    font-size:var(--brv-screen-body-size);
  }
  body.brv-typo-scope-both .brv-admin-content,
  body.brv-typo-scope-admin .brv-admin-content{
    font-family:var(--brv-screen-font);
    font-size:var(--brv-screen-body-size);
  }

  body.brv-typo-scope-both .ipl-front-app :is(input,select,textarea,button,.button,.button-primary),
  body.brv-typo-scope-frontend .ipl-front-app :is(input,select,textarea,button,.button,.button-primary),
  body.brv-typo-scope-both .brv-admin-content :is(input,select,textarea,button,.button,.button-primary),
  body.brv-typo-scope-admin .brv-admin-content :is(input,select,textarea,button,.button,.button-primary){
    font-size:var(--brv-screen-control-size);
  }

  body.brv-typo-scope-both .ipl-front-app label,
  body.brv-typo-scope-frontend .ipl-front-app label,
  body.brv-typo-scope-both .brv-admin-content label,
  body.brv-typo-scope-admin .brv-admin-content label{
    font-size:var(--brv-screen-label-size);
  }

  /* Screen tables only. Color is intentionally NOT set here. */
  body.brv-typo-scope-both .ipl-front-app table :is(th,td),
  body.brv-typo-scope-frontend .ipl-front-app table :is(th,td),
  body.brv-typo-scope-both .brv-admin-content table :is(th,td),
  body.brv-typo-scope-admin .brv-admin-content table :is(th,td){
    font-size:var(--brv-screen-table-size);
  }

  body.brv-typo-scope-both .ipl-front-app h1,
  body.brv-typo-scope-frontend .ipl-front-app h1,
  body.brv-typo-scope-both .brv-admin-content h1,
  body.brv-typo-scope-admin .brv-admin-content h1{font-size:var(--brv-screen-h1-size)}
  body.brv-typo-scope-both .ipl-front-app h2,
  body.brv-typo-scope-frontend .ipl-front-app h2,
  body.brv-typo-scope-both .brv-admin-content h2,
  body.brv-typo-scope-admin .brv-admin-content h2{font-size:var(--brv-screen-h2-size)}
  body.brv-typo-scope-both .ipl-front-app h3,
  body.brv-typo-scope-frontend .ipl-front-app h3,
  body.brv-typo-scope-both .brv-admin-content h3,
  body.brv-typo-scope-admin .brv-admin-content h3{font-size:var(--brv-screen-h3-size)}

  body.brv-typo-scope-both :is(.ipl-front-app,.brv-admin-content) :is(small,.description,.help,.helper-text,.ipl-field-help,.ipd-help),
  body.brv-typo-scope-frontend .ipl-front-app :is(small,.description,.help,.helper-text,.ipl-field-help,.ipd-help),
  body.brv-typo-scope-admin .brv-admin-content :is(small,.description,.help,.helper-text,.ipl-field-help,.ipd-help){
    font-size:var(--brv-screen-small-size);
  }

  /* Semantic Safe is default: only neutral UI text gets a readability floor. */
  body.brv-contrast-semantic :is(.ipl-front-app,.brv-admin-content) :is(.ipl-muted,.description,.help,.helper-text,.ipl-field-help,.ipd-help){
    color:var(--brv-screen-neutral-muted);
  }
  body.brv-contrast-semantic :is(input,textarea)::placeholder,
  body.brv-contrast-strong :is(input,textarea)::placeholder{
    color:var(--brv-screen-placeholder);
    opacity:1;
    -webkit-text-fill-color:var(--brv-screen-placeholder);
  }
  body.brv-contrast-semantic :is(.ipl-front-app,.brv-admin-content) :is(.ipl-muted,.description,.help,.helper-text,.ipl-field-help,.ipd-help) a,
  body.brv-contrast-strong :is(.ipl-front-app,.brv-admin-content) :is(.ipl-muted,.description,.help,.helper-text,.ipl-field-help,.ipd-help) a{
    color:var(--brv-screen-link);
  }
  body.brv-contrast-semantic .brv-admin-nav .brv-admin-nav-group,
  body.brv-contrast-strong .brv-admin-nav .brv-admin-nav-group,
  body.brv-contrast-semantic .ipl-side-nav :is(.ipl-side-title,.brv-ui-nav-heading),
  body.brv-contrast-strong .ipl-side-nav :is(.ipl-side-title,.brv-ui-nav-heading){
    color:var(--brv-screen-nav-muted);
  }

  /* Strong mode only strengthens NEUTRAL controls. It still excludes semantic financial colors. */
  body.brv-contrast-strong :is(.ipl-front-app,.brv-admin-content) :is(.ipl-muted,.description,.help,.helper-text,.ipl-field-help,.ipd-help){
    color:var(--brv-screen-neutral-muted)!important;
  }
  body.brv-contrast-strong :is(.ipl-front-app,.brv-admin-content) :is(input,select,textarea):not([class*="success"]):not([class*="danger"]):not([class*="paid"]):not([class*="due"]){
    border-color:#94a3b8;
  }
  body.brv-contrast-strong :is(.ipl-front-app,.brv-admin-content) a:not(.button):not(.button-primary):not([class*="paid"]):not([class*="due"]):not([class*="success"]):not([class*="danger"]){
    text-decoration-thickness:1px;
    text-underline-offset:2px;
  }

  /* Legacy mode intentionally applies no v1.2.8 contrast repaint. */

  /* Two component-specific fixes that do not alter semantic table/card colors. */
  body.brv-ui-atlas button[name="ipl_add_product"]{background:#15803d!important;border-color:#15803d!important;color:#fff!important}
  body.brv-ui-atlas :is(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid #7c3aed!important;outline-offset:2px!important;box-shadow:none!important}

  /* Keep the v1.2.7 safe performance work, without forcing a header background color. */
  body.brv-ui-frontend .ipl-app-topbar.ipl-solution-header{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  @supports (content-visibility:auto){
    body.brv-ui-frontend .ipl-app-main :is(
      .brv-table-scroll,.ipl-dash-panel,.ipl-recent-table,.ipl-chart-card,
      .payment-list-panel,.current-list-panel,.bb-formula-slide,.bb-wallet-slide,
      .bb-central-sync-panel,.ipl-full-panel,.ipl-mirror-card,.ipl-role-scroll
    ),
    body.brv-ui-admin .brv-admin-content :is(
      .brv-table-scroll,.ipl-card,.card,.ipl-mirror-card,.ipl-role-scroll,.ipl-ui-checkgrid
    ){
      content-visibility:auto;
      contain-intrinsic-size:280px;
    }
  }
  body.brv-ui-atlas :is(a,button,input[type="button"],input[type="submit"],.button,.button-primary){touch-action:manipulation}
}
