@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --sidebar-w: 210px;
  --topbar-h: 56px;
  --titlebar-h: 28px; /* macOS hiddenInset traffic-light clearance */

  /* Brand */
  --brand:       #5B5BD6;
  --brand-hover: #4747C2;
  --brand-light: #EEEFFF;
  --brand-text:  #3B3BAF;

  /* Zinc scale (warm grays) */
  --zinc-50:  #FAFAFA;
  --zinc-100: #F4F4F5;
  --zinc-200: #E4E4E7;
  --zinc-300: #D4D4D8;
  --zinc-400: #A1A1AA;
  --zinc-500: #71717A;
  --zinc-600: #52525B;
  --zinc-700: #3F3F46;
  --zinc-800: #27272A;
  --zinc-900: #18181B;

  /* Semantic */
  --bg:       var(--zinc-50);
  --surface:  #FFFFFF;
  --border:   var(--zinc-200);
  --border-strong: var(--zinc-300);
  --text:     var(--zinc-900);
  --text-2:   var(--zinc-600);
  --text-3:   var(--zinc-400);

  /* Status */
  --green:    #16A34A;
  --green-bg: #F0FDF4;
  --green-t:  #14532D;
  --amber:    #D97706;
  --amber-bg: #FFFBEB;
  --amber-t:  #78350F;
  --red:      #DC2626;
  --red-bg:   #FEF2F2;
  --red-t:    #7F1D1D;

  /* Sidebar */
  --sb-bg:     #18181B;
  --sb-hover:  #27272A;
  --sb-active: #3F3F46;
  --sb-text:   #A1A1AA;
  --sb-text-a: #FAFAFA;

  /* Radius */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(0,0,0,.05);
  --sh-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --sh:    0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --sh-md: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.04);
  --sh-lg: 0 20px 25px rgba(0,0,0,.1), 0 8px 10px rgba(0,0,0,.06);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: 16px;
  background: var(--sb-bg);
}

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,.1);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-screen p { color: var(--zinc-500); font-size: 13px; }

/* ── Onboarding — split layout ───────────────────────────────────────────── */
#onboarding-screen {
  display: flex;
  align-items: stretch;
  height: 100vh;
  overflow: hidden;
}

.ob-left {
  width: 340px;
  min-width: 340px;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}

.ob-left::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(91,91,214,.25) 0%, transparent 70%);
  pointer-events: none;
}

.ob-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.ob-logo-mark {
  width: 34px; height: 34px;
  background: var(--brand);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ob-logo-mark svg { color: white; }

.ob-logo-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.ob-headline {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -.4px;
  margin-bottom: 12px;
}

.ob-subline {
  font-size: 13.5px;
  color: var(--zinc-400);
  line-height: 1.6;
  margin-bottom: 32px;
}

.ob-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.ob-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--zinc-300);
  line-height: 1.45;
}

.ob-feat-icon {
  width: 20px; height: 20px;
  background: rgba(91,91,214,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ob-feat-icon svg { color: var(--brand); }

.ob-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 40px;
}

.ob-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.ob-step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 32px;
  width: 2px;
  height: calc(100% - 8px);
  background: var(--zinc-700);
}

.ob-step-item.active .ob-step-num  { background: var(--brand); color: #fff; border-color: var(--brand); }
.ob-step-item.done   .ob-step-num  { background: var(--brand); color: #fff; border-color: var(--brand); }
.ob-step-item.active::after,
.ob-step-item.done::after          { background: var(--brand); }

.ob-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--zinc-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--zinc-500);
  flex-shrink: 0;
  z-index: 1;
  background: var(--sb-bg);
  transition: all .2s;
}

.ob-step-label {
  font-size: 12.5px;
  color: var(--zinc-500);
  font-weight: 500;
  transition: color .2s;
}

.ob-step-item.active .ob-step-label { color: var(--zinc-200); }
.ob-step-item.done   .ob-step-label { color: var(--zinc-500); }

/* Right panel */
.ob-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--surface);
}

.ob-form {
  padding: 48px 48px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ob-form h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
  margin-bottom: 6px;
}

.ob-form .ob-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
}

.ob-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ── App Shell ───────────────────────────────────────────────────────────── */
#app-screen { display: flex; height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sb-logo {
  padding: 18px 16px 14px;
  padding-top: calc(var(--titlebar-h) + 10px); /* clear macOS traffic lights */
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
  -webkit-app-region: drag; /* make logo area the drag handle */
}

.sb-logo-mark {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sb-logo-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}

.sb-nav {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
  user-select: none;
}

.nav-item:hover  { background: var(--sb-hover); color: var(--sb-text-a); }
.nav-item.active { background: var(--sb-active); color: var(--sb-text-a); }
.nav-item svg    { flex-shrink: 0; opacity: .65; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sb-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sb-stats {
  font-size: 11.5px;
  color: var(--zinc-600);
  line-height: 1.8;
}

.sb-stats strong { color: var(--zinc-400); font-weight: 600; }

/* ── Main ────────────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  -webkit-app-region: drag; /* allow dragging window from topbar */
}

