:root{--epem-red:#b21917;--epem-red-dark:#86110f;--epem-ink:#111827;--epem-muted:#6b7280;--epem-border:#e5e7eb;--epem-soft:#f8fafc;--epem-card:#ffffff;--epem-shadow:0 24px 80px rgba(17,24,39,.14)}
.epem-portal{display:flex;gap:24px;max-width:1200px;margin:32px auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--epem-ink)}
.epem-sidebar{width:240px;background:#111827;color:#fff;padding:20px;border-radius:18px;box-shadow:0 18px 40px rgba(17,24,39,.18)}
.epem-sidebar a{display:block;color:#fff;text-decoration:none;padding:9px 0;opacity:.92}.epem-sidebar a:hover{opacity:1;text-decoration:underline}
.epem-main{flex:1;background:#fff;padding:24px;border:1px solid var(--epem-border);border-radius:18px;box-shadow:0 12px 40px rgba(15,23,42,.05)}
.epem-public-screen{display:block;max-width:1060px;margin:58px auto 72px}.epem-public-screen .epem-main{padding:0;border:0;background:transparent;box-shadow:none}
.epem-button,button{background:var(--epem-red);color:#fff;border:0;border-radius:10px;padding:10px 14px;text-decoration:none;cursor:pointer;font-weight:700}.epem-button:hover,button:hover{background:var(--epem-red-dark)}
input,select,textarea{max-width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:10px;background:#fff;color:#111827}input:focus,select:focus,textarea:focus{outline:2px solid rgba(178,25,23,.18);border-color:var(--epem-red)}
table{width:100%;border-collapse:collapse}td,th{border-bottom:1px solid var(--epem-border);padding:9px;text-align:left}.epem-notice{border-radius:12px;padding:12px 14px;margin-bottom:16px;background:#eff6ff;border:1px solid #bfdbfe}.epem-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}.epem-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.epem-auth-shell{display:grid;grid-template-columns:minmax(320px,.92fr) minmax(360px,1.08fr);gap:0;min-height:590px;border-radius:28px;overflow:hidden;background:#fff;box-shadow:var(--epem-shadow);border:1px solid rgba(229,231,235,.9)}
.epem-auth-shell-single{display:flex;justify-content:center;min-height:0;background:linear-gradient(135deg,#fff 0%,#fff 48%,#fef2f2 100%);padding:34px}.epem-auth-shell-single .epem-auth-panel{max-width:560px;width:100%;border-radius:22px;box-shadow:0 14px 40px rgba(17,24,39,.08)}
.epem-auth-panel{padding:46px}.epem-auth-brand-panel{position:relative;display:flex;flex-direction:column;justify-content:space-between;background:radial-gradient(circle at 15% 15%,rgba(255,255,255,.24),transparent 28%),linear-gradient(145deg,var(--epem-red) 0%,#7f0d0b 100%);color:#fff;overflow:hidden}.epem-auth-brand-panel:after{content:"";position:absolute;right:-90px;bottom:-90px;width:260px;height:260px;border-radius:999px;background:rgba(255,255,255,.09)}
.epem-auth-logo-wrap{position:relative;z-index:1}.epem-auth-logo{display:block;max-width:220px;height:auto;background:transparent;border-radius:0;padding:0;box-shadow:none}.epem-auth-logo-wrap .custom-logo-link{display:inline-block;background:transparent;padding:0;border-radius:0}.epem-auth-logo-wrap img:not(.epem-auth-logo){max-width:150px;height:auto;display:block}.epem-auth-wordmark{display:inline-flex;align-items:center;justify-content:center;background:#fff;color:var(--epem-red);font-size:22px;font-weight:900;letter-spacing:.04em;text-transform:uppercase;border-radius:14px;padding:12px 16px}.epem-auth-kicker{position:relative;z-index:1;text-transform:uppercase;letter-spacing:.18em;font-size:12px;font-weight:800;margin:52px 0 14px;opacity:.86}.epem-auth-brand-panel h1{position:relative;z-index:1;font-size:40px;line-height:1.02;margin:0;letter-spacing:-.04em;color:#fff}.epem-auth-feature-list{position:relative;z-index:1;display:grid;gap:11px;margin-top:42px}.epem-auth-feature-list span{display:flex;gap:10px;align-items:center;font-size:14px;opacity:.94}.epem-auth-feature-list span:before{content:"";width:8px;height:8px;border-radius:99px;background:#fff;box-shadow:0 0 0 5px rgba(255,255,255,.16)}
.epem-auth-form-panel{background:linear-gradient(180deg,#fff 0%,#fff 58%,#f8fafc 100%);display:flex;flex-direction:column;justify-content:center}.epem-auth-card-header{margin-bottom:24px}.epem-auth-eyebrow{color:var(--epem-red);font-weight:900;text-transform:uppercase;letter-spacing:.16em;font-size:12px;margin:0 0 8px}.epem-auth-card-header h2{font-size:34px;line-height:1.08;margin:0 0 10px;letter-spacing:-.035em;color:var(--epem-ink)}.epem-auth-card-header p{margin:0;color:var(--epem-muted);font-size:15px;line-height:1.55}.epem-auth-form{display:grid;gap:16px}.epem-auth-form label{display:grid;gap:7px;font-size:13px;font-weight:800;color:#374151}.epem-auth-form input[type="text"],.epem-auth-form input[type="email"],.epem-auth-form input[type="password"]{width:100%;box-sizing:border-box;min-height:48px;font-size:15px;border-radius:12px;border:1px solid #d1d5db;background:#fff}.epem-auth-row{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px}.epem-auth-row a,.epem-auth-footnote a{color:var(--epem-red);font-weight:800;text-decoration:none}.epem-auth-row a:hover,.epem-auth-footnote a:hover{text-decoration:underline}.epem-auth-check{display:flex!important;grid-template-columns:auto 1fr!important;gap:8px!important;align-items:center;font-weight:700!important}.epem-auth-check input{width:auto}.epem-auth-primary,.epem-auth-secondary{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border-radius:12px;font-weight:900;text-decoration:none;border:0;width:100%;box-sizing:border-box}.epem-auth-primary{background:var(--epem-red);color:#fff;box-shadow:0 12px 24px rgba(178,25,23,.22)}.epem-auth-primary:hover{background:var(--epem-red-dark);color:#fff}.epem-auth-secondary{background:#fff;color:var(--epem-red);border:1px solid rgba(178,25,23,.25)}.epem-auth-secondary:hover{background:#fff5f5;color:var(--epem-red-dark)}.epem-auth-secondary-button{cursor:pointer}.epem-auth-button-link{width:auto;padding:0 22px}.epem-auth-divider{display:flex;align-items:center;gap:12px;margin:22px 0;color:#9ca3af;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.12em}.epem-auth-divider:before,.epem-auth-divider:after{content:"";height:1px;background:#e5e7eb;flex:1}.epem-auth-error,.epem-auth-message{border-radius:12px;padding:12px 14px;margin-bottom:16px;background:#fef2f2;border:1px solid #fecaca;color:#991b1b;font-weight:700;font-size:14px}.epem-auth-message{display:none;background:#f8fafc;border-color:#e5e7eb;color:#374151}.epem-auth-message:not(:empty){display:block}.epem-auth-footnote{margin:18px 0 0;text-align:center;color:var(--epem-muted);font-size:14px}
@media(max-width:900px){.epem-auth-shell{grid-template-columns:1fr}.epem-auth-brand-panel{padding:32px}.epem-auth-brand-panel h1{font-size:30px}.epem-auth-feature-list{margin-top:24px}.epem-auth-form-panel{padding:32px}.epem-public-screen{margin:28px 16px 52px}}
@media(max-width:800px){.epem-portal{display:block;margin:18px 12px}.epem-sidebar{width:auto;margin-bottom:16px}.epem-main{padding:18px}.epem-public-screen .epem-main{padding:0}.epem-auth-shell-single{padding:18px}.epem-auth-card-header h2{font-size:28px}}

/* Standalone app treatment for portal pages. */
body:has(.epem-portal) .site-header,
body:has(.epem-portal) header.header,
body:has(.epem-portal) .main-navigation,
body:has(.epem-portal) footer,
body:has(.epem-portal) .site-footer { display:none!important; }

.epem-protected-screen{max-width:1440px;margin:0 auto;gap:0;min-height:calc(100vh - 32px);border-radius:0}.epem-protected-screen .epem-main{border-radius:0;border:0;box-shadow:none;padding:32px 38px;background:#f8fafc}.epem-protected-screen .epem-sidebar{background:#C0392B;color:#fff;border-radius:0;box-shadow:none;padding:0;width:260px}.epem-sidebar-logo{padding:16px;text-align:center;border-bottom:1px solid rgba(255,255,255,.18)}.epem-sidebar-logo img{display:block;max-width:160px;height:auto;margin:0 auto}.epem-sidebar-nav{display:block;margin:0;padding:12px 0}.epem-sidebar-nav a,.epem-sidebar a{display:block;color:#fff!important;text-decoration:none;padding:10px 20px;opacity:1;border-radius:0;font-weight:700}.epem-sidebar-nav a:hover,.epem-sidebar a:hover{background:rgba(0,0,0,.15);text-decoration:none}.epem-sidebar-nav a.is-active{background:rgba(0,0,0,.25);color:#fff!important;font-weight:900}.epem-dashboard-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}.epem-dashboard-header h1{margin:0 0 8px;font-size:34px;line-height:1.1}.epem-dashboard-header p{color:#4b5563}.epem-eyebrow{margin:0 0 8px;color:#C0392B!important;font-weight:900;text-transform:uppercase;letter-spacing:.12em;font-size:12px}.epem-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin:18px 0 28px}.epem-card{background:#fff;border:1px solid var(--epem-border);border-radius:16px;padding:18px;box-shadow:0 10px 28px rgba(15,23,42,.06)}.epem-card strong{display:block;color:#6b7280;text-transform:uppercase;letter-spacing:.08em;font-size:12px}.epem-card span{font-size:32px;font-weight:900;color:#111827}.epem-table{background:#fff;border:1px solid var(--epem-border);border-radius:14px;overflow:hidden}.epem-table th{background:#f3f4f6;color:#374151;font-size:12px;text-transform:uppercase;letter-spacing:.08em}
@media(max-width:800px){.epem-protected-screen{display:block}.epem-protected-screen .epem-sidebar{width:auto}.epem-dashboard-header{display:block}.epem-dashboard-header h1{font-size:28px}}


/* Portal page body class fallback, stronger than :has() and works with theme chrome rendered before shortcode. */
body.epem-portal-page .site-header,
body.epem-portal-page header.header,
body.epem-portal-page #masthead,
body.epem-portal-page .main-navigation,
body.epem-portal-page .nav-primary,
body.epem-portal-page footer,
body.epem-portal-page .site-footer,
body.epem-portal-page #colophon { display:none!important; }

body.epem-portal-page { background:#f8fafc!important; }
body.epem-portal-page .entry-header,
body.epem-portal-page .page-title,
body.epem-portal-page .entry-title { display:none!important; }
body.epem-portal-page .site-content,
body.epem-portal-page .content-area,
body.epem-portal-page .entry-content,
body.epem-portal-page main,
body.epem-portal-page article { max-width:none!important; width:100%!important; margin:0!important; padding:0!important; }
body.epem-portal-page .epem-portal.epem-protected-screen { max-width:none!important; width:100%!important; margin:0!important; min-height:100vh!important; }
body.epem-portal-page .epem-protected-screen .epem-sidebar { min-height:100vh!important; }
body.epem-portal-page .epem-protected-screen .epem-main { min-height:100vh!important; }

/* v1.0.14: hard standalone portal mode. The public theme may not expose predictable
   header/footer classes, so the portal JS hides body-level siblings and these styles
   make the remaining wrapper behave like an app shell. */
body.epem-portal-page,
body.epem-standalone-portal { background:#f4f6f8!important; overflow-x:hidden!important; }
body.epem-standalone-portal .epem-theme-hidden { display:none!important; }
body.epem-standalone-portal .epem-portal-host,
body.epem-standalone-portal .epem-portal-host *:not(.epem-sidebar):not(.epem-sidebar *) { box-sizing:border-box; }
body.epem-standalone-portal .epem-portal-host { max-width:none!important; width:100%!important; margin:0!important; padding:0!important; }
body.epem-standalone-portal .epem-portal.epem-protected-screen,
body.epem-portal-page .epem-portal.epem-protected-screen {
    display:grid!important;
    grid-template-columns:260px minmax(0,1fr)!important;
    gap:0!important;
    width:100%!important;
    max-width:none!important;
    min-height:100vh!important;
    margin:0!important;
    padding:0!important;
    background:#f4f6f8!important;
    align-items:stretch!important;
}
body.epem-standalone-portal .epem-protected-screen .epem-sidebar,
body.epem-portal-page .epem-protected-screen .epem-sidebar {
    position:sticky!important;
    top:0!important;
    align-self:start!important;
    width:260px!important;
    min-height:100vh!important;
    background:#C0392B!important;
    border-radius:0!important;
    padding:0!important;
    margin:0!important;
    z-index:20!important;
}
body.epem-standalone-portal .epem-protected-screen .epem-main,
body.epem-portal-page .epem-protected-screen .epem-main {
    min-width:0!important;
    width:100%!important;
    min-height:100vh!important;
    padding:42px 52px!important;
    margin:0!important;
    background:#f4f6f8!important;
    border:0!important;
    box-shadow:none!important;
    border-radius:0!important;
    overflow:auto!important;
}
body.epem-standalone-portal .epem-dashboard-header,
body.epem-portal-page .epem-dashboard-header { max-width:1180px; }
body.epem-standalone-portal .epem-dashboard-header .epem-button,
body.epem-portal-page .epem-dashboard-header .epem-button { white-space:normal; line-height:1.25; }
body.epem-standalone-portal .epem-table,
body.epem-portal-page .epem-table { max-width:1180px; }
@media(max-width:900px){
  body.epem-standalone-portal .epem-portal.epem-protected-screen,
  body.epem-portal-page .epem-portal.epem-protected-screen { display:block!important; }
  body.epem-standalone-portal .epem-protected-screen .epem-sidebar,
  body.epem-portal-page .epem-protected-screen .epem-sidebar { position:relative!important; width:100%!important; min-height:0!important; }
  body.epem-standalone-portal .epem-protected-screen .epem-main,
  body.epem-portal-page .epem-protected-screen .epem-main { padding:24px 18px!important; }
}


/* v1.0.15: stronger standalone reset for themes that wrap header/content/footer together. */
body.epem-standalone-portal .epem-theme-hidden { display:none!important; visibility:hidden!important; height:0!important; overflow:hidden!important; }
body.epem-standalone-portal .epem-portal-path { max-width:none!important; width:100%!important; margin:0!important; padding:0!important; }
body.epem-standalone-portal #page,
body.epem-standalone-portal .site,
body.epem-standalone-portal .site-inner,
body.epem-standalone-portal .site-content,
body.epem-standalone-portal .content,
body.epem-standalone-portal .content-sidebar-wrap,
body.epem-standalone-portal .wrap,
body.epem-standalone-portal .container { max-width:none!important; width:100%!important; margin:0!important; padding:0!important; }
body.epem-standalone-portal .epem-protected-screen .epem-main > * { max-width:1180px; }
body.epem-standalone-portal .epem-protected-screen .epem-main .epem-dashboard-header,
body.epem-standalone-portal .epem-protected-screen .epem-main .epem-cards,
body.epem-standalone-portal .epem-protected-screen .epem-main .epem-table { width:100%; }
