/* ══════════════════════════════════════════════════════════════════
   Perik.ai — The Signal · Design System v2
   ══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Accent — liquid amber */
  --amber:       #E8A030;
  --amber-dim:   #C88020;
  --amber-bg:    rgba(232, 160, 48, 0.09);
  --amber-glow:  rgba(232, 160, 48, 0.22);

  /* Legacy compat aliases (JS-injected HTML may reference these) */
  --accent:      #E8A030;
  --accent-dark: #C88020;
  --accent-bg:   rgba(232, 160, 48, 0.09);
  --accent-ring: rgba(232, 160, 48, 0.22);

  /* Backgrounds */
  --bg:          #09080C;
  --surface:     #100E17;
  --surface-2:   #161222;
  --surface-3:   #1E1A2E;

  /* Borders */
  --border:        rgba(255, 255, 255, 0.07);
  --border-light:  rgba(255, 255, 255, 0.04);
  --border-hover:  rgba(255, 255, 255, 0.14);

  /* Text — warm off-white */
  --text-primary:   #F0EBE3;
  --text-secondary: rgba(240, 235, 227, 0.55);
  --text-muted:     rgba(240, 235, 227, 0.28);

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.60);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.75);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Layout */
  --topbar-h:    58px;
  --content-max: 880px;

  /* Spacing scale — overridden at breakpoints */
  --content-pad-x:  16px;
  --job-pad-y:      14px;
  --job-pad-x:      16px;
  --job-font:       15px;
  --search-pad:     10px 14px;
  --search-font:    14.5px;
}

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

/* ── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(232, 160, 48, 0.04) 0%, transparent 70%);
}

a::after { display: none !important; }
a:hover  { transform: none !important; }

/* ── Outer shell ───────────────────────────────────────────────── */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════ */
.site-header {
  background: rgba(16, 14, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max);
  padding: 0 24px;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-brand a {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 28px;
  width: 28px;
  display: block;
  filter: invert(1);
  user-select: none;
  border-radius: 5px;
}

.brand-tagline {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

h1 { display: none; }

.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Social + theme icons ──────────────────────────────────────── */
.social-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.social-icon-btn:hover {
  background: var(--surface-3);
  color: var(--text-secondary);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--surface-3);
  color: var(--text-secondary);
}

.theme-icon-day   { display: block; }
.theme-icon-night { display: none; }

[data-theme="day"] .theme-icon-day   { display: none; }
[data-theme="day"] .theme-icon-night { display: block; }

/* ══════════════════════════════════════════════════════════════════
   NAV TABS
   ══════════════════════════════════════════════════════════════════ */
.timeframe-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  position: sticky;
  top: var(--topbar-h);
  z-index: 90;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.timeframe-tabs::-webkit-scrollbar { display: none; }
.timeframe-tabs::before             { display: none; }

.tabs-inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: var(--content-max);
  padding: 0 16px;
}

.timeframe-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 48px;
  flex-shrink: 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.01em;
  border-radius: 0;
}

.timeframe-tab:hover  { color: var(--text-secondary); }
.timeframe-tab.active { color: var(--amber); font-weight: 600; border-bottom-color: var(--amber); }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
}

.timeframe-tab.active .count-badge {
  background: rgba(232, 160, 48, 0.15);
  color: var(--amber);
}

/* Saved — amber */
.timeframe-tab[data-timeframe="saved"]:hover  { color: var(--amber); }
.timeframe-tab[data-timeframe="saved"].active { color: var(--amber); border-bottom-color: var(--amber); }
.timeframe-tab[data-timeframe="saved"].active .count-badge { background: rgba(232,160,48,0.15); color: var(--amber); }

