:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --line: #e4e7ef;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef2ff;
  --on-brand: #ffffff;
  --accent: #059669;
  --accent-soft: #ecfdf5;
  --danger: #dc2626;
  --warn-bg: #fffbeb;
  --warn-text: #92400e;
  --warn-line: #fde68a;
  --ring-track: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --nav-w: 232px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #121826;
    --surface-2: #1a2132;
    --line: #232b3d;
    --text: #e6e9f2;
    --muted: #8b95ab;
    --brand: #818cf8;
    --brand-hover: #a5b4fc;
    --brand-soft: rgba(129, 140, 248, 0.12);
    --on-brand: #0b0f19;
    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --warn-bg: rgba(251, 191, 36, 0.1);
    --warn-text: #fcd34d;
    --warn-line: rgba(251, 191, 36, 0.25);
    --ring-track: #273046;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--accent); font-weight: 500; }
.link { color: var(--brand); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.pre { white-space: pre-line; }

/* ---------- Shell / sidebar ---------- */
.shell { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 0 8px; }
.brand-mark { width: 34px; height: 34px; display: block; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.35)); }
.brand-name span { background: linear-gradient(135deg, #6366f1, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font-size: 11.5px; font-weight: 600; text-align: center;
}
.nav-count[hidden] { display: none; }
.nav-foot { margin-top: auto; padding: 0 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

.page { flex: 1; min-width: 0; }
.page-inner { max-width: 1080px; margin: 0 auto; padding: 32px 32px 64px; }
.mobile-bar { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { font-size: 14px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, badges, chips ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-head { margin-bottom: 16px; }
.card-head.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-head p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.badge-soft { background: var(--brand-soft); color: var(--brand); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-status { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.badge[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
a.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip-match { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-size: 12px; padding: 2px 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-text { background: none; color: var(--muted); padding: 9px 10px; }
.btn-text:hover { color: var(--text); }
.btn-text.danger:hover { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px 16px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field em { font-style: normal; opacity: 0.75; font-weight: 400; }
.field input, .field select, .field textarea,
.quick-search input, .quick-search select, .tracker-field select, .tracker-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea, .tracker-field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus,
.quick-search input:focus, .quick-search select:focus, .tracker-field select:focus, .tracker-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-card { margin-bottom: 24px; }
.form-section { font-size: 15px; font-weight: 600; margin: 4px 0 14px; }
.form-section ~ .form-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; border: 1.5px dashed var(--line); border-radius: 12px;
  background: var(--surface-2); text-align: center; cursor: pointer; position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 26px; height: 26px; color: var(--brand); }
.has-file .dz-icon { color: var(--accent); }
.dz-title { font-size: 14px; font-weight: 500; word-break: break-all; }
.dz-title u { color: var(--brand); text-decoration: none; }
.dz-sub { font-size: 12.5px; color: var(--muted); }

/* ---------- Notices ---------- */
.notice {
  margin-bottom: 16px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px;
  background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line);
}
.notice-ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.notice-info { background: var(--brand-soft); color: var(--text); border-color: transparent; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit; transition: border-color 0.15s;
}
a.stat:hover { border-color: var(--brand); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.accent { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.onboarding { margin-bottom: 20px; background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.onboarding h2 { font-size: 17px; margin-bottom: 10px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.steps a { color: var(--brand); font-weight: 600; text-decoration: none; }

.meter { height: 8px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width 0.4s; }
.meter-label { margin-top: 8px; font-size: 14px; }
.missing-list { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }

.alert-list, .activity { list-style: none; margin: 0; padding: 0; }
.alert-list li, .activity li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.alert-list li:last-child, .activity li:last-child { border-bottom: none; }
.alert-list a { color: inherit; font-weight: 500; text-decoration: none; }
.alert-list a:hover { color: var(--brand); }

/* ---------- Profile ---------- */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-side { display: flex; flex-direction: column; gap: 20px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; background: var(--brand-soft); color: var(--brand); flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.resume { padding: 32px; }
.resume-head { display: flex; gap: 18px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.resume-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.resume-headline { color: var(--brand); font-weight: 500; margin-top: 2px; }
.resume-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; margin-top: 6px; }
.pref-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 4px; }
.pref-grid div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.pref-grid dt { font-size: 12px; color: var(--muted); }
.pref-grid dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.pref-grid dd small { display: block; font-weight: 400; font-size: 11px; }
.resume-section { margin-top: 22px; }
.resume-section h3 {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--brand); margin-bottom: 8px;
}
.resume-section p { font-size: 14.5px; }

/* ---------- Filters ---------- */
.filter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.filter-card { display: flex; flex-direction: column; gap: 14px; }
.filter-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.filter-top h3 { font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-actions { display: flex; gap: 2px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.filter-actions form { margin: 0; }

/* ---------- Jobs ---------- */
.filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-tab {
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
}
.filter-tab:hover { border-color: var(--brand); }
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.quick-search { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr auto; gap: 10px; padding: 12px; margin-bottom: 20px; }

.loading { display: flex; align-items: center; gap: 12px; padding: 40px; justify-content: center; color: var(--muted); }
.loading[hidden] { display: none; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--ring-track); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.job-list { display: flex; flex-direction: column; gap: 14px; }
.job {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px;
  padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, opacity 0.3s;
}
.job:hover { box-shadow: var(--shadow-md); }
.job-top { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.job[data-status="approved"], .job[data-status="applied"] { border-color: var(--accent); }
.job.removing { opacity: 0; }
.company-logo {
  position: relative; overflow: hidden;
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.company-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.job-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-title-row h3 { font-size: 16.5px; font-weight: 600; }
.job-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.job-meta .sep { margin: 0 6px; opacity: 0.6; }
.job-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fact { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.fact-salary { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.fact-source { background: var(--brand-soft); color: var(--brand); }
.job-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.job-desc {
  font-size: 14px; margin-top: 10px; opacity: 0.85;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.job.expanded .job-desc { -webkit-line-clamp: unset; white-space: pre-line; max-height: 420px; overflow-y: auto; }
.job-breakdown { display: none; font-size: 12.5px; margin-top: 10px; }
.job.expanded .job-breakdown { display: block; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.apply-panel {
  margin-top: 14px; padding: 14px; border-radius: 12px;
  background: var(--accent-soft); font-size: 13.5px;
  display: flex; flex-direction: column; gap: 4px;
}
.apply-panel[hidden] { display: none; }
.apply-panel strong { color: var(--accent); }
.apply-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.tracker-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.tracker-field { display: flex; flex-direction: column; gap: 4px; }
.tracker-field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.tracker-field select, .tracker-field textarea { padding: 7px 10px; font-size: 13.5px; }

.score-ring {
  --size: 64px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--ring-track) 0);
  display: grid; place-items: center; flex-shrink: 0;
}
.score-ring span {
  width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: baseline; justify-content: center;
  padding-top: calc((var(--size) - 12px) / 2 - 0.7em);
  font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
}
.score-ring small { font-size: 10px; font-weight: 600; color: var(--muted); }

/* ---------- Applications pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.pipe {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit;
}
.pipe:hover { border-color: var(--brand); }
.pipe.active { border-color: var(--brand); background: var(--brand-soft); }
.pipe-count { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipe-label { font-size: 12.5px; color: var(--muted); }
.pipe.active .pipe-label { color: var(--brand); font-weight: 500; }

/* ---------- Empty + toast ---------- */
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 56px 24px; text-align: center; background: var(--surface); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 14px; max-width: 380px; margin: 0 auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .profile-layout { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav {
    position: fixed; z-index: 40; left: 0; top: 0;
    transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-md);
  }
  .nav.open { transform: none; }
  .mobile-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
  }
  .page-inner { padding: 20px 16px 48px; }
  .grid-2, .filter-list { grid-template-columns: minmax(0, 1fr); }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .quick-search { grid-template-columns: 1fr 1fr; }
  .quick-search input[name="keywords"] { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .page-head { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 20px; }
  .job { grid-template-columns: minmax(0, 1fr) auto; padding: 16px; }
  .company-logo { display: none; }
  .score-ring { --size: 52px; }
  .score-ring span { font-size: 14px; }
  .tracker-row { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resume { padding: 20px; }
  .resume-head { flex-direction: column; align-items: flex-start; }
}

/* =================== v3 additions =================== */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-wide { max-width: 1400px; }
code { font-family: "SF Mono", Menlo, monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre.code { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; font-size: 12.5px; overflow-x: auto; margin: 8px 0; }
.notice-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border-color: transparent; }
.badge-warn, .chip-warn, .fact-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.chip-strong { background: var(--brand-soft); color: var(--brand); border-color: transparent; font-weight: 500; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 500; }
.chip-btn { cursor: pointer; font: inherit; font-size: 12.5px; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-toggle.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.field-select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; }
.is-paused { opacity: 0.65; }

/* Sidebar user */
.nav-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.nav-user form { margin: 0 0 0 auto; }
.nav-user-text { min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.3; }
.nav-user-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-text span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; object-fit: cover; }

/* Auth */
.auth-title { font-size: 22px; letter-spacing: -0.01em; }
.auth-sub { margin: 4px 0 20px; font-size: 14px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 14px; }
.btn-google { background: var(--surface); border: 1px solid var(--line); color: var(--text); gap: 10px; }
.btn-google:hover { background: var(--surface-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.otp-input { font-size: 22px !important; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; }
.steps-check li.done { color: var(--muted); }
.steps-check li.done::marker { color: var(--accent); }
.done-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, 0.45); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border-radius: var(--radius); width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.ai-text { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; margin: 0; background: var(--surface-2); padding: 14px; border-radius: 10px; }
.ai-text-sm { font-size: 14px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.ai-card { margin-top: 16px; }
.ai-list { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.ai-list.good li::marker { color: var(--accent); }
.ai-list.bad li::marker { color: var(--danger); }

/* Job cards (v3) */
.job-title-row h3 a { color: inherit; text-decoration: none; }
.job-title-row h3 a:hover { color: var(--brand); }
.autofill-report { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface); font-size: 13px; line-height: 1.55; }
.autofill-report[hidden] { display: none; }
.tracker-row { grid-template-columns: 170px 160px minmax(0, 1fr); }
.tracker-field input[type="date"] { padding: 7px 10px; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.queue-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px 20px; }
.alert-strip { margin: -4px 0 18px; }

/* Dashboard chart + checklists */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; height: 150px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent))); min-height: 2px; }
.bar-n { font-size: 11.5px; font-weight: 600; }
.bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.check-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.check-list li { padding-left: 24px; position: relative; }
.check-list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.check-list li.ok::before { content: "✓"; color: var(--accent); }
.check-list li.bad::before { content: "✕"; color: var(--danger); }
.check-list.compact { margin-top: 10px; gap: 4px; font-size: 13px; }
.check-list .fix { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Wizard */
.wizard { padding: 0; overflow: visible; }
.wizard-steps { list-style: none; margin: 0; padding: 14px 18px; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); counter-reset: s; }
.wizard-steps li { counter-increment: s; font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.wizard-steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); margin-right: 6px; font-size: 11.5px; font-weight: 600; }
.wizard-steps li.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.wizard-steps li.on::before { background: var(--brand); color: var(--on-brand); }
.wizard-steps li.done::before { content: "✓"; background: var(--accent-soft); color: var(--accent); }
.wizard-panel { padding: 26px 26px 10px; min-height: 300px; }
.wizard-panel h2 { font-size: 19px; margin-bottom: 4px; }
.wizard-panel > p.muted { margin-bottom: 18px; font-size: 14px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
#wiz-error { color: var(--danger); }
.tag-input { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); }
.tag-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tag-input input { flex: 1; min-width: 200px; border: none; outline: none; padding: 6px; background: transparent; }
.tags { display: contents; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13.5px; font-weight: 500; }
.tag button { border: none; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; opacity: 0.7; }
.tag button:hover { opacity: 1; }
.ac-wrap { position: relative; flex: 1; min-width: 220px; display: flex; }
.ac-wrap input { width: 100%; }
.ac-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); max-height: 300px; overflow-y: auto; }
.ac-list[hidden] { display: none; }
.ac-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ac-list li em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.ac-list li small { color: var(--muted); font-size: 11.5px; }
.ac-list li:hover, .ac-list li.on { background: var(--brand-soft); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg-big button { padding: 12px 22px; font-size: 16px; font-weight: 600; }
.auto-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 24px; padding: 16px; border-radius: 12px; background: var(--accent-soft); }
.auto-box p { margin: 4px 0 10px; }
.inline-field { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; }
.inline-field input { width: 80px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--ring-track); cursor: pointer; transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.review dl { margin: 20px 0 0; display: grid; gap: 8px; }
.review dl div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 14px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; font-weight: 500; }

/* Settings */
.qa-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.qa-row input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

/* Resumes */
.resume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 24px; }
.resume-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.resume-thumb { display: block; height: 230px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); position: relative; }
.resume-thumb iframe { width: 794px; height: 1123px; border: 0; transform: scale(0.36); transform-origin: top left; pointer-events: none; position: absolute; left: 50%; margin-left: -143px; background: #fff; }
.resume-card-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.resume-card-body h3 { font-size: 15.5px; }
.resume-card-body h3 a { color: inherit; text-decoration: none; }
.ats-mini { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; }
.ats-mini .meter { flex: 1; height: 6px; }

/* Resume editor */
.title-input { display: block; margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; margin-left: -7px; background: transparent; width: min(520px, 100%); }
.title-input:hover, .title-input:focus { border-color: var(--line); outline: none; background: var(--surface); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-left { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 0 22px 22px; }
.editor-right { position: sticky; top: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -22px 18px; padding: 0 14px; position: sticky; top: 0; background: var(--surface); z-index: 2; border-radius: var(--radius) var(--radius) 0 0; }
.tab { border: none; background: none; padding: 14px 12px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel[hidden] { display: none; }
.mono-ish { font-family: "SF Mono", Menlo, monospace; font-size: 12.5px !important; }
.preview-bar { display: flex; justify-content: space-between; margin-bottom: 8px; }
.preview-frame { background: var(--surface-2); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-md); position: relative; }
.preview-frame iframe { width: 794px; height: 1123px; border: 0; transform-origin: top left; background: #fff; display: block; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tpl { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: inherit; font: inherit; }
.tpl:hover { border-color: var(--c); }
.tpl.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.tpl strong { font-size: 13px; margin-top: 6px; }
.tpl small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.tpl-mini { position: relative; display: block; height: 96px; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }
.tpl-mini i { position: absolute; display: block; border-radius: 2px; }
.tpl-mini .m-head { left: 10%; top: 10%; width: 50%; height: 8%; background: var(--c); }
.tpl-mini .m-l1, .tpl-mini .m-l2, .tpl-mini .m-l3 { left: 10%; right: 10%; height: 4%; background: #d1d5db; }
.tpl-mini .m-l1 { top: 34%; } .tpl-mini .m-l2 { top: 48%; right: 25%; } .tpl-mini .m-l3 { top: 62%; right: 18%; }
.tpl-mini .m-side { display: none; }
.tpl-mini .m-photo { right: 10%; top: 8%; width: 18%; height: 20%; background: #cbd5e1; border-radius: 3px; }
.tpl-h-band .m-head { left: 0; top: 0; width: 100%; height: 24%; border-radius: 0; }
.tpl-h-center .m-head { left: 25%; }
.tpl-h-box .m-head { outline: 2px solid var(--c); outline-offset: 3px; background: #9ca3af; }
.tpl-sidebar-left .m-side, .tpl-sidebar-right .m-side { display: block; top: 0; bottom: 0; width: 32%; border-radius: 0; background: color-mix(in srgb, var(--c) 18%, #fff); }
.tpl-sidebar-left .m-side { left: 0; } .tpl-sidebar-right .m-side { right: 0; }
.tpl-sidebar-left .m-head, .tpl-sidebar-left .m-l1, .tpl-sidebar-left .m-l2, .tpl-sidebar-left .m-l3 { left: 40%; }
.tpl-sidebar-right .m-head, .tpl-sidebar-right .m-l1, .tpl-sidebar-right .m-l2, .tpl-sidebar-right .m-l3 { right: 40%; }
.tpl-sidebar-left .m-photo { left: 6%; right: auto; top: 6%; width: 20%; height: 17%; border-radius: 50%; }
.tpl-sidebar-right .m-photo { right: 6%; width: 20%; height: 17%; border-radius: 50%; }
.tpl-dark .m-side { background: #1f2937; }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.photo-row form { margin: 0; display: flex; align-items: center; gap: 8px; }
.photo-form input[type="file"] { font-size: 13px; max-width: 220px; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.dl { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.dl:hover { border-color: var(--brand); background: var(--brand-soft); }
.dl span { font-size: 12.5px; color: var(--muted); }
.ats-report { margin-top: 18px; }
.ats-score { display: flex; align-items: center; gap: 14px; }
.score-ring.big { --size: 76px; }
.score-ring.big span { font-size: 20px; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-right { position: static; }
}
@media (max-width: 860px) {
  .tracker-row { grid-template-columns: 1fr 1fr; }
  .tracker-notes { grid-column: 1 / -1; }
  .queue-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .wizard-panel { padding: 20px 16px 8px; }
  .seg-big button { padding: 10px 14px; font-size: 14px; }
  .qa-row { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}

/* AI providers (settings) */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ai-card-p { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ai-card-p.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-card-p .field { margin-bottom: 4px; }
.ai-card-p select { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ai-card-p .form-actions { margin-top: 4px; padding-top: 10px; }
.bad-text { color: var(--danger); }
@media (max-width: 1000px) { .ai-grid { grid-template-columns: 1fr; } }

/* =================== Auth pages v2 =================== */
.auth-body { min-height: 100vh; background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: minmax(420px, 46%) 1fr; min-height: 100vh; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 40px 56px;
  display: flex; flex-direction: column; gap: 36px;
  background: linear-gradient(150deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; pointer-events: none; }
.hero-glow.g1 { width: 420px; height: 420px; background: #22d3ee; top: -160px; right: -120px; opacity: 0.35; }
.hero-glow.g2 { width: 360px; height: 360px; background: #f0abfc; bottom: -140px; left: -100px; opacity: 0.35; }
.auth-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background-image: radial-gradient(rgba(255,255,255,0.9) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.hero-brand { position: relative; z-index: 1; padding: 0; color: #fff; font-weight: 700; font-size: 20px; gap: 12px; }
.hero-brand .brand-mark { width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25)); }
.hero-copy { position: relative; z-index: 1; margin-top: auto; }
.hero-copy h2 { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.hero-copy h2 span { background: linear-gradient(90deg, #a5f3fc, #f5d0fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy > p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: rgba(255,255,255,0.82); max-width: 460px; }
.hero-points { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-points li { display: flex; gap: 14px; align-items: center; }
.hero-points i { font-style: normal; width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px;
  border-radius: 12px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); backdrop-filter: blur(6px); }
.hero-points div { display: flex; flex-direction: column; }
.hero-points strong { font-size: 15px; }
.hero-points span { font-size: 13.5px; color: rgba(255,255,255,0.72); }
.hero-mock { position: relative; z-index: 1; max-width: 420px; }
.mock-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; color: #0f172a;
  background: rgba(255,255,255,0.96); box-shadow: 0 24px 50px rgba(15, 23, 42, 0.35); transform: rotate(-1.5deg);
}
.mock-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: #16a34a; flex-shrink: 0; }
.mock-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mock-body strong { font-size: 14.5px; }
.mock-body > span { font-size: 12.5px; color: #64748b; }
.mock-chips { display: flex; gap: 5px; margin-top: 6px; }
.mock-chips em { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #ecfdf5; color: #059669; }
.mock-ring { width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(#059669 92%, #e5e7eb 0); position: relative; }
.mock-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.mock-ring b, .mock-ring small { position: relative; }
.mock-ring b { font-size: 15px; } .mock-ring small { font-size: 9px; color: #64748b; position: absolute; right: 9px; top: 21px; }
.mock-toast {
  position: absolute; right: -6px; bottom: -22px; padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: #0f172a; color: #a7f3d0; box-shadow: 0 12px 30px rgba(0,0,0,0.3); transform: rotate(1.5deg);
}

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-mobile-brand { display: none; }
.auth-panel { width: 100%; max-width: 420px; }
.auth-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { margin: 6px 0 26px; font-size: 15px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 14px; }
.btn-lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; }
.btn-google { background: var(--surface); border: 1px solid var(--line); color: var(--text); gap: 12px; padding: 12px 16px;
  font-size: 15px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.btn-google:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.auth-panel .input-icon input { padding: 12px 14px 12px 42px; border-radius: 12px; font-size: 15px; }
.auth-panel .input-icon input:focus + .pw-toggle, .input-icon:focus-within > svg { color: var(--brand); }
.pw-toggle { position: absolute; right: 8px; border: none; background: none; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pw-toggle:hover { background: var(--brand-soft); }
.auth-panel .input-icon input[type="password"], .auth-panel .input-icon input[name="password"] { padding-right: 64px; }
.btn.is-busy { pointer-events: none; opacity: 0.8; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; margin-left: 6px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
.guide { margin: 0; padding: 0; list-style: none; counter-reset: g; display: flex; flex-direction: column; gap: 16px; }
.guide li { counter-increment: g; position: relative; padding-left: 40px; font-size: 14px; }
.guide li::before { content: counter(g); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; }
.guide p { margin-top: 4px; color: var(--muted); line-height: 1.55; }
.guide p b { color: var(--text); }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.copy-row span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.copy-row code { background: none; padding: 0; font-size: 12.5px; word-break: break-all; }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; margin-bottom: 28px; padding: 0; }
  .auth-main { justify-content: flex-start; padding-top: 48px; }
}
@media (max-width: 560px) {
  .auth-title { font-size: 24px; }
}
.guide pre.code { white-space: pre-wrap; word-break: break-all; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.chip[hidden], .ac-list li[hidden] { display: none; }

/* Settings sub-menu in the sidebar */
.nav-caret { width: 15px !important; height: 15px !important; margin-left: auto; opacity: 0.6; transition: transform 0.15s; }
.nav-caret.open { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1.5px solid var(--line); }
.nav-sub-link { padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-sub-link:hover { background: var(--surface-2); color: var(--text); }
.nav-sub-link.active { color: var(--brand); background: var(--brand-soft); }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 4px !important; }

/* Claude subscription one-click card */
.sub-card { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 14px; margin-bottom: 22px;
  border: 1.5px solid color-mix(in srgb, #d97706 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 9%, var(--surface)), var(--surface)); }
.sub-card.is-active { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.sub-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--surface); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.sub-body { flex: 1; min-width: 0; }
.sub-body h3 { font-size: 17px; font-weight: 700; }
.sub-body p { margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.sub-body p strong { color: var(--text); }
.sub-actions form { margin: 0; }
.or-head { font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
@media (max-width: 700px) { .sub-card { flex-direction: column; align-items: flex-start; } }

/* Resume editor v2: real thumbnails, style controls, PDF preview */
.tpl-real { padding: 8px; }
.tpl-thumb { display: block; position: relative; aspect-ratio: 210 / 297; overflow: hidden; border-radius: 6px; background: #fff; border: 1px solid #e5e7eb; }
.tpl-thumb iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: top left; pointer-events: none; background: #fff; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tpl-wait { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.style-box { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.style-box[hidden] { display: none; }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.style-grid input[type="range"] { padding: 0; accent-color: var(--brand); }
.style-grid input[type="color"] { height: 40px; padding: 4px; }
.style-grid em { font-style: normal; color: var(--brand); font-weight: 600; margin-left: 4px; }
.photo-mini { width: 44px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.fmt-bar { display: flex; gap: 4px; margin-bottom: -2px; }
.fmt-bar button { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.fmt-bar button:hover { background: var(--brand-soft); border-color: var(--brand); }
.pdf-frame { height: calc(100vh - 140px); min-height: 520px; background: #525659; }
.pdf-frame iframe { width: 100%; height: 100%; transform: none !important; }
.upload-names { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.name-row { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.name-row input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }
.resume-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb-tag { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(15,23,42,0.75); color: #fff; }

/* Skill gaps */
.skills-layout { align-items: start; }
.gap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.gap-top { display: flex; align-items: center; gap: 8px; }
.gap-top strong { font-size: 14.5px; text-transform: capitalize; }
.gap-top .small { margin-left: auto; }
.gap-bar { height: 6px; border-radius: 999px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.gap-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.plan-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.plan-list p { margin-top: 3px; }
.inline-select select { margin-left: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }

/* Fit evaluation */
.fit-badge { font-weight: 600; }
.fit-strong { background: var(--accent-soft); color: var(--accent); }
.fit-mid { background: var(--brand-soft); color: var(--brand); }
.fit-weak { background: var(--warn-bg); color: var(--warn-text); }
.fit-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0 14px; }
.fit-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fit-table td:first-child { font-weight: 600; width: 130px; }
.fit-table td:nth-child(2) { width: 70px; font-variant-numeric: tabular-nums; }
.gate-pass { color: var(--accent); } .gate-flag, .gate-unverified { color: var(--warn-text); } .gate-fail { color: var(--danger); }
.fit-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.filter-actions { flex-wrap: wrap; }
.score-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.score-cap { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* Wizard: resume preview */
.resume-pick { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px; align-items: start; margin-top: 18px; }
.resume-pick .field { margin: 0; }
.resume-mini { display: block; position: relative; aspect-ratio: 210 / 297; overflow: hidden; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; box-shadow: var(--shadow-sm); }
.resume-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.resume-mini iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: top left; pointer-events: none; }
.resume-mini-cap { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }
@media (max-width: 560px) { .resume-pick { grid-template-columns: 1fr; } .resume-pick > div:last-child { max-width: 200px; } }

/* Job sources */
.sources { margin: -4px 0 18px; padding: 12px 16px; }
.sources summary { cursor: pointer; font-size: 13.5px; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sources summary::-webkit-details-marker { display: none; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 500; }
.src-chip em { font-style: normal; color: var(--muted); font-weight: 400; }
.src-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.src-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; font-size: 13.5px; align-items: baseline; }
.src-list li strong a { color: inherit; }
@media (max-width: 560px) { .src-list li { grid-template-columns: 1fr; gap: 2px; } }
a.fact-source { text-decoration: none; }
a.fact-source:hover { text-decoration: underline; }

/* ---------- job details modal ---------- */
.modal-card:has(.details) { width: min(860px, 100%); }
.details .job-facts { margin: 8px 0 14px; }
.details-tabs { margin-bottom: 14px; }
.job-full { line-height: 1.6; font-size: 14px; }
.job-full h4, .details h4 { font-size: 14px; margin: 16px 0 6px; }
.job-full p { margin: 0 0 10px; }
.job-full ul { margin: 0 0 12px; padding-left: 20px; }
.job-full li { margin: 3px 0; }
.company-box { margin-bottom: 8px; }
.company-box > p { line-height: 1.55; margin: 8px 0; }
.company-head { display: flex; gap: 12px; align-items: center; }
.company-head img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.company-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; font-size: 14px; }
.company-facts dt { color: var(--muted); }
.company-facts dd { margin: 0; }
.research { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.research-link { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; text-decoration: none; color: inherit; background: var(--surface); }
.research-link:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 560px) { .company-facts { grid-template-columns: 1fr; } .company-facts dt { margin-top: 6px; } }
.fact-ok { background: #e7f8ef; color: #047857; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fact-ok { background: #0f2e22; color: #6ee7b7; } }
.sent-shot { display: block; margin-top: 10px; max-height: 260px; width: 100%; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 8px; }
.ai-ideas { margin: 4px 0 14px; }
.chip-btn { cursor: pointer; border: 1px dashed var(--line); background: var(--surface); font: inherit; font-size: 12.5px; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; border: 1px solid var(--line); }

/* ---------- mobile polish ---------- */
.bars { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex-shrink: 0; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; }
.menu-btn svg { width: 18px; height: 18px; }
.nav-backdrop { display: none; }
img, svg, video, iframe { max-width: 100%; }
.page-inner { min-width: 0; }
@media (max-width: 860px) {
  .nav { height: 100vh; height: 100dvh; overflow-y: auto; }
  .nav.open + .page .nav-backdrop, .nav-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 35; }
  .modal-card { max-height: 92vh; }
}
@media (max-width: 560px) {
  .bars { gap: 4px; }
  .bar-label, .bars small, .bars span { font-size: 10px; }
  .editor-left { padding: 0 14px 16px; }
  .tabs { margin: 0 -14px 14px; padding: 0 6px; }
  .tab { padding: 12px 10px; font-size: 13.5px; }
  .btn-row > .btn, .apply-steps > .btn { flex: 1 1 auto; justify-content: center; }
  .job-actions { flex-wrap: wrap; }
  .modal { padding: 8px; align-items: end; }
  .modal-card { width: 100%; border-radius: 14px 14px 0 0; max-height: 94vh; }
  .card { padding: 16px; }
  h1 { font-size: 24px; }
}
@media (max-width: 560px) {
  .job { display: block; position: relative; }
  .job .score-wrap { position: absolute; top: 14px; right: 14px; }
  .job .score-ring { --size: 46px; }
  .job .score-cap { display: none; }
  .job-title-row { padding-right: 54px; }
  .job-actions, .apply-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .job-actions .btn, .apply-steps .btn { width: 100%; justify-content: center; text-align: center; }
  .job-actions .js-preview { grid-column: 1 / -1; }
  .apply-panel { padding: 12px; }
}
.save-as { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.save-as input { flex: 1 1 180px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; }
.resume-thumb { overflow: hidden; }
.resume-thumb iframe { max-width: none; left: 0; margin-left: 0; transform: scale(var(--s, 0.36)); }
.save-as[hidden] { display: none; }
.weak-jobs { margin-top: 18px; }
.weak-jobs > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 10px 0; }
.weak-jobs .job-list { margin-top: 10px; opacity: 0.85; }
.answer-once { display: grid; gap: 8px; margin: 10px 0 4px; max-width: 520px; }
.answer-once .field { margin: 0; }
.answer-once .btn { justify-self: start; }
.ext-status { display: flex; gap: 14px; align-items: center; }
.ext-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.ext-status.on .ext-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ext-steps { padding-left: 20px; display: grid; gap: 14px; }
.ext-list { padding-left: 18px; display: grid; gap: 8px; margin-top: 8px; }

/* ---------- agent + records ---------- */
.pipe-auto { border-color: var(--brand); }
.agent-card { margin-bottom: 18px; }
.agent-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.agent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; align-items: end; }
.agent-grid .field { margin: 0; }
.agent-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.agent-stat strong { font-size: 18px; }
.agent-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.section-title { font-size: 16px; margin: 22px 0 10px; }
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); font-size: 14px; }
.next-step.due { background: var(--warn-bg); color: var(--warn-text); }
.next-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .agent-grid { grid-template-columns: 1fr 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { position: relative; padding-left: 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline time { color: var(--muted); font-size: 12.5px; margin-right: 8px; }
.pipeline { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
@media (max-width: 560px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Scaled A4 previews must keep their real width (the global max-width rule would squash them) */
.tpl-thumb iframe, .resume-thumb iframe { max-width: none !important; }
.title-input { width: min(900px, 100%); field-sizing: content; min-width: 12ch; max-width: 100%; }
.spinner-sm { width: 13px; height: 13px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.agent-stop { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); font-size: 14px; }

/* ---------- clean job cards ---------- */
.job-facts .fact { font-size: 12px; }
.tracker-row-slim { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.tracker-row-slim select { width: auto; min-width: 150px; }
.job-actions { gap: 6px; }
.apply-panel .apply-steps { margin-top: 0; }

/* ---------- mobile bottom tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--accent); }
  .tab-main svg { width: 26px; height: 26px; padding: 10px; box-sizing: content-box; border-radius: 50%; background: var(--accent); color: #fff; margin-top: -22px; box-shadow: var(--shadow-md); }
  .tab-main.active { color: var(--accent); }
  .tab-count { position: absolute; top: -20px; right: calc(50% - 30px); font-style: normal; font-size: 10px; background: #ef4444; color: #fff; border-radius: 999px; padding: 1px 6px; }
  .page-inner { padding-bottom: 96px; }
  .nav .nav-in-tabbar { display: none; }
}

/* ---------- crisp job details ---------- */
.crisp { margin: 6px 0 12px; padding-left: 18px; }
.crisp li { margin: 3px 0; font-size: 14px; }
.crisp.ok li::marker { color: var(--accent); }
.crisp.warn li::marker { color: #d97706; }
.crisp-verdict { margin: 12px 0 4px; font-size: 14px; }
.crisp-full { margin-top: 8px; }
.crisp-full summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.crisp-links { margin-top: 14px; font-size: 13px; }

/* clean cards: no description on the card, compact buttons on phones */
.job-desc[hidden] { display: none !important; }
.apply-panel { padding: 10px 12px; }
@media (max-width: 560px) {
  .job-actions, .apply-steps { display: flex; flex-wrap: wrap; gap: 6px; }
  .job-actions .btn, .apply-steps .btn { width: auto; flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
  .job-actions .js-preview { grid-column: auto; }
  .job h3 { font-size: 16px; }
}
.crisp li { color: var(--text, inherit); }

/* ---------- status pill + country filter ---------- */
.status-pill, .country-filter {
  appearance: none; -webkit-appearance: none; width: auto;
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 28px 5px 12px; cursor: pointer;
}
.status-pill { margin-left: auto; }
.country-filter { display: block; margin: 0 0 14px; padding: 8px 32px 8px 14px; font-size: 14px; }
article.job[hidden] { display: none !important; }

/* ---------- list filters, industry chip, score colours ---------- */
.list-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.list-filter {
  appearance: none; -webkit-appearance: none; width: auto; font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 30px 7px 14px; cursor: pointer;
}
.country-filter { display: none; }
.fact-industry { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.score-ring.ring-mid { background: conic-gradient(#f59e0b calc(var(--p) * 1%), var(--ring-track) 0); }
.score-ring.ring-weak { background: conic-gradient(#ef4444 calc(var(--p) * 1%), var(--ring-track) 0); }
.score-ring.ring-pending { background: conic-gradient(#94a3b8 calc(var(--p) * 1%), var(--ring-track) 0); }
