/* ==========================================================================
   Career Pilot design system
   Dark (default) + light theme via html.light-theme, glassmorphism cards,
   Inter/Outfit typography -- built for a working dashboard tool rather
   than a marketing page: no decorative animation, denser layout, but a
   consistent color/type/glass system throughout.
   ========================================================================== */

:root {
    --bg-dark: #070a13;
    --card-bg: rgba(13, 20, 38, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.08);

    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --grad-primary: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    --grad-accent: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-blue) 100%);
    --grad-danger: linear-gradient(135deg, var(--accent-amber) 0%, var(--accent-red) 100%);

    --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 16px;
    --radius-md: 8px;
    --max-width-content: 1000px;
}

/* Applied to <html> (not <body>) by a synchronous inline script in
   _base.html's <head>, run before the page paints -- see that file's
   comment for why it has to be html+inline rather than a body class
   set from theme.js at the end of the page (that would flash the
   wrong theme for a split second on every load). */
html.light-theme {
    --bg-dark: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(15, 23, 42, 0.08);
    --card-border-hover: rgba(15, 23, 42, 0.16);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --input-bg: rgba(15, 23, 42, 0.03);
    --input-border: rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

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

html {
    scroll-behavior: smooth;
    /* Tells the browser this page supports dark UI, so native controls
       it renders itself -- <select> dropdown popups, date/time pickers,
       scrollbars -- use dark-appropriate styling instead of always
       defaulting to a light native popup on top of this dark-themed
       page. Page CSS can't override a native <select> popup's own
       styling directly in most browsers; this is the actual mechanism
       for it. Overridden to light below when html.light-theme is set. */
    color-scheme: dark;
}

html.light-theme {
    color-scheme: light;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 0.5rem 0;
}

h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; margin-top: 1.25rem; }

p { margin: 0 0 0.75rem 0; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.plain-link {
    color: inherit;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

code {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-size: 0.9em;
}

/* Keyboard-focus indicator -- applied deliberately (not just relying on
   browser defaults) across every interactive element for accessibility. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent-indigo);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background-color: color-mix(in srgb, var(--bg-dark) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.topbar h1 {
    margin: 0;
    font-size: 1.15rem;
}

.topnav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.topnav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.topnav a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

main {
    padding: 24px;
    max-width: var(--max-width-content);
    margin: 0 auto;
}

/* ==========================================================================
   Theme toggle
   ========================================================================== */

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--input-bg);
}

/* ==========================================================================
   Glass panels (cards, sections)
   ========================================================================== */

.card,
.variant-block,
.settings-panel,
.empty-state,
.pending-list,
.pending-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

html.light-theme .card,
html.light-theme .variant-block,
html.light-theme .settings-panel,
html.light-theme .empty-state,
html.light-theme .pending-list,
html.light-theme .pending-item {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.variant-block:hover,
.card:hover {
    border-color: var(--card-border-hover);
}

.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    padding: 16px 20px;
    flex: 1;
    min-width: 160px;
}

.card-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.card-value {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-state {
    padding: 20px 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.settings-panel {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.variant-block {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.pending-list {
    background: var(--input-bg);
    border-style: dashed;
    padding: 12px 16px;
    margin: 16px 0;
}

.pending-item {
    padding: 14px 16px;
    margin-bottom: 10px;
}

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

.pending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.settings-panel form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.settings-panel form label {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    color: var(--text-secondary);
    gap: 5px;
}

.settings-panel form > button {
    grid-column: 1 / -1;
    margin-top: 4px;
    justify-self: start;
}

/* Same compact 2-column layout as .settings-panel form, for the
   Profile page's Application Preferences form specifically -- not
   applied to every .sub-panel form, since the LinkedIn-import/manual-
   JSON forms are single full-width textareas that shouldn't be
   squeezed into two columns. */
.preferences-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.preferences-form h3 {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    font-size: 0.95rem;
}

.preferences-form h3:first-child {
    margin-top: 0;
}

.preferences-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    color: var(--text-secondary);
    gap: 5px;
}

.preferences-form > button {
    grid-column: 1 / -1;
    margin-top: 4px;
    justify-self: start;
}

.preferences-form .checkbox-label {
    align-self: end;
    justify-self: start;
    padding-bottom: 0.65rem;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* select's own closed box correctly uses the translucent --input-bg
   above (it blends with the dark page behind it, same as every other
   input) -- but a <select>'s dropdown POPUP isn't rendered inside the
   page's own background stack in most browsers, so that same
   translucent value doesn't composite against anything dark there and
   can render close to invisible/washed-out (text unreadable until a
   browser's own hover-highlight provides contrast). <option> elements
   need an explicit SOLID background of their own, independent of the
   translucent input styling, for this exact reason. */
select option {
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: var(--input-bg);
}

textarea {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.82rem;
    resize: vertical;
    margin-bottom: 8px;
}

.inline-form {
    display: inline;
}

.inline-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.inline-form-row input,
.inline-form-row select {
    width: auto;
    flex: 1;
    min-width: 140px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    transition: var(--transition-smooth);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--card-border);
    box-shadow: none;
}

.btn-link {
    background: none;
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
    padding: 2px 4px;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: var(--grad-danger);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.4);
}

.btn-off {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: none;
}

.btn-off:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: none;
}

.btn-on {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: none;
}

.btn-on:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: none;
}

/* ==========================================================================
   Flash messages / badges / flags
   ========================================================================== */

.flash {
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.flash-ok {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--text-primary);
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--text-primary);
}

