/* ============================================================
   SRAFELAGI — Premium editorial design system
   ============================================================ */

:root {
    /* Brand */
    --primary: #047857;
    --primary-hover: #065f46;
    --primary-soft: #d1fae5;
    --primary-glow: rgba(4, 120, 87, 0.18);
    --accent: #f59e0b;
    --accent-soft: #fef3c7;

    /* Surface */
    --bg-primary: #ffffff;
    --bg-secondary: #fbfaf7;
    --bg-tertiary: #f3f1ec;
    --bg-elevated: #ffffff;
    --bg-canvas: #f7f5f0;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Lines */
    --border-color: #e7e5e0;
    --border-strong: #d4d2cc;
    --divider: rgba(15, 23, 42, 0.08);

    /* Shadow system — layered, soft */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.18);
    --shadow-glow: 0 0 0 4px var(--primary-glow);

    /* Type */
    --font-display: 'DM Serif Display', 'Iowan Old Style', Georgia, serif;
    --font-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Layout */
    --container-width: 1240px;
    --section-padding: 120px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 160ms var(--ease-out);
    --transition-normal: 240ms var(--ease-out);
    --transition-slow: 420ms var(--ease-out);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
}

[data-theme="dark"] {
    --primary: #10b981;
    --primary-hover: #34d399;
    --primary-soft: rgba(16, 185, 129, 0.14);
    --primary-glow: rgba(16, 185, 129, 0.28);
    --accent: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.16);

    --bg-primary: #0b0f0d;
    --bg-secondary: #11161a;
    --bg-tertiary: #1a2026;
    --bg-elevated: #161c21;
    --bg-canvas: #0a0e10;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: #232a31;
    --border-strong: #2c343c;
    --divider: rgba(255, 255, 255, 0.08);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
#jobs, #categories, #about, #stats { scroll-margin-top: 5.5rem; }

body {
    font-family: var(--font-body);
    background: var(--bg-canvas);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

::selection { background: var(--primary); color: #fff; }

/* ============ A11Y ============ */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 12px 20px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ============ LAYOUT ============ */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ LOADER ============ */
.loader {
    position: fixed; inset: 0;
    background: var(--bg-canvas);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s, visibility 0.4s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-content { text-align: center; color: var(--text-muted); }
.loader-content p { margin-top: 1.25rem; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; }
.loader-spinner {
    width: 48px; height: 48px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.005em;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast);
    white-space: nowrap;
    position: relative;
    isolation: isolate;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 24px -8px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -10px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-primary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.btn-white { background: #fff; color: var(--primary); box-shadow: var(--shadow-md); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-lg { padding: 16px 32px; font-size: 15px; }

.btn-copy { background: #0ea5e9; color: #fff; }
.btn-copy:hover { background: #0284c7; transform: translateY(-1px); }

/* ============ TAGS ============ */
.tag {
    display: inline-flex; align-items: center;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.tag:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    border-color: var(--primary);
}
.tag-email { background: rgba(14, 165, 233, 0.1); color: #0369a1; }
.tag-link { background: var(--accent-soft); color: #b45309; }
.tag-success { background: var(--primary-soft); color: var(--primary); }

[data-theme="dark"] .tag-email { color: #38bdf8; }
[data-theme="dark"] .tag-link { color: #fbbf24; }

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--transition-normal);
    background: color-mix(in srgb, var(--bg-canvas) 75%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    padding: 10px 0;
    background: color-mix(in srgb, var(--bg-canvas) 92%, transparent);
    border-bottom-color: var(--divider);
    box-shadow: var(--shadow-sm);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.logo {
    display: flex; align-items: center; gap: 0.7rem;
    transition: transform var(--transition-fast);
}
.logo:hover { transform: scale(1.02); }
.logo-img {
    height: 42px; width: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--bg-canvas), 0 0 0 3.5px var(--primary);
}
.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: 4px; }
.nav-link {
    position: relative;
    font-weight: 500;
    font-size: 14.5px;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
#darkModeToggle {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-primary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: inline-flex; align-items: center; justify-content: center;
}
#darkModeToggle:hover { color: var(--primary); border-color: var(--primary); transform: rotate(-12deg); }

.mobile-menu-btn {
    display: none; flex-direction: column; gap: 5px; padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.mobile-menu-btn:hover { background: var(--bg-tertiary); }
.mobile-menu-btn span {
    width: 22px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
    transform-origin: center;
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
    min-height: 92vh;
    display: flex; align-items: center;
    padding: 140px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at top right, var(--primary-soft) 0%, transparent 55%),
        radial-gradient(ellipse at bottom left, var(--accent-soft) 0%, transparent 55%),
        var(--bg-canvas);
    z-index: -2;
}
[data-theme="dark"] .hero-bg {
    background:
        radial-gradient(ellipse at top right, rgba(16, 185, 129, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(251, 191, 36, 0.08) 0%, transparent 55%),
        var(--bg-canvas);
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.5;
    z-index: -1;
    animation: float 22s ease-in-out infinite;
}
.hero-shape-1 {
    width: 420px; height: 420px;
    background: var(--primary);
    top: -120px; right: -120px;
}
.hero-shape-2 {
    width: 320px; height: 320px;
    background: var(--accent);
    bottom: 5%; left: -80px;
    opacity: 0.35;
    animation-delay: -7s;
}
.hero-shape-3 { display: none; }
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

.hero-content {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.5rem;
    padding: 6px 16px;
    background: var(--primary-soft);
    border-radius: var(--radius-full);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}
.hero-eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 10%, transparent); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}
.hero-title-accent {
    background: linear-gradient(135deg, var(--primary) 0%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0 auto 2rem;
    max-width: 560px;
    line-height: 1.6;
}

.hero-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}
.hero-count #liveJobCount {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}

/* Search box — hero centerpiece */
.search-box {
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--divider);
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}
.search-box:focus-within {
    box-shadow: var(--shadow-xl), 0 0 0 2px var(--primary-glow);
    transform: translateY(-2px);
}

.search-input-wrapper, .search-select-wrapper {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}
.search-input-wrapper:hover, .search-select-wrapper:hover { background: var(--bg-secondary); }
.search-input-wrapper i, .search-select-wrapper i { color: var(--text-muted); font-size: 0.95rem; }

.search-input-wrapper input,
.search-select-wrapper select {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}
.search-input-wrapper input::placeholder { color: var(--text-muted); font-weight: 400; }

.search-box .btn { min-width: 160px; padding: 14px 28px; }

/* Popular searches */
.popular-searches {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.popular-searches span { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* Sources ticker */
.sources-ticker-wrap {
    width: 100%;
    max-width: min(1400px, 96%);
    margin: 2.5rem auto 0;
    padding: 0;
}
.sources-ticker-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}
.sources-ticker {
    overflow: hidden;
    border: 1px solid var(--divider);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    padding: 0.9rem 0;
    box-shadow: var(--shadow-sm);
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.sources-ticker-inner {
    display: flex; align-items: center; gap: 2rem;
    width: max-content;
    animation: ticker-rtl 60s linear infinite;
}
.ticker-item {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}
.ticker-avatar, .ticker-avatar-fallback {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px var(--bg-primary), 0 0 0 2.5px var(--divider);
}
.ticker-avatar-fallback {
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    align-items: center; justify-content: center;
    display: inline-flex;
}
@keyframes ticker-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Hero stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 4rem;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                border-color var(--transition-fast);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--divider));
}
.stat-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
}
.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-number {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    opacity: 0.7;
}
.mouse {
    width: 22px; height: 36px;
    border: 1.5px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}
.wheel {
    width: 3px; height: 7px;
    background: var(--text-muted);
    border-radius: 2px;
    position: absolute;
    top: 7px; left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}
@keyframes scroll {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ============ SECTION HEADERS ============ */
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header-jobs { margin-bottom: 2rem; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto;
}
.how-it-works {
    max-width: 580px;
    margin: 1.25rem auto 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ============ CATEGORIES ============ */
.categories-section {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--divider);
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.categories-note {
    margin-top: 1.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    text-align: center;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                border-color var(--transition-fast);
    border: 1px solid var(--divider);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--divider));
}
.category-card:hover::before { opacity: 0.6; }
.category-card > * { position: relative; z-index: 1; }

.category-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.category-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.005em; }
.category-count { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* ============ JOBS SECTION ============ */
.jobs-section {
    padding: var(--section-padding) 0;
    background: var(--bg-canvas);
}

.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
}

.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-xs);
    max-width: 100%;
    min-width: 0;
}
.filter-tab {
    padding: 9px 18px;
    min-height: 38px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.filter-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.filter-tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.filter-select {
    padding: 10px 36px 10px 18px;
    height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    -webkit-appearance: none; appearance: none;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.filter-select:hover { border-color: var(--primary); }

/* Job grid + cards */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.job-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    border: 1px solid var(--divider);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.job-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}
.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--divider));
}
.job-card:hover::after { transform: scaleX(1); }

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.job-logo {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-soft), var(--bg-tertiary));
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid var(--divider);
}
.job-card-title { flex: 1; min-width: 0; }
.job-card-title h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.job-card-title .company {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

.job-card-meta {
    display: flex; flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 12px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.job-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.job-card-meta i { font-size: 0.75rem; color: var(--primary); opacity: 0.7; }

.job-card-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.job-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
    margin-top: auto;
}
.job-card-tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }

