/* =========================================================
   JOBSENSE — MODERN EDITORIAL THEME
   Replace static/css/style.css with this file.

   Design:
   - Warm ivory background
   - Charcoal typography
   - Orange accent
   - Clean editorial job cards
   - No change to Flask/Jinja functionality
========================================================= */

:root {
    --bg: #f6f4ef;
    --bg-soft: #fffdf8;
    --panel: #ffffff;
    --card: #ffffff;
    --card-hover: #fffaf2;
    --text: #17202a;
    --muted: #6b7280;
    --accent: #f97316;
    --accent-dark: #c2410c;
    --accent-soft: #ffedd5;
    --success: #15803d;
    --success-bg: #dcfce7;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --border: #e5e1d8;
    --shadow: 0 12px 35px rgba(31, 41, 55, .08);
    --shadow-hover: 0 20px 50px rgba(31, 41, 55, .14);
    --radius: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 90% 0%, rgba(249, 115, 22, .08), transparent 28%),
        linear-gradient(180deg, #fffdf8 0%, var(--bg) 55%, #f1eee7 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 42px));
    margin: 0 auto;
}

/* ---------------- Header ---------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 253, 248, .92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.navbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand {
    font-size: 24px;
}

.brand-mark,
.footer-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--text);
    color: #fff;
    box-shadow: 0 7px 18px rgba(23, 32, 42, .16);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 20px;
}

.footer-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.brand-name,
.footer-brand-name {
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: #4b5563;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease;
}

.nav-links a:hover {
    color: var(--accent-dark);
}

/* ---------------- Shared typography ---------------- */

.eyebrow,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

/* ---------------- Homepage ---------------- */

.hero-section {
    padding: 88px 0 72px;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    align-items: center;
    gap: 65px;
}

.hero-copy h1 {
    margin-top: 24px;
    color: var(--text);
    font-size: clamp(2.8rem, 5vw, 5rem);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: -.075em;
}

.hero-copy h1 span {
    display: block;
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: initial;
}

.hero-description {
    max-width: 570px;
    margin-top: 25px;
    color: var(--muted);
    font-size: 1.03rem;
    line-height: 1.85;
}

.main-search-form,
.results-search-form {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: 30px;
}

.search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-symbol {
    position: absolute;
    top: 50%;
    left: 17px;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-field input {
    width: 100%;
    height: 58px;
    padding: 0 18px 0 47px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--text);
    box-shadow: 0 5px 18px rgba(31, 41, 55, .04);
}

.search-field input::placeholder {
    color: #9ca3af;
}

.search-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
}

.primary-button,
.main-search-form button[type="submit"] {
    min-width: 125px;
    min-height: 58px;
    padding: 0 22px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.primary-button:hover,
.main-search-form button[type="submit"]:hover {
    transform: translateY(-2px);
    background: var(--accent-dark);
    box-shadow: 0 12px 25px rgba(249, 115, 22, .22);
}

.hero-note {
    display: flex;
    gap: 9px;
    margin-top: 17px;
    color: var(--muted);
    font-size: 13px;
}

.hero-note > span {
    color: #16a34a;
}

/* ---------------- Hero panel ---------------- */

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background: var(--text);
    box-shadow: var(--shadow);
}

.panel-header,
.panel-item {
    display: flex;
    align-items: center;
}

.panel-header {
    justify-content: space-between;
    gap: 15px;
}

.panel-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 1.7rem;
}

.panel-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fed7aa;
    font-size: 10px;
    font-weight: 900;
}

.hero-panel h2 {
    margin-top: 27px;
    color: #fff;
    font-size: 2rem;
    line-height: 1.15;
}

.hero-panel > p {
    margin-top: 16px;
    color: #cbd5e1;
    font-size: .9rem;
    line-height: 1.8;
}

.panel-divider {
    height: 1px;
    margin: 27px 0;
    background: rgba(255, 255, 255, .16);
}

.panel-item {
    gap: 13px;
    margin-bottom: 20px;
}

.panel-item-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(249, 115, 22, .16);
    color: #fdba74;
}

.panel-item strong,
.panel-item small {
    display: block;
}

.panel-item strong {
    color: #fff;
    font-size: .85rem;
}

.panel-item small {
    color: #cbd5e1;
    font-size: .75rem;
}

.skill-pills,
.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.skill-pills span,
.job-skills span {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    background: rgba(255, 255, 255, .07);
    color: #fed7aa;
    font-size: .75rem;
    font-weight: 800;
}

/* ---------------- Sections ---------------- */

.stats-section,
.jobs-section,
.results-section {
    padding: 30px 0 95px;
}

.stats-grid,
.job-grid,
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.stat-card {
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    color: var(--accent);
    font-size: 2.3rem;
    font-weight: 950;
}

.stat-label {
    color: var(--muted);
    font-size: .85rem;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.section-heading h2 {
    margin-top: 15px;
    color: var(--text);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    letter-spacing: -.045em;
}

.section-heading > p {
    max-width: 320px;
    color: var(--muted);
    text-align: right;
}

/* ---------------- Job cards ---------------- */

.job-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 390px;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.job-card:hover {
    transform: translateY(-5px);
    border-color: #fdba74;
    background: var(--card-hover);
    box-shadow: var(--shadow-hover);
}

.job-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-label,
.job-badge {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .06em;
}

.job-arrow {
    color: var(--accent-dark);
    font-size: 1.3rem;
    font-weight: 900;
    text-decoration: none;
}

.job-card h2,
.job-card h3 {
    margin-top: 20px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -.025em;
}

.job-company {
    margin-top: 13px;
    color: #374151;
    font-size: .88rem;
    font-weight: 800;
}

.job-location {
    margin-top: 6px;
    color: #6b7280;
    font-size: .82rem;
}

.job-description {
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 16px;
    color: #6b7280;
    font-size: .86rem;
    line-height: 1.7;
}

.job-link,
.view-job-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 22px;
    color: var(--accent-dark);
    font-size: .84rem;
    font-weight: 900;
    text-decoration: none;
}

.view-job-btn {
    margin-top: 22px;
    padding: 12px 15px;
    border: 1px solid #fed7aa;
    border-radius: 11px;
    background: #fff7ed;
}

.job-link:hover,
.view-job-btn:hover {
    color: #9a3412;
    background: #ffedd5;
}

/* ---------------- Results page ---------------- */

.results-page {
    padding: 60px 0 100px;
}

.results-top,
.results-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 38px;
}

.results-top h1,
.results-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -.065em;
}

.results-top p,
.results-topbar p,
.results-subtitle {
    margin-top: 14px;
    color: var(--muted);
}

.results-top p strong,
.results-topbar p strong,
.results-subtitle strong {
    color: var(--accent-dark);
}

.secondary-button,
.new-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--text);
    color: #fff;
    font-size: .84rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.secondary-button:hover,
.new-search-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ---------------- Matching information ---------------- */

