:root {
    --ink: #111315;
    --muted: #5b5f63;
    --sand: #f6f0e9;
    --cream: #fffaf2;
    --teal: #0f766e;
    --sky: #0ea5a6;
    --gold: #f4b860;
    --outline: rgba(17, 19, 21, 0.12);
    --glass: rgba(255, 255, 255, 0.72);
    --shadow: 0 24px 50px rgba(17, 19, 21, 0.15);
}

[hidden] {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 20%, rgba(14, 165, 166, 0.18), transparent 50%),
        radial-gradient(circle at 80% 10%, rgba(244, 184, 96, 0.18), transparent 45%),
        linear-gradient(180deg, #faf7f1 0%, #f3efe7 65%, #f8f2ea 100%);
    min-height: 100vh;
}

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

.container {
    width: min(1200px, 90vw);
    margin: 0 auto;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(0px);
    opacity: 0.45;
    animation: float 10s ease-in-out infinite;
}

.orb-1 {
    width: 280px;
    height: 280px;
    background: linear-gradient(130deg, rgba(14, 165, 166, 0.5), rgba(15, 118, 110, 0.2));
    top: 12%;
    left: -4%;
}

.orb-2 {
    width: 220px;
    height: 220px;
    background: linear-gradient(130deg, rgba(244, 184, 96, 0.5), rgba(255, 250, 242, 0.2));
    bottom: 15%;
    right: -2%;
    animation-delay: 1s;
}

.orb-3 {
    width: 160px;
    height: 160px;
    background: linear-gradient(130deg, rgba(14, 165, 166, 0.4), rgba(244, 184, 96, 0.2));
    top: 45%;
    right: 18%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-16px);
    }
}