.flash-error-inline {
    color: #f87171;
}

html.light-theme .flash-error-inline {
    color: #dc2626;
}

.badge {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    padding: 3px 10px;
    color: var(--text-secondary);
    margin-left: 6px;
}

.badge-default,
.badge-active {
    color: var(--accent-indigo);
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
}

.badge-warn {
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.1);
}

html:not(.light-theme) .badge-warn {
    color: #fbbf24;
}

.flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.flag-warning {
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    border-radius: 999px;
    padding: 2px 10px;
}

html.light-theme .flag-warning {
    color: #b45309;
}

/* ==========================================================================
   Misc content blocks
   ========================================================================== */

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

.json-preview {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.78rem;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.sub-panel {
    margin-top: 16px;
}

.sub-panel summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.sub-panel summary:hover {
    color: var(--text-primary);
}

/* Interview-prep round headers need to read as major, distinct
   sections when scanning a long page -- the generic .sub-panel summary
   style above (small, muted) is right for minor secondary panels like
   "Sources" or "Log a networking insight", but was also being reused
   for round titles, making them just as easy to skim past as anything
   else on the page. */
.round-panel {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 20px;
    background: var(--input-bg);
}

.round-panel .round-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.round-panel .round-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--grad-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.round-panel .round-title {
    color: var(--text-primary);
}

.round-panel .round-interviewer {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.version-history {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.interviewer-turn {
    border-left: 3px solid var(--accent-indigo);
    padding-left: 10px;
}

.candidate-turn {
    border-left: 3px solid var(--accent-emerald);
    padding-left: 10px;
}

.version-history li {
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
}

.version-history li:last-child {
    border-bottom: none;
}

.version-history form {
    display: inline;
    margin-left: 4px;
}

.tag-chip-delete {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tag-chip-delete:hover {
    color: #f87171;
    transform: none;
    box-shadow: none;
}

/* Rows with action buttons (Intake Sources, Search Keywords, exclusion
   lists) split into an info group that wraps freely and an actions group
   that stays together -- without this, a long info line (e.g. a source's
   error text) pushes a single button onto its own line by itself instead
   of wrapping as a clean group. */
.version-history .row-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.version-history .row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.version-history .row-actions form {
    display: inline-flex;
    margin-left: 0;
}

/* Tag-chip lists: for short, potentially numerous items (search keywords,
   seniority/location exclusions) where a full-width row with two big
   gradient buttons per item doesn't scale -- a location-exclusion list
   alone can run 30-40+ entries, and at that count the version-history row
   pattern turns into an extremely long, visually loud scroll. Chips wrap
   compactly like Gmail labels/GitHub topics: click the label to toggle
   active/paused, click the small x to delete. */
.tag-chip-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    overflow: hidden;
}

.tag-chip.tag-chip-active {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
}

.tag-chip form {
    display: inline-flex;
    margin: 0;
}

.tag-chip button {
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tag-chip button:hover {
    transform: none;
    box-shadow: none;
}

.tag-chip-label {
    padding: 6px 14px;
}

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

.variant-header {
    justify-content: space-between;
    margin-bottom: 4px;
}

.job-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.job-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
}

.job-item:last-child {
    border-bottom: none;
}

.job-item-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.job-item-header a {
    font-weight: 600;
    color: var(--text-primary);
}

.job-item-header a:hover {
    color: var(--accent-blue);
}

/* Contains wide tables to their panel instead of overflowing the page --
   the bulk review table and analytics tables can have more columns than
   fit on a narrow screen, so this scrolls horizontally within its own
   box rather than blowing out the whole layout. */
.table-scroll {
    overflow-x: auto;
    margin-bottom: 12px;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.review-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.review-table td {
    padding: 10px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.review-table tbody tr:hover {
    background: var(--input-bg);
}

.score-breakdown summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.score-breakdown summary::-webkit-details-marker {
    display: none;
}

.score-breakdown summary::after {
    content: " \25BE";
    font-size: 0.75em;
    color: var(--text-muted);
}

.score-breakdown-table {
    white-space: normal;
    font-size: 0.8rem;
    margin-top: 6px;
    border-collapse: collapse;
}

.score-breakdown-table td {
    padding: 2px 8px 2px 0;
    border: none;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ==========================================================================
   Bar charts (Analytics page) -- a track + proportional fill, single
   accent hue per chart. Color here encodes "how much of this converted"
   (applied is a subset of total, shown as an inset fill on a dimmed
   total track), not category identity -- the row label is the identity,
   so no categorical palette or legend is needed. Every bar carries a
   direct numeric label instead of a hover tooltip; the table underneath
   each chart is the exact-value view the chart summarizes.
   ========================================================================== */

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 24px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 200px) 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.bar-row-label {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    position: relative;
    display: block;
    height: 18px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill-total {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--text-muted);
    opacity: 0.3;
    border-radius: 999px;
}

.bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-emerald);
    border-radius: 999px;
    transition: var(--transition-smooth);
}

/* A genuinely-zero value must render as zero width -- min-width would
   make "0 applied" show the same reassuring sliver as "1 applied",
   which is exactly the kind of small dishonesty a chart shouldn't have.
   Applied as a modifier, not baked into .bar-fill, so a real nonzero
   value that happens to round to a very thin sliver still gets a
   visible floor. */
.bar-fill:not(.bar-fill-zero) {
    min-width: 3px;
}

.bar-fill.bar-fill-primary {
    background: var(--accent-indigo);
}

.bar-row-value {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    font-size: 0.82rem;
}

/* ==========================================================================
   Kanban board
   ========================================================================== */

/* Horizontal scroll here is the RIGHT kind of scroll (unlike the old
   flat Jobs list's vertical "endless scroll" this board replaces) --
   Trello/Huntr/every real Kanban tool scrolls sideways through a bounded
   set of columns, one column per real pipeline status, so the whole
   board's shape is visible/scannable even when one column runs long. */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 260px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-height: 80px;
}

/* Ingested/Tailored: the pipeline sets these on its own (see
   confirmation_service.KANBAN_TRANSITIONS's docstring) -- dimmed and
   marked "auto" so it reads as "the system is working on this," not
   "you forgot to move this card." */
.kanban-column.kanban-auto {
    opacity: 0.72;
}

.kanban-column-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--input-border);
}

