/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --blue:    #1d4ed8;
  --blue-lt: #eff6ff;
  --blue-md: #dbeafe;
  --green:   #059669;
  --amber:   #d97706;
  --red:     #dc2626;
  --purple:  #7c3aed;
  --indigo:  #4f46e5;
  --grey:    #6b7280;

  --bg:      #f1f5f9;
  --card:    #ffffff;
  --border:  #e2e8f0;
  --text:    #0f172a;
  --text2:   #475569;

  --radius:  8px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);

  --status-spotted:  #4f46e5;
  --status-applied:  #2563eb;
  --status-interview:#d97706;
  --status-offer:    #059669;
  --status-rejected: #6b7280;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--blue); }
button { cursor: pointer; font-family: inherit; font-size: .95rem; }
select, input, textarea {
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: .45rem .65rem;
}
select:focus, input:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
textarea { resize: vertical; width: 100%; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: .5rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: #1e40af; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: .5rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
  background: #fff;
  color: var(--red);
  border: 1px solid #fca5a5;
  padding: .5rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
}
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: .3rem .8rem; font-size: .85rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: #1e3a5f;
  color: #fff;
  padding: 1rem 1.5rem;
}
.header-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-title {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.header-icon { font-size: 2rem; }
.header-title h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.header-title p  { font-size: .82rem; opacity: .75; margin-top: .15rem; }

.api-badge {
  font-size: .78rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.api-badge.ok     { background: #d1fae5; color: #065f46; }
.api-badge.no-key { background: #fef3c7; color: #92400e; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tab-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 1rem;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: .85rem 1.1rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  transition: color .12s, border-color .12s;
  position: relative;
}
.tab-btn:hover  { color: var(--blue); }
.tab-btn.active { color: var(--blue); border-color: var(--blue); font-weight: 700; }

.count-badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .05rem .4rem;
  border-radius: 10px;
  margin-left: .3rem;
  vertical-align: middle;
}

/* ── Main / panels ───────────────────────────────────────────────────────── */
.site-main {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}
.section-sub {
  color: var(--text2);
  font-size: .88rem;
  margin-bottom: 1rem;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */
.search-bar-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.control-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.control-group select { min-width: 170px; }

.info-banner {
  background: var(--blue-lt);
  border: 1px solid var(--blue-md);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-top: .85rem;
  font-size: .88rem;
  color: #1e40af;
}
.info-banner a { color: #1e40af; }

/* ── Search status / loading ─────────────────────────────────────────────── */
.search-status {
  text-align: center;
  padding: 2rem;
  color: var(--text2);
  font-size: .95rem;
}
.spinner { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results grid ─────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.vacancy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: box-shadow .15s;
}
.vacancy-card:hover { box-shadow: var(--shadow-md); }

.vacancy-card .vc-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}
.vacancy-card .vc-employer {
  font-size: .9rem;
  color: var(--blue);
  font-weight: 600;
}
.vacancy-card .vc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .18rem .55rem;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-level   { background: #ede9fe; color: #5b21b6; }
.tag-wage    { background: #d1fae5; color: #065f46; }
.tag-dist    { background: var(--bg); color: var(--text2); }
.tag-closing { background: #fef3c7; color: #92400e; }
.tag-dc      { background: #d1fae5; color: #065f46; }

.vacancy-card .vc-desc {
  font-size: .85rem;
  color: var(--text2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vc-actions {
  display: flex;
  gap: .5rem;
  margin-top: .25rem;
  flex-wrap: wrap;
}
.btn-save {
  font-size: .82rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .7rem;
  color: var(--text2);
  transition: all .12s;
}
.btn-save:hover, .btn-save.saved {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}
.btn-view {
  font-size: .82rem;
  background: none;
  border: 1px solid var(--blue-md);
  border-radius: 6px;
  padding: .3rem .7rem;
  color: var(--blue);
  text-decoration: none;
  display: inline-block;
  transition: background .12s;
}
.btn-view:hover { background: var(--blue-lt); }

.travel-chips { display: inline-flex; gap: .3rem; align-items: center; }
.travel-chip {
  font-size: .78rem;
  font-weight: 600;
  padding: .18rem .45rem;
  border-radius: 99px;
  white-space: nowrap;
}
.travel-drive   { background: #e0f2fe; color: #0369a1; }
.travel-transit { background: #f3e8ff; color: #6b21a8; }

.btn-expand {
  font-size: .82rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .65rem;
  color: var(--text2);
  transition: background .12s;
}
.btn-expand:hover { background: var(--bg); }

.vc-expanded {
  margin: .5rem 0;
  padding: .75rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Summary grid */
.vc-summary-grid { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.vc-si { display: flex; flex-direction: column; gap: .05rem; min-width: 80px; }
.vc-sl { font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); }
.vc-sv { font-size: .86rem; color: var(--text); font-weight: 500; }
.vc-sv-2027 { color: var(--green); font-weight: 700; }

/* Sections within expanded */
.vc-section { display: flex; flex-direction: column; gap: .3rem; border-top: 1px solid var(--border); padding-top: .55rem; }
.vc-section-label { font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); }
.vc-full-desc {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}
.vc-address {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .84rem;
  color: var(--text2);
  border-top: 1px solid var(--border);
  padding-top: .5rem;
}
.vc-address-label { font-weight: 600; color: var(--text); }

/* Start date tag */
.tag-start { background: #e0f2fe; color: #0369a1; }
.tag-start-future { background: #dcfce7; color: #15803d; font-weight: 700; }
.transport-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .84rem;
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
  margin-top: .1rem;
}
.transport-link:hover { text-decoration: underline; }

/* ── Travel filter row ───────────────────────────────────────────────────── */
.travel-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-top: .6rem;
  padding: .55rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.travel-filter-label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}
.control-group-inline {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.control-group-inline label {
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text2);
}
.control-group-inline select {
  font-size: .82rem;
  padding: .28rem .5rem;
}
.travel-filter-hint {
  font-size: .8rem;
  color: var(--text2);
  font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--text2);
}

/* ── Platforms ───────────────────────────────────────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.platform-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.platform-card .pc-icon { font-size: 1.8rem; }
.platform-card .pc-name { font-weight: 700; font-size: 1rem; }
.platform-card .pc-desc { font-size: .85rem; color: var(--text2); flex: 1; }
.platform-card a.btn-primary {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  margin-top: .25rem;
}

/* ── Neuro section ───────────────────────────────────────────────────────── */
.neuro-intro {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.neuro-intro h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.neuro-intro p  { font-size: .9rem; color: var(--text2); }

.employer-grid, .org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.employer-card, .org-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.employer-card .ec-header    { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .4rem; }
.employer-card .ec-icon      { font-size: 1.5rem; flex-shrink: 0; }
.employer-card .ec-name-block { display: flex; flex-direction: column; gap: .15rem; }
.employer-card .ec-name      { font-weight: 700; font-size: .98rem; }
.employer-card .ec-remote    { font-size: .73rem; color: #065f46; background: #d1fae5; padding: .1rem .4rem; border-radius: 8px; font-weight: 600; display: inline-block; width: fit-content; }
.employer-card .ec-prog   {
  font-size: .78rem;
  background: #ede9fe;
  color: #5b21b6;
  padding: .15rem .5rem;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: .4rem;
}
.employer-card .ec-desc { font-size: .84rem; color: var(--text2); margin-bottom: .5rem; }
.employer-card .ec-offices-row { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.ec-office {
  font-size: .75rem;
  padding: .12rem .4rem;
  border-radius: 8px;
  cursor: default;
  white-space: nowrap;
}
.ec-office-ok  { background: #d1fae5; color: #065f46; }
.ec-office-far { background: #f3f4f6; color: var(--text2); }
.ec-commute-ok   { font-size: .78rem; color: #065f46; font-weight: 600; margin-bottom: .4rem; }
.ec-commute-none { font-size: .78rem; color: #92400e; font-weight: 600; margin-bottom: .4rem; }
.employer-card a, .org-card a {
  font-size: .82rem;
  font-weight: 600;
}
.org-card .oc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.org-card .oc-name { font-weight: 700; }
.org-card .oc-desc { font-size: .84rem; color: var(--text2); margin-bottom: .5rem; }
.oc-type { font-size: .7rem; font-weight: 600; padding: .1rem .4rem; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.oc-type-both { background: #ede9fe; color: #5b21b6; }
.oc-type-uni  { background: #dbeafe; color: #1e40af; }
.oc-type-app  { background: #fef3c7; color: #92400e; }
.org-filter-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.org-filter-label { font-size: .82rem; color: var(--text2); font-weight: 600; }
.org-filter-btn {
  font-size: .78rem; font-weight: 600; padding: .2rem .65rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text2); cursor: pointer;
}
.org-filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.oc-highlights { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.oc-highlight {
  font-size: .73rem;
  background: #eff6ff;
  color: #1e40af;
  padding: .1rem .4rem;
  border-radius: 8px;
  font-weight: 600;
}
.gcse-callout {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: .85rem;
  color: #78350f;
  margin-top: .75rem;
}
.gcse-callout strong { color: #92400e; }

/* ── Universities tab ────────────────────────────────────────────────────── */
.uni-filter-row {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem 1rem; margin-bottom: 1rem;
}
.uni-filter-label { font-size: .82rem; color: var(--text2); font-weight: 600; margin-right: .25rem; }
.uni-toggle-label { display: flex; align-items: center; gap: .35rem; font-size: .85rem; cursor: pointer; }
.uni-filter-sub { font-size: .74rem; color: var(--text2); }
.uni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.uni-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .35rem;
}
.uc-header { display: flex; align-items: flex-start; gap: .6rem; }
.uc-icon   { font-size: 1.5rem; flex-shrink: 0; }
.uc-title-block { flex: 1; }
.uc-name   { font-weight: 700; font-size: .98rem; }
.uc-flags  { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.uni-flag  { font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 8px; }
.flag-rg   { background: #ede9fe; color: #5b21b6; }
.flag-oct  { background: #fee2e2; color: #991b1b; }
.flag-int  { background: #fef3c7; color: #92400e; }
.uni-grade {
  font-size: .82rem; font-weight: 800; padding: .2rem .55rem; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.grade-tier-1 { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.grade-tier-2 { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.grade-tier-3 { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.grade-tier-4 { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.uc-travel-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.uni-travel {
  font-size: .78rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 10px; cursor: default;
}
.ut-ok   { background: #d1fae5; color: #065f46; }
.ut-long { background: #fef3c7; color: #92400e; }
.ut-no   { background: #f3f4f6; color: var(--text2); }
.uc-routes { display: flex; flex-direction: column; gap: .1rem; }
.uc-route { font-size: .78rem; color: var(--text2); }
.uc-route-no { opacity: .6; }
.uc-entry-note { font-size: .8rem; color: #374151; background: #f9fafb; padding: .3rem .5rem; border-radius: 6px; }
.uc-courses-label { font-size: .75rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.uc-courses { display: flex; flex-direction: column; gap: .2rem; }
.uc-course { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .83rem; }
.uc-course-name { flex: 1; }
.uc-ucas-code { font-size: .72rem; color: var(--text2); font-family: monospace; flex-shrink: 0; }
.uc-notes { font-size: .79rem; color: #374151; border-left: 3px solid var(--border); padding-left: .6rem; }
.uni-card a { font-size: .82rem; font-weight: 600; margin-top: auto; }
.uni-empty { grid-column: 1/-1; text-align: center; color: var(--text2); padding: 2rem; }

.tips-section { margin-top: 1.5rem; }
.tip-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: .6rem;
  font-size: .88rem;
}
.tip-item strong { color: var(--blue); display: block; margin-bottom: .2rem; }

/* ── Tracker ─────────────────────────────────────────────────────────────── */
.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.tracker-header h2 { font-size: 1.15rem; font-weight: 700; }
.tracker-filters { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }

.tracker-list { display: flex; flex-direction: column; gap: .75rem; }

.tracker-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.tracker-card .tc-status-bar {
  width: 4px;
  border-radius: 4px;
  align-self: stretch;
  flex-shrink: 0;
}
.tc-status-bar.spotted   { background: var(--status-spotted);  }
.tc-status-bar.applied   { background: var(--status-applied);  }
.tc-status-bar.interview { background: var(--status-interview); }
.tc-status-bar.offer     { background: var(--status-offer);     }
.tc-status-bar.rejected  { background: var(--status-rejected);  }

.tracker-card .tc-body { flex: 1; min-width: 0; }
.tc-title    { font-weight: 700; font-size: .97rem; }
.tc-employer { font-size: .88rem; color: var(--blue); font-weight: 600; }
.tc-meta     { font-size: .82rem; color: var(--text2); margin-top: .2rem; }
.tc-notes    { font-size: .84rem; color: var(--text2); margin-top: .4rem; white-space: pre-wrap; }

.tc-status-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 12px;
  white-space: nowrap;
  text-transform: capitalize;
}
.status-badge-spotted   { background: #e0e7ff; color: #3730a3; }
.status-badge-applied   { background: #dbeafe; color: #1e40af; }
.status-badge-interview { background: #fef3c7; color: #92400e; }
.status-badge-offer     { background: #d1fae5; color: #065f46; }
.status-badge-rejected  { background: #f3f4f6; color: #374151; }

.tracker-card .tc-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.btn-edit-tracker {
  font-size: .8rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .65rem;
  color: var(--text2);
}
.btn-edit-tracker:hover { background: var(--bg); }

/* Edit panel */
.edit-panel {
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-md);
}
.edit-panel h3 { font-size: 1rem; margin-bottom: 1rem; }
.form-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .85rem;
}
.form-row label { font-size: .8rem; font-weight: 600; color: var(--text2); }
.panel-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text2);
}
.empty-state p { margin-bottom: 1rem; }

/* ── CV Studio ───────────────────────────────────────────────────────────── */
.cv-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 768px) { .cv-layout { grid-template-columns: 1fr; } }

.cv-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.cv-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
  flex-wrap: wrap;
  gap: .4rem;
}
.cv-panel-header h2 { font-size: 1rem; font-weight: 700; }

.filename-tag {
  font-size: .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15rem .5rem;
  border-radius: 10px;
  color: var(--text2);
  font-family: monospace;
}

.cv-text-view {
  margin-top: .85rem;
  font-size: .82rem;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .85rem;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.6;
}
.placeholder-text { color: var(--text2); font-family: inherit; font-style: italic; }

.cv-versions-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.cv-version-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .65rem .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.cv-version-item:hover { background: var(--bg); }
.cvi-info .cvi-name     { font-weight: 700; font-size: .92rem; }
.cvi-info .cvi-employer { font-size: .8rem; color: var(--blue); }
.cvi-info .cvi-date     { font-size: .75rem; color: var(--text2); }
.cvi-actions { display: flex; gap: .35rem; }

.cv-editor { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: .5rem; }
.editor-hint {
  background: var(--blue-lt);
  border: 1px solid var(--blue-md);
  border-radius: 6px;
  padding: .65rem .85rem;
  font-size: .82rem;
  color: #1e40af;
  margin-bottom: .85rem;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  color: #fff;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  font-size: .88rem;
  z-index: 999;
  box-shadow: var(--shadow-md);
  transition: opacity .2s;
}
.toast.hidden { opacity: 0; pointer-events: none; }

/* ── CV missing note ─────────────────────────────────────────────────────── */
.cv-missing-note {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: .55rem .8rem;
  font-size: .83rem;
  color: #78350f;
  margin-bottom: .6rem;
}

/* ── Personal Statement Builder ──────────────────────────────────────────── */
.ps-builder-section {
  margin-top: 1.75rem;
  border-top: 2px solid var(--border);
  padding-top: 1.5rem;
}
.ps-builder-header { margin-bottom: 1rem; }
.ps-builder-header h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; }

.ps-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 768px) { .ps-layout { grid-template-columns: 1fr; } }

.ps-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.ps-output-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.ps-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.ps-output-header h3 { font-size: .98rem; font-weight: 700; }

.ps-output {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: .83rem;
  line-height: 1.65;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem;
  background: #f8fafc;
  color: var(--text);
  resize: vertical;
}

.ps-guidance {
  margin-top: .85rem;
  background: var(--blue-lt);
  border: 1px solid var(--blue-md);
  border-radius: 6px;
  padding: .75rem 1rem;
  font-size: .82rem;
  color: #1e40af;
}
.ps-guidance ul { margin: .4rem 0 0 1.2rem; }
.ps-guidance li { margin-bottom: .25rem; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 600px) {
  .results-grid    { grid-template-columns: 1fr; }
  .platform-grid   { grid-template-columns: 1fr; }
  .employer-grid   { grid-template-columns: 1fr; }
  .org-grid        { grid-template-columns: 1fr; }
  .search-controls { gap: .5rem; }
  .control-group select { min-width: 130px; }
}