.job-match-info {
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.match-score {
    display: inline-flex;
    align-items: center;
    margin: 8px 0 13px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
    font-size: 13px;
    font-weight: 900;
}

.job-match-info p {
    margin: 6px 0;
    color: #6b7280;
    font-size: 14px;
}

.job-match-info strong {
    color: var(--text);
}

/* Compatible with both old and new results.html markup */

.skill-section,
.skills-detected,
.matched-skills,
.missing-skills,
.required-skills {
    color: var(--text) !important;
    opacity: 1 !important;
    font-size: .88rem;
    line-height: 1.7;
    font-weight: 600;
}

.skill-section strong,
.skills-detected strong,
.matched-skills strong,
.missing-skills strong,
.required-skills strong,
.skill-label {
    color: var(--text) !important;
    font-weight: 900;
}

.skill-badges,
.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text) !important;
    opacity: 1 !important;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 3px 3px 3px 0;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: .72rem;
    line-height: 1.35;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.skill-badge.detected,
.detected-badge {
    color: #1d4ed8 !important;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.skill-badge.matched,
.matched-badge {
    color: #166534 !important;
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
}

.skill-badge.missing,
.missing-badge {
    color: #991b1b !important;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
}

.skill-empty {
    color: #6b7280 !important;
    font-size: .8rem;
    font-weight: 800;
}

.job-card .text-muted,
.job-card .text-secondary,
.job-card small,
.job-card p {
    opacity: 1 !important;
}

/* ---------------- Empty state / Footer ---------------- */

.empty-results {
    padding: 70px 28px;
    border: 1px dashed #d6d3d1;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-results h2 {
    color: var(--text);
}

.empty-results p {
    margin-top: 10px;
    color: var(--muted);
}

.site-footer {
    padding: 44px 0;
    background: #17202a;
    border-top: 1px solid #263241;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-footer p {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 13px;
}

.footer-brand-name {
    color: #fff;
}

.footer-right,
.footer-copy {
    color: #cbd5e1;
    text-align: right;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1000px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .stats-grid,
    .job-grid,
    .results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 30px, 1180px);
    }

    .hero-section {
        padding: 60px 0 50px;
    }

    .main-search-form,
    .results-search-form {
        flex-direction: column;
    }

    .primary-button,
    .main-search-form button[type="submit"] {
        width: 100%;
    }

    .section-heading,
    .results-top,
    .results-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .section-heading > p {
        max-width: 100%;
        text-align: left;
    }

    .stats-grid,
    .job-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .job-card {
        min-height: 0;
        padding: 22px;
    }

    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-right,
    .footer-copy {
        text-align: left;
    }
}

@media (max-width: 430px) {
    .container {
        width: calc(100% - 26px);
    }

    .brand {
        font-size: 1.05rem;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a:last-child {
        display: none;
    }

    .hero-panel {
        padding: 25px;
    }
}

:focus-visible {
    outline: 3px solid rgba(249, 115, 22, .45);
    outline-offset: 4px;
}

.search-loading-message {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f97316;
}

button.is-loading {
    cursor: wait;
    opacity: 0.75;
}

.results-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0 28px;
}

.results-tools label {
    font-weight: 700;
}

.results-tools select,
.results-tools button {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font: inherit;
}

.results-tools button {
    cursor: pointer;
    font-weight: 700;
}

.no-filtered-jobs {
    margin: 20px 0;
    padding: 18px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
}

/* ---------------------------------
   Phase 5.3 - Job sorting controls
---------------------------------- */

.results-tools {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
}

.filter-group select {
    min-width: 180px;
}

@media (max-width: 600px) {
    .results-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-group select,
    .results-tools button {
        width: 100%;
    }
}

/* =================================
   Job Card Action Alignment
================================= */

.job-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* View Job and Save Job have equal alignment */
.view-job-btn,
.save-job-btn {
    min-height: 46px;
    height: 46px;
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0 20px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;

    border-radius: 10px;
    vertical-align: middle;
}

/* View Job link */
.view-job-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #8b451f;
}

/* Save Job button */
.save-job-btn {
    border: 1px solid #d8dee8;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Saved state */
.save-job-btn.saved {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* Hover effects */
.view-job-btn:hover {
    opacity: 0.75;
}

.save-job-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Mobile alignment */
@media (max-width: 600px) {
    .job-card-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .view-job-btn,
    .save-job-btn {
        width: 100%;
    }
}

/* =================================
   PHASE 5.6 - SAVED JOBS PAGE
================================= */

.saved-jobs-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

.saved-jobs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.section-label {
    color: #a16207;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.saved-jobs-header h1 {
    margin: 0;
    font-size: 36px;
}

.saved-jobs-subtitle {
    color: #64748b;
    margin-top: 10px;
}

.back-to-search-btn,
.view-saved-job-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border: none;
}

.saved-jobs-container {
    display: grid;
    gap: 18px;
}

.saved-job-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.saved-job-label {
    color: #a16207;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.saved-job-title {
    margin: 0;
    font-size: 21px;
    color: #0f172a;
}

.saved-job-url {
    max-width: 600px;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.saved-job-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.remove-saved-job-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
    font-weight: 700;
    cursor: pointer;
}

.empty-saved-jobs {
    text-align: center;
    padding: 70px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

.empty-saved-icon {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.empty-saved-jobs h2 {
    margin-bottom: 10px;
}

.empty-saved-jobs p {
    color: #64748b;
    margin-bottom: 24px;
}

@media (max-width: 700px) {
    .saved-jobs-page {
        padding: 28px 16px;
    }

    .saved-jobs-header {
        align-items: stretch;
        flex-direction: column;
    }

    .saved-jobs-header h1 {
        font-size: 30px;
    }

    .back-to-search-btn {
        width: 100%;
    }

    .saved-job-card {
        align-items: stretch;
        flex-direction: column;
    }

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

    .view-saved-job-btn,
    .remove-saved-job-btn {
        width: 100%;
    }
}

/* ============================= */
/* COMPACT AI ASSISTANT */
/* ============================= */

.ai-assistant-section {
    width: 100%;
    max-width: 1000px;
    margin: 35px auto 20px;
    padding: 20px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 18px;
    background: var(--card-background, #ffffff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.ai-assistant-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.ai-badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.ai-assistant-top h2 {
    margin: 0 0 5px;
    font-size: 22px;
    color: var(--text-color, #111827);
}

.ai-assistant-top p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted-text, #6b7280);
}

.ai-toggle-button {
    flex-shrink: 0;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    padding: 8px 12px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.ai-toggle-button:hover {
    background: #f3f4f6;
}

.ai-chat-content {
    margin-top: 15px;
}

.ai-chat-hidden {
    display: none;
}

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 80px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.ai-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.ai-message-bot {
    align-self: flex-start;
    background: #e5e7eb;
    color: #111827;
}

.ai-message-user {
    align-self: flex-end;
    background: #2563eb;
    color: white;
}

.ai-message h3,
.ai-message h4 {
    margin: 8px 0 5px;
    font-weight: 700;
}

.ai-message h3 {
    font-size: 16px;
}

.ai-message h4 {
    font-size: 15px;
}

.ai-message ul {
    margin: 6px 0;
    padding-left: 20px;
}

.ai-message li {
    margin-bottom: 5px;
}

.ai-message strong {
    font-weight: 700;
}

.ai-chat-form {
    display: flex;
    gap: 9px;
    margin-top: 12px;
}

#ai-chat-input {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
}

#ai-chat-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#ai-chat-submit {
    border: none;
    border-radius: 10px;
    padding: 0 17px;
    background: #2563eb;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#ai-chat-submit:hover {
    background: #1d4ed8;
}

#ai-chat-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-message-loading {
    opacity: 0.65;
    font-style: italic;
}

@media (max-width: 650px) {
    .ai-assistant-section {
        padding: 15px;
        margin-top: 25px;
    }

    .ai-assistant-top {
        align-items: flex-start;
    }

    .ai-assistant-top h2 {
        font-size: 19px;
    }

    .ai-assistant-top p {
        font-size: 13px;
    }

    .ai-chat-form {
        flex-direction: column;
    }

    #ai-chat-submit {
        min-height: 42px;
    }

    .ai-message {
        max-width: 95%;
    }
}


/* ========================================= */
/* MODERN JOBSENSE AI CHAT WINDOW */
/* ========================================= */

.floating-ai-chat {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 9999;

    display: flex;
    flex-direction: column;

    width: 410px;
    max-width: calc(100vw - 32px);
    height: 590px;
    max-height: calc(100vh - 130px);

    overflow: hidden;

    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;

    background: #ffffff;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.22),
        0 4px 16px rgba(15, 23, 42, 0.08);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(18px) scale(0.96);
    transform-origin: bottom right;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s ease;
}

.floating-ai-chat.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}


