/* Affiliate SaaS v1.9: unified responsive shell. Loaded after legacy styles. */
:root{--am-header:66px}
html{scroll-padding-top:calc(var(--am-header) + 68px)}
body{overflow-x:clip}
/* v1.7 inserted this drawer-only heading at ALL viewport widths: it caused
   the desktop 'Navigation' gap and an apparently broken close control. */
.v17-drawer-bar,.v17-close-menu{display:none!important}
.v17-nav-backdrop[hidden],.v16-nav-backdrop[hidden]{display:none!important}
.app-shell>.global-header,.aff-shell>.aff-topbar{position:sticky!important;top:0!important;left:auto!important;right:auto!important;width:auto!important;grid-row:1;z-index:80!important}
.app-shell,.aff-shell{min-height:100dvh;align-content:start}
.app-shell>.main-column,.aff-shell>.aff-main{min-width:0}
.app-shell>.main-column>.topbar,.aff-shell>.aff-main>.aff-pagebar{position:sticky!important;top:var(--am-header)!important;z-index:40!important;box-shadow:0 1px 0 #e3e9f3}
.app-shell>.rail,.aff-shell>.aff-rail{z-index:37}
.app-shell>.sidebar,.aff-shell>.aff-context.sidebar{z-index:38}
.app-shell .sidebar-collapse{display:none!important}
/* A single normal-flow header eliminates the empty fixed-header row and
   the intermittent overlapping report heading when scrolling back. */
.app-shell>.global-header{grid-column:1/-1;grid-row:1}
.aff-shell>.aff-topbar{grid-column:1/-1;grid-row:1}
.v19-support-link{display:flex;align-items:center;gap:8px;padding:11px 12px;border-radius:8px;color:#21457c;font-weight:730;background:#edf3ff}
.v19-support-link:hover{background:#dfeafa}
.v19-auth-hint{color:#687991;font-size:12px;line-height:1.5}
.v19-public-links{display:flex;gap:14px;flex-wrap:wrap;margin:15px 0;font-size:12px}
.v19-public-links a{color:#2c568e;text-decoration:underline}
.v19-mfa-secret{font:700 16px ui-monospace,Consolas,monospace;letter-spacing:.17em;overflow-wrap:anywhere;padding:15px;border:1px dashed #a4b6d3;border-radius:9px;background:#f5f8fe}
@media(max-width:900px){
 :root{--am-header:61px}
 .app-shell,.aff-shell{display:block!important;min-width:0}
 .app-shell>.global-header,.aff-shell>.aff-topbar{height:61px!important;min-height:61px!important;position:sticky!important;top:0!important}
 .app-shell>.rail,.aff-shell>.aff-rail{display:none!important}
 .app-shell>.main-column>.topbar,.aff-shell>.aff-main>.aff-pagebar{top:var(--am-header)!important}
 .app-shell>.sidebar,.aff-shell>.aff-context.sidebar,.partner-shell>.sidebar{
  position:fixed!important;top:var(--am-header)!important;bottom:0!important;
  left:0!important;width:min(326px,calc(100vw - 52px))!important;
  height:calc(100dvh - var(--am-header))!important;
  max-width:none!important;z-index:91!important;overflow-y:auto!important;
  overscroll-behavior:contain;background:#fff;box-shadow:12px 0 32px #0b244643;
 }
 .app-shell>.sidebar:not(.shown),.aff-shell>.aff-context.sidebar:not(.shown),.partner-shell>.sidebar:not(.shown){transform:translateX(-110%)!important;visibility:hidden!important;pointer-events:none!important}
 .app-shell>.sidebar.shown,.aff-shell>.aff-context.sidebar.shown,.partner-shell>.sidebar.shown{transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important}
 .v17-drawer-bar,.app-shell>.sidebar .v17-drawer-bar,.aff-context .v17-drawer-bar,.partner-shell>.sidebar .v17-drawer-bar{display:flex!important;position:sticky;top:0;align-items:center;justify-content:space-between;z-index:12;background:#fff;border-bottom:1px solid #e5ebf4;padding:13px 15px;min-height:60px}
 .v17-drawer-bar strong{color:#1b2e4f;font-size:15px}
 .v17-close-menu{display:grid!important;width:38px;height:38px;place-items:center;background:#f1f5fa;border:1px solid #dbe4f1;border-radius:10px;font-size:22px;line-height:1;cursor:pointer;color:#264468}
 .v16-nav-backdrop,.v17-nav-backdrop{position:fixed!important;inset:var(--am-header) 0 0!important;z-index:88!important;background:rgba(11,25,50,.56);backdrop-filter:blur(2px)}
 .v16-nav-backdrop[hidden],.v17-nav-backdrop[hidden]{display:none!important}
 .sidebar .section-identity,.aff-context .aff-context-title{padding:15px 17px!important}
 /* Admin: mobile module navigation is the primary destination list. Show the
    current section first, then the complete role-allowed module list. */
 .app-shell>.sidebar .context-menu{overflow:visible!important;flex:0 0 auto!important;padding-bottom:7px}
 .app-shell>.sidebar .v16-mobile-modules{display:grid!important;padding:15px 10px 26px!important}
 /* Affiliate: show one complete menu instead of a duplicate section menu. */
 .aff-shell .aff-context-title,.aff-shell .aff-context.sidebar>nav:not(.aff-mobile-all){display:none!important}
 .aff-shell>.aff-context.sidebar .aff-mobile-all{display:flex!important;flex-direction:column!important;flex:0 0 auto!important;overflow:visible!important;padding:7px 12px 18px!important}
 .aff-mobile-group{margin-top:13px;padding:15px 9px 4px;font-size:10px;font-weight:800;color:#8a99af;letter-spacing:.12em;text-transform:uppercase}
 .aff-mobile-all a{padding:11px 12px!important;min-height:43px;display:flex;align-items:center}
 .partner-shell>.sidebar .partner-nav-note{position:static!important;margin-top:20px}
 .partner-shell>.main-column>.topbar{top:0!important}
 .app-shell>.main-column,.aff-shell>.aff-main{width:100%;max-width:100%;min-height:calc(100dvh - var(--am-header))}
 .app-shell>.main-column>.page,.aff-shell .aff-content{width:100%;max-width:100%;min-width:0}
 .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
 .app-shell>.sidebar .sidebar-profile,.aff-shell .aff-context-footer{position:relative;flex:0 0 auto;margin-top:0}
}
@media(max-width:640px){
 .app-shell>.global-header .brand-logo{max-width:34vw!important;overflow:hidden}
 .app-shell>.global-header .brand-logo img{max-width:100%;max-height:35px}
 .app-shell>.global-header .global-tools{gap:3px!important}
 .app-shell>.global-header .mobile-header-menu{min-width:38px;padding:7px!important}
 .aff-shell>.aff-topbar .aff-brand{max-width:46vw!important;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 .aff-shell>.aff-topbar .aff-top-right{min-width:0;gap:4px}
 .app-shell .dashboard-filter,.app-shell .section-toolbar,.aff-shell .aff-pagebar{flex-wrap:wrap}
 .app-shell .page-intro,.aff-shell .aff-pagebar{padding-left:13px;padding-right:13px}
 .app-shell .page,.aff-shell .aff-content{padding:13px!important}
 .app-shell .panel,.aff-shell .panel{min-width:0}
 .app-shell .form-grid,.aff-shell .form-grid{grid-template-columns:minmax(0,1fr)}
 .app-shell .metrics,.aff-shell .aff-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .app-shell>.main-column>.topbar .crumb{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
 .app-shell>.global-header .global-tools{margin-left:auto}
 .app-shell .v13-skel-brand,.aff-shell .v13-skel-brand{max-width:100%}
}
@media(max-width:370px){.app-shell .metrics,.aff-shell .aff-kpi-grid{grid-template-columns:1fr 1fr}.app-shell>.global-header .brand-logo{max-width:28vw!important}}
@media(prefers-reduced-motion:reduce){.app-shell>.sidebar,.aff-shell>.aff-context.sidebar,.partner-shell>.sidebar{transition:none!important}}

/* Legacy advertiser portal has no global header: its own topbar is the drawer anchor. */
@media(max-width:900px){
 .partner-shell{--am-header:54px}
 .partner-shell>.main-column>.topbar{position:sticky!important;top:0!important;z-index:83!important;background:#fff;min-height:54px}
 .partner-shell>.sidebar{top:54px!important;height:calc(100dvh - 54px)!important}
 .partner-shell .v17-nav-backdrop{inset:54px 0 0!important}
}

/* Compact mobile sign-in and registration: keep the brand readable without a
   giant hero and leave room for multi-field signup forms on small screens. */
@media(max-width:900px){
 .affiliate-auth .affiliate-auth-split{display:flex!important;flex-direction:column;min-height:100dvh}
 .affiliate-auth .affiliate-auth-hero{padding:23px 22px 18px!important;min-height:0!important;display:block!important}
 .affiliate-auth .auth-brand{font-size:15px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;margin:0 0 14px!important;gap:9px}
 .affiliate-auth .auth-brand img{width:auto!important;max-width:44px!important;height:auto!important;max-height:44px!important;object-fit:contain}
 .affiliate-auth .affiliate-auth-hero h1{font-size:22px!important;line-height:1.18;margin:4px 0 9px}
 .affiliate-auth .affiliate-auth-hero>p{font-size:12px;line-height:1.5;margin:0 0 10px}
 .affiliate-auth .auth-footer{font-size:12px;margin:12px 0 0;padding-top:12px}
 .affiliate-auth .affiliate-auth-panel{display:block;overflow:visible;padding:24px 19px 32px}
 .affiliate-auth .affiliate-auth-form{max-width:100%}
 .affiliate-auth .auth-form-grid{gap:6px 12px}
 .affiliate-auth .auth-field input,.affiliate-auth .auth-field select{min-height:44px}
 .login-body .login-box{width:min(460px,calc(100vw - 28px));max-width:100%;box-sizing:border-box}
}
@media(max-width:370px){
 .affiliate-auth .affiliate-auth-hero{padding:19px 16px 15px!important}
 .affiliate-auth .affiliate-auth-panel{padding:19px 14px 26px}
}
