:root {
    --bg: #fff8fb;
    --bg-accent: radial-gradient(circle at top, rgba(195, 17, 108, 0.16), transparent 35%), radial-gradient(circle at top right, rgba(255, 186, 1, 0.2), transparent 28%), linear-gradient(180deg, #fffaf4 0%, #fff7fb 100%);
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --text: #4c1531;
    --muted: #7d5d6d;
    --line: rgba(76, 21, 49, 0.09);
    --pink: #c3116c;
    --pink-deep: #9f0e57;
    --gold: #ffba01;
    --gold-soft: rgba(255, 186, 1, 0.16);
    --shadow: 0 30px 70px rgba(131, 29, 75, 0.12);
    --shadow-soft: 0 14px 32px rgba(131, 29, 75, 0.09);
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Manrope", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    position: relative;
}

body.page-loading {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input {
    font: inherit;
}

.app-bg {
    position: fixed;
    inset: 0;
    background: var(--bg-accent);
    z-index: 0;
}

.page-preloader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 248, 251, 0.92);
    backdrop-filter: blur(8px);
    z-index: 20;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.page-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-preloader-spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 4px solid rgba(195, 17, 108, 0.12);
    border-top-color: var(--pink);
    border-right-color: var(--gold);
    animation: spin 900ms linear infinite;
    box-shadow: 0 12px 24px rgba(195, 17, 108, 0.12);
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 28px 20px 36px;
}

.site-header,
.page-content,
.site-footer {
    max-width: 1180px;
    margin-inline: auto;
    width: 100%;
    min-width: 0;
}

.site-header {
    display: grid;
    justify-items: center;
    gap: 16px;
    text-align: center;
    margin-bottom: 28px;
}

.brandmark {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding-top: 10px;
}

.brandmark img {
    width: min(340px, 72vw);
}

.brandmark strong,
.brandmark small {
    display: block;
}

.brandmark strong {
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.brandmark small {
    font-size: 1rem;
    color: var(--muted);
}

.brand-accent-line {
    width: min(320px, 62vw);
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pink), var(--gold));
    box-shadow: 0 10px 24px rgba(195, 17, 108, 0.18);
}

.helpline-banner,
.site-footer {
    color: var(--muted);
}

.helpline-banner {
    margin: 0;
    font-size: 0.98rem;
}

.helpline-banner a,
.site-footer a {
    color: var(--pink);
    font-weight: 800;
}

.top-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(195, 17, 108, 0.08), rgba(255, 186, 1, 0.18));
    color: var(--pink-deep);
    font-weight: 800;
}

.account-chip-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.account-chip strong {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.top-nav a {
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 800;
}

.top-nav a:hover {
    background: rgba(195, 17, 108, 0.08);
    color: var(--pink-deep);
}

.section-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 12px;
    align-items: center;
}

.welcome-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 12px;
    align-items: center;
}

.inline-check-form {
    margin: 0;
}

.inline-check-form .btn {
    width: 100%;
}

.page-heading {
    margin-bottom: 18px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--pink);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.time-greeting {
    margin: 0 0 10px;
    color: var(--pink-deep);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.auth-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.auth-copy,
.auth-card,
.panel,
.metric-card,
.welcome-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    width: 100%;
    min-width: 0;
}

.auth-copy,
.auth-card,
.panel,
.metric-card,
.welcome-panel {
    padding: 28px;
}

.auth-copy h1,
.welcome-panel h2 {
    margin: 0 0 12px;
    letter-spacing: -0.05em;
}

.auth-copy h1 {
    font-size: clamp(2.3rem, 5vw, 4.2rem);
    line-height: 1;
}

.auth-copy p,
.welcome-panel p,
.panel-header p,
.auth-card-header p,
.empty-state p,
.recent-report-card p {
    margin: 0;
    color: var(--muted);
}

.feature-grid,
.dashboard-grid,
.recent-report-list {
    display: grid;
    gap: 16px;
}

.feature-grid {
    margin-top: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid article,
.recent-report-card {
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 252, 245, 0.94);
    border: 1px solid rgba(195, 17, 108, 0.08);
    min-width: 0;
}

.feature-grid strong,
.feature-grid span {
    display: block;
}

.feature-grid strong {
    margin-bottom: 8px;
}

.feature-grid span {
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--muted);
}

.auth-card-header h2,
.panel-header h2,
.empty-state h2 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

.stack-form {
    margin-top: 22px;
    display: grid;
    gap: 16px;
}

.stack-form label span {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--pink-deep);
}

.stack-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(195, 17, 108, 0.14);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(76, 21, 49, 0.04);
}

.stack-form input:focus {
    outline: 2px solid rgba(255, 186, 1, 0.34);
    border-color: rgba(195, 17, 108, 0.6);
}