/* Anything interactive inside a drag region must opt out */
#topbar button, #topbar a, #topbar input, #topbar select,
#topbar .run-btn-group, #topbar #run-status {
  -webkit-app-region: no-drag;
}

#page-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
}

#topbar-spacer { flex: 1; }

/* ── Run dropdown button ────────────────────────────────────────────────── */
.run-btn-group {
  position: relative;
}
.run-btn-caret {
  margin-left: 2px;
  opacity: .8;
  flex-shrink: 0;
}
.run-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
}
.run-dd-header {
  padding: 9px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.run-dd-items {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}
.run-dd-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.run-dd-check:hover { background: var(--surface-2); }
.run-dd-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
  flex-shrink: 0;
  cursor: pointer;
}
.run-dd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.run-dd-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.run-dd-toggle:hover { color: var(--text-2); }
.run-dropdown-loading,
.run-dropdown-empty {
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-3);
}

#run-status {
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 280px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}

#run-status.running { color: var(--brand); }
#run-status.success { color: var(--green); }
#run-status.error   { color: var(--red); }

/* ── Progress bar ────────────────────────────────────────────────────────── */
#progress-bar-wrap { height: 2px; background: transparent; flex-shrink: 0; }

#progress-bar { height: 2px; background: var(--brand); width: 0%; }

#progress-bar.indeterminate {
  width: 35%;
  animation: pb-slide 1.1s ease-in-out infinite;
}

@keyframes pb-slide {
  0%   { margin-left: -35%; }
  100% { margin-left: 100%; }
}

/* ── Content ─────────────────────────────────────────────────────────────── */
#content { flex: 1; display: flex; overflow: hidden; min-height: 0; }

/* ── Jobs view ───────────────────────────────────────────────────────────── */
#jobs-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

.filter-bar {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}

.filter-btn:hover  { background: var(--zinc-100); color: var(--text); }
.filter-btn.active { background: var(--brand-light); border-color: transparent; color: var(--brand-text); font-weight: 600; }

.filter-spacer { flex: 1; }
.filter-count  { font-size: 12px; color: var(--text-3); }
.filter-divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.filter-select select { width: auto; font-size: 12.5px; padding: 4px 28px 4px 10px; height: 28px; background: transparent; border-color: var(--border); }
.filter-select select:focus { background: var(--surface); }

.jobs-pane { flex: 1; display: flex; overflow: hidden; min-height: 0; }

/* ── Job List ────────────────────────────────────────────────────────────── */
#job-list {
  width: 340px;
  min-width: 340px;
  overflow-y: auto;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.job-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.job-card:hover  { background: var(--zinc-50); }
.job-card.active { background: var(--brand-light); border-left: 3px solid var(--brand); padding-left: 13px; }

.score-ring-sm {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; border: 2.5px solid;
}
.score-ring-sm .score-ring-num   { font-size: 15px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.score-ring-sm .score-ring-label { font-size: 8px; font-weight: 600; opacity: .5; margin-top: 0; }

.job-info { flex: 1; min-width: 0; }

.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}

.job-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-company {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.job-pill {
  background: var(--zinc-100);
  color: var(--zinc-600);
  padding: 1.5px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.score-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.score-high { background: var(--green-bg); color: var(--green-t); }
.score-mid  { background: var(--amber-bg); color: var(--amber-t); }
.score-low  { background: var(--zinc-100); color: var(--zinc-500); }

.new-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.status-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.status-new        { background: var(--brand); color: #fff; }
.status-interested { background: var(--amber-bg); color: var(--amber-t); }
.status-applied    { background: var(--green-bg); color: var(--green-t); }
.status-pass       { background: var(--zinc-100); color: var(--zinc-500); }

.job-pill-manual { background: var(--brand-light); color: var(--brand); }

.job-card { position: relative; }
.card-apply-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s;
}
.job-card:hover .card-apply-btn,
.job-card.active .card-apply-btn { opacity: 1; }
.card-apply-btn:hover { background: var(--zinc-100); }
.card-apply-btn.is-applied { background: var(--green-bg); color: var(--green-t); border-color: transparent; }

/* ── Job Detail ──────────────────────────────────────────────────────────── */
#job-detail { flex: 1; overflow-y: auto; min-height: 0; background: var(--bg); }

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-3);
}

.detail-empty svg { opacity: .2; }
.detail-empty p   { font-size: 14px; color: var(--text-3); }

.detail-inner { max-width: 680px; padding: 28px 28px 60px; }

.detail-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.detail-company {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.detail-section { margin-bottom: 22px; }

.detail-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.match-box {
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--brand-text);
  line-height: 1.6;
  font-style: italic;
}

.skill-list { display: flex; flex-wrap: wrap; gap: 7px; }

.skill-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-2);
}