.btn-icon {
    padding: 0;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--divider);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: scale(1.05);
}

.job-card-share { color: var(--text-secondary); }
.job-card-source { margin-left: auto; }

.job-source-channel {
    display: inline-flex; align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.job-source-channel .channel-avatar,
.job-source-channel .channel-avatar-fallback {
    width: 24px; height: 24px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 1.5px var(--bg-primary), 0 0 0 2.5px var(--divider);
}
.job-source-channel .channel-avatar-fallback {
    background: var(--primary); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    align-items: center; justify-content: center; display: inline-flex;
}
.job-source-channel .channel-name {
    max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.job-card-deadline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.job-card-deadline.urgent {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.job-card-save {
    min-width: 36px; min-height: 36px;
    padding: 0;
    border-radius: 50%;
    color: var(--text-muted);
}
.job-card-save.saved {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
}

/* Load more */
.load-more-wrapper { text-align: center; margin-top: 48px; }

/* ============ FEATURES ============ */
.features-section {
    padding: var(--section-padding) 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--divider);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1020px;
    margin: 0 auto;
}
.feature-card {
    padding: 36px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 56px; height: 4px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-sm) 0;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--divider));
    box-shadow: var(--shadow-md);
}
.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.feature-card p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.65; }

/* ============ STATS BAND ============ */
.stats-section {
    padding: var(--section-padding) 0;
    background: linear-gradient(135deg, var(--primary) 0%, #065f46 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.stats-section::before {
    content: '';
    position: absolute;
    top: -20%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.stats-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
}
.stats-text .section-title {
    font-family: var(--font-display);
    color: #fff;
    margin-bottom: 1rem;
}
.stats-text p { opacity: 0.92; margin-bottom: 1.75rem; font-size: 1rem; line-height: 1.65; }
.stats-list { display: flex; flex-direction: column; gap: 0.75rem; }
.stats-item {
    font-size: 0.95rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 12px;
}
.stats-item::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}
.stats-numbers { display: flex; gap: 3rem; justify-content: center; }
.big-stat { text-align: center; }
.big-stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 6vw, 5rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}
.big-stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* ============ CTA ============ */
.cta-section {
    padding: 5rem 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--divider);
}
.cta-content { text-align: center; max-width: 520px; margin: 0 auto; }
.cta-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

