:root {
    /* Light theme. Surfaces are white on a soft lavender page plane; indigo is
       the accent and the single data-mark hue. Ink/mark colors were checked for
       WCAG contrast against #fff (accent 6.29:1, pay 7.61:1, secondary 7.94:1). */
    --bg-color: #f5f7ff;                 /* page plane + inset field wells */
    --card-bg: #ffffff;
    --panel-bg: #ffffff;
    --surface: #ffffff;
    --border-color: #e6e9f5;
    --border-soft: #eef1fa;
    --text-primary: #1e1b4b;
    --text-secondary: #5b6478;
    --text-muted: #8b93a7;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-ink: #4338ca;
    --accent-soft: #eef2ff;
    --success: #0f7a43;
    --pay: #0f7a43;                      /* salary green */
    --pay-bg: #e7f8ef;
    --gold-ink: #8a6116;                 /* sponsored text */
    --gold-bg: #fdf3dd;
    --heart: #e0407f;
    --warning: #b0810f;
    --danger: #d03b3b;
    --glass: rgba(79, 70, 229, 0.06);    /* hover wash */
    --shadow: 0 1px 2px rgba(30, 27, 75, 0.04), 0 8px 24px rgba(30, 27, 75, 0.06);
    --shadow-lift: 0 2px 4px rgba(30, 27, 75, 0.05), 0 14px 32px rgba(30, 27, 75, 0.10);
    --container: 1120px;
    --nav-height: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }

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

/* ---------- Top navigation ---------- */
.topnav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(245, 247, 255, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { color: var(--accent-ink); background: var(--accent-soft); }
/* :not(.nav-cta) — on /hiring the CTA carries .active too, and this rule's
   higher specificity would paint it white against its own white text. */
.nav-links a.active:not(.nav-cta) { color: var(--text-primary); background: var(--surface); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Page shell ---------- */
main {
    flex: 1;
    width: 100%;
    padding: 32px 0 48px;
}

.page-head { margin-bottom: 24px; }
.page-head h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.page-sub {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 640px;
}

/* ---------- Toolbar (jobs page) ---------- */
.toolbar {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.search-controls {
    display: flex;
    gap: 12px;
    width: 100%;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: flex-end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

input[type="text"] {
    flex: 1;
    min-width: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

select {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover { background: #f7f9ff; border-color: #c7cdf0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.btn-link:hover { color: var(--accent); }

/* ---------- Status row ---------- */
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.status-row .left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-row .right { display: flex; align-items: center; gap: 14px; }

.match-count { color: var(--accent); font-weight: 600; }

.mode-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
}
.mode-badge.live { color: var(--pay); border-color: var(--success); background: var(--pay-bg); }

.freshness { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.freshness .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-secondary);
}
.freshness .dot.ok { background: var(--pay); box-shadow: 0 0 6px rgba(15, 122, 67, 0.22); }
.freshness .dot.stale { background: var(--warning); }
.freshness .dot.err { background: var(--danger); }

/* ---------- Job feed ---------- */
.job-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    align-content: start;
}

.job-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.job-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
    border-left-color: var(--accent);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.job-title { font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.job-company { font-size: 0.9rem; color: var(--text-secondary); margin-top: 2px; }
.job-salary { font-size: 0.9rem; font-weight: 600; color: var(--pay); margin-top: 4px; }

.badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tag {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f4f6fb;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}
.tag-new { background: var(--pay-bg); border-color: var(--success); color: var(--pay); }
.tag-match { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.job-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Single row at every width: "Your listing?" hugs the left, the CTA is
       pinned bottom-right by margin-left:auto — which holds even on cards that
       have no claim link (direct postings), where space-between would fail. */
    flex-wrap: nowrap;
}
.job-cta { color: var(--accent); font-size: 0.8rem; font-weight: 600; white-space: nowrap; margin-left: auto; }

/* ---------- States: skeleton / empty / error ---------- */
.feed-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 24px;
    color: var(--text-secondary);
}
.feed-message h3 { color: var(--text-primary); margin-bottom: 8px; font-size: 1.1rem; }
.feed-message.error h3 { color: var(--danger); }
.feed-message p { max-width: 520px; margin: 0 auto 8px; }

.skeleton {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#eef1fa 25%,#f8faff 50%,#eef1fa 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; }
.sk-line.w90 { width: 90%; }
.sk-line.tall { height: 22px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -3px;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Utilities directory page ---------- */
.directory-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 640px;
    margin-bottom: 24px;
}

.utility-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
}

.utility-group {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.utility-group h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.utility-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background 0.15s;
}
.utility-item:hover { background: var(--glass); color: var(--accent); }
.utility-item .icon { font-size: 0.8rem; color: var(--text-secondary); }
.utility-name { display: inline-flex; align-items: center; gap: 8px; }
.util-badge {
    font-size: 0.68rem; font-weight: 600; white-space: nowrap;
    color: var(--pay); background: var(--pay-bg);
    border: 1px solid rgba(15, 122, 67, 0.35); border-radius: 999px; padding: 1px 8px;
}

/* ---------- Trends placeholder ---------- */
.coming-soon {
    text-align: center;
    padding: 72px 24px;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
}
.coming-soon .big { font-size: 2.4rem; margin-bottom: 12px; }
.coming-soon h1 { font-size: 1.5rem; margin-bottom: 10px; }
.coming-soon p { color: var(--text-secondary); max-width: 520px; margin: 0 auto 8px; }

/* ---------- Trends page ---------- */
.trend-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-bg);
}
.toggle-group button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border-right: 1px solid var(--border-color);
    transition: background 0.15s, color 0.15s;
}
.toggle-group button:last-child { border-right: none; }
.toggle-group button:hover { color: var(--text-primary); background: var(--glass); }
.toggle-group button.active { background: var(--accent-soft); color: var(--accent); }

.trend-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 16px;
    min-height: 1em;
}

