:root {
    --navy: #123a76;
    --navy-dark: #0b2856;
    --blue: #2a5ea5;
    --sky: #eaf2ff;
    --orange: #f28c28;
    --orange-soft: #fff3e7;
    --green: #157554;
    --green-soft: #e8f7f0;
    --red: #b43a45;
    --red-soft: #fcecef;
    --ink: #1f2d42;
    --muted: #66748a;
    --line: #dce4ef;
    --surface: #ffffff;
    --background: #f4f7fb;
    --shadow: 0 16px 45px rgba(18, 58, 118, .09);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); }

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto minmax(230px, 1fr);
    align-items: center;
    min-height: 78px;
    padding: 8px clamp(18px, 4vw, 64px);
    border-bottom: 1px solid rgba(18, 58, 118, .1);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: var(--navy);
    text-decoration: none;
}

.brand img { width: 58px; height: 52px; object-fit: contain; }
.brand span, .user-menu a span { display: flex; flex-direction: column; }
.brand strong { font-size: 1.03rem; letter-spacing: -.02em; }
.brand small, .user-menu small { color: var(--muted); font-size: .73rem; }

.main-nav { display: flex; align-self: stretch; align-items: center; gap: 8px; }
.main-nav a {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 15px;
    border-radius: 12px;
    color: #56667d;
    font-size: .91rem;
    font-weight: 700;
    text-decoration: none;
}
.main-nav a:hover { background: #f2f6fb; color: var(--navy); }
.main-nav a.active { background: var(--sky); color: var(--navy); }

.user-menu { display: flex; justify-self: end; align-items: center; gap: 15px; }
.user-menu a { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.user-menu a > span:last-child { max-width: 170px; }
.user-menu strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar {
    display: grid !important;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--navy);
    color: #fff;
    font-weight: 800;
}

.link-button, .button-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: .78rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-main { width: min(1220px, calc(100% - 40px)); min-height: calc(100vh - 144px); margin: 0 auto; padding: 44px 0 64px; }
.public-main { min-height: calc(100vh - 48px); }

.page-heading { margin-bottom: 30px; }
.page-heading h1, .result-hero h1 { margin: 4px 0 8px; color: var(--navy-dark); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.045em; }
.page-heading > p:last-child, .result-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.heading-with-aside { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: .76rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.course-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #b9ddce; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .82rem; font-weight: 750; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #21a77a; box-shadow: 0 0 0 4px rgba(33, 167, 122, .13); }

.form-section, .card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 30px rgba(18, 58, 118, .05);
}

.section-index { display: grid; align-content: start; justify-content: center; padding-top: 32px; background: var(--navy); color: #fff; font-size: 1.05rem; font-weight: 850; }
.section-content { min-width: 0; padding: 30px clamp(22px, 4vw, 42px) 36px; }
.section-title, .card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.section-title h2, .card-heading h2 { margin: 0 0 4px; color: var(--navy); font-size: 1.28rem; letter-spacing: -.02em; }
.section-title p, .card-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.actions-title { align-items: center; }

.form-grid { display: grid; gap: 20px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.form-action { display: flex; align-items: flex-end; }

label { display: flex; flex-direction: column; gap: 8px; color: #34445b; font-size: .82rem; font-weight: 750; }
label small { color: var(--muted); font-size: .75rem; font-weight: 500; }
input, select, textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd6e4;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input, select { padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(42, 94, 165, .11); }
input::placeholder, textarea::placeholder { color: #9aa7b8; }

.mail-choice { grid-column: span 1; flex-direction: row; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid #cbd6e4; border-radius: 11px; background: #f9fbfd; cursor: pointer; }
.mail-choice input { flex: 0 0 auto; width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--navy); }
.mail-choice span { display: flex; flex-direction: column; gap: 2px; }

.paste-panel { margin-bottom: 18px; border: 1px dashed #b7c7da; border-radius: 12px; background: #f9fbfe; }
.paste-panel summary { padding: 13px 16px; color: var(--blue); cursor: pointer; font-size: .84rem; font-weight: 800; }
.paste-content { padding: 0 16px 16px; }
.paste-content p { margin: 0 0 10px; color: var(--muted); font-size: .82rem; }
.button-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.field-message { color: var(--muted); font-size: .8rem; }

.trainee-table-wrap, .data-table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.trainee-table { min-width: 720px; }
.trainee-table th { padding: 0 7px 8px; color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.trainee-table td { padding: 5px 7px; }
.trainee-table th:first-child, .trainee-table td:first-child { padding-left: 0; }
.trainee-table th:last-child, .trainee-table td:last-child { width: 46px; padding-right: 0; }
.trainee-table input { min-height: 43px; background: #fbfcfe; }
.trainee-row.removing { opacity: 0; transform: translateX(12px); transition: .18s ease; }

.icon-button { display: grid; width: 35px; height: 35px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #8996a8; cursor: pointer; font-size: 1.4rem; }
.icon-button:hover { background: var(--red-soft); color: var(--red); }
.count-badge { display: inline-flex; align-items: baseline; gap: 4px; padding: 8px 11px; border-radius: 999px; background: var(--sky); color: var(--navy); font-size: .76rem; font-weight: 700; white-space: nowrap; }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 780; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(18, 58, 118, .16); }
.button-primary:hover { background: var(--navy-dark); }
.button-secondary { border-color: #c7d4e5; background: #fff; color: var(--navy); }
.button-secondary:hover { border-color: #9fb2cc; background: #f8fafd; }
.button-danger { border-color: #efc1c7; background: #fff; color: var(--red); }
.button-add { margin-top: 14px; border-color: #c7d4e5; background: #f8fafd; color: var(--blue); }
.button-large { min-height: 51px; padding: 0 22px; }
.button-wide { width: 100%; }

.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin: 28px 0 5px; padding: 20px 22px; border-radius: 15px; background: var(--navy-dark); color: #fff; box-shadow: var(--shadow); }
.submit-bar div { display: flex; flex-direction: column; }
.submit-bar strong { font-size: .9rem; }
.submit-bar span { color: #becde3; font-size: .8rem; }
.submit-bar .button-primary { background: var(--orange); box-shadow: none; }
.submit-bar .button-primary:hover { background: #dd7818; }
.submit-bar .button-primary span { color: inherit; font-size: 1.1rem; }

.notice { display: flex; align-items: flex-start; gap: 11px; width: min(1220px, 100%); margin: 0 auto 20px; padding: 14px 17px; border: 1px solid; border-radius: 12px; font-size: .87rem; }
.notice > span { display: grid; flex: 0 0 auto; width: 23px; height: 23px; place-items: center; border-radius: 50%; font-size: .75rem; font-weight: 900; }
.notice p { margin: 1px 0 0; }
.notice-success { border-color: #b9ddce; background: var(--green-soft); color: #115c43; }
.notice-success > span { background: var(--green); color: #fff; }
.notice-error { border-color: #efc1c7; background: var(--red-soft); color: #8a2833; }
.notice-error > span { background: var(--red); color: #fff; }
.notice-warning { border-color: #f2cfac; background: var(--orange-soft); color: #83501f; }
.notice-warning > span { background: var(--orange); color: #fff; }
.notice-info { border-color: #bfd1eb; background: var(--sky); color: var(--navy); }
.notice-info > span { background: var(--blue); color: #fff; }

.result-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-bottom: 22px; padding: 29px 32px; border-radius: var(--radius); }
.result-success { border: 1px solid #b9ddce; background: linear-gradient(120deg, #ecf9f4, #f9fdfb); }
.result-partial { border: 1px solid #f2cfac; background: linear-gradient(120deg, #fff4e8, #fffaf5); }
.result-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: var(--green); color: #fff; font-size: 1.5rem; font-weight: 900; }
.result-partial .result-icon { background: var(--orange); }
.result-hero h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.result-actions { display: flex; gap: 9px; }

.card { display: block; padding: 28px; }
.data-table th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .71rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 14px; border-bottom: 1px solid #edf1f6; color: #415067; font-size: .84rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { display: block; color: var(--ink); }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); }
.data-table tr:hover td { background: #fbfcfe; }
.pill { display: inline-flex; align-items: center; min-height: 27px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.pill-success { background: var(--green-soft); color: var(--green); }
.pill-error { background: var(--red-soft); color: var(--red); }
.pill-warning { background: var(--orange-soft); color: #9a5b1c; }
.pill-neutral { background: #edf2f7; color: #536278; }
.password-cell { display: flex; align-items: center; gap: 8px; }
code { padding: 5px 8px; border-radius: 7px; background: #eef2f7; color: var(--navy-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .79rem; }
.copy-button { padding: 5px 8px; border: 0; border-radius: 7px; background: var(--sky); color: var(--blue); cursor: pointer; font-size: .72rem; font-weight: 800; }
.table-link { color: var(--blue); font-size: .8rem; font-weight: 800; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--blue); font-size: .84rem; font-weight: 750; text-decoration: none; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.summary-card { padding: 20px 23px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.summary-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.summary-card strong { color: var(--navy); font-size: 2rem; }
.summary-good strong { color: var(--green); }
.summary-bad strong { color: var(--red); }

.hidden-panel { display: none; }
.hidden-panel.open { display: block; }
.credential-reveal { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #b9ddce; border-radius: 15px; background: var(--green-soft); }
.credential-reveal div { flex: 1; }
.credential-reveal p { margin: 2px 0 0; color: #477162; font-size: .8rem; }
.credential-reveal code { background: #fff; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.settings-grid .card { margin: 0; }
.definition-list { margin: 0 0 22px; }
.definition-list div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #edf1f6; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; color: var(--ink); font-weight: 750; text-align: right; }
.code-list { margin: 0; padding: 0; list-style: none; }
.code-list li { margin-bottom: 7px; padding: 7px 9px; border-radius: 7px; background: #f1f4f8; color: var(--navy-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .77rem; }

.narrow-page { width: min(610px, 100%); margin: 0 auto; }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.stack-form .button { margin-top: 4px; }
.empty-state, .error-state { display: grid; justify-items: center; padding: 54px 20px; text-align: center; }
.empty-state > span, .error-state > span { display: grid; width: 52px; height: 52px; margin-bottom: 12px; place-items: center; border-radius: 16px; background: var(--sky); color: var(--blue); font-size: 1.4rem; font-weight: 900; }
.empty-state h2, .error-state h1 { margin: 0 0 6px; color: var(--navy); }
.empty-state p, .error-state p { margin: 0 0 20px; color: var(--muted); }
.error-state { min-height: 60vh; align-content: center; }

.login-page { background: var(--navy-dark); }
.login-page .public-main { min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(45px, 8vw, 110px); background: radial-gradient(circle at 10% 15%, rgba(255,255,255,.11), transparent 28%), linear-gradient(145deg, var(--navy) 0%, var(--navy-dark) 70%); color: #fff; }
.login-intro::after { position: absolute; right: -130px; bottom: -130px; width: 380px; height: 380px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); content: ""; }
.login-intro > * { position: relative; z-index: 1; }
.login-intro img { width: 190px; max-height: 115px; margin-bottom: 32px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.95); object-fit: contain; }
.login-intro .eyebrow { color: #9dbbe5; }
.login-intro h1 { max-width: 660px; margin: 8px 0 18px; font-size: clamp(2.7rem, 5vw, 4.8rem); line-height: .98; letter-spacing: -.06em; }
.login-intro > p:not(.eyebrow) { max-width: 570px; margin: 0; color: #c7d3e4; font-size: 1.08rem; }
.feature-list { display: flex; flex-wrap: wrap; gap: 16px 24px; max-width: 700px; margin: 55px 0 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: center; gap: 9px; color: #d9e3ef; font-size: .82rem; }
.feature-list span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: var(--orange); font-size: .66rem; font-weight: 850; }
.login-panel { display: grid; place-items: center; padding: 36px; background: #f7f9fc; }
.login-card { width: min(430px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin: 3px 0 8px; color: var(--navy-dark); font-size: 2rem; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 28px; font-size: .88rem; }
.login-help { margin: 25px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.admin-login { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-login summary { color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 750; text-align: center; }
.admin-login[open] summary { margin-bottom: 18px; color: var(--navy); }
.login-shell-centered { grid-template-columns: 1fr; background: linear-gradient(145deg, var(--navy-dark), var(--navy)); }
.login-shell-centered .login-panel { background: transparent; }
.login-card h1 { margin: 3px 0 8px; color: var(--navy-dark); font-size: 2rem; line-height: 1.12; letter-spacing: -.04em; }
.verify-logo { width: 130px; max-height: 82px; margin-bottom: 20px; object-fit: contain; }
.verification-code { height: 62px; font-size: 1.8rem; font-weight: 800; letter-spacing: .32em; text-align: center; }
.login-page .site-footer, .setup-page .site-footer { display: none; }

.setup-page { background: linear-gradient(145deg, var(--navy-dark), var(--navy)); }
.setup-shell { display: grid; min-height: 100vh; padding: 45px 20px; place-items: center; }
.setup-card { width: min(620px, 100%); padding: 38px; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.setup-wide { width: min(880px, 100%); }
.setup-heading { display: flex; align-items: center; gap: 25px; margin-bottom: 30px; }
.setup-heading img, .setup-card > img { width: 145px; max-height: 95px; object-fit: contain; }
.setup-heading h1, .setup-card h1 { margin: 3px 0 6px; color: var(--navy-dark); font-size: 2rem; letter-spacing: -.04em; }
.setup-heading p:last-child, .setup-card > p:last-child { margin: 0; color: var(--muted); }
.setup-form { display: flex; flex-direction: column; gap: 24px; }
.setup-form fieldset { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 15px; }
.setup-form legend { padding: 0 8px; color: var(--navy); font-size: .9rem; font-weight: 850; }
.setup-requirements { display: flex; flex-direction: column; padding: 14px 16px; border-left: 4px solid var(--orange); border-radius: 8px; background: var(--orange-soft); }
.setup-requirements strong { color: #7a4715; font-size: .83rem; }
.setup-requirements span { color: #8f653b; font-size: .78rem; }
.runtime-checks { display: flex; flex-wrap: wrap; gap: 5px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .76rem; }
.runtime-checks .ready { color: var(--green); }
.runtime-checks .missing { color: var(--red); font-weight: 800; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; }
.site-footer a { color: var(--blue); text-decoration: none; }

.legal-confirmation { flex-direction: row; align-items: flex-start; gap: 12px; margin: 24px 0 14px; padding: 17px 19px; border: 1px solid #b7c7da; border-radius: 13px; background: #fff; }
.legal-confirmation input { flex: 0 0 auto; width: 19px; min-height: 19px; margin-top: 2px; accent-color: var(--navy); }
.legal-confirmation span { display: flex; flex-direction: column; gap: 3px; }
.data-minimization-note { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-left: 4px solid var(--green); border-radius: 10px; background: var(--green-soft); color: #315f50; font-size: .8rem; }
.data-minimization-note strong { flex: 0 0 auto; color: var(--green); }
.privacy-summary { max-width: 820px; }
.privacy-summary h2 { margin-top: 0; color: var(--navy); }
.privacy-summary > p { color: var(--muted); }

.legal-page .public-main { width: min(940px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 70px; }
.legal-document { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.legal-document > header { padding: clamp(30px, 6vw, 62px); background: linear-gradient(145deg, var(--navy), var(--navy-dark)); color: #fff; }
.legal-document > header .eyebrow { color: #aac4e8; }
.legal-document > header h1 { margin: 7px 0 15px; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -.055em; }
.legal-document > header p:last-child { max-width: 720px; margin: 0; color: #cfdaea; font-size: 1.03rem; }
.legal-document > section { padding: 26px clamp(25px, 6vw, 62px); border-bottom: 1px solid #edf1f6; }
.legal-document > section:last-child { border-bottom: 0; }
.legal-document h2 { margin: 0 0 10px; color: var(--navy); font-size: 1.2rem; letter-spacing: -.02em; }
.legal-document p { margin: 8px 0; color: #44536a; }
.legal-document ul { margin: 10px 0 0; padding-left: 22px; color: #44536a; }
.legal-document li { margin: 7px 0; }
.legal-alert { margin: 28px clamp(25px, 6vw, 62px) 4px; padding: 18px 20px; border-left: 4px solid var(--green); border-radius: 10px; background: var(--green-soft); }
.legal-alert strong { color: var(--green); }
.legal-alert p { margin-bottom: 0; }
.legal-table-wrap { overflow-x: auto; }
.legal-table { min-width: 680px; margin: 15px 0; border: 1px solid var(--line); }
.legal-table th, .legal-table td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { background: #f2f6fb; color: var(--navy); font-size: .76rem; }
.legal-table td { color: #44536a; font-size: .82rem; }

@media (max-width: 1050px) {
    .app-header { grid-template-columns: 1fr auto; }
    .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; order: 3; border-top: 1px solid #edf1f6; }
    .app-main { padding-top: 32px; }
    .login-shell { grid-template-columns: 1fr 1fr; }
    .login-intro { padding: 55px; }
    .feature-list { display: none; }
}

@media (max-width: 780px) {
    .app-header { position: static; grid-template-columns: 1fr; gap: 8px; padding: 12px 18px; }
    .brand { justify-self: center; }
    .user-menu { position: absolute; top: 18px; right: 16px; }
    .user-menu a > span:last-child, .user-menu form { display: none; }
    .main-nav { width: 100%; justify-content: flex-start; overflow-x: auto; }
    .main-nav a { flex: 0 0 auto; }
    .app-main { width: min(100% - 24px, 1220px); }
    .heading-with-aside { align-items: flex-start; flex-direction: column; }
    .form-section { grid-template-columns: 42px minmax(0, 1fr); }
    .section-content { padding: 24px 17px 28px; }
    .three-columns, .two-columns, .settings-grid { grid-template-columns: 1fr; }
    .span-two, .mail-choice { grid-column: auto; }
    .result-hero { grid-template-columns: auto 1fr; padding: 23px; }
    .result-actions { grid-column: 1 / -1; }
    .summary-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: 43vh; padding: 42px 28px; }
    .login-intro img { width: 130px; margin-bottom: 20px; }
    .login-intro h1 { font-size: 2.7rem; }
    .login-panel { padding: 25px 18px 45px; }
    .login-card { padding: 28px 23px; }
    .setup-heading { align-items: flex-start; flex-direction: column; }
    .credential-reveal { align-items: stretch; flex-direction: column; }
    .data-minimization-note { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 540px) {
    .page-heading h1 { font-size: 2.15rem; }
    .actions-title { align-items: flex-start; flex-direction: column; }
    .submit-bar { align-items: stretch; flex-direction: column; }
    .result-hero { grid-template-columns: 1fr; }
    .result-actions { align-items: stretch; flex-direction: column; }
    .result-actions form, .result-actions .button { width: 100%; }
    .card { padding: 20px 14px; }
    .site-footer { align-items: flex-start; flex-direction: column; }
    .site-footer nav { justify-content: flex-start; }
    .legal-page .public-main { width: min(100% - 22px, 940px); padding-top: 18px; }
    .legal-document > section { padding: 22px 20px; }
}

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