/* ============ FOOTER ============ */
.footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 80px 0 32px;
}
[data-theme="dark"] .footer { background: #050807; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 56px;
    margin-bottom: 56px;
}
.footer-brand p {
    margin: 16px 0 24px;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1.7;
}
.footer .logo-text { color: #fff; }
.footer-links h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.footer-links ul { display: flex; flex-direction: column; gap: 12px; }
.footer-links a, .footer-links li {
    font-size: 14px;
    opacity: 0.75;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-links a:hover { opacity: 1; color: var(--primary); }

.social-links { display: flex; gap: 10px; }
.social-link {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #cbd5e1;
    transition: all var(--transition-fast);
}
.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    opacity: 0.6;
}

/* Email alerts card */
.jobs-section-alerts {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--bg-primary) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--divider));
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.jobs-section-alerts::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}
.jobs-section-alerts > * { position: relative; z-index: 1; }

.jobs-alerts-label {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}
.jobs-alerts-label i { color: var(--primary); font-size: 1rem; }

.jobs-alerts-form {
    display: flex; flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.jobs-alerts-form input, .jobs-alerts-form select {
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-height: 44px;
    transition: border-color var(--transition-fast);
}
.jobs-alerts-form input:focus, .jobs-alerts-form select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.jobs-alerts-form #alertsEmail { min-width: 220px; flex: 1; }
.jobs-alerts-form .jobs-alerts-keywords { min-width: 160px; }

.alerts-form-message {
    font-size: 0.875rem;
    margin-top: 0.75rem;
    min-height: 1.25rem;
    font-weight: 500;
}
.alerts-form-message.success { color: var(--primary); }
.alerts-form-message.error { color: #dc2626; }

/* ============ MODAL ============ */
.modal { display: none; position: fixed; inset: 0; z-index: 2000; }
.modal.active { display: block; }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    position: fixed; inset: 0;
    overflow-y: auto;
    padding: 40px 16px;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.32s var(--ease-out);
    overflow: hidden;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    color: #fff;
    border-radius: 50%;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}
.modal-close:hover { background: rgba(255,255,255,0.25); transform: rotate(90deg); }

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #065f46 100%);
    color: #fff;
    padding: 2.5rem 2.25rem 2rem;
    position: relative;
    overflow: hidden;
}
.modal-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.modal-header > * { position: relative; z-index: 1; }

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 400;
    margin-bottom: 1rem;
    padding-right: 3.5rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.modal-meta {
    display: flex; flex-wrap: wrap;
    gap: 12px 18px;
    font-size: 0.875rem;
    opacity: 0.95;
}
.modal-meta span { display: flex; align-items: center; gap: 6px; }
.modal-meta i { opacity: 0.85; }

.modal-source-channel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.modal-source-channel.job-source-channel.modal-channel {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.96);
}
.modal-source-channel .channel-avatar,
.modal-source-channel .channel-avatar-fallback {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.modal-source-channel .channel-avatar-fallback {
    background: rgba(255,255,255,0.25); color: #fff;
    font-size: 0.85rem; font-weight: 700;
    align-items: center; justify-content: center; display: inline-flex;
}

.modal-header-actions {
    position: absolute;
    top: 1.25rem; right: 4rem;
    display: flex; align-items: center; gap: 0.5rem;
    z-index: 5;
}
.modal-header-actions .job-card-save {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
}
.modal-header-actions .job-card-save:hover,
.modal-header-actions .job-card-save.saved {
    border-color: #fff; color: #fff;
    background: rgba(255,255,255,0.2);
}

.modal-share {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}
.modal-share:hover { background: #f9fafb; color: var(--primary-hover); }

.modal-body { padding: 2rem 2.25rem 2.5rem; }
.modal-body-content { padding-bottom: 2rem; max-width: 720px; }
.modal-body-content .description-section { margin-top: 1.5rem; }

/* Sticky apply bar */
.modal-sticky-apply {
    position: sticky;
    bottom: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--bg-primary) 95%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--divider);
    padding: 1rem 2.25rem;
    display: none;
    z-index: 5;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
}
.modal-sticky-apply.visible { display: block; }

/* Desktop has sticky sidebar with apply button always visible — bar is not needed */
@media (min-width: 901px) {
    .modal-sticky-apply.visible { display: none !important; }
}
.modal-sticky-inner {
    max-width: 720px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.modal-sticky-title {
    font-weight: 600; font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 300px;
}
.modal-sticky-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.apply-section {
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--bg-tertiary) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--divider));
    position: relative;
    overflow: hidden;
}
.apply-section h4 {
    font-family: var(--font-display);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: 10px;
    letter-spacing: -0.01em;
}
.apply-section p { color: var(--text-secondary); margin-bottom: 1rem; }
.apply-section > .btn { width: fit-content; max-width: 100%; }

.email-box {
    display: flex; gap: 10px;
    flex-wrap: wrap; align-items: center;
}
.email-display {
    background: var(--bg-primary);
    border: 1.5px solid var(--primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    flex: 1;
    min-width: 220px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Description readable typography */
.description-section { margin-bottom: 2rem; }
.description-section h4 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--divider);
    letter-spacing: -0.01em;
}
.description-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
    max-width: 65ch;
    word-wrap: break-word;
    text-align: left;
    letter-spacing: 0.005em;
}
.description-text p { margin: 0 0 1.25rem; }
.description-text p:last-child { margin-bottom: 0; }
.description-text ul, .description-text ol {
    margin: 1rem 0 1.25rem;
    padding-left: 1.25rem;
}
.description-text li { margin-bottom: 0.4em; line-height: 1.65; }
.description-text li:last-child { margin-bottom: 0; }
.description-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    font-weight: 500;
}
.description-text a:hover { text-decoration: none; }
.description-text strong, .description-text b {
    font-weight: 600;
    color: var(--text-primary);
}

