:root {
    --bg: #f4efe6;
    --bg-wash: #efe3cf;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-strong: rgba(255, 248, 240, 0.96);
    --border: rgba(43, 58, 58, 0.14);
    --text: #1f2a2a;
    --muted: #5e6d6d;
    --teal: #0f766e;
    --teal-soft: #d6f2ee;
    --rust: #b45309;
    --rust-soft: #fce8d1;
    --rose: #a23b56;
    --shadow: 0 24px 60px rgba(49, 57, 56, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --field-bg: rgba(255, 255, 255, 0.7);
    --field-border: rgba(31, 42, 42, 0.12);
    --focus-ring: rgba(15, 118, 110, 0.55);
}

html[data-theme="dark"] {
    --bg: #10181a;
    --bg-wash: #0a1112;
    --surface: rgba(24, 34, 36, 0.82);
    --surface-strong: rgba(28, 40, 42, 0.96);
    --border: rgba(229, 233, 232, 0.14);
    --text: #ecf3f1;
    --muted: #9aaaab;
    --teal: #5eead4;
    --teal-soft: rgba(94, 234, 212, 0.16);
    --rust: #fbbf77;
    --rust-soft: rgba(251, 191, 119, 0.18);
    --rose: #f5879f;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    --field-bg: rgba(255, 255, 255, 0.06);
    --field-border: rgba(229, 233, 232, 0.18);
    --focus-ring: rgba(94, 234, 212, 0.55);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(94, 234, 212, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(251, 191, 119, 0.1), transparent 28%),
        linear-gradient(180deg, #0a1112 0%, var(--bg) 55%, var(--bg-wash) 100%);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="dark"]) {
        --bg: #10181a;
        --bg-wash: #0a1112;
        --surface: rgba(24, 34, 36, 0.82);
        --surface-strong: rgba(28, 40, 42, 0.96);
        --border: rgba(229, 233, 232, 0.14);
        --text: #ecf3f1;
        --muted: #9aaaab;
        --teal: #5eead4;
        --teal-soft: rgba(94, 234, 212, 0.16);
        --rust: #fbbf77;
        --rust-soft: rgba(251, 191, 119, 0.18);
        --rose: #f5879f;
        --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
        --field-bg: rgba(255, 255, 255, 0.06);
        --field-border: rgba(229, 233, 232, 0.18);
        --focus-ring: rgba(94, 234, 212, 0.55);
    }

    html:not([data-theme="light"]):not([data-theme="dark"]) body {
        background:
            radial-gradient(circle at top left, rgba(94, 234, 212, 0.12), transparent 30%),
            radial-gradient(circle at top right, rgba(251, 191, 119, 0.1), transparent 28%),
            linear-gradient(180deg, #0a1112 0%, var(--bg) 55%, var(--bg-wash) 100%);
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 30%),
        radial-gradient(circle at top right, rgba(180, 83, 9, 0.15), transparent 28%),
        linear-gradient(180deg, #fbf6ef 0%, var(--bg) 55%, var(--bg-wash) 100%);
}

a {
    color: inherit;
}

.page-shell {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-copy,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-copy {
    padding: 36px;
    animation: rise-in 420ms ease-out both;
}

.hero-card {
    padding: 28px;
    animation: rise-in 520ms ease-out both;
}

.eyebrow,
.panel-label,
.meta-label,
.summary-kicker,
.job-source {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--teal);
}

.hero h1,
.section-head h2,
.results-head h2 {
    margin: 0;
    font-family: "Fraunces", serif;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero h1 {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    max-width: 10ch;
    margin: 14px 0 18px;
}

.hero-text,
.section-note,
.summary-detail,
.job-description,
.muted-copy,
.compact-list,
.status-card p,
.status-card small {
    color: var(--muted);
}

.hero-text {
    max-width: 62ch;
    font-size: 1.05rem;
    margin-bottom: 26px;
}

.hero-chips,
.provider-catalog {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip,
.provider-chip,
.score-pill {
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 700;
}

.chip {
    background: rgba(15, 118, 110, 0.08);
    color: var(--teal);
}

.compact-list {
    margin: 18px 0 0;
    padding-left: 18px;
}

.compact-list li + li {
    margin-top: 8px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.profile-panel,
.results-panel {
    min-width: 0;
}

.profile-panel {
    grid-column: 1;
}

.sidebar {
    grid-column: 2;
    display: grid;
    gap: 24px;
    align-content: start;
}

.results-panel {
    grid-column: 1 / -1;
}

.panel,
.results-panel {
    padding: 28px;
}

.section-head,
.results-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.section-note {
    max-width: 28ch;
    font-size: 0.92rem;
}

.profile-form {
    display: grid;
    gap: 18px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 9px;
}

.field span,
.toggle span {
    font-size: 0.93rem;
    font-weight: 700;
}

.field-help {
    color: var(--muted);
    font-size: 0.86rem;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    background: var(--field-bg);
    color: var(--text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field textarea {
    min-height: 86px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    transform: translateY(-1px);
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.hero-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.toggle-row,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(31, 42, 42, 0.1);
    border-radius: var(--radius-md);
}

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-btn {
    background: linear-gradient(135deg, #0f766e, #155e75);
    color: #f7fdfc;
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.2);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    border: 1px solid rgba(31, 42, 42, 0.1);
}

.secondary-btn--small {
    padding: 8px 14px;
    font-size: 0.84rem;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.message-stack {
    min-height: 4px;
}

.message-card {
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.message-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.message-card ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.message-card.error {
    background: rgba(162, 59, 86, 0.1);
    border: 1px solid rgba(162, 59, 86, 0.16);
}

.message-card.success {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.provider-chip {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(31, 42, 42, 0.08);
    cursor: pointer;
    user-select: none;
    transition: opacity 180ms ease, background 180ms ease;
}

.provider-chip input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
}

.provider-chip:focus-within {
    outline: 2px solid rgba(15, 118, 110, 0.7);
    outline-offset: 2px;
}

.provider-chip span {
    font-size: 0.76rem;
    color: var(--muted);
}

.provider-chip.enabled {
    background: var(--teal-soft);
}

.provider-chip.disabled {
    opacity: 0.52;
    background: rgba(255, 255, 255, 0.4);
}

.summary-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(180, 83, 9, 0.08));
    border: 1px solid rgba(31, 42, 42, 0.08);
}

.summary-title {
    margin: 10px 0 8px;
    font-size: 1.12rem;
    font-weight: 800;
}

.status-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.status-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(31, 42, 42, 0.08);
    background: rgba(255, 255, 255, 0.7);
}

.status-card.success {
    background: rgba(214, 242, 238, 0.8);
}

.status-card.warning {
    background: rgba(252, 232, 209, 0.92);
}

.status-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 6px;
}

.status-head span {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--rust);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.results-head {
    margin-bottom: 24px;
}

.results-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.results-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    min-width: 120px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 42, 42, 0.08);
}

.meta-item strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
}

.sort-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.sort-select {
    border: 1px solid rgba(31, 42, 42, 0.12);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}

.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.job-card,
.empty-card {
    position: relative;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    border: 1px solid rgba(31, 42, 42, 0.08);
    box-shadow: 0 18px 36px rgba(46, 54, 54, 0.08);
    animation: rise-in 360ms ease-out both;
}

.job-card::after {
    content: "";
    position: absolute;
    inset: auto 24px 0 24px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.85), rgba(180, 83, 9, 0.75));
}

.job-card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 12px;
}

