:root {
    /* ── Surfaces ─────────────────────────────────────────────────────────── */
    /* Stitch Workbench Zinc: bg=zinc-100, surface=white, subtle=zinc-200     */
    --bg: #f4f4f5;               /* zinc-100 — confirmed by Stitch design DNA */
    --surface: #ffffff;
    --surface-subtle: #f4f4f5;   /* zinc-100 */
    --surface-muted: #e4e4e7;    /* zinc-200 */

    /* ── Navigation ────────────────────────────────────────── */
    --sidebar: #18181b;          /* zinc-900 */
    --sidebar-surface: #27272a;  /* zinc-800 */

    /* ── Typography ────────────────────────────────────────── */
    --text: #18181b;             /* zinc-900 */
    --muted: #71717a;            /* zinc-500 */
    --muted-strong: #52525b;     /* zinc-600 */

    /* ── Borders ───────────────────────────────────────────── */
    --line: #e4e4e7;             /* zinc-200 */
    --line-strong: #d4d4d8;      /* zinc-300 */

    /* ── Brand & Actions ─────────────────────────────────────────────────── */
    /* Stitch primary: #0066FF (pure blue) — brighter than Tailwind blue-600  */
    --primary: #0066ff;          /* Stitch Workbench Zinc primary */
    --primary-strong: #0052cc;   /* darker hover */

    /* ── Semantic Status ───────────────────────────────────── */
    --success: #059669;          /* emerald-600 */
    --success-bg: #ecfdf5;       /* emerald-50  */
    --warning: #d97706;          /* amber-600   */
    --warning-bg: #fffbeb;       /* amber-50    */
    --danger: #e11d48;           /* rose-600    */
    --danger-bg: #fff1f2;        /* rose-50     */

    /* ── Spacing ─────────────────────────────────────────────────────────── */
    /* Stitch ROUND_FOUR = 4px base radius                                    */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --space-5: 24px;
    --space-6: 28px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: light; }

body, .app-body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a { color: inherit; transition: opacity 0.15s ease; }
a:hover { opacity: 0.8; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 20px;
    background: var(--sidebar);
    color: #fff;
}

.app-sidebar-head {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.app-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.app-brand-title {
    font-family: "Inter", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.app-brand-copy {
    margin-top: 2px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-side-nav-secondary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-side-nav-caption {
    padding: 0 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.side-nav-link {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.side-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.side-nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    border-left: 2px solid #60a5fa;
    padding-left: 10px;
}

.side-nav-link-secondary {
    color: rgba(255, 255, 255, 0.58);
}

.side-nav-label { min-width: 0; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    margin-left: auto;
}

.profile-chip {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
}

.profile-chip-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.profile-chip-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-chip-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-chip-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.profile-chip-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    overflow-wrap: anywhere;
}
.profile-chip-logout {
    margin-top: 4px;
}
.profile-chip-logout-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
}
.profile-chip-logout-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.app-main {
    min-width: 0;
    padding: 32px;
}

.app-main-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 1440px;
    margin: 0 auto;
}

.app-mobile-nav {
    display: none;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.mobile-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.mobile-nav-link.active {
    background: var(--sidebar);
    color: #fff;
}

.page-stack,
.dashboard-main,
.dashboard-sidebar,
.settings-shell,
.settings-main,
.settings-sidebar,
.job-main-column,
.job-side-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.page-header,
.page-hero,
.settings-hero,
.job-hero,
.discovery-hero {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.page-header,
.page-hero,
.settings-hero,
.job-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-6);
}

.page-hero { align-items: center; }

.discovery-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-5);
    padding: var(--space-6);
}

.page-kicker,
.settings-kicker,
.hero-panel-label,
.summary-label,
.settings-stat-label,
.settings-label,
.tag-group-label,
.profile-flow-label,
.integ-section-label,
.detail-label,
.integ-status-label,
.label-text {
    display: inline-flex;
    align-items: center;
    font-family: "Inter", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.page-title,
.settings-title,
.job-hero-title {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}

.page-copy,
.settings-subtitle,
.section-copy,
.settings-card-copy,
.settings-help,
.integration-meta,
.activity-meta,
.activity-subtitle,
.activity-query,
.list-row-copy,
.job-card-meta,
.job-card-summary,
.mini-stat-label,
.pulse-copy,
.detail-value,
.job-hero-company,
.match-brief-summary,
.company-card-tagline,
.provider-model-profile,
.provider-model-id,
.provider-card-copy,
.profile-index-copy {
    color: var(--muted);
}

.page-copy,
.settings-subtitle,
.section-copy,
.settings-card-copy {
    margin-top: 8px;
    font-size: 1rem;
    line-height: 1.55;
}

.hero-panel,
.discovery-status-note,
.dashboard-meta-card,
.discovery-meta-card,
.summary-item,
.settings-stat,
.mini-stat,
.pulse-row,
.attention-card,
.profile-intro-card,
.profile-panel,
.provider-summary-card,
.profile-index-card,
.provider-editor-card,
.provider-card,
.provider-model-card,
.integ-highlight-row,
.integ-source-item,
.analysis-card,
.company-fact-card,
.compact-fact-item,
.overview-callout,
.ops-card,
.results-toolbar,
.list-row,
.activity-row {
    background: var(--surface);
    border-radius: var(--radius);
}

.surface-card,
.settings-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    padding: var(--space-6);
}

.surface-card-tinted {
    background: var(--surface-subtle);
}

.section-heading,
.settings-card-header,
.provider-card-top,
.provider-editor-summary,
.profile-editor-summary,
.integration-row,
.activity-row-top,
.list-row,
.detail-row,
.profile-panel-header,
.attention-card-top,
.profile-index-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.section-heading { margin-bottom: var(--space-3); }
.section-heading-tight { margin-bottom: 12px; }