.detail-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 8px;
}

.empty-state svg { opacity: .2; margin-bottom: 6px; }
.empty-state h3 { font-size: 15px; color: var(--text-2); font-weight: 600; }
.empty-state p  { font-size: 13px; color: var(--text-3); max-width: 280px; line-height: 1.6; }

/* ── Guide view ──────────────────────────────────────────────────────────── */
#guide-view { flex: 1; overflow-y: auto; min-height: 0; }
.guide-inner { max-width: 720px; padding: 32px 28px 48px; }

/* Guide prompt */
.guide-nav-dot {
  width: 7px; height: 7px; background: var(--brand); border-radius: 50%;
  margin-left: auto; flex-shrink: 0; animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.4); }
}

.guide-prompt-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-light); border-bottom: 1px solid var(--brand);
  padding: 10px 20px; font-size: 13px; color: var(--brand-text);
}
.guide-prompt-banner svg { flex-shrink: 0; color: var(--brand); }
.guide-prompt-banner span { flex: 1; }
.guide-prompt-dismiss {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--text-3); line-height: 1; padding: 0 4px;
}
.guide-prompt-dismiss:hover { color: var(--text); }

.demo-tour-banner {
  display: flex; align-items: center; justify-content: center;
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 6px 20px; font-size: 12px; color: #92400e; gap: 6px;
}

.install-type-cards { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 32px; }

.install-type-card {
  display: flex; align-items: flex-start; gap: 16px;
  width: 100%; text-align: left; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.install-type-card:hover {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.install-type-icon {
  width: 44px; height: 44px; background: var(--brand-light); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.install-type-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.install-type-sub   { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.guide-schedule-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 24px;
}
.guide-schedule-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px;
}
.guide-schedule-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.guide-schedule-sub   { font-size: 12px; color: var(--text-3); line-height: 1.5; max-width: 460px; }
.guide-schedule-time-row { display: flex; align-items: center; gap: 10px; }
.guide-schedule-time-label { font-size: 12.5px; color: var(--text-2); }
.guide-schedule-next  { font-size: 11.5px; color: var(--text-3); }

.guide-first-run-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--brand-light); border: 1.5px solid var(--brand);
  border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 24px;
}
.guide-cta-left { flex: 1; }
.guide-cta-title { font-size: 14px; font-weight: 700; color: var(--brand-text); margin-bottom: 4px; }
.guide-cta-sub   { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

.guide-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--sb-bg); border-radius: var(--r-lg);
  padding: 24px 28px; margin-bottom: 32px;
}
.guide-hero-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.guide-hero-title { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -.3px; margin-bottom: 4px; }
.guide-hero-sub   { font-size: 13px; color: var(--sb-text); line-height: 1.55; max-width: 460px; }

.guide-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}

.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.guide-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px;
}
.guide-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.guide-card-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.guide-card-body  { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

.guide-tips { display: flex; flex-direction: column; gap: 12px; }
.guide-tip {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px;
}
.guide-tip-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-light); color: var(--brand-text);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.guide-tip-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.guide-tip-body  { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* ── Settings view ───────────────────────────────────────────────────────── */
#settings-view { flex: 1; overflow-y: auto; min-height: 0; padding: 28px; }
.settings-inner { max-width: 600px; }

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--sh-xs);
}

.settings-section h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.1px;
  margin-bottom: 2px;
}

.section-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 18px;
}

/* ── Danger zone ─────────────────────────────────────────────────────────── */
.danger-zone { border-color: #FEE2E2 !important; }
.danger-zone h2 { color: #991B1B !important; }

.danger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.danger-label { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.danger-sub   { font-size: 12px; color: var(--text-3); }

.btn-danger {
  background: #DC2626; color: #fff; border: none;
  padding: 7px 14px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-danger:hover { background: #B91C1C; }

.danger-confirm {
  margin-top: 14px; padding: 14px 16px;
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--r);
  font-size: 13px; color: #7F1D1D; line-height: 1.5;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.field .hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.5;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  transform: translateZ(0);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,91,214,.1);
}

textarea { resize: vertical; line-height: 1.6; }

.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; accent-color: var(--brand); cursor: pointer; }
.checkbox-row span { font-size: 13.5px; color: var(--text-2); }

.slider-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; padding: 0; accent-color: var(--brand); cursor: pointer; height: 4px; }
.slider-val { font-size: 13px; font-weight: 700; color: var(--brand); min-width: 38px; text-align: right; }

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

/* ── Location rows ───────────────────────────────────────────────────────── */
.locations-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.loc-row { display: flex; gap: 8px; align-items: center; }
.loc-row .loc-city { flex: 1; min-width: 0; }
.loc-state-wrap { width: 155px; flex-shrink: 0; }
.loc-remove {
  width: 30px; height: 30px; flex-shrink: 0;
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  background: none; cursor: pointer;
  color: var(--text-3); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s, border-color .12s;
}
.loc-remove:hover { color: var(--red); background: var(--red-bg); border-color: var(--red-bg); }
.loc-empty { font-size: 12.5px; color: var(--text-3); padding: 4px 0; }
.loc-dimmed { opacity: .4; pointer-events: none; }

.select-wrap { position: relative; display: inline-block; }
.field .select-wrap { display: block; }
.select-wrap select { padding-right: 28px; cursor: pointer; min-width: 110px; }
.select-wrap::after {
  content: "▾";
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-3); font-size: 11px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-secondary { background: var(--surface); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--zinc-50); color: var(--text); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--zinc-100); color: var(--text); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 10px 22px; font-size: 14px; }
.btn-xl  { padding: 12px 28px; font-size: 15px; border-radius: var(--r); }