.chart-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 18px 14px;
    margin-bottom: 20px;
}
.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.chart-sub { font-size: 0.75rem; font-weight: 400; color: var(--text-secondary); }

.trend-svg { width: 100%; height: auto; display: block; }
.trend-svg .grid { stroke: var(--border-color); stroke-width: 1; }
.trend-svg .axis { fill: var(--text-secondary); font-size: 11px; }
.trend-svg .axis.y { text-anchor: end; }
.trend-svg .axis.x { text-anchor: middle; }

.chart-empty { color: var(--text-secondary); text-align: center; padding: 40px 0; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.site-footer .container {
    padding-top: 20px;
    padding-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal h2 { font-size: 1.25rem; }
.modal-text { font-size: 0.9rem; color: var(--text-secondary); }
.modal-actions { display: flex; gap: 12px; }

.status-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.status-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
}
.status-item .dot { width: 9px; height: 9px; border-radius: 50%; }
.status-item .dot.ok { background: var(--pay); }
.status-item .dot.stale { background: var(--warning); }
.status-item .dot.err { background: var(--danger); }
.status-name { color: var(--text-primary); }
.status-detail { color: var(--text-secondary); font-size: 0.78rem; text-align: right; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    /* The nav is a single non-wrapping row on desktop. On a phone the five
       links can't fit beside the brand: they used to be squeezed until the
       label text was clipped away entirely, and "Post a job — $49" broke
       across three lines. Let the bar grow to a second row instead. */
    .nav-inner {
        padding: 8px 16px;
        height: auto;
        min-height: var(--nav-height);
        flex-wrap: wrap;
        gap: 6px 12px;
    }
    .brand { font-size: 0.95rem; order: 1; }
    /* Flatten the link wrapper so its children become items of .nav-inner and
       can be ordered independently: brand + the paid CTA share the first row,
       the section links wrap onto the second. */
    .nav-links { display: contents; }
    .nav-links a {
        padding: 7px 10px;
        font-size: 0.85rem;
        white-space: nowrap; /* keep each label (incl. the CTA price) on one line */
        order: 3;
    }
    /* Section links become outlined pills on their own row — bigger tap targets,
       and the row scrolls sideways rather than re-crowding as links are added. */
    .nav-links a:not(.nav-cta) {
        background: var(--surface);
        border: 1px solid var(--border-color);
        box-shadow: none;
    }
    .nav-links a.active:not(.nav-cta) { border-color: var(--accent); color: var(--accent-ink); }
    .nav-links a.nav-cta { order: 2; margin-left: auto; }
    .container { padding: 0 16px; }
    .search-controls { flex-direction: column; }
    .job-feed { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 1.35rem; }
    /* (Hero left-alignment lives at the end of the file — it has to come after
       the .hero-head base rule to win the cascade at equal specificity.) */
}

/* ---------- Membership portal (/account) ---------- */
.portal-hero { text-align: center; padding: 40px 0 8px; }
.portal-hero h1 { font-size: 1.8rem; margin-bottom: 10px; }
.portal-hero p { color: var(--text-secondary); max-width: 560px; margin: 0 auto 20px; }
.portal-hero .eyebrow { display: block; margin-bottom: 8px; color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; }

.signin-card {
    max-width: 620px; margin: 0 auto 32px; background: var(--panel-bg);
    border: 1px solid var(--border-color); border-radius: 12px; padding: 24px;
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--bg-color); border-radius: 10px; }
.auth-tab { padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; font-weight: 600; }
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active { color: var(--text-primary); background: var(--panel-bg); box-shadow: 0 0 0 1px var(--border-color); }
[hidden] { display: none !important; }
.auth-error { margin-bottom: 16px; padding: 10px 12px; border: 1px solid rgba(208, 59, 59, 0.35); border-radius: 8px; color: var(--danger); font-size: 0.85rem; }
.signup-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.signup-heading h2 { font-size: 1.15rem; margin-bottom: 3px; }
.signup-heading p { color: var(--text-secondary); font-size: 0.85rem; }
.plan-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.plan-choice { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 13px;
    background: var(--bg-color); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 9px; cursor: pointer; font-family: inherit; }