/* For You — sky */
.timeframe-tab[data-timeframe="foryou"]:hover  { color: #7DD3FC; }
.timeframe-tab[data-timeframe="foryou"].active { color: #7DD3FC; border-bottom-color: #7DD3FC; }

/* Applications — emerald */
.timeframe-tab[data-timeframe="applications"]:hover  { color: #6EE7B7; }
.timeframe-tab[data-timeframe="applications"].active { color: #6EE7B7; border-bottom-color: #6EE7B7; }
.timeframe-tab[data-timeframe="applications"].active .count-badge { background: rgba(110,231,183,0.12); color: #6EE7B7; }

/* ── Profile slot ──────────────────────────────────────────────── */
#sidebar-profile-slot {
  margin-left: auto;
  padding: 0 8px 0 12px;
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.sidebar-profile-sub { display: none; }

.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-profile-btn:hover { background: var(--surface-3); color: var(--text-primary); }

.sidebar-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 160, 48, 0.25);
}

.sidebar-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-profile-email {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sidebar-profile-edit-icon {
  flex-shrink: 0;
  font-size: 14px;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.sidebar-profile-btn:hover .sidebar-profile-edit-icon { opacity: 0.85; }

/* ══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-top: 24px;
  padding-bottom: 64px;
}

/* ── Search + filter ───────────────────────────────────────────── */
.search-container {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  flex: 1;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 3px var(--amber-bg);
}

.search-clear-btn {
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
}

.search-clear-btn:hover { color: var(--text-primary); background: var(--surface-3); }
.search-clear-btn:active { transform: none; }

/* ── Location combobox ──────────────────────────────────────────── */
.loc-combo { position: relative; flex-shrink: 0; }

.loc-combo-face {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 12px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: text;
  transition: border-color 0.15s, background 0.15s;
  min-width: 110px;
  max-width: 180px;
}
.loc-combo:hover .loc-combo-face,
.loc-combo.open  .loc-combo-face { border-color: var(--border-hover); }
.loc-combo.open  .loc-combo-face { border-color: var(--amber-dim); box-shadow: 0 0 0 3px var(--amber-bg); }
.loc-combo.has-value .loc-combo-face { background: var(--amber-bg); border-color: rgba(232,160,48,0.35); }

.loc-pin-icon { color: var(--text-muted); flex-shrink: 0; transition: color 0.15s; }
.loc-combo.has-value .loc-pin-icon { color: var(--amber); }

.loc-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  min-width: 0;
  cursor: text;
}
.loc-input::placeholder { color: var(--text-secondary); }
.loc-combo.has-value:not(.open) .loc-input { color: var(--amber); }

.loc-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.1s, color 0.1s;
}
.loc-clear:hover { background: var(--surface-3); color: var(--text-primary); }

.loc-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 200px;
  max-width: 300px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  z-index: 200;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.loc-option {
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  outline: none;
}
.loc-option[tabindex] { tabindex: -1; }
.loc-option:hover,
.loc-option:focus,
.loc-option.highlighted { background: var(--surface-3); color: var(--text-primary); }
.loc-option.selected { color: var(--amber); font-weight: 600; }

.loc-dropdown-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  list-style: none;
}

/* ── Filter toggle ─────────────────────────────────────────────── */
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-toggle-btn:hover    { color: var(--text-primary); border-color: var(--border-hover); }
.filter-toggle-btn.active,
.filter-toggle-btn.has-filter { background: var(--amber-bg); color: var(--amber); border-color: rgba(232,160,48,0.35); }

.filter-panel         { padding: 14px 0 2px; }
.filter-panel[hidden] { display: none; }

/* ── Discipline pills ──────────────────────────────────────────── */
#discipline-pills-container       { background: var(--bg); }
#discipline-pills-container:empty { display: none; }

.discipline-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 14px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.discipline-pills::-webkit-scrollbar { display: none; }

.discipline-pill {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}

.discipline-pill:hover  { color: var(--text-primary); border-color: var(--border-hover); background: var(--surface-3); }
.discipline-pill.active { background: var(--amber-bg); border-color: rgba(232,160,48,0.35); color: var(--amber); }
.discipline-pill.active .disc-count { opacity: 0.8; }
.disc-count { font-size: inherit; margin-left: 3px; opacity: 0.55; }

/* ── Company filter chips ──────────────────────────────────────── */
#company-tabs-container { padding: 0; background: none; }

.company-tabs { display: flex; flex-wrap: wrap; gap: 5px; }

.company-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-family: inherit;
}

.company-tab:hover  { color: var(--text-primary); border-color: var(--border-hover); }
.company-tab.active { background: var(--amber-bg); border-color: rgba(232,160,48,0.35); color: var(--amber); }
.company-tab.active .count-badge { background: rgba(232,160,48,0.15); color: var(--amber); }

.company-name { text-transform: capitalize; }

.company-tab .count-badge {
  font-size: 12px;
  padding: 0 5px;
  background: transparent;
  border: none;
  opacity: 0.55;
  min-width: auto;
}

/* ══════════════════════════════════════════════════════════════════
   JOB LISTINGS
   ══════════════════════════════════════════════════════════════════ */
.company-jobs {
  padding: 0;
  animation: none;
  /* Skip layout/paint for off-screen company blocks — dramatically speeds up
     monthly tab which can have 100+ company sections */
  content-visibility: auto;
  contain-intrinsic-size: 0 180px;
}

/* Scroll-triggered load sentinel */
.load-sentinel {
  height: 1px;
  overflow: hidden;
}
.loading-more-text {
  display: block;
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.6;
  letter-spacing: 0.04em;
  height: auto;
}

/* Company section header — Syne typeface, editorial */
.company-header {
  font-family: 'Syne', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 22px 2px 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: transparent;
  margin-bottom: 0;
  border: none;
}

.jobs-list {
  display: flex;
  flex-direction: column;
}

/* ── Job row ───────────────────────────────────────────────────── */
.job-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 14px;
  background: var(--surface);
  border: none;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  transition: background 0.12s, border-left-color 0.12s;
}

.job-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.job-item:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); border-bottom: none; }
.job-item:only-child  { border-radius: var(--radius-md); border-bottom: none; }

.job-item:hover {
  background: var(--surface-3);
  border-left-color: var(--amber);
}

.job-item-content { flex: 1; min-width: 0; }
.job-item-main    { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

.job-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: color 0.12s;
}

.job-link:hover { color: var(--amber); }