.site-header {
    position: sticky;
    top: 0;
    background: rgba(248, 242, 234, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(17, 19, 21, 0.08);
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.brand-name {
    font-weight: 600;
    font-size: 1rem;
}

.brand-tag {
    font-size: 0.8rem;
    color: var(--muted);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
}

.nav-links a {
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-links a:hover {
    border-bottom-color: var(--ink);
}

.header-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.ghost-btn,
.solid-btn {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    font-family: "Space Grotesk", sans-serif;
}

.user-chip {
    background: #fff;
    border: 1px solid rgba(17, 19, 21, 0.1);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.ghost-btn {
    background: transparent;
    border: 1px solid var(--outline);
}

.solid-btn {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 20px rgba(17, 19, 21, 0.18);
}

.hero {
    padding: 5rem 0 3rem;
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 3rem;
    align-items: start;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: "Newsreader", serif;
    font-size: clamp(2.6rem, 3vw, 3.6rem);
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 1.6rem;
}

.search-card {
    background: var(--glass);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    box-shadow: var(--shadow);
}

.search-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.6rem;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
}

.search-row input {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--outline);
    font-size: 1rem;
    font-family: "Space Grotesk", sans-serif;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.search-filters select,
.search-filters input {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--outline);
    background: #fff;
    font-family: "Space Grotesk", sans-serif;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.8rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.chip {
    border: 1px solid rgba(17, 19, 21, 0.15);
    background: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
}

.hero-panel {
    display: grid;
    gap: 1.2rem;
}

.panel-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.4rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    box-shadow: 0 12px 20px rgba(17, 19, 21, 0.1);
}

.panel-title {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: var(--muted);
}

.panel-metric {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.6rem 0;
}

.panel-detail {
    color: var(--muted);
    font-size: 0.95rem;
}

.results {
    padding: 3rem 0 4rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    gap: 2rem;
}

.results-meta {
    color: var(--muted);
    max-width: 320px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.result-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.2rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(17, 19, 21, 0.12);
}

.result-title {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.result-meta {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.result-link {
    font-size: 0.85rem;
    color: var(--teal);
    font-weight: 600;
}

.user-menu {
    position: relative;
}

#userMenuBtn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chevron {
    font-size: 0.85rem;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: 120%;
    background: #fff;
    border-radius: 14px;
    padding: 0.4rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(17, 19, 21, 0.08);
    display: none;
    min-width: 160px;
}

.user-dropdown.active {
    display: grid;
}

.user-dropdown button {
    border: none;
    background: transparent;
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
}

.user-dropdown button:hover {
    background: rgba(17, 19, 21, 0.06);
}

.user-dropdown a {
    display: block;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    color: var(--ink);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-dropdown a:hover {
    background: rgba(17, 19, 21, 0.06);
}

.section-head {
    margin-bottom: 1.8rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.3rem;
}

.step-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.2rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
}

.step-card h3 {
    margin-bottom: 0.6rem;
}

.account {
    padding: 3rem 0 4rem;
}

.account-tabs {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
}

.account-tabs button {
    border: 1px solid rgba(17, 19, 21, 0.12);
    background: #fff;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.account-tabs button.active {
    background: var(--ink);
    color: #fff;
}

.account-view {
    display: none;
}

.account-view.active {
    display: block;
}

.account-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.6rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    box-shadow: 0 12px 20px rgba(17, 19, 21, 0.08);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin: 1rem 0;
}

.label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.skills-block {
    margin-top: 1rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.skills-list span {
    background: #fff7e7;
    border: 1px solid rgba(244, 184, 96, 0.4);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.saved-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.saved-item {
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 14px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.saved-item h4 {
    margin-bottom: 0.3rem;
}

.saved-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.cta {
    padding: 3rem 0 4rem;
}

.cta-inner {
    background: #fff;
    border-radius: 28px;
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: var(--shadow);
}

.dashboard-hero {
    padding: 4rem 0 2rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.action-progress {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 360px;
}

.action-progress-track {
    background: rgba(17, 19, 21, 0.08);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.action-progress-bar {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, #f3b25e, #e0784a, #f3b25e);
    border-radius: inherit;
    animation: progress-glide 1.4s ease-in-out infinite;
}

.action-progress-label {
    font-size: 0.85rem;
    color: var(--muted);
}

@keyframes progress-glide {
    0% {
        transform: translateX(-60%);
    }
    50% {
        transform: translateX(80%);
    }
    100% {
        transform: translateX(-60%);
    }
}

.dashboard {
    padding: 2rem 0 4rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.4rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    box-shadow: var(--shadow);
}

.kpi-label {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.kpi-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.6rem;
    margin-bottom: 2rem;
}

.dashboard-grid.three {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.panel {
    background: #fff;
    border-radius: 20px;
    padding: 1.4rem;
    border: 1px solid rgba(17, 19, 21, 0.08);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.panel-body {
    display: grid;
    gap: 1rem;
}

.panel-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.panel-value {
    font-weight: 700;
    font-size: 1.4rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(17, 19, 21, 0.06);
}

.metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.data-list {
    display: grid;
    gap: 0.9rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(17, 19, 21, 0.06);
    padding-bottom: 0.8rem;
}

.data-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.data-row span {
    color: var(--muted);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.2rem;
}

.summary-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.summary-controls select {
    border: 1px solid rgba(17, 19, 21, 0.12);
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    background: #fff;
    font-size: 0.9rem;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.summary-table th,
.summary-table td {
    text-align: left;
    padding: 0.75rem 0.4rem;
    border-bottom: 1px solid rgba(17, 19, 21, 0.06);
}

.summary-table th:last-child,
.summary-table td:last-child {
    text-align: right;
}

.summary-table tbody tr:last-child td {
    border-bottom: none;
}

.summary-table .summary-action {
    border: 1px solid rgba(17, 19, 21, 0.12);
    background: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
}

.summary-table .summary-value {
    font-weight: 600;
}

.mapping-form {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.mapping-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.mapping-form label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.mapping-form input {
    border: 1px solid rgba(17, 19, 21, 0.12);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(71, 110, 246, 0.12);
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
}

.coverage-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coverage-meter {
    flex: 1;
    height: 8px;
    background: rgba(17, 19, 21, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.coverage-meter span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1f2937, #4f46e5);
}

.auth-gate {
    padding: 3rem 0 4rem;
}

.gate-card {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 20;
}

.auth-modal.active {
    display: grid;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 19, 21, 0.45);
}

.auth-card {
    position: relative;
    background: #fff;
    width: min(480px, 90vw);
    border-radius: 22px;
    padding: 2rem;
    box-shadow: var(--shadow);
    z-index: 1;
}

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.auth-tabs button {
    border: 1px solid rgba(17, 19, 21, 0.12);
    background: #fff;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.auth-tabs button.active {
    background: var(--ink);
    color: #fff;
}

.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

.auth-subtext {
    color: var(--muted);
    margin: 0.4rem 0 1.2rem;
}

.auth-form {
    display: grid;
    gap: 0.8rem;
}

.auth-form input,
.auth-form select {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--outline);
    font-family: "Space Grotesk", sans-serif;
}

.auth-divider {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.8rem 0;
}

.auth-google {
    width: 100%;
}

.link-btn {
    margin-top: 0.8rem;
    border: none;
    background: transparent;
    color: var(--teal);
    cursor: pointer;
    font-weight: 600;
}

.auth-message {
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-error {
    margin-top: 0.8rem;
    color: #b91c1c;
    font-size: 0.85rem;
}

.site-footer {
    padding: 2rem 0 3rem;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.8s ease forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .hero-grid,
    .gov-grid {
        grid-template-columns: 1fr;
    }

    .cta-inner,
    .footer-inner,
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .search-row {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb,
    .reveal {
        animation: none;
    }
}
