/*
 * Baltique OS Core 2.4.1.1
 * Official Light Visual System — Magdalena reference palette.
 *
 * Palette sampled from the approved premium patient-experience artwork:
 * canvas      #F4EEE9
 * canvas soft #F8F3EF
 * surface     #FFFDFC
 * surface 2   #FAF5F1
 * surface 3   #F2EAE5
 * line        #E0D2C7
 * line strong #CDB6A7
 * accent      #9D6258
 * accent soft #F0DDD7
 * accent pale #F8ECE8
 * text        #2F261E
 * text muted  #6E6058
 * gold        #8A6737
 *
 * This stylesheet is intentionally loaded last. It normalises legacy dark-only
 * modules without changing the official dark theme.
 */

html:not([data-theme="dark"]){
  --balt-bg:#F4EEE9;
  --balt-bg-soft:#F8F3EF;
  --balt-canvas:#F4EEE9;
  --balt-canvas-soft:#F8F3EF;
  --balt-panel:#FFFDFC;
  --balt-panel-2:#FAF5F1;
  --balt-panel-3:#F2EAE5;
  --balt-sidebar-bg:#F7EEE8;
  --balt-topbar-bg:rgba(255,253,252,.97);
  --balt-input-bg:#FFFDFC;
  --balt-border:#E0D2C7;
  --balt-border-strong:#CDB6A7;
  --balt-border-soft:rgba(157,98,88,.18);
  --balt-text:#2F261E;
  --balt-text-strong:#211A15;
  --balt-muted:#6E6058;
  --balt-subtle:#796B63;
  --balt-hover:#F4E4DE;
  --balt-selected:#F0DDD7;
  --balt-accent:#9D6258;
  --balt-accent-hover:#875149;
  --balt-accent-strong:#7D463F;
  --balt-accent-soft:#F0DDD7;
  --balt-accent-pale:#F8ECE8;
  --balt-accent-text:#FFFFFF;
  --balt-gold:#8A6737;
  --balt-gold-soft:#F2E7D3;
  --balt-link:#8C4E45;
  --balt-link-hover:#6F3A33;
  --balt-focus:#A66B61;
  --balt-danger:#9B3F4B;
  --balt-danger-bg:#FCEDEF;
  --balt-success:#3F704F;
  --balt-success-bg:#EDF6F0;
  --balt-warning:#8A5D20;
  --balt-warning-bg:#FFF5E3;
  --balt-info:#5E6672;
  --balt-info-bg:#F1F3F6;
  --balt-shadow-sm:0 1px 2px rgba(63,43,34,.04),0 4px 14px rgba(63,43,34,.05);
  --balt-shadow:0 14px 38px rgba(82,55,44,.10);
  --balt-shadow-lg:0 24px 64px rgba(82,55,44,.14);
  --bg:#F4EEE9;
  --panel:#FFFDFC;
  --card:#FFFDFC;
  --text:#2F261E;
  --muted:#6E6058;
  --line:#E0D2C7;
  --sidebar:#F7EEE8;
  --topbar:#FFFDFC;
  --input:#FFFDFC;
  --pro-surface:#FFFDFC;
  --pro-surface-2:#FAF5F1;
  --pro-line:#E0D2C7;
  --pro-muted:#6E6058;
  color-scheme:light;
  accent-color:#9D6258;
}