/* ========================================= */
/* HEADER */
/* ========================================= */

.floating-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 18px 19px;

    background:
        linear-gradient(
            135deg,
            #4f46e5 0%,
            #6366f1 52%,
            #7c3aed 100%
        );

    color: #ffffff;
}

.ai-profile {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.ai-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 43px;
    height: 43px;

    flex-shrink: 0;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;

    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.ai-avatar svg {
    width: 25px;
    height: 25px;
}

.ai-profile-info {
    min-width: 0;
}

.ai-profile-info strong {
    display: block;

    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.ai-profile-info span {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 4px;

    color: rgba(255, 255, 255, 0.82);

    font-size: 11px;
    font-weight: 500;
}

.ai-online-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #86efac;
    box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.16);
}

.close-ai-chat {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.close-ai-chat svg {
    width: 18px;
    height: 18px;
}

.close-ai-chat:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(5deg);
}


/* ========================================= */
/* INTRO AREA */
/* ========================================= */

.ai-chat-intro {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    padding: 17px 18px 8px;

    background: #ffffff;
}

.ai-intro-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border-radius: 11px;

    background: #eef2ff;
    color: #4f46e5;

    font-size: 20px;
    font-weight: 800;
}

.ai-chat-intro h3 {
    margin: 0;

    color: #111827;

    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.ai-chat-intro p {
    margin: 4px 0 0;

    color: #6b7280;

    font-size: 12px;
    line-height: 1.5;
}


/* ========================================= */
/* SUGGESTED QUESTIONS */
/* ========================================= */

.ai-suggestions {
    display: flex;
    gap: 7px;

    overflow-x: auto;

    padding: 9px 18px 13px;

    scrollbar-width: thin;
}

.ai-suggestion {
    flex-shrink: 0;

    padding: 7px 10px;

    border: 1px solid #e0e7ff;
    border-radius: 999px;

    background: #f5f7ff;
    color: #4f46e5;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.ai-suggestion:hover {
    border-color: #a5b4fc;
    background: #eef2ff;
    transform: translateY(-1px);
}


/* ========================================= */
/* MESSAGE AREA */
/* ========================================= */

.floating-ai-messages {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 15px;

    overflow-y: auto;

    padding: 18px;

    background:
        linear-gradient(
            180deg,
            #f8fafc 0%,
            #f1f5f9 100%
        );

    scrollbar-width: thin;
}

.floating-ai-message {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    max-width: 94%;

    font-size: 13px;
    line-height: 1.65;

    overflow-wrap: anywhere;
}

.message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 27px;
    height: 27px;

    flex-shrink: 0;

    border-radius: 9px;

    background: #e0e7ff;
    color: #4f46e5;

    font-size: 15px;
    font-weight: 800;
}

.message-content {
    padding: 12px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 5px 15px 15px 15px;

    background: #ffffff;
    color: #1f2937;

    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;

    display: block;

    padding: 12px 15px;

    border-radius: 15px 15px 5px 15px;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #6366f1
        );

    color: #ffffff;

    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.16);
}

.floating-ai-message h3,
.floating-ai-message h4 {
    margin: 8px 0 5px;

    color: inherit;
    font-weight: 800;
}

.floating-ai-message h3 {
    font-size: 15px;
}

.floating-ai-message h4 {
    font-size: 14px;
}

.floating-ai-message ul {
    margin: 6px 0;
    padding-left: 19px;
}

.floating-ai-message li {
    margin-bottom: 5px;
}

.floating-ai-message strong {
    font-weight: 800;
}

.loading-message {
    opacity: 0.65;
    font-style: italic;
}


/* ========================================= */
/* INPUT AREA */
/* ========================================= */

.floating-ai-form {
    padding: 12px 14px 8px;

    border-top: 1px solid #e5e7eb;

    background: #ffffff;
}

.ai-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 5px 5px 5px 13px;

    border: 1px solid #dbe2ea;
    border-radius: 15px;

    background: #f8fafc;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ai-input-wrapper:focus-within {
    border-color: #818cf8;

    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.12);
}

#floating-ai-input {
    flex: 1;
    min-width: 0;

    border: none;
    outline: none;

    padding: 9px 0;

    background: transparent;
    color: #111827;

    font-size: 13px;
}

#floating-ai-input::placeholder {
    color: #9ca3af;
}

#floating-ai-submit {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border: none;
    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #6366f1
        );

    color: #ffffff;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

#floating-ai-submit svg {
    width: 18px;
    height: 18px;
}

#floating-ai-submit:hover {
    transform: translateY(-2px);

    box-shadow:
        0 5px 12px rgba(79, 70, 229, 0.25);
}

#floating-ai-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


/* ========================================= */
/* FOOTER */
/* ========================================= */

.ai-chat-footer {
    padding: 0 15px 11px;

    background: #ffffff;

    color: #9ca3af;

    text-align: center;

    font-size: 10px;
}


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

@media (max-width: 600px) {
    .floating-ai-chat {
        right: 16px;
        bottom: 84px;

        width: calc(100vw - 32px);
        height: 570px;
        max-height: calc(100vh - 105px);

        border-radius: 21px;
    }

    .floating-ai-header {
        padding: 15px;
    }

    .ai-chat-intro {
        padding: 14px 15px 7px;
    }

    .ai-suggestions {
        padding-left: 15px;
        padding-right: 15px;
    }

    .floating-ai-messages {
        padding: 15px;
    }

    .floating-ai-message {
        max-width: 96%;
    }

    .floating-ai-form {
        padding: 10px 11px 7px;
    }
}

/* =========================================
   FLOATING AI BUTTON
========================================= */

