@import url('tokens.css');

:root {
    --portal-ink: #12262a;
    --portal-deep: #082e34;
    --portal-green: #0d4a4c;
    --portal-mint: #dceae4;
    --portal-gold: #d7ad5d;
    --portal-cream: #f4f2eb;
    --portal-paper: #fffefb;
    --portal-muted: #647378;
    --portal-line: #dfe5e1;
    --portal-shadow: 0 24px 70px rgba(22, 43, 45, .09);
    --portal-serif: Georgia, 'Times New Roman', serif;
    --portal-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --portal-mobile-nav-height: 64px;
    --portal-mobile-nav-offset: 12px;
    --portal-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --portal-mobile-content-reserve: calc(var(--portal-mobile-nav-height) + var(--portal-mobile-nav-offset) + var(--portal-mobile-safe-bottom) + 28px);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--portal-ink); background: var(--portal-cream); font-family: var(--portal-sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
.portal-skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; color: #fff; background: var(--portal-deep); transform: translateY(-140%); }
.portal-skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #de9e23; outline-offset: 3px; }

/* Independent sign-in */
.portal-login-main { min-height: 100vh; }
.portal-login-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr); min-height: 100vh; }
.portal-login-story { position: relative; min-height: 100vh; overflow: hidden; color: #fff; background: var(--portal-deep); }
.portal-login-story-image { position: absolute; inset: 0; background: url('../images/hero/service-army-1920.webp') 52% center / cover no-repeat; transform: scale(1.01); }
.portal-login-story-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 27, 31, .42), rgba(4, 28, 32, .1) 35%, rgba(3, 27, 30, .92) 100%), linear-gradient(90deg, rgba(4, 41, 44, .32), transparent 60%); }
.portal-login-brand { position: absolute; z-index: 2; top: clamp(28px, 5vw, 64px); left: clamp(28px, 5vw, 72px); display: inline-flex; gap: 15px; align-items: center; color: #fff; text-decoration: none; }
.portal-login-brand img { width: 54px; height: auto; filter: drop-shadow(0 7px 15px rgba(0,0,0,.25)); }
.portal-login-brand span { display: grid; gap: 3px; }
.portal-login-brand strong { font-size: 1.05rem; letter-spacing: .18em; }
.portal-login-brand small { color: rgba(255,255,255,.7); font-size: .7rem; letter-spacing: .045em; }
.portal-login-quote { position: absolute; z-index: 2; left: clamp(28px, 5vw, 72px); right: clamp(28px, 5vw, 72px); bottom: clamp(42px, 8vh, 92px); }
.portal-login-quote > p, .portal-kicker { margin: 0 0 18px; color: var(--portal-gold); font-size: .69rem; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.portal-login-quote h2 { max-width: 680px; margin: 0 0 28px; font-family: var(--portal-serif); font-size: clamp(3.2rem, 6.5vw, 7.1rem); font-weight: 400; letter-spacing: -.055em; line-height: .88; }
.portal-login-quote h2 em { color: #e9cf9b; font-weight: 400; }
.portal-login-quote > span { display: inline-flex; align-items: center; gap: 13px; color: rgba(255,255,255,.72); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.portal-login-quote > span::before { width: 38px; height: 1px; content: ''; background: var(--portal-gold); }
.portal-login-panel { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 74px clamp(38px, 7vw, 104px) 42px; background: var(--portal-paper); }
.portal-login-form-wrap { width: min(100%, 470px); margin: auto; }
.portal-back-link { display: inline-flex; gap: 10px; margin-bottom: clamp(58px, 9vh, 105px); color: var(--portal-muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.portal-back-link:hover { color: var(--portal-green); }
.portal-login-form-wrap h1 { margin: 0; font-family: var(--portal-serif); font-size: clamp(3rem, 5vw, 5.2rem); font-weight: 400; letter-spacing: -.055em; line-height: .95; }
.portal-login-intro { max-width: 410px; margin: 22px 0 36px; color: var(--portal-muted); font-size: 1rem; line-height: 1.65; }
.portal-login-alert { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 24px; padding: 14px 16px; color: #7f2e25; border: 1px solid #e8c7c0; background: #fff5f2; }
.portal-login-alert > span { display: grid; flex: 0 0 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: #a44336; font-weight: 800; }
.portal-login-alert p { margin: 1px 0 0; font-size: .87rem; line-height: 1.45; }
.portal-login-form { display: grid; }
.portal-login-form label { margin: 0 0 9px; font-size: .77rem; font-weight: 750; letter-spacing: .035em; }
.portal-login-form input { width: 100%; height: 55px; margin: 0 0 22px; padding: 0 16px; color: var(--portal-ink); border: 1px solid #cbd5d1; border-radius: 2px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.portal-login-form input:focus { border-color: var(--portal-green); box-shadow: 0 0 0 4px rgba(13, 74, 76, .1); outline: 0; }
.portal-password-label { display: flex; justify-content: space-between; }
.portal-password-label span { color: #8a9799; font-size: .7rem; }
.portal-login-form button { display: flex; justify-content: space-between; align-items: center; min-height: 57px; margin-top: 6px; padding: 0 21px; color: #fff; border: 0; background: var(--portal-deep); font-weight: 760; cursor: pointer; transition: background .2s, transform .2s; }
.portal-login-form button:hover { background: #0d4a4c; transform: translateY(-1px); }
.portal-login-form button span { color: var(--portal-gold); font-size: 1.3rem; }
.portal-login-help { margin-top: 31px; padding-top: 25px; border-top: 1px solid var(--portal-line); }
.portal-login-help strong { font-size: .8rem; }
.portal-login-help p { margin: 7px 0 0; color: var(--portal-muted); font-size: .77rem; line-height: 1.55; }
.portal-admin-door { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 27px; padding: 16px 0; color: var(--portal-green); border-top: 1px solid var(--portal-line); border-bottom: 1px solid var(--portal-line); text-decoration: none; }
.portal-admin-door > span:first-child { display: grid; gap: 4px; }
.portal-admin-door strong { font-size: .78rem; }
.portal-admin-door small { color: var(--portal-muted); font-size: .72rem; }
.portal-login-privacy { margin: 45px 0 0; color: #929c9c; font-size: .68rem; text-align: center; }

/* Employee shell */
.portal-authenticated { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: linear-gradient(180deg, #edf2ee 0, var(--portal-cream) 390px); }
.portal-header { position: sticky; z-index: 20; top: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 82px; padding: 0 clamp(24px, 4vw, 68px); border-bottom: 1px solid rgba(18, 50, 51, .1); background: rgba(255, 254, 251, .94); box-shadow: 0 1px 16px rgba(21,44,44,.035); backdrop-filter: blur(16px); }
.portal-brand { display: inline-flex; gap: 13px; align-items: center; text-decoration: none; }
.portal-brand img { width: 43px; height: auto; }
.portal-brand > span { display: grid; gap: 2px; }
.portal-brand strong { font-size: .86rem; letter-spacing: .16em; }
.portal-brand small { color: var(--portal-muted); font-family: var(--portal-serif); font-size: .8rem; }
.portal-desktop-nav { display: flex; justify-content: center; align-self: stretch; gap: clamp(10px, 2.2vw, 34px); }
.portal-desktop-nav > a, .portal-desktop-nav > span { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 0 3px; color: #5e6c6e; font-size: .79rem; font-weight: 680; text-decoration: none; white-space: nowrap; }
.portal-desktop-nav > .is-active { color: var(--portal-deep); }
.portal-desktop-nav > .is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; content: ''; background: var(--portal-gold); }
.portal-desktop-nav > span { cursor: not-allowed; opacity: .58; }
.portal-desktop-nav small { position: absolute; bottom: 8px; left: 50%; display: none; font-size: .52rem; transform: translateX(-50%); }
.portal-account-menu { position: relative; }
.portal-account-menu summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.portal-account-menu summary::-webkit-details-marker { display: none; }
.portal-account-avatar { display: grid; width: 38px; height: 38px; overflow: hidden; place-items: center; color: #fff; border-radius: 50%; background: var(--portal-green); font-family: var(--portal-serif); font-size: 1rem; }
.portal-account-avatar img, .portal-personnel-monogram img { width: 100%; height: 100%; object-fit: cover; }
.portal-account-copy { display: grid; gap: 1px; }
.portal-account-copy strong { font-size: .76rem; }
.portal-account-copy small { max-width: 110px; overflow: hidden; color: var(--portal-muted); font-size: .64rem; text-overflow: ellipsis; }
.portal-account-menu summary svg { width: 15px; fill: none; stroke: #657476; stroke-linecap: round; stroke-width: 1.8; }
.portal-account-popover { position: absolute; top: calc(100% + 17px); right: 0; width: 245px; padding: 18px; border: 1px solid var(--portal-line); background: #fff; box-shadow: var(--portal-shadow); }
.portal-account-popover p { display: grid; gap: 4px; margin: 0 0 15px; }
.portal-account-popover strong { font-size: .82rem; }
.portal-account-popover p span { color: var(--portal-muted); font-size: .7rem; }
.portal-account-popover button { display: flex; justify-content: space-between; width: 100%; padding: 11px 0 0; color: var(--portal-green); border: 0; border-top: 1px solid var(--portal-line); background: transparent; font-size: .77rem; font-weight: 750; cursor: pointer; }
.portal-main { width: min(100%, 1420px); margin: 0 auto; padding: clamp(42px, 6vw, 82px) clamp(24px, 5vw, 76px) 28px; }
.portal-welcome { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; margin-bottom: 42px; }
.portal-welcome h1 { margin: 0; font-family: var(--portal-serif); font-size: clamp(3.2rem, 6.3vw, 6.8rem); font-weight: 400; letter-spacing: -.06em; line-height: .83; }
.portal-welcome h1 span { display: block; color: #657775; font-family: var(--portal-sans); font-size: clamp(.8rem, 1.2vw, 1rem); font-weight: 670; letter-spacing: .02em; line-height: 1; }
.portal-welcome-copy > p:last-child { margin: 24px 0 0; color: var(--portal-muted); }
.portal-welcome-mark { display: grid; grid-template-columns: auto auto; align-items: center; gap: 12px; padding-bottom: 7px; color: #889592; }
.portal-welcome-mark span { font-size: .63rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.portal-welcome-mark strong { color: var(--portal-gold); font-family: var(--portal-serif); font-size: 2.6rem; font-weight: 400; }
.portal-identity-card { overflow: hidden; border: 1px solid rgba(16, 55, 56, .12); background: var(--portal-paper); box-shadow: var(--portal-shadow); }
.portal-identity-heading { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: clamp(24px, 3.5vw, 40px); color: #fff; background: var(--portal-deep); }
.portal-personnel-monogram { display: grid; width: 68px; height: 74px; overflow: hidden; place-items: center; color: var(--portal-deep); border-radius: 50% 50% 46% 46%; background: #e8d2a4; font-family: var(--portal-serif); font-size: 1.55rem; }
.portal-identity-heading p { margin: 0 0 6px; color: #b9cfca; font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.portal-identity-heading h2 { margin: 0; font-family: var(--portal-serif); font-size: clamp(1.75rem, 3.1vw, 3.15rem); font-weight: 400; letter-spacing: -.035em; }
.portal-status { display: inline-block; margin-top: 9px; color: #dbbd7c; font-size: .69rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.portal-canonical-note { display: inline-flex; gap: 8px; align-items: center; align-self: start; color: #bdd2cc; font-size: .67rem; }
.portal-canonical-note svg { width: 19px; fill: none; stroke: var(--portal-gold); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.portal-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.portal-facts > div { min-height: 122px; padding: 30px 34px; border-right: 1px solid var(--portal-line); border-bottom: 1px solid var(--portal-line); }
.portal-facts > div:nth-child(3n) { border-right: 0; }
.portal-facts > div:nth-last-child(-n+3) { border-bottom: 0; }
.portal-facts dt { margin-bottom: 11px; color: #7c8989; font-size: .61rem; font-weight: 780; letter-spacing: .13em; text-transform: uppercase; }
.portal-facts dd { margin: 0; color: var(--portal-ink); font-size: .96rem; font-weight: 680; line-height: 1.4; }
.portal-facts dd .portal-status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: #3a8a67; box-shadow: 0 0 0 4px #e4f1e9; }
.portal-destinations { padding-top: clamp(55px, 7vw, 90px); }
.portal-section-heading { display: grid; grid-template-columns: 1fr minmax(240px, 370px); gap: 30px; align-items: end; margin-bottom: 30px; }
.portal-section-heading h2 { margin: 0; font-family: var(--portal-serif); font-size: clamp(2.2rem, 4vw, 4.2rem); font-weight: 400; letter-spacing: -.05em; line-height: .95; }
.portal-section-heading > p { margin: 0 0 5px; color: var(--portal-muted); font-size: .86rem; line-height: 1.6; }
.portal-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-destination-card { position: relative; display: flex; flex-direction: column; min-height: 285px; padding: 24px; border: 1px solid var(--portal-line); background: rgba(255,254,251,.88); }
.portal-destination-card.is-enabled { border-color: rgba(13,74,76,.3); background: #fff; box-shadow: 0 16px 42px rgba(22,43,45,.07); }
.portal-destination-card { min-width: 0; }
#assignment-heading { scroll-margin-top: 110px; }
.portal-profile-intro, .portal-welcome-copy, .portal-identity-heading > div { min-width: 0; }
.portal-profile-intro h1, .portal-welcome h1, .portal-identity-heading h2,
.portal-profile-details dd, .portal-face-identity strong, .portal-attendance-live-message,
.portal-attendance-terminal, .portal-account-popover p { overflow-wrap: anywhere; }
.portal-card-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: var(--portal-mint); }
.portal-card-icon span { position: relative; width: 19px; height: 19px; border: 1.7px solid var(--portal-green); border-radius: 50%; }
.portal-card-icon-assignment span { border-radius: 2px; }
.portal-card-icon-attendance span::after { position: absolute; top: 3px; left: 8px; width: 1px; height: 7px; content: ''; background: var(--portal-green); transform: rotate(-25deg); transform-origin: bottom; }
.portal-card-icon-biometrics span { border-style: dashed; }
.portal-card-icon-payroll span { border-radius: 2px; transform: rotate(45deg); }
.portal-coming-soon { position: absolute; top: 27px; right: 24px; color: #8b7549; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.portal-destination-card h3 { margin: auto 0 10px; font-family: var(--portal-serif); font-size: clamp(1.55rem, 2.2vw, 2.1rem); font-weight: 400; letter-spacing: -.035em; }
.portal-destination-card > p { min-height: 42px; margin: 0 0 22px; color: var(--portal-muted); font-size: .78rem; line-height: 1.55; }
.portal-card-footer { padding-top: 15px; color: #8a9694; border-top: 1px solid var(--portal-line); font-size: .63rem; }
a.portal-card-footer { display: flex; justify-content: space-between; color: var(--portal-green); font-weight: 800; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.portal-home-footer { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 23px; color: #899492; border-top: 1px solid #d7dfda; font-size: .65rem; }
.portal-mobile-nav { display: none; }
.portal-message-page { max-width: 800px; min-height: 65vh; padding: clamp(60px, 10vw, 130px) 0; }
.portal-message-page h1 { margin: 0 0 22px; font-family: var(--portal-serif); font-size: clamp(3rem, 7vw, 6rem); font-weight: 400; letter-spacing: -.055em; line-height: .95; }
.portal-message-page > p:not(.portal-kicker) { color: var(--portal-muted); }
.portal-message-page a { display: inline-block; margin-top: 20px; color: var(--portal-green); font-weight: 750; text-decoration: none; }

/* Profile and self-service editing */
.portal-breadcrumb { display: flex; gap: 10px; align-items: center; margin: -20px 0 30px; color: #758381; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.portal-breadcrumb a { color: var(--portal-green); text-decoration: none; }
.portal-flash { margin: 0 0 24px; padding: 15px 18px; border: 1px solid #b8d8c8; background: #edf8f1; color: #245f49; font-size: .83rem; line-height: 1.5; }
.portal-flash-error { border-color: #e6c2bb; background: #fff4f1; color: #8a3328; }
.portal-profile-hero { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(22px,4vw,48px); align-items: center; margin-bottom: 34px; padding: clamp(28px,4vw,50px); color: #fff; background: var(--portal-deep); box-shadow: var(--portal-shadow); }
.portal-profile-photo { display: grid; width: clamp(110px,12vw,160px); aspect-ratio: 4 / 5; overflow: hidden; place-items: center; border: 3px solid rgba(232,210,164,.7); border-radius: 50% 50% 46% 46%; background: #e8d2a4; color: var(--portal-deep); font: 400 clamp(2rem,4vw,3.4rem)/1 var(--portal-serif); }
.portal-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.portal-profile-intro .portal-kicker { margin-bottom: 13px; }
.portal-profile-intro h1, .portal-edit-header h1 { margin: 0; font: 400 clamp(2.6rem,5vw,5.2rem)/.92 var(--portal-serif); letter-spacing: -.055em; }
.portal-profile-intro > p:not(.portal-kicker) { margin: 17px 0 0; color: #c1d0cc; font-size: .86rem; }
.portal-primary-link { display: flex; gap: 22px; align-items: center; align-self: end; padding: 15px 0; color: #f0d598; border-bottom: 1px solid rgba(240,213,152,.4); font-size: .73rem; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.portal-profile-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.portal-profile-content { display: grid; gap: 24px; }
.portal-profile-section, .portal-photo-panel, .portal-edit-form, .portal-readonly-panel { border: 1px solid var(--portal-line); background: var(--portal-paper); box-shadow: 0 12px 38px rgba(22,43,45,.045); }
.portal-profile-section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 26px 30px; border-bottom: 1px solid var(--portal-line); }
.portal-profile-section-heading p { margin: 0 0 7px; color: #8a754c; font-size: .58rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.portal-profile-section-heading h2, .portal-photo-panel h2, .portal-readonly-panel h2 { margin: 0; font: 400 2rem/1 var(--portal-serif); letter-spacing: -.035em; }
.portal-profile-section-heading > span { color: #7a8786; font-size: .65rem; }
.portal-profile-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; }
.portal-profile-details > div { min-height: 102px; padding: 24px 30px; border-right: 1px solid var(--portal-line); border-bottom: 1px solid var(--portal-line); }
.portal-profile-details > div:nth-child(2n) { border-right: 0; }
.portal-profile-details > div:nth-last-child(-n+2) { border-bottom: 0; }
.portal-profile-details > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.portal-profile-details > div:nth-last-child(2):nth-child(even) { border-bottom: 1px solid var(--portal-line); }
.portal-profile-details dt, .portal-readonly-panel dt { margin-bottom: 8px; color: #7c8989; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.portal-profile-details dd, .portal-readonly-panel dd { margin: 0; font-size: .88rem; font-weight: 670; line-height: 1.45; }
.portal-profile-details dd small { display: block; margin-top: 5px; color: #36735c; font-size: .57rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-contact-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.portal-contact-columns > div { min-height: 150px; padding: 25px 30px; border-right: 1px solid var(--portal-line); }
.portal-contact-columns > div:last-child { border-right: 0; }
.portal-contact-columns h3 { margin: 0 0 16px; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.portal-contact-columns ul { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.portal-contact-columns li { display: grid; gap: 3px; }
.portal-contact-columns li strong { font-size: .72rem; }
.portal-contact-columns li span, .portal-empty { margin: 0; color: var(--portal-muted); font-size: .72rem; line-height: 1.5; }
.portal-data-note { margin: 0; padding: 15px 30px; color: #6d7a79; border-top: 1px solid var(--portal-line); background: #f7f8f4; font-size: .65rem; }
.portal-photo-panel { position: sticky; top: 106px; padding: 29px; }
.portal-photo-panel > p:not(.portal-kicker), .portal-readonly-panel > p:last-child { color: var(--portal-muted); font-size: .77rem; line-height: 1.6; }
.portal-photo-form { display: grid; gap: 11px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--portal-line); }
.portal-photo-form label { font-size: .72rem; font-weight: 780; }
.portal-photo-form input { max-width: 100%; color: var(--portal-muted); font-size: .68rem; }
.portal-photo-form input::file-selector-button { margin-right: 9px; padding: 9px 11px; border: 1px solid #bfcbc7; background: #fff; color: var(--portal-green); font-weight: 750; cursor: pointer; }
.portal-photo-form small { color: #7a8786; font-size: .63rem; line-height: 1.5; }
.portal-photo-form button, .portal-edit-actions button { min-height: 48px; border: 0; background: var(--portal-deep); color: #fff; font-weight: 780; cursor: pointer; }
.portal-remove-photo-form { margin-top: 12px; }
.portal-remove-photo-form button { width: 100%; padding: 11px; border: 1px solid #d8bdb6; background: transparent; color: #8b3a30; font-size: .7rem; font-weight: 750; cursor: pointer; }
.portal-edit-header { max-width: 880px; margin-bottom: 35px; }
.portal-edit-header > p:last-child { max-width: 710px; color: var(--portal-muted); line-height: 1.65; }
.portal-edit-layout { display: grid; grid-template-columns: minmax(0,1fr) 390px; gap: 24px; align-items: start; }
.portal-edit-form { display: grid; gap: 26px; padding: clamp(27px,4vw,48px); }
.portal-edit-form > div:not(.portal-edit-actions) { display: grid; gap: 9px; }
.portal-edit-form label { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 780; }
.portal-edit-form label span { color: #86918f; font-size: .63rem; font-weight: 600; }
.portal-edit-form input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid #c8d2cf; background: #fff; }
.portal-edit-form input:focus { border-color: var(--portal-green); box-shadow: 0 0 0 4px rgba(13,74,76,.09); outline: 0; }
.portal-edit-form small { color: var(--portal-muted); font-size: .67rem; line-height: 1.45; }
.portal-field-error { color: #973e32; font-size: .67rem; }
.portal-edit-actions { display: flex; gap: 20px; align-items: center; padding-top: 10px; }
.portal-edit-actions button { padding: 0 22px; }
.portal-edit-actions a { color: var(--portal-muted); font-size: .72rem; font-weight: 750; text-decoration: none; }
.portal-readonly-panel { padding: 29px; }
.portal-readonly-panel dl { display: grid; gap: 0; margin: 22px 0; border-top: 1px solid var(--portal-line); }
.portal-readonly-panel dl > div { padding: 15px 0; border-bottom: 1px solid var(--portal-line); }

@media (max-width: 1050px) {
    .portal-login-shell { grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); }
    .portal-login-quote h2 { font-size: clamp(3rem, 7vw, 5rem); }
    .portal-desktop-nav { gap: 14px; }
    .portal-account-copy { display: none; }
    .portal-profile-layout, .portal-edit-layout { grid-template-columns: minmax(0,1fr); }
    .portal-photo-panel { position: static; }
    .portal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-facts > div:nth-child(3n) { border-right: 1px solid var(--portal-line); }
    .portal-facts > div:nth-child(2n) { border-right: 0; }
    .portal-facts > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--portal-line); }
    .portal-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 800px) {
    .portal-login-shell { display: block; }
    .portal-login-story { min-height: 320px; }
    .portal-login-story-image { background-position: center 36%; }
    .portal-login-brand { top: 26px; left: 25px; }
    .portal-login-quote { bottom: 30px; left: 25px; }
    .portal-login-quote h2 { margin-bottom: 0; font-size: clamp(2.8rem, 10vw, 4.8rem); }
    .portal-login-quote > span { display: none; }
    .portal-login-panel { min-height: auto; padding: 48px 25px 30px; }
    .portal-back-link { margin-bottom: 52px; }
    .portal-login-privacy { margin-top: 34px; }
    .portal-header { grid-template-columns: 1fr auto; min-height: 72px; padding: 0 20px; }
    .portal-brand img { width: 38px; }
    .portal-desktop-nav { display: none; }
    .portal-main { min-height: calc(100vh - 72px); min-height: calc(100dvh - 72px); padding: 46px 20px var(--portal-mobile-content-reserve); scroll-padding-bottom: var(--portal-mobile-content-reserve); }
    .portal-breadcrumb { margin-top: -8px; }
    .portal-profile-hero { grid-template-columns: auto 1fr; }
    .portal-profile-hero .portal-primary-link { grid-column: 1 / -1; justify-self: start; }
    .portal-contact-columns { grid-template-columns: 1fr; }
    .portal-contact-columns > div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--portal-line); }
    .portal-contact-columns > div:last-child { border-bottom: 0; }
    .portal-welcome-mark { display: none; }
    .portal-section-heading { grid-template-columns: 1fr; }
    .portal-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-destination-card:nth-child(n) { grid-column: span 1; }
    #assignment-heading { scroll-margin-top: 100px; }
    .portal-mobile-nav { position: fixed; z-index: 18; right: var(--portal-mobile-nav-offset); bottom: var(--portal-mobile-nav-offset); left: var(--portal-mobile-nav-offset); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: calc(var(--portal-mobile-nav-height) + var(--portal-mobile-safe-bottom)); padding: 8px 5px calc(8px + var(--portal-mobile-safe-bottom)); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(7,43,47,.97); box-shadow: 0 18px 45px rgba(6,31,33,.25); backdrop-filter: blur(12px); }
    .portal-mobile-nav > a, .portal-mobile-nav > span { display: grid; gap: 4px; place-items: center; min-height: 48px; color: #aebfbb; font-size: .58rem; text-decoration: none; }
    .portal-mobile-nav > .is-active { color: #f2d493; }
    .portal-mobile-nav > span { opacity: .55; }
    .portal-mobile-nav svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
}

@media (max-width: 540px) {
    .portal-login-story { min-height: 265px; }
    .portal-login-brand small { display: none; }
    .portal-login-quote h2 { font-size: 2.75rem; line-height: .9; }
    .portal-login-panel { padding-top: 38px; }
    .portal-back-link { margin-bottom: 40px; }
    .portal-login-form-wrap h1 { font-size: 3.2rem; }
    .portal-brand small { font-size: .7rem; }
    .portal-account-popover { right: -5px; }
    .portal-welcome { margin-bottom: 30px; }
    .portal-welcome h1 { font-size: clamp(2.9rem, 15vw, 4.6rem); }
    .portal-identity-heading { grid-template-columns: auto 1fr; gap: 14px; }
    .portal-personnel-monogram { width: 54px; height: 59px; }
    .portal-canonical-note { grid-column: 1 / -1; }
    .portal-facts { grid-template-columns: 1fr; }
    .portal-facts > div { min-height: auto; padding: 23px 25px; border-right: 0 !important; border-bottom: 1px solid var(--portal-line) !important; }
    .portal-facts > div:last-child { border-bottom: 0 !important; }
    .portal-card-grid { grid-template-columns: 1fr; }
    .portal-destination-card:nth-child(n) { grid-column: span 1; min-height: 245px; }
    .portal-home-footer { display: grid; gap: 6px; }
    .portal-profile-hero { grid-template-columns: 1fr; text-align: center; }
    .portal-profile-photo { margin: 0 auto; }
    .portal-profile-hero .portal-primary-link { grid-column: auto; justify-self: center; }
    .portal-profile-details { grid-template-columns: 1fr; }
    .portal-profile-details > div { min-height: auto; border-right: 0; }
    .portal-profile-details > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--portal-line); }
    .portal-profile-details > div:last-child { border-bottom: 0; }
    .portal-profile-section-heading { display: grid; }
}

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

/* Mandatory first-login password establishment */
.portal-required-step-label { color: var(--portal-muted); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.portal-password-required .portal-account-menu { margin-left: auto; }
.portal-password-establishment { display: grid; place-items: start center; min-height: calc(100vh - 90px); padding: clamp(36px, 8vw, 88px) 20px; background: radial-gradient(circle at top right, rgba(183,146,52,.12), transparent 38%); }
.portal-password-establishment-card { width: min(100%, 590px); padding: clamp(28px, 5vw, 48px); border: 1px solid var(--portal-line); border-radius: 20px; background: var(--portal-surface); box-shadow: 0 24px 60px rgba(9,36,40,.12); }
.portal-password-establishment-card h1 { margin: 8px 0 12px; font-family: var(--portal-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1; }
.portal-password-establishment-card > p:not(.portal-kicker) { color: var(--portal-muted); line-height: 1.65; }
.portal-password-notice { display: grid; gap: 4px; margin: 22px 0; padding: 16px 18px; border-left: 4px solid var(--portal-gold); background: var(--portal-gold-soft); }
.portal-password-notice span { color: var(--portal-muted); font-size: .83rem; }
.portal-password-form { margin-top: 20px; }
.portal-password-form small { display: block; margin: -7px 0 15px; color: var(--portal-muted); font-size: .75rem; }

@media (max-width: 600px) {
    .portal-required-step-label { display: none; }
    .portal-password-establishment { padding: 24px 14px; }
}

/* Phase 3 self-service biometrics */
.portal-card-status { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 0 20px; border: 1px solid var(--portal-line); }
.portal-card-status > div { padding: 10px 12px; }
.portal-card-status > div + div { border-left: 1px solid var(--portal-line); }
.portal-card-status dt { color: var(--portal-muted); font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.portal-card-status dd { margin: 4px 0 0; color: var(--portal-green); font-size: .72rem; font-weight: 750; }
.portal-biometric-hero { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 34px; padding: clamp(32px,5vw,62px); color: #fff; background: linear-gradient(120deg,#082e34,#0c4849); box-shadow: var(--portal-shadow); }
.portal-biometric-hero h1, .portal-biometric-page-head h1 { margin: 0; font: 400 clamp(3rem,7vw,6rem)/.9 var(--portal-serif); letter-spacing: -.055em; }
.portal-biometric-hero p:last-child { margin: 18px 0 0; color: #c8d8d4; }
.portal-security-mark { display: grid; width: 84px; height: 84px; place-items: center; border: 1px solid rgba(238,211,153,.4); border-radius: 50%; background: rgba(255,255,255,.04); }
.portal-security-mark svg { width: 42px; fill: none; stroke: #f0d598; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }
.portal-biometric-grid, .portal-device-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.portal-biometric-card, .portal-face-workspace, .portal-device-card { border: 1px solid var(--portal-line); background: var(--portal-paper); box-shadow: 0 14px 45px rgba(22,43,45,.06); }
.portal-biometric-card { display: flex; flex-direction: column; min-height: 500px; padding: clamp(26px,4vw,42px); }
.portal-biometric-card-head, .portal-device-card-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.portal-biometric-card-head > div { min-width: 0; }
.portal-biometric-card h2, .portal-device-card h2, .portal-face-workspace h2 { margin: 0; font: 400 clamp(1.8rem,3vw,2.6rem)/1.02 var(--portal-serif); letter-spacing: -.035em; }
.portal-biometric-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: var(--portal-mint); color: var(--portal-green); font-size: 1.7rem; }
.portal-biometric-summary { margin: 32px 0 24px; border-top: 1px solid var(--portal-line); }
.portal-biometric-summary > div { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--portal-line); }
.portal-biometric-summary dt { color: var(--portal-muted); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.portal-biometric-summary dd { margin: 0; font-size: .78rem; font-weight: 750; text-align: right; }
.portal-biometric-summary dd.is-ready { color: #217351; }
.portal-face-identity .is-ready { color: var(--portal-mint); }
.portal-biometric-card > p { color: var(--portal-muted); font-size: .8rem; line-height: 1.65; }
.portal-biometric-action { display: flex; justify-content: space-between; margin-top: auto; padding: 16px 0 5px; color: var(--portal-green); border-top: 1px solid var(--portal-line); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.portal-biometric-action.is-disabled { color: #899492; }
.portal-biometric-boundary { margin: 25px 0 0; padding: 16px 20px; color: var(--portal-muted); border-left: 3px solid var(--portal-gold); background: rgba(255,255,255,.55); font-size: .73rem; line-height: 1.55; }
.portal-biometric-alert { display: grid; gap: 5px; margin: 0 0 24px; padding: 15px 18px; border: 1px solid #e2cf9e; background: #fff9e9; }
.portal-biometric-alert strong { font-size: .78rem; }
.portal-biometric-alert span { color: var(--portal-muted); font-size: .72rem; line-height: 1.5; }
.portal-biometric-page-head { max-width: 900px; margin: 0 0 38px; }
.portal-biometric-page-head > p:last-child { max-width: 650px; color: var(--portal-muted); line-height: 1.6; }
.portal-face-identity { display: grid; grid-template-columns: 1fr auto; gap: 28px; margin-bottom: 22px; padding: 20px 24px; color: #fff; background: var(--portal-deep); }
.portal-face-identity > div { display: grid; gap: 4px; }
.portal-face-identity > div:last-child { text-align: right; }
.portal-face-identity span, .portal-face-identity small { color: #b9cbc7; font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }
.portal-face-workspace { overflow: hidden; }
.portal-face-workspace-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 30px; padding: clamp(24px,4vw,38px); border-bottom: 1px solid var(--portal-line); }
.portal-face-workspace-head > div:first-child > p:last-child { max-width: 720px; color: var(--portal-muted); font-size: .78rem; line-height: 1.6; }
.portal-biometric-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portal-biometric-controls button, .portal-biometric-controls select { min-height: 38px; border: 1px solid #cbd5d1; background: #fff; color: var(--portal-green); font-size: .68rem; }
.portal-biometric-controls button { padding: 0 11px; cursor: pointer; }
.portal-biometric-controls label { display: flex; gap: 7px; align-items: center; color: var(--portal-muted); font-size: .63rem; }
.camera-indicator { display: inline-flex; gap: 7px; align-items: center; min-height: 38px; padding: 0 11px; color: var(--portal-muted); border: 1px solid var(--portal-line); background: #fff; font-size: .66rem; }
.camera-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #9ca9a7; }
.camera-indicator.is-active i { background: #2a8c63; box-shadow: 0 0 0 4px rgba(42,140,99,.12); }
.enrollment-initial, .enrollment-confirmation, .enrollment-success, .enrollment-error { padding: clamp(28px,5vw,55px); }
.model-readiness { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 25px; color: var(--portal-muted); font-size: .78rem; }
.readiness-spinner { width: 14px; height: 14px; border: 2px solid #cad7d3; border-top-color: var(--portal-green); border-radius: 50%; animation: portal-spin .9s linear infinite; }
.model-readiness.is-ready .readiness-spinner { border: 0; background: #2a8c63; animation: none; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
.portal-face-actions, .dialog-actions, .credential-actions { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.portal-button-primary, .portal-button-secondary, .portal-button-danger { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 19px; border: 1px solid transparent; font-size: .74rem; font-weight: 780; text-decoration: none; cursor: pointer; }
.portal-button-primary { background: var(--portal-deep); color: #fff; }
.portal-button-secondary { border-color: #bdcac6; background: #fff; color: var(--portal-green); }
.portal-button-danger { border-color: #d9b8b1; background: #fff7f5; color: #8b3328; }
.portal-button-primary:disabled { cursor: not-allowed; opacity: .45; }
.camera-workspace { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: clamp(22px,4vw,45px); padding: clamp(22px,4vw,42px); }
.camera-preview-wrap { position: relative; overflow: hidden; aspect-ratio: 4/3; max-height: 62vh; border-radius: 5px; background: #071d21; }
.camera-preview-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-guide { position: absolute; inset: 10%; display: grid; place-items: center; pointer-events: none; }
.camera-guide span { width: min(55%,280px); aspect-ratio: .76; border: 2px solid rgba(240,213,152,.9); border-radius: 48% 48% 44% 44%; box-shadow: 0 0 0 999px rgba(4,24,27,.23); }
.camera-guide-copy { position: absolute; right: 12px; bottom: 12px; left: 12px; color: #fff; font-size: .7rem; text-align: center; text-shadow: 0 1px 5px #000; }
.camera-picker { display: grid; gap: 6px; margin-top: 10px; color: var(--portal-muted); font-size: .68rem; }
.camera-picker select { min-height: 44px; padding: 0 10px; border: 1px solid #bdcac6; background: #fff; }
.capture-column { display: flex; flex-direction: column; gap: 25px; }
.capture-instruction { padding-bottom: 22px; border-bottom: 1px solid var(--portal-line); }
.capture-instruction h3, .enrollment-confirmation h3, .enrollment-success h3, .enrollment-error h3 { margin: 0 0 13px; font: 400 clamp(1.8rem,4vw,2.8rem)/1 var(--portal-serif); }
.capture-instruction > p:last-child, .enrollment-confirmation > p, .enrollment-success > p, .enrollment-error > p { color: var(--portal-muted); font-size: .78rem; line-height: 1.55; }
.enrollment-progress > div { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; font-size: .7rem; }
.enrollment-progress ol { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.enrollment-progress li { display: grid; gap: 6px; min-width: 0; color: #8a9694; font-size: .56rem; text-align: center; }
.enrollment-progress li::before { width: 100%; height: 7px; content: ''; border-radius: 20px; background: #dfe5e1; }
.enrollment-progress li.is-current::before { background: var(--portal-gold); }
.enrollment-progress li.is-complete::before { background: #2a8c63; }
.enrollment-progress li > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.enrollment-progress b { overflow: hidden; text-overflow: ellipsis; }
.capture-help { color: var(--portal-muted); font-size: .66rem; line-height: 1.5; }
.completion-mark, .error-camera-icon { display: grid; width: 54px; height: 54px; margin-bottom: 22px; place-items: center; border-radius: 50%; background: #dff1e7; color: #217351; font-size: 1.5rem; }
.error-camera-icon { background: #f9e4df; color: #913b30; }
.portal-device-privacy { display: flex; gap: 18px; margin-bottom: 24px; padding: 23px; color: #fff; background: var(--portal-deep); }
.portal-device-privacy > span { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border: 1px solid rgba(240,213,152,.5); border-radius: 50%; color: #f0d598; }
.portal-device-privacy p { margin: 6px 0 0; color: #c3d3cf; font-size: .75rem; line-height: 1.55; }
.portal-device-card { padding: clamp(24px,4vw,38px); }
.portal-device-card-head > span { color: var(--portal-muted); font-size: .65rem; font-weight: 750; text-align: right; }
.portal-device-card-head > span.is-supported { color: #217351; }
.portal-device-card-head > span.is-unavailable { color: #913b30; }
.portal-device-card > p { color: var(--portal-muted); font-size: .77rem; line-height: 1.6; }
.device-label-field { display: grid; gap: 8px; margin: 25px 0 15px; font-size: .72rem; font-weight: 750; }
.device-label-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #bdcac6; }
.device-inline-result { min-height: 22px; color: var(--portal-muted); font-size: .72rem; }
.device-inline-result.is-success { color: #217351; }
.device-inline-result.is-error { color: #913b30; }
.credential-list { display: grid; gap: 12px; margin-top: 25px; }
.credential-item { padding: 18px; border: 1px solid var(--portal-line); background: #fff; }
.credential-item.is-revoked { opacity: .65; }
.credential-summary { display: flex; gap: 12px; align-items: center; }
.credential-icon { display: grid; flex: 0 0 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--portal-mint); color: var(--portal-green); }
.credential-summary > div { display: grid; gap: 3px; min-width: 0; }
.credential-summary strong { overflow-wrap: anywhere; font-size: .78rem; }
.credential-status { color: #217351; font-size: .63rem; font-weight: 750; }
.credential-item.is-revoked .credential-status { color: #7a8786; }
.credential-item dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.credential-item dt { color: var(--portal-muted); font-size: .57rem; letter-spacing: .08em; text-transform: uppercase; }
.credential-item dd { margin: 4px 0 0; font-size: .67rem; }
.credential-empty { display: grid; gap: 5px; padding: 24px; border: 1px dashed #bdcac6; color: var(--portal-muted); text-align: center; }
.credential-empty strong { color: var(--portal-ink); font-size: .8rem; }
.credential-empty span { font-size: .7rem; }
.portal-text-link { display: inline-block; margin-top: 28px; color: var(--portal-green); font-size: .73rem; font-weight: 760; text-decoration: none; }
.device-revoke-dialog { width: min(calc(100% - 30px),480px); padding: 0; border: 0; background: transparent; }
.device-revoke-dialog::backdrop { background: rgba(5,27,30,.65); }
.device-revoke-dialog > div { padding: 30px; background: #fff; box-shadow: var(--portal-shadow); }
.device-revoke-dialog h2 { margin: 14px 0 9px; font: 400 2rem/1 var(--portal-serif); }
.device-revoke-dialog p { color: var(--portal-muted); font-size: .76rem; line-height: 1.55; }
.danger-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: #f9e4df; color: #913b30; font-weight: 800; }

@media (max-width: 1024px) {
    .portal-biometric-grid, .portal-device-grid { grid-template-columns: 1fr; }
    .portal-biometric-card { min-height: 390px; }
    .camera-workspace { grid-template-columns: 1fr; }
    .camera-preview-wrap { max-height: 58vh; }
}
@media (max-width: 768px) {
    .portal-biometric-hero { align-items: center; }
    .portal-face-workspace-head { grid-template-columns: 1fr; }
    .portal-face-workspace-head, .camera-workspace { padding: 22px; }
    .portal-biometric-controls { align-items: flex-start; }
    .camera-preview-wrap { max-height: 52vh; }
}
@media (max-width: 430px) {
    .portal-main { padding-right: 14px; padding-left: 14px; }
    .portal-biometric-hero { padding: 28px 22px; }
    .portal-security-mark { display: none; }
    .portal-biometric-card { min-height: 0; padding: 24px 20px; }
    .portal-biometric-card-head { display: grid; }
    .portal-biometric-summary > div { display: grid; gap: 6px; }
    .portal-biometric-summary dd { text-align: left; }
    .portal-face-identity { grid-template-columns: 1fr; }
    .portal-face-identity > div:last-child { text-align: left; }
    .portal-face-workspace-head, .camera-workspace, .enrollment-initial, .enrollment-confirmation, .enrollment-success, .enrollment-error { padding: 20px 16px; }
    .camera-preview-wrap { max-height: 48vh; }
    .portal-face-actions > *, .portal-device-card .portal-button-primary { width: 100%; }
    .portal-biometric-controls label { width: 100%; }
    .credential-item dl { grid-template-columns: 1fr; }
    .portal-device-privacy { padding: 19px 16px; }
    .portal-device-privacy > span { display: none; }
}
@media (max-width: 390px) {
    .enrollment-progress b { display: none; }
    .portal-biometric-page-head h1 { font-size: 2.8rem; }
}
@media (max-width: 360px) {
    .portal-biometric-controls button, .camera-indicator { width: 100%; justify-content: center; }
    .camera-preview-wrap { max-height: 43vh; }
}
@media (prefers-reduced-motion: reduce) {
    .readiness-spinner { animation: none; }
}

/* Phase 4 foreground-only location readiness */
.portal-location-readiness-link { margin-top: 10px; color: var(--portal-green); font-size: .66rem; font-weight: 780; line-height: 1.4; text-decoration: none; }
.portal-location-page { width: min(100%, 1240px); margin: 0 auto; }
.portal-location-hero { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 28px; padding: clamp(32px,5vw,62px); color: #fff; background: linear-gradient(122deg,#082e34,#0c4a49); box-shadow: var(--portal-shadow); }
.portal-location-hero h1 { margin: 0; font: 400 clamp(3rem,7vw,6rem)/.9 var(--portal-serif); letter-spacing: -.055em; }
.portal-location-hero p:last-child { max-width: 690px; margin: 18px 0 0; color: #c8d8d4; line-height: 1.6; }
.portal-location-mark { display: grid; flex: 0 0 84px; width: 84px; height: 84px; place-items: center; border: 1px solid rgba(238,211,153,.4); border-radius: 50%; }
.portal-location-mark svg { width: 45px; fill: none; stroke: #f0d598; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.portal-location-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 24px; }
.portal-location-workspace, .portal-location-privacy { border: 1px solid var(--portal-line); background: var(--portal-paper); box-shadow: 0 14px 45px rgba(22,43,45,.06); }
.portal-location-workspace { padding: clamp(25px,4vw,42px); }
.portal-location-workspace-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.portal-location-workspace h2, .portal-location-privacy h2 { margin: 0; font: 400 clamp(2rem,4vw,3.2rem)/.98 var(--portal-serif); letter-spacing: -.04em; }
.location-state-badge { flex: 0 0 auto; padding: 7px 10px; color: var(--portal-muted); border: 1px solid var(--portal-line); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.location-state-badge.is-working { color: #765b18; border-color: #e0c87f; background: #fff8df; }
.location-state-badge.is-success { color: #217351; border-color: #a8d0bd; background: #eef9f3; }
.location-state-badge.is-error { color: #913b30; border-color: #e0bdb6; background: #fff4f2; }
.location-readiness-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 30px 0 24px; border: 1px solid var(--portal-line); }
.location-readiness-facts > div { min-height: 96px; padding: 18px; }
.location-readiness-facts > div:nth-child(odd) { border-right: 1px solid var(--portal-line); }
.location-readiness-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--portal-line); }
.location-readiness-facts dt { color: var(--portal-muted); font-size: .6rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.location-readiness-facts dd { margin: 9px 0 0; font-size: .76rem; font-weight: 760; overflow-wrap: anywhere; }
.location-result { display: grid; gap: 6px; min-height: 82px; padding: 18px 20px; border-left: 4px solid #91a5a0; background: #f4f7f5; }
.location-result strong { font-size: .82rem; }
.location-result span { color: var(--portal-muted); font-size: .73rem; line-height: 1.5; }
.location-result.is-working { border-left-color: var(--portal-gold); background: #fff9e9; }
.location-result.is-success { border-left-color: #2a8c63; background: #eff8f3; }
.location-result.is-error { border-left-color: #a64c40; background: #fff4f2; }
.portal-location-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.portal-location-privacy { padding: clamp(26px,4vw,38px); color: #fff; background: var(--portal-deep); }
.portal-location-privacy h2 { color: #fff; }
.portal-location-privacy > p:not(.portal-kicker):not(.portal-location-phase-note), .portal-location-privacy li { color: #c3d3cf; font-size: .75rem; line-height: 1.65; }
.portal-location-privacy ul { display: grid; gap: 10px; margin: 25px 0; padding-left: 20px; }
.portal-location-phase-note { margin: 28px 0 0; padding: 17px; color: #f2d493; border: 1px solid rgba(240,213,152,.35); font-size: .72rem; line-height: 1.55; }

@media (max-width: 1024px) {
    .portal-location-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .portal-location-hero { align-items: center; }
}
@media (max-width: 430px) {
    .portal-location-hero { padding: 28px 22px; }
    .portal-location-mark { display: none; }
    .portal-location-workspace, .portal-location-privacy { padding: 22px 18px; }
    .portal-location-workspace-head { display: grid; }
    .location-state-badge { justify-self: start; }
    .location-readiness-facts { grid-template-columns: 1fr; }
    .location-readiness-facts > div { min-height: 78px; border-right: 0 !important; border-bottom: 1px solid var(--portal-line); }
    .location-readiness-facts > div:last-child { border-bottom: 0; }
    .portal-location-actions > * { width: 100%; }
}
@media (max-width: 390px) {
    .portal-location-hero h1 { font-size: 2.8rem; }
}
@media (max-width: 360px) {
    .portal-location-workspace, .portal-location-privacy { padding-right: 15px; padding-left: 15px; }
}

/* Phase 5 biometric + GPS Personnel Portal attendance */
.portal-attendance-page { width: min(100%,1240px); margin: 0 auto; }
.portal-attendance-hero { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 24px; padding: clamp(32px,5vw,60px); color: #fff; background: linear-gradient(122deg,#082e34,#0d4b4a); box-shadow: var(--portal-shadow); }
.portal-attendance-hero h1 { margin: 0; font: 400 clamp(3.2rem,7vw,6.3rem)/.88 var(--portal-serif); letter-spacing: -.055em; }
.portal-attendance-hero p:last-child { max-width: 700px; margin: 18px 0 0; color: #c6d7d3; line-height: 1.6; }
.portal-attendance-date { display: grid; flex: 0 0 115px; padding: 18px; border: 1px solid rgba(240,213,152,.4); text-align: center; }
.portal-attendance-date span, .portal-attendance-date small { color: #c6d7d3; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.portal-attendance-date strong { margin: 5px 0; color: #f0d598; font: 400 1.8rem/1 var(--portal-serif); }
.portal-today-card { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr) auto; gap: 28px; align-items: center; padding: clamp(25px,4vw,40px); border: 1px solid var(--portal-line); background: var(--portal-paper); box-shadow: 0 14px 45px rgba(22,43,45,.07); }
.portal-today-copy h2, .portal-attendance-workflow h2, .portal-attendance-history h2 { margin: 0; font: 400 clamp(2rem,4vw,3.2rem)/.98 var(--portal-serif); letter-spacing: -.04em; }
.portal-today-copy > p:last-child { margin: 10px 0 0; color: var(--portal-muted); font-size: .75rem; }
.portal-today-times { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; border: 1px solid var(--portal-line); }
.portal-today-times > div { min-height: 78px; padding: 17px; }
.portal-today-times > div + div { border-left: 1px solid var(--portal-line); }
.portal-today-times dt, .portal-attendance-confirm dt, .portal-attendance-success dt { color: var(--portal-muted); font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.portal-today-times dd { margin: 8px 0 0; color: var(--portal-green); font: 700 1.05rem/1.2 var(--portal-sans); }
.portal-today-action { display: grid; gap: 8px; justify-items: stretch; min-width: 170px; text-align: center; }
.portal-today-action small { max-width: 180px; color: var(--portal-muted); font-size: .6rem; line-height: 1.45; }
.portal-attendance-primary { min-height: 58px; padding: 0 26px; border: 0; background: var(--portal-deep); color: #fff; font-size: .78rem; font-weight: 850; letter-spacing: .1em; cursor: pointer; }
.portal-attendance-primary:disabled { cursor: wait; opacity: .55; }
.portal-attendance-complete-mark { display: grid; width: 58px; height: 58px; margin: auto; place-items: center; border-radius: 50%; background: #dff1e7; color: #217351; font-size: 1.5rem; }
.portal-attendance-workflow { margin-top: 24px; padding: clamp(24px,4vw,40px); border: 1px solid var(--portal-line); background: var(--portal-paper); box-shadow: 0 14px 45px rgba(22,43,45,.07); }
.portal-attendance-workflow > header, .portal-attendance-history > header { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; }
.portal-text-button { padding: 8px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--portal-green); font-size: .7rem; font-weight: 780; cursor: pointer; }
.portal-attendance-steps { display: grid; grid-template-columns: repeat(3,1fr); margin: 28px 0 22px; padding: 0; border: 1px solid var(--portal-line); list-style: none; }
.portal-attendance-page[data-location-required="false"] .portal-attendance-steps { grid-template-columns: repeat(2,1fr); }
.portal-attendance-steps li { display: flex; gap: 12px; min-width: 0; min-height: 78px; padding: 15px; align-items: center; color: #8a9694; }
.portal-attendance-steps li + li { border-left: 1px solid var(--portal-line); }
.portal-attendance-steps li > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border: 1px solid #bdcac6; border-radius: 50%; font-size: .68rem; }
.portal-attendance-steps li div { display: grid; gap: 4px; min-width: 0; }
.portal-attendance-steps strong { color: inherit; font-size: .72rem; }
.portal-attendance-steps small { overflow: hidden; font-size: .6rem; line-height: 1.35; text-overflow: ellipsis; }
.portal-attendance-steps li.is-active { color: #765b18; background: #fff9e9; }
.portal-attendance-steps li.is-complete { color: #217351; background: #eff8f3; }
.portal-attendance-steps li.is-complete > span { border-color: #2a8c63; background: #2a8c63; color: #fff; }
.portal-attendance-steps li.is-ended { color: #746763; background: #f5efed; }
.portal-attendance-steps li.is-ended > span { border-color: #b49389; color: #7f4037; }
.portal-attendance-live-message { display: grid; gap: 5px; min-height: 74px; padding: 17px 19px; border-left: 4px solid #91a5a0; background: #f4f7f5; }
.portal-attendance-live-message strong { font-size: .78rem; }
.portal-attendance-live-message span { color: var(--portal-muted); font-size: .7rem; line-height: 1.45; }
.portal-attendance-live-message.is-working { border-left-color: var(--portal-gold); background: #fff9e9; }
.portal-attendance-live-message.is-success { border-left-color: #2a8c63; background: #eff8f3; }
.portal-attendance-live-message.is-error { border-left-color: #a64c40; background: #fff4f2; }
.portal-identity-methods { margin-top: 25px; }
.portal-identity-methods > div:first-child > p:last-child { color: var(--portal-muted); font-size: .74rem; }
.portal-identity-methods h3, .portal-attendance-camera h3, .portal-attendance-confirm h3, .portal-attendance-success h3, .portal-attendance-terminal h3 { margin: 0; font: 400 clamp(1.8rem,3vw,2.6rem)/1 var(--portal-serif); }
.portal-method-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 20px; }
.portal-method-grid article { display: grid; grid-template-columns: auto 1fr; gap: 8px 15px; padding: 24px; border: 1px solid var(--portal-line); background: #fff; }
.portal-method-grid article > span { grid-row: span 2; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--portal-mint); color: var(--portal-green); }
.portal-method-grid h4 { margin: 2px 0 0; font-size: .83rem; }
.portal-method-grid p { grid-column: 2; margin: 0; color: var(--portal-muted); font-size: .7rem; line-height: 1.45; }
.portal-method-grid article > button, .portal-method-grid article > a, .portal-device-choice { grid-column: 1 / -1; }
.portal-device-choice { display: flex; flex-wrap: wrap; gap: 7px; }
.portal-attendance-camera { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(270px,.85fr); gap: 28px; margin-top: 25px; padding: 24px; color: #fff; background: var(--portal-deep); }
/* These interactive components use the HTML hidden attribute as their visibility contract.
   Author-level grid/flex declarations otherwise override the browser's default hidden rule. */
.portal-attendance-page [hidden],
.portal-face-shell [hidden],
.portal-device-shell [hidden],
.portal-location-page [hidden] { display: none; }
.portal-camera-preview { position: relative; overflow: hidden; aspect-ratio: 4/3; background: #061d20; }
.portal-camera-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.portal-camera-preview > div { position: absolute; inset: 10%; display: grid; place-items: center; pointer-events: none; }
.portal-camera-preview > div span { width: min(55%,220px); aspect-ratio: .76; border: 2px solid #f0d598; border-radius: 48%; box-shadow: 0 0 0 999px rgba(4,24,27,.2); }
.portal-attendance-camera > div:last-child { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.portal-attendance-camera p:not(.portal-kicker) { color: #c6d7d3; font-size: .73rem; line-height: 1.5; }
.portal-attendance-camera [data-face-progress] { margin: 8px 0 22px; color: #f0d598; font-size: .72rem; }
.portal-attendance-confirm, .portal-attendance-success, .portal-attendance-terminal { margin-top: 25px; padding: clamp(25px,4vw,42px); border: 1px solid var(--portal-line); background: #fff; }
.portal-attendance-confirm dl, .portal-attendance-success dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 24px 0; border: 1px solid var(--portal-line); }
.portal-attendance-confirm dl > div, .portal-attendance-success dl > div { padding: 17px; }
.portal-attendance-confirm dl > div + div, .portal-attendance-success dl > div + div { border-left: 1px solid var(--portal-line); }
.portal-attendance-confirm dd, .portal-attendance-success dd { margin: 7px 0 0; font-size: .76rem; font-weight: 760; }
.portal-attendance-confirm > p:not(.portal-kicker) { color: var(--portal-muted); font-size: .72rem; }
.portal-attendance-success > span { display: grid; width: 50px; height: 50px; margin-bottom: 18px; place-items: center; border-radius: 50%; background: #dff1e7; color: #217351; font-size: 1.35rem; }
.portal-attendance-success > strong { display: block; margin-top: 12px; color: var(--portal-green); font: 400 2.1rem/1 var(--portal-serif); }
.portal-attendance-workflow.is-terminal { border-color: #dcc6c0; background: #fffaf8; }
.portal-attendance-terminal { border-left: 4px solid #a64c40; }
.portal-attendance-terminal > p:not(.portal-kicker) { max-width: 620px; margin: 14px 0 24px; color: var(--portal-muted); font-size: .78rem; line-height: 1.6; }
.portal-attendance-history { margin-top: 48px; }
.portal-attendance-history > header > p { max-width: 320px; color: var(--portal-muted); font-size: .72rem; text-align: right; }
.portal-history-list { display: grid; gap: 10px; margin-top: 22px; }
.portal-history-list article { display: grid; grid-template-columns: minmax(180px,1.25fr) repeat(4,minmax(110px,1fr)); gap: 15px; align-items: center; min-height: 88px; padding: 17px 20px; border: 1px solid var(--portal-line); background: var(--portal-paper); }
.portal-history-list article > div { display: grid; gap: 5px; min-width: 0; }
.portal-history-list small { color: var(--portal-muted); font-size: .56rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-history-list strong { overflow-wrap: anywhere; font-size: .68rem; }
.portal-history-date strong { font-family: var(--portal-serif); font-size: 1rem; font-weight: 500; }
.portal-history-date span { color: #217351; font-size: .64rem; font-weight: 750; }
.portal-history-empty { display: grid; gap: 5px; margin-top: 22px; padding: 35px; border: 1px dashed #bdcac6; color: var(--portal-muted); text-align: center; }
.portal-history-empty strong { color: var(--portal-ink); }
.portal-history-empty span { font-size: .72rem; }
.portal-attendance-privacy { margin: 30px 0 0; padding: 17px 20px; border-left: 3px solid var(--portal-gold); background: rgba(255,255,255,.55); color: var(--portal-muted); font-size: .7rem; line-height: 1.6; }
.portal-attendance-privacy a { color: var(--portal-green); }

@media (max-width: 1024px) {
    .portal-today-card { grid-template-columns: 1fr 1fr; }
    .portal-today-action { grid-column: 1 / -1; justify-self: stretch; }
    .portal-today-action small { max-width: none; }
    .portal-history-list article { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .portal-history-date { grid-column: span 3; }
}
@media (max-width: 768px) {
    .portal-attendance-hero { align-items: center; }
    .portal-today-card { grid-template-columns: 1fr; }
    .portal-today-action { grid-column: auto; }
    .portal-method-grid, .portal-attendance-camera { grid-template-columns: 1fr; }
    .portal-camera-preview { max-height: 52vh; max-height: 52dvh; }
}
@media (max-width: 430px) {
    .portal-attendance-hero { padding: 28px 22px; }
    .portal-attendance-date { display: none; }
    .portal-today-card, .portal-attendance-workflow { padding: 22px 18px; }
    .portal-today-times { grid-template-columns: 1fr; }
    .portal-today-times > div + div { border-top: 1px solid var(--portal-line); border-left: 0; }
    .portal-attendance-primary { width: 100%; min-height: 60px; }
    .portal-attendance-steps { grid-template-columns: 1fr; }
    .portal-attendance-steps li + li { border-top: 1px solid var(--portal-line); border-left: 0; }
    .portal-method-grid article, .portal-attendance-camera { padding: 18px 15px; }
    .portal-attendance-confirm dl, .portal-attendance-success dl { grid-template-columns: 1fr; }
    .portal-attendance-confirm dl > div + div, .portal-attendance-success dl > div + div { border-top: 1px solid var(--portal-line); border-left: 0; }
    .portal-history-list article { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .portal-history-date { grid-column: span 2; }
    .portal-attendance-history > header { display: grid; }
    .portal-attendance-history > header > p { text-align: left; }
}
@media (max-width: 390px) {
    .portal-attendance-hero h1 { font-size: 3rem; }
    .portal-attendance-workflow > header { display: grid; }
}
@media (max-width: 360px) {
    .portal-today-card, .portal-attendance-workflow { padding-right: 15px; padding-left: 15px; }
    .portal-history-list article { grid-template-columns: 1fr; }
    .portal-history-date { grid-column: auto; }
}