/* Similar jobs */
.similar-jobs-loading {
    margin-top: 2rem; padding-top: 1.5rem;
    color: var(--text-muted); font-size: 0.875rem;
}
.similar-jobs {
    margin-top: 2rem; padding-top: 1.5rem;
    border-top: 1px solid var(--divider);
}
.similar-jobs h4 {
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 400;
    margin-bottom: 1rem; color: var(--text-primary);
}
.similar-jobs-list { display: flex; flex-direction: column; gap: 8px; }
.similar-job-item {
    display: block;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.similar-job-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateX(4px);
}
.similar-job-item .company { color: var(--text-muted); font-size: 0.8125rem; }

.source-section {
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--divider);
    text-align: center;
}
.source-section a { color: var(--text-muted); font-size: 14px; }
.source-section a:hover { color: var(--primary); }

.jobs-freshness {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    font-weight: 500;
}

.active-filters-chips {
    display: none; flex-wrap: wrap;
    gap: 8px; margin-bottom: 1rem; align-items: center;
}
.active-filters-chips.has-chips { display: flex; }
.filter-chip {
    display: inline-flex; align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.filter-chip-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    padding: 0;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}
.filter-chip-remove:hover {
    color: #fff;
    background: var(--primary);
}

.btn-empty-state { margin-top: 1.25rem; }
.modal-view-full { margin-top: 1rem; font-size: 0.875rem; }
.modal-view-full a { color: var(--primary); font-weight: 500; }
.modal-report {
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--divider);
    font-size: 0.825rem;
}
.modal-report a, .link-muted {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}
.modal-report a:hover, .link-muted:hover { color: var(--primary); }
.modal-report a i { margin-right: 6px; }

/* Skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.3s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.job-card-skeleton {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--divider);
}
.job-card-skeleton .skeleton-title { height: 1.1rem; width: 75%; margin-bottom: 0.75rem; }
.job-card-skeleton .skeleton-company { height: 0.875rem; width: 50%; margin-bottom: 1rem; }
.job-card-skeleton .skeleton-meta { height: 0.75rem; width: 40%; margin-bottom: 0.75rem; }
.job-card-skeleton .skeleton-preview { height: 0.875rem; width: 100%; margin-bottom: 0.5rem; }
.job-card-skeleton .skeleton-preview:nth-child(5) { width: 60%; }

.empty-state { padding: 4rem 1.5rem; text-align: center; }
.empty-state i, .empty-state .empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: block;
    opacity: 0.5;
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.empty-state p { color: var(--text-muted); font-size: 0.95rem; }
.empty-state .suggestion-divider { margin-top: 1.25rem; }
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.suggestion-chip {
    appearance: none;
    border: 1px solid var(--divider);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.suggestion-chip:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    transform: translateY(-1px);
}
.suggestion-chip-cat {
    background: rgba(6, 95, 70, 0.06);
    border-color: rgba(6, 95, 70, 0.2);
    color: #065f46;
}
.suggestion-chip-cat:hover {
    background: #065f46;
    color: #fff;
    border-color: #065f46;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px; left: 24px;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    z-index: 900;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* Toast */
.toast {
    position: fixed;
    bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 3000;
    box-shadow: var(--shadow-xl);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--primary); color: #fff; }