.floating-ai-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-ai-button:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 18px 38px rgba(79, 70, 229, 0.42);
}

.floating-ai-button:active {
    transform: scale(0.96);
}

@media (max-width: 600px) {
    .floating-ai-button {
        right: 18px;
        bottom: 18px;
        width: 56px;
        height: 56px;
        font-size: 27px;
    }
}

/* ================================
   FIX: COMPLETE AI RESPONSE DISPLAY
================================ */

.floating-ai-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    height: auto;
    max-height: 420px;
    padding: 18px;
    scroll-behavior: smooth;
}

.ai-message {
    display: block;
    width: fit-content;
    max-width: 92%;
    min-width: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.65;
    padding: 12px 16px;
    border-radius: 16px;
}

.ai-message.bot-message {
    align-self: flex-start;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message.user-message {
    align-self: flex-end;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message p {
    margin: 0 0 10px;
}

.ai-message p:last-child {
    margin-bottom: 0;
}

.ai-message ul,
.ai-message ol {
    margin: 8px 0;
    padding-left: 22px;
}

.ai-message li {
    margin-bottom: 5px;
}

.ai-message h1,
.ai-message h2,
.ai-message h3,
.ai-message h4 {
    margin: 10px 0 6px;
    line-height: 1.35;
}

.ai-message code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message a {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .floating-ai-messages {
        max-height: 360px;
        padding: 12px;
    }

    .ai-message {
        max-width: 96%;
        padding: 11px 13px;
        font-size: 14px;
    }
}

/* Professional AI response formatting */

.ai-response-heading {
    margin: 16px 0 8px;
    color: #172554;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.35;
}

.ai-response-paragraph {
    margin: 0 0 12px;
    color: #263248;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.ai-response-list {
    margin: 8px 0 14px;
    padding-left: 24px;
}

.ai-response-list li {
    margin: 7px 0;
    padding-left: 4px;
    color: #263248;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ai-response-numbered {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
    color: #263248;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ai-response-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #e8edff;
    color: #3045d8;
    font-size: 13px;
    font-weight: 750;
}

.ai-response-paragraph strong,
.ai-response-list strong,
.ai-response-numbered strong {
    color: #172554;
    font-weight: 750;
}

.ai-response-paragraph code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #eef2ff;
    color: #3730a3;
    font-family: Consolas, monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .ai-response-heading {
        font-size: 16px;
    }

    .ai-response-paragraph,
    .ai-response-list li,
    .ai-response-numbered {
        font-size: 14px;
        line-height: 1.55;
    }
}

/* ============================================================
   JOBSENSE AI CHATBOT FINAL OVERRIDE
   ============================================================ */

/* Floating chatbot launcher */
.floating-ai-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99998;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #4f46e5,
        #2563eb
    );

    color: #ffffff;
    font-size: 28px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 12px 35px rgba(37, 99, 235, 0.35);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.floating-ai-button:hover {
    transform: translateY(-3px);
    box-shadow:
        0 16px 42px rgba(37, 99, 235, 0.45);
}

.floating-ai-button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
}

.floating-ai-button.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Main chatbot */
.floating-ai-chat {
    position: fixed;

    right: 24px;
    bottom: 92px;

    left: auto;
    top: auto;

    width: 520px;
    height: 680px;

    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 24px;

    box-shadow:
        0 24px 80px rgba(15, 23, 42, 0.25);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(18px);

    z-index: 99999;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

/* Open state */
.floating-ai-chat.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Maximized state
   JavaScript also applies inline position values.
*/
.floating-ai-chat.is-expanded,
.floating-ai-chat.is-maximized {
    width: min(900px, calc(100vw - 32px));
    height: min(850px, calc(100vh - 32px));

    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);

    right: auto;
    bottom: auto;

    z-index: 99999;
}

/* Chat header */
.floating-ai-header {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;
    min-height: 82px;

    padding: 18px 20px;

    background: linear-gradient(
        135deg,
        #4338ca,
        #2563eb
    );

    color: #ffffff;

    z-index: 5;
}

/* Profile section */
.ai-profile {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.ai-avatar svg {
    width: 28px;
    height: 28px;
}

.ai-profile-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ai-profile-info strong {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.ai-profile-info span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.78rem;
    line-height: 1.2;
}

.ai-online-dot {
    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 5px;

    border-radius: 50%;
    background: #86efac;
}

/* Header action buttons */
.ai-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    flex: 0 0 auto;

    position: relative;
    z-index: 20;
}

.ai-header-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 13px;

    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;

    font-size: 25px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    opacity: 1 !important;
    visibility: visible !important;

    position: relative;
    z-index: 25;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.ai-header-btn:hover {
    background: rgba(255, 255, 255, 0.27);
    transform: translateY(-1px);
}

.ai-header-btn:focus-visible {
    outline: 3px solid #bfdbfe;
    outline-offset: 3px;
}

/* Chat intro */
.ai-chat-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    flex: 0 0 auto;

    padding: 22px 22px 12px;
}

.ai-intro-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    color: #4f46e5;
    font-size: 23px;
}

.ai-chat-intro h3 {
    margin: 0 0 6px;

    color: #111827;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
}

.ai-chat-intro p {
    margin: 0;

    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.5;
}

/* Suggestions */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    flex: 0 0 auto;

    padding: 0 22px 16px;
}

.ai-suggestion {
    padding: 8px 12px;

    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 999px;

    background: #eef2ff;
    color: #3730a3;

    font-size: 0.78rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.ai-suggestion:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

.ai-suggestion:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Messages area */
.floating-ai-messages {
    min-height: 0;
    flex: 1 1 auto;

    display: flex;
    flex-direction: column;
    gap: 14px;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 12px 22px 18px;

    scroll-behavior: smooth;
}

/* Individual message */
.floating-ai-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    min-width: 0;
}

.floating-ai-message .message-content {
    min-width: 0;
    max-width: 100%;

    overflow-wrap: anywhere;
    word-break: normal;
}

/* Bot message */
.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    padding: 13px 15px;

    border-radius: 15px 15px 15px 4px;

    background: #f8fafc;
    color: #334155;

    font-size: 0.9rem;
    line-height: 1.6;
}

/* User message */
.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    max-width: 85%;

    padding: 12px 15px;

    border-radius: 15px 15px 4px 15px;

    background: linear-gradient(
        135deg,
        #4338ca,
        #2563eb
    );

    color: #ffffff;

    font-size: 0.9rem;
    line-height: 1.55;
}

/* Message avatar */
.message-avatar {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eef2ff;
    color: #4f46e5;

    font-size: 17px;
    font-weight: 800;
}