.job-item-meta {
  margin-top: 3px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.job-location {
  font-size: 12.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.job-salary {
  font-size: 12.5px;
  color: #6EE7B7;
  font-weight: 500;
}

.job-company-tag {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid rgba(232,160,48,0.20);
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  white-space: nowrap;
  text-transform: capitalize;
  transition: background 0.12s;
}

.job-company-tag:hover { background: rgba(232, 160, 48, 0.14); }

/* ── Discipline group ──────────────────────────────────────────── */
.discipline-group                     { padding: 0; border-radius: 0; }
.discipline-group + .discipline-group { margin-top: 8px; }

.discipline-title {
  font-family: 'Syne', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 14px 2px 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: none;
  margin-bottom: 0;
}

.discipline-count {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ── NEW badge ─────────────────────────────────────────────────── */
.new-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(110, 231, 183, 0.08);
  color: #6EE7B7;
  border: 1px solid rgba(110, 231, 183, 0.20);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Save button ───────────────────────────────────────────────── */
.job-save-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  padding: 7px 14px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.job-save-btn:hover { border-color: rgba(232,160,48,0.45); color: var(--amber); background: var(--amber-bg); }
.job-save-btn.saved { border-color: rgba(232,160,48,0.45); color: var(--amber); background: var(--amber-bg); }

/* ── Apply button ──────────────────────────────────────────────── */
.job-apply-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  padding: 3px 8px;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.job-apply-btn:hover   { border-color: rgba(110,231,183,0.4); color: #6EE7B7; background: rgba(110,231,183,0.06); }
.job-apply-btn.applied { background: rgba(110,231,183,0.08); border-color: rgba(110,231,183,0.3); color: #6EE7B7; }
.job-item.applied .job-link { text-decoration: line-through; opacity: 0.4; }

/* ── Applied counter ───────────────────────────────────────────── */
.applied-counter {
  text-align: center;
  font-size: 13.5px;
  color: #6EE7B7;
  font-weight: 500;
  padding: 6px 20px;
  background: rgba(110,231,183,0.05);
  border-bottom: 1px solid rgba(110,231,183,0.10);
}

/* ── Loading / error / info ────────────────────────────────────── */
.loading, .error, .info-message {
  padding: 52px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.loading { position: relative; }

.loading::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin: 16px auto 0;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error {
  color: rgba(255, 100, 100, 0.9);
  background: rgba(255, 50, 50, 0.06);
  border: 1px solid rgba(255, 50, 50, 0.16);
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 12px 16px;
  font-size: 14.5px;
  text-align: left;
}

/* ── Checkout bar ──────────────────────────────────────────────── */
.checkout-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface-2);
}

.checkout-count { color: var(--text-secondary); font-size: 14.5px; }

.checkout-btn {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(232,160,48,0.35);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.checkout-btn:hover { background: rgba(232, 160, 48, 0.15); border-color: var(--amber); }

/* ══════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════ */
#checkout-modal,
#auth-modal,
#resume-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#checkout-modal.open { display: flex; }
#auth-modal.open     { display: flex; }
#resume-modal.open   { display: flex; }
#auth-modal          { z-index: 1001; }
#resume-modal        { z-index: 1001; }

/* ── Modal panel ───────────────────────────────────────────────── */
.checkout-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px 24px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04) inset;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Close button ──────────────────────────────────────────────── */
.checkout-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.checkout-close:hover { color: var(--text-primary); background: var(--surface-3); border-color: var(--border-hover); }
[data-step="2"] .checkout-close,
[data-step="3"] .checkout-close { display: none; }

/* ── Step dots ─────────────────────────────────────────────────── */
.checkout-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }

.checkout-step-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.25s;
}

[data-step="1"] .checkout-step-dot[data-s="1"],
[data-step="2"] .checkout-step-dot[data-s="2"],
[data-step="3"] .checkout-step-dot[data-s="3"],
[data-step="4"] .checkout-step-dot[data-s="4"] {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(232,160,48,0.5);
}

/* ── Step pages ────────────────────────────────────────────────── */
.checkout-page { display: none; }

[data-step="1"] .checkout-page[data-page="1"],
[data-step="2"] .checkout-page[data-page="2"],
[data-step="3"] .checkout-page[data-page="3"],
[data-step="4"] .checkout-page[data-page="4"] { display: block; }

/* ── Application form (step 2) ────────────────────────────────── */
.checkout-form-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 22px 0 12px;
}
.checkout-form-section-title:first-child { margin-top: 0; }
.checkout-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkout-question-block {
  margin-bottom: 14px;
}
.checkout-question-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.checkout-req { color: var(--accent); margin-left: 1px; }
.checkout-question-input,
.checkout-question-textarea,
.checkout-question-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 9px 12px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.checkout-question-input::placeholder,
.checkout-question-textarea::placeholder { color: var(--text-muted); }
.checkout-question-input:focus,
.checkout-question-textarea:focus,
.checkout-question-select:focus {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 3px var(--amber-bg);
}
.checkout-question-textarea { resize: vertical; min-height: 80px; }
.checkout-radio-group {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.checkout-radio-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
}
.checkout-radio-label input[type="radio"] { accent-color: var(--amber); cursor: pointer; }
.checkout-question-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.checkout-question-checkbox-label input[type="checkbox"] {
  accent-color: var(--amber);
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}
.checkout-consent-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 8px;
  margin-bottom: 24px;
}