.plan-choice span { color: var(--text-secondary); font-size: 0.8rem; }
.plan-choice:hover { border-color: var(--text-secondary); }
.plan-choice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.signin-card form label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; }
.email-entry { display: flex; gap: 8px; }
.signin-card input[type="email"] {
    flex: 1; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 10px 12px; color: var(--text-primary); font-size: 0.95rem;
}
.signin-card input[type="email"]:focus { outline: 2px solid rgba(79, 70, 229, 0.35); border-color: var(--accent); }
.signin-card button:disabled { opacity: 0.65; cursor: wait; }
.signin-note { margin-top: 12px; font-size: 0.83rem; color: var(--text-secondary); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-secondary); font-size: 0.78rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border-color); }
.google-auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px 14px;
    border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: #202124; cursor: pointer; font: inherit; font-weight: 600; }
.google-auth-btn:hover { background: #f8f9fa; border-color: #9aa0a6; }
.google-auth-btn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.premium-intent { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
    padding: 10px 14px; border: 1px solid var(--accent); background: var(--accent-soft);
    border-radius: 8px; font-size: 0.85rem; color: var(--text-primary); }
.premium-intent button { flex: 0 0 auto; background: none; border: none; color: var(--text-secondary);
    text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.8rem; }
.premium-intent button:hover { color: var(--text-primary); }
.dev-link { margin-top: 12px; padding: 10px; border: 1px dashed var(--warning); border-radius: 8px;
    font-size: 0.83rem; word-break: break-all; }
.dev-link a { color: var(--accent); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 40px; }
.plan-card { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; text-align: left; }
.plan-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card h3 { margin-bottom: 4px; }
.plan-price { color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.plan-card ul { list-style: none; }
.plan-card li { padding: 4px 0 4px 22px; position: relative; font-size: 0.88rem; color: var(--text-secondary); }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--success); }
.plan-signup-btn { width: 100%; margin-top: 16px; }

.portal-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
#tab-content { min-width: 0; }
.portal-nav { position: sticky; top: calc(var(--nav-height) + 20px); display: flex; flex-direction: column; gap: 2px; }
.portal-nav button {
    text-align: left; background: none; border: none; color: var(--text-secondary);
    padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-family: inherit;
}
.portal-nav button:hover { color: var(--text-primary); background: var(--glass); }
.portal-nav button.active { color: #fff; background: var(--accent); font-weight: 600; }

.panel { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 4px; }
.panel .sub { color: var(--text-secondary); font-size: 0.87rem; margin-bottom: 16px; }
.panel table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.panel th { text-align: left; color: var(--text-secondary); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border-color); }
.panel td { padding: 7px 8px; border-bottom: 1px solid var(--border-soft); }
.panel tr:last-child td { border-bottom: none; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.form-grid label, .form-col label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-secondary); }
.form-grid input, .form-grid select, .form-col input, .form-col textarea, .form-col select {
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px;
    padding: 8px 10px; color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
}
.form-col { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.form-col select { width: 100%; min-width: 0; }
.form-col textarea { min-height: 120px; resize: vertical; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
    border: 1px solid var(--border-color); color: var(--text-secondary); }
.pill.green { color: var(--pay); border-color: rgba(15, 122, 67, 0.35); }
.pill.gold { color: var(--warning); border-color: #e8c98a; }
.pill.blue { color: var(--accent); border-color: var(--accent); }
.pill.red { color: var(--danger); border-color: rgba(208, 59, 59, 0.35); }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kanban-col { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px; min-height: 120px; }
.kanban-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 8px; }
.kanban-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 0.83rem; }
.kanban-card .kc-title { font-weight: 600; }
.kanban-card .kc-company { color: var(--text-secondary); font-size: 0.78rem; margin-bottom: 6px; }
.kanban-card .kc-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.kanban-card .kc-actions button { background: var(--glass); border: 1px solid var(--border-color); color: var(--text-secondary);
    border-radius: 6px; padding: 1px 7px; font-size: 0.75rem; cursor: pointer; }