/* AI response formatting */
.ai-message-content p {
    margin: 0 0 10px;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content h3,
.ai-message-content h4 {
    margin: 14px 0 7px;

    color: #111827;
    font-weight: 800;
    line-height: 1.35;
}

.ai-message-content h3 {
    font-size: 1rem;
}

.ai-message-content h4 {
    font-size: 0.95rem;
}

.ai-message-content ul,
.ai-message-content ol {
    margin: 8px 0 10px;
    padding-left: 20px;
}

.ai-message-content li {
    margin: 4px 0;
    line-height: 1.5;
}

.ai-message-content strong {
    font-weight: 800;
}

.ai-message-content em {
    font-style: italic;
}

.ai-message-content code {
    padding: 2px 5px;

    border-radius: 5px;

    background: rgba(99, 102, 241, 0.12);
    color: #3730a3;

    font-size: 0.88em;
}

.ai-message-content pre {
    max-width: 100%;

    margin: 12px 0;
    padding: 12px;

    overflow-x: auto;

    border-radius: 10px;

    background: #111827;
    color: #f9fafb;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    font-size: 0.82rem;
    line-height: 1.5;
}

.ai-message-content pre code {
    padding: 0;

    background: transparent;
    color: inherit;
}

/* Loading dots */
.ai-loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 20px;
}

.ai-loading-dots span {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #6366f1;

    animation: jobsense-ai-bounce 1.2s infinite ease-in-out;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes jobsense-ai-bounce {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Input form */
.floating-ai-form {
    flex: 0 0 auto;

    padding: 12px 18px 8px;

    background: #ffffff;
}

.ai-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;

    padding: 7px 7px 7px 15px;

    border: 1px solid #dbe3ef;
    border-radius: 17px;

    background: #f8fafc;
}

.ai-input-wrapper input {
    min-width: 0;
    flex: 1 1 auto;

    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;
    color: #0f172a;

    font-size: 0.9rem;
}

.ai-input-wrapper input::placeholder {
    color: #94a3b8;
}

.ai-input-wrapper input:disabled {
    opacity: 0.6;
}

#floating-ai-submit {
    width: 42px;
    height: 42px;
    min-width: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 13px;

    background: #2563eb;
    color: #ffffff;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#floating-ai-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

#floating-ai-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

#floating-ai-submit svg {
    width: 22px;
    height: 22px;
}

/* Footer */
.ai-chat-footer {
    flex: 0 0 auto;

    padding: 0 18px 13px;

    background: #ffffff;
    color: #94a3b8;

    text-align: center;

    font-size: 0.68rem;
    line-height: 1.4;
}

/* Mobile layout */
@media (max-width: 640px) {
    .floating-ai-button {
        right: 16px;
        bottom: 16px;

        width: 54px;
        height: 54px;
    }

    .floating-ai-chat {
        right: 8px;
        bottom: 78px;

        width: calc(100vw - 16px);
        height: calc(100vh - 96px);

        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 96px);

        border-radius: 20px;
    }

    .floating-ai-chat.is-expanded,
    .floating-ai-chat.is-maximized {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);

        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .floating-ai-header {
        min-height: 70px;
        padding: 13px 14px;
    }

    .ai-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .ai-profile-info strong {
        font-size: 0.9rem;
    }

    .ai-profile-info span {
        font-size: 0.7rem;
    }

    .ai-header-actions {
        gap: 5px;
    }

    .ai-header-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        flex-basis: 36px;

        border-radius: 10px;
        font-size: 22px;
    }

    .ai-chat-intro {
        padding: 17px 16px 10px;
    }

    .ai-suggestions {
        padding: 0 16px 12px;
    }

    .floating-ai-messages {
        padding: 10px 16px 14px;
    }

    .floating-ai-form {
        padding: 10px 12px 6px;
    }

    .ai-chat-footer {
        padding: 0 12px 10px;
        font-size: 0.62rem;
    }
}

/* Prevent page content from interfering with chatbot */
.floating-ai-chat,
.floating-ai-chat * {
    box-sizing: border-box;
}

/* Refined chat layout: keeps the existing blue theme while improving readability. */
.ai-chat-intro {
    align-items: center;
    margin: 14px 18px 4px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.ai-intro-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 11px;
    background: #eef2ff;
}

.ai-chat-intro h3 {
    margin-bottom: 3px;
}

.floating-ai-messages {
    gap: 16px;
    padding-top: 16px;
}

.bot-message .message-content,
.user-message .message-content {
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.ai-input-wrapper {
    min-height: 56px;
    padding-left: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ai-input-wrapper:focus-within {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

#floating-ai-submit:focus-visible,
.ai-header-btn:focus-visible {
    outline: 3px solid #bfdbfe;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .ai-chat-intro {
        margin: 12px 12px 2px;
        padding: 12px;
    }
}

/* Keep chatbot controls above all chatbot content */
.floating-ai-header,
.ai-header-actions,
.ai-header-btn {
    isolation: isolate;
}

/* Authentication */
.nav-user,
.nav-auth-link {
    font: inherit;
    white-space: nowrap;
}

.nav-user {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
}

.logout-form {
    display: inline;
    margin: 0;
}

.nav-auth-link {
    border: 0;
    background: transparent;
    color: #1e40af;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.nav-auth-primary {
    padding: 8px 12px;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
}

.flash-stack {
    position: fixed;
    top: 82px;
    left: 50%;
    z-index: 100000;
    width: min(520px, calc(100vw - 32px));
    transform: translateX(-50%);
}

.flash-message {
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    font-weight: 700;
}

.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

.auth-page {
    display: grid;
    min-height: calc(100vh - 180px);
    padding: 64px 20px;
    place-items: center;
}

.auth-card {
    width: min(100%, 460px);
    padding: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.1);
}

.auth-eyebrow {
    margin: 0 0 8px;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.auth-card h1 { margin: 0; color: #0f172a; font-size: 1.75rem; }
.auth-copy { margin: 9px 0 26px; color: #64748b; line-height: 1.55; }

.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 5px; color: #334155; font-size: 0.9rem; font-weight: 700; }
.auth-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font: inherit;
}
.auth-form input:focus { border-color: #2563eb; outline: 3px solid rgba(37, 99, 235, 0.14); }
.auth-form small { color: #64748b; }

.auth-submit {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}
.auth-submit { margin-top: 14px; border: 0; background: #2563eb; color: #ffffff; cursor: pointer; }
.auth-submit:hover { background: #1d4ed8; }

.auth-switch { margin: 24px 0 0; color: #64748b; text-align: center; }
.auth-switch a { color: #2563eb; font-weight: 800; }

@media (max-width: 640px) {
    .auth-page { padding: 32px 16px; }
    .auth-card { padding: 26px 20px; }
    .nav-user { display: none; }
}

/* =========================================
   SEARCH HISTORY & EXPLAIN JOB BUTTONS
========================================= */

.ai-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0 12px;
}

.ai-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 0 16px;

    border: 1px solid transparent;
    border-radius: 12px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

/* Search History */

.history-btn {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.history-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    box-shadow: 0 5px 14px rgba(79, 70, 229, 0.16);
    transform: translateY(-2px);
}


/* Button icon */

.ai-action-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
}

/* Click effect */

.ai-action-btn:active {
    transform: scale(0.97);
}

/* Keyboard accessibility */

.ai-action-btn:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.25);
    outline-offset: 3px;
}

/* =========================================
   SEARCH HISTORY PANEL
========================================= */

.ai-history-panel {
    margin: 12px 0 16px;
    padding: 16px;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);

    animation: historyPanelOpen 0.22s ease;
}

.ai-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 14px;
}

.ai-history-header h3 {
    margin: 0;

    color: #111827;
    font-size: 17px;
    font-weight: 800;
}

.ai-history-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border: 0;
    border-radius: 9px;

    background: #f1f5f9;
    color: #475569;

    font-size: 21px;
    line-height: 1;

    cursor: pointer;
}

.ai-history-close:hover {
    background: #e2e8f0;
    color: #111827;
}

/* History item */

.history-item {
    margin-bottom: 10px;
    padding: 13px;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    background: #f8fafc;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item h4 {
    margin: 0 0 5px;

    color: #1e293b;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.history-item small {
    display: block;
    margin-bottom: 7px;

    color: #94a3b8;
    font-size: 11px;
}

.history-item p {
    margin: 0;

    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

/* Empty/loading history message */

#historyList > p {
    margin: 0;
    padding: 12px;

    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* Panel animation */

@keyframes historyPanelOpen {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }

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

/* Mobile responsive */

@media (max-width: 600px) {
    .ai-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-action-btn {
        width: 100%;
        min-height: 44px;
    }

    .ai-history-panel {
        padding: 13px;
    }

    .ai-history-header h3 {
        font-size: 16px;
    }
}

/* =========================================
   Explain This Job Button
========================================= */

.explain-job-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 40px;
    padding: 10px 16px;
    margin: 0;

    box-sizing: border-box;

    border: 1px solid transparent;
    border-radius: 10px;

    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;
    transition: all 0.25s ease;

    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.explain-job-btn:hover {
    transform: translateY(-2px);

    background: linear-gradient(135deg, #4338ca, #4f46e5);

    box-shadow: 0 7px 18px rgba(79, 70, 229, 0.35);
}

.explain-job-btn:active {
    transform: translateY(0);
}

.explain-job-btn:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.4);
    outline-offset: 3px;
}

.explain-job-btn i,
.explain-job-btn span {
    font-size: 15px;
}

/* Align with View Job and Save Job buttons */

.job-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.job-actions .view-job-btn,
.job-actions .save-job-btn,
.job-actions .explain-job-btn {
    min-height: 40px;
    margin: 0;
    box-sizing: border-box;
}

/* Mobile responsiveness */

@media (max-width: 600px) {
    .job-actions {
        width: 100%;
        gap: 8px;
    }

    .job-actions button {
        flex: 1;
    }

    .explain-job-btn {
        padding: 11px 14px;
        font-size: 14px;
    }
}

/* =================================
   SEARCH HISTORY GRID
================================= */

.history-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 45px 28px 80px;
}

.history-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 35px;
}