.section-title,
.settings-card-title,
.match-brief-title,
.discovery-status-title,
.discovery-feed-title,
.provider-card-title,
.provider-model-title,
.integration-name,
.list-row-title,
.pulse-title,
.analysis-title,
.company-card-name,
.discovery-meta-value,
.dashboard-meta-value,
.summary-value,
.hero-panel-value,
.opportunity-title,
.opportunity-score-number,
.opportunity-score-draft,
.ops-value {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.summary-value,
.dashboard-meta-value,
.opportunity-score-number {
    font-family: "JetBrains Mono", monospace;
    letter-spacing: -0.02em;
}

.hero-panel-value {
    font-size: 1.75rem;
    line-height: 1;
}

.summary-strip,
.dashboard-hero-meta,
.discovery-hero-meta,
.quick-setup-grid,
.quick-setup-grid-four,
.attention-grid,
.profile-atelier-grid,
.profile-strategy-grid,
.provider-summary-grid,
.provider-editor-grid,
.provider-model-grid,
.settings-grid-two,
.batch-workflow-grid,
.mini-stat-grid,
.analysis-grid,
.job-profile-grid,
.integ-key-grid,
.integ-source-grid {
    display: grid;
    gap: 16px;
}

.summary-strip,
.dashboard-hero-meta,
.discovery-hero-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.quick-setup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-setup-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.attention-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-atelier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-strategy-grid,
.provider-editor-grid,
.provider-model-grid,
.settings-grid-two,
.batch-workflow-grid,
.mini-stat-grid,
.analysis-grid,
.job-profile-grid,
.integ-key-grid,
.integ-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.provider-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.integ-source-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.dashboard-grid,
.job-layout,
.settings-layout,
.discovery-editorial-layout,
.pipeline-board {
    display: grid;
    align-items: start;
    gap: var(--space-5);
}

.dashboard-grid { grid-template-columns: minmax(0, 2fr) minmax(360px, 0.8fr); }
.job-layout { grid-template-columns: minmax(0, 1.8fr) minmax(360px, 0.8fr); }
.settings-layout { grid-template-columns: minmax(0, 1.8fr) minmax(360px, 0.8fr); }
.discovery-editorial-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 24px; }
.pipeline-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.settings-sidebar { position: sticky; top: 32px; }

.discovery-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.discovery-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.discovery-rail-section,
.discovery-feed {
    min-width: 0;
}

.discovery-posture-card,
.dashboard-meta-card-link,
.mini-stat-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.dashboard-meta-card-link,
.discovery-meta-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
}
.dashboard-meta-card-link:hover,
.mini-stat-link:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.list-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.list-row-actions .opportunity-action-link {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--line);
    font-size: 0.72rem;
    transition: all 0.15s;
}
.list-row-actions .opportunity-action-link:hover {
    border-color: var(--muted-strong);
    background: var(--surface-muted);
}
.list-row-actions .opportunity-action-link-strong {
    border-color: rgba(5, 150, 105, 0.3);
    flex-shrink: 0;
}

button.discovery-filter-toggle {
    display: none;
}

.meta-card-note {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 2px;
}
.meta-card-note-warn {
    color: var(--warning);
}

.stale-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}
.stale-indicator-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--warning);
}
.stale-refresh-form {
    display: inline;
}
.stale-refresh-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.stale-refresh-btn:hover {
    color: var(--text);
}
.stale-summary-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stale-summary-detail {
    font-size: 0.72rem;
    color: var(--muted);
}

.pass-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pass-reason-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.pass-reason-chip:hover {
    border-color: var(--primary);
}
.pass-reason-chip.pass-reason-selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.score-accuracy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.score-accuracy-buttons {
    display: flex;
    gap: 8px;
}
.score-accuracy-btn.accuracy-selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.toast-undo {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    font-size: inherit;
    padding: 0;
    margin-left: 6px;
}

.discovery-filter-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.discovery-posture-list,
.discovery-tag-groups,
.discovery-tag-group,
.discovery-search-form,
.provider-model-section,
.pipeline-tracker,
.company-profile-stack,
.detail-grid,
.activity-stack,
.list-stack,
.pulse-stack,
.integration-list,
.discovery-results-stack,
.discovery-featured {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.discovery-featured-tight {
    gap: 10px;
    margin-bottom: 2px;
}

.discovery-results-stack-tight {
    gap: 10px;
}

.featured-match-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.featured-match-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.featured-match-top,
.featured-match-actions,
.featured-match-signals,
.featured-match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.featured-match-top { justify-content: flex-start; }

.featured-match-date {
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--muted);
}

.pagination-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
}

.pagination-link {
    min-width: 40px;
}

.pagination-ellipsis {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0 4px;
}

.btn-compact {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.75rem;
}

.featured-match-title {
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    text-decoration: none;
}

.featured-match-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.92rem;
}

.featured-match-meta,
.opportunity-company {
    color: var(--muted);
    font-size: 0.92rem;
}

.opportunity-company {
    margin-top: 6px;
    font-weight: 600;
}

.tag-count {
    margin-left: 4px;
    opacity: 0.6;
}