.kanban-card .kc-actions button:hover { color: var(--text-primary); }
.kc-reminder { color: var(--warning); font-size: 0.75rem; margin: 4px 0; }

.usage-bar { height: 8px; background: var(--bg-color); border-radius: 6px; overflow: hidden; margin: 6px 0 4px; border: 1px solid var(--border-color); }
.usage-bar > div { height: 100%; background: var(--accent); }

.ai-result { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px;
    margin-top: 14px; font-size: 0.9rem; line-height: 1.6; overflow-x: auto; }
/* mdLite now emits real block elements, so structure comes from HTML (which also
   survives Word/PDF export) rather than white-space:pre-wrap. */
.ai-result p { margin: 0 0 10px; }
.ai-result p:last-child { margin-bottom: 0; }
.ai-result h3, .ai-result h4, .ai-result h5, .ai-result h6 { margin: 16px 0 7px; line-height: 1.3; }
.ai-result h3 { font-size: 1.08rem; }
.ai-result h4 { font-size: 1rem; }
.ai-result h5, .ai-result h6 { font-size: 0.92rem; }
.ai-result ul, .ai-result ol { margin: 0 0 10px; padding-left: 22px; }
.ai-result li { margin-bottom: 4px; }
.ai-result hr { border: 0; border-top: 1px solid var(--border-color); margin: 14px 0; }
.ai-result table { border-collapse: collapse; margin: 4px 0 12px; font-size: 0.86rem; }
.ai-result th, .ai-result td { border: 1px solid var(--border-color); padding: 6px 10px; text-align: left; vertical-align: top; }
.ai-result th { background: var(--accent-soft); color: var(--accent-ink); }
.ai-result code { background: var(--accent-soft); border-radius: 4px; padding: 1px 5px; font-size: 0.86em; }

.upsell { border: 1px solid var(--accent); background: var(--accent-soft);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; font-size: 0.9rem; }
.upsell a { color: var(--accent); font-weight: 600; }

.access-note { margin: 0 0 14px; padding: 10px 14px; border: 1px solid #e8c98a;
    background: var(--gold-bg); border-radius: 10px; font-size: 0.85rem; }
.access-note a { color: var(--accent); font-weight: 600; }