.section-label {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 30px;
    background: #f4eadb;
    color: #76552d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.4px;
    margin-bottom: 15px;
}

.history-header h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.1;
}

.history-header p {
    margin-top: 14px;
    color: #6b7280;
    font-size: 16px;
}

.back-home-btn,
.start-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    transition: 0.2s ease;
}

.back-home-btn:hover,
.start-search-btn:hover {
    background: #374151;
    transform: translateY(-2px);
}

/* Compact card grid */

.history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.history-card {
    min-width: 0;
    min-height: 235px;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease;
    outline: none;
}

.history-card:hover,
.history-card:focus-visible {
    transform: translateY(-5px);
    border-color: #a5b4fc;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12);
}

.history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.history-date {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.history-arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #4f46e5;
    font-weight: 800;
}

.history-question {
    display: -webkit-box;
    margin: 0 0 14px;
    color: #111827;
    font-size: 19px;
    line-height: 1.35;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.history-preview {
    display: -webkit-box;
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.history-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 20px;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 800;
}

/* Modal */

body.modal-open {
    overflow: hidden;
}

.history-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.history-modal.show {
    display: flex;
}

.history-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.history-modal-box {
    position: relative;
    z-index: 1;
    width: min(850px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: modalAppear 0.2s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 22px;
}

.modal-label {
    color: #4f46e5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.modal-header h2 {
    margin: 9px 0 7px;
    color: #111827;
    font-size: clamp(21px, 3vw, 30px);
    line-height: 1.3;
}

.modal-header p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.close-modal-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 17px;
    cursor: pointer;
    transition: 0.2s ease;
}

.close-modal-btn:hover {
    background: #e5e7eb;
}

.modal-answer {
    color: #374151;
    font-size: 15px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.modal-answer h2,
.modal-answer h3,
.modal-answer h4 {
    margin: 22px 0 10px;
    color: #111827;
    line-height: 1.35;
}

.modal-answer h2:first-child,
.modal-answer h3:first-child,
.modal-answer h4:first-child {
    margin-top: 0;
}

.modal-answer strong {
    color: #111827;
    font-weight: 800;
}

/* Loading and empty states */

.history-loading,
.empty-history,
.history-error {
    grid-column: 1 / -1;
    padding: 55px 20px;
    text-align: center;
    border: 1px dashed #d1d5db;
    border-radius: 18px;
    color: #6b7280;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-history h3,
.history-error h3 {
    color: #111827;
    margin-bottom: 8px;
}

.empty-history p,
.history-error p {
    margin-bottom: 20px;
}

/* Responsive */

@media (max-width: 950px) {
    .history-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .history-page {
        padding: 32px 16px 55px;
    }

    .history-header {
        align-items: stretch;
        flex-direction: column;
    }

    .back-home-btn {
        width: 100%;
    }

    .history-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .history-card {
        min-height: 210px;
    }

    .history-modal {
        padding: 12px;
    }

    .history-modal-box {
        padding: 22px;
        max-height: 92vh;
        border-radius: 17px;
    }
}

.history-answer {
    padding: 20px 22px;
    border-radius: 16px;
    background: #f8fafc;
    color: #374151;
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.history-answer h2,
.history-answer h3,
.history-answer h4 {
    color: #111827;
    line-height: 1.35;
}

.history-answer h2 {
    margin: 4px 0 12px;
    font-size: 24px;
}

.history-answer h3 {
    margin: 18px 0 7px;
    font-size: 19px;
}

.history-answer h4 {
    margin: 14px 0 6px;
    font-size: 17px;
}

.history-answer p {
    margin: 5px 0;
}

.history-answer ul {
    margin: 6px 0 12px;
    padding-left: 22px;
}

.history-answer li {
    margin: 3px 0;
}

.history-answer br {
    line-height: 1.2;
}

/* ================================
   FLOATING CHATBOT ANSWER FORMAT
================================ */

.ai-message,
.chatbot-message,
.ai-response {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.55;
    font-size: 14px;
}

.ai-message h2,
.chatbot-message h2,
.ai-response h2 {
    margin: 4px 0 10px;
    font-size: 20px;
    line-height: 1.3;
    color: #111827;
}

.ai-message h3,
.chatbot-message h3,
.ai-response h3 {
    margin: 15px 0 7px;
    font-size: 17px;
    line-height: 1.35;
    color: #111827;
}

.ai-message h4,
.chatbot-message h4,
.ai-response h4 {
    margin: 12px 0 5px;
    font-size: 15px;
    line-height: 1.35;
    color: #111827;
}

.ai-message p,
.chatbot-message p,
.ai-response p {
    margin: 4px 0;
}

.ai-message ul,
.chatbot-message ul,
.ai-response ul {
    margin: 6px 0 10px;
    padding-left: 20px;
}

.ai-message li,
.chatbot-message li,
.ai-response li {
    margin: 2px 0;
}

.ai-message strong,
.chatbot-message strong,
.ai-response strong {
    color: #111827;
    font-weight: 800;
}

.ai-message br,
.chatbot-message br,
.ai-response br {
    line-height: 1.1;
}

/* =================================
   RESUME ANALYZER
================================= */

.resume-analyzer-section {
    display: block;
    width: 100%;
    padding: 80px 0;
    margin: 0;
    background: #f5f7fb;
    color: #1f2937;
    position: relative;
    z-index: 1;
}

.resume-analyzer-card {
    display: block;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.resume-analyzer-heading {
    margin-bottom: 24px;
}

.resume-analyzer-heading h2 {
    margin: 12px 0;
    font-size: 32px;
    color: #111827;
}

.resume-analyzer-heading p {
    color: #6b7280;
}

.resume-analyzer-section form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.resume-analyzer-section input[type="file"] {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
}

.resume-analyzer-section button {
    display: inline-block;
    width: fit-content;
    padding: 13px 22px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

.resume-analyzer-section button:hover {
    background: #1d4ed8;
}

.resume-upload-status {
    margin-top: 16px;
    color: #2563eb;
}

#resumeResults {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

#resumeSkills {
    padding-left: 20px;
}

#resumeText {
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 16px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #1f2937;
}

/* Mobile layout */
@media (max-width: 768px) {
    .resume-analyzer-section {
        padding: 45px 16px;
    }

    .resume-analyzer-card {
        padding: 22px;
    }

    .resume-analyzer-heading h2 {
        font-size: 26px;
    }
}

.resume-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.resume-ai-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.resume-ai-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.resume-status {
    margin-top: 12px;
    font-weight: 600;
}

.resume-status.loading {
    color: #d97706;
}

.resume-status.success {
    color: #16a34a;
}

.resume-status.error {
    color: #dc2626;
}

/* =========================================================
   JOBSENSE DASHBOARD
   Complete dashboard layout + responsive styling
========================================================= */

.db-wrap {
    width: 100%;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 15% 5%,
            rgba(249, 115, 22, 0.07),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #fffdf8 0%,
            #f6f4ef 100%
        );
    color: var(--text);
}

/* =========================================================
   DASHBOARD HERO
========================================================= */

.db-hero {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    background:
        linear-gradient(
            135deg,
            #fffaf3 0%,
            #fff7ed 52%,
            #fef3e8 100%
        );
    border-bottom: 1px solid var(--border);
}

.db-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.db-hero-bg::before {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    top: -230px;
    right: -80px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.09);
}

.db-hero-bg::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: 43%;
    bottom: -190px;
    border-radius: 50%;
    background: rgba(251, 146, 60, 0.07);
}

.db-hero-inner {
    position: relative;
    z-index: 1;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    padding-top: 55px;
    padding-bottom: 55px;
}

.db-hero-left {
    max-width: 700px;
}

.db-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0;
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    line-height: 1.2;
}