.kanban-column-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-column-count {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
}

.kanban-card {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px;
    cursor: grab;
}

.kanban-column.kanban-auto .kanban-card {
    cursor: default;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.kanban-card-title:hover {
    color: var(--accent-blue);
}

.kanban-card-company {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.kanban-card .badge,
.kanban-card .flag-warning {
    margin-left: 0;
    margin-right: 4px;
    margin-bottom: 4px;
}

.kanban-empty-note {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
}

/* SortableJS's own state classes, themed to match instead of its
   unstyled defaults. */
.kanban-cards .sortable-ghost {
    opacity: 0.35;
}

.kanban-cards .sortable-chosen {
    box-shadow: 0 0 0 2px var(--accent-indigo);
}

.kanban-cards .sortable-drag {
    box-shadow: var(--shadow-md, 0 8px 20px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    main {
        padding: 16px;
    }

    .topbar {
        padding: 14px 16px;
    }

    .settings-panel form,
    .preferences-form {
        grid-template-columns: 1fr;
    }

    .variant-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .bar-row-value {
        text-align: left;
    }

    .summary-cards {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .card {
        min-width: 100%;
    }

    .inline-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form-row input,
    .inline-form-row select {
        width: 100%;
    }

    button {
        width: 100%;
    }

    .pending-actions button,
    .variant-actions button,
    .topnav button,
    .inline-form-row button {
        width: auto;
    }

    .job-item-header {
        gap: 6px;
    }
}

/* Ready to Apply page (2026-09-22) -- a flat, real-URL-first list, no
   automation of its own, matching the plan-classes.md convention of
   reusing existing tokens (--bg-dark, --card-border, --radius-md, etc.)
   rather than inventing new colors. */

/* Real bug found live: the base `button { ... }` rule only targets the
   <button> element, never <a>, so a plain `<a class="btn-primary">`
   (the real posting link, deliberately an <a> so target="_blank"/
   rel="noopener" work -- a <button> can't navigate on its own) rendered
   completely unstyled. .btn-primary didn't exist anywhere in this
   stylesheet before -- defined here as a real, reusable class rather
   than an anchor-only hack, so any future <a> that wants the primary
   look can just use it too. */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
    text-decoration: none;
}

.ready-to-apply-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.ready-to-apply-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    flex-wrap: wrap;
}

.ready-to-apply-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 320px;
}

.ready-to-apply-title {
    font-weight: 600;
    font-size: 1.02rem;
}

.ready-to-apply-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.ready-to-apply-title a:hover {
    text-decoration: underline;
}

.ready-to-apply-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ready-to-apply-attention {
    font-style: italic;
}

.ready-to-apply-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .ready-to-apply-row {
        flex-direction: column;
        align-items: stretch;
    }
    /* Real bug found live: .ready-to-apply-main's `flex: 1 1 320px`
       sets a minimum WIDTH in the row layout above, but once this query
       switches the container to flex-direction: column, that same
       320px basis applies to HEIGHT instead -- forcing a 320px-tall box
       around three lines of text. Reset to content-sized here. */
    .ready-to-apply-main {
        flex: none;
    }
    .ready-to-apply-actions {
        justify-content: space-between;
    }
}