.tag-sponsored { background: var(--gold-bg); color: var(--gold-ink); border: 1px solid #e8c98a; }
.tag-claimed { background: var(--pay-bg); color: var(--pay); }
.job-card.sponsored-card {
    border-color: #e8a33d;
    box-shadow: 0 0 0 1px rgba(232, 163, 61, 0.30), 0 0 18px rgba(232, 163, 61, 0.10);
}
.job-card.sponsored-card:hover { border-color: var(--gold-ink); }

.claim-link {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-decoration: underline dotted;
    white-space: nowrap;
    cursor: pointer;
}
.claim-link:hover { color: var(--accent); }

/* ---------- Save/heart bubble on job cards (E2) ----------
   Sits top-right in the badge row, where the (redundant) state tag used to be.
   Round rather than pill-shaped so it reads as an action, not another label. */
.save-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    /* Comfortable thumb target, and kept clear of the tags stacked beneath it. */
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.save-bubble:hover { color: var(--heart); border-color: var(--heart); }
.save-bubble.saved {
    color: var(--heart);
    border-color: var(--heart);
    background: #fff5f9;
}
.save-bubble.is-busy { opacity: 0.5; pointer-events: none; }
.save-bubble:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


/* Save confirmation. Fixed to the bottom on phones (thumb-height, clear of the
   card you just tapped) and floating bottom-right on wider screens. */
.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(8px);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: min(92vw, 420px);
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 12px 32px rgba(30, 27, 75, 0.16);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast a { color: var(--accent); font-weight: 600; white-space: nowrap; }

@media (min-width: 720px) {
    .toast { left: auto; right: 24px; transform: translateY(8px); }
    .toast.show { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .toast { transition: opacity 0.18s ease; transform: translateX(-50%); }
    .toast.show { transform: translateX(-50%); }
}

/* ---------- Saved jobs tab (/account#saved) ---------- */
/* Cards reuse .job-card/.job-feed from the main board; the title is a link
   here rather than the whole card being one, so it inherits its colour. */
.job-title a { color: inherit; text-decoration: none; }
.job-title a:hover { color: var(--accent); }
.saved-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.saved-actions select { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }
.saved-actions button.claim-link {
    background: none;
    border: none;
    padding: 0;
    margin-right: 0;
    font-family: inherit;
    font-size: 0.75rem;
}

/* ---------- Nav CTA + /hiring landing ---------- */
.nav-cta {
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.nav-cta:hover { background: var(--accent-hover) !important; color: #fff; }
/* The price rides as its own chip so it reads as a tag rather than a dangling
   number — and it never breaks onto a second line on narrow screens. */
.nav-cta .price {
    /* Darkens rather than lightens the accent: a white 0.22 wash composited to
       #766feb, leaving the white label at 4.00:1 — under AA for text this size.
       This lands at 8.28:1 and still reads as a distinct chip. */
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.hiring-hero { text-align: center; padding: 44px 0 10px; }
.hiring-hero h1 { font-size: 2rem; margin-bottom: 12px; }
.hiring-hero h1 em { color: var(--gold-ink); font-style: normal; }
.hiring-hero p { color: var(--text-secondary); max-width: 620px; margin: 0 auto 18px; }

.price-card {
    max-width: 560px; margin: 20px auto 30px; background: var(--panel-bg);
    border: 1px solid #e8c98a; border-radius: 14px; padding: 24px; text-align: left;
    box-shadow: 0 0 0 1px rgba(232, 163, 61, 0.22);
}
.price-card .price-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.price-card .price { font-size: 2rem; font-weight: 700; color: var(--gold-ink); }
.price-card .per { color: var(--text-secondary); }
.price-card ul { list-style: none; }
.price-card li { padding: 5px 0 5px 24px; position: relative; color: var(--text-secondary); font-size: 0.92rem; }
.price-card li::before { content: "★"; position: absolute; left: 0; color: var(--gold-ink); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 8px 0 32px; }
.step { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; }
.step .n { color: var(--gold-ink); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; }
.step h3 { font-size: 0.98rem; margin: 6px 0 4px; }
.step p { color: var(--text-secondary); font-size: 0.85rem; }

.inline-msg { font-size: 0.85rem; margin-top: 8px; }
.inline-msg.err { color: var(--danger); }
.inline-msg.ok { color: var(--pay); }

.key-once { border: 1px dashed var(--success); border-radius: 8px; padding: 10px; margin-top: 10px;
    font-family: ui-monospace, monospace; font-size: 0.83rem; word-break: break-all; }

@media (max-width: 760px) {
    .portal-layout { grid-template-columns: 1fr; }
    .portal-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .kanban { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

@media (max-width: 560px) {
    .signin-card { padding: 18px; }
    .plan-picker, .email-entry { grid-template-columns: 1fr; }
    .email-entry { display: grid; }
    .email-entry .btn { width: 100%; }
}

/* ---------- Hero (jobs page) ----------
   Centered on desktop, left-aligned on mobile (see the 760px block above).
   .grad paints the second line with the brand gradient; the fallback color
   keeps the text readable if background-clip:text is unsupported. */
.page-head.hero-head {
    text-align: center;
    padding: 12px 0 4px;
    margin-bottom: 22px;
}
.page-head.hero-head h1 {
    font-size: clamp(1.9rem, 5vw, 2.9rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.page-head.hero-head .page-sub {
    font-size: 1.02rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.grad {
    color: var(--accent);
    background: linear-gradient(100deg, #4f46e5, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .grad { color: transparent; }
}

/* Hero reads better left-aligned on a phone. Must come after the .hero-head
   base rule above — same specificity, so source order decides. */
@media (max-width: 760px) {
    .page-head.hero-head { text-align: left; }
    .page-head.hero-head h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); }
    .page-head.hero-head .page-sub { margin-left: 0; margin-right: 0; }
}

/* ---------- Pipeline v2: attention-first board + application drawer ---------- */
.pipeline-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    margin-bottom: 16px;
}
.pipeline-head h2 { margin: 3px 0 4px; font-size: 1.45rem; letter-spacing: -0.02em; }
.pipeline-head p { color: var(--text-secondary); font-size: 0.9rem; max-width: 620px; }
.pipeline-add { min-width: 0; flex: 0 0 290px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface); }
.pipeline-add summary { padding: 10px 13px; color: var(--accent-ink); cursor: pointer; font-size: 0.84rem; font-weight: 700; }
.pipeline-add-body { padding: 0 13px 13px; border-top: 1px solid var(--border-soft); }
.pipeline-add-body > .sub { margin: 10px 0 0; }
.pipeline-add-grid { grid-template-columns: 1fr; margin-top: 12px; }
.pipeline-add-grid select { width: 100%; min-width: 0; }
.pipeline-plan-note { margin-top: 9px; color: var(--text-secondary); font-size: 0.74rem; }

.pipeline-attention { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.pipeline-summary-card {
    min-width: 0; display: flex; align-items: center; gap: 11px; padding: 13px;
    border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface);
    color: var(--text-primary); cursor: pointer; font: inherit; text-align: left; box-shadow: var(--shadow);
}
.pipeline-summary-card:hover:not(:disabled), .pipeline-summary-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.pipeline-summary-card:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-color: var(--accent); }
.pipeline-summary-card:disabled { cursor: default; opacity: 0.58; }
.pipeline-summary-icon {
    width: 31px; height: 31px; display: inline-grid; place-items: center; flex: 0 0 auto;
    border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.78rem; font-weight: 800;
}
.pipeline-summary-card > span:last-child { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; }
.pipeline-summary-card strong { font-size: 1.25rem; line-height: 1; }
.pipeline-summary-card b { font-size: 0.82rem; }
.pipeline-summary-card small { grid-column: 1 / -1; margin-top: 3px; color: var(--text-secondary); font-size: 0.7rem; line-height: 1.3; }

.pipeline-toast {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; padding: 10px 13px; border: 1px solid var(--accent); border-radius: 10px;
    background: var(--accent-soft); color: var(--accent-ink); font-size: 0.82rem;
}
.pipeline-toast button, .pipeline-filter-note button { border: 0; background: none; color: var(--accent-ink); cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; }
.pipeline-board-panel { padding: 18px; }
.pipeline-board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.pipeline-board-head h2 { margin: 0; }
.pipeline-board-head .sub { margin: 2px 0 0; }
.pipeline-search { min-width: 220px; color: var(--text-secondary); font-size: 0.72rem; }
.pipeline-search span { display: block; margin-bottom: 3px; }
.pipeline-search input, .pipeline-detail-grid select, .pipeline-detail-grid input, .pipeline-field input, .pipeline-field textarea {
    width: 100%; min-width: 0; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-color); color: var(--text-primary); padding: 8px 10px; font: inherit; font-size: 0.84rem;
}
.pipeline-search input:focus, .pipeline-detail-grid select:focus, .pipeline-detail-grid input:focus, .pipeline-field input:focus, .pipeline-field textarea:focus {
    outline: 3px solid var(--accent-soft); border-color: var(--accent);
}
.pipeline-filter-note { margin: -3px 0 12px; padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.77rem; }
.pipeline-stage-tabs { display: none; }
.pipeline-kanban { align-items: start; }
.pipeline-kanban .kanban-col { min-width: 0; padding: 9px; }
.pipeline-kanban .kanban-col h4 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pipeline-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--surface); color: var(--text-primary); text-align: center; }
.pipeline-empty { padding: 14px 5px; color: var(--text-muted); font-size: 0.74rem; text-align: center; }

.pipeline-card { position: relative; min-width: 0; padding: 10px; box-shadow: 0 1px 1px var(--border-soft); }
/* One-click "remove from pipeline" — moves the card back to Saved (My Jobs).
   Reversible via the Undo toast, so no confirm dialog is needed. */
.pipeline-card-remove {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 6px; background: none;
    color: var(--text-muted); font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.pipeline-card-remove:hover { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.pipeline-card-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pipeline-card-open { width: 100%; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; text-align: left; padding-right: 26px; }
.pipeline-card-open:hover .kc-title { color: var(--accent-ink); }
.pipeline-card .kc-title, .pipeline-card .kc-company { display: block; overflow-wrap: anywhere; }
.pipeline-card .kc-title { line-height: 1.35; }
.pipeline-card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 7px 0 4px; color: var(--text-muted); font-size: 0.68rem; }
.pipeline-card-meta span + span::before { content: "·"; margin-right: 8px; }
.pipeline-card .kc-reminder { display: inline-flex; margin: 4px 0; padding: 2px 6px; border-radius: 6px; background: var(--gold-bg); color: var(--gold-ink); }
.pipeline-card .kc-reminder.overdue { border: 1px solid var(--danger); background: var(--surface); color: var(--danger); }
.pipeline-stale { margin: 4px 0; color: var(--warning); font-size: 0.7rem; font-weight: 600; }
.pipeline-note-preview { margin: 5px 0 8px; color: var(--text-secondary); font-size: 0.73rem; line-height: 1.4; overflow-wrap: anywhere; }
.pipeline-card-actions { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.pipeline-card-actions button {
    min-width: 0; border: 1px solid var(--border-color); border-radius: 7px; padding: 5px 7px;
    background: var(--surface); color: var(--text-secondary); cursor: pointer; font: inherit; font-size: 0.68rem;
}
.pipeline-card-actions button:hover { border-color: var(--accent); color: var(--accent-ink); }
.pipeline-card-actions .pipeline-primary-action { flex: 1; background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.pipeline-drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(30, 27, 75, 0.26); }
.pipeline-drawer {
    position: fixed; z-index: 81; top: 0; right: 0; width: min(520px, 92vw); height: 100vh;
    overflow-y: auto; padding: 26px; background: var(--surface); border-left: 1px solid var(--border-color); box-shadow: var(--shadow-lift);
}
.pipeline-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.pipeline-drawer-head h2 { margin: 4px 0 2px; font-size: 1.25rem; line-height: 1.3; }
.pipeline-drawer-head p { color: var(--text-secondary); font-size: 0.84rem; }
.pipeline-drawer-close { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--border-color); border-radius: 50%; background: var(--surface); color: var(--text-secondary); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.pipeline-drawer-close:hover { border-color: var(--accent); color: var(--accent-ink); }
.pipeline-next-action { display: flex; flex-direction: column; gap: 3px; margin: 16px 0; padding: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.8rem; }
.pipeline-next-action strong { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.pipeline-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pipeline-detail-grid label, .pipeline-field { display: block; margin-bottom: 12px; color: var(--text-secondary); font-size: 0.75rem; }
.pipeline-detail-grid label > *, .pipeline-field > * { margin-top: 4px; }
.pipeline-field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.pipeline-activity { margin: 17px 0; padding-top: 15px; border-top: 1px solid var(--border-color); }
.pipeline-activity h3 { margin-bottom: 10px; font-size: 0.88rem; }
.pipeline-activity > div { position: relative; display: grid; grid-template-columns: 14px 1fr; column-gap: 7px; margin-bottom: 10px; font-size: 0.78rem; }
.pipeline-activity > div small { grid-column: 2; color: var(--text-secondary); }
.activity-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--accent); }
.activity-dot.muted { background: var(--border-color); }
.pipeline-activity p { margin-top: 10px; color: var(--text-muted); font-size: 0.7rem; line-height: 1.45; }
.pipeline-drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pipeline-drawer-actions .btn { text-decoration: none; }
.pipeline-remove { margin-top: 18px; border: 0; background: none; color: var(--danger); cursor: pointer; font: inherit; font-size: 0.75rem; text-decoration: underline; }
.pipeline-remove-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 10px; border: 1px solid var(--danger); border-radius: 8px; color: var(--danger); font-size: 0.76rem; }
.pipeline-remove-confirm button { border: 1px solid var(--border-color); border-radius: 6px; background: var(--surface); color: var(--text-secondary); padding: 4px 8px; cursor: pointer; font: inherit; }
.pipeline-remove-confirm button[data-rmyes] { border-color: var(--danger); color: var(--danger); }

@media (max-width: 760px) {
    .pipeline-head { flex-direction: column; }
    .pipeline-add { width: 100%; flex-basis: auto; }
    .pipeline-attention { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pipeline-board-head { align-items: stretch; flex-direction: column; }
    .pipeline-search { min-width: 0; }
    .pipeline-stage-tabs { display: flex; gap: 5px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 3px; }
    .pipeline-stage-tabs button { flex: 0 0 auto; border: 1px solid var(--border-color); border-radius: 999px; background: var(--surface); color: var(--text-secondary); padding: 6px 10px; cursor: pointer; font: inherit; font-size: 0.73rem; }
    .pipeline-stage-tabs button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
    .pipeline-stage-tabs button span { margin-left: 3px; }
    .pipeline-kanban { display: block; }
    .pipeline-kanban .kanban-col { display: none; }
    .pipeline-kanban .kanban-col.mobile-active { display: block; }
}

@media (max-width: 480px) {
    .pipeline-attention { gap: 7px; }
    .pipeline-summary-card { align-items: flex-start; padding: 10px; }
    .pipeline-summary-card small { display: none; }
    .pipeline-summary-card > span:last-child { display: flex; flex-direction: column; gap: 2px; }
    .pipeline-board-panel { padding: 14px; }
    .pipeline-drawer { width: 100vw; padding: 20px; }
    .pipeline-detail-grid { grid-template-columns: 1fr; gap: 0; }
    .pipeline-drawer-actions { flex-direction: column; }
    .pipeline-drawer-actions .btn { width: 100%; text-align: center; }
}

/* ---------- AI toolkit tab ---------- */
.ai-explain { margin: 4px 0 16px; padding-left: 18px; }
.ai-explain li { margin-bottom: 7px; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.ai-explain strong { color: var(--text-primary); }
.ai-provider-note {
    margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--border-soft);
    border-radius: 10px; background: var(--bg-color); color: var(--text-secondary);
    font-size: 0.8rem; line-height: 1.45;
}
.ai-provider-note strong { color: var(--text-primary); }
.ai-provider-note a { color: var(--accent-ink); font-weight: 600; }
.field-label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.resume-input { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.file-btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 9px 14px; font-size: 0.86rem; font-weight: 600; white-space: nowrap;
}
.file-btn:hover { border-color: var(--accent); }
.file-name { font-size: 0.85rem; color: var(--pay); }
.file-name .linkish { background: none; border: 0; color: var(--text-secondary); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.8rem; }
.paste-fallback { display: block; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 8px; }
.ai-runbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.ai-runbar .usage-bar { margin: 0; }
.ai-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.ai-export { display: inline-flex; gap: 6px; }

/* ---------- AI toolkit v2: guided flow, task cards, result history ---------- */
.ai-step {
    margin: 16px 0; padding: 18px; border: 1px solid var(--border-color);
    border-radius: 14px; background: var(--surface);
}
.ai-step > h3 {
    display: flex; align-items: center; gap: 9px; margin: 0 0 14px;
    color: var(--text-primary); font-size: 1rem;
}
.ai-step-number {
    display: inline-grid; place-items: center; width: 28px; height: 28px;
    border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
    font-size: 0.82rem; font-weight: 700; flex: 0 0 auto;
}
.ai-step .form-col:last-child { margin-bottom: 0; }
.ai-details { margin-top: 10px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
.ai-details summary {
    color: var(--text-secondary); cursor: pointer; font-size: 0.84rem;
    font-weight: 600; line-height: 1.4;
}
.ai-details[open] summary { margin-bottom: 10px; color: var(--text-primary); }
.ai-details .form-col { margin: 0; }

.task-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.task-card {
    min-width: 0; min-height: 132px; display: flex; flex-direction: column; gap: 10px;
    padding: 15px; border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--surface); color: var(--text-secondary); cursor: pointer;
    font: inherit; font-size: 0.84rem; line-height: 1.45; text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.task-card:hover { border-color: var(--accent); }
.task-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.task-card:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-color: var(--accent); }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-card strong { color: var(--text-primary); font-size: 0.9rem; line-height: 1.3; }
.model-chip {
    display: inline-flex; align-items: center; flex: 0 0 auto; padding: 2px 7px;
    border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.model-chip.fast { background: var(--pay-bg); color: var(--pay); }
.ai-usage-text.warning { color: var(--warning) !important; font-weight: 600; }
.ai-result-head .sub { margin: 0; }
.ai-export { flex-wrap: wrap; }

.ai-history { margin-top: 22px; border-top: 1px solid var(--border-color); padding-top: 16px; }
.ai-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.ai-history-head h3 { margin: 0; font-size: 0.95rem; }
.ai-history .linkish {
    border: 0; background: none; color: var(--text-secondary); cursor: pointer;
    font: inherit; font-size: 0.78rem; text-decoration: underline;
}
.ai-history .linkish:hover { color: var(--accent); }
.ai-history-list { border-top: 1px solid var(--border-soft); }
.ai-history-row {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--border-soft);
    background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; text-align: left;
}
.ai-history-row:hover, .ai-history-row:focus-visible { color: var(--accent-ink); background: var(--accent-soft); outline: 0; }
.ai-history-row > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-history-row strong, .ai-history-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history-row strong { font-size: 0.84rem; }
.ai-history-row small, .ai-history-row time { color: var(--text-secondary); font-size: 0.75rem; }
.ai-history-row time { flex: 0 0 auto; }

@media (max-width: 640px) {
    .task-cards { grid-template-columns: 1fr; }
    .task-card { min-height: 0; }
    .ai-step { padding: 14px; }
    .ai-export { width: 100%; }
    .ai-export .btn { flex: 1 1 auto; }
}