.divider-top {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.discovery-add-tag-panel {
    margin-top: 16px;
}

.discovery-activity-row {
    padding: 12px;
    font-size: 0.85rem;
}

.discovery-activity-op {
    font-size: 0.75rem;
}

.discovery-activity-time {
    margin-top: 4px;
}

.discovery-empty-compact {
    padding: 20px;
}

.discovery-search-row,
.hero-panel-actions,
.results-toolbar-actions,
.settings-actions-inline,
.settings-actions-split,
.status-chip-row,
.settings-status-row,
.settings-chip-row,
.company-link-row,
.job-tag-row,
.job-chip-row,
.job-chip-row-spaced,
.opportunity-signal-row,
.opportunity-actions,
.batch-run-actions,
.provider-summary-meta,
.provider-health-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.job-decision-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.job-decision-actions-primary {
    margin-bottom: 12px;
}

.job-decision-copy {
    margin-bottom: 0;
}

.job-hero-quickline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.job-hero-inline-copy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.job-layout {
    gap: 24px;
}

.job-main-column,
.job-side-column {
    gap: 20px;
}

.job-layout .surface-card {
    padding: 28px;
}

.job-hero {
    gap: 20px;
    padding: 28px;
}

.job-hero-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.job-tag-row {
    margin-top: 2px;
}
.job-hero-quickline {
    margin-top: 2px;
}

.job-hero-score {
    gap: 12px;
}

.job-hero-meta {
    gap: 12px;
    margin-top: 8px;
}

.job-tag-row,
.job-chip-row,
.job-chip-row-spaced,
.company-link-row,
.company-stat-row {
    gap: 10px;
}

.section-heading {
    margin-bottom: 16px;
}

.job-main-column .section-heading,
.job-side-column .section-heading,
.job-main-column .match-brief-header {
    margin-bottom: 14px;
}

.match-brief-summary {
    margin: 0 0 16px;
}

.analysis-grid,
.job-profile-grid {
    gap: 14px;
}

.analysis-card {
    padding: 20px 22px;
}

.analysis-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pipeline-tracker,
.company-profile-stack,
.detail-grid {
    gap: 12px;
}

.job-side-column .company-profile-stack .analysis-card {
    margin-top: 2px;
}

.notes-panel {
    margin: 0;
}

.discovery-hero-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.discovery-hero-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.discovery-hero-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.discovery-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.discovery-ops-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
}

.results-toolbar {
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.results-toolbar-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.discovery-viewbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.discovery-viewchip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}

.discovery-viewchip-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.discovery-viewchip-count {
    font-family: "JetBrains Mono", monospace;
    opacity: 0.8;
}

.settings-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-check-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.settings-check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-check-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-check-chip input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.settings-check-chip-static span {
    cursor: default;
    background: var(--surface-subtle);
}

.profile-strategy-spotlight {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-layout-profile {
    grid-template-columns: minmax(0, 1fr);
}

.settings-main-full {
    min-width: 0;
}

.profile-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-spotlight-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--surface-subtle);
    border-radius: 10px;
}

.profile-summary-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.profile-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.profile-summary-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.profile-single-form {
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.opportunity-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.opportunity-lower {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.opportunity-insight-block {
    min-width: 0;
    flex: 1 1 360px;
}

.opportunity-insight-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.opportunity-signal-row {
    gap: 6px;
}

.opportunity-actions {
    justify-content: flex-end;
    gap: var(--space-2);
}

.opportunity-card-row {
    border: 1px solid var(--line);
}

.opportunity-card-row .opportunity-body {
    gap: 10px;
    padding: var(--space-4);
}

.opportunity-context-tight {
    gap: 10px;
}

.opportunity-row-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: var(--space-3);
    align-items: start;
}

.opportunity-copy-dense {
    min-width: 0;
}

.opportunity-copy-dense .opportunity-title {
    font-size: 1.04rem;
    line-height: 1.25;
}

.opportunity-score-rail-dense {
    align-items: flex-end;
    justify-content: flex-start;
}

.opportunity-score-rail-dense .opportunity-score-number {
    font-size: 1.55rem;
}

.opportunity-lower-dense {
    justify-content: space-between;
}

.opportunity-actions-dense {
    margin-left: auto;
}

.opportunity-action-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted-strong);
    text-decoration: none;
}

.opportunity-action-link-strong {
    color: var(--success);
}

.compact-summary-stack,
.disclosure-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.discovery-feed-header,
.results-toolbar {
    padding: 20px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.disclosure-shell,
.form-details {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.disclosure-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
    font-family: "Inter", sans-serif;
    font-weight: 700;
}

.disclosure-summary::-webkit-details-marker { display: none; }

.disclosure-shell[open] .disclosure-summary,
.form-details[open] .disclosure-summary {
    background: var(--surface-subtle);
}

.disclosure-body { padding: 24px 22px; }

.opportunity-card {
    display: flex;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    border: 1px solid var(--line);
    transition: border-color 0.15s ease;
}

.opportunity-card:hover {
    border-color: var(--line-strong);
}

.opportunity-accent {
    width: 4px;
    flex: 0 0 4px;
    background: var(--surface-muted);
}

.opportunity-card-high .opportunity-accent { background: var(--success); }
.opportunity-card-mid .opportunity-accent { background: var(--warning); }
.opportunity-card-low .opportunity-accent { background: var(--danger); }
.opportunity-card-draft .opportunity-accent { background: var(--sidebar); }

.opportunity-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.opportunity-context,
.job-card-rail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.opportunity-date,
.list-row-meta,
.activity-time,
.job-card-date {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--muted);
}

.opportunity-date { margin-left: auto; }

.job-hero-meta-compact {
    margin-top: 6px;
}

.opportunity-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 24px;
    align-items: start;
}

.opportunity-title,
.job-card-title {
    font-family: "Inter", sans-serif;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.opportunity-score-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.opportunity-score-number {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 800;
}

.opportunity-score-draft {
    font-size: 1.25rem;
    font-family: "JetBrains Mono", monospace;
    color: var(--muted);
}

.opportunity-insight-copy {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--muted);
}

.prose {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
    white-space: pre-line;
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.prose-collapsed {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}
.prose-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
}
.prose-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--primary);
    border: 1px solid transparent;
    color: #fff;
}

.btn-primary:hover { background: var(--primary-strong); opacity: 1; }

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-secondary:hover { background: var(--surface-subtle); border-color: var(--line-strong); }

.input-field,
.pipeline-select,
select.input-field,
textarea.input-field {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font: inherit;
    color: var(--text);
    transition: border-color 0.15s ease;
}