/* ── Modal text ────────────────────────────────────────────────── */
.checkout-heading {
  font-family: 'Syne', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.checkout-subheading {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.55;
}

/* ── Resume dropzone ───────────────────────────────────────────── */
.resume-dropzone {
  border: 1.5px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 14px;
}

.resume-dropzone:hover,
.resume-dropzone.drag-over { background: var(--surface-3); border-color: rgba(255,255,255,0.22); }

.resume-dropzone-icon   { font-size: 26px; margin-bottom: 8px; display: block; }
.resume-dropzone-label  { color: var(--text-primary); font-size: 15px; margin-bottom: 3px; font-weight: 500; }
.resume-dropzone-sub    { color: var(--text-muted); font-size: 13px; }
.resume-dropzone input[type="file"] { display: none; }

.resume-parsed-info {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(110, 231, 183, 0.06);
  border: 1px solid rgba(110, 231, 183, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 14.5px;
  color: #6EE7B7;
}

.resume-parsed-info.visible { display: flex; }
.resume-parsed-icon         { font-size: 15px; }

/* Parsing spinner shown while PDF.js extracts text */
.resume-parsed-info.parsing {
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.resume-parsed-info.parsing::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0.7;
}

.resume-privacy-note {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 18px;
}

/* ── Primary CTA ───────────────────────────────────────────────── */
.checkout-primary-btn {
  display: block;
  width: 100%;
  background: var(--amber);
  color: #0B0907;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.01em;
}

.checkout-primary-btn:hover:not(:disabled) { opacity: 0.90; transform: translateY(-1px); }
.checkout-primary-btn:active:not(:disabled) { transform: translateY(0); }
.checkout-primary-btn:disabled { opacity: 0.28; cursor: not-allowed; transform: none; }

/* ── Job checklist ─────────────────────────────────────────────── */
.checkout-job-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 20px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.checkout-job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.checkout-job-row.checked { border-left-color: var(--amber); background: var(--amber-bg); }
.checkout-job-row input[type="checkbox"] { accent-color: var(--amber); width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; }
.checkout-job-title       { font-size: 14.5px; color: var(--text-primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkout-job-company-pill { font-size: 12px; padding: 2px 7px; border-radius: 20px; background: rgba(255,255,255,0.06); color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }

/* ── API input ─────────────────────────────────────────────────── */
.checkout-api-section { margin-bottom: 18px; }

.checkout-api-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.checkout-api-help       { font-size: 13px; color: var(--amber); text-decoration: none; }
.checkout-api-help:hover { text-decoration: underline; }

.checkout-api-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.checkout-api-input:focus { border-color: var(--amber-dim); box-shadow: 0 0 0 3px var(--amber-bg); }

/* ── Progress list ─────────────────────────────────────────────── */
.checkout-progress-list { display: flex; flex-direction: column; gap: 7px; margin: 18px 0; }

.checkout-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text-secondary);
}

.progress-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.progress-icon.spinning { display: inline-block; animation: spin 1s linear infinite; }
.checkout-progress-row.done  { color: var(--text-primary); }
.checkout-progress-row.error { color: rgba(255,100,100,0.9); background: rgba(255,50,50,0.06); border-color: rgba(255,50,50,0.16); }

/* ── Result cards ──────────────────────────────────────────────── */
.checkout-success-header { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; color: #6EE7B7; margin-bottom: 4px; }
.checkout-success-sub    { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 20px; }
.checkout-result-cards   { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.checkout-result-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.result-card-header  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 10px; }
.result-card-title   { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.result-card-company { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

.result-open-btn {
  background: var(--surface-3);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}

.result-open-btn:hover { background: var(--amber-bg); color: var(--amber); border-color: rgba(232,160,48,0.35); }

.result-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 2px 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-family: inherit;
}

.result-copy-btn:hover  { color: var(--text-primary); border-color: var(--border-hover); }
.result-copy-btn.copied { color: #6EE7B7; border-color: rgba(110,231,183,0.30); background: rgba(110,231,183,0.06); }

.result-cover-letter {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.result-highlights       { font-size: 14.5px; color: var(--text-secondary); padding-left: 0; list-style: none; margin-bottom: 0; }
.result-highlights li    { padding: 3px 0 3px 14px; position: relative; line-height: 1.5; }
.result-highlights li::before { content: '→'; position: absolute; left: 0; color: var(--amber); }
.result-highlights-block { background: var(--surface-3); border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--border); }

/* ── Done / secondary button ───────────────────────────────────── */
.checkout-done-btn {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  font-family: inherit;
}

.checkout-done-btn:hover { background: var(--surface-3); color: var(--text-primary); }

/* ── Under construction screen ─────────────────────────────────── */
.checkout-wip-icon    { font-size: 40px; margin-bottom: 12px; }
.checkout-wip-heading { color: var(--amber); margin-bottom: 8px; }
.checkout-wip-link    { color: var(--amber); text-decoration: none; }
.checkout-wip-link:hover { text-decoration: underline; }

/* ── Error boxes ───────────────────────────────────────────────── */
.checkout-error {
  display: none;
  font-size: 14.5px;
  color: rgba(255,100,100,0.9);
  background: rgba(255,50,50,0.06);
  border: 1px solid rgba(255,50,50,0.16);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.checkout-error.visible { display: block; }

.checkout-credits-info {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.checkout-credits-info.over {
  color: rgba(255,100,100,0.8);
}

/* ══════════════════════════════════════════════════════════════════
   APPLICATIONS TABLE
   ══════════════════════════════════════════════════════════════════ */
.applications-dashboard     { padding: 0; }
.applications-table-wrap    { overflow-x: auto; border-radius: 0; border: none; }

.applications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.applications-table thead tr {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.applications-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  white-space: nowrap;
  font-family: 'Syne', sans-serif;
}

.applications-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.applications-table tbody tr:last-child td { border-bottom: none; }
.applications-table tbody tr:hover td      { background: var(--surface-3); }

.app-job-link { color: var(--text-primary); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.app-job-link:hover { color: var(--amber); }
.app-company  { color: var(--text-secondary); white-space: nowrap; }
.app-location { color: var(--text-muted); font-size: 13.5px; white-space: nowrap; }
.app-date     { color: var(--text-muted); font-size: 13.5px; white-space: nowrap; }

/* ── Status badges ─────────────────────────────────────────────── */
.app-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.app-status-badge.queued {
  background: rgba(232, 160, 48, 0.08);
  color: var(--amber);
  border: 1px solid rgba(232, 160, 48, 0.20);
}

.app-status-badge.queued::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border: 1.5px solid rgba(232, 160, 48, 0.3);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.app-status-badge.applied {
  background: rgba(110, 231, 183, 0.08);
  color: #6EE7B7;
  border: 1px solid rgba(110, 231, 183, 0.20);
}

.app-status-badge.applied::before { content: '●'; color: #6EE7B7; font-size: 7px; }

.app-status-badge.failed {
  background: rgba(255,50,50,0.06);
  color: rgba(255,100,100,0.9);
  border: 1px solid rgba(255,50,50,0.16);
}

/* ── Table action buttons ──────────────────────────────────────── */
.app-requeue-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  padding: 2px 7px;
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s;
}

.app-requeue-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }
.app-requeue-btn:disabled { opacity: 0.5; cursor: default; }

.app-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.app-delete-btn:hover { color: rgba(255,100,100,0.9); background: rgba(255,50,50,0.06); }

/* ── Application row expansion ─────────────────────────────────── */
.app-row.has-materials           { cursor: pointer; }
.app-row.has-materials:hover td  { background: var(--surface-3); }
.app-row.expanded td             { background: var(--amber-bg); }
.app-materials-row td            { padding: 0 !important; }

.app-materials {
  padding: 16px 20px;
  background: rgba(232, 160, 48, 0.04);
  border-left: 2px solid var(--amber-dim);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-materials-section { display: flex; flex-direction: column; gap: 5px; }

.app-materials-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Syne', sans-serif;
}

.app-materials-text      { font-size: 14.5px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; }
.app-highlights-list     { list-style: none; display: flex; flex-direction: column; gap: 5px; padding: 0; }
.app-highlights-list li  { font-size: 14.5px; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 7px; }
.app-highlights-list li::before { content: '→'; color: var(--amber); flex-shrink: 0; margin-top: 1px; }

.app-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 5px;
  transition: color 0.15s, border-color 0.15s;
}

.app-copy-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

.app-open-btn {
  display: inline-block;
  margin-top: 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
  transition: opacity 0.15s;
}

.app-open-btn:hover { opacity: 0.8; }

/* ══════════════════════════════════════════════════════════════════
   AUTH HEADER
   ══════════════════════════════════════════════════════════════════ */
.auth-header-slot { display: flex; align-items: center; gap: 6px; }

.auth-header-btn {
  background: var(--amber);
  border: none;
  border-radius: var(--radius-md);
  color: #0B0907;
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  padding: 7px 16px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.auth-header-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.auth-user-email {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-signout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}

.auth-signout-btn:hover { color: var(--text-primary); }

.credits-badge {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  white-space: nowrap;
}

.auth-resume-update-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px;
  transition: color 0.15s, border-color 0.15s;
}

.auth-resume-update-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

.auth-buy-credits-btn {
  background: var(--amber-bg);
  border: 1px solid rgba(232,160,48,0.30);
  border-radius: var(--radius-sm);
  color: var(--amber);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 12px;
  transition: background 0.15s, border-color 0.15s;
}

.auth-buy-credits-btn:hover    { background: rgba(232,160,48,0.14); border-color: var(--amber); }
.auth-buy-credits-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.credits-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid rgba(232,160,48,0.22);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

.auth-divider { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }

/* ══════════════════════════════════════════════════════════════════
   AUTH MODAL
   ══════════════════════════════════════════════════════════════════ */
.auth-panel { max-width: 400px; }

.auth-view         { display: none; }
.auth-view.visible { display: block; }

.auth-field { margin-bottom: 14px; }

.auth-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  font-family: 'Syne', sans-serif;
}

.auth-input { font-family: 'Outfit', sans-serif; }

.auth-error {
  display: none;
  font-size: 14px;
  color: rgba(255,100,100,0.9);
  background: rgba(255,50,50,0.06);
  border: 1px solid rgba(255,50,50,0.16);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 14px;
}

.auth-error.visible { display: block; }

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 0;
}

.auth-switch a       { color: var(--amber); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════
   FLOATING CHECKOUT BUTTON
   ══════════════════════════════════════════════════════════════════ */
#floating-checkout-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 16px;
  background: var(--amber);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 32px rgba(232, 160, 48, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

#floating-checkout-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#floating-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232, 160, 48, 0.50), 0 4px 12px rgba(0, 0, 0, 0.35);
}

#floating-checkout-btn:active { transform: translateY(0); }

.float-btn-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }

.float-btn-label {
  font-size: 15px;
  font-weight: 700;
  color: #0B0907;
  white-space: nowrap;
  font-family: 'Syne', sans-serif;
}

.float-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.22);
  color: #0B0907;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════ */
.perik-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

.perik-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════════════
   THEME TRANSITIONS
   ══════════════════════════════════════════════════════════════════ */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.25s ease, color 0.25s ease,
              box-shadow 0.25s ease, border-color 0.25s ease,
              filter 0.25s ease !important;
}

/* ══════════════════════════════════════════════════════════════════
   DAY (LIGHT) THEME
   ══════════════════════════════════════════════════════════════════ */
[data-theme="day"] {
  --amber:       #B8610A;
  --amber-dim:   #9A5108;
  --amber-bg:    rgba(184, 97, 10, 0.08);
  --amber-glow:  rgba(184, 97, 10, 0.18);

  --accent:      #B8610A;
  --accent-dark: #9A5108;
  --accent-bg:   rgba(184, 97, 10, 0.08);
  --accent-ring: rgba(184, 97, 10, 0.18);

  --bg:          #F6F4EF;
  --surface:     #FFFFFF;
  --surface-2:   #ECEAE3;
  --surface-3:   #E0DDD5;

  --border:        rgba(0, 0, 0, 0.08);
  --border-light:  rgba(0, 0, 0, 0.05);
  --border-hover:  rgba(0, 0, 0, 0.18);

  --text-primary:   #1A1510;
  --text-secondary: #6B5E4A;
  --text-muted:     #9E8E78;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
}

[data-theme="day"] body {
  background-image: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(184, 97, 10, 0.04) 0%, transparent 70%);
}

[data-theme="day"] .brand-logo { filter: none; }

[data-theme="day"] .site-header {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

[data-theme="day"] .timeframe-tabs    { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07); }
[data-theme="day"] #sidebar-profile-slot { border-left-color: rgba(0, 0, 0, 0.08); }
[data-theme="day"] .count-badge       { background: rgba(0, 0, 0, 0.06); }
[data-theme="day"] .checkout-step-dot { background: rgba(0, 0, 0, 0.08); }
[data-theme="day"] .checkout-job-company-pill { background: rgba(0, 0, 0, 0.05); }

[data-theme="day"] #floating-checkout-btn {
  box-shadow: 0 4px 16px rgba(184, 97, 10, 0.30), 0 1px 4px rgba(0, 0, 0, 0.08);
  color: #FEFCE8;
}