.btn {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 800;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    text-align: center;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.82;
}

.btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 800ms linear infinite;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.btn-lg {
    min-height: 52px;
    padding-inline: 24px;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--pink) 0%, #e04a90 100%);
    box-shadow: 0 16px 28px rgba(195, 17, 108, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--pink-deep) 0%, #c7387d 100%);
}

.btn-secondary {
    color: var(--pink-deep);
    background: rgba(255, 186, 1, 0.16);
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.metric-card-accent {
    background: linear-gradient(140deg, rgba(195, 17, 108, 0.96), rgba(229, 92, 150, 0.92));
    color: #fff;
}

.metric-card-accent .metric-label,
.metric-card-accent p {
    color: rgba(255, 255, 255, 0.86);
}

.metric-label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    margin-bottom: 10px;
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    letter-spacing: -0.04em;
}

.welcome-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.panel {
    margin-bottom: 24px;
}

.panel-note {
    margin-bottom: 20px;
    padding-block: 18px;
}

.panel-note p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 22px;
}

.status-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--pink-deep);
    font-weight: 800;
}

.recent-report-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-report-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex-wrap: wrap;
}

.recent-report-card > div {
    min-width: 0;
    flex: 1 1 220px;
}

.recent-report-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.table-shell {
    overflow-x: auto;
    min-width: 0;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.report-table th,
.report-table td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.report-table thead th {
    color: var(--pink-deep);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.report-table tbody tr:hover {
    background: rgba(255, 186, 1, 0.06);
}

.actions-col,
.actions-cell {
    width: 1%;
    min-width: 280px;
    white-space: normal;
    min-width: 0;
}

.action-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.action-group > * {
    min-width: 0;
    flex: 1 1 0;
}

.action-group .btn {
    flex: 1 1 0;
    min-height: 44px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-report-card .btn {
    min-width: 132px;
    min-height: 44px;
    flex: 0 0 auto;
}

.ready-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 186, 1, 0.18);
    color: var(--pink-deep);
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
}

.viewer-shell {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(195, 17, 108, 0.08);
    background: #fff;
    overflow: auto;
}

.progress-panel {
    text-align: center;
}

.progress-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
}

.progress-track {
    margin: 24px auto 14px;
    max-width: 640px;
    height: 16px;
    border-radius: 999px;
    background: rgba(195, 17, 108, 0.08);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pink), var(--gold));
    transition: width 300ms ease;
}

.progress-meta {
    color: var(--muted);
    font-weight: 700;
}

.preparing-progress-shell {
    margin: 28px auto 20px;
    max-width: 680px;
}

.preparing-progress-track {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: rgba(195, 17, 108, 0.08);
    overflow: hidden;
}

.preparing-progress-bar {
    position: absolute;
    inset: 0 auto 0 -38%;
    width: 38%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pink), var(--gold));
    animation: preparing-slide 1.4s ease-in-out infinite;
    box-shadow: 0 8px 22px rgba(195, 17, 108, 0.18);
}

.preparing-steps {
    display: grid;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
}

.preparing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 252, 245, 0.94);
    border: 1px solid rgba(195, 17, 108, 0.08);
    color: var(--muted);
    font-weight: 700;
}

.preparing-step.is-active {
    border-color: rgba(195, 17, 108, 0.22);
    color: var(--pink-deep);
    box-shadow: 0 12px 24px rgba(195, 17, 108, 0.08);
}

.preparing-step.is-done {
    border-color: rgba(255, 186, 1, 0.28);
    color: var(--pink-deep);
}

.preparing-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 186, 1, 0.16);
    color: var(--pink-deep);
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.backend-fragment table {
    width: 100%;
    border-collapse: collapse;
}

.backend-fragment td,
.backend-fragment th {
    padding: 10px;
    border: 1px solid rgba(195, 17, 108, 0.12);
}

.alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
}

.alert-error {
    color: #8c2338;
    background: rgba(217, 69, 104, 0.12);
    border: 1px solid rgba(217, 69, 104, 0.16);
}

.alert-success {
    color: #7c4b00;
    background: rgba(255, 186, 1, 0.16);
    border: 1px solid rgba(255, 186, 1, 0.28);
}

.empty-state {
    text-align: center;
    padding: 34px 18px;
}

.hidden-form {
    display: none;
}

.hidden-frame {
    width: 0;
    height: 0;
    border: 0;
    position: absolute;
    left: -9999px;
}

.site-footer {
    text-align: center;
    font-size: 0.92rem;
}

.site-footer p {
    margin: 8px 0;
}

