  :root {
    --aptly-cream: #f8f7f2;
    --aptly-white: #ffffff;
    --aptly-dark-green: #1a2e0f;
    --aptly-primary-green: #2d5016;
    --aptly-accent-green: #4a7c28;
    --aptly-light-green: #97c459;
    --aptly-pale-green: #c0dd97;
    --aptly-text: #111210;
    --aptly-text-muted: #7a7868;
    --aptly-text-faint: #b0ae9f;
    --aptly-border: rgba(45, 80, 22, 0.1);
    --aptly-border-strong: rgba(45, 80, 22, 0.16);
    --aptly-shadow-card: 0 1px 2px rgba(17, 18, 16, 0.03);
    /* Pipeline stage tokens, lifted from inline hex in home.js renderJobsPipelineAndBreakdown. */
    --stage-applied: #888780;
    --stage-screened: #888780;
    --stage-shortlisted: #4a7c28;
    --stage-interviewing: #185fa5;
    --stage-offered: #534ab7;
    --stage-placed: #1a2e0f;
    --stage-zero: rgba(26, 46, 15, 0.18);
    /* Jobs breakdown stacked-numerals dot colours.
       Open reuses accent green. Filled is warm dark slate #4a4940 to avoid the pipeline blue
       (#185fa5 Interviewing) and pipeline mute grey (#888780 Applied/Screened). On hold is the
       existing text-faint mute. */
    --breakdown-open: #4a7c28;
    --breakdown-filled: #4a4940;
    --breakdown-onhold: #b4b2a9;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'DM Sans', sans-serif; background: #f8f7f2; color: #111210; min-height: 100vh; -webkit-font-smoothing: antialiased; }

  nav { padding: 14px 40px; border-bottom: 1px solid #e2e0d8; display: flex; justify-content: space-between; align-items: center; background: #ffffff; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .logo { font-family: 'DM Serif Display', serif; font-size: 22px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; background: #2d5016; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .logo-mark span { font-family: 'DM Serif Display', serif; font-style: italic; font-size: 20px; color: white; line-height: 1; }
  .logo em { font-style: italic; color: #4a7c28; }
  .nav-right { display: flex; align-items: center; gap: 16px; }
  .nav-scans { font-size: 12px; font-weight: 500; background: #edf5df; color: #2d5016; padding: 5px 12px; border-radius: 999px; border: 1px solid #d0e9ae; }
  .nav-scans.low { background: #fff3e0; color: #a05c00; border-color: #f0c890; }
  .nav-scans.empty { background: #fef2f2; color: #b91c1c; border-color: #fcd4d4; }
  .nav-link { font-size: 13px; color: #7a7868; cursor: pointer; text-decoration: none; transition: color 150ms ease; background: none; border: none; font-family: 'DM Sans', sans-serif; }
  .nav-link:hover { color: #2d5016; }
  .nav-link.active { padding: 7px 16px; background: #2d5016; color: white !important; border-radius: 8px; font-size: 12px; font-weight: 500; }
  .nav-link.active:hover { color: white !important; background: #3a6a1d; }

  .page { display: none; }
  .page.active { display: block; }
  .container { max-width: none; margin: 0; padding: 40px 48px; }
  .container-sm { max-width: 480px; margin: 0 auto; padding: 60px 40px; }

  /* ── SIDEBAR ── */
  #app-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 57px); }
  #app-sidebar { display: none; width: 220px; background: white; border-right: 1px solid #e2e0d8; flex-shrink: 0; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; flex-direction: column; z-index: 90; }
  #pages-wrapper { flex: 1; min-width: 0; overflow-x: hidden; }
  .snav-item { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 1px 8px; padding: 9px 10px; border: none; background: transparent; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 400; color: #4a4940; border-radius: 8px; text-align: left; transition: background 150ms ease, color 150ms ease; white-space: nowrap; text-decoration: none; }
  .snav-item:hover { background: #f8f7f2; color: #2d5016; }
  .snav-item.active { background: #edf5df; color: #2d5016; font-weight: 600; }
  .snav-section-label { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #b0ae9f; padding: 12px 18px 4px; }
  #sidebar-footer { padding: 12px 14px; border-top: 1px solid #e2e0d8; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .sidebar-avatar { width: 30px; height: 30px; border-radius: 50%; background: #2d5016; color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }

  /* ── PAGE TOPBAR ── */
  .page-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid #e2e0d8; flex-wrap: wrap; gap: 16px; }
  .page-topbar-left h2 { margin-bottom: 4px; }
  .page-topbar-left p { font-size: 13px; color: #7a7868; margin: 0; line-height: 1.6; }
  .page-topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

  h1 { font-family: 'DM Serif Display', serif; font-size: 42px; font-weight: 400; letter-spacing: -1px; margin-bottom: 12px; line-height: 1.15; }
  h1 em { font-style: italic; color: #4a7c28; }
  h2 { font-family: 'DM Serif Display', serif; font-size: 28px; font-weight: 400; margin-bottom: 8px; line-height: 1.3; }
  .subtitle { font-size: 16px; font-weight: 400; color: #4a4940; margin-bottom: 48px; line-height: 1.65; }

  .card { background: white; border: 1px solid #e2e0d8; border-radius: 8px; padding: 32px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .card-title { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #7a7868; margin-bottom: 20px; }

  label { display: block; font-size: 13px; font-weight: 500; color: #111210; margin-bottom: 8px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input[type="search"] { width: 100%; padding: 11px 12px; border: 1px solid #e2e0d8; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: #111210; background: #f8f7f2; outline: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
  input:focus { border-color: #4a7c28; box-shadow: 0 0 0 3px rgba(158,203,108,0.35); }
  textarea { width: 100%; padding: 11px 12px; border: 1px solid #e2e0d8; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: #111210; background: #f8f7f2; resize: vertical; min-height: 120px; outline: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
  textarea:focus { border-color: #4a7c28; box-shadow: 0 0 0 3px rgba(158,203,108,0.35); }
  .form-row { margin-bottom: 20px; }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-error { font-size: 12px; color: #b91c1c; margin-top: 6px; display: none; }
  .form-success { font-size: 12px; color: #2d5016; margin-top: 6px; display: none; }

  .pw-meter { margin-top: 8px; }
  .pw-meter-bars { display: flex; gap: 4px; margin-bottom: 6px; }
  .pw-meter-bar { flex: 1; height: 4px; background: #ece9df; border-radius: 2px; transition: background-color 120ms ease; }
  .pw-meter-bar.is-active-0 { background: #f0d5a0; }
  .pw-meter-bar.is-active-1 { background: #b8860b; }
  .pw-meter-bar.is-active-2 { background: var(--aptly-accent-green, #4a7c28); }
  .pw-meter-bar.is-active-3 { background: var(--aptly-primary-green, #2d5016); }
  .pw-meter-bar.is-active-4 { background: var(--aptly-primary-green, #2d5016); }
  .pw-meter-label { font-size: 12px; color: var(--aptly-text-muted, #7a7868); margin: 0; line-height: 1.4; }
  .pw-meter-label.is-error { color: #b91c1c; }

  .pw-input-wrap { position: relative; display: block; }
  .pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; padding: 4px; cursor: pointer; color: var(--aptly-text-muted, #7a7868); display: inline-flex; align-items: center; justify-content: center; }
  .pw-toggle:hover { color: var(--aptly-primary-green, #2d5016); }
  .pw-toggle:focus-visible { outline: 2px solid var(--aptly-primary-green, #2d5016); outline-offset: 2px; border-radius: 4px; }
  .pw-toggle svg { width: 18px; height: 18px; }
  .pw-input-wrap input[type="password"],
  .pw-input-wrap input[type="text"] { padding-right: 38px; }

  .btn-primary { width: 100%; padding: 13px 20px; background: #2d5016; color: white; border: none; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 150ms ease; box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 1px 2px rgba(45,80,22,0.18); }
  .btn-primary:hover { background: #3a6a1d; }
  .btn-primary:disabled { background: #b0ae9f; cursor: not-allowed; }
  .btn-secondary { width: 100%; padding: 12px 20px; background: transparent; color: #4a4940; border: 1.5px solid #e2e0d8; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 150ms ease; }
  .btn-secondary:hover { border-color: #2d5016; color: #2d5016; }
  .btn-small { padding: 7px 14px; background: transparent; color: #7a7868; border: 1px solid #e2e0d8; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 150ms ease; white-space: nowrap; }
  .btn-small:hover { border-color: #4a7c28; color: #2d5016; }
  .btn-danger { padding: 7px 14px; background: transparent; color: #b91c1c; border: 1px solid #fcd4d4; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 150ms ease; }
  .btn-danger:hover { background: #fef2f2; border-color: #f0a0a0; }
  .btn-back { background: none; border: none; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #7a7868; cursor: pointer; padding: 0; transition: color 150ms ease; display: inline-flex; align-items: center; gap: 4px; }
  .btn-back:hover { color: #2d5016; }

  .auth-toggle { display: flex; gap: 0; margin-bottom: 32px; border: 1px solid #e2e0d8; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .auth-tab { flex: 1; padding: 12px; text-align: center; cursor: pointer; font-size: 13px; font-weight: 500; color: #7a7868; background: white; transition: all 150ms ease; border: none; font-family: 'DM Sans', sans-serif; }
  .auth-tab.active { background: #2d5016; color: white; }
  .auth-form { display: none; }
  .auth-form.active { display: block; }
  .auth-divider { text-align: center; font-size: 12px; color: #b4b2a9; margin: 20px 0; }

  .file-drop { border: 2px dashed #e2e0d8; border-radius: 10px; padding: 40px; text-align: center; cursor: pointer; transition: all 150ms ease; background: #f8f7f2; }
  .file-drop:hover, .file-drop.active { border-color: #4a7c28; background: #edf5df; }
  .file-drop p { font-size: 14px; color: #7a7a72; margin-bottom: 8px; }
  .file-drop span { font-size: 12px; color: #b4b2a9; }
  .file-list { margin-top: 16px; }
  .file-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #eef4e8; border-radius: 4px; margin-bottom: 8px; font-size: 13px; }
  .file-item span { color: #2d5016; font-weight: 500; }
  .file-remove { cursor: pointer; color: #7a7a72; font-size: 16px; background: none; border: none; }

  /* ── LOADING ── */
  .loading-wrap { max-width: 860px; margin: 0 auto; padding: 80px 40px; display: flex; align-items: center; gap: 60px; min-height: 60vh; }
  .loading-left { flex: 1; display: flex; flex-direction: column; gap: 14px; }
  .loading-right { flex: 1; }
  .loading-title { font-family: 'DM Serif Display', serif; font-size: 28px; font-weight: 300; margin-bottom: 36px; color: #111210; }
  .loading-title em { font-style: italic; color: #4a7c28; }
  .lcard { background: white; border: 1px solid #e0ddd3; border-radius: 8px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; opacity: 0; transform: translateX(-20px); transition: all 0.4s ease; }
  .lcard.visible { opacity: 1; transform: translateX(0); }
  .lcard.done { border-color: #c8e6b0; background: #f4faf0; }
  .lcard-avatar { width: 36px; height: 36px; border-radius: 50%; background: #eef4e8; display: flex; align-items: center; justify-content: center; font-family: 'DM Serif Display', serif; font-size: 16px; color: #2d5016; flex-shrink: 0; }
  .lcard-lines { flex: 1; }
  .lcard-name { height: 10px; background: #e0ddd3; border-radius: 4px; margin-bottom: 8px; width: 60%; }
  .lcard-name.done { background: #b8dca0; }
  .lcard-detail { height: 8px; background: #eeede8; border-radius: 4px; width: 80%; }
  .lcard-detail.done { background: #d0ecc0; }
  .lcard-score { font-size: 13px; font-weight: 500; color: #b4b2a9; flex-shrink: 0; min-width: 36px; text-align: right; }
  .lcard-score.done { color: #4a7c28; }
  .lcard-check { font-size: 16px; opacity: 0; transition: opacity 0.3s; flex-shrink: 0; }
  .lcard.done .lcard-check { opacity: 1; }
  .loading-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
  .lstep { display: flex; align-items: center; gap: 14px; opacity: 0.3; transition: all 0.4s ease; }
  .lstep.active { opacity: 1; }
  .lstep.complete { opacity: 1; }
  .lstep-icon { width: 28px; height: 28px; border-radius: 50%; background: #e0ddd3; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #7a7a72; flex-shrink: 0; transition: all 0.3s; }
  .lstep.active .lstep-icon { background: #eef4e8; color: #4a7c28; animation: pulse 1.5s ease-in-out infinite; }
  .lstep.complete .lstep-icon { background: #4a7c28; color: white; }
  .lstep-text { font-size: 14px; color: #3d3d38; }
  .lstep.active .lstep-text { font-weight: 500; color: #111210; }
  .loading-note { font-size: 12px; color: #b4b2a9; }
  @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

  /* ── RESULTS ── */
  .results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
  .results-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .btn-expand { font-size: 12px; font-weight: 500; color: #7a7868; background: transparent; border: 1px solid #e2e0d8; border-radius: 6px; padding: 8px 14px; cursor: pointer; transition: all 150ms ease; }
  .btn-expand:hover { border-color: #4a7c28; color: #2d5016; }
  .btn-pdf { font-size: 12px; font-weight: 500; color: white; background: #2d5016; border: none; border-radius: 6px; padding: 8px 16px; cursor: pointer; transition: background 150ms ease; }
  .btn-pdf:hover { background: #3a6a1d; }
  .btn-pdf:disabled { background: #b0ae9f; cursor: not-allowed; }
  .btn-send-all { font-size: 12px; font-weight: 500; color: white; background: #1d4ed8; border: none; border-radius: 6px; padding: 8px 16px; cursor: pointer; transition: background 150ms ease; }
  .btn-send-all:hover { background: #1a44c0; }
  .btn-send-all:disabled { background: #b0ae9f; cursor: not-allowed; }

  .summary-table { background: white; border: 1px solid #e2e0d8; border-radius: 10px; overflow: visible; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .summary-row { border-left: 3px solid transparent; border-bottom: 1px solid #e2e0d8; }
  .summary-row:last-child { border-bottom: none; }
  .summary-row.verdict-strong { border-left-color: #4a7c28; }
  .summary-row.verdict-borderline { border-left-color: #b8860b; }
  .summary-row.verdict-no { border-left-color: #c0392b; }
  .summary-top { display: grid; grid-template-columns: 44px 1fr 160px 150px 110px 220px 36px; align-items: center; gap: 16px; padding: 18px 24px; cursor: pointer; user-select: none; }
  .summary-top:hover { background: #f8f7f2; }
  .rank-num { font-size: 13px; font-weight: 500; color: #7a7a72; text-align: center; }
  .candidate-info .name { font-size: 14px; font-weight: 500; color: #111210; margin-bottom: 2px; }
  .candidate-info .email-link { font-size: 12px; color: #4a7c28; text-decoration: none; }
  .candidate-info .email-link:hover { text-decoration: underline; }
  .score-col { display: flex; align-items: center; gap: 8px; }
  .score-col .num { font-size: 14px; font-weight: 500; color: #4a7c28; min-width: 32px; }
  .score-col .bar-track { flex: 1; height: 4px; background: #e0ddd3; border-radius: 2px; }
  .score-col .bar-fill { height: 100%; border-radius: 2px; background: #4a7c28; }
  .verdict-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
  .verdict-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .vb-strong { background: #edf5df; color: #2d5016; }
  .vb-strong::before { background: #2d5016; }
  .vb-borderline { background: #fff3e0; color: #a05c00; }
  .vb-borderline::before { background: #a05c00; }
  .vb-no { background: #fef2f2; color: #b91c1c; }
  .vb-no::before { background: #b91c1c; }
  .flag-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
  .fb-none { background: #edf5df; color: #2d5016; }
  .fb-mild { background: #fff3e0; color: #a05c00; }
  .fb-moderate { background: #fef2f2; color: #b91c1c; }
  .fb-strong { background: #fef2f2; color: #b91c1c; }
  .expand-icon { font-size: 18px; color: #b4b2a9; text-align: center; transition: transform 0.2s; }
  .expand-icon.open { transform: rotate(180deg); }
  .detail-panel { display: none; border-top: 1px solid #e0ddd3; background: #fafaf7; }
  .detail-panel.open { display: block; }
  .detail-inner { padding: 24px 20px 24px 68px; }
  .detail-section-title { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: #7a7a72; margin-bottom: 10px; margin-top: 20px; }
  .detail-section-title:first-child { margin-top: 0; }
  .email-type-label { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; margin-bottom: 10px; }
  .etl-shortlist, .etl-progress { background: #eef4e8; color: #2d5016; }
  .etl-reject { background: #faeeda; color: #854f0b; }
  .reason-list { list-style: none; }
  .reason-list li { font-size: 13px; color: #3d3d38; padding: 4px 0 4px 16px; position: relative; line-height: 1.5; }
  .reason-list li::before { content: '—'; position: absolute; left: 0; color: #4a7c28; }
  .gap-list li::before { color: #b8860b; }
  .ai-flag-detail { font-size: 12px; color: #7a7a72; margin-top: 6px; font-style: italic; }
  .score-summary { font-size: 13px; color: var(--aptly-text-muted); font-style: italic; margin: 6px 0 12px 0; line-height: 1.4; }
  .confidence-line { font-size: 13px; color: var(--aptly-text-muted); font-style: italic; margin: 6px 0 12px 0; line-height: 1.4; }
  .confidence-value-low { color: #3d5a6c; font-weight: 500; font-style: normal; }
  .gem-note { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; background: #e8f0f7; color: #1c4a72; margin-top: 8px; }
  .email-preview { background: white; border: 1px solid #e0ddd3; border-radius: 6px; padding: 20px; margin-bottom: 16px; }
  .email-to { font-size: 12px; color: #7a7a72; margin-bottom: 4px; }
  .email-to a { color: #4a7c28; text-decoration: none; }
  .email-subject { font-size: 13px; font-weight: 500; margin-bottom: 12px; color: #111210; border-bottom: 1px solid #e0ddd3; padding-bottom: 10px; }
  .email-body { font-size: 13px; color: #3d3d38; line-height: 1.7; white-space: pre-wrap; }
  .email-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
  .copy-btn { padding: 7px 14px; background: transparent; border: 1px solid #e2e0d8; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: #7a7868; cursor: pointer; transition: all 150ms ease; }
  .copy-btn:hover { border-color: #4a7c28; color: #2d5016; }
  .copy-btn.copied { border-color: #4a7c28; color: #2d5016; background: #edf5df; }
  .send-btn { padding: 7px 14px; background: #2d5016; border: none; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: white; cursor: pointer; transition: background 150ms ease; }
  .send-btn:hover { background: #3a6a1d; }
  .send-btn:disabled { background: #b0ae9f; cursor: not-allowed; }
  .send-btn.sent { background: #4a7c28; }
  .interview-section { background: white; border: 1px solid #e0ddd3; border-radius: 8px; padding: 28px; margin-top: 8px; }
  .interview-section h3 { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 300; margin-bottom: 24px; }
  .accordion { border: 1px solid #e2e0d8; border-radius: 8px; margin-bottom: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(17,18,16,0.04); }
  .accordion-header { padding: 14px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; background: #f8f7f2; transition: background 150ms ease; color: #111210; }
  .accordion-header:hover { background: #edf5df; color: #2d5016; }
  .accordion-body { padding: 16px 18px; display: none; border-top: 1px solid #e2e0d8; background: white; }
  .accordion-body.open { display: block; }
  .accordion-body li { font-size: 13px; color: #4a4940; padding: 5px 0; line-height: 1.6; }
  .btn-new-search { display: block; margin: 32px auto 0; padding: 12px 32px; background: transparent; border: 1.5px solid #e0ddd3; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: #3d3d38; cursor: pointer; transition: all 0.15s; }
  .btn-new-search:hover { border-color: #4a7c28; color: #4a7c28; }

  /* ── PROFILE ── */
  .profile-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
  .profile-tabs { display: flex; gap: 0; margin-bottom: 32px; border-bottom: 2px solid #e2e0d8; }
  .profile-tab { padding: 14px 24px; text-align: center; cursor: pointer; font-size: 14px; font-weight: 400; color: #7a7868; background: transparent; transition: all 150ms ease; border: none; font-family: 'DM Sans', sans-serif; border-bottom: 2px solid transparent; margin-bottom: -2px; }
  .profile-tab.active { color: #2d5016; font-weight: 600; border-bottom-color: #2d5016; background: transparent; }
  .profile-tab:not(.active):hover { color: #2d5016; }
  .profile-tab-content { display: none; }
  .profile-tab-content.active { display: block; }
  .profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: #eef4e8; display: flex; align-items: center; justify-content: center; font-family: 'DM Serif Display', serif; font-size: 22px; color: #2d5016; flex-shrink: 0; }
  .profile-name { font-size: 18px; font-weight: 500; }
  .profile-email-text { font-size: 13px; color: #7a7a72; }
  .plan-card { background: #edf5df; border: 1px solid #d0e9ae; border-radius: 10px; padding: 20px 24px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .plan-info .plan-name { font-size: 14px; font-weight: 600; color: #2d5016; margin-bottom: 4px; }
  .plan-info .plan-scans { font-size: 13px; color: #4a7c28; }
  .scan-bar-wrap { flex: 1; min-width: 160px; }
  .scan-bar-track { height: 5px; background: #c8e6b0; border-radius: 999px; margin-bottom: 6px; }
  .scan-bar-fill { height: 100%; border-radius: 999px; background: #2d5016; transition: width 300ms ease; }
  .scan-bar-label { font-size: 11px; color: #4a7c28; font-weight: 500; }
  .upgrade-banner { background: #faeeda; border: 1px solid #f0d9b5; border-radius: 8px; padding: 20px 24px; margin-bottom: 24px; display: none; }
  .upgrade-banner h3 { font-size: 15px; font-weight: 500; color: #854f0b; margin-bottom: 6px; }
  .upgrade-banner p { font-size: 13px; color: #6b3f08; margin-bottom: 14px; }

  /* ── OUT-OF-SCANS CTAs ── */
  /* Surface A: header badge becomes clickable in empty state */
  .nav-scans.empty.cta { cursor: pointer; border: 1px solid #fcd4d4; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease; }
  .nav-scans.empty.cta:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(185, 28, 28, 0.18); background: #fee5e5; }

  /* Surface C: sidebar plan card CTA (healthy state hover) */
  .sidebar-plan-cta:hover { border-color: var(--aptly-primary-green); color: var(--aptly-primary-green); }
  /* Surface C: sidebar plan card CTA escalation (empty state) */
  #sidebar-plan.empty .sidebar-plan-cta { background: var(--aptly-primary-green); color: var(--aptly-cream); border-color: var(--aptly-primary-green); }
  #sidebar-plan.empty .sidebar-plan-cta:hover { background: var(--aptly-accent-green); border-color: var(--aptly-accent-green); color: var(--aptly-cream); }

  /* ── HOME DASHBOARD (redesign) ── */
  .home-hero {
    position: relative;
    padding: 8px 0 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--aptly-border);
    background:
      radial-gradient(900px 220px at 92% -40%, rgba(158, 203, 108, 0.16), transparent 65%),
      radial-gradient(700px 180px at 6% 120%, rgba(208, 233, 174, 0.30), transparent 60%);
  }
  .home-hero-left { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .home-date-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 11px;
    background: var(--aptly-white);
    border: 1px solid var(--aptly-border);
    border-radius: 999px;
    font-size: 11.5px; font-weight: 500;
    color: var(--aptly-text-muted);
    letter-spacing: 0;
    text-transform: none;
  }
  .home-date-pill::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--aptly-accent-green);
    box-shadow: 0 0 0 3px rgba(158, 203, 108, 0.22);
    flex-shrink: 0;
  }
  .home-greeting { font-family: 'DM Serif Display', serif; font-size: 30px; font-weight: 400; margin: 0; line-height: 1.1; letter-spacing: -0.01em; color: var(--aptly-text); }
  .home-greeting em { font-style: italic; color: var(--aptly-accent-green); }
  .home-company { font-size: 13px; color: var(--aptly-text-muted); margin: 6px 0 0; }
  .home-hero-summary {
    font-size: 14px; color: var(--aptly-text-muted);
    margin: 10px 0 0; max-width: 520px; line-height: 1.5;
  }
  .home-hero-summary:empty { display: none; }
  .home-hero-summary strong { color: var(--aptly-text); font-weight: 600; }

  .home-pill-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
  }
  .home-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--cream-soft, #f3f0e6);
    border: 1px solid var(--rule, #e0ddd3);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink, #111210);
    line-height: 1.2;
    font-family: 'DM Sans', sans-serif;
  }
  .home-pill-label {
    color: var(--ink-tertiary, #7a7a72);
    font-weight: 400;
  }
  .home-pill-value {
    color: var(--ink, #111210);
    font-weight: 600;
  }
  .home-pill-scans.low { background: #fff4e3; border-color: #f0d5a0; color: #854f0b; }
  .home-pill-scans.empty {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
    cursor: pointer;
    transition: transform 80ms ease, box-shadow 80ms ease;
  }
  .home-pill-scans.empty:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(185,28,28,0.12); }

  .home-metrics-skeleton {
    background: var(--green-deep, #1a2e0f);
    border-radius: var(--r-lg, 14px);
    min-height: 168px;
    opacity: 0.92;
  }

  #home-metrics-card:not(:empty) { margin-bottom: 32px; }
  #home-jobs-list { margin-bottom: 32px; }
  #home-attention-bar:not(:empty) { margin-bottom: 16px; }

  .home-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
  .home-section-title { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 400; margin: 0; letter-spacing: -0.01em; color: var(--aptly-text); }
  .home-section-title em { font-style: italic; color: var(--aptly-accent-green); }
  .home-section-sub { font-size: 12px; color: var(--aptly-text-muted); margin: 4px 0 0; }
  .home-section-link { font-size: 12px; color: var(--aptly-accent-green); text-decoration: none; font-weight: 500; }
  .home-section-link:hover { text-decoration: underline; }

  .home-card { background: var(--aptly-white); border-radius: 8px; border: 1px solid var(--aptly-border); padding: 24px 28px; box-shadow: var(--aptly-shadow-card); }
  .home-card-header { margin-bottom: 24px; }
  .home-card-title { font-family: 'DM Serif Display', serif; font-size: 18px; font-weight: 400; margin: 0; letter-spacing: -0.005em; color: var(--aptly-text); }
  .home-card-title em { font-style: italic; color: var(--aptly-accent-green); }
  .home-card-sub { font-size: 11px; color: var(--aptly-text-muted); margin: 3px 0 0; }

  .home-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 32px; }

  /* Pipeline horizontal bars: one row per stage, label + track + count. */
  .home-pipeline { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
  .home-pipeline-row { display: grid; grid-template-columns: 96px 1fr 32px; column-gap: 14px; align-items: center; }
  .home-pipeline-label { font-size: 12.5px; color: var(--ink-soft, #3d3d38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-pipeline-row.is-zero .home-pipeline-label,
  .home-pipeline-row.is-zero .home-pipeline-count { color: var(--ink-tertiary, #7a7a72); }
  .home-pipeline-track { background: rgba(26,46,15,0.06); height: 8px; border-radius: 999px; overflow: hidden; }
  .home-pipeline-fill { height: 100%; border-radius: 999px; transition: width 200ms ease; }
  .home-pipeline-count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink, #111210); font-weight: 500; text-align: right; }

  /* Jobs breakdown: vertical stacked numerals, one per status. */
  .home-breakdown-stack { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
  .home-breakdown-row { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center; }
  .home-breakdown-dot { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 999px; }
  .home-breakdown-num { font-family: 'DM Serif Display', serif; font-size: 26px; line-height: 1; color: var(--ink, #111210); font-variant-numeric: tabular-nums; }
  .home-breakdown-label { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-tertiary, #7a7a72); }

  /* Open jobs card list: loose cards, no outer shell. */
  .home-jobs-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
  .home-job-card { display: grid; grid-template-columns: 1fr auto auto auto; column-gap: 18px; align-items: center; padding: 16px 20px; background: var(--paper, #ffffff); border: 1px solid var(--rule, #e0ddd3); border-radius: var(--r-md, 10px); cursor: pointer; transition: border-color 80ms ease, transform 80ms ease, box-shadow 80ms ease; }
  .home-job-card:hover { border-color: var(--rule-strong, #c8c4b7); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(26,46,15,0.05); }
  .home-job-card-main { min-width: 0; }
  .home-job-card-title { font-size: 14.5px; font-weight: 500; color: var(--ink, #111210); display: flex; align-items: center; gap: 8px; }
  .home-job-card-meta { font-size: 11.5px; color: var(--ink-tertiary, #7a7a72); margin-top: 3px; }
  .home-job-card-stats { font-size: 12.5px; color: var(--ink-soft, #3d3d38); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .home-job-card-chevron { color: var(--ink-quiet, #b4b2a9); }
  .home-job-card-urgent-dot { width: 7px; height: 7px; border-radius: 999px; background: #f59e0b; flex-shrink: 0; }

  /* Stage pills reused by the new card list. */
  .home-jobs-stage-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 500;
  }
  .home-jobs-stage-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .home-jobs-stage-pill--success     { background: #edf5df; color: #2d5016; }
  .home-jobs-stage-pill--info        { background: #eff6ff; color: #1d4ed8; }
  .home-jobs-stage-pill--warning     { background: #fff3e0; color: #a05c00; }
  .home-jobs-stage-pill--success-dark{ background: #1a2e0f; color: #c0dd97; }
  .home-jobs-stage-pill--neutral     { background: #f0eee5; color: #3d3d38; }
  .home-jobs-stage-pill--neutral .home-jobs-stage-dot { background: #b0ae9f; }

  .home-plan-dark { background: var(--aptly-dark-green); color: var(--aptly-cream); border-radius: 8px; padding: 28px 32px; position: relative; overflow: hidden; }
  .home-plan-dark-decoration { position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(151, 196, 89, 0.06); pointer-events: none; }
  .home-plan-dark-content { position: relative; }
  .home-plan-dark-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
  .home-plan-dark-eyebrow { font-size: 10px; letter-spacing: 0.14em; color: var(--aptly-light-green); margin: 0 0 6px; text-transform: uppercase; font-weight: 500; }
  .home-plan-dark-title { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 400; margin: 0; letter-spacing: -0.005em; color: var(--aptly-cream); }
  .home-plan-dark-title em { font-style: italic; color: var(--aptly-cream); }
  .home-plan-dark-meta { font-size: 11px; color: var(--aptly-pale-green); margin: 0; }
  .home-plan-dark-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .home-plan-dark-stat-num { font-family: 'DM Serif Display', serif; font-size: 32px; font-weight: 400; margin: 0; line-height: 1; letter-spacing: -0.01em; color: var(--aptly-cream); font-variant-numeric: tabular-nums; }
  .home-plan-dark-stat-unit { font-size: 16px; color: var(--aptly-pale-green); margin-left: 4px; }
  .home-plan-dark-stat-label { font-size: 11px; color: var(--aptly-light-green); margin: 8px 0 2px; letter-spacing: 0.06em; text-transform: uppercase; }
  .home-plan-dark-stat-sub { font-size: 11px; color: var(--aptly-pale-green); margin: 0; }

  .home-empty-hero { background: var(--aptly-white); border-radius: 12px; padding: 64px 48px; border: 1px solid var(--aptly-border); box-shadow: var(--aptly-shadow-card); margin-bottom: 32px; position: relative; overflow: hidden; }
  .home-empty-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(to right, var(--aptly-dark-green), var(--aptly-accent-green), var(--aptly-light-green)); }
  .home-empty-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
  .home-empty-hero-eyebrow { font-size: 11px; letter-spacing: 0.12em; color: var(--aptly-accent-green); margin: 0 0 12px; text-transform: uppercase; font-weight: 500; }
  .home-empty-hero-title { font-family: 'DM Serif Display', serif; font-size: 32px; font-weight: 400; margin: 0 0 12px; line-height: 1.15; letter-spacing: -0.01em; color: var(--aptly-text); }
  .home-empty-hero-title em { font-style: italic; color: var(--aptly-accent-green); }
  .home-empty-hero-body { font-size: 15px; color: #3d3d38; margin: 0 0 24px; line-height: 1.55; max-width: 480px; }
  .home-empty-hero-cta { background: var(--aptly-dark-green); color: var(--aptly-cream); border: none; padding: 13px 22px; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; letter-spacing: -0.005em; }
  .home-empty-hero-cta:hover { background: var(--aptly-primary-green); }
  .home-empty-hero-checks { display: flex; gap: 32px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--aptly-border); }
  .home-empty-hero-check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .home-empty-hero-check-label { font-size: 12px; font-weight: 500; margin: 0; color: var(--aptly-text); }
  .home-empty-hero-check-sub { font-size: 11px; color: var(--aptly-text-muted); margin: 0; }
  .home-empty-hero-side { display: flex; flex-direction: column; gap: 12px; align-items: stretch; min-width: 200px; }
  .home-empty-hero-side-card { background: var(--aptly-cream); border: 1px solid var(--aptly-border-strong); border-radius: 8px; padding: 14px 16px; }
  .home-empty-hero-side-label { font-size: 10px; letter-spacing: 0.12em; color: var(--aptly-text-muted); margin: 0 0 8px; text-transform: uppercase; }
  .home-empty-hero-side-num { font-family: 'DM Serif Display', serif; font-size: 28px; font-weight: 400; margin: 0; color: var(--aptly-dark-green); line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
  .home-empty-hero-side-unit { font-size: 13px; color: #3d3d38; margin-left: 4px; }
  .home-empty-hero-side-sub { font-size: 11px; color: #3d3d38; margin: 6px 0 0; }

  .home-empty-skeletons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; opacity: 0.55; }
  .home-empty-skeleton-card { background: var(--aptly-white); border-radius: 8px; border: 1px solid var(--aptly-border); padding: 18px 20px; text-align: center; }
  .home-empty-skeleton-label { font-size: 10px; letter-spacing: 0.12em; color: var(--aptly-text-muted); margin: 0 0 8px; text-transform: uppercase; }
  .home-empty-skeleton-num { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 400; margin: 0; color: var(--aptly-text-muted); line-height: 1; }
  .home-empty-skeleton-caption { font-size: 11px; color: var(--aptly-text-muted); margin: 12px 0 0; text-align: center; }

  @media (max-width: 768px) {
    .home-charts-row { grid-template-columns: 1fr; }
    .home-empty-hero-grid { grid-template-columns: 1fr; gap: 24px; }
    .home-empty-hero { padding: 40px 28px; }
    .home-plan-dark-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .home-greeting { font-size: 24px; }
    .home-hero-summary { font-size: 13px; }
  }

  /* ── JOBS ── */
  .job-card { background: white; border: 1px solid #e2e0d8; border-radius: 10px; padding: 20px 24px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease; box-shadow: 0 1px 3px rgba(17,18,16,0.05); }
  .job-card:hover { border-color: #4a7c28; box-shadow: 0 4px 12px rgba(17,18,16,0.08); }
  .job-card-info { flex: 1; }
  .job-card-title { font-size: 15px; font-weight: 500; color: #111210; margin-bottom: 4px; }
  .job-card-meta { font-size: 12px; color: #7a7a72; }
  .job-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
  .js-open { background: #eef4e8; color: #2d5016; }
  .js-filled { background: #e8f0f7; color: #1c4a72; }
  .js-on-hold { background: #faeeda; color: #854f0b; }
  .job-card-stats { display: flex; gap: 20px; flex-shrink: 0; }
  .job-stat { text-align: center; }
  .job-stat-num { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 300; color: #2d5016; }
  .job-stat-label { font-size: 10px; color: #7a7a72; text-transform: uppercase; letter-spacing: 0.5px; }
  .filter-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }

  /* ── SPEC BUILDER ── */
  .spec-path-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
  .spec-path-card { background: white; border: 2px solid #e2e0d8; border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all 200ms ease-out; box-shadow: 0 1px 3px rgba(17,18,16,0.06); }
  .spec-path-card:hover { border-color: #4a7c28; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(17,18,16,0.10); }
  .spec-path-icon { font-size: 32px; margin-bottom: 16px; }
  .spec-path-title { font-size: 16px; font-weight: 500; margin-bottom: 8px; }
  .spec-path-desc { font-size: 13px; color: #7a7a72; line-height: 1.5; }
  .spec-flag { background: #faeeda; border: 1px solid #f0c890; border-radius: 6px; padding: 12px 16px; margin-bottom: 10px; font-size: 13px; color: #854f0b; display: flex; gap: 10px; align-items: flex-start; }
  .spec-flag-ok { background: #eef4e8; border: 1px solid #c8e6b0; border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #2d5016; display: flex; gap: 10px; align-items: center; }
  .questionnaire { max-width: 700px; }
  .q-section { margin-bottom: 32px; }
  .q-section-title { font-size: 11px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: #4a7c28; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid #e0ddd3; }
  .q-row { margin-bottom: 20px; }
  .q-optional { font-size: 11px; color: #b4b2a9; font-weight: 400; margin-left: 6px; }
  .seniority-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
  .seniority-btn { padding: 7px 16px; border: 1.5px solid #e2e0d8; border-radius: 999px; font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer; background: white; color: #4a4940; transition: all 150ms ease; }
  .seniority-btn:hover { border-color: #4a7c28; color: #2d5016; }
  .seniority-btn.active { border-color: #2d5016; background: #2d5016; color: white; }
  /* ── SLIDER GROUP (Arc 2: replaces 8-tag picker) ── */
  .slider-group { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
  .slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
  .slider-row-label-text { font-size: 13px; font-weight: 500; color: #111210; }
  .slider-row-label-hint { font-size: 11px; color: #7a7a72; margin-top: 2px; }
  .slider-row-pills { display: inline-flex; gap: 0; border: 1px solid #e0ddd3; border-radius: 999px; overflow: hidden; background: #f8f7f2; }
  .slider-pill { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; padding: 6px 14px; border: none; background: transparent; color: #7a7a72; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
  .slider-pill:hover { color: #111210; }
  .slider-pill.active { background: #2d5016; color: white; }
  .slider-pill.active.slider-pill-less { background: #b8860b; }
  .slider-pill.active.slider-pill-normal { background: #7a7a72; }
  .slider-pill.active.slider-pill-more { background: #2d5016; }
  @media (max-width: 640px) {
    .slider-row { grid-template-columns: 1fr; gap: 6px; }
    .slider-row-pills { align-self: flex-start; }
  }
  .spec-loading { text-align: center; padding: 80px 40px; }
  .spec-loading-steps { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 32px auto 0; }
  .spec-loading-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: white; border: 1px solid #e0ddd3; border-radius: 8px; font-size: 14px; color: #7a7a72; transition: all 0.3s; }
  .spec-loading-step.active { border-color: #4a7c28; color: #111210; font-weight: 500; }
  .spec-loading-step.done { border-color: #c8e6b0; color: #2d5016; }
  .spec-step-icon { width: 24px; height: 24px; border-radius: 50%; background: #e0ddd3; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; transition: all 0.3s; }
  .spec-loading-step.active .spec-step-icon { background: #eef4e8; color: #4a7c28; animation: pulse 1.5s ease-in-out infinite; }
  .spec-loading-step.done .spec-step-icon { background: #4a7c28; color: white; }

/* ── STAGE PIPELINE ── */
.stage-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
  .stage-applied { background: #e8f0f7; color: #1c4a72; }
  .stage-applied { background: #e8f0f7; color: #1c4a72; }
  .stage-screened { background: #f0ede6; color: #7a7a72; }
  .stage-shortlisted { background: #eef4e8; color: #2d5016; }
  .stage-interviewing { background: #e8f0f7; color: #1c4a72; }
  .stage-offered { background: #f0e8f7; color: #6b2d8c; }
  .stage-placed { background: #1a2e0f; color: #6ab04c; }
  .stage-rejected { background: #fcebeb; color: #a32d2d; }
  .stage-btn { padding: 7px 14px; border: 1.5px solid #e0ddd3; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; background: white; color: #3d3d38; transition: all 0.15s; }
  .stage-btn:hover { border-color: #4a7c28; color: #4a7c28; }
  .stage-btn-green { border-color: #c8e6b0; color: #2d5016; background: #eef4e8; }
  .stage-btn-green:hover { background: #d8f0c8; border-color: #4a7c28; }
  .stage-btn-red { border-color: #f0c0c0; color: #a32d2d; }
  .stage-btn-red:hover { background: #fcebeb; border-color: #a32d2d; }
  .stage-btn-blue { border-color: #b8d4e8; color: #1c4a72; background: #e8f0f7; }
  .stage-btn-blue:hover { background: #d0e4f4; border-color: #1c4a72; }
  .stage-btn-placed { border-color: #1a2e0f; color: #2d5016; background: #eef4e8; }
  .stage-btn-placed:hover { background: #1a2e0f; color: #6ab04c; }

/* ── STAGE DROPDOWN ── */
.stage-col { position: relative; }
  .stage-badge-btn { cursor: pointer; border: none; background: none; padding: 0; font-family: 'DM Sans', sans-serif; }
  .stage-dropdown { position: absolute; top: calc(100% + 4px); left: 0; background: white; border: 1px solid #e0ddd3; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 200; min-width: 160px; padding: 4px 0; }
  .stage-dropdown-item { display: block; width: 100%; padding: 9px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif; cursor: pointer; background: none; border: none; text-align: left; color: #3d3d38; transition: background 0.1s; }
  .stage-dropdown-item:hover { background: #f8f7f2; }

  /* ── INTERACTIVE STAGE TRACK ── */
  .stage-track-wrap { display: flex; align-items: center; gap: 16px; padding: 16px 0 20px; border-bottom: 1px solid #f0ede6; margin-bottom: 16px; flex-wrap: wrap; }
  .st-track { display: flex; align-items: flex-start; flex: 1; min-width: 0; position: relative; }
  .st-step { display: flex; flex-direction: column; align-items: center; flex: 1; cursor: pointer; position: relative; }
  .st-step:not(:last-child)::after { content: ''; position: absolute; top: 9px; left: 50%; width: 100%; height: 2px; background: #e8e5dc; z-index: 0; transition: background 0.2s; }
  .st-step.done:not(:last-child)::after, .st-step.active:not(:last-child)::after { background: #4a7c28; }
  .st-dot { width: 20px; height: 20px; border-radius: 50%; background: #e2e0d8; border: 2px solid #e2e0d8; position: relative; z-index: 1; transition: all 150ms ease; flex-shrink: 0; }
  .st-step.done .st-dot { background: #4a7c28; border-color: #4a7c28; }
  .st-step.active .st-dot { background: white; border-color: #4a7c28; box-shadow: 0 0 0 3px rgba(158,203,108,0.35); }
  .st-step:hover .st-dot { border-color: #4a7c28; transform: scale(1.15); }
  .st-step.done:hover .st-dot { background: #3a6a1d; }
  .st-label { font-size: 9px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: #b0ae9f; margin-top: 6px; text-align: center; white-space: nowrap; transition: color 150ms ease; }
  .st-step.done .st-label, .st-step.active .st-label, .st-step:hover .st-label { color: #4a7c28; }
  .st-step.active .st-label { color: #2d5016; font-weight: 700; }
  .stage-track-reject-btn { padding: 6px 14px; background: transparent; border: 1px solid #f0c0c0; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; color: #a32d2d; cursor: pointer; transition: all 0.15s; white-space: nowrap; flex-shrink: 0; }
  .stage-track-reject-btn:hover { background: #fcebeb; border-color: #a32d2d; }
  .stage-track-rejected-state { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: #fcebeb; border: 1px solid #f0c0c0; border-radius: 6px; }
  .stage-track-restore-btn { background: none; border: none; font-family: 'DM Sans', sans-serif; font-size: 12px; color: #7a7a72; cursor: pointer; text-decoration: underline; padding: 0; }
  .stage-track-restore-btn:hover { color: #2d5016; }
  @media (max-width: 640px) { .st-track { display: none; } .stage-track-wrap { padding: 10px 0 14px; } .stage-track-mobile { display: flex !important; } .mini-track { display: none !important; } }
  .mini-track { display: flex; align-items: center; gap: 0; }
  .mt-step { display: flex; align-items: center; flex: 1; position: relative; }
  .mt-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0ddd3; border: 2px solid #e0ddd3; flex-shrink: 0; position: relative; z-index: 1; transition: all 0.2s; }
  .mt-step.done .mt-dot { background: #4a7c28; border-color: #4a7c28; }
  .mt-step.active .mt-dot { background: white; border-color: #4a7c28; box-shadow: 0 0 0 2px rgba(74,124,41,0.2); }
  .mt-step.rejected .mt-dot { background: #e8b4b4; border-color: #e8b4b4; }
  .mt-line { flex: 1; height: 2px; background: #e0ddd3; transition: background 0.2s; }
  .mt-step.done .mt-line { background: #4a7c28; }
  .mt-rejected-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; color: #a32d2d; background: #fcebeb; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
  .stage-track-mobile { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .stm-btn { padding: 6px 12px; border: 1.5px solid #e0ddd3; border-radius: 20px; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; cursor: pointer; background: white; color: #3d3d38; transition: all 0.15s; }
  .stm-btn.active { border-color: #2d5016; background: #eef4e8; color: #2d5016; }
  .stm-btn:hover { border-color: #4a7c28; color: #4a7c28; }

  /* ── REJECTED SECTION ── */
  .rejected-section { margin-top: 24px; }
  .rejected-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fef2f2; border: 1px solid #fcd4d4; border-radius: 8px; cursor: pointer; transition: background 150ms ease; user-select: none; }
  .rejected-header:hover { background: #fef2f2; border-color: #f0a0a0; }
  .rejected-header-title { font-size: 13px; font-weight: 500; color: #a32d2d; flex: 1; }
  .rejected-body { display: none; margin-top: 8px; }
  .rejected-body.open { display: block; }

  /* ── INLINE JOB DROP ZONE ── */
  .job-drop-section { margin-top: 32px; border: 2px dashed #e2e0d8; border-radius: 10px; padding: 28px; text-align: center; transition: all 150ms ease; background: #f8f7f2; cursor: pointer; }
  .job-drop-section.active { border-color: #4a7c28; background: #edf5df; }
  .job-drop-section:hover { border-color: #4a7c28; }
  .job-drop-section p { font-size: 14px; color: #7a7a72; margin-bottom: 8px; }
  .job-drop-section span { font-size: 12px; color: #b4b2a9; }
  .job-drop-files { margin-top: 12px; text-align: left; }
  .job-drop-loading { display: none; text-align: center; padding: 24px 20px; }
  .inline-spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid #e0ddd3; border-top-color: #2d5016; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .inline-loading-steps { display: flex; flex-direction: column; gap: 8px; max-width: 280px; margin: 16px auto 0; text-align: left; }
  .inline-loading-step { font-size: 13px; color: #b4b2a9; display: flex; align-items: center; gap: 8px; transition: color 0.3s; }
  .inline-loading-step.active { color: #2d5016; font-weight: 500; }
  .inline-loading-step.done { color: #4a7c28; }
  .inline-step-dot { width: 6px; height: 6px; border-radius: 50%; background: #e0ddd3; flex-shrink: 0; transition: background 0.3s; }
  .inline-loading-step.active .inline-step-dot { background: #2d5016; animation: pulse 1s ease-in-out infinite; }
  .inline-loading-step.done .inline-step-dot { background: #4a7c28; }

  /* ── CLIENT STATUS ── */
  .client-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
  .cs-active { background: #eef4e8; color: #2d5016; }
  .cs-prospect { background: #e8f0f7; color: #1c4a72; }
  .cs-dormant { background: #f0ede6; color: #7a7a72; }
  .cs-do_not_contact { background: #fcebeb; color: #a32d2d; }

/* ── COMMENT BADGE ── */
.comment-badge { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 500; background: #e8f0f7; color: #1c4a72; }

/* ── STALE SCORE CHIP ── shown when application.last_scored_at < job.scoring_inputs_updated_at */
.stale-chip { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; background: #fff3e0; color: #854f0b; cursor: help; margin-top: 4px; white-space: nowrap; }
.stale-chip-mini { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 500; background: #fff3e0; color: #854f0b; cursor: help; white-space: nowrap; }
.confidence-low-chip { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; background: #e9eef2; color: #3d5a6c; }
.confidence-low-chip-mini { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 500; background: #e9eef2; color: #3d5a6c; }
/* Rotation utility — pairs with the @keyframes spin defined earlier (.inline-spinner uses it too) */
.spin { animation: spin 1s linear infinite; }

/* ── PIPELINE HEALTH ── */
.pipeline-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 500; }
  .ph-empty { background: #f0ede6; color: #b4b2a9; }
  .ph-screening { background: #eef4e8; color: #2d5016; }
  .ph-interviewing { background: #e8f0f7; color: #1c4a72; }
  .ph-offer_out { background: #f0e8f7; color: #6b2d8c; }
  .ph-placed { background: #1a2e0f; color: #6ab04c; }

  /* ── JOB NOTES ── */
  .notes-area { width: 100%; padding: 11px 12px; border: 1px solid #e2e0d8; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #111210; background: #f8f7f2; resize: vertical; min-height: 80px; outline: none; line-height: 1.6; transition: border-color 150ms ease, box-shadow 150ms ease; }
  .notes-area:focus { border-color: #4a7c28; box-shadow: 0 0 0 3px rgba(158,203,108,0.35); }

/* ── REFERRAL SIDEBAR CARD ── */
/* Card styling lives inline on #sidebar-referral so it mirrors #sidebar-plan exactly;
   this rule only ensures the empty state collapses cleanly. */
#sidebar-referral:empty { display: none !important; }

/* ── SHARE MODAL ── */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(17,18,16,0.48); backdrop-filter: blur(2px); z-index: 500; display: flex; align-items: center; justify-content: center; }
  .modal { background: white; border-radius: 12px; padding: 32px; max-width: 520px; width: 90%; box-shadow: 0 12px 32px rgba(17,18,16,0.18); }
  .modal h3 { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 300; margin-bottom: 8px; }
  .modal p { font-size: 13px; color: #7a7a72; margin-bottom: 20px; line-height: 1.6; }
  .share-link-box { display: flex; gap: 8px; margin-bottom: 16px; }
  .share-link-input { flex: 1; padding: 10px 14px; border: 1px solid #e0ddd3; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: #3d3d38; background: #f8f7f2; outline: none; }
  .modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
  .session-warning-modal-countdown { font-family: 'DM Sans', sans-serif; font-weight: 600; color: #b91c1c; font-feature-settings: "tnum"; }

  /* ── HISTORY ── */
  .history-empty { text-align: center; padding: 60px 20px; color: #7a7a72; }
  .history-empty p { font-size: 15px; margin-bottom: 24px; }
  .history-item { background: white; border: 1px solid #e2e0d8; border-radius: 10px; padding: 20px 24px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: border-color 150ms ease, box-shadow 150ms ease; box-shadow: 0 1px 3px rgba(17,18,16,0.05); }
  .history-item:hover { border-color: #4a7c28; box-shadow: 0 4px 12px rgba(17,18,16,0.08); }
  .history-info { flex: 1; }
  .history-role { font-size: 15px; font-weight: 500; color: #111210; margin-bottom: 4px; }
  .history-meta { font-size: 12px; color: #7a7a72; }
  .history-stats { display: flex; gap: 16px; align-items: center; flex-shrink: 0; }
  .history-stat { text-align: center; }
  .history-stat-num { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 300; color: #2d5016; }
  .history-stat-label { font-size: 10px; color: #7a7a72; text-transform: uppercase; letter-spacing: 0.5px; }
  .history-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .btn-history-view { padding: 7px 16px; background: #2d5016; border: none; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: white; cursor: pointer; transition: background 0.15s; }
  .btn-history-view:hover { background: #3d6a1e; }
  .btn-history-delete { padding: 7px 12px; background: transparent; border: 1px solid #f0c0c0; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: #a32d2d; cursor: pointer; transition: all 0.15s; }
  .btn-history-delete:hover { background: #fcebeb; }
  .history-expires { font-size: 11px; color: #b4b2a9; margin-top: 4px; }

  /* ── JOBS TABLE REDESIGN ── */
  .jobs-stats-strip { display: none; grid-template-columns: repeat(4,1fr); background: #e2e0d8; gap: 1px; border-radius: 10px; overflow: hidden; border: 1px solid #e2e0d8; margin-bottom: 20px; }
  .jobs-stat-cell { background: white; padding: 14px 24px; }
  .jobs-stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: #7a7868; margin-bottom: 4px; }
  .jobs-stat-value { font-family: 'DM Serif Display', serif; font-size: 26px; color: #111210; letter-spacing: -0.02em; line-height: 1; }
  .jobs-table-header { display: grid; grid-template-columns: 1fr 130px 100px 100px 110px 24px; padding: 8px 22px; margin-bottom: 4px; }
  .jobs-table-header span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #7a7868; }
  .jobs-table-wrap { background: white; border: 1px solid #e2e0d8; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(17,18,16,0.05); }
  .jobs-table-row { display: grid; grid-template-columns: 1fr 130px 100px 100px 110px 24px; align-items: center; padding: 15px 22px; border-bottom: 1px solid #e2e0d8; cursor: pointer; transition: background 120ms ease; }
  .jobs-table-row:last-child { border-bottom: none; }
  .jobs-table-row:hover { background: #fdfcf9; }
  .jobs-table-row:hover .jtrow-chevron { opacity: 1; }
  .jtrow-chevron { opacity: 0; transition: opacity 120ms; display: flex; justify-content: flex-end; align-items: center; }
  .pipeline-dots { display: flex; gap: 3px; align-items: center; margin-top: 7px; }
  .pipeline-dot-seg { height: 3px; width: 16px; border-radius: 999px; background: #e2e0d8; }
  .pipeline-dot-seg.active { background: #9ecb6c; }
  .jobs-footer-row { display: flex; align-items: center; padding: 12px 2px; color: #7a7868; font-size: 12px; margin-top: 6px; }

  /* ── JOB PAGE HEADER ── */
  .job-page-header { background: white; border-bottom: 1px solid #e2e0d8; margin: -40px -48px 32px; padding: 28px 48px 24px; }
  .job-status-dd { display: none; position: absolute; top: calc(100% + 4px); left: 0; background: white; border: 1px solid #e2e0d8; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); z-index: 200; min-width: 130px; padding: 4px 0; }
  .job-status-dd-wrap { position: relative; }
  @media (max-width: 768px) {
    .job-page-header { margin: -32px -20px 24px; padding: 20px 20px 18px; }
  }
  @media (max-width: 640px) {
    .job-page-header { margin: -40px -20px 24px; padding: 20px 20px 18px; }
  }

  /* ── KANBAN VIEW ── */
  .kanban-board { display: flex; gap: 12px; align-items: flex-start; min-width: max-content; }
  .kanban-col { flex-shrink: 0; width: 264px; background: #f8f7f2; border-radius: 10px; border: 1px solid #e2e0d8; overflow: hidden; }
  .kanban-col-header { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #e2e0d8; }
  .kanban-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; flex: 1; }
  .kanban-col-count { font-size: 11px; font-weight: 600; color: #7a7868; background: white; border: 1px solid #e2e0d8; border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
  .kanban-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
  .kanban-card { background: white; border: 1px solid #e2e0d8; border-radius: 8px; padding: 10px 12px; transition: border-color 150ms ease, box-shadow 150ms ease; position: relative; }
  .kanban-card:hover { border-color: #4a7c28; box-shadow: 0 2px 8px rgba(17,18,16,0.08); }
  .kanban-empty { font-size: 12px; color: #b0ae9f; text-align: center; padding: 20px 8px; font-style: italic; }
  .view-toggle-btn { padding: 6px 14px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; border: none; transition: all 150ms ease; }

  @media (max-width: 768px) {
    #app-sidebar { display: none !important; }
    #pages-wrapper { width: 100%; }
    .container { padding: 32px 20px; }
    #page-auth > div > div:first-child { display: none !important; }
    #page-auth > div > div:last-child { padding: 40px 24px; }
    .jobs-stats-strip { grid-template-columns: repeat(2,1fr); }
    .jobs-table-header { display: none; }
    .jobs-table-row { grid-template-columns: 1fr auto; }
    .jobs-table-row > div:nth-child(2), .jobs-table-row > div:nth-child(3), .jobs-table-row > div:nth-child(4) { display: none; }
  }
  @media (max-width: 640px) {
    nav { padding: 14px 20px; }
    .container { padding: 40px 20px; }
    .container-sm { padding: 40px 20px; }
    .two-col { grid-template-columns: 1fr; }
    .summary-top { grid-template-columns: 28px 1fr 80px 32px; gap: 8px; }
    .stage-col { display: none; }
    .score-col { display: none; }
    .detail-inner { padding: 20px 16px; }
    .loading-wrap { flex-direction: column; padding: 40px 20px; gap: 32px; }
    .history-item { flex-direction: column; align-items: flex-start; }
    .home-stats { grid-template-columns: 1fr 1fr; }
    .spec-path-cards { grid-template-columns: 1fr; }
  }

  /* Candidate detail panel: in-row tab system */
  .row-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e2e0d8;
    margin-bottom: 16px;
    padding: 0 4px;
  }
  .row-tab {
    padding: 10px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #7a7a72;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
  }
  .row-tab:hover { color: #3d3d38; }
  .row-tab.active { color: #2d5016; border-bottom-color: #2d5016; }
  .row-tab-content { display: none; }
  .row-tab-content.active { display: block; }

  /* Detail panel two-column: main + right rail */
  .detail-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
  }
  .detail-rail {
    background: #f8f7f2;
    border: 1px solid #e0ddd3;
    border-radius: 8px;
    padding: 14px 16px;
  }
  .detail-rail-section + .detail-rail-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e0ddd3;
  }
  @media (max-width: 1280px) {
    .detail-layout { grid-template-columns: 1fr; }
  }

  /* Sticky context band */
  .detail-sticky {
    position: sticky;
    top: 0;
    background: white;
    z-index: 5;
    padding: 12px 0 12px 0;
    border-bottom: 1px solid #e2e0d8;
    margin-bottom: 14px;
  }

  /* Communication chip in row header */
  .comm-chip {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
  }
  .comm-chip-empty { background: transparent; border: 1.5px dashed #b8b6a8; }
  .comm-chip-half { background: #c8e6b0; }
  .comm-chip-full { background: #2d5016; }

/* ───────── In-app AI assistant ───────── */

#assistant-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 400px;
  max-width: 90vw;
  background: #f8f7f2;
  border-left: 1px solid #e2e0d8;
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 9000;
}

#assistant-panel.open {
  transform: translateX(0);
}

@media (max-width: 900px) {
  #assistant-panel { width: 90vw; }
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e0d8;
  background: #fff;
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #2d5016;
}

.assistant-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #7a7868;
}

.assistant-close-btn:hover {
  color: #2d5016;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-msg {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
}

.assistant-msg-user {
  align-self: flex-end;
  background: #2d5016;
  color: #fff;
}

.assistant-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: #1f1e18;
  border: 1px solid #e2e0d8;
}

.assistant-msg-bot p { margin: 0 0 8px; }
.assistant-msg-bot p:last-child { margin-bottom: 0; }
.assistant-msg-bot ul, .assistant-msg-bot ol { margin: 6px 0 6px 18px; padding: 0; }
.assistant-msg-bot li { margin: 2px 0; }
.assistant-msg-bot code {
  background: #f0eee5;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12.5px;
}
.assistant-msg-bot pre {
  background: #f0eee5;
  padding: 8px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12.5px;
}
.assistant-msg-bot strong { font-weight: 600; }

.assistant-typing {
  display: flex;
  gap: 4px;
}

.assistant-typing::after {
  content: "● ● ●";
  letter-spacing: 4px;
  animation: assistant-pulse 1.2s ease-in-out infinite;
  color: #7a7868;
}

@keyframes assistant-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.assistant-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e0d8;
  background: #fff;
}

.assistant-input {
  flex: 1;
  resize: none;
  border: 1px solid #e2e0d8;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1f1e18;
  outline: none;
}

.assistant-input:focus {
  border-color: #2d5016;
}

.assistant-input:disabled {
  background: #f0eee5;
  cursor: not-allowed;
}

.assistant-send-btn {
  background: #2d5016;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.assistant-send-btn:hover {
  background: #1f3a0f;
}

.assistant-send-btn:disabled {
  background: #b8b6ac;
  cursor: not-allowed;
}

.assistant-counter {
  font-size: 11px;
  color: #7a7868;
  text-align: center;
  padding: 6px 12px 10px;
  background: #fff;
  border-top: 1px solid #f0eee5;
}

/* Returning-user dashboard rebuild (Stage 2). Appended block. */
:root {
  --aptly-accent-subtle: rgba(74, 124, 40, 0.10);
}

.home-top-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
  padding: 4px 0 8px;
}
@media (max-width: 899px) {
  .home-top-row { grid-template-columns: 1fr; }
}
.home-top-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.home-date-line {
  font-size: 12.5px;
  color: var(--aptly-text-muted);
  font-weight: 400;
  margin: 0;
}
.home-top-summary {
  font-size: 14px;
  color: var(--aptly-text-muted);
  margin: 4px 0 0;
  max-width: 520px;
  line-height: 1.5;
}
.home-top-summary strong { color: var(--aptly-text); font-weight: 600; }

.home-metric-strip {
  background: var(--aptly-white);
  border: 1px solid var(--aptly-border);
  border-radius: 14px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  box-shadow: var(--aptly-shadow-card);
}
@media (max-width: 599px) {
  .home-metric-strip { grid-template-columns: 1fr; }
}
.home-metric-cell { display: flex; flex-direction: column; min-width: 0; }
.home-metric-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--aptly-text-muted);
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 6px;
}
.home-metric-num {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  color: var(--aptly-accent-green);
  margin: 0;
  letter-spacing: -0.01em;
}
.home-metric-unit {
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  margin-left: 4px;
  color: var(--aptly-accent-green);
}
.home-metric-sub {
  font-size: 11.5px;
  color: var(--aptly-text-muted);
  margin: 6px 0 0;
}

.home-tile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 24px;
}
@media (max-width: 899px) {
  .home-tile-row { grid-template-columns: 1fr; }
}
.home-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
  border: 1px solid var(--aptly-border);
  background: var(--aptly-white);
  color: var(--aptly-text);
}
.home-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 18, 16, 0.06);
}
.home-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--aptly-cream);
  color: var(--aptly-accent-green);
}
.home-tile-icon i { width: 18px; height: 18px; }
.home-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-tile-title { font-size: 14px; font-weight: 600; color: inherit; margin: 0; }
.home-tile-sub { font-size: 12px; color: var(--aptly-text-muted); margin: 0; }
.home-tile-primary {
  background: var(--aptly-primary-green);
  border-color: var(--aptly-primary-green);
  color: var(--aptly-white);
}
.home-tile-primary .home-tile-icon {
  background: rgba(255, 255, 255, 0.14);
  color: var(--aptly-white);
}
.home-tile-primary .home-tile-sub { color: rgba(255, 255, 255, 0.78); }
.home-tile-primary:hover {
  background: var(--aptly-dark-green);
  border-color: var(--aptly-dark-green);
}

.home-needs { margin-bottom: 28px; }
.home-needs-list { display: flex; flex-direction: column; gap: 2px; }
.home-needs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 120ms ease;
  gap: 12px;
}
.home-needs-row:hover { background: #fbfaf5; }
.home-needs-row-left { min-width: 0; }
.home-needs-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--aptly-text);
  margin: 0;
}
.home-needs-row-sub {
  font-size: 11.5px;
  color: var(--aptly-text-muted);
  margin: 2px 0 0;
}
.home-needs-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--aptly-accent-subtle);
  color: var(--aptly-accent-green);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.home-needs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  color: var(--aptly-text-muted);
  gap: 8px;
}
.home-needs-empty i { width: 24px; height: 24px; color: var(--aptly-accent-green); }
.home-needs-loading {
  padding: 18px 16px;
  color: var(--aptly-text-muted);
  font-size: 13px;
}
.home-needs-error {
  padding: 12px 16px;
  color: var(--aptly-text-muted);
  font-size: 13px;
}

.home-jobs-table-wrap {
  background: var(--aptly-white);
  border: 1px solid var(--aptly-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.home-jobs-header {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(480px, 2fr) 24px;
  column-gap: 14px;
  align-items: center;
  padding: 10px 18px;
  background: var(--aptly-cream);
  border-top: 1px solid var(--aptly-border);
  border-bottom: 1px solid var(--aptly-border);
}
.home-jobs-header-cell {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aptly-text-muted);
  font-weight: 500;
}
.home-jobs-header-cell.num { text-align: right; }
.home-jobs-table-wrap .home-job-card {
  grid-template-columns: minmax(200px, 1fr) minmax(480px, 2fr) 24px;
  column-gap: 14px;
  border: none;
  border-bottom: 1px solid var(--aptly-border);
  border-radius: 0;
  box-shadow: none;
}
.home-jobs-table-wrap .home-job-card:last-child { border-bottom: none; }
.home-jobs-table-wrap .home-job-card:hover {
  transform: none;
  box-shadow: none;
  background: #fbfaf5;
  border-color: transparent;
  border-bottom-color: var(--aptly-border);
}
.home-job-card-pipeline {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
.home-job-card-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--aptly-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.home-job-card-num.is-zero { color: var(--aptly-text-faint); }
@media (max-width: 768px) {
  .home-jobs-header { grid-template-columns: minmax(0, 1fr) 24px; }
  .home-jobs-table-wrap .home-job-card { grid-template-columns: minmax(0, 1fr) 24px; }
  .home-job-card-pipeline { display: none; }
  .home-jobs-header-cell:nth-child(2) { display: none; }
}

/* === Notifications bell + dropdown === */
.nav-notifications-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
}
.nav-notifications-btn:hover {
  background: rgba(45, 80, 22, 0.08);
}
.nav-notifications-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #b8860b;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notifications-dropdown {
  position: absolute;
  top: 56px;
  right: 24px;
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: 13px;
  color: #1a2e0f;
}
.notif-mark-all {
  font-size: 12px;
  color: #2d5016;
  text-decoration: none;
  font-weight: 500;
}
.notif-mark-all:hover {
  text-decoration: underline;
}
.notif-list {
  padding: 4px 0;
}
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid #f8f7f2;
  cursor: pointer;
}
.notif-item:hover {
  background: #f8f7f2;
}
.notif-item.notif-unread {
  background: #edf5df;
}
.notif-item.notif-unread:hover {
  background: #c0dd97;
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a2e0f;
  margin-bottom: 2px;
}
.notif-body {
  font-size: 12px;
  color: #4a5a3a;
  margin-bottom: 4px;
  line-height: 1.4;
}
.notif-time {
  font-size: 11px;
  color: #8a9a7a;
}
.notif-empty, .notif-loading {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #6a7a5a;
}