.toast.error { background: #dc2626; color: #fff; }

/* ============ RESPONSIVE ============ */

/* ── Large tablet / small desktop (≤1200px) ── */
@media (max-width: 1200px) {
    .jobs-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* ── Tablet landscape (≤1024px) ── */
@media (max-width: 1024px) {
    :root { --section-padding: 80px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .stats-content { grid-template-columns: 1fr; text-align: center; }
    .stats-numbers { margin-top: 2rem; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
    .jobs-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-tabs::-webkit-scrollbar { display: none; }
    .filter-tab { white-space: nowrap; flex-shrink: 0; }
}

/* ── Tablet portrait (≤768px) ── */
@media (max-width: 768px) {
    :root { --section-padding: 64px; }

    /* Navbar — show hamburger, hide links, drop the redundant Search CTA */
    .nav-actions .btn span { display: none; }
    .nav-actions a.btn-primary { display: none; } /* hero already has a big search box */
    .nav-actions { gap: 8px; }
    .mobile-menu-btn { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--divider);
        flex-direction: column;
        padding: 12px 16px 16px;
        gap: 4px;
        box-shadow: var(--shadow-md);
        z-index: 999;
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 12px 16px; border-radius: var(--radius-md); width: 100%; }
    .navbar .container { position: relative; }

    /* Hero */
    .hero { min-height: auto; padding: 100px 0 56px; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .scroll-indicator { display: none; }

    /* Search */
    .search-box {
        flex-direction: column;
        border-radius: var(--radius-xl);
        padding: 12px;
        gap: 4px;
    }
    .search-input-wrapper, .search-select-wrapper { padding: 14px 18px; }
    .search-box .btn { width: 100%; min-height: 50px; border-radius: var(--radius-full); }

    /* Jobs */
    .jobs-grid { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .filter-actions { display: flex; gap: 10px; }
    .filter-select { flex: 1; }
    .load-more-wrapper .btn { width: 100%; min-height: 48px; }

    /* Alerts form */
    .jobs-alerts-form { flex-direction: column; align-items: stretch; }
    .jobs-alerts-form #alertsEmail,
    .jobs-alerts-form .jobs-alerts-keywords { min-width: 0; width: 100%; }

    /* Categories */
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .category-card { padding: 16px; }

    /* Features */
    .features-grid { grid-template-columns: 1fr; max-width: none; }

    /* Stats section */
    .stats-content { grid-template-columns: 1fr; text-align: center; }
    .stats-numbers { margin-top: 1.5rem; }
    .big-stat-number { font-size: 2.75rem; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
    .social-links { justify-content: center; }

    /* Modal */
    .modal-content { padding: 16px 8px; }
    .modal-dialog { border-radius: var(--radius-xl); }
    .modal-header { padding: 1.75rem 1.5rem; }
    .modal-header h2 { font-size: 1.3rem; padding-right: 2.5rem; }
    .modal-body, .modal-body-content { padding: 1.5rem; }
    .modal-sticky-apply { padding: 0.75rem 1.25rem; }
    .modal-sticky-inner { gap: 0.5rem; }
    .modal-sticky-title { max-width: 180px; font-size: 0.85rem; }
    .modal-sticky-actions .btn { min-height: 44px; padding: 10px 18px; }
    .modal-header-actions { right: 4rem; top: 1rem; }

    /* Misc */
    .email-box { flex-direction: column; align-items: stretch; }
    .email-display { min-width: auto; text-align: center; }
    .btn { min-height: 44px; }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 88px 0 48px; }
    .hero-title { font-size: 1.9rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 14px 16px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }
    .stat-number { font-size: 1.3rem; }
    .section-title { font-size: 1.75rem; }
    .job-card { padding: 18px; }
    .feature-card { padding: 28px 22px; }
    .jobs-section-alerts { padding: 1.5rem 1.25rem; }
    .categories-grid { grid-template-columns: 1fr; }
    .filter-actions { flex-direction: column; }
    .popular-searches { gap: 6px; }
    .logo-text { font-size: 1.3rem; }
}

/* ── Very small mobile (≤360px) ── */
@media (max-width: 360px) {
    .hero-title { font-size: 1.65rem; }
    .search-box { padding: 8px; }
    .stat-card { padding: 12px; gap: 8px; }
    .hero-stats { gap: 6px; }
}

/* ============================================================
   PREMIUM ADDITIONS — modal hero, sidebar, sections,
   deadline badges, rich similar jobs, category tones
   ============================================================ */

/* Modal hero — gradient header with logo tile */
.modal-hero {
    position: relative;
    padding: 36px 36px 32px;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.modal-hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 80% -20%, rgba(255,255,255,0.18) 0%, transparent 55%),
        radial-gradient(circle at 10% 110%, rgba(255,255,255,0.10) 0%, transparent 55%),
        linear-gradient(135deg, #065f46 0%, #047857 50%, #0d9488 100%);
    z-index: -1;
}
.modal-hero-inner {
    display: flex; align-items: flex-start;
    gap: 22px;
    position: relative;
    z-index: 1;
}
.modal-hero-logo {
    flex-shrink: 0;
    width: 76px; height: 76px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    letter-spacing: -0.02em;
}
.modal-hero-text { flex: 1; min-width: 0; }
.modal-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 6px;
    padding-right: 3rem;
    letter-spacing: -0.015em;
    color: #fff;
}
.modal-hero-company {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    margin: 0 0 14px;
    letter-spacing: 0.01em;
}
.modal-hero-meta {
    display: flex; flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
}
.modal-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.modal-hero-meta i { font-size: 0.8rem; opacity: 0.8; }

.modal-hero-badges {
    margin-top: 14px;
    display: flex; flex-wrap: wrap; gap: 8px;
}

/* Deadline badges — shared color scale */
.deadline-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
}
.deadline-badge--urgent { background: #fee2e2; border-color: transparent; color: #b91c1c; }
.deadline-badge--soon   { background: #ffedd5; border-color: transparent; color: #c2410c; }
.deadline-badge--week   { background: #fef3c7; border-color: transparent; color: #92400e; }
.deadline-badge--far    { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.deadline-badge--closed { background: #e5e7eb; border-color: transparent; color: #6b7280; }
[data-theme="dark"] .deadline-badge--urgent { background: rgba(239,68,68,0.18); color: #fecaca; }
[data-theme="dark"] .deadline-badge--soon   { background: rgba(249,115,22,0.18); color: #fed7aa; }
[data-theme="dark"] .deadline-badge--week   { background: rgba(245,158,11,0.18); color: #fde68a; }
[data-theme="dark"] .deadline-badge--far    { background: rgba(16,185,129,0.18); color: #a7f3d0; }
[data-theme="dark"] .deadline-badge--closed { background: rgba(148,163,184,0.18); color: #cbd5e1; }

/* Override the modal-header default so the new hero is fully styled */
.modal-dialog > .modal-header { display: none; }
.modal-dialog > .modal-close { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28); }

/* Two-column modal grid */
.modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    padding: 32px 36px 40px;
}
.modal-main { min-width: 0; }
.modal-side {
    position: sticky;
    top: 24px;
    align-self: start;
    height: fit-content;
}
.modal-side-card {
    background: var(--bg-secondary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.modal-side-apply { display: flex; flex-direction: column; gap: 10px; }
.modal-side-apply .btn { width: 100%; }
.apply-cta {
    padding: 16px 24px !important;
    font-size: 15px !important;
    box-shadow: 0 12px 28px -10px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.18) !important;
}
.btn-block { width: 100%; }
.apply-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.modal-side-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}
.btn-side-action {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.btn-side-action i { font-size: 1rem; color: var(--text-muted); transition: color var(--transition-fast); }
.btn-side-action:hover {
    background: var(--bg-primary);
    border-color: var(--divider);
    color: var(--text-primary);
}
.btn-side-action:hover i { color: var(--primary); }
.btn-side-action.is-saved { color: var(--primary); }
.btn-side-action.is-saved i { color: var(--primary); }

.modal-side-deadline {
    margin-top: 16px;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--divider);
}
.modal-side-deadline.deadline-badge--urgent { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.modal-side-deadline.deadline-badge--soon   { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.modal-side-deadline.deadline-badge--week   { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.modal-side-deadline.deadline-badge--far    { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.modal-side-deadline.deadline-badge--closed { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
[data-theme="dark"] .modal-side-deadline.deadline-badge--urgent { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: #fecaca; }
[data-theme="dark"] .modal-side-deadline.deadline-badge--soon   { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.3); color: #fed7aa; }
[data-theme="dark"] .modal-side-deadline.deadline-badge--week   { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fde68a; }
[data-theme="dark"] .modal-side-deadline.deadline-badge--far    { background: rgba(16,185,129,0.15); color: #a7f3d0; }

.modal-side-deadline i { font-size: 1.1rem; flex-shrink: 0; }
.modal-side-deadline-label { font-weight: 700; font-size: 0.875rem; letter-spacing: -0.005em; }
.modal-side-deadline-date { font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }

.modal-side-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
    display: flex; flex-direction: column; gap: 10px;
}
.modal-side-meta-row {
    display: flex; flex-direction: column;
    gap: 2px;
}
.modal-side-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.modal-side-meta-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Description sections — visual blocks */
.description-section .description-text { max-width: none; }
.description-block {
    background: var(--bg-secondary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.description-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
}
.description-block--about::before    { background: #0ea5e9; }
.description-block--resp::before     { background: var(--primary); }
.description-block--req::before      { background: #8b5cf6; }
.description-block--benefits::before { background: var(--accent); }
.description-block--apply::before    { background: #ec4899; }

.description-block-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 12px;
}
.description-block-title i {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
}
.description-block--about .description-block-title i    { background: rgba(14,165,233,0.12); color: #0284c7; }
.description-block--resp .description-block-title i     { background: var(--primary-soft); color: var(--primary); }
.description-block--req .description-block-title i      { background: rgba(139,92,246,0.12); color: #7c3aed; }
.description-block--benefits .description-block-title i { background: var(--accent-soft); color: #b45309; }
.description-block--apply .description-block-title i    { background: rgba(236,72,153,0.12); color: #db2777; }
[data-theme="dark"] .description-block--about .description-block-title i    { background: rgba(14,165,233,0.18); color: #7dd3fc; }
[data-theme="dark"] .description-block--req .description-block-title i      { background: rgba(139,92,246,0.18); color: #c4b5fd; }
[data-theme="dark"] .description-block--benefits .description-block-title i { background: rgba(245,158,11,0.18); color: #fcd34d; }
[data-theme="dark"] .description-block--apply .description-block-title i    { background: rgba(236,72,153,0.18); color: #f9a8d4; }

.description-block-body { color: var(--text-secondary); line-height: 1.7; }
.description-block-body p { margin: 0 0 0.85rem; }
.description-block-body p:last-child { margin-bottom: 0; }
.description-block-body ul, .description-block-body ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.description-block-body li { margin-bottom: 0.4em; }
.description-block-body strong { color: var(--text-primary); }
.description-block-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }

.modal-channel-row {
    margin: 1.25rem 0;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
    display: inline-flex;
}
.modal-channel-row .job-source-channel { color: var(--text-secondary); }

/* Rich similar-jobs rail */
.similar-jobs {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--divider);
}
.similar-jobs-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 16px;
}
.similar-jobs-header h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
    display: flex; align-items: center; gap: 10px;
}
.similar-jobs-header h4 i { color: var(--accent); font-size: 1rem; }
.similar-jobs-see-all {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    transition: opacity var(--transition-fast);
}
.similar-jobs-see-all:hover { opacity: 0.7; }

.similar-jobs-rail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.similar-job-card {
    display: flex; align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}
.similar-job-card:hover {
    background: var(--bg-primary);
    border-color: color-mix(in srgb, var(--primary) 28%, var(--divider));
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}
.similar-job-logo {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-soft), var(--bg-tertiary));
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 1.05rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
}
.similar-job-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.similar-job-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.similar-job-company {
    font-size: 0.825rem;
    color: var(--primary);
    font-weight: 500;
}
.similar-job-meta {
    display: flex; flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.similar-job-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.similar-job-meta i { font-size: 0.7rem; opacity: 0.7; }
.similar-job-deadline {
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.similar-jobs-loading {
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}
.similar-jobs-loading i { margin-right: 6px; color: var(--primary); }

/* Color-coded category cards */
.categories-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 1024px) { .categories-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 768px)  { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .categories-grid { grid-template-columns: 1fr; } }
.category-card {
    --tone: var(--primary);
    --tone-soft: var(--primary-soft);
    --tone-text: var(--primary);
    display: flex; align-items: center;
    gap: 14px;
    width: 100%;
    padding: 20px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                border-color var(--transition-fast), background var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--tone-soft) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}
.category-card > * { position: relative; z-index: 1; }
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--tone) 35%, var(--divider));
}
.category-card:hover::before { opacity: 1; }

.category-card .category-icon {
    background: var(--tone-soft);
    color: var(--tone-text);
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}
.category-card:hover .category-icon { transform: scale(1.08) rotate(-6deg); }

.category-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.category-count strong {
    color: var(--tone-text);
    font-weight: 700;
}

.category-arrow {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition-normal);
}
.category-card:hover .category-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--tone-text);
}

/* Tone palette */
.category-card--blue    { --tone: #2563eb; --tone-soft: #dbeafe; --tone-text: #1d4ed8; }
.category-card--emerald { --tone: #047857; --tone-soft: #d1fae5; --tone-text: #047857; }
.category-card--teal    { --tone: #0d9488; --tone-soft: #ccfbf1; --tone-text: #0f766e; }
.category-card--indigo  { --tone: #4f46e5; --tone-soft: #e0e7ff; --tone-text: #4338ca; }
.category-card--fuchsia { --tone: #c026d3; --tone-soft: #fae8ff; --tone-text: #a21caf; }
.category-card--rose    { --tone: #e11d48; --tone-soft: #ffe4e6; --tone-text: #be123c; }
.category-card--amber   { --tone: #d97706; --tone-soft: #fef3c7; --tone-text: #b45309; }
.category-card--orange  { --tone: #ea580c; --tone-soft: #ffedd5; --tone-text: #c2410c; }
.category-card--slate   { --tone: #475569; --tone-soft: #f1f5f9; --tone-text: #334155; }
[data-theme="dark"] .category-card--blue    { --tone-soft: rgba(37,99,235,0.16); --tone-text: #93c5fd; }
[data-theme="dark"] .category-card--emerald { --tone-soft: rgba(16,185,129,0.16); --tone-text: #6ee7b7; }
[data-theme="dark"] .category-card--teal    { --tone-soft: rgba(20,184,166,0.16); --tone-text: #5eead4; }
[data-theme="dark"] .category-card--indigo  { --tone-soft: rgba(99,102,241,0.16); --tone-text: #a5b4fc; }
[data-theme="dark"] .category-card--fuchsia { --tone-soft: rgba(217,70,239,0.16); --tone-text: #f0abfc; }
[data-theme="dark"] .category-card--rose    { --tone-soft: rgba(244,63,94,0.16); --tone-text: #fda4af; }
[data-theme="dark"] .category-card--amber   { --tone-soft: rgba(245,158,11,0.16); --tone-text: #fcd34d; }
[data-theme="dark"] .category-card--orange  { --tone-soft: rgba(249,115,22,0.16); --tone-text: #fdba74; }
[data-theme="dark"] .category-card--slate   { --tone-soft: rgba(100,116,139,0.18); --tone-text: #cbd5e1; }

/* Mobile modal: collapse to single column */
@media (max-width: 900px) {
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 20px 32px;
    }
    .modal-side {
        position: static;
        order: -1;  /* Apply card above description on mobile */
    }
    .apply-section { display: none; } /* sidebar already shows apply CTA above description */
    .modal-hero { padding: 28px 24px; }
    .modal-hero-inner { gap: 16px; }
    .modal-hero-logo { width: 60px; height: 60px; font-size: 1.6rem; border-radius: 16px; }
    .modal-hero-title { font-size: 1.3rem; padding-right: 2.5rem; }
    .modal-hero-meta { font-size: 0.825rem; }
    .description-block { padding: 16px 18px; }
}

@media (max-width: 480px) {
    .modal-hero { padding: 24px 18px; }
    .modal-hero-logo { width: 52px; height: 52px; font-size: 1.4rem; }
    .modal-side-card { padding: 16px; }
    .modal-side-actions { grid-template-columns: repeat(3, 1fr); }
    .categories-grid { grid-template-columns: 1fr; }
}

/* ===== SALARY BADGE ===== */
.salary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: 20px;
}

.salary-badge i {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* ===== TRUST SIGNALS ===== */
.modal-side-trust { margin-top: 4px; }

.trust-signals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trust-signal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition-fast);
}

.trust-signal i {
    font-size: 1rem;
    color: var(--primary);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.trust-signal--hot {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.trust-signal--hot i { color: var(--accent); }

.trust-signal-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.trust-signal-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ===== JOB ALERTS ONBOARDING POPUP ===== */
.alerts-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alerts-popup-overlay.alerts-popup-visible { opacity: 1; }
.alerts-popup-overlay[hidden] { display: none !important; }

.alerts-popup {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
    padding: 36px 32px 28px;
    text-align: center;
    transform: translateY(28px) scale(0.96);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alerts-popup-visible .alerts-popup {
    transform: translateY(0) scale(1);
}

.alerts-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.alerts-popup-close:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: scale(1.1);
}

.alerts-popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.75rem;
    color: #fff;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}

.alerts-popup-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.alerts-popup-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 24px;
    line-height: 1.6;
}

.alerts-popup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.alerts-popup-form input,
.alerts-popup-form select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.alerts-popup-form input:focus,
.alerts-popup-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.alerts-popup-form .btn-block {
    margin-top: 2px;
    width: 100%;
    justify-content: center;
}

.alerts-popup-skip {
    display: block;
    margin: 14px auto 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.alerts-popup-skip:hover { color: var(--text-secondary); }

body.popup-open { overflow: hidden; }

@media (max-width: 480px) {
    .alerts-popup { padding: 28px 20px 22px; border-radius: 16px; }
    .alerts-popup-title { font-size: 1.35rem; }
    .alerts-popup-icon { width: 54px; height: 54px; font-size: 1.5rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ============ EMPLOYER IDENTITY (logos) ============ */
.job-logo, .modal-hero-logo { position: relative; overflow: hidden; }
.company-logo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: inherit;
}
.company-logo-letter { position: relative; z-index: 0; line-height: 1; }

/* ============ RECOMMENDED FOR YOU ============ */
.reco-section { padding: var(--section-padding, 96px) 0 0; }
.reco-section .section-header { margin-bottom: 1.5rem; }
.reco-rail {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px 4px 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--divider) transparent;
}
.reco-rail::-webkit-scrollbar { height: 8px; }
.reco-rail::-webkit-scrollbar-track { background: transparent; }
.reco-rail::-webkit-scrollbar-thumb { background: var(--divider); border-radius: var(--radius-full); }
.reco-rail .job-card {
    flex: 0 0 auto;
    min-width: 320px;
    max-width: 340px;
    scroll-snap-align: start;
}
@media (max-width: 480px) {
    .reco-rail .job-card { min-width: 82vw; max-width: 82vw; }
}

/* ============ SHARE SHEET ============ */
.share-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.share-sheet-overlay.visible { opacity: 1; }
.share-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(14px);
    transition: transform 0.22s ease;
}
.share-sheet-overlay.visible .share-sheet { transform: translateY(0); }
.share-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.share-sheet-title { font-weight: 700; font-size: 1rem; }
.share-sheet-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}
.share-sheet-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.share-sheet-btn:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--divider)); }
.share-sheet-btn i { width: 22px; font-size: 1.15rem; text-align: center; }
.share-sheet-btn--telegram i { color: #229ED9; }
.share-sheet-btn--whatsapp i { color: #25D366; }
@media (min-width: 640px) {
    .share-sheet-overlay { align-items: center; }
    .share-sheet { border-radius: var(--radius-xl); }
}

/* ============ TELEGRAM LOGIN + USER MENU ============ */
.tg-login-container { display: flex; align-items: center; min-height: 36px; }
.tg-login-container[hidden] { display: none; }

.user-menu { position: relative; }
.user-menu[hidden] { display: none; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--divider);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.user-menu-btn:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.user-menu-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-soft);
    flex-shrink: 0;
}
.user-menu-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret { font-size: 0.7rem; color: var(--text-muted); }
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-menu-dropdown[hidden] { display: none; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.user-menu-item:hover { background: var(--bg-tertiary); }
.user-menu-item i { width: 16px; text-align: center; color: var(--text-muted); }

@media (max-width: 768px) {
    .user-menu-name { display: none; }
}

/* Sign-in popover (Telegram + email) */
.auth-area { position: relative; }
.auth-area[hidden] { display: none; }
.login-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-popover[hidden] { display: none; }
.login-popover-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); text-align: center; margin: 0; }
.login-popover .tg-login-container { justify-content: center; min-height: 44px; }
.google-btn-container { display: flex; justify-content: center; min-height: 40px; }
.login-or {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-muted); font-size: 0.8rem;
}
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
.login-email-form { display: flex; flex-direction: column; gap: 8px; }
.login-email-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}
.login-email-form input:focus { outline: none; border-color: var(--primary); }
.login-popover-msg { font-size: 0.82rem; text-align: center; margin: 0; min-height: 1em; }
.login-popover-msg.success { color: var(--primary); }
.login-popover-msg.error { color: #dc2626; }
.login-popover-note { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin: 0; line-height: 1.4; }
@media (max-width: 480px) {
    /* Center the sign-in card on phones instead of hanging off the right edge */
    .login-popover {
        position: fixed;
        top: 72px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(330px, calc(100vw - 24px));
    }
}

/* ============ POST A JOB (page + homepage modal) ============ */
.hero-employer { margin-top: 18px; font-size: 0.9rem; color: var(--text-muted); }
.hero-employer a { color: var(--primary); font-weight: 600; }
.hero-employer a:hover { text-decoration: underline; }

.pj-modal-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: flex-start; justify-content: center;
    overflow-y: auto; padding: 80px 16px 40px;
}
.pj-modal-overlay[hidden] { display: none; }
.pj-card {
    background: var(--bg-primary); border: 1px solid var(--divider);
    border-radius: var(--radius-xl); padding: 30px; box-shadow: var(--shadow-lg);
    width: 100%; max-width: 640px; position: relative;
}
.pj-card h2 { font-family: var(--font-display); font-size: 1.7rem; color: var(--text-primary); margin-bottom: 6px; }
.pj-sub { color: var(--text-muted); margin-bottom: 18px; font-size: 0.95rem; }
.pj-close {
    position: absolute; top: 14px; right: 14px;
    background: var(--bg-tertiary); border: none; width: 34px; height: 34px;
    border-radius: 50%; cursor: pointer; color: var(--text-secondary); font-size: 15px;
}
.pj-price { border-radius: var(--radius-md); padding: 13px 16px; margin-bottom: 20px; font-size: 1rem; text-align: center; }
.pj-price.free { background: var(--primary-soft); color: var(--primary); }
.pj-price.paid { background: var(--bg-tertiary); color: var(--text-primary); }
.pj-field { margin-bottom: 14px; }
.pj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pj-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text-secondary); }
.pj-field .req { color: #dc2626; }
.pj-field input, .pj-field textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--divider);
    border-radius: var(--radius-md); background: var(--bg-secondary);
    color: var(--text-primary); font-family: inherit; font-size: 0.95rem;
}
.pj-field input:focus, .pj-field textarea:focus { outline: none; border-color: var(--primary); }
.pj-field textarea { min-height: 130px; resize: vertical; }
.pj-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.pj-payment { border: 1px dashed var(--border-strong, var(--divider)); border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; background: var(--bg-secondary); }
.pj-payment-info { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 12px; white-space: pre-wrap; }
.pj-msg { text-align: center; margin-top: 12px; font-size: 0.92rem; min-height: 1.2em; }
.pj-msg.success { color: var(--primary); }
.pj-msg.error { color: #dc2626; }
@media (max-width: 560px) { .pj-row { grid-template-columns: 1fr; } .pj-card { padding: 22px; } .pj-modal-overlay { padding: 70px 12px 30px; } }
