* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f8fa;
    color: #182230;
    line-height: 1.5;
}

.page {
    margin: 32px auto;
    width: min(1040px, calc(100% - 32px));
}

.page-header {
    border-bottom: 4px solid #0071b9;
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.top-bar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.portal-brand {
    align-items: center;
    display: flex;
    gap: 16px;
}

.portal-brand picture {
    display: flex;
}

.portal-brand span {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-logo {
    display: block;
    height: auto;
    max-width: 132px;
    width: 132px;
}

.user-menu {
    align-items: center;
    display: flex;
    gap: 12px;
}

.user-menu form {
    margin: 0;
}

.account-summary {
    text-align: right;
}

.account-label {
    color: #667085;
    display: block;
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.account-name {
    color: #182230;
    display: block;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.2;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eyebrow,
.status-label {
    color: #667085;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    line-height: 1.08;
    margin-bottom: 0;
}

h2 {
    font-size: 1.1rem;
    line-height: 1.25;
    margin-bottom: 6px;
}

h3 {
    font-size: 1.18rem;
    line-height: 1.22;
    margin: 0 0 8px;
}

.lede {
    color: #526071;
    font-size: 1rem;
    margin-bottom: 0;
    max-width: 620px;
}

.card {
    background: #fff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(23, 32, 42, 0.05);
    margin-top: 14px;
    padding: 18px;
}

.tools-section {
    display: grid;
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.tool-card {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 22px;
}

.tool-card-main {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    min-width: 0;
}

.tool-card-main p {
    color: #526071;
    margin-bottom: 0;
}

.tool-icon {
    align-items: center;
    background: #eef7fc;
    border: 1px solid #b9ddef;
    border-radius: 8px;
    color: #0071b9;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.05rem;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
}

.tool-label {
    color: #667085 !important;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 6px !important;
    text-transform: uppercase;
}

.action-panel {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.action-panel p {
    color: #526071;
    margin-top: 6px;
    margin-bottom: 0;
}

.action-panel h2 {
    margin-bottom: 0;
}


.run-form {
    flex: 0 0 auto;
    margin: 0;
}

.run-actions {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.run-status {
    align-items: center;
    color: #526071;
    display: flex;
    font-size: 0.9rem;
    gap: 10px;
}

.spinner {
    animation: spin 700ms linear infinite;
    border: 2px solid rgba(0, 113, 185, 0.22);
    border-radius: 999px;
    border-top-color: #0071b9;
    height: 16px;
    width: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

button {
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: #0071b9;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 42px;
    padding: 0.68rem 1rem;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button-link {
    align-items: center;
    appearance: none;
    background: #0071b9;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 0.68rem 1rem;
    text-decoration: none;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    white-space: nowrap;
}

button:hover {
    background: #005f9d;
    transform: translateY(-1px);
}

.button-link:hover {
    background: #005f9d;
    transform: translateY(-1px);
}

button[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.secondary-button {
    background: #fff;
    border: 1px solid #c8d1dc;
    color: #182230;
    font-weight: 650;
    min-height: 34px;
    padding: 0.4rem 0.65rem;
}

.secondary-button:hover {
    background: #eef2f6;
}

button:focus-visible {
    outline: 3px solid rgba(0, 113, 185, 0.28);
    outline-offset: 3px;
}

.button-link:focus-visible {
    outline: 3px solid rgba(0, 113, 185, 0.28);
    outline-offset: 3px;
}

.result-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.result-heading {
    align-items: center;
    display: flex;
    gap: 12px;
}

.status-icon {
    align-items: center;
    background: #eef2f6;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 32px;
}

.status-icon svg {
    height: 20px;
    width: 20px;
}

.latest-report-label {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.report-banner-row {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.report-banner-body {
    align-items: flex-start;
    color: #182230;
    display: flex;
    gap: 12px;
    margin: 0;
    min-width: 0;
}

.report-text {
    min-width: 0;
}

.report-date {
    font-weight: 800;
    margin: 0 0 3px;
}

.report-banner-filename {
    color: #526071;
    font-size: 0.92rem;
    margin: 0;
    word-break: break-word;
}

.download-pill {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #344054;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    gap: 8px;
    line-height: 1;
    padding: calc(0.55rem - 1px) calc(0.85rem - 1px);
    text-decoration: none;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    white-space: nowrap;
}

.download-pill:hover {
    background: #f8fafc;
    border-color: #98a2b3;
    transform: translateY(-1px);
}

.download-pill[data-loading="true"] {
    cursor: progress;
    pointer-events: none;
    opacity: 0.9;
    transform: none;
}

.download-pill-icon {
    height: 18px;
    width: 18px;
}

.download-pill:focus-visible {
    outline: 3px solid rgba(0, 113, 185, 0.28);
    outline-offset: 3px;
}

.run-details {
    margin: 0;
}

.run-details summary {
    color: #526071;
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 10px;
}

.run-details[open] summary {
    margin-bottom: 12px;
}

.run-result {
    border-left: 5px solid #8a96a8;
}

.run-result.is-success {
    background: #fff;
    border-color: #d8dee6;
    border-left-color: #71c598;
}

.status-icon.is-success {
    background: #e8f7ef;
    border-color: #a8ddbe;
    color: #226b42;
}

.run-result.is-error {
    background: #fff7f6;
    border-color: #f2c6c2;
    border-left-color: #c9352b;
}

.run-result.is-error .status-icon {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.run-result pre {
    background: #17202a;
    border-radius: 8px;
    color: #f8fafc;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
    max-height: 420px;
    overflow: auto;
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 412px;
    padding: 28px 16px;
    width: 100%;
}

.login-card {
    border-top: 4px solid #0071b9;
    box-shadow: 0 14px 34px rgba(23, 32, 42, 0.08);
    margin: 0;
    padding: 28px;
    width: 100%;
}

.brand-header {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.brand-logo {
    display: block;
    height: auto;
    max-width: 128px;
    width: 44%;
}

.login-card-header {
    margin-bottom: 18px;
}

.login-card-header h1 {
    color: #182230;
    font-size: 1.45rem;
    line-height: 1.18;
    margin-bottom: 6px;
}

.login-card-header p {
    color: #526071;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.login-form {
    margin: 0;
}

.login-form button {
    width: 100%;
}

.login-note {
    color: #667085;
    font-size: 0.86rem;
    margin: 12px 0 0;
    text-align: center;
}

.auth-message {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.auth-message.is-error {
    background: #fff7f6;
    border: 1px solid #f2c6c2;
    color: #8a1f17;
}

.auth-message p {
    margin-bottom: 0;
}

.auth-message-title {
    font-weight: 800;
    margin-bottom: 3px;
}

@media (max-width: 640px) {
    .page {
        margin: 24px auto;
        width: min(100% - 24px, 1040px);
    }

    .action-panel,
    .result-header,
    .tool-card,
    .tool-card-main {
        align-items: stretch;
        flex-direction: column;
    }

    .top-bar {
        align-items: center;
        flex-direction: row;
        gap: 18px;
    }

    .portal-brand span {
        display: none;
    }

    .user-menu {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        justify-content: flex-end;
        margin-left: auto;
        padding: 0;
        width: auto;
    }

    .account-label {
        display: block;
        font-size: 0.56rem;
        line-height: 1;
        margin-bottom: 1px;
    }

    .account-summary {
        min-width: 0;
        text-align: left;
    }

    .account-name {
        font-size: 0.9rem;
        max-width: min(22vw, 110px);
    }

    .secondary-button {
        width: auto;
    }

    .portal-logo {
        max-width: 42px;
        width: 42px;
    }

    .tool-card {
        gap: 18px;
        padding: 20px;
    }

    .tool-card-main {
        gap: 14px;
    }

    .run-form,
    button {
        width: 100%;
    }

    .run-actions {
        align-items: stretch;
    }

    .report-banner-row {
        align-items: stretch;
        flex-direction: column;
    }

    .download-pill {
        justify-content: center;
        width: 100%;
    }

    .login-shell {
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 18px 12px;
        max-width: none;
        width: 100%;
    }

    .login-card {
        padding: 22px;
    }

    .brand-header {
        align-items: center;
        margin-bottom: 18px;
    }

    .brand-logo {
        max-width: 122px;
        width: 50%;
    }

}