[data-theme="day"] #floating-checkout-btn:hover {
  box-shadow: 0 8px 24px rgba(184, 97, 10, 0.40), 0 2px 8px rgba(0, 0, 0, 0.10);
}

[data-theme="day"] .float-btn-label { color: #FEFCE8; }
[data-theme="day"] .float-btn-count { color: #FEFCE8; background: rgba(0, 0, 0, 0.20); }
[data-theme="day"] .auth-header-btn { color: #FEFCE8; }

[data-theme="day"] .checkout-close:hover        { border-color: rgba(0,0,0,0.14); }
[data-theme="day"] .result-copy-btn:hover       { border-color: rgba(0,0,0,0.14); }
[data-theme="day"] .auth-resume-update-btn:hover { border-color: rgba(0,0,0,0.18); }
[data-theme="day"] .app-requeue-btn:hover       { border-color: rgba(0,0,0,0.18); }
[data-theme="day"] .app-copy-btn:hover          { border-color: rgba(0,0,0,0.18); }
[data-theme="day"] .resume-dropzone:hover,
[data-theme="day"] .resume-dropzone.drag-over   { border-color: rgba(0,0,0,0.20); }

[data-theme="day"] #checkout-modal,
[data-theme="day"] #auth-modal,
[data-theme="day"] #resume-modal { background: rgba(0, 0, 0, 0.40); }

/* Day: For You — deeper blue */
[data-theme="day"] .timeframe-tab[data-timeframe="foryou"]:hover  { color: #0369A1; }
[data-theme="day"] .timeframe-tab[data-timeframe="foryou"].active  { color: #0369A1; border-bottom-color: #0369A1; }

/* Day: Applications — deeper green */
[data-theme="day"] .timeframe-tab[data-timeframe="applications"]:hover  { color: #059669; }
[data-theme="day"] .timeframe-tab[data-timeframe="applications"].active  { color: #059669; border-bottom-color: #059669; }
[data-theme="day"] .timeframe-tab[data-timeframe="applications"].active .count-badge { background: rgba(5,150,105,0.10); color: #059669; }

[data-theme="day"] .job-apply-btn:hover,
[data-theme="day"] .job-apply-btn.applied    { border-color: #059669; color: #059669; background: rgba(5,150,105,0.07); }
[data-theme="day"] .applied-counter         { color: #059669; background: rgba(5,150,105,0.05); border-bottom-color: rgba(5,150,105,0.12); }
[data-theme="day"] .resume-parsed-info                { background: rgba(5,150,105,0.06); color: #059669; border-color: rgba(5,150,105,0.18); }
[data-theme="day"] .resume-parsed-info.parsing        { background: rgba(0,0,0,0.03); color: var(--text-secondary); border-color: rgba(0,0,0,0.08); }
[data-theme="day"] .checkout-success-header { color: #059669; }
[data-theme="day"] .new-badge               { background: rgba(5,150,105,0.08); color: #059669; border-color: rgba(5,150,105,0.20); }
[data-theme="day"] .job-salary              { color: #059669; }
[data-theme="day"] .result-copy-btn.copied  { color: #059669; border-color: rgba(5,150,105,0.28); background: rgba(5,150,105,0.06); }
[data-theme="day"] .app-status-badge.applied { background: rgba(5,150,105,0.07); color: #059669; border-color: rgba(5,150,105,0.18); }
[data-theme="day"] .app-status-badge.applied::before { color: #059669; }
[data-theme="day"] .app-highlights-list li::before { color: var(--amber); }
[data-theme="day"] .result-highlights li::before   { color: var(--amber); }

[data-theme="day"] .app-status-badge.queued { background: rgba(184,97,10,0.08); color: #92400E; border-color: rgba(184,97,10,0.18); }
[data-theme="day"] .app-status-badge.queued::before { border-color: rgba(184,97,10,0.25); border-top-color: #B45309; }

/* ══════════════════════════════════════════════════════════════════
   FOR YOU VIEW
   ══════════════════════════════════════════════════════════════════ */
.foryou-header       { font-size: 12px; color: var(--text-muted); padding: 10px 2px 6px; letter-spacing: 0.02em; }
.foryou-resume-name  { color: var(--text-secondary); font-weight: 500; }
.foryou-match-hint   { font-size: 11px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.01em; }

.foryou-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px 48px;
  gap: 12px;
}

.foryou-empty-icon  { font-size: 26px; color: var(--amber); margin-bottom: 4px; }
.foryou-empty-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.foryou-empty-body  { font-size: 14px; color: var(--text-secondary); max-width: 320px; line-height: 1.6; }
.foryou-cta         { margin-top: 8px; width: auto; padding: 10px 24px; }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop scaling
   ══════════════════════════════════════════════════════════════════ */

/* ── Medium desktop (1024px+) ──────────────────────────────────── */
@media (min-width: 1024px) {
  :root {
    --topbar-h:      68px;
    --content-max:   1140px;
    --content-pad-x: 32px;
    --job-pad-y:     18px;
    --job-pad-x:     20px;
    --job-font:      16px;
    --search-pad:    12px 16px;
    --search-font:   15.5px;
  }

  body { font-size: 16px; }

  /* Header */
  .site-header-inner  { padding: 0 40px; }
  .brand-logo         { height: 32px; width: 32px; }
  .brand-tagline      { font-size: 13.5px; }

  /* Nav tabs */
  .tabs-inner         { padding: 0 32px; }
  .timeframe-tab      { height: 56px; font-size: 15px; padding: 0 20px; gap: 8px; }
  .count-badge        { font-size: 12.5px; padding: 2px 7px; }

  /* Main content */
  .main-content {
    padding-top: 32px;
    padding-bottom: 80px;
    padding-left: var(--content-pad-x);
    padding-right: var(--content-pad-x);
  }

  /* Search + filters */
  .search-container   { padding: 20px 24px; margin-bottom: 20px; }
  .search-row         { gap: 10px; }
  .search-input       { padding: var(--search-pad); font-size: var(--search-font); }
  .search-clear-btn   { height: 44px; width: 44px; font-size: 15px; }
  .filter-toggle-btn  { padding: 11px 18px; font-size: 14px; height: 44px; }

  /* Location combobox */
  .loc-combo-face     { height: 44px; padding: 0 12px 0 14px; min-width: 130px; max-width: 220px; }
  .loc-input          { font-size: 14px; }

  /* Discipline pills */
  .discipline-pills   { padding: 18px 0 24px; gap: 8px; }
  .discipline-pill    { padding: 8px 18px; font-size: 13.5px; }

  /* Company filter chips */
  .company-tab        { font-size: 14px; padding: 6px 14px; }

  /* Job items */
  .job-item           { padding: var(--job-pad-y) var(--job-pad-x) var(--job-pad-y) calc(var(--job-pad-x) - 2px); gap: 16px; }
  .job-link           { font-size: var(--job-font); }
  .job-location       { font-size: 13px; }
  .job-salary         { font-size: 13px; }
  .job-company-tag    { font-size: 14px; padding: 4px 11px; }
  .job-save-btn       { font-size: 14.5px; padding: 8px 16px; }
  .company-header     { font-size: 28px; padding: 28px 0 18px; }
  .discipline-title   { font-size: 11px; padding: 20px 2px 10px; }

  /* Filter panel */
  .filter-panel       { padding: 18px 0 4px; }
  .company-tabs       { gap: 6px; }
}

/* ── Large desktop (1440px+) ───────────────────────────────────── */
@media (min-width: 1440px) {
  :root {
    --content-max:   1360px;
    --content-pad-x: 48px;
    --job-pad-y:     20px;
    --job-pad-x:     24px;
    --job-font:      16.5px;
  }

  .brand-logo         { height: 36px; width: 36px; }
  .brand-tagline      { font-size: 14px; }
  .timeframe-tab      { height: 60px; font-size: 15.5px; padding: 0 24px; }
  .job-item           { padding: var(--job-pad-y) var(--job-pad-x) var(--job-pad-y) calc(var(--job-pad-x) - 2px); }
  .job-link           { font-size: var(--job-font); }
  .company-header     { font-size: 32px; padding: 32px 0 20px; }
  .search-container   { padding: 24px 28px; }
  .loc-combo-face     { max-width: 260px; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .site-header-inner  { padding: 0 14px; gap: 8px; }
  .tabs-inner         { padding: 0 2px; }
  .brand-tagline      { display: none; }
  .timeframe-tab      { padding: 0 10px; font-size: 13px; height: 46px; }

  .checkout-panel     { padding: 20px 16px 16px; border-radius: var(--radius-md); }
  .checkout-heading   { font-size: 16px; }
  .checkout-job-list  { max-height: 200px; }
  .checkout-form-row  { grid-template-columns: 1fr; gap: 0; }
  .result-cover-letter { max-height: 150px; }
  .auth-panel         { max-width: 100%; }
  .auth-user-email    { max-width: 80px; }
  .auth-header-btn    { padding: 6px 12px; font-size: 12.5px; }

  .main-content       { padding-top: 16px; padding-bottom: 48px; }
  .discipline-pills   { padding: 10px 0 6px; }
  .search-container   { padding: 12px 14px; }

  /* Search row wraps on small screens */
  .search-row         { flex-wrap: wrap; }
  .search-input-group { flex: 1 1 100%; order: -1; }
  .filter-toggle-btn  { flex: 1; justify-content: center; min-height: 44px; }
  .loc-combo          { flex: 1; }
  .loc-combo-face     { min-width: 0; max-width: 100%; width: 100%; height: 44px; }

  /* Job items — comfortable touch target */
  .job-item           { padding: 14px 12px; gap: 10px; }
  .job-link           { font-size: 15px; }
  .job-company-tag    { font-size: 12.5px; padding: 3px 8px; }
  .job-save-btn       { font-size: 13px; min-height: 38px; padding: 6px 12px; }

  #floating-checkout-btn { bottom: 20px; right: 16px; padding: 11px 16px; }
  .float-btn-label    { font-size: 14px; }
  #sidebar-profile-slot { max-width: 120px; }
}

/* ══════════════════════════════════════════════════════════════════
   ENHANCEMENTS — Animations, Depth & Interactions
   ══════════════════════════════════════════════════════════════════ */

/* ── Film grain texture overlay ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/* ── Keyframes ─────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes amberPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(232, 160, 48, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4); }
  50%       { box-shadow: 0 8px 44px rgba(232, 160, 48, 0.62), 0 2px 8px rgba(0, 0, 0, 0.4); }
}

/* ── Page-load entrance ────────────────────────────────────────── */
.site-header    { animation: fadeIn 0.35s ease both; }
.timeframe-tabs { animation: fadeSlideUp 0.4s 0.08s ease both; }
.main-content   { animation: fadeSlideUp 0.4s 0.14s ease both; }

/* ── Job item staggered entrance ───────────────────────────────── */
/* Fires on every render — gives a clear "content loaded" signal   */
.job-item                 { animation: fadeSlideUp 0.28s ease both; }
.job-item:nth-child(1)    { animation-delay: 0ms;   }
.job-item:nth-child(2)    { animation-delay: 45ms;  }
.job-item:nth-child(3)    { animation-delay: 90ms;  }
.job-item:nth-child(4)    { animation-delay: 135ms; }
.job-item:nth-child(5)    { animation-delay: 180ms; }
.job-item:nth-child(6)    { animation-delay: 225ms; }
.job-item:nth-child(7)    { animation-delay: 270ms; }
.job-item:nth-child(8)    { animation-delay: 315ms; }
.job-item:nth-child(9)    { animation-delay: 360ms; }
.job-item:nth-child(10)   { animation-delay: 405ms; }
.job-item:nth-child(n+11) { animation-delay: 450ms; }

/* ── Company header — large editorial Syne display ─────────────── */
.company-header {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  padding: 20px 0 14px;
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 1.2;
  animation: fadeSlideUp 0.35s ease both;
}

/* ── Floating button — amber glow pulse ────────────────────────── */
#floating-checkout-btn.visible {
  animation: amberPulse 2.8s 0.6s ease-in-out infinite;
}

#floating-checkout-btn.visible:hover,
#floating-checkout-btn.visible:active {
  animation: none; /* snap to static hover state */
}

/* ── Job row — refined hover interactions ──────────────────────── */
@media (hover: hover) {
  /* Subtle rightward nudge on the title */
  .job-link {
    display: inline-block;
    transition: color 0.12s, transform 0.18s ease;
  }

  .job-item:hover .job-link {
    transform: translateX(3px);
  }

  /* Save button hidden by default, slides in on row hover */
  .job-save-btn:not(.saved) {
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.18s ease, transform 0.18s ease,
                background 0.15s, color 0.15s, border-color 0.15s;
  }

  .job-item:hover .job-save-btn:not(.saved),
  .job-item:focus-within .job-save-btn:not(.saved) {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Always show saved-state buttons regardless of hover */
.job-save-btn.saved {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* ── Respect reduced-motion preference ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .timeframe-tabs,
  .main-content,
  .job-item,
  .company-header {
    animation: none !important;
  }

  #floating-checkout-btn.visible { animation: none !important; }
}

/* ══════════════════════════════════════════════════════════════════
   OPEN PROPS — Replace flat easing with physics-based curves
   Requires: https://unpkg.com/open-props/easings.min.css
   ══════════════════════════════════════════════════════════════════ */

/* Entrance animations — pronounced ease-out deceleration */
.site-header    { animation-timing-function: var(--ease-out-3, ease); }
.timeframe-tabs { animation-timing-function: var(--ease-out-3, ease); }
.main-content   { animation-timing-function: var(--ease-out-3, ease); }
.job-item       { animation-timing-function: var(--ease-out-3, ease); }
.company-header { animation-timing-function: var(--ease-out-3, ease); }

/* Floating button entrance/exit */
#floating-checkout-btn {
  transition-timing-function: var(--ease-spring-2, ease);
}

/* Amber pulse — smooth sinusoidal breathe */
#floating-checkout-btn.visible {
  animation-timing-function: var(--ease-in-out-3, ease-in-out);
}

/* Hover transitions on interactive elements */
@media (hover: hover) {
  .job-link {
    transition-timing-function: var(--ease-out-2, ease);
  }

  /* Save button spring slide-in */
  .job-save-btn:not(.saved) {
    transition-timing-function: var(--ease-spring-2, ease),
                                var(--ease-spring-2, ease),
                                var(--ease-2, ease),
                                var(--ease-2, ease),
                                var(--ease-2, ease);
  }
}

/* ══════════════════════════════════════════════════════════════════
   VIEW TRANSITIONS API
   Smooth crossfade when switching tabs / filters.
   Falls back gracefully in browsers without support.
   ══════════════════════════════════════════════════════════════════ */

/* Name the transitioning region */
#dynamic-content           { view-transition-name: job-feed; }
#discipline-pills-container { view-transition-name: disc-pills; }

/* Old content fades + slides out */
::view-transition-old(job-feed) {
  animation: 160ms var(--ease-2, ease) both vt-out;
}

/* New content fades + slides in with a short delay */
::view-transition-new(job-feed) {
  animation: 240ms 80ms var(--ease-out-3, ease) both vt-in;
}

/* Pills — subtler, faster swap */
::view-transition-old(disc-pills) {
  animation: 120ms var(--ease-2, ease) both vt-out;
}
::view-transition-new(disc-pills) {
  animation: 160ms 40ms var(--ease-out-2, ease) both vt-in;
}

@keyframes vt-out {
  to { opacity: 0; transform: translateY(-6px); }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Suppress view-transition animation on reduced-motion */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(job-feed),
  ::view-transition-new(job-feed),
  ::view-transition-old(disc-pills),
  ::view-transition-new(disc-pills) {
    animation: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PAGE LOADING BAR
   Thin amber progress bar anchored to top of viewport.
   Shown during tab switches / filter changes via render() wrapper.
   ══════════════════════════════════════════════════════════════════ */
#page-loading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), color-mix(in srgb, var(--amber) 60%, #fff));
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--amber);
  transition: opacity 0.15s ease;
}

#page-loading-bar.bar-loading {
  opacity: 1;
  width: 75%;
  transition: width 1.8s cubic-bezier(0.05, 0.6, 0.4, 1), opacity 0.15s ease;
}

#page-loading-bar.bar-done {
  width: 100%;
  opacity: 0;
  transition: width 0.18s ease, opacity 0.25s 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  #page-loading-bar { display: none; }
}