.job-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bookmark-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    color: var(--muted);
    transition: color 180ms ease, transform 180ms ease;
}

.bookmark-btn:hover {
    transform: scale(1.2);
}

.bookmark-btn.bookmarked {
    color: var(--rust);
}

.job-card h3,
.empty-card h3 {
    margin: 8px 0 0;
    font-family: "Fraunces", serif;
    font-size: 1.4rem;
    line-height: 1.15;
}

.score-pill {
    background: var(--rust-soft);
    color: var(--rust);
}

.job-company {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 800;
}

.job-location {
    margin: 0 0 12px;
    color: var(--muted);
}

.reason-list {
    display: grid;
    gap: 8px;
    margin: 16px 0 18px;
    padding-left: 18px;
}

.reason-list li {
    color: var(--muted);
}

.apply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(15, 118, 110, 0.1);
    color: var(--teal);
    font-weight: 800;
}

.muted-copy {
    margin: 0;
}

/* History cards */
.history-list {
    display: grid;
    gap: 10px;
}

.history-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(31, 42, 42, 0.06);
    cursor: default;
}

.history-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.history-head span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--teal);
}

.history-detail {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
}

.history-card small {
    color: var(--muted);
    font-size: 0.76rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    min-width: 40px;
    min-height: 40px;
    border: 1px solid rgba(31, 42, 42, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.page-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
}

.page-btn.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .hero,
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .results-panel,
    .profile-panel {
        grid-column: auto;
    }
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    padding: 18px 20px;
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
}

.filter-group {
    display: grid;
    gap: 6px;
    min-width: 160px;
}

.filter-group--toggle,
.filter-group--actions {
    align-self: center;
}

.filter-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.filter-value {
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}

.filter-input,
.filter-select {
    border: 1px solid var(--field-border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    background: var(--field-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

input[type="range"] {
    accent-color: var(--teal);
    width: 100%;
}

.filter-summary {
    flex-basis: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

/* View toggle */
.view-toggle {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px;
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    gap: 2px;
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 6px 14px;
    border-radius: 999px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}

.view-btn.active {
    background: var(--teal);
    color: #f7fdfc;
}

html[data-theme="dark"] .view-btn.active {
    color: #08191b;
}

/* Provider groups view */
.provider-group {
    margin-bottom: 24px;
}

.provider-group-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.provider-group-head h3 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.4rem;
}

.provider-group-head span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

/* Skeleton loading */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.skeleton-card {
    height: 220px;
    border-radius: var(--radius-lg);
    background: linear-gradient(110deg, var(--surface) 8%, var(--surface-strong) 18%, var(--surface) 33%);
    background-size: 220% 100%;
    animation: skeleton-shimmer 1.4s linear infinite;
    border: 1px solid var(--border);
}

@keyframes skeleton-shimmer {
    to {
        background-position: -220% 0;
    }
}

.job-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.job-meta-pill {
    background: var(--teal-soft);
    color: var(--teal);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
}

.bookmark-btn[aria-pressed="true"] {
    color: var(--rust);
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding-top: 18px;
    }

    .hero-copy,
    .panel,
    .results-panel {
        padding: 22px;
    }

    .field-grid,
    .results-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .section-head {
        flex-direction: column;
    }

    .results-controls {
        align-items: stretch;
    }

    .results-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sort-row {
        flex-wrap: wrap;
    }

    .job-grid {
        grid-template-columns: 1fr;
    }
}
