/* GRS theme: replace white/near-white surfaces with OI mint, keep brand colors. */
:root{--oi-app-bg:#ECF7F3;--oi-app-bg-hover:#DCEDE6;--oi-ink:#102F43;--oi-line:#315B70;--oi-blue:#BFD7E6}
body>.topbar .firm-name,body>.topbar .crumb.layout-menu-crumb{background:var(--oi-blue)!important;background-image:none!important}

/* Common white surfaces: menus, dropdowns, cards, form fields, dialogs */
.dropdown,.submenu,.sector-menu,.card,.definition-card,.page-generated-card,
dialog,[role="dialog"],[role="menu"],.modal,.popover,.tooltip,
.oi-scene-toolbar,.auth-card,.auth-form,form.card,
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]),
select,textarea{background-color:var(--oi-app-bg)}
.drop-link:hover,.drop-link:focus-visible,.sector-option:hover,.sector-option:focus-visible{background-color:var(--oi-app-bg-hover)}
input:focus,select:focus,textarea:focus{background-color:var(--oi-app-bg)}
input,select,textarea,button,.drop-link,.sector-option{transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}

/* Disabled page-files UI (do NOT target [data-page-files]: used by GRS frame guide) */
#screen-files,.export-screen,[data-open-screen="screen-files"],[data-open-screen="page-files"]{display:none!important}

/* Proportional responsiveness without zoom/transform */
html,body{max-width:100%}
body{min-height:100dvh}
.nav-shell{flex-wrap:wrap;row-gap:6px}
.app-screen{max-width:100%;box-sizing:border-box}
.app-screen img,.app-screen video{max-width:100%;height:auto}
.app-screen table{max-width:100%}
.consultant-list-wrap,.marketer-list-wrap,.personnel-list-wrap,.personnel-auth-wrap,.bank-table-wrap,.insurance-list-panel{max-width:100%;overflow-x:auto}
dialog,[role="dialog"],.oi-scene-toolbar{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box}
@media (max-width:1366px){.topbar .title{font-size:clamp(16px,1.6vw,24px)}}
@media (max-width:768px){
  .nav-shell{justify-content:center}
  .form-row,.bank-form-row,.insurance-form-row{grid-template-columns:1fr!important}
  .actions,.list-footer,.form-actions{flex-wrap:wrap}
}

/* Narrow viewports: wrap header/nav, keep nested menus inside viewport, no body h-scroll */
.topbar{flex-wrap:wrap;row-gap:4px;max-width:100%;box-sizing:border-box}
.topbar>*{min-width:0}
.nav-shell,.oi-ext-quick{max-width:100%;box-sizing:border-box}
.nav-group{min-width:0}
.dropdown,.submenu,.sector-menu{max-width:calc(100vw - 16px);box-sizing:border-box}
@media (max-width:600px){
  body>.topbar{display:flex!important;flex-direction:column;height:auto!important;min-height:0!important;justify-content:center;text-align:center}
  .topbar .title-group{display:flex!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:none!important;flex-wrap:wrap!important;justify-content:center}
  .topbar .title,.topbar .firm-name{max-width:100%!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box}
  .nav-shell{overflow:visible}
  .nav-group{position:static}
  .dropdown{left:8px!important;right:8px!important;width:auto!important;max-height:calc(100dvh - 120px);overflow-y:auto}
  .submenu{position:static!important;left:auto!important;top:auto!important;width:auto!important;margin-left:10px;box-shadow:none}
  .sector-menu{right:8px!important;left:auto!important}
  #oi-ext-quick{justify-content:center}
}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}

/* Control surfaces: quick-button blue tone instead of white (media/QR untouched). */
:root{--oi-ctrl:#BFD7E6;--oi-ctrl-hover:#A9C8DC}
body>.topbar button:not(.oi-note-fab),.nav-shell .nav-button,.nav-shell>button,.nav-shell>a,.topbar .crumb,.topbar .firm-name,.topbar .date,.topbar [class*="date"],
.oi-account-bar,.oi-account-bar button,.oi-account-bar a.button{background-color:var(--oi-ctrl)!important;background-image:none!important;color:var(--oi-ink)!important;border-color:var(--oi-line)!important}
body>.topbar button:not(.oi-note-fab):hover,body>.topbar button:focus-visible,.nav-shell .nav-button:hover,.nav-shell .nav-button:focus-visible,.nav-shell>button:hover,.oi-account-bar button:hover,.oi-account-bar button:focus-visible{background-color:var(--oi-ctrl-hover)!important}
.nav-shell,.oi-ext-quick,body>.topbar,body>.topbar .title-group,body>.topbar .title{background-color:var(--oi-ctrl)!important;background-image:none!important}

/* Header: modest shrink, then orderly wrap inside parent (overrides native inline sizes). */
body>.topbar{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;gap:6px 8px!important;height:auto!important;min-height:0!important;width:auto!important;max-width:100%!important;transform:none!important;position:relative!important;padding:6px 8px!important;box-sizing:border-box!important}
body>.topbar>*,body>.topbar .title-group>*{position:static!important;transform:none!important;left:auto!important;top:auto!important;inset:auto!important;width:auto!important;height:auto!important;min-width:0!important;max-width:100%!important;flex:0 1 auto!important;box-sizing:border-box!important;margin:0!important}
body>.topbar .title-group{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-width:0!important}
body>.topbar .title,body>.topbar .firm-name,body>.topbar .crumb{white-space:normal!important;overflow-wrap:anywhere;font-size:clamp(13px,1.35vw,20px)!important;padding:4px 10px!important;text-align:center}
.nav-shell{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:6px!important;height:auto!important;width:auto!important;transform:none!important;position:relative!important}
.nav-shell .nav-button{font-size:clamp(13px,1.2vw,18px)!important;padding:5px 12px!important;white-space:nowrap}
.oi-account-bar{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;align-items:center!important;gap:6px 12px!important;height:auto!important;max-width:100%!important;transform:none!important;box-sizing:border-box}
@media (max-width:840px){body>.topbar .title,body>.topbar .firm-name,body>.topbar .crumb{font-size:14px!important}.nav-shell .nav-button{font-size:14px!important;padding:4px 10px!important}}
@media (max-width:420px){.nav-shell .nav-button{white-space:normal}}
/* Legacy menu measurement must not force desktop-sized buttons or scroll-only navigation. */
.nav-shell{overflow:visible!important}
.nav-shell .nav-group{min-width:0!important;max-width:100%!important;flex:0 1 auto}
.nav-shell .nav-button,.nav-shell .admin,.nav-shell .login-return{
  width:auto!important;min-width:0!important;max-width:100%!important;
  white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box
}
.dropdown,.submenu,.sector-menu{min-width:0!important}
.dropdown .drop-link,.submenu .drop-link{min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:840px){
  .nav-shell .nav-group{position:static}
  .nav-shell .dropdown{position:absolute!important;left:8px!important;right:8px!important;width:auto!important;max-height:calc(100dvh - 120px);overflow-y:auto}
  .nav-shell .submenu{position:static!important;left:auto!important;top:auto!important;width:auto!important;margin-left:10px}
}