/* ---------- Global canvas and shell ---------- */
html:not([data-theme="dark"]),
html:not([data-theme="dark"]) body,
html:not([data-theme="dark"]) body.strategy-bg,
html:not([data-theme="dark"]) .shell,
html:not([data-theme="dark"]) .main,
html:not([data-theme="dark"]) .page,
html:not([data-theme="dark"]) .page-wrap,
html:not([data-theme="dark"]) .content,
html:not([data-theme="dark"]) .content-area,
html:not([data-theme="dark"]) .app-shell,
html:not([data-theme="dark"]) .workspace-shell{
  background:#F4EEE9!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) body.strategy-bg{
  background:
    radial-gradient(circle at 88% 3%,rgba(196,141,129,.10),transparent 30%),
    radial-gradient(circle at 8% 92%,rgba(224,210,199,.36),transparent 34%),
    linear-gradient(180deg,#F8F3EF 0%,#F4EEE9 100%)!important;
}
html:not([data-theme="dark"]) .shell{
  background:linear-gradient(90deg,#F7EEE8 0,var(--balt-sidebar-width,280px),#F4EEE9 var(--balt-sidebar-width,280px),#F4EEE9 100%)!important;
}

/* ---------- Sidebar ---------- */
html:not([data-theme="dark"]) :where(.sidebar,.side-nav,.app-sidebar,.main-sidebar,.navigation-panel){
  background:linear-gradient(180deg,#FBF5F1 0%,#F7EEE8 100%)!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
  box-shadow:10px 0 30px rgba(82,55,44,.045)!important;
}
html:not([data-theme="dark"]) :where(.sidebar .brand,.sidebar .side-foot,.sidebar .nav,.sidebar .nav-group,.sidebar details,.sidebar details[open]){
  background:transparent!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) .sidebar .brand{
  border-bottom:1px solid #E0D2C7!important;
}
html:not([data-theme="dark"]) :where(.sidebar summary,.sidebar a,.sidebar span,.sidebar small,.sidebar label,.sidebar strong){
  color:#5E514A!important;
}
html:not([data-theme="dark"]) :where(.sidebar a:hover,.sidebar a.active,.sidebar summary:hover,.sidebar details[open]>summary){
  background:#F0DDD7!important;
  color:#2F261E!important;
  border-color:#D9BFB5!important;
}
html:not([data-theme="dark"]) .sidebar a.active{
  box-shadow:inset 3px 0 0 #9D6258!important;
}
html:not([data-theme="dark"]) .sidebar :where(svg,path){
  color:currentColor;
}

/* ---------- Top bar ---------- */
html:not([data-theme="dark"]) :where(.topbar,.app-topbar,.header-bar,.main-header){
  background:rgba(255,253,252,.97)!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
  box-shadow:0 1px 0 rgba(82,55,44,.06),0 10px 28px rgba(82,55,44,.05)!important;
  backdrop-filter:blur(18px) saturate(1.08);
}
html:not([data-theme="dark"]) :where(.topbar form,.topbar .userbox,.topbar .balt-user-identity){
  background:transparent!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) .balt-user-identity strong{color:#211A15!important}
html:not([data-theme="dark"]) .balt-user-identity small{color:#6E6058!important}

/* ---------- Search: visible frame and visible left edge of button ---------- */
html:not([data-theme="dark"]) :where(form.search,.search-form,.global-search,.patient-search,.search-box,.searchbar,.balt-search-form){
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:stretch!important;
  min-height:42px!important;
  background:#FFFDFC!important;
  border:1px solid #CDB6A7!important;
  border-radius:12px!important;
  box-shadow:0 1px 0 rgba(255,255,255,.9),0 5px 16px rgba(82,55,44,.06)!important;
  overflow:hidden!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) :where(form.search,.search-form,.global-search,.patient-search,.search-box,.searchbar,.balt-search-form) :where(input[type="search"],input[type="text"],input:not([type])){
  min-width:0!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:#FFFDFC!important;
  color:#2F261E!important;
  box-shadow:none!important;
  outline:0!important;
}
html:not([data-theme="dark"]) :where(form.search,.search-form,.global-search,.patient-search,.search-box,.searchbar,.balt-search-form) button{
  align-self:stretch!important;
  min-width:88px!important;
  margin:0!important;
  border:0!important;
  border-left:1px solid #BFA398!important;
  border-radius:0!important;
  background:#9D6258!important;
  color:#FFF!important;
  box-shadow:none!important;
  font-weight:750!important;
}
html:not([data-theme="dark"]) :where(form.search,.search-form,.global-search,.patient-search,.search-box,.searchbar,.balt-search-form) button:hover{
  background:#875149!important;
}
html:not([data-theme="dark"]) :where(form.search,.search-form,.global-search,.patient-search,.search-box,.searchbar,.balt-search-form):focus-within{
  border-color:#9D6258!important;
  box-shadow:0 0 0 3px rgba(157,98,88,.16),0 8px 22px rgba(82,55,44,.08)!important;
}

/* ---------- Surfaces ---------- */
html:not([data-theme="dark"]) :where(
  .card,.panel,.box,.tile,.widget,.surface,.section-card,.content-card,
  .enterprise-panel,.enterprise-card,.hero,.kpi,.kpi-card,.stat-card,
  .workspace-kpis article,.role-module-card,.modal,.modal-content,.drawer,.sheet,
  .popover,.dropdown-menu,.menu-panel,.mobile-card,.enterprise-check,
  .enterprise-actions,.theme-preview,.notice,.callout,.summary-card,.detail-card,
  .filter-card,.form-card,.table-card,.chart-card,.dashboard-card,.patient-card,
  .booking-card,.op-public-card,.public-card,.pay-card,.pro-card,.pro-hero,
  .pro-requirement,.pro-details,.pro-empty,.pro-callout,.pro-table-wrap
){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
  box-shadow:var(--balt-shadow-sm)!important;
}
html:not([data-theme="dark"]) :where([class$="-card"],[class*="-card "],[class$="__card"],[class*="__card "]){
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) :where(.hero,.enterprise-hero,.role-workspace-hero,.pro-hero){
  background:linear-gradient(135deg,#FFFDFC 0%,#F8ECE8 100%)!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) :where(.card:hover,.tile:hover,.role-module-card:hover,.dashboard-card:hover){
  border-color:#CDB6A7!important;
}

/* ---------- Typography: never white/yellow on a light canvas ---------- */
html:not([data-theme="dark"]) body :where(h1,h2,h3,h4,h5,h6,legend,summary,.title,.page-title,.section-title,.card-title,.panel-title,.hero-title,.heading,.headline,.modal-title,.drawer-title,.pro-phase-title){
  color:#211A15!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body :where(p,li,dt,dd,label,caption,figcaption,.body-copy,.description,.copy,.text){
  color:#4E423B!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body :where(small,.muted,.help,.hint,.subtitle,.subtle,.meta,.eyebrow,.supporting-text,.secondary-text){
  color:#6E6058!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body :where(strong,b){color:#2F261E}
html:not([data-theme="dark"]) body a:not(.btn):not(.button):not(.badge):not(.pill):not(.chip):not(.tag){
  color:#8C4E45;
}
html:not([data-theme="dark"]) body a:not(.btn):not(.button):hover{color:#6F3A33}
html:not([data-theme="dark"]) hr{border-color:#E0D2C7!important}

/* Common legacy light/gold text colours overridden only in the light theme. */
html:not([data-theme="dark"]) .main :where(
  [style*="color:#fff" i],[style*="color: #fff" i],[style*="color:white" i],[style*="color: white" i],
  [style*="color:#ffffff" i],[style*="color: #ffffff" i],
  [style*="color:#eef5ff" i],[style*="color: #eef5ff" i],
  [style*="color:#d7b56d" i],[style*="color: #d7b56d" i],
  [style*="color:#e5c986" i],[style*="color: #e5c986" i],
  [style*="color:#f4ca73" i],[style*="color: #f4ca73" i]
){
  color:#2F261E!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) .main :where(.gold-text,.text-gold,.text-light,.text-white,.white-text,.light-text){
  color:#6E4D2C!important;
  text-shadow:none!important;
}

/* ---------- Forms ---------- */
html:not([data-theme="dark"]) :where(input,select,textarea,.input,.select,.textarea,[contenteditable="true"]){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border:1px solid #CDB6A7!important;
  caret-color:#2F261E!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8)!important;
}
html:not([data-theme="dark"]) :where(input,select,textarea,[contenteditable="true"]):hover{
  border-color:#B99486!important;
}
html:not([data-theme="dark"]) :where(input,select,textarea,[contenteditable="true"]):focus{
  border-color:#9D6258!important;
  outline:3px solid rgba(157,98,88,.16)!important;
  outline-offset:1px!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) :where(input,textarea)::placeholder{color:#83756D!important;opacity:1}
html:not([data-theme="dark"]) :where(option,optgroup){background:#FFFDFC!important;color:#2F261E!important}
html:not([data-theme="dark"]) :where(input,select,textarea):disabled{
  background:#F2EAE5!important;
  color:#796B63!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) fieldset{
  border-color:#E0D2C7!important;
  background:rgba(255,253,252,.45)!important;
}
html:not([data-theme="dark"]) label{color:#4E423B!important}

/* ---------- Buttons ---------- */
html:not([data-theme="dark"]) :where(.btn,.button,button,input[type="submit"],input[type="button"]){
  border:1px solid #CDB6A7!important;
  background:#FFFDFC!important;
  color:#2F261E!important;
  box-shadow:0 2px 8px rgba(82,55,44,.055)!important;
}
html:not([data-theme="dark"]) :where(.btn,.button,button,input[type="submit"],input[type="button"]):hover{
  background:#F8ECE8!important;
  border-color:#B99486!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) :where(.btn.primary,.button.primary,button.primary,.btn.gold,.button.gold,button.gold,.booking-btn.gold,.cta-primary){
  background:#9D6258!important;
  color:#FFF!important;
  border-color:#9D6258!important;
}
html:not([data-theme="dark"]) :where(.btn.primary,.button.primary,button.primary,.btn.gold,.button.gold,button.gold,.booking-btn.gold,.cta-primary):hover{
  background:#875149!important;
  color:#FFF!important;
  border-color:#875149!important;
}
html:not([data-theme="dark"]) :where(.btn.secondary,.button.secondary){
  background:#F8ECE8!important;
  color:#7D463F!important;
  border-color:#D9BFB5!important;
}
html:not([data-theme="dark"]) :where(.btn.danger,.button.danger,button.danger){background:#FCEDEF!important;color:#8C3040!important;border-color:#E8BFC5!important}
html:not([data-theme="dark"]) :where(.btn.success,.button.success,button.success){background:#EDF6F0!important;color:#315D3E!important;border-color:#BFD9C8!important}

/* ---------- Tables ---------- */
html:not([data-theme="dark"]) :where(table,.table,.data-table,.pro-table){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) :where(thead,th,.table th,.data-table th,.pro-table th){
  background:#F2EAE5!important;
  color:#2F261E!important;
  border-color:#DCCABE!important;
}
html:not([data-theme="dark"]) :where(tbody,tr,td,.table td,.data-table td,.pro-table td){
  color:#3F342E!important;
  border-color:#E8DDD5!important;
}
html:not([data-theme="dark"]) tbody tr:nth-child(even){background:#FCF8F5!important}
html:not([data-theme="dark"]) tbody tr:hover{background:#F8ECE8!important}

/* ---------- Badges / semantic messages ---------- */
html:not([data-theme="dark"]) :where(.badge,.pill,.chip,.tag,.status-badge,.pro-badge){
  background:#F2EAE5!important;
  color:#51443D!important;
  border-color:#DCCABE!important;
}
html:not([data-theme="dark"]) :where(.success,.ok,.pass,.badge.success,.badge.green,.pro-badge-pass,.pro-decision-go){
  background:#EDF6F0!important;color:#315D3E!important;border-color:#BFD9C8!important;
}
html:not([data-theme="dark"]) :where(.warning,.warn,.badge.warning,.badge.yellow,.pro-badge-warning,.pro-decision-hold){
  background:#FFF5E3!important;color:#7B511A!important;border-color:#E7D1A7!important;
}
html:not([data-theme="dark"]) :where(.danger,.error,.fail,.badge.danger,.badge.red,.pro-badge-fail,.pro-decision-nogo){
  background:#FCEDEF!important;color:#8C3040!important;border-color:#E8BFC5!important;
}
html:not([data-theme="dark"]) :where(.info,.badge.info){background:#F1F3F6!important;color:#4E5967!important;border-color:#D3D8DF!important}
html:not([data-theme="dark"]) :where(.flash,.alert,.notice,.message,.toast){
  background:#FFFDFC!important;
  color:#3F342E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) :where(.flash.success,.alert-success,.notice.success){background:#EDF6F0!important;color:#315D3E!important;border-color:#BFD9C8!important}
html:not([data-theme="dark"]) :where(.flash.warning,.alert-warning,.notice.warning){background:#FFF5E3!important;color:#7B511A!important;border-color:#E7D1A7!important}
html:not([data-theme="dark"]) :where(.flash.danger,.alert-danger,.notice.danger,.error-box){background:#FCEDEF!important;color:#8C3040!important;border-color:#E8BFC5!important}

/* ---------- Professional Clinical Operations ---------- */
html:not([data-theme="dark"]) :where(.pro-hero,.pro-card,.pro-table-wrap,.pro-requirement,.pro-details,.pro-empty,.pro-subnav a,.pro-filter a,.pro-callout){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
  box-shadow:var(--balt-shadow-sm)!important;
}
html:not([data-theme="dark"]) .pro-hero{background:linear-gradient(135deg,#FFFDFC,#F8ECE8)!important}
html:not([data-theme="dark"]) .pro-hero-mark{background:#F0DDD7!important;border-color:#C99D90!important;color:#7D463F!important}
html:not([data-theme="dark"]) .pro-subnav a:hover,
html:not([data-theme="dark"]) .pro-subnav a.active,
html:not([data-theme="dark"]) .pro-filter a.active{
  background:#F0DDD7!important;
  color:#6F3A33!important;
  border-color:#C99D90!important;
}
html:not([data-theme="dark"]) .pro-progress{background:#E9DDD4!important}
html:not([data-theme="dark"]) .pro-progress>span{background:#9D6258!important}
html:not([data-theme="dark"]) .pro-callout{background:#F8ECE8!important}
html:not([data-theme="dark"]) .pro-callout.warning{background:#FFF5E3!important}
html:not([data-theme="dark"]) .pro-callout.danger{background:#FCEDEF!important}
html:not([data-theme="dark"]) .pro-callout.success{background:#EDF6F0!important}

/* ---------- Location / language / theme switches ---------- */
html:not([data-theme="dark"]) .site-context-switch select{
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#CDB6A7!important;
}
html:not([data-theme="dark"]) .site-context-switch label>span{color:#6E6058!important}
html:not([data-theme="dark"]) .balt-theme-switch{
  background:#FAF5F1!important;
  border-color:#DCCABE!important;
}
html:not([data-theme="dark"]) .balt-theme-switch button{
  background:transparent!important;
  color:#6E6058!important;
  border:0!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) .balt-theme-switch button.active{
  background:#9D6258!important;
  color:#FFF!important;
}
.balt-locale-switch{
  display:grid!important;
  grid-template-columns:42px 42px!important;
  width:88px!important;
  min-width:88px!important;
  max-width:88px!important;
  flex:0 0 88px!important;
  gap:4px!important;
  overflow:visible!important;
  position:relative!important;
  z-index:12!important;
}
.balt-locale-switch a{
  display:grid!important;
  place-items:center!important;
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:36px!important;
  padding:0!important;
  box-sizing:border-box!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  border:1px solid transparent;
  border-radius:9px;
}
html:not([data-theme="dark"]) .balt-locale-switch a{color:#6E6058!important}
html:not([data-theme="dark"]) .balt-locale-switch a.active{
  background:#F0DDD7!important;
  border-color:#D9BFB5!important;
  color:#6F3A33!important;
}

/* ---------- Public patient-facing pages ---------- */
html:not([data-theme="dark"]) :where(.op-public-shell,.public-shell,.consent-public,.booking-shell,.intake-shell,.pretriage-shell,.photo-shell,.guide-error){
  background:#F4EEE9!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) :where(.booking-hero,.op-public-hero,.public-hero){
  background:linear-gradient(135deg,#FFFDFC,#F8ECE8)!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) :where(.booking-card,.op-public-card,.public-card,.pay-card){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}

/* ---------- Automatic accessibility classes from JS ---------- */
html:not([data-theme="dark"]) .balt-auto-contrast-dark{color:#2F261E!important;text-shadow:none!important}
html:not([data-theme="dark"]) .balt-auto-contrast-muted{color:#6E6058!important;text-shadow:none!important}
html:not([data-theme="dark"]) .balt-auto-visible-border{
  border-color:#CDB6A7!important;
  box-shadow:0 0 0 1px rgba(205,182,167,.22)!important;
}
html:not([data-theme="dark"]) .balt-auto-surface{
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}

/* ---------- Reduced motion, focus and mobile ---------- */
html:not([data-theme="dark"]) :focus-visible{
  outline:3px solid rgba(157,98,88,.36)!important;
  outline-offset:2px!important;
}
*{scrollbar-color:#CDB6A7 #F4EEE9}
@media(max-width:1100px){
  .topbar{grid-template-columns:minmax(180px,280px) minmax(220px,1fr) auto!important}
}
@media(max-width:900px){
  .topbar{grid-template-columns:1fr!important}
  .topbar .userbox{width:100%;justify-content:flex-start!important;flex-wrap:wrap!important}
  .balt-locale-switch{margin-left:0!important}
  html:not([data-theme="dark"]) .shell{background:#F4EEE9!important}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
@media print{
  html,body{background:#FFF!important;color:#000!important;color-scheme:light}
  .card,.panel,.enterprise-panel,.hero,table,th,td{background:#FFF!important;color:#000!important;border-color:#999!important;box-shadow:none!important}
}

/* Appearance centre. */
.balt-palette-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px}
.balt-palette-swatch{display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto auto;column-gap:12px;align-items:center;padding:12px;border:1px solid var(--balt-border,#E0D2C7);border-radius:14px;background:var(--balt-panel-2,#FAF5F1)}
.balt-palette-swatch>span{grid-row:1/3;width:48px;height:48px;border-radius:12px;border:1px solid rgba(47,38,30,.12);box-shadow:inset 0 0 0 1px rgba(255,255,255,.55)}
.balt-palette-swatch strong{font-size:13px;text-transform:capitalize;color:var(--balt-text-strong,#211A15)}
.balt-palette-swatch small{color:var(--balt-muted,#6E6058)}

/* ========================================================================== 
   AUTHORITATIVE LIGHT CASCADE
   High-specificity rules intentionally override historical dark-only !important
   declarations from app.css, enterprise_bundle_210.css and module-local styles.
   ========================================================================== */
html:not([data-theme="dark"]) body.balt-visual-system-2402{
  background:#F4EEE9!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.main,.content,.content-area,.page,.page-wrap,.workspace,.workspace-main){
  background-color:#F4EEE9!important;
  color:#2F261E!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.sidebar,.side-nav,.app-sidebar,.main-sidebar,.navigation-panel){
  background:linear-gradient(180deg,#FBF5F1 0%,#F7EEE8 100%)!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.topbar,.app-topbar,.header-bar,.main-header){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}

/* The topbar patient search has a complete frame and a visible input/button seam. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar form.search,
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar .search,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.patient-search,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.global-search,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.search-form{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:0!important;
  padding:0!important;
  min-height:42px!important;
  border:1px solid #BFA398!important;
  border-radius:12px!important;
  background:#FFFDFC!important;
  overflow:hidden!important;
  box-shadow:0 1px 0 rgba(255,255,255,.95),0 6px 18px rgba(82,55,44,.07)!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar form.search input,
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar .search input,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.patient-search input,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.global-search input,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.search-form input{
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  margin:0!important;
  padding:10px 14px!important;
  border:0!important;
  border-radius:0!important;
  background:#FFFDFC!important;
  color:#2F261E!important;
  outline:0!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar form.search button,
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar .search button,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.patient-search button,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.global-search button,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.search-form button{
  align-self:stretch!important;
  min-width:88px!important;
  margin:0!important;
  padding:9px 16px!important;
  border:0!important;
  border-left:1px solid #7D463F!important;
  border-radius:0!important;
  background:#9D6258!important;
  color:#FFF!important;
  box-shadow:none!important;
  font-weight:750!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar form.search:focus-within,
html:not([data-theme="dark"]) body.balt-visual-system-2402 .topbar .search:focus-within,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.patient-search:focus-within,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.global-search:focus-within,
html:not([data-theme="dark"]) body.balt-visual-system-2402 form.search-form:focus-within{
  border-color:#9D6258!important;
  box-shadow:0 0 0 3px rgba(157,98,88,.18),0 8px 22px rgba(82,55,44,.08)!important;
}

/* Legacy title and copy colours. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  h1,h2,h3,h4,h5,h6,.page-title h1,.page-title h2,.panel h2,.panel h3,
  .patient-hero h1,.login-card h1,.install-panel h1,.kpi strong,
  .pro-hero h1,.pro-card h2,.pro-card h3,.uni-card h2,.uni-card h3,
  .enterprise-hero h1,.workspace-hero h1,.card-title,.panel-title,.section-title
){
  color:#211A15!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  p,li,dt,dd,label,legend,summary,caption,figcaption,.page-title p,.panel p,
  .message-list strong,.message-list p,.uni-list strong,.uni-search-result strong
){
  color:#4E423B!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  small,.muted,.help,.hint,.meta,.subtle,.subtitle,.eyebrow,.supporting-text,
  .page-title small,.panel small,.kpi small,.kpi em,.message-list small,
  .uni-list small,.uni-search-result small
){
  color:#6E6058!important;
  text-shadow:none!important;
}

/* Inline legacy white/gold copy on light surfaces, excluding semantic controls. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  [style*="color:#fff" i],[style*="color: #fff" i],[style*="color:white" i],[style*="color: white" i],
  [style*="color:#ffffff" i],[style*="color: #ffffff" i],
  [style*="color:#eef5ff" i],[style*="color: #eef5ff" i],
  [style*="color:#d7b56d" i],[style*="color: #d7b56d" i],
  [style*="color:#e5c986" i],[style*="color: #e5c986" i],
  [style*="color:#f4ca73" i],[style*="color: #f4ca73" i]
):not(button):not(.btn):not(.button):not(.badge):not(.pill):not(.chip):not(.tag){
  color:#2F261E!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.gold-text,.text-gold,.text-light,.text-white,.white-text,.light-text):not(.btn):not(.button):not(.badge){
  color:#6E4D2C!important;
  text-shadow:none!important;
}

/* Historical dark-only surfaces. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  .page-title,.panel,.kpi,.login-card,.install-panel,.patient-hero,
  .uni-card,.uni-list article,.uni-search-result,.uni-table,.uni-pre,
  .pro-hero,.pro-card,.pro-table-wrap,.pro-requirement,.pro-details,.pro-empty,.pro-callout,
  .card,.box,.tile,.widget,.modal,.modal-content,.drawer,.sheet,.popover,.dropdown-menu,
  .booking-card,.op-public-card,.public-card,.pay-card,.notice,.callout
){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border-color:#E0D2C7!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.uni-table thead th,.pro-table thead th,table thead th){
  background:#F2EAE5!important;
  color:#2F261E!important;
  border-color:#DCCABE!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.uni-table td,.uni-table th,.pro-table td,.pro-table th,table td,table th){
  color:#3F342E!important;
  border-color:#E8DDD5!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.notice,.form-grid .notice,.uni-callout){
  background:#F8ECE8!important;
  color:#6E4D2C!important;
  border-color:#D9BFB5!important;
}

/* Inputs and controls need a visible perimeter even under old border:0!important rules. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(input,select,textarea,[contenteditable="true"]):not([type="hidden"]){
  background:#FFFDFC!important;
  color:#2F261E!important;
  border:1px solid #CDB6A7!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85)!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.btn,.button,button,input[type="submit"],input[type="button"]){
  border:1px solid #CDB6A7!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  .btn.primary,.button.primary,button.primary,.btn.gold,.button.gold,button.gold,
  .booking-btn.gold,.cta-primary,.balt-theme-switch button.active
){
  background:#9D6258!important;
  border-color:#9D6258!important;
  color:#FFF!important;
}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(
  .btn.primary,.button.primary,button.primary,.btn.gold,.button.gold,button.gold,
  .booking-btn.gold,.cta-primary,.balt-theme-switch button.active
) :where(span,strong,b,small,svg){
  color:inherit!important;
}

/* Semantic badges keep readable colours instead of being darkened by title guards. */
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.badge.green,.badge.paid,.badge.confirmed,.badge.done,.badge.ok,.success){color:#315D3E!important}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.badge.yellow,.badge.payment_pending,.badge.reserved,.badge.open,.badge.warn,.warning){color:#7B511A!important}
html:not([data-theme="dark"]) body.balt-visual-system-2402 :where(.badge.red,.badge.cancelled,.badge.failed,.badge.fail,.badge.danger,.danger){color:#8C3040!important}

/* Fixed geometry of language/theme controls in both languages. */
html body .topbar .userbox .balt-locale-switch{
  display:grid!important;
  grid-template-columns:42px 42px!important;
  width:88px!important;
  min-width:88px!important;
  max-width:88px!important;
  flex:0 0 88px!important;
  gap:4px!important;
  overflow:visible!important;
}
html body .topbar .userbox .balt-locale-switch a{
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  padding:0!important;
}

/* ========================================================================== 
   Baltique OS Core 2.4.1.1 — Precision premium sweep
   Approved Rose & Cream patient-experience visual language.
   ========================================================================== */
html:not([data-theme="dark"]){
  --balt-font-ui:Inter,"Avenir Next","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --balt-font-display:"Iowan Old Style","Baskerville","Palatino Linotype","Book Antiqua",Georgia,serif;
  --balt-radius-xs:9px;
  --balt-radius-sm:12px;
  --balt-radius-md:16px;
  --balt-radius-lg:22px;
  --balt-space-1:6px;
  --balt-space-2:10px;
  --balt-space-3:14px;
  --balt-space-4:18px;
  --balt-space-5:24px;
  --balt-space-6:32px;
  --balt-control-h:42px;
}
html:not([data-theme="dark"]) body,
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) button{font-family:var(--balt-font-ui)!important}
html:not([data-theme="dark"]) body :where(h1,h2,.display-title,.patient-journey-title,.login-brand h1){
  font-family:var(--balt-font-display)!important;
  font-weight:500!important;
  letter-spacing:-.018em!important;
}
html:not([data-theme="dark"]) body :where(h3,h4,h5,h6,.card-title,.panel-title,.section-title){
  font-family:var(--balt-font-ui)!important;
  font-weight:720!important;
  letter-spacing:-.01em!important;
}
html:not([data-theme="dark"]) body{font-size:15px;line-height:1.55}
html:not([data-theme="dark"]) body *{box-sizing:border-box}
html:not([data-theme="dark"]) body :where(.main,.content,.page,.page-wrap,.content-area)>*{min-width:0}

/* Navigation labels — no legacy bright gold/yellow copy. */
html:not([data-theme="dark"]) body :where(.sidebar,.enterprise-nav-runtime) :where(summary,.nav-group>summary,.nav-section-title,.group-label){
  color:#69564D!important;
  font-size:11px!important;
  font-weight:800!important;
  letter-spacing:.105em!important;
  text-transform:uppercase!important;
  text-shadow:none!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime details.nav-group{
  margin:4px 10px 8px!important;
  padding:2px!important;
  border:1px solid transparent!important;
  border-radius:14px!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime details.nav-group[open]{
  background:rgba(255,253,252,.62)!important;
  border-color:#E7DAD1!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime details.nav-group>summary{
  padding:10px 12px!important;
  border-radius:10px!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime a{
  min-height:42px!important;
  margin:3px 5px!important;
  padding:10px 12px!important;
  border:1px solid transparent!important;
  border-radius:11px!important;
  color:#554841!important;
  font-weight:620!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime a:hover{
  background:#F8ECE8!important;
  border-color:#E5CFC7!important;
  color:#6F3A33!important;
}
html:not([data-theme="dark"]) body .enterprise-nav-runtime a.active{
  background:linear-gradient(135deg,#F0DDD7,#F8ECE8)!important;
  border-color:#D9BFB5!important;
  color:#6F3A33!important;
  box-shadow:inset 3px 0 0 #9D6258,0 6px 15px rgba(99,57,47,.06)!important;
}
html:not([data-theme="dark"]) body :where(.nav-mini-flag,.nav-status,.route-health){
  color:#7B564C!important;
  background:#F1E3DD!important;
  border-color:#D7BFB6!important;
}

/* Premium page rhythm and aligned actions. */
html:not([data-theme="dark"]) body :where(.main,.content,.content-area,.page,.page-wrap){
  padding-top:clamp(18px,2.5vw,32px);
}
html:not([data-theme="dark"]) body :where(.hero,.enterprise-hero,.pro-hero,.role-workspace-hero){
  padding:clamp(22px,3vw,34px)!important;
  border-radius:24px!important;
  border:1px solid #E0D2C7!important;
  gap:24px!important;
  overflow:visible!important;
}
html:not([data-theme="dark"]) body :where(.hero,.enterprise-hero,.pro-hero) :where(h1,h2){margin:0 0 10px!important}
html:not([data-theme="dark"]) body :where(.hero,.enterprise-hero,.pro-hero) p{margin:0!important;max-width:900px!important}
html:not([data-theme="dark"]) body :where(.hero-actions,.ce220-actions,.enterprise-actions,.pro-actions,.form-actions,.sandbox-finalize){
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  min-width:0!important;
}
html:not([data-theme="dark"]) body :where(.hero-actions,.ce220-actions){align-self:center!important}
html:not([data-theme="dark"]) body :where(.enterprise-actions,.pro-actions,.form-actions){padding:4px!important}
html:not([data-theme="dark"]) body :where(.section-head,.enterprise-table-head,.pro-card-header){
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:18px!important;
  flex-wrap:wrap!important;
  margin-bottom:18px!important;
}
html:not([data-theme="dark"]) body :where(.section-head>div,.pro-card-header>div){min-width:0;flex:1 1 260px}
html:not([data-theme="dark"]) body :where(.section-head form,.pro-card-header form){margin:0!important}

/* Cards: consistent geometry, spacing and no buttons glued to corners. */
html:not([data-theme="dark"]) body :where(.enterprise-panel,.enterprise-card,.pro-card,.ce220-module,.ce220-kpi,.uat-role-card,.uat-finding,.check-card,.sandbox-scenario,.sandbox-run-card){
  border:1px solid #E0D2C7!important;
  border-radius:18px!important;
  background:#FFFDFC!important;
  color:#2F261E!important;
  box-shadow:0 1px 2px rgba(63,43,34,.035),0 10px 28px rgba(63,43,34,.055)!important;
  min-width:0!important;
  overflow:visible!important;
}
html:not([data-theme="dark"]) body :where(.enterprise-panel,.pro-card){padding:clamp(18px,2vw,24px)!important}
html:not([data-theme="dark"]) body :where(.ce220-module,.ce220-kpi,.uat-role-card,.uat-finding,.check-card,.sandbox-scenario,.sandbox-run-card){padding:18px!important}
html:not([data-theme="dark"]) body :where(.ce220-module,.role-module-card,.dashboard-card){display:flex!important;flex-direction:column!important}
html:not([data-theme="dark"]) body :where(.ce220-module,.role-module-card,.dashboard-card) :where(.btn,.button){align-self:flex-start!important;margin-top:auto!important}
html:not([data-theme="dark"]) body :where(.card,.panel,.enterprise-panel,.pro-card,.ce220-module,.enterprise-check,.ce220-safety-grid>div) :where(h1,h2,h3,h4,p,small,strong,span,code){
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}

/* Unified buttons. */
html:not([data-theme="dark"]) body :where(.btn,.button,button,input[type="submit"],input[type="button"]){
  min-height:var(--balt-control-h)!important;
  padding:9px 16px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  border-radius:12px!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:720!important;
  white-space:normal!important;
  text-align:center!important;
  text-decoration:none!important;
}
html:not([data-theme="dark"]) body :where(.btn.primary,.button.primary,.btn.gold,.button.gold,.login-submit,.cta-primary),
html:not([data-theme="dark"]) body button[name="action"][value="refresh"]{
  background:linear-gradient(135deg,#A66B61,#91574F)!important;
  color:#FFF!important;
  border-color:#8C5048!important;
  box-shadow:0 8px 20px rgba(125,70,63,.18)!important;
}
html:not([data-theme="dark"]) body :where(.btn.primary,.button.primary,.btn.gold,.button.gold,.login-submit,.cta-primary) :where(span,strong,small){color:#FFF!important}
html:not([data-theme="dark"]) body :where(.btn.secondary,.button.secondary){background:#F8ECE8!important;color:#74443D!important;border-color:#D9BFB5!important}
html:not([data-theme="dark"]) body :where(.btn.small,.button.small){min-height:34px!important;padding:7px 12px!important;font-size:12px!important}

/* Enterprise check cards: readable keys, restrained status colours, aligned grid. */
html:not([data-theme="dark"]) body .enterprise-check-grid,
html:not([data-theme="dark"]) body .enterprise-check-grid.compact{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))!important;
  gap:12px!important;
  align-items:stretch!important;
  margin-top:16px!important;
}
html:not([data-theme="dark"]) body .enterprise-check{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:8px 12px!important;
  min-height:78px!important;
  padding:15px 16px!important;
  border:1px solid #E0D2C7!important;
  border-radius:15px!important;
  background:#FAF5F1!important;
  color:#2F261E!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) body .enterprise-check strong{
  color:#3B302A!important;
  font-family:var(--balt-font-ui)!important;
  font-size:12.5px!important;
  line-height:1.35!important;
  font-weight:720!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
html:not([data-theme="dark"]) body .enterprise-check span{
  float:none!important;
  align-self:start!important;
  min-width:54px!important;
  padding:5px 9px!important;
  border-radius:999px!important;
  text-align:center!important;
  font-size:11px!important;
  line-height:1!important;
  font-weight:850!important;
  letter-spacing:.045em!important;
  background:#F2EAE5!important;
  color:#65554D!important;
  border:1px solid #D9C8BD!important;
}
html:not([data-theme="dark"]) body .enterprise-check small{grid-column:1/-1!important;color:#6E6058!important}
html:not([data-theme="dark"]) body .enterprise-check.ok{background:#F4F8F4!important;border-color:#C8DCCB!important}
html:not([data-theme="dark"]) body .enterprise-check.ok span{background:#E8F3EB!important;color:#365E40!important;border-color:#BFD4C3!important}
html:not([data-theme="dark"]) body .enterprise-check.bad{background:#FDF2F3!important;border-color:#E7C6CB!important}
html:not([data-theme="dark"]) body .enterprise-check.bad span{background:#F8E3E6!important;color:#8A3946!important;border-color:#E0B9C0!important}
html:not([data-theme="dark"]) body .enterprise-check.warning{background:#FFF9EE!important;border-color:#E8D5AF!important}

/* 2.2 clinical experience control panel. */
html:not([data-theme="dark"]) body .ce220-kpis{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important;gap:14px!important}
html:not([data-theme="dark"]) body .ce220-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;gap:16px!important}
html:not([data-theme="dark"]) body .ce220-module{min-height:230px!important}
html:not([data-theme="dark"]) body .ce220-module h2{font-size:1.08rem!important;line-height:1.3!important;color:#2F261E!important}
html:not([data-theme="dark"]) body .ce220-module p{color:#665850!important;line-height:1.6!important}
html:not([data-theme="dark"]) body .ce220-safety{padding:24px!important}
html:not([data-theme="dark"]) body .ce220-safety-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr))!important;
  gap:14px!important;
}
html:not([data-theme="dark"]) body .ce220-safety-grid>div{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  min-height:112px!important;
  padding:18px!important;
  border:1px solid #DCCABE!important;
  border-radius:16px!important;
  background:linear-gradient(145deg,#FFFDFC,#FAF3EF)!important;
  box-shadow:0 7px 20px rgba(75,49,39,.045)!important;
}
html:not([data-theme="dark"]) body .ce220-safety-grid strong{color:#5F3A34!important;font-size:14px!important}
html:not([data-theme="dark"]) body .ce220-safety-grid span{color:#655850!important;line-height:1.5!important}

/* UAT / Sandbox refinements. */
html:not([data-theme="dark"]) body .sandbox-safety{
  background:linear-gradient(135deg,#F6E8E3,#FFFDFC)!important;
  border-color:#D8BCB2!important;
  color:#5C3C35!important;
}
html:not([data-theme="dark"]) body .sandbox-safety strong{color:#6F3A33!important}
html:not([data-theme="dark"]) body .sandbox-safety span{color:#6E6058!important}
html:not([data-theme="dark"]) body .uat-role-grid{align-items:stretch!important}
html:not([data-theme="dark"]) body .uat-role-card.covered{background:#F4F8F4!important;border-color:#C8DCCB!important}
html:not([data-theme="dark"]) body .uat-role-card.pending{background:#FFF9EE!important;border-color:#E8D5AF!important}
html:not([data-theme="dark"]) body .uat-role-card>span,
html:not([data-theme="dark"]) body .sandbox-meta span,
html:not([data-theme="dark"]) body .finding-priority{
  color:#5B4C45!important;
  background:#F2EAE5!important;
  border:1px solid #D9C8BD!important;
}
html:not([data-theme="dark"]) body .sandbox-meta .decision.go,
html:not([data-theme="dark"]) body .sandbox-meta .decision.pass{color:#365E40!important;background:#E8F3EB!important;border-color:#BFD4C3!important}
html:not([data-theme="dark"]) body .sandbox-meta .decision.hold,
html:not([data-theme="dark"]) body .sandbox-meta .decision.blocked{color:#76501E!important;background:#FFF3DB!important;border-color:#E5CEA1!important}
html:not([data-theme="dark"]) body .sandbox-meta .decision.nogo,
html:not([data-theme="dark"]) body .sandbox-meta .decision.escalated{color:#8A3946!important;background:#F8E3E6!important;border-color:#E0B9C0!important}
html:not([data-theme="dark"]) body .sandbox-state pre,
html:not([data-theme="dark"]) body pre{
  background:#F5EEE9!important;
  color:#443730!important;
  border:1px solid #DDCFC5!important;
  border-radius:13px!important;
}

/* PRO badges are muted and readable rather than neon. */
html:not([data-theme="dark"]) body :where(.pro-badge-pass,.pro-badge-approved,.pro-badge-ready,.pro-badge-completed,.pro-badge-resolved,.pro-decision-go){color:#365E40!important;background:#E8F3EB!important;border-color:#BFD4C3!important}
html:not([data-theme="dark"]) body :where(.pro-badge-fail,.pro-badge-rejected,.pro-badge-blocked,.pro-decision-nogo){color:#8A3946!important;background:#F8E3E6!important;border-color:#E0B9C0!important}
html:not([data-theme="dark"]) body :where(.pro-badge-warning,.pro-badge-pending,.pro-badge-not-evaluated,.pro-badge-not-started,.pro-decision-hold){color:#76501E!important;background:#FFF3DB!important;border-color:#E5CEA1!important}
html:not([data-theme="dark"]) body :where(.pro-badge-running,.pro-badge-in-progress,.pro-badge-submitted){color:#4A5D70!important;background:#EEF2F6!important;border-color:#CBD5DF!important}
html:not([data-theme="dark"]) body .pro-hero small{color:#91574F!important}
html:not([data-theme="dark"]) body .pro-hero-mark strong{color:#7D463F!important}

/* Robust text colours inside generic status containers. */
html:not([data-theme="dark"]) body :where(.ok,.success,.green):not(.btn):not(button):not(.badge):not(.pill):not(.chip):not(.tag){color:#365E40!important}
html:not([data-theme="dark"]) body :where(.warning,.warn,.yellow):not(.btn):not(button):not(.badge):not(.pill):not(.chip):not(.tag){color:#76501E!important}
html:not([data-theme="dark"]) body :where(.danger,.error,.fail,.red):not(.btn):not(button):not(.badge):not(.pill):not(.chip):not(.tag){color:#8A3946!important}
html:not([data-theme="dark"]) body :where(code,kbd,samp){
  color:#68453D!important;
  background:#F3E7E1!important;
  border:1px solid #DECBC1!important;
  border-radius:7px!important;
  padding:.12em .4em!important;
  overflow-wrap:anywhere!important;
}

/* Login screen: official light experience by default. */
html:not([data-theme="dark"]) body.public-login,
body.public-login.balt-premium-visual-2411{
  min-height:100vh!important;
  color:#2F261E!important;
  background:
    radial-gradient(circle at 16% 18%,rgba(214,174,164,.25),transparent 33%),
    radial-gradient(circle at 85% 82%,rgba(224,210,199,.42),transparent 38%),
    linear-gradient(145deg,#FFFDFC 0%,#F8F3EF 48%,#F1E7E1 100%)!important;
}
body.public-login .login-wrap{max-width:520px!important}
body.public-login .login-panel{
  border:1px solid #DFCFC5!important;
  border-radius:28px!important;
  background:rgba(255,253,252,.94)!important;
  color:#2F261E!important;
  box-shadow:0 30px 85px rgba(87,58,47,.16)!important;
  backdrop-filter:blur(18px)!important;
}
body.public-login .login-panel:before{
  background:linear-gradient(135deg,rgba(240,221,215,.72),transparent 45%,rgba(242,231,211,.45))!important;
}
body.public-login .login-brand h1{color:#2D241E!important;text-transform:none!important;letter-spacing:-.02em!important}
body.public-login .login-brand p,
body.public-login .login-form label,
body.public-login .login-actions{color:#6E6058!important}
body.public-login .login-form input{
  background:#FFFDFC!important;
  color:#2F261E!important;
  border:1px solid #CDB6A7!important;
  border-radius:13px!important;
}
body.public-login .login-actions a{color:#875149!important}
body.public-login .login-flash{background:#FAF5F1!important;color:#3F342E!important;border-color:#E0D2C7!important}

/* Stable topbar geometry and locale switch. */
html:not([data-theme="dark"]) body .topbar{min-width:0!important}
html:not([data-theme="dark"]) body .topbar>*{min-width:0!important}
html:not([data-theme="dark"]) body .balt-locale-switch{width:88px!important;min-width:88px!important;max-width:88px!important;flex:0 0 88px!important}
html:not([data-theme="dark"]) body .balt-locale-switch a{width:42px!important;min-width:42px!important;max-width:42px!important}

/* Visual runtime classes. */
html:not([data-theme="dark"]) body .balt2411-auto-dark-text{color:#2F261E!important;text-shadow:none!important}
html:not([data-theme="dark"]) body .balt2411-auto-muted-text{color:#6E6058!important;text-shadow:none!important}
html:not([data-theme="dark"]) body .balt2411-auto-border{border-color:#CDB6A7!important;box-shadow:0 0 0 1px rgba(205,182,167,.18)!important}
html:not([data-theme="dark"]) body .balt2411-auto-surface{background:#FFFDFC!important;color:#2F261E!important;border-color:#E0D2C7!important}
html:not([data-theme="dark"]) body .balt2411-wrap{min-width:0!important;overflow-wrap:anywhere!important}

@media(max-width:1100px){
  html:not([data-theme="dark"]) body :where(.hero,.enterprise-hero,.pro-hero){align-items:flex-start!important;flex-direction:column!important}
  html:not([data-theme="dark"]) body :where(.hero-actions,.ce220-actions){width:100%!important}
}
@media(max-width:760px){
  html:not([data-theme="dark"]) body :where(.enterprise-panel,.pro-card,.ce220-module){padding:16px!important;border-radius:16px!important}
  html:not([data-theme="dark"]) body .enterprise-check-grid{grid-template-columns:1fr!important}
  html:not([data-theme="dark"]) body :where(.section-head,.pro-card-header){flex-direction:column!important}
  html:not([data-theme="dark"]) body :where(.enterprise-actions,.hero-actions,.ce220-actions,.pro-actions,.form-actions){width:100%!important}
  html:not([data-theme="dark"]) body :where(.enterprise-actions,.hero-actions,.ce220-actions,.pro-actions,.form-actions) :where(.btn,.button,button){width:100%!important}
}

/* Visual Quality Center 2.4.1.1 */
.visual-findings-2411{display:grid;gap:14px;margin-top:18px}
.visual-finding-2411{display:grid;grid-template-columns:minmax(240px,1fr) minmax(360px,1.45fr);gap:20px;align-items:center;padding:18px 20px;border:1px solid var(--balt-border,#E0D2C7);border-radius:18px;background:linear-gradient(145deg,#FFFDFC 0%,#FAF5F1 100%);box-shadow:0 10px 28px rgba(74,52,40,.07)}
.visual-finding-2411>div{display:grid;gap:6px;min-width:0}.visual-finding-2411 code{display:block;max-width:100%;overflow-wrap:anywhere;white-space:normal;color:#5E4E46;background:#F3EAE4;border:1px solid #E0D2C7;border-radius:10px;padding:8px 10px}.visual-finding-2411 small{color:#6E6058}
.visual-finding-review-2411{display:grid;grid-template-columns:minmax(140px,.65fr) minmax(180px,1.35fr) auto;gap:10px;align-items:center;margin:0}
.visual-finding-review-2411 select,.visual-finding-review-2411 input{min-width:0;width:100%;height:44px;margin:0}
.visual-finding-review-2411 .btn{margin:0;align-self:stretch;white-space:nowrap}
@media(max-width:900px){.visual-finding-2411{grid-template-columns:1fr}.visual-finding-review-2411{grid-template-columns:1fr}.visual-finding-review-2411 .btn{width:100%}}