textarea.input-field { min-height: auto; resize: vertical; }

.input-field:focus,
.pipeline-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-label {
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.settings-help {
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.settings-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.settings-toggle input { accent-color: var(--primary); width: 18px; height: 18px; }

.settings-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--success-bg);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.settings-banner-warn {
    background: var(--warning-bg);
    border-color: rgba(217, 119, 6, 0.2);
}

.settings-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.settings-banner-copy {
    font-size: 0.9rem;
    color: var(--muted);
}

.provider-pill,
.status-chip,
.status-badge,
.score-badge,
.tag-pill,
.results-pill,
.settings-chip,
.job-tag,
.job-source-pill,
.job-company-pill,
.job-inline-link,
.sort-btn,
.company-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 4px;
    background: var(--surface-muted);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.provider-pill-live,
.status-chip-ok,
.score-high {
    background: var(--success-bg);
    color: var(--success);
}

.provider-pill-warn,
.status-chip-skipped,
.status-chip-empty,
.score-mid {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-chip-error,
.score-low {
    background: var(--danger-bg);
    color: var(--danger);
}

.provider-pill-override,
.sort-active,
.tag-active {
    background: var(--primary);
    color: #fff;
}

.mobile-nav-link.active {
    background: var(--sidebar);
    color: #fff;
}

.sort-btn:hover,
.tag-pill:hover,
.job-inline-link:hover {
    background: var(--primary);
    color: #fff;
}

.company-link-btn:hover,
.section-link:hover,
.inline-link:hover {
    color: var(--primary);
    background: transparent;
    opacity: 1;
}

.section-link,
.inline-link,
.opportunity-action-link {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.opportunity-action-link:hover {
    text-decoration: underline;
}

.opportunity-action-link-warm { color: var(--warning); }

.job-inline-action-warm,
.pipeline-save-btn {
    background: var(--primary);
    color: #fff;
}

.job-inline-action-muted {
    background: var(--surface-subtle);
    color: var(--muted);
}

.job-inline-action,
.pipeline-save-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-state,
.empty-state-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 48px 32px;
    border-radius: var(--radius);
    background: var(--surface-subtle);
    text-align: center;
}

.empty-state-title {
    font-family: "Inter", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.empty-state-copy {
    font-size: 0.95rem;
    color: var(--muted);
}

.list-row {
    padding: 14px 20px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.list-row:hover { background: var(--surface-subtle); }

.pipeline-job-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: grab;
}

.pipeline-job-title {
    color: var(--text);
    text-decoration: none;
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.pipeline-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pipeline-card-hint {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.pipeline-job-card.pipeline-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.pipeline-dropzone {
    min-height: 120px;
    border-radius: var(--radius);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pipeline-dropzone.pipeline-dropzone-active {
    background: rgba(37, 99, 235, 0.04);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

.score-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
}

.score-ring-high { color: var(--success); border: 4px solid var(--success); }
.score-ring-mid { color: var(--warning); border: 4px solid var(--warning); }
.score-ring-low { color: var(--danger); border: 4px solid var(--danger); }
.score-ring-none { color: var(--muted); border: 4px solid var(--line-strong); }

.job-hero-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.job-hero-company {
    margin-top: 8px;
    font-family: "Inter", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.settings-stat {
    padding: 20px 24px;
}

.settings-stat-value {
    display: block;
    margin-top: 10px;
    font-family: "JetBrains Mono", monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.job-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.92rem;
    color: var(--muted);
}

.job-hero-salary,
.job-card-salary { color: var(--success); font-weight: 800; }

.journey-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.journey-step {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.journey-step-active {
    background: var(--primary);
    color: #fff;
}

.company-card-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.company-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
}

.company-fact-grid,
.compact-fact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.company-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.company-profile-stack .analysis-card {
    padding: 18px 20px;
}

.company-profile-stack .analysis-list {
    gap: 10px;
}

.pipeline-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pipeline-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}

.pipeline-column-title {
    font-family: "Inter", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.pipeline-column-count {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-subtle);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    font-weight: 700;
}

.pipeline-column-count-green { color: var(--success); }
.pipeline-column-count-yellow { color: var(--warning); }
.pipeline-column-count-blue { color: var(--primary); }
.pipeline-column-count-indigo { color: #7c3aed; }

.provider-editor-wide { grid-column: 1 / -1; }
.provider-editor-summary,
.profile-editor-summary {
    padding: 20px 24px;
    cursor: pointer;
    background: var(--surface-subtle);
    list-style: none;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.provider-editor-summary::-webkit-details-marker,
.profile-editor-summary::-webkit-details-marker { display: none; }

.provider-editor-shell,
.profile-editor-shell {
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    border: 1px solid var(--line);
}

.provider-card,
.provider-editor-card,
.profile-panel {
    padding: 32px 24px;
}

.provider-card-deep,
.provider-editor-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.provider-health-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface-muted);
}

.provider-health-indicator-live { background: var(--success); }

.settings-provider-grid,
.profile-search-layout {
    display: grid;
    gap: 32px;
}

.settings-provider-grid { grid-template-columns: 1fr; }
.profile-search-layout { grid-template-columns: 340px minmax(0, 1fr); }

.profile-search-list,
.profile-search-editors { min-width: 0; }

.hidden { display: none !important; }

.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 24px; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notes-panel {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
    white-space: pre-wrap;
}

.settings-mono,
.detail-value,
.activity-time,
.list-row-meta,
.provider-model-id,
.opportunity-score-number,
.summary-value,
.dashboard-meta-value {
    font-family: "JetBrains Mono", monospace;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1200px) {
    .dashboard-grid,
    .job-layout,
    .settings-layout,
    .discovery-editorial-layout,
    .pipeline-board,
    .summary-strip,
    .dashboard-hero-meta,
    .discovery-hero-meta,
    .quick-setup-grid-four,
    .provider-summary-grid,
    .profile-atelier-grid,
    .attention-grid,
    .profile-search-layout,
    .featured-match-grid {
        grid-template-columns: 1fr;
    }

    .profile-summary-bar,
    .profile-spotlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .discovery-hero,
    .opportunity-topline,
    .opportunity-row-grid {
        grid-template-columns: 1fr;
    }

    .opportunity-date,
    .opportunity-score-rail {
        margin-left: 0;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { display: none; }
    .app-main { padding: 32px 24px; }
    .app-mobile-nav { display: flex; }
    .settings-sidebar { position: static; }
}

@media (max-width: 768px) {
    .page-header,
    .page-hero,
    .settings-hero,
    .job-hero,
    .discovery-hero,
    .section-heading,
    .settings-card-header,
    .provider-card-top,
    .provider-editor-summary,
    .profile-editor-summary,
    .integration-row,
    .activity-row-top,
    .list-row,
    .detail-row,
    .profile-panel-header,
    .attention-card-top,
    .profile-index-top,
    .discovery-feed-header,
    .results-toolbar,
    .results-toolbar-actions,
    .settings-actions-split {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-strip,
    .quick-setup-grid,
    .profile-strategy-grid,
    .profile-summary-bar,
    .profile-spotlight-grid,
    .provider-editor-grid,
    .provider-model-grid,
    .settings-grid-two,
    .batch-workflow-grid,
    .mini-stat-grid,
    .analysis-grid,
    .job-profile-grid,
    .integ-key-grid,
    .integ-source-grid,
    .company-fact-grid,
    .compact-fact-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-meta,
    .discovery-hero-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-panel-actions,
    .settings-actions-inline,
    .batch-run-actions,
    .discovery-viewbar,
    .opportunity-actions-dense,
    .pipeline-inline-form {
        width: 100%;
    }

    .job-decision-actions {
        grid-template-columns: 1fr;
    }

    .hero-panel-actions .btn-primary,
    .hero-panel-actions .btn-secondary,
    .settings-actions-inline .btn-primary,
    .settings-actions-inline .btn-secondary,
    .batch-run-actions .btn-secondary,
    .pipeline-save-btn {
        width: 100%;
    }

    /* Show filter toggle button on mobile */
    .discovery-filter-toggle {
        display: inline-flex;
    }

    /* Discovery filter rail: hidden by default, toggled via JS */
    .discovery-filter-rail {
        display: none;
    }
    .discovery-filter-rail.filter-rail-open {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Increase tap targets for Interested / Pass on mobile */
    .opportunity-actions-dense .btn-primary,
    .opportunity-actions-dense .btn-secondary,
    .opportunity-actions-dense .opportunity-action-link,
    .opportunity-actions .btn-primary,
    .opportunity-actions .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 16px;
    }

    /* Prevent feedback widget from overlapping pipeline board */
    .feedback-widget {
        bottom: 12px;
        right: 12px;
        z-index: 900;
    }

    /* Discovery grid overflow prevention */
    .discovery-editorial-layout {
        overflow: hidden;
    }
}

/* ─── INTEGRATIONS POLISH ─────────────────────────────────────────── */

.integ-section-label {
    margin-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

/* Settings card headers need breathing room before content */
.settings-card .settings-card-header {
    margin-bottom: 18px;
}

/* Top-level model plan cards */
.integ-model-plan .integ-highlight-row {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 18px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-summary-card {
    border: 1px solid var(--line);
    padding: 18px;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.provider-summary-card:hover {
    border-color: var(--primary);
}

.provider-editor-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.provider-editor-shell > summary {
    padding: 18px 24px;
    cursor: pointer;
}
.provider-editor-shell[open] > summary {
    border-bottom: 1px solid var(--line);
}
.provider-editor-shell .provider-card-deep {
    border: none;
    border-radius: 0;
}

/* ─── BULK ACTIONS POLISH ─────────────────────────────────────────── */

.batch-stats-strip .integ-highlight-row {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 16px 18px;
    border-radius: var(--radius);
}

.batch-workflow-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
}
.batch-workflow-card .btn-secondary {
    align-self: flex-start;
}

/* ─── BANNER VARIANTS ─────────────────────────────────────────────── */

.settings-banner-success {
    background: var(--success-bg);
    border-color: rgba(5, 150, 105, 0.2);
}

.settings-banner-running {
    background: var(--primary-bg);
    border-color: rgba(37, 99, 235, 0.2);
    animation: pulse-bg 2s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── HERO ZONES ──────────────────────────────────────────────────── */

.dashboard-hero-main,
.discovery-hero-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    flex: 1;
    justify-content: center;
}

.discovery-hero-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 220px;
    flex-shrink: 0;
    align-items: flex-end;
}

.hero-panel-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-panel-copy {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
    margin: 0;
}

/* ─── DASHBOARD SECTIONS ──────────────────────────────────────────── */

.dashboard-priority-well {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px;
}

.attention-card-strong {
    background: var(--warning-bg);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* ─── MINI STATS ──────────────────────────────────────────────────── */

.mini-stat {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-stat-value {
    font-family: "Inter", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.pulse-row {
    padding: 14px 18px;
}

.pulse-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

/* ─── DISCOVERY ───────────────────────────────────────────────────── */

.sort-row {
    display: flex;
    gap: 10px;
}

.discovery-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.discovery-form-panel {
    padding: 24px;
    background: var(--surface-subtle);
    border-radius: var(--radius);
}

/* ─── RESULTS TOOLBAR ─────────────────────────────────────────────── */

.results-toolbar-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ─── ACTIVITY LOG ────────────────────────────────────────────────── */

.activity-title {
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.activity-error {
    font-size: 0.9rem;
    color: var(--danger);
    line-height: 1.55;
    margin-top: 6px;
}

/* ─── OPPORTUNITY CARDS ───────────────────────────────────────────── */

.opportunity-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opportunity-insight-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── SCORE RING INTERNALS ────────────────────────────────────────── */

.score-ring-number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
}

.score-ring-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ─── JOB DETAIL ──────────────────────────────────────────────────── */

.analysis-card-positive {
    border-left: 3px solid var(--success);
    background: var(--success-bg);
}

.analysis-card-caution {
    border-left: 3px solid var(--warning);
    background: var(--warning-bg);
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1rem;
    line-height: 1.65;
}

.company-card-logo {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

/* ─── BATCH OPS ───────────────────────────────────────────────────── */

.summary-strip-four {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* ─── PROFILE ─────────────────────────────────────────────────────── */

.profile-index-card {
    padding: 20px 24px;
    transition: background 0.15s ease;
}

.profile-index-card:hover { background: var(--surface-subtle); }

.profile-index-card-active {
    background: var(--surface-muted);
}

.profile-panel-accent,
.profile-panel-generated {
    background: var(--surface-subtle);
}

.settings-card-title-sm {
    font-family: "Inter", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ─── FORMS ───────────────────────────────────────────────────────── */

.settings-actions {
    padding-top: 24px;
    margin-top: 12px;
}

/* ─── DISCLOSURE / DETAILS ────────────────────────────────────────── */

.disclosure-summary {
    padding: 20px 24px;
    font-family: "Inter", sans-serif;
    font-weight: 700;
}

details[open] .disclosure-summary {
    background: var(--surface-subtle);
}

.disclosure-body {
    padding: 32px 24px;
}

/* ─── PROVIDERS ───────────────────────────────────────────────────── */

.provider-card-active {
    border-left: 3px solid var(--primary);
}

.provider-model-card-selected {
    background: var(--surface-muted);
}

/* ─── INTEGRATIONS / TASK ROUTING ─────────────────────────────────── */

.task-route-row {
    padding: 24px 0;
}

.task-route-name {
    font-family: "Inter", sans-serif;
    font-size: 1.15rem;
}

.integ-source-name {
    font-family: "Inter", sans-serif;
    font-size: 1.1rem;
}

.integ-source-live {
    background: var(--success-bg);
}

/* ─── SMALL UTILITIES ────────────────────────────────────────────── */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ─── MISSING UTILITIES (pass 1) ─────────────────────────────────── */

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mt-section { margin-top: 20px; }

.btn-full { width: 100%; }

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pipeline card — same as .list-row but no pointer / hover cursor */
.list-row-static {
    cursor: default;
}
.list-row-static:hover {
    background: var(--surface);
}

.empty-state-centered {
    align-items: center;
}

.empty-state.compact {
    padding: 24px 20px;
}

/* Single-column settings form (add-tag form, etc.) */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── ANALYSIS MARKERS ───────────────────────────────────────────── */

.analysis-marker {
    flex: 0 0 auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    margin-top: 3px;
    width: 16px;
    text-align: center;
}

.analysis-card-positive .analysis-marker { color: var(--success); }
.analysis-card-caution .analysis-marker { color: var(--warning); }

/* ─── PULSE ANIMATION ────────────────────────────────────────────── */

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.2); }
    50%       { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.0); }
}

.attention-card-pulse {
    animation: pulse-border 2.4s ease-in-out infinite;
}

/* ─── PIPELINE DRAG HINT ─────────────────────────────────────────── */

/* Hide hint text by default; show only on hover/active drag */
.pipeline-card-hint {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pipeline-job-card:hover .pipeline-card-hint {
    opacity: 1;
}

/* ─── TOAST NOTIFICATION SYSTEM ──────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--text);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    pointer-events: all;
    animation: toast-in 0.22s ease forwards;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warn    { background: var(--warning); }

.toast-msg { flex: 1; line-height: 1.45; }

.toast-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 2px;
}
.toast-dismiss:hover { color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0)   scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.toast.toast-hiding {
    animation: toast-out 0.2s ease forwards;
    pointer-events: none;
}

/* Auto-dismiss inline banners */
.settings-banner {
    transition: opacity 0.4s ease;
}
.settings-banner.banner-hiding {
    opacity: 0;
    pointer-events: none;
}

/* Close button for inline banners */
.banner-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}
.banner-close:hover { color: var(--text); }

/* sidebar active — border is set on the class itself above */

/* ─── EMPTY STATE ACTIONS ────────────────────────────────────────── */

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

/* ─── PASS 2: MISSING LAYOUT CLASSES ────────────────────────────── */

/* List row internal structure */
.list-row-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.list-row-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Dashboard hero action panel */
.hero-panel-wide {
    flex: 0 0 auto;
    min-width: 240px;
    max-width: 300px;
}

/* Company card info column */
.company-card-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

/* Profile workbench two-column form layout */
.profile-workbench {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-workbench-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

/* Muted text utility */
.text-muted { color: var(--muted); }

/* Ensure discovery-results-stack-tight inherits flex layout */
.discovery-results-stack-tight {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── PASS 2: SCORE RING ENHANCEMENTS ────────────────────────────── */

/* Larger, more impactful score ring for job detail */
.score-ring {
    width: 108px;
    height: 108px;
}

.score-ring-number {
    font-size: 2.1rem;
}

/* ─── PASS 2: RESPONSIVE GRID FIX ───────────────────────────────── */

@media (max-width: 1200px) {
    .profile-workbench-two-col {
        grid-template-columns: 1fr;
    }
    .hero-panel-wide {
        max-width: none;
        min-width: 0;
    }
}

/* Discovery card lower row should span full card width */
.opportunity-row-grid > .opportunity-lower {
    grid-column: 1 / -1;
}

@media (max-width: 1200px) {
    .pipeline-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .pipeline-board {
        grid-template-columns: 1fr;
    }
}

/* ─── REDESIGN: SEMANTIC SCORE COLORS ───────────────────────────── */

/* Score numbers in discovery cards match the card accent color */
.opportunity-card-high .opportunity-score-number { color: var(--success); }
.opportunity-card-mid  .opportunity-score-number { color: var(--warning); }
.opportunity-card-low  .opportunity-score-number { color: var(--danger);  }

/* ─── REDESIGN: TYPOGRAPHY REFINEMENTS ──────────────────────────── */

/* Letter-spacing tightening — Inter doesn't need as much as Space Grotesk */
.page-title,
.settings-title,
.job-hero-title {
    letter-spacing: -0.04em;
    font-weight: 800;
}

.section-title,
.settings-card-title,
.match-brief-title,
.pipeline-column-title {
    letter-spacing: -0.02em;
}

/* Brand tagline */
.app-brand-copy {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

/* ─── REDESIGN: IMPROVED LIST ROWS ──────────────────────────────── */

.list-row {
    border-bottom: 1px solid var(--line);
}

.list-stack .list-row:last-child {
    border-bottom: none;
}

.list-row-copy {
    margin: 0;
}

/* ─── REDESIGN: PILL REFINEMENTS ─────────────────────────────────── */

/* Less aggressive uppercase on metadata pills */
.provider-pill {
    text-transform: none;
    font-size: 0.75rem;
    letter-spacing: 0;
}

/* Uppercase for short filter labels only — not tag pills (names can be long) */
.sort-btn,
.discovery-viewchip {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag-pill {
    text-transform: none;
    letter-spacing: 0;
}

/* ─── REDESIGN: SCORE BADGE REFINEMENTS ─────────────────────────── */

.score-badge {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 4px;
}

/* ─── REDESIGN: IMPROVED ATTENTION CARD ─────────────────────────── */

.attention-card {
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── REDESIGN: MINI STAT POLISH ─────────────────────────────────── */

.mini-stat {
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.mini-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mini-stat-wide {
    grid-column: 1 / -1;
}

/* ─── REDESIGN: PIPELINE COLUMN HEADER COLORS ───────────────────── */

.pipeline-column-header-interested { border-top: 3px solid #d97706; }
.pipeline-column-header-applied    { border-top: 3px solid var(--primary); }
.pipeline-column-header-interviewing { border-top: 3px solid #7c3aed; }
.pipeline-column-header-offer      { border-top: 3px solid var(--success); }

/* ─── REDESIGN: OPPORTUNITY ACCENT COLORS ───────────────────────── */

/* Make accent bar on cards use the new palette */
.opportunity-card-draft .opportunity-accent { background: var(--line-strong); }

/* ─── DISCOVERY CARD DENSITY ─────────────────────────────────────── */

/* Card body: tighter padding and collapsed internal gaps */
.opportunity-card-row .opportunity-body {
    padding: 10px 14px;
    gap: 4px;
}

/* Context row (source + date): ultra-compact */
.opportunity-context-tight {
    gap: 6px;
    margin-bottom: 0;
}

/* Copy column: minimal gap between title / meta / insight */
.opportunity-card-row .opportunity-copy {
    gap: 3px;
}

/* Insight block: no extra internal gap, collapse flex-basis */
.opportunity-card-row .opportunity-insight-block {
    gap: 0;
    margin-top: 2px;
    flex: 0 0 auto;
}

/* Clamp insight to 1 line in row cards */
.opportunity-card-row .opportunity-insight-copy {
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Row grid: tighter column + row gap */
.opportunity-row-grid {
    gap: 4px 8px;
}

/* Lower row: tighter spacing */
.opportunity-card-row .opportunity-lower {
    gap: 6px 8px;
    margin-top: 4px;
}

/* Title size in dense cards */
.opportunity-copy-dense .opportunity-title {
    font-size: 0.95rem;
    line-height: 1.25;
}

/* Meta line: flush spacing, baseline-align all items */
.opportunity-card-row .opportunity-meta-line {
    margin-top: 1px;
    gap: 4px;
    font-size: 0.82rem;
    align-items: baseline;
}

/* Remove company top-margin inside row cards */
.opportunity-card-row .opportunity-company {
    margin-top: 0;
}

/* Score number in discovery cards */
.opportunity-score-rail-dense .opportunity-score-number {
    font-size: 1.25rem;
}

/* Fix btn-compact specificity — btn-secondary's min-height: 44px
   comes later in the cascade and overrides btn-compact's 32px */
.btn-secondary.btn-compact {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.75rem;
}

/* Compact pills inside card rows */
.opportunity-card-row .job-source-pill {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.65rem;
}
.opportunity-card-row .provider-pill {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.65rem;
}

/* Between-card gap */
.discovery-results-stack-tight {
    gap: 14px;
}

/* ─── DISCOVERY FEED SECTION SPACING ─────────────────────────────── */

/* Toolbar: side-by-side layout, less padding */
.discovery-feed .results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

/* Consistent vertical rhythm between feed sections */
.discovery-feed .discovery-viewbar {
    margin-top: 14px;
}
.discovery-feed .discovery-results-stack {
    margin-top: 14px;
}
.discovery-feed .pagination-row {
    margin-top: 14px;
}

/* ─── DISCOVERY HERO BUTTONS ─────────────────────────────────────── */

/* Give the hero-side more breathing room */
.discovery-hero-compact .discovery-hero-side {
    gap: 14px;
    justify-content: center;
}
.discovery-hero-compact .hero-panel-actions {
    gap: 10px;
}

/* ─── DOCUMENTATION ───────────────────────────────────────────────── */

.docs-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 20px;
}

.docs-nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.docs-nav-link:hover {
    background: var(--surface-subtle);
}

.docs-nav-link-active {
    background: var(--surface);
    font-weight: 700;
    border: 1px solid var(--line);
}

.docs-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.docs-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.docs-section {
    margin-bottom: var(--space-5);
}

.docs-section:last-child {
    margin-bottom: 0;
}

.docs-section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.docs-section-body {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0;
}

.docs-list {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0;
    padding-left: 20px;
}

.docs-list li {
    margin-bottom: 6px;
}

/* Markdown-rendered guide content */
.prose-guide h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}
.prose-guide h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
}
.prose-guide h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
}
.prose-guide p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0 0 var(--space-3) 0;
}
.prose-guide ul, .prose-guide ol {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0 0 var(--space-3) 0;
    padding-left: 20px;
}
.prose-guide li {
    margin-bottom: 6px;
}
.prose-guide strong {
    color: var(--text);
    font-weight: 600;
}
.prose-guide img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin: var(--space-3) 0;
}
.prose-guide blockquote {
    border-left: 3px solid var(--primary);
    padding: var(--space-2) var(--space-4);
    margin: var(--space-3) 0;
    background: var(--surface-subtle);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.prose-guide blockquote p {
    margin: 0;
}
.prose-guide code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85em;
    background: var(--surface-muted);
    padding: 2px 6px;
    border-radius: 3px;
}
.prose-guide pre {
    background: var(--surface-muted);
    padding: var(--space-3);
    border-radius: var(--radius);
    overflow-x: auto;
    margin: var(--space-3) 0;
}
.prose-guide pre code {
    background: none;
    padding: 0;
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        position: static;
    }
}

/* ─── ANALYTICS PAGE ──────────────────────────────────────────────── */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .analytics-grid { grid-template-columns: 1fr; }
}

.analytics-bar-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 0;
    min-height: 100px;
}

.analytics-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.analytics-bar-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
}

.analytics-bar-0 { background: var(--danger); }
.analytics-bar-1 { background: var(--warning); }
.analytics-bar-2 { background: var(--primary); }
.analytics-bar-3 { background: var(--success); }
.analytics-bar-4 { background: var(--line-strong); }

.analytics-bar-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-funnel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

.analytics-funnel-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-funnel-label {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 90px;
}

.analytics-funnel-bar-track {
    flex: 1;
    height: 18px;
    background: var(--surface-muted);
    border-radius: 3px;
    overflow: hidden;
}

.analytics-funnel-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    min-width: 4px;
}

.analytics-funnel-count {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 30px;
    text-align: right;
}

/* ─── LOGS PAGE ───────────────────────────────────────────────────── */

.logs-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.logs-stats-row .mini-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 100px;
}

.logs-filter-row {
    margin-bottom: var(--space-3);
}

.logs-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.logs-filter-select {
    width: auto;
    min-width: 140px;
}

.logs-table-wrap {
    overflow-x: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.logs-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.logs-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.logs-table tbody tr:hover {
    background: var(--surface-subtle);
}

.logs-cell-mono {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.logs-cell-query {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logs-cell-error {
    color: var(--danger);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logs-row-error {
    background: rgba(239, 68, 68, 0.04);
}

.logs-row-skipped {
    opacity: 0.6;
}

/* ─── TRANSITION LOG ──────────────────────────────────────────────── */

.transition-log {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.transition-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.transition-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
}

.transition-entry-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.transition-arrow {
    color: var(--muted);
    font-size: 0.85rem;
}

.transition-comment {
    color: var(--muted);
    font-size: 0.82rem;
    font-style: italic;
}

.transition-date {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ─── IDEAS ───────────────────────────────────────────────────────── */

.ideas-layout {
    max-width: 720px;
}

.ideas-add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ideas-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ideas-priority-select {
    width: auto;
    min-width: 100px;
}

.ideas-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ideas-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: border-color 0.15s ease;
}

.ideas-filter-chip:hover {
    border-color: var(--line-strong);
}

.ideas-filter-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ideas-filter-count {
    font-size: 0.72rem;
    opacity: 0.7;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.ideas-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    border-left: 3px solid var(--line);
}

.ideas-card-high {
    border-left-color: var(--warning);
}

.ideas-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ideas-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ideas-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.ideas-card-body {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.ideas-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ideas-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ideas-status-new { background: var(--primary-bg); color: var(--primary); }
.ideas-status-noted { background: var(--warning-bg); color: #b45309; }
.ideas-status-done { background: var(--success-bg); color: var(--success); }
.ideas-status-shelved { background: var(--surface-muted); color: var(--muted); }

.ideas-card-date {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    color: var(--muted);
}

.ideas-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.ideas-action-btn {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s ease;
}

.ideas-action-btn:hover {
    background: var(--surface-subtle);
}

.ideas-action-danger {
    color: var(--danger);
}

.ideas-action-danger:hover {
    background: rgba(239, 68, 68, 0.06);
}

/* ─── FEEDBACK WIDGET ─────────────────────────────────────────────── */

.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.feedback-trigger {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sidebar);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feedback-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.feedback-trigger.hidden {
    display: none;
}

.feedback-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.feedback-panel.hidden {
    display: none;
}

.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
}

.feedback-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.feedback-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
    line-height: 1;
}

.feedback-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-body.hidden {
    display: none;
}

.feedback-sentiment-row {
    display: flex;
    gap: 8px;
}

.feedback-sentiment-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.feedback-sentiment-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface-subtle);
}

.feedback-sentiment-active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.feedback-comment {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.feedback-comment:focus {
    outline: none;
    border-color: var(--primary);
}

.feedback-submit {
    align-self: flex-end;
    min-height: 34px;
    padding: 0 18px;
    font-size: 0.8rem;
}

.feedback-thanks {
    padding: 24px 16px;
    text-align: center;
}

.feedback-thanks.hidden {
    display: none;
}

.feedback-thanks-text {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--success);
}