.recaptcha-notice {
    max-width: 700px;
    margin-inline: auto;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(76, 21, 49, 0.42);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    width: min(100%, 560px);
    padding: 26px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.88);
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header {
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    letter-spacing: -0.03em;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 186, 1, 0.16);
    color: var(--pink-deep);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
}

.modal-body p {
    margin: 0 0 14px;
    color: var(--muted);
}

.modal-help {
    font-weight: 700;
}

.modal-actions {
    margin-top: 24px;
}

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

@keyframes preparing-slide {
    0% {
        left: -38%;
    }

    100% {
        left: 100%;
    }
}

@media (max-width: 980px) {
    .app-shell {
        padding: 20px 14px 28px;
    }

    .auth-hero,
    .dashboard-grid,
    .feature-grid,
    .recent-report-list,
    .welcome-panel,
    .panel-header,
    .recent-report-card {
        display: grid;
        grid-template-columns: 1fr;
    }

    .recent-report-card,
    .welcome-panel {
        justify-items: start;
    }

    .section-actions,
    .welcome-actions {
        justify-content: start;
        width: 100%;
    }

    .top-nav {
        width: min(100%, 560px);
    }

    .top-nav a {
        flex: 1 1 140px;
    }

    .account-chip {
        width: 100%;
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 1100px) {
    .auth-hero {
        grid-template-columns: 1fr;
    }

    .auth-copy,
    .auth-card {
        width: 100%;
    }
}

@media (max-width: 640px) {
    html,
    body {
        overflow-x: hidden;
    }

    .brandmark img {
        width: min(280px, 78vw);
    }

    .brandmark strong {
        font-size: 1.35rem;
    }

    .brandmark small,
    .helpline-banner,
    .site-footer {
        font-size: 0.9rem;
    }

    .page-heading {
        margin-bottom: 16px;
        text-align: center;
    }

    .page-heading h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .auth-copy,
    .auth-card,
    .panel,
    .metric-card,
    .welcome-panel {
        padding: 20px;
        border-radius: 22px;
    }

    .auth-hero {
        gap: 18px;
        grid-template-columns: 1fr;
    }

    .auth-copy {
        order: 2;
    }

    .auth-card {
        order: 1;
    }

    .auth-copy {
        padding-top: 24px;
    }

    .auth-copy h1 {
        font-size: clamp(2rem, 12vw, 3rem);
        line-height: 0.98;
    }

    .auth-card-header h2,
    .panel-header h2,
    .empty-state h2 {
        font-size: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .welcome-actions,
    .section-actions,
    .top-nav {
        width: 100%;
    }

    .top-nav {
        padding: 6px;
        gap: 8px;
    }

    .account-chip,
    .top-nav a {
        width: 100%;
        text-align: center;
    }

    .status-pill {
        width: 100%;
        justify-content: center;
        display: inline-flex;
    }

    .recent-report-card {
        align-items: stretch;
    }

    .btn {
        padding-inline: 16px;
    }

    .modal-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .table-shell {
        overflow: visible;
    }

    .report-table,
    .report-table thead,
    .report-table tbody,
    .report-table tr,
    .report-table th,
    .report-table td {
        display: block;
        width: 100%;
    }

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

    .report-table thead {
        display: none;
    }

    .report-table tbody tr {
        margin-bottom: 16px;
        padding: 18px 16px;
        background: rgba(255, 255, 255, 0.92);
        border-radius: 18px;
        box-shadow: var(--shadow-soft);
    }

    .report-table td {
        display: grid;
        grid-template-columns: minmax(96px, 120px) 1fr;
        gap: 10px;
        align-items: start;
        padding: 8px 0;
        border: 0;
        white-space: normal;
        min-width: 0;
    }

    .report-table td::before {
        content: attr(data-label);
        color: var(--pink-deep);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .report-table td.actions-cell {
        grid-template-columns: 1fr;
        gap: 12px;
        min-width: 0;
    }

    .report-table td.actions-cell::before {
        margin-bottom: -2px;
    }

    .action-group {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .action-group .btn {
        width: 100%;
        flex: none;
        min-height: 44px;
    }

    .ready-badge {
        justify-self: start;
    }

    .recent-report-card .btn,
    .welcome-actions > .btn,
    .section-actions > .btn,
    .section-actions > form,
    .welcome-actions > form {
        width: 100%;
        max-width: 100%;
    }

    .recent-report-card .btn {
        min-width: 0;
    }

    .report-table tbody tr,
    .report-table td,
    .report-table td > *,
    .action-group,
    .action-group > *,
    .actions-cell {
        min-width: 0;
    }

    .report-table td > a.btn,
    .report-table td > button.btn,
    .report-table td .action-group > a.btn,
    .report-table td .action-group > button.btn {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