.db-hero-title {
    margin: 15px 0 0;
    color: var(--text);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: -0.07em;
}

.db-hero-name {
    color: var(--accent);
}

.db-hero-sub {
    max-width: 600px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.db-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.db-btn-primary,
.db-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.db-btn-primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.18);
}

.db-btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(249, 115, 22, 0.25);
}

.db-btn-primary svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}

.db-btn-secondary {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

.db-btn-secondary:hover {
    background: #fff7ed;
    transform: translateY(-2px);
}

/* =========================================================
   AVATAR
========================================================= */

.db-hero-avatar-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-avatar-ring {
    width: 174px;
    height: 174px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(249, 115, 22, 0.24);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
    box-shadow:
        0 0 0 14px rgba(249, 115, 22, 0.045),
        0 18px 45px rgba(31, 41, 55, 0.09);
}

.db-avatar {
    width: 118px;
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--text);
    color: #ffffff;
    font-size: 3.1rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 12px 30px rgba(23, 32, 42, 0.18);
}

.db-avatar-badge {
    position: absolute;
    right: 2px;
    bottom: 25px;
    padding: 8px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 7px 18px rgba(22, 101, 52, 0.1);
}

/* =========================================================
   STATS BAR
========================================================= */

.db-stats-bar {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: -32px;
}

.db-stat-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 92px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
}

.db-stat-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
}

.db-stat-icon svg {
    width: 23px !important;
    height: 23px !important;
    max-width: 23px !important;
    max-height: 23px !important;
    display: block;
}

.db-stat-icon--orange {
    background: #fff7ed;
    color: #ea580c;
}

.db-stat-icon--blue {
    background: #eff6ff;
    color: #2563eb;
}

.db-stat-icon--green {
    background: #f0fdf4;
    color: #16a34a;
}

.db-stat-icon--purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.db-stat-body {
    min-width: 0;
}

.db-stat-value {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-stat-name {
    font-size: 1rem;
}

.db-stat-ready {
    color: #15803d;
}

.db-stat-label {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   MAIN DASHBOARD GRID
========================================================= */

.db-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 24px;
    padding-top: 30px;
    padding-bottom: 75px;
}

.db-col-main,
.db-col-aside {
    min-width: 0;
}

.db-col-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.db-col-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =========================================================
   PANELS
========================================================= */

.db-panel {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(31, 41, 55, 0.055);
}

.db-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

.db-panel-title {
    margin: 7px 0 0;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.035em;
}

.db-link-arrow {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.db-link-arrow:hover {
    color: #9a3412;
}

/* =========================================================
   QUICK ACTIONS
========================================================= */

.db-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.db-action-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-height: 112px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.db-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.1);
}

.db-action-card--orange:hover {
    border-color: #fdba74;
}

.db-action-card--blue:hover {
    border-color: #93c5fd;
}

.db-action-card--green:hover {
    border-color: #86efac;
}

.db-action-card--purple:hover {
    border-color: #c4b5fd;
}

.db-action-icon {
    width: 43px;
    height: 43px;
    min-width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.db-action-icon svg {
    width: 21px !important;
    height: 21px !important;
    max-width: 21px !important;
    max-height: 21px !important;
    display: block;
}

.db-action-card--orange .db-action-icon {
    background: #fff7ed;
    color: #ea580c;
}

.db-action-card--blue .db-action-icon {
    background: #eff6ff;
    color: #2563eb;
}

.db-action-card--green .db-action-icon {
    background: #f0fdf4;
    color: #16a34a;
}

.db-action-card--purple .db-action-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.db-action-body {
    min-width: 0;
}

.db-action-body h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.3;
}

.db-action-body p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.db-action-arrow {
    color: #94a3b8;
    font-size: 17px;
    font-weight: 800;
}

/* =========================================================
   RESUME PANEL
========================================================= */

.db-resume-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.db-resume-file {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #f8fafc;
}

.db-resume-file-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 20px;
}