/* Tab bar for a two-view page toggle (2026-09-22) -- e.g. Review Queue /
   Ready to Apply, switched client-side like the light/dark toggle
   instead of two separate pages, since they're a real linked pair
   (Review clears things into Approved; Ready to Apply is where
   Approved things go next). */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: none;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.tab-btn-active {
    background: var(--grad-primary);
    color: #fff;
}

.tab-btn-active:hover {
    color: #fff;
}

/* Collapsed-by-default salary correction (2026-09-22) -- the summary
   reads as a small inline link, matching .btn-link's look, not a
   default browser disclosure widget with its own marker/spacing. */
.salary-correct-details {
    display: inline-block;
}

.salary-correct-details summary {
    display: inline;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    list-style: none;
}

.salary-correct-details summary::-webkit-details-marker {
    display: none;
}

.salary-correct-details summary:hover {
    color: var(--text-primary);
}

.salary-correct-details[open] summary {
    display: block;
    margin-bottom: 4px;
}

.salary-correct-details form {
    margin-top: 2px;
}

/* ==========================================================================
   Profile interview prep (/interview-prep): read top to bottom before a call --
   pitch and answers first, reference material after.
   ========================================================================== */
.prep-intro .prep-lede { color: var(--text-secondary); max-width: 68ch; line-height: 1.6; margin: 0.25rem 0 1rem; }
.prep-status { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0.9rem; border-radius: var(--radius-md);
    border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-secondary); line-height: 1.5; font-size: 0.92rem; }
.prep-status strong { color: var(--text-primary); }
.prep-status-dot { flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-top: 0.4rem; background: var(--text-muted); }
.prep-status-current .prep-status-dot { background: var(--accent-emerald); }
.prep-status-stale .prep-status-dot, .prep-status-none .prep-status-dot { background: var(--accent-amber); }
.prep-status-busy .prep-status-dot { background: var(--accent-blue); }
.prep-status-error { color: var(--accent-amber); }
.prep-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 0.9rem; }
.prep-controls form { margin: 0; }
.prep-auto { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.prep-auto .checkbox-label { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }
.prep-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--card-border); }
.prep-jump a { padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--card-border); color: var(--text-secondary);
    text-decoration: none; font-size: 0.88rem; }
.prep-jump a:hover, .prep-jump a:focus-visible { border-color: var(--accent-indigo); color: var(--text-primary); }
.prep-section { scroll-margin-top: 1rem; }
.prep-section > h2 { margin-bottom: 0.4rem; }
.prep-section h3 { font-size: 1.02rem; margin: 1.4rem 0 0.6rem; }
.prep-section h4 { font-size: 0.92rem; margin: 0.9rem 0 0.4rem; color: var(--text-secondary); font-weight: 600; }

.prep-pitch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 0.6rem; }
.prep-pitch { padding: 1rem 1.1rem; border-radius: var(--radius-md); border: 1px solid var(--card-border); background: var(--input-bg); }
.prep-pitch h3 { margin: 0 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-indigo); }
.prep-pitch p { margin: 0; line-height: 1.7; font-size: 1rem; }