/* ── Upload area ─────────────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 8px;
  user-select: none;
}

.upload-area:hover { border-color: var(--brand); background: var(--brand-light); }

.upload-area .upload-icon {
  width: 36px; height: 36px;
  background: var(--zinc-100);
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  transition: background .15s;
}

.upload-area:hover .upload-icon { background: var(--brand-light); }
.upload-area:hover .upload-icon svg { color: var(--brand); }

.upload-area p { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.upload-area .upload-formats { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.upload-area.loading { border-color: var(--brand); border-style: solid; background: var(--brand-light); cursor: default; }
.upload-area.loading p { color: var(--brand); }

.upload-area.success { border-color: var(--green); border-style: solid; background: var(--green-bg); cursor: default; }
.upload-area.success p { color: var(--green-t); font-weight: 500; }
.upload-area.success .upload-icon { background: var(--green-bg); }

.upload-area.error { border-color: var(--red); border-style: solid; background: var(--red-bg); }
.upload-area.error p { color: var(--red); }

/* ── Suggest titles CTA ──────────────────────────────────────────────────── */
.suggest-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand-light);
  border: 1.5px solid rgba(91,91,214,.2);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.suggest-cta p { font-size: 13px; color: var(--brand-text); font-weight: 500; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.alert-error   { background: var(--red-bg);   color: var(--red);   }
.alert-success { background: var(--green-bg); color: var(--green-t); }

/* ── Info box ────────────────────────────────────────────────────────────── */
.info-box {
  background: var(--zinc-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.info-box p  { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.info-box ol { padding-left: 16px; color: var(--text-2); font-size: 12.5px; line-height: 2; }

/* ── Run overlay ─────────────────────────────────────────────────────────── */
#run-overlay {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px;
}

.run-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 48px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--sh-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.run-anim-wrap {
  position: relative;
  width: 80px; height: 80px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.run-anim-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}

.run-anim-icon {
  position: absolute; inset: 9px;
  background: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.run-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  margin-bottom: 6px;
}

.run-subtitle {
  font-size: 13.5px;
  color: var(--text-2);
  min-height: 20px;
  margin-bottom: 28px;
  max-width: 320px;
  line-height: 1.5;
}

.run-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  text-align: left;
  margin-bottom: 28px;
}

.run-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-3);
  transition: color .3s;
}

.run-step-item .step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--zinc-300);
  flex-shrink: 0;
  transition: all .35s;
}

.run-step-item[data-state="active"] { color: var(--text); font-weight: 500; }
.run-step-item[data-state="active"] .step-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.run-step-item[data-state="done"] { color: var(--text-3); }
.run-step-item[data-state="done"] .step-dot { background: var(--green); }

.run-tip-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--zinc-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 16px;
  width: 100%;
}

.run-tip-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.run-tip-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.run-tip-body  { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.run-tip-hint  { font-size: 12px; color: var(--text-3); line-height: 1.6; }

.run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  width: 100%;
  margin-bottom: 20px;
}

.run-stat {
  background: var(--zinc-50);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.run-stat-num   { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; }
.run-stat-label { font-size: 11px; color: var(--text-3); font-weight: 500; }

.run-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--zinc-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.run-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 3px;
  transition: width .6s ease;
}

.run-progress-pct {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 24px;
  font-weight: 600;
}

.run-result-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.run-result-icon.success { background: var(--green-bg); border: 3px solid var(--green); color: var(--green); }
.run-result-icon.error   { background: var(--red-bg);   border: 3px solid var(--red);   color: var(--red); }

/* ── Score ring (job detail header) ─────────────────────────────────────── */
.detail-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.detail-header-info { flex: 1; min-width: 0; }

.score-ring {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; border: 3px solid;
}
.score-ring.score-high { background: var(--green-bg); border-color: var(--green);    color: var(--green-t); }
.score-ring.score-mid  { background: var(--amber-bg); border-color: var(--amber);    color: var(--amber-t); }
.score-ring.score-low  { background: var(--zinc-100); border-color: var(--zinc-300); color: var(--zinc-500); }
.score-ring-num   { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.score-ring-label { font-size: 10px; font-weight: 600; opacity: .55; margin-top: 1px; }

/* ── Feedback buttons ────────────────────────────────────────────────────── */
.feedback-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-right: 2px;
}