.db-resume-file strong {
    display: block;
    overflow-wrap: anywhere;
    color: #172033;
    font-size: 14px;
    font-weight: 750;
}

.db-resume-file span {
    display: block;
    margin-top: 4px;
    color: #7b8495;
    font-size: 12px;
}

.db-resume-skills-label {
    margin: 0 0 10px;
    color: #687386;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.db-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.db-skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   SAVED JOBS
========================================================= */

.db-saved-jobs-list {
    display: flex;
    flex-direction: column;
}

.db-saved-job-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid #eeeae2;
}

.db-saved-job-item:first-child {
    padding-top: 0;
}

.db-saved-job-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.db-saved-job-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 19px;
}

.db-saved-job-info {
    min-width: 0;
}

.db-saved-job-title {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-saved-job-company {
    margin: 4px 0 0;
    overflow: hidden;
    color: #475569;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-saved-job-location {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-saved-job-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.db-saved-job-view:hover {
    background: #ffedd5;
}

/* =========================================================
   AI HISTORY
========================================================= */

.db-history-list {
    display: flex;
    flex-direction: column;
}

.db-history-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 13px;
    min-width: 0;
}

.db-history-dot-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}

.db-history-dot {
    position: relative;
    z-index: 2;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px #fff7ed;
}

.db-history-line {
    position: absolute;
    top: 15px;
    bottom: -2px;
    width: 1px;
    background: #e5e7eb;
}

.db-history-body {
    min-width: 0;
    padding-bottom: 22px;
}

.db-history-item:last-child .db-history-body {
    padding-bottom: 0;
}

.db-history-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.db-history-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.db-history-time {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 650;
}

.db-history-question {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.db-history-answer {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* =========================================================
   EMPTY STATES
========================================================= */

.db-empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 32px 20px;
    border: 1px dashed #d6d3d1;
    border-radius: 14px;
    background: #fffdf9;
    text-align: center;
}

.db-empty-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 13px;
    background: #fff7ed;
    color: var(--accent);
    font-size: 20px;
}

.db-empty-state strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

.db-empty-state > span {
    max-width: 440px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.db-empty-cta {
    margin-top: 16px;
}

/* =========================================================
   PROFILE CARD
========================================================= */

.db-profile-card {
    padding: 24px;
}

.db-profile-avatar-sm {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    border-radius: 17px;
    background: var(--text);
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 9px 22px rgba(23, 32, 42, 0.14);
}

.db-profile-name {
    margin: 13px 0 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.db-profile-email {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.db-divider {
    height: 1px;
    margin: 19px 0;
    border: 0;
    background: #eeeae2;
}

.db-profile-dl {
    margin: 0;
}

.db-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 7px 0;
}

.db-profile-row dt {
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}

.db-profile-row dd {
    margin: 0;
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    text-align: right;
}

.db-status-pill {
    color: #15803d !important;
}

.db-profile-link {
    margin-top: 13px;
}

/* =========================================================
   CAREER TIPS
========================================================= */

.db-tips-panel .db-panel-title {
    margin-bottom: 18px;
}

.db-tips-list {
    display: flex;
    flex-direction: column;
    gap: 17px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.db-tip-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
}

.db-tip-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 900;
}

.db-tip-num--orange {
    background: #fff7ed;
    color: #ea580c;
}

.db-tip-num--blue {
    background: #eff6ff;
    color: #2563eb;
}

.db-tip-num--green {
    background: #f0fdf4;
    color: #16a34a;
}

.db-tip-item strong {
    display: block;
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
}

.db-tip-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

/* =========================================================
   AI QUICK PANEL
========================================================= */

.db-ai-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            145deg,
            #172554 0%,
            #1e1b4b 100%
        );
    border-color: #312e81;
}

.db-ai-panel .db-panel-title {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    color: #ffffff;
}

.db-ai-sparkle {
    position: absolute;
    top: -17px;
    right: 18px;
    color: rgba(255, 255, 255, 0.08);
    font-size: 100px;
    line-height: 1;
}

.db-ai-sub {
    position: relative;
    z-index: 1;
    margin: 11px 0 18px;
    color: #c7d2fe;
    font-size: 11px;
    line-height: 1.65;
}

.db-btn-full {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 1050px) {
    .db-main-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .db-stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .db-hero-inner {
        gap: 35px;
    }
}

/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 800px) {
    .db-hero {
        min-height: auto;
    }

    .db-hero-inner {
        min-height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding-top: 48px;
        padding-bottom: 120px;
    }

    .db-hero-avatar-wrap {
        position: absolute;
        right: 25px;
        bottom: 22px;
        width: 105px;
        height: 105px;
        flex-basis: 105px;
    }

    .db-avatar-ring {
        width: 90px;
        height: 90px;
        box-shadow:
            0 0 0 8px rgba(249, 115, 22, 0.045),
            0 10px 25px rgba(31, 41, 55, 0.09);
    }

    .db-avatar {
        width: 62px;
        height: 62px;
        font-size: 1.7rem;
    }

    .db-avatar-badge {
        right: -4px;
        bottom: 0;
        padding: 5px 8px;
        font-size: 8px;
    }

    .db-main-grid {
        grid-template-columns: 1fr;
    }

    .db-col-aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 600px) {
    .db-main-grid {
        width: calc(100% - 26px);
        padding-top: 20px;
        padding-bottom: 50px;
    }

    .db-stats-bar {
        width: calc(100% - 26px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin-top: -25px;
    }

    .db-stat-card {
        min-height: 78px;
        gap: 9px;
        padding: 11px;
        border-radius: 12px;
    }

    .db-stat-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 10px;
    }

    .db-stat-icon svg {
        width: 18px !important;
        height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
    }

    .db-stat-value {
        font-size: 0.9rem;
    }

    .db-stat-label {
        font-size: 9px;
    }

    .db-hero-title {
        font-size: 2.65rem;
    }

    .db-hero-sub {
        max-width: calc(100% - 25px);
        font-size: 0.9rem;
    }

    .db-hero-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .db-btn-primary,
    .db-btn-secondary {
        width: 100%;
    }

    .db-panel {
        padding: 19px;
        border-radius: 15px;
    }

    .db-panel-header {
        gap: 12px;
    }

    .db-panel-title {
        font-size: 1.18rem;
    }

    .db-action-grid {
        grid-template-columns: 1fr;
    }

    .db-action-card {
        min-height: 92px;
    }

    .db-col-aside {
        display: flex;
    }

    .db-saved-job-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .db-saved-job-view {
        grid-column: 2;
        width: fit-content;
    }

    .db-history-question {
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .db-stats-bar {
        grid-template-columns: 1fr;
    }

    .db-stat-card {
        min-height: 70px;
    }

    .db-hero-title {
        font-size: 2.35rem;
    }

    .db-hero-avatar-wrap {
        right: 15px;
    }
}

/* =========================================================
   DASHBOARD SVG FINAL SAFETY
========================================================= */

.db-wrap svg {
    max-width: 100%;
}

.db-action-icon svg,
.db-stat-icon svg,
.db-btn-primary svg {
    display: block;
    overflow: visible;
}