.prep-qa { list-style: none; padding: 0; margin: 0.5rem 0 0; counter-reset: q; display: grid; gap: 0.5rem; }
.prep-qa > li { counter-increment: q; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--input-bg); }
.prep-qa summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; line-height: 1.45; list-style: none; display: flex; gap: 0.6rem; }
.prep-qa summary::-webkit-details-marker { display: none; }
.prep-qa summary::before { content: counter(q); flex: none; min-width: 1.6rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.prep-qa details[open] summary { border-bottom: 1px solid var(--card-border); }
.prep-answer { padding: 0.8rem 1rem 1rem 3.2rem; }
.prep-answer p { margin: 0 0 0.6rem; line-height: 1.7; max-width: 72ch; }
.prep-cue { font-size: 0.9rem; color: var(--text-secondary); }
.prep-cue span { display: inline-block; margin-right: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 4px; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.05em; background: var(--accent-indigo); color: #fff; }

.prep-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 0.5rem; }
.prep-list { margin: 0.3rem 0 0; padding-left: 1.2rem; line-height: 1.65; }
.prep-list li { margin-bottom: 0.35rem; }
.prep-gap, .prep-story, .prep-more-item { border-bottom: 1px solid var(--card-border); padding: 0.55rem 0; }
.prep-gap summary, .prep-story summary, .prep-more-item summary, .prep-more > summary { cursor: pointer; font-weight: 600; line-height: 1.45; }
.prep-gap p { margin: 0.5rem 0 0.2rem; line-height: 1.65; color: var(--text-secondary); }
.prep-star { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0.7rem 0 0.3rem; line-height: 1.6; }
.prep-star dt { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.15rem; }
.prep-star dd { margin: 0; }

.prep-project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.prep-project { padding: 1rem 1.1rem; border-radius: var(--radius-md); border: 1px solid var(--card-border); background: var(--input-bg); }
.prep-project h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
.prep-date { color: var(--text-muted); font-size: 0.85rem; font-weight: 400; margin: 0.2rem 0 0; }
.prep-chips { list-style: none; padding: 0; margin: 0.6rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.prep-chips li { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--card-border); color: var(--text-secondary); }
.prep-chip-more { color: var(--text-muted); }
.prep-project .prep-list { font-size: 0.92rem; }
.prep-more { margin-top: 1rem; }
.prep-more > summary { padding: 0.5rem 0; }
.prep-more-item { padding-left: 0.75rem; }

.prep-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; margin: 0.6rem 0 0; }
.prep-facts > div { padding: 0.7rem 0.9rem; border-radius: var(--radius-md); border: 1px solid var(--card-border); background: var(--input-bg); }
.prep-facts dt { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.prep-facts dd { margin: 0; font-weight: 600; }

.prep-timeline { list-style: none; padding: 0; margin: 0; }
.prep-timeline > li { border-left: 2px solid var(--card-border); padding: 0.1rem 0 0.7rem 1rem; position: relative; }
.prep-timeline > li::before { content: ""; position: absolute; left: -6px; top: 0.55rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-indigo); }
.prep-timeline summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; align-items: baseline; line-height: 1.5; }
.prep-role { font-weight: 600; }
.prep-org { color: var(--text-secondary); }
.prep-timeline .prep-date { flex-basis: 100%; margin: 0; }
.prep-skill-group h4 { margin-top: 1rem; }

@media (max-width: 600px) {
    .prep-answer { padding-left: 1rem; }
    .prep-star { grid-template-columns: 1fr; }
}

/* Chromium stops painting an element with backdrop-filter once it grows past its compositing size limit, so very tall cards
   (the interview prep sections run several thousand pixels) rendered blank below the fold. Tall content panels use a solid
   background instead of the blur. */
.prep-section,
.prep-intro {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-dark);
}

/* Fit and Opportunity side by side on the application page */
.score-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 12px;
}

.score-pair-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
}

.score-pair-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.score-pair-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.evidence-table td {
    white-space: normal;
    overflow-wrap: break-word;
    vertical-align: top;
}

.evidence-table td:nth-child(-n+2) {
    white-space: nowrap;
}

button:disabled,
button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.add-job-panel summary {
    cursor: pointer;
}

.add-job-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.add-job-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.add-job-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 200px;
    font-size: 0.85rem;
}

.add-job-form textarea {
    width: 100%;
}

.add-job-form button {
    align-self: flex-start;
}

/* Upgrades page (monthly upgrade check) */
.upgrade-run {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.upgrade-list {
    margin: 8px 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 4px;
}

.upgrade-item {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.upgrade-item h3 {
    margin: 0;
    font-size: 1rem;
}

.upgrade-item textarea {
    width: 100%;
    box-sizing: border-box;
}

.upgrade-item button {
    justify-self: start;
}