.feedback-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}

.feedback-btn:hover { border-color: var(--border-strong); background: var(--zinc-100); transform: scale(1.1); }
.feedback-btn.active-pos { border-color: var(--green); background: var(--green-bg); }
.feedback-btn.active-neg { border-color: var(--red);   background: var(--red-bg); }

/* ── Feedback note ───────────────────────────────────────────────────────── */
.feedback-note-wrap {
  background: var(--zinc-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.feedback-note-prompt {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.feedback-note-prompt span { font-weight: 400; color: var(--text-3); }

.feedback-note-wrap textarea {
  font-size: 13px;
  margin-bottom: 8px;
  resize: none;
}

.feedback-note-actions { display: flex; gap: 8px; }

.feedback-note-saved {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--zinc-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.feedback-note-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.feedback-note-text { font-size: 12.5px; color: var(--text-2); flex: 1; font-style: italic; line-height: 1.5; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--zinc-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: all .25s ease;
  z-index: 9999;
  box-shadow: var(--sh-md);
  pointer-events: none;
  max-width: 340px;
  line-height: 1.4;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Apply Help panel ────────────────────────────────────────────────────── */
/* ── Insights page ──────────────────────────────────────────────────────── */
#insights-view { flex: 1; overflow-y: auto; min-height: 0; }

.insights-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 28px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.insights-page-hd {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.insights-page-hd h2 {
  font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.insights-page-hd p {
  font-size: 13px; color: var(--text-3);
}
.insights-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.insights-card-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.insights-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.insights-card-sub  { font-size: 12.5px; color: var(--text-3); }
.insights-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.insights-timestamp { font-size: 11.5px; color: var(--text-3); }
.insights-threshold-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface-2, var(--zinc-50));
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.insights-loading { padding: 20px; font-size: 13px; color: var(--text-3); }
.insights-empty   { padding: 20px; font-size: 13px; color: var(--text-3); }

/* Keyword bars */
.insights-kw-list { padding: 8px 0; }
.kw-row {
  display: grid;
  grid-template-columns: 28px 160px 1fr 40px 44px;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
}
.kw-row:hover { background: var(--zinc-50); }
.kw-rank  { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-align: right; }
.kw-name  { font-size: 13px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-bar-wrap {
  height: 8px;
  background: var(--zinc-100);
  border-radius: 4px;
  overflow: hidden;
}
.kw-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  min-width: 4px;
  transition: width .4s ease;
}
.kw-count { font-size: 12px; color: var(--text-2); font-weight: 600; text-align: right; }
.kw-pct   { font-size: 11.5px; color: var(--text-3); text-align: right; }

/* Skills gap */
.gap-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  gap: 8px;
}
.gap-placeholder-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.gap-placeholder-sub   { font-size: 13px; color: var(--text-3); max-width: 420px; line-height: 1.6; }
.gap-analyzing {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; gap: 12px;
}
.gap-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.gap-spinner-sub { font-size: 12px; color: var(--text-3); }
.gap-error { padding: 16px 20px; font-size: 13px; color: var(--red); }
.gap-results { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.gap-section { display: flex; flex-direction: column; gap: 10px; }
.gap-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}
.gap-label-hint { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.gap-label-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gap-dot-critical { background: #dc2626; }
.gap-dot-minor    { background: #d97706; }
.gap-dot-have     { background: #16a34a; }
.gap-label-critical { color: #dc2626; }
.gap-label-minor    { color: #d97706; }
.gap-label-have     { color: #16a34a; }
.gap-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.gap-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1.5px solid;
}
.gap-chip-critical { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.gap-chip-minor    { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.gap-chip-have     { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.gap-recommendation {
  display: flex;
  gap: 12px;
  background: var(--brand-light);
  border: 1.5px solid #c7c7f7;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  align-items: flex-start;
}
.gap-rec-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.gap-rec-text { font-size: 13.5px; color: var(--brand-text); line-height: 1.6; }

/* ── Date pill on card ──────────────────────────────────────────────────── */
.job-pill-date {
  color: var(--text-3);
}

/* ── Salary estimate chip ───────────────────────────────────────────────── */
.detail-chip-est {
  color: var(--text-3);
  border-style: dashed;
  font-style: italic;
}
.detail-chip-est-loaded {
  font-style: normal;
  color: var(--text-2);
  border-style: solid;
}

/* ── Skills gap panel ───────────────────────────────────────────────────── */
.skills-gap-panel {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-top: 4px;
}
.skills-gap-panel.skills-gap-error {
  background: var(--red-bg); border-color: #fca5a5; color: var(--red-t);
  font-size: 13px;
}
.skills-gap-header {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.skills-gap-verdict {
  font-size: 13px; color: var(--text-2); margin-bottom: 14px;
  line-height: 1.5; font-style: italic;
}
.skills-gap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.skills-gap-col-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px;
}
.skills-gap-have-label { color: #16a34a; }
.skills-gap-miss-label { color: #dc2626; }
.skills-gap-have {
  background: #f0fdf4; border-color: #bbf7d0; color: #15803d;
}
.skills-gap-miss {
  background: #fef2f2; border-color: #fecaca; color: #dc2626;
}

.apply-help-panel {
  background: var(--brand-light);
  border: 1.5px solid #c7c7f7;
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-top: 4px;
}
.apply-help-panel.apply-help-error {
  background: var(--red-bg); border-color: #fca5a5; color: var(--red-t);
  font-size: 13px;
}
.apply-help-header { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.apply-help-title  { font-size: 13.5px; font-weight: 700; color: var(--brand-text); }
.apply-help-sub    {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--brand-text); opacity: .65; margin-bottom: 8px;
}
.apply-help-cover  { position: relative; }
.apply-help-cover-text {
  font-size: 13px; color: var(--text); line-height: 1.7;
  white-space: pre-wrap; background: rgba(255,255,255,.65);
  border-radius: var(--r-sm); padding: 14px 14px 42px;
}
.apply-help-copy   { position: absolute; bottom: 8px; right: 8px; }
.apply-help-cover-actions {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.apply-help-cover-edit { display: flex; flex-direction: column; gap: 8px; }
.apply-help-cover-edit-footer { display: flex; gap: 6px; }

.apply-help-tips-list { display: flex; flex-direction: column; gap: 6px; }
.apply-tip-item {
  background: rgba(255,255,255,.65); border-radius: var(--r-sm);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.apply-tip-item-editing { background: rgba(255,255,255,.85); }
.apply-tip-text { font-size: 13px; color: var(--text); line-height: 1.55; }
.apply-tip-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.apply-tip-edit-ta { min-height: 64px; font-size: 13px; }

.apply-help-tips   { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.apply-help-tips li {
  font-size: 13px; color: var(--text); line-height: 1.55;
  background: rgba(255,255,255,.65); border-radius: var(--r-sm);
  padding: 9px 12px; display: flex; gap: 8px; align-items: flex-start;
}
.apply-help-tips li::before {
  content: "→"; color: var(--brand); font-weight: 700; flex-shrink: 0;
}

/* ── Logs ────────────────────────────────────────────────────────────────── */
#logs-view { flex: 1; overflow-y: auto; min-height: 0; }
.logs-inner { padding: 28px; max-width: 900px; }
.logs-header { margin-bottom: 22px; }
.logs-title  { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.logs-sub    { font-size: 13px; color: var(--text-3); }
.logs-empty  { font-size: 13px; color: var(--text-3); padding: 24px 0; }

.logs-table  { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.logs-table th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-3); padding: 0 12px 8px 0;
  border-bottom: 1.5px solid var(--border);
}
.logs-table td {
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.logs-table tr:last-child td { border-bottom: none; }
.logs-table tr:hover td { background: var(--surface-2); }

.log-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.log-badge.success { background: #d1fae5; color: #065f46; }
.log-badge.error   { background: #fee2e2; color: #991b1b; }
.log-badge.partial { background: #fef3c7; color: #92400e; }

.log-num { font-weight: 600; color: var(--brand); }
.log-zero { color: var(--text-3); }

/* ── Resume Chat ─────────────────────────────────────────────────────────── */
.resume-chat-panel {
  margin-top: 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px 12px;
}
.resume-chat-header { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.resume-chat-title  { font-size: 13.5px; font-weight: 700; color: var(--brand-text); white-space: nowrap; }
.resume-chat-sub    { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.resume-chat-msgs   { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.resume-chat-msg    {
  font-size: 12.5px; line-height: 1.5; border-radius: var(--r-sm); padding: 7px 10px;
}
.resume-chat-msg.user  { background: var(--brand); color: #fff; align-self: flex-end; max-width: 85%; }
.resume-chat-msg.bot   { background: rgba(255,255,255,.7); color: var(--text); align-self: flex-start; }
.resume-chat-msg.bot.loading { color: var(--text-3); font-style: italic; }
.resume-chat-input-row { display: flex; gap: 6px; }
.resume-chat-input     {
  flex: 1; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface);
  outline: none; transition: border-color .15s;
}
.resume-chat-input:focus { border-color: var(--brand); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Util ────────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.text-muted { color: var(--text-3); font-size: 12px; }
.flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zinc-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--zinc-300); }

/* ── Resume Changes (AI Tailoring Summary) ───────────────────────────────── */
.resume-changes-panel {
  display: flex;
  gap: 12px;
  background: var(--brand-light);
  border: 1.5px solid #c7c7f7;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-top: 8px;
}
.resume-changes-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.resume-changes-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-text);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.resume-changes-panel p { font-size: 13px; color: var(--brand-text); line-height: 1.6; opacity: .85; }
.resume-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ── AI Progress Bar ─────────────────────────────────────────────────────── */
.ai-processing { flex-direction: column; align-items: stretch; }
.ai-progress-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.ai-progress-bar {
  height: 4px;
  border-radius: 4px;
  background: #c7c7f7;
  overflow: hidden;
}
.ai-progress-fill {
  height: 100%;
  width: 40%;
  border-radius: 4px;
  background: var(--brand);
  animation: ai-sweep 1.4s ease-in-out infinite;
}
@keyframes ai-sweep {
  0%   { transform: translateX(-250%); }
  100% { transform: translateX(400%); }
}
.ai-processing-label {
  font-size: 12px;
  color: var(--brand-text);
  opacity: .8;
  text-align: center;
  margin: 0;
}

/* ── Resume Inline Editor ────────────────────────────────────────────────── */
.resume-editor-panel {
  border: 2px solid var(--brand);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 10px;
  background: var(--surface);
}
.resume-editor-hd { margin-bottom: 18px; }
.resume-editor-hd-title { font-size: 14px; font-weight: 700; color: var(--text); display: block; margin-bottom: 3px; }
.resume-editor-hd-sub   { font-size: 12px; color: var(--text-3); }

.resume-edit-section { margin-bottom: 20px; }
.resume-edit-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--brand);
  margin-bottom: 8px;
}

.resume-edit-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.resume-edit-input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.resume-edit-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,91,214,.1); }

.resume-edit-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.resume-edit-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,91,214,.1); }

.resume-edit-job {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--zinc-50);
}
.resume-edit-job:last-child { margin-bottom: 0; }

.resume-edit-job-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 130px;
  gap: 6px;
  margin-bottom: 8px;
}

.resume-edit-edu {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 6px;
  margin-bottom: 6px;
}
.resume-edit-edu:last-child { margin-bottom: 0; }

.resume-edit-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.resume-save-status {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 600;
  margin-left: 4px;
}

/* ── Salary estimate tooltip ─────────────────────────────────────────────── */
.sal-tip-icon {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  opacity: .65;
  font-style: normal;
  font-size: 11px;
  vertical-align: middle;
}
.sal-tip-icon:hover { opacity: 1; }
.sal-tip-bubble {
  position: fixed;
  background: #18181B;
  color: #fff;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .15s;
  z-index: 9999;
  pointer-events: none;
  white-space: normal;
  width: 280px;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.sal-tip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 5px solid transparent;
  border-top-color: #18181B;
}
/* tooltip show/hide handled via JS _showSalTip/_hideSalTip */

/* ── Archive view ─────────────────────────────────────────────────────────── */
#archive-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
#archive-list { width: 320px; min-width: 260px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
#archive-detail { flex: 1; overflow-y: auto; min-height: 0; background: var(--bg); }

/* ── Tour overlay & spotlight ────────────────────────────────────────────── */
#tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: all;
  background: transparent;
}
#tour-spotlight {
  position: fixed;
  z-index: 9001;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.58);
  border: 2.5px solid var(--brand);
  pointer-events: none;
  transition: left .35s cubic-bezier(.4,0,.2,1),
              top .35s cubic-bezier(.4,0,.2,1),
              width .35s cubic-bezier(.4,0,.2,1),
              height .35s cubic-bezier(.4,0,.2,1);
}

/* ── Tour card ───────────────────────────────────────────────────────────── */
#tour-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--surface);
  border: 1.5px solid var(--brand);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: 9100;
  overflow: hidden;
}
.tour-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--brand-light);
  border-bottom: 1px solid #c7c7f7;
}
.tour-title { font-size: 11.5px; font-weight: 700; color: var(--brand-text); text-transform: uppercase; letter-spacing: .5px; flex: 1; }
.tour-step-label { font-size: 11px; color: var(--brand-text); opacity: .7; }
.tour-mute { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1; opacity: .65; }
.tour-mute:hover { opacity: 1; }
.tour-close { background: none; border: none; cursor: pointer; font-size: 17px; color: var(--text-3); padding: 0 2px; line-height: 1; }
.tour-close:hover { color: var(--text); }
.tour-voice-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-bottom: 1px solid #ddddf8;
  background: rgba(91,91,214,.04);
}
.tour-voice-label { font-size: 11px; font-weight: 600; color: var(--brand-text); opacity: .7; white-space: nowrap; }
.tour-voice-wrap { flex: 1; }
.tour-voice-wrap select { font-size: 11.5px; padding: 3px 22px 3px 7px; height: 26px; }
.tour-body { padding: 14px 16px; }
.tour-step-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tour-step-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.tour-footer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.tour-progress { flex: 1; height: 3px; background: var(--zinc-200); border-radius: 2px; overflow: hidden; }
.tour-progress-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width .35s; }



/* ── Cover letter survey ─────────────────────────────────────────────────── */
.survey-why {
  background: #fff;
  border: 1px solid #c7c7f7;
  border-radius: var(--r-md, 8px);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 16px;
}
.survey-q { margin-bottom: 14px; }
.survey-q-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-1, #111); margin-bottom: 2px; }
.survey-q-hint  { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.survey-saved-note { font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: none; letter-spacing: 0; }

/* ── Move your data ──────────────────────────────────────────────────────── */
.transfer-actions { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.found-list { margin-top: 10px; }
.found-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
  font-size: 13px; background: #fff;
}
.found-item .hint { word-break: break-all; }
.transfer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--brand-light); border-bottom: 1px solid #c7c7f7;
  padding: 10px 16px; font-size: 13px; color: var(--text-2);
}

/* ── ATS panel ───────────────────────────────────────────────────────────── */
.ats-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ats-top .score-ring { width: 64px; height: 64px; }
.ats-verdict { font-size: 15px; font-weight: 700; color: var(--text-1, #111); }
.ats-compare { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.ats-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 12.5px; }
.ats-bar-label { width: 96px; color: var(--text-2); }
.ats-bar-track { flex: 1; height: 8px; background: var(--zinc-100); border-radius: 4px; overflow: hidden; }
.ats-bar-fill { height: 100%; border-radius: 4px; }
.ats-bar-num { width: 28px; text-align: right; font-weight: 600; }
.ats-list { margin: 4px 0 0 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.ats-list.ats-good { list-style: none; margin-left: 0; color: var(--green-t); }

.skills-gap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(17, 17, 24, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 620px; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-hd h2 { font-size: 17px; font-weight: 700; }

.ats-bar-fill.score-high { background: var(--green); }
.ats-bar-fill.score-mid  { background: var(--amber); }
.ats-bar-fill.score-low  { background: #DC2626; }

.level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 6px 0; }
.level-opt { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }

/* Web version: automatic job search isn't built yet */
#run-btn-wrap { display: none !important; }
#add-job-btn { margin-right: 0 !important; }

.search-sites { background: var(--zinc-50); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.search-sites-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.search-sites-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-sites-row select { max-width: 220px; padding: 6px 10px; font-size: 13px; }


/* ── Phone and small tablets ────────────────────────────────────────────── */
.mobile-back { display: none; }
@media (max-width: 820px) {
  #app-screen { flex-direction: column-reverse; height: 100vh; height: 100dvh; }

  /* sidebar becomes a bottom tab bar */
  #sidebar { width: 100%; min-width: 0; height: 58px; flex-direction: row; flex-shrink: 0; border-top: 1px solid var(--sb-active); padding-bottom: env(safe-area-inset-bottom); }
  .sb-logo, .sb-footer { display: none; }
  .sb-nav { flex: 1; display: flex; flex-direction: row; justify-content: space-around; align-items: stretch; padding: 0; gap: 0; }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 3px; margin: 0; padding: 6px 2px; border-radius: 0; font-size: 10.5px; position: relative; }
  .nav-item svg { width: 20px; height: 20px; opacity: .85; }
  .nav-item .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  .nav-item .guide-nav-dot { position: absolute; top: 8px; left: calc(50% + 8px); margin: 0; }

  #topbar { height: auto; min-height: 48px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  #page-title { font-size: 16px; }
  #topbar .btn { padding: 6px 10px; }
  #topbar-spacer { flex: 1 1 0; }

  .filter-bar { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; padding: 8px 12px; -webkit-overflow-scrolling: touch; }
  .filter-bar > * { flex-shrink: 0; }

  /* list and detail become two full-screen steps */
  .jobs-pane { flex-direction: column; }
  #job-list { width: 100%; min-width: 0; flex: 1; border-right: 0; }
  #job-detail { display: none; width: 100%; flex: 1; }
  #jobs-view.mobile-detail #job-list { display: none; }
  #jobs-view.mobile-detail #job-detail { display: block; }
  #jobs-view.mobile-detail .filter-bar, #jobs-view.mobile-detail #guide-prompt-banner { display: none; }
  .mobile-back { display: none; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--brand); width: 100%; text-align: left; flex-shrink: 0; }
  #jobs-view.mobile-detail .mobile-back { display: flex; }

  .guide-prompt-banner { flex-wrap: wrap; gap: 8px; }
  .guide-prompt-banner > span { flex: 1 1 100%; }
  .card-apply-btn { display: none; }                 /* no hover on touch: change status from the job itself */
  .filter-bar { scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .detail-inner { padding: 16px !important; }
  .detail-header { flex-wrap: wrap; gap: 12px; }
  .detail-actions { gap: 8px; }

  .settings-inner, .logs-inner, .insights-inner, .guide-inner { padding: 14px !important; max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 2vh 8px; }
  .modal-card { padding: 16px; max-width: 100%; }
  .level-grid { grid-template-columns: 1fr; }
  .toast { left: 12px; right: 12px; max-width: none; bottom: 70px; }
  #tour-card { left: 8px; right: 8px; bottom: 66px; width: auto; max-width: none; }
}
