/* ==========================================================================
   Jobs Browser - Train & Hire
   Editorial utility aesthetic: clean hierarchy, warm neutrals, subtle depth
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout: override parent containers so jobs page fills viewport with no
   outer scrollbar.  Inner panels (.jobs-list, .jobs-detail) handle scroll.
   -------------------------------------------------------------------------- */

body:has(.jobs-browser) > div.bg-white {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(.jobs-browser) main.container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.jobs-browser {
  font-family: var(--jobs-font);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.jobs-filter-form {
  display: contents;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.jobs-browser-header {
  padding: 0.6rem 1rem;
  background: var(--jobs-sidebar-bg);
  border-bottom: 1px solid var(--jobs-card-border);
  flex-shrink: 0;
}

.jobs-filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.jobs-filter-row .jobs-search-input-wrap {
  flex: 1 1 180px;
  max-width: 280px;
  margin-bottom: 0;
}

.loc-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-left: 1px solid var(--jobs-card-border);
  padding-left: 0.4rem;
  flex-shrink: 1;
  min-width: 0;
}

.jobs-filter-row .jobs-location-input-wrap {
  flex: 1 1 150px;
  max-width: 220px;
}

.jobs-filter-row .pf-bar {
  padding: 0;
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
}

.jobs-browser-header h1 {
  font-family: var(--jobs-font);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--jobs-text-primary);
  margin-bottom: 0.15rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.jobs-browser-header p {
  color: var(--jobs-text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 0;
  font-weight: 400;
  max-width: 560px;
}

/* --------------------------------------------------------------------------
   Two-column body
   -------------------------------------------------------------------------- */

.jobs-browser-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.jobs-sidebar {
  width: 400px;
  min-width: 400px;
  background: var(--jobs-sidebar-bg);
  border-right: 1px solid var(--jobs-card-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar footer */
.jobs-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--jobs-card-border);
  padding: 0.65rem 1rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--jobs-text-secondary);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Search & filters form */
.jobs-search-form {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--jobs-card-border);
  background: #fff;
  flex-shrink: 0;
}

/* Search input with icon */
.jobs-search-input-wrap {
  position: relative;
  margin-bottom: 0;
}

.jobs-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--jobs-text-muted);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.jobs-search-input-wrap:focus-within .jobs-search-icon {
  stroke: var(--jobs-accent);
}

.jobs-search-input {
  display: block;
  width: 100%;
  font-family: var(--jobs-font);
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-weight: 400;
  padding: 0.38rem 0.75rem 0.38rem 2rem;
  border-radius: 100px;
  border: 1.5px solid var(--jobs-card-border);
  background: #f9fafb;
  color: var(--jobs-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}

@media (min-width: 769px) {
  .jobs-search-input {
    font-size: 0.85rem;
  }
}

.jobs-search-input::placeholder {
  color: var(--jobs-text-muted);
  font-weight: 400;
}

.jobs-search-input:focus {
  border-color: var(--jobs-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
}

/* --------------------------------------------------------------------------
   Location autocomplete
   -------------------------------------------------------------------------- */

.loc-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--jobs-card-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.loc-suggestion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--jobs-text-primary);
  transition: background 0.1s;
}

.loc-suggestion:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.loc-suggestion:last-child { border-radius: 0 0 0.5rem 0.5rem; }

.loc-suggestion:hover,
.loc-suggestion--active {
  background: var(--jobs-accent-bg, #eef3ff);
}

.loc-suggestion--remote {
  border-bottom: 1px solid var(--jobs-card-border);
}

.loc-suggestion__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--jobs-text-muted);
  stroke-width: 2;
  fill: none;
}

.loc-suggestion--remote .loc-suggestion__icon {
  stroke: var(--jobs-accent);
}

.loc-suggestion__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-suggestion__badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--jobs-accent);
  background: var(--jobs-accent-bg, #eef3ff);
  padding: 0.1rem 0.4rem;
  border-radius: 100px;
  white-space: nowrap;
}

.loc-suggestion__badge--ref {
  color: var(--jobs-text-muted);
  background: #f3f4f6;
}

.loc-radius-wrap {
  display: flex;
  align-items: center;
}

/* Distance pill dropdown positioned correctly within loc-group */
.loc-radius-wrap .pf-pill-wrap {
  flex-shrink: 0;
}

/* Mobile filter button - hidden on desktop, shown on mobile */
.jobs-mobile-filter-btn {
  display: none; /* shown via media query on mobile */
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--jobs-card-border);
  border-radius: 10px;
  background: #fff;
  color: var(--jobs-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}

.jobs-mobile-filter-btn svg {
  width: 16px;
  height: 16px;
}

.jobs-mobile-filter-btn:hover {
  border-color: var(--jobs-accent);
  color: var(--jobs-accent);
  background: #f0f4ff;
}

/* Filter grid - collapsible, defaults to collapsed */
.jobs-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.jobs-filters.filters-open {
  overflow: visible;
}

.jobs-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.jobs-filter-label {
  font-family: var(--jobs-font);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jobs-text-muted);
  margin-bottom: 0;
  padding-left: 0.1rem;
}

/* Custom select wrapper with chevron */
.jobs-select-wrap {
  position: relative;
}

.jobs-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--jobs-text-muted);
  pointer-events: none;
  transition: border-top-color 0.2s ease;
}

.jobs-select-wrap:focus-within::after {
  border-top-color: var(--jobs-accent);
}

.jobs-select {
  display: block;
  width: 100%;
  font-family: var(--jobs-font);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 1.6rem 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1.5px solid var(--jobs-card-border);
  background-color: #f9fafb;
  color: var(--jobs-text-primary);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.jobs-select:focus {
  border-color: var(--jobs-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background-color: #fff;
}

.jobs-select:hover:not(:focus) {
  border-color: #c4c8cc;
  background-color: #f3f4f6;
}

/* Filter actions row */
.jobs-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.jobs-btn-search {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--jobs-font);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  letter-spacing: -0.01em;
  background: var(--jobs-accent);
  color: #fff;
  border: 1.5px solid var(--jobs-accent);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.jobs-btn-search:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
  transform: translateY(-1px);
}

.jobs-btn-search:active {
  transform: scale(0.98);
  box-shadow: none;
}

.jobs-btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: var(--jobs-font);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.5rem 0.7rem;
  color: var(--jobs-text-secondary);
  background: transparent;
  border: 1.5px solid var(--jobs-card-border);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.jobs-btn-clear svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.jobs-btn-clear:hover {
  color: #dc3545;
  border-color: #dc3545;
  background: #fef2f2;
  text-decoration: none;
}

/* Save This Search button */
.jobs-btn-save-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-family: var(--jobs-font);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.5rem 0.7rem;
  color: var(--jobs-accent);
  background: transparent;
  border: 1.5px solid var(--jobs-accent);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.jobs-btn-save-search svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.jobs-btn-save-search:hover {
  color: #fff;
  background: var(--jobs-accent);
  border-color: var(--jobs-accent);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
  transform: translateY(-1px);
  text-decoration: none;
}

.jobs-btn-save-search:active {
  transform: scale(0.98);
  box-shadow: none;
}

.jobs-btn-save-search-saved {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
  cursor: default;
  pointer-events: none;
}

.jobs-btn-save-search-saved svg {
  stroke-width: 2.5;
}

/* --------------------------------------------------------------------------
   Job cards list (scrollable)
   -------------------------------------------------------------------------- */

.jobs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #c4c8cc transparent;
}

.jobs-list::-webkit-scrollbar { width: 5px; }
.jobs-list::-webkit-scrollbar-track { background: transparent; }
.jobs-list::-webkit-scrollbar-thumb { background: #c4c8cc; border-radius: 3px; }

/* --------------------------------------------------------------------------
   Job card
   -------------------------------------------------------------------------- */

.job-card {
  display: block;
  background: var(--jobs-card-bg);
  border: 1.5px solid var(--jobs-card-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.18s ease;
  position: relative;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.job-card:hover {
  border-color: #c7d7f7;
  border-left-color: var(--jobs-accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.job-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-card.active {
  border-left-color: var(--jobs-accent);
  background: #f0f4ff;
  box-shadow: var(--jobs-card-hover-shadow);
  border-color: #c7d7f7;
}

.job-card.active:hover {
  border-left-color: var(--jobs-accent);
  border-color: #c7d7f7;
}

.job-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--jobs-text-primary);
  margin-bottom: 0.15rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.job-card-company {
  font-size: 0.8rem;
  color: var(--jobs-text-secondary);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.job-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  color: var(--jobs-text-muted);
}

.job-card-meta .meta-separator {
  color: #d1d5db;
  font-size: 0.6rem;
}

.job-card-salary {
  font-weight: 600;
  color: #1e6b3a;
  font-size: 0.8rem;
}

.job-card-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.job-card-skills {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.job-card-skills .skill-chip {
  font-size: 0.67rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #eef1f5;
  color: #475569;
  letter-spacing: -0.01em;
}

.job-card-skills .skill-chip.skill-chip--matched {
  background: #e4f5ea;
  color: #2d6a4f;
  border: 1px solid #c8e6d0;
}

.job-card-skills .skill-chip.skill-chip--missing {
  background: #faeaeb;
  color: #943838;
  border: 1px solid #ebd3d4;
}

.job-card-posted {
  font-size: 0.7rem;
  color: var(--jobs-text-muted);
  margin-top: 0.35rem;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Badge variants (shared across cards and detail)
   -------------------------------------------------------------------------- */

.badge-remote   { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge-hybrid   { background-color: #dbeafe !important; color: #1e40af !important; }
.badge-onsite   { background-color: #f1f3f5 !important; color: #495057 !important; }

.badge-full-time  { background-color: #dbeafe !important; color: #1e3a5f !important; }
.badge-part-time  { background-color: #fef3c7 !important; color: #92400e !important; }
.badge-contract   { background-color: #e0e7ff !important; color: #3730a3 !important; }
.badge-internship { background-color: #f1f3f5 !important; color: #495057 !important; }

.badge-salary        { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge-hourly        { background-color: #fef3c7 !important; color: #92400e !important; }
.badge-commission    { background-color: #fce7f3 !important; color: #9d174d !important; }
.badge-contract-rate { background-color: #e0e7ff !important; color: #3730a3 !important; }

.job-card-badges span,
.job-detail-badges span {
  font-family: var(--jobs-font);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.01em;
  border: none;
}

.job-detail-badges span {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Detail pane
   -------------------------------------------------------------------------- */

.jobs-detail {
  flex: 1;
  overflow-y: auto;
  background: var(--jobs-detail-bg);
  scrollbar-width: thin;
  scrollbar-color: #c4c8cc transparent;
}

.jobs-detail::-webkit-scrollbar { width: 5px; }
.jobs-detail::-webkit-scrollbar-track { background: transparent; }
.jobs-detail::-webkit-scrollbar-thumb { background: #c4c8cc; border-radius: 3px; }

/* Placeholder state when no job selected */
.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--jobs-text-muted);
  text-align: center;
  padding: 2rem;
  user-select: none;
}

.detail-placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.detail-placeholder-icon svg {
  width: 32px;
  height: 32px;
  stroke: #adb5bd;
  stroke-width: 1.5;
  fill: none;
}

.detail-placeholder h3 {
  font-family: var(--jobs-font);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--jobs-text-secondary);
  margin-bottom: 0.25rem;
}

.detail-placeholder p {
  font-size: 0.88rem;
  color: var(--jobs-text-muted);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Job detail content
   -------------------------------------------------------------------------- */

.job-detail-content {
  padding: 1rem 2.5rem 3rem;
  max-width: 780px;
}

.job-detail-header {
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--jobs-card-border);
}

.job-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.job-detail-title-row .bookmark-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-top: 0.15rem;
}

.job-detail-title-row .bookmark-toggle svg {
  width: 18px;
  height: 18px;
}

.job-detail-title {
  font-family: var(--jobs-font);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--jobs-text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0;
  line-height: 1.2;
}

.job-detail-company {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.job-detail-company-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--jobs-card-border);
  background: #f9fafb;
}

.job-detail-company-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--jobs-card-border);
  background: linear-gradient(135deg, #e8eef4, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--jobs-font);
  font-weight: 800;
  font-size: 0.95rem;
  color: #3d5a80;
  flex-shrink: 0;
}

.job-detail-company-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--jobs-text-secondary);
  letter-spacing: -0.01em;
}

.job-detail-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--jobs-text-secondary);
}

.job-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.job-detail-meta-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--jobs-text-muted);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.job-detail-meta-item strong {
  font-weight: 600;
  color: var(--jobs-text-primary);
}

/* --------------------------------------------------------------------------
   Detail sections
   -------------------------------------------------------------------------- */

.job-detail-section {
  margin-bottom: 1.75rem;
}

.job-detail-section-heading {
  font-family: var(--jobs-font);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--jobs-text-secondary);
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f0f1f3;
}

/* Rich text (ActionText) */
.job-detail-section .trix-content,
.job-detail-section .job-description-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: #374151;
}

.job-detail-section .trix-content p,
.job-detail-section .job-description-text p {
  margin-bottom: 0.8rem;
}

/* Skills list */
.job-detail-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-family: var(--jobs-font);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.skill-pill:hover {
  transform: translateY(-1px);
}

.skill-pill.required {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.skill-pill.preferred {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.skill-pill .pill-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.skill-pill.matched {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.skill-pill.missing {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

.skill-match-icon {
  flex-shrink: 0;
  vertical-align: -1px;
}

/* Credentials */
.credential-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.88rem;
  color: var(--jobs-text-primary);
}

.credential-item + .credential-item {
  border-top: 1px solid #f3f4f6;
}

.credential-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.credential-required {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.credential-required.is-required {
  background: #fef2f2;
  color: #991b1b;
}

.credential-required.is-preferred {
  background: #f3f4f6;
  color: #6b7280;
}

/* Locations */
.location-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--jobs-text-primary);
}

.location-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--jobs-text-muted);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

/* Apply action (inline in header) */
.job-detail-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.job-detail-action:empty {
  display: none;
}

.btn-apply-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--jobs-font);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.38rem 1.1rem;
  letter-spacing: -0.01em;
  background: var(--jobs-accent);
  color: #fff;
  border: 1px solid var(--jobs-accent);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-apply-compact:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(13, 110, 253, 0.25);
  color: #fff;
  text-decoration: none;
}

.btn-apply-compact:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-apply-compact svg {
  transition: transform 0.18s ease;
}

.btn-apply-compact:hover svg {
  transform: translateX(2px);
}

.apply-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--jobs-font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
}

.apply-chip--applied {
  background: #e4f5ea;
  color: #1a7a42;
  border: 1px solid #c8e6d0;
}

.apply-track-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--jobs-font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  color: var(--jobs-accent);
  background: #fff;
  border: 1.5px solid var(--jobs-accent);
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.apply-track-link:hover {
  background: #eef2ff;
  text-decoration: none;
  transform: translateY(-1px);
}

.apply-skills-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--jobs-font);
  font-size: 0.88rem;
  font-weight: 500;
  color: #a44040;
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--jobs-text-muted);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-state-icon svg {
  width: 26px;
  height: 26px;
  stroke: #adb5bd;
  stroke-width: 1.5;
  fill: none;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.empty-state-action {
  display: inline-flex;
  align-items: center;
  font-family: var(--jobs-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--jobs-accent);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1.5px solid var(--jobs-accent);
  transition: all 0.18s ease;
}

.empty-state-action:hover {
  background: var(--jobs-accent);
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Full page show (non-turbo)
   -------------------------------------------------------------------------- */

.job-show-page {
  font-family: var(--jobs-font);
  max-width: 780px;
  margin: 0 auto;
}


.job-show-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--jobs-font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--jobs-text-secondary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s ease;
}

.job-show-back:hover {
  color: var(--jobs-accent);
}

.job-show-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --------------------------------------------------------------------------
   Loading state
   -------------------------------------------------------------------------- */

turbo-frame[busy] .job-detail-content {
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.job-detail-content {
  animation: fadeSlideIn 0.25s ease-out;
}

.job-card {
  animation: fadeSlideIn 0.25s ease-out both;
}

.job-card:nth-child(1)  { animation-delay: 0.02s; }
.job-card:nth-child(2)  { animation-delay: 0.04s; }
.job-card:nth-child(3)  { animation-delay: 0.06s; }
.job-card:nth-child(4)  { animation-delay: 0.08s; }
.job-card:nth-child(5)  { animation-delay: 0.10s; }
.job-card:nth-child(6)  { animation-delay: 0.12s; }
.job-card:nth-child(7)  { animation-delay: 0.14s; }
.job-card:nth-child(8)  { animation-delay: 0.16s; }
.job-card:nth-child(9)  { animation-delay: 0.18s; }
.job-card:nth-child(10) { animation-delay: 0.20s; }

/* --------------------------------------------------------------------------
   Filter toggle button
   -------------------------------------------------------------------------- */

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  font-family: var(--jobs-font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 8px;
  border: 1.5px solid var(--jobs-card-border);
  background: #f9fafb;
  color: var(--jobs-text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-toggle-btn:hover {
  border-color: #c4c8cc;
  background: #f3f4f6;
}

.filter-toggle-btn.filter-toggle-active {
  border-color: var(--jobs-accent);
  color: var(--jobs-accent);
  background: #eef2ff;
}

.filter-toggle-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* Chevron indicator rotates on expand */
.filter-toggle-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: auto;
  transition: transform 0.25s ease;
}

.filter-toggle-btn.filter-toggle-active::after {
  transform: rotate(180deg);
}

/* Active filter count badge */
.filter-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--jobs-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Accordion expansion container (hidden on desktop)
   -------------------------------------------------------------------------- */

.job-card-expand {
  display: none;
}

.job-card-industry {
  font-size: 0.65rem;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.job-card-response {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  color: var(--jobs-text-muted, #9aa0a6);
  font-weight: 500;
}

.job-card-response svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
  /* iOS fix: pin the body with position:fixed so it always fills exactly the
     visible viewport.  This avoids 100vh (too tall on iOS) and 100dvh (changes
     dynamically when the toolbar shows/hides, causing scroll jumps).
     Keep .bg-white as the single scroll container and remove all nested
     scroll containers to avoid iOS rubber-band/stuck-scroll bugs. */
  body:has(.jobs-browser) {
    position: fixed !important;
    inset: 0 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  body:has(.jobs-browser) > div.bg-white {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body:has(.jobs-browser) main.container {
    display: block;
  }

  .jobs-browser {
    overflow: visible;
  }

  .jobs-browser-body {
    flex-direction: column;
    flex: none;
  }

  .jobs-sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: none;
    overflow: visible;
  }

  /* --- Hide detail pane on mobile --- */
  .jobs-detail {
    display: none;
  }

  /* Don't highlight the pre-selected card on mobile (no detail pane visible) */
  .job-card.active {
    border-left-color: var(--jobs-card-border);
    background: var(--jobs-card-bg);
    box-shadow: var(--jobs-card-shadow);
    border-color: var(--jobs-card-border);
  }

  /* --- Jobs list: natural document flow, no inner scroll container --- */
  .jobs-list {
    max-height: none;
    overflow: visible;
  }

  /* --- Accordion expansion --- */
  .job-card-expand {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .accordion-open .job-card-expand {
    border-top: 1px solid var(--jobs-card-border);
    margin-top: 0.5rem;
  }

  .accordion-open .job-card {
    border-left-color: var(--jobs-accent);
    background: #f0f4ff;
    border-color: #c7d7f7;
  }

  .job-card-expand .job-detail-content {
    padding: 0.75rem 0.5rem 0;
    max-width: none;
  }

  .job-card-expand .job-detail-section:last-child {
    margin-bottom: 0.5rem;
  }

  .job-card-expand .job-detail-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .job-card-expand .job-detail-action {
    margin-top: 0.4rem;
  }

  .accordion-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
  }

  .job-detail-content {
    padding: 1.5rem;
  }

  /* --- Mobile: single search bar + filter icon --- */
  .jobs-browser-header {
    padding: 0.5rem 0.75rem;
  }

  .jobs-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .jobs-filter-row .jobs-search-input-wrap {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }

  /* Hide location group and pill bar on mobile */
  .loc-group {
    display: none;
  }

  .jobs-filter-row .pf-bar {
    display: none;
  }

  /* Show mobile filter button */
  .jobs-mobile-filter-btn {
    display: flex;
  }

  /* Show location section in all-filters panel on mobile */
  .af-body .af-location-section {
    display: block;
  }



  /* Prevent suggestions from being clipped by af-body scroll */
  .af-location-input-wrap .loc-suggestions {
    position: fixed;
    left: 1.5rem;
    right: 1.5rem;
    top: auto;
    z-index: 1100;
  }

  .jobs-search-input {
    padding: 0.4rem 0.75rem 0.4rem 2rem;
  }

  .jobs-browser-header h1 {
    font-size: 1.1rem;
  }
}

@media (max-width: 575.98px) {
  .job-detail-content {
    padding: 1.25rem;
  }

  .job-detail-title {
    font-size: 1.3rem;
  }

  .job-detail-meta {
    gap: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Job card bookmark toggle
   -------------------------------------------------------------------------- */

.job-card-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}

.job-card-wrap .job-card {
  margin-bottom: 0;
}

.job-card-bookmark {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
}

.bookmark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--jobs-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  backdrop-filter: blur(4px);
}

.bookmark-toggle:hover {
  background: #fff;
  color: var(--jobs-accent);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bookmark-toggle:active {
  transform: scale(0.95);
}

.bookmark-toggle svg {
  width: 16px;
  height: 16px;
}

.bookmark-toggle-saved {
  color: var(--jobs-accent);
  background: rgba(13, 110, 253, 0.08);
}

.bookmark-toggle-saved:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
}

@keyframes bookmarkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.bookmark-toggle-saved {
  animation: bookmarkPop 0.3s ease;
}

/* (search actions moved inline with .jobs-filter-actions above) */

/* --------------------------------------------------------------------------
   Loading state for detail pane
   -------------------------------------------------------------------------- */

.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--jobs-text-muted);
  text-align: center;
  padding: 2rem;
  gap: 1rem;
}

.detail-loading p {
  font-family: var(--jobs-font);
  font-size: 0.88rem;
  color: var(--jobs-text-muted);
  margin: 0;
}

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

.detail-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e4e7eb;
  border-top-color: var(--jobs-accent);
  border-radius: 50%;
  animation: detailSpin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   Company Assessment card (job detail)
   -------------------------------------------------------------------------- */

.job-assessment-card {
  border: 1.5px solid var(--jobs-card-border);
  border-radius: 12px;
  background: var(--jobs-card-bg);
  overflow: hidden;
}

.job-assessment-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, #eef2ff 0%, #f6f7f9 60%, #fef9f0 100%);
  border-bottom: 1px solid var(--jobs-card-border);
}

.job-assessment-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--jobs-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.job-assessment-title {
  font-family: var(--jobs-font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--jobs-text-primary);
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.job-assessment-desc {
  font-family: var(--jobs-font);
  font-size: 0.82rem;
  color: var(--jobs-text-secondary);
  line-height: 1.55;
}

.job-assessment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f0f1f3;
}

.job-assessment-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--jobs-font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--jobs-text-secondary);
}

.job-assessment-meta-item svg {
  width: 14px;
  height: 14px;
  stroke: var(--jobs-text-muted);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.job-assessment-action {
  padding: 1rem 1.25rem;
}

.job-assessment-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--jobs-font);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.75rem;
  background: var(--jobs-accent);
  color: #fff;
  border: 1px solid var(--jobs-accent);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
  letter-spacing: -0.01em;
}

.job-assessment-cta:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.3);
  color: #fff;
  text-decoration: none;
}

.job-assessment-cta:active {
  transform: translateY(0);
  box-shadow: none;
}

.job-assessment-cta svg {
  transition: transform 0.18s ease;
}

.job-assessment-cta:hover svg {
  transform: translateX(3px);
}

.job-assessment-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-family: var(--jobs-font);
  font-size: 0.85rem;
  font-weight: 600;
}

.job-assessment-result-passed {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.job-assessment-result-failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.job-assessment-signin {
  font-family: var(--jobs-font);
  font-size: 0.85rem;
  color: var(--jobs-text-secondary);
  margin: 0;
}

.job-assessment-signin a {
  color: var(--jobs-accent);
  font-weight: 600;
  text-decoration: none;
}

.job-assessment-signin a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Apply status (already applied / sign-in hint)
   -------------------------------------------------------------------------- */

.apply-status-applied {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-family: var(--jobs-font);
  font-size: 0.88rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 0.75rem;
}

.btn-apply-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--jobs-font);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.5rem;
  color: var(--jobs-accent);
  background: #fff;
  border: 1.5px solid var(--jobs-accent);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-apply-secondary:hover {
  background: #eef2ff;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-apply svg {
  margin-left: 0.35rem;
  transition: transform 0.18s ease;
}

.btn-apply:hover svg {
  transform: translateX(3px);
}

.apply-blocked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.apply-blocked-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--jobs-font);
  font-size: 0.85rem;
  font-weight: 500;
  color: #b91c1c;
}

.apply-signin-hint {
  font-family: var(--jobs-font);
  font-size: 0.88rem;
  color: var(--jobs-text-secondary);
  margin: 0;
}

.apply-signin-hint a {
  color: var(--jobs-accent);
  font-weight: 600;
  text-decoration: none;
}

.apply-signin-hint a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Flash toast notifications (for save/unsave actions)
   -------------------------------------------------------------------------- */

.flash-messages-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.flash-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--jobs-font);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
}

.flash-toast a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.flash-toast-success {
  background: #065f46;
  color: #d1fae5;
}

.flash-toast-success a {
  color: #a7f3d0;
}

.flash-toast-info {
  background: #1e3a5f;
  color: #dbeafe;
}

.flash-toast-info a {
  color: #93c5fd;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Application form improvements
   -------------------------------------------------------------------------- */

.apply-field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.apply-field-header .apply-field-label {
  margin-bottom: 0;
}

.apply-field-hint {
  font-family: var(--jobs-font);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--jobs-text-muted);
  font-style: italic;
}

.apply-field-error {
  font-family: var(--jobs-font);
  font-size: 0.78rem;
  font-weight: 500;
  color: #dc3545;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.apply-errors-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.apply-error-item {
  padding-left: 1.4rem;
  font-size: 0.82rem;
  line-height: 1.6;
}

.apply-back-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.apply-back-separator {
  font-family: var(--jobs-font);
  font-size: 0.82rem;
  color: var(--jobs-text-muted);
}

/* --------------------------------------------------------------------------
   Company name links
   -------------------------------------------------------------------------- */

.job-card-company-link {
  color: inherit;
  text-decoration: none;
}

.job-card-company-link:hover {
  color: var(--jobs-accent, #0d6efd);
  text-decoration: underline;
}

a.job-detail-company-name:hover {
  color: var(--jobs-accent, #0d6efd);
}

/* ==========================================================================
   Pill Filters
   ========================================================================== */

/* Pill bar */
.pf-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pf-bar::-webkit-scrollbar {
  display: none;
}

/* Pill wrapper (contains pill button + dropdown) */
.pf-pill-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Pill button */
.pf-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid #d1d5db;
  border-radius: 100px;
  background: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pf-pill:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.pf-pill-active,
.pf-pill-has-selections {
  border-color: #16a34a;
  color: #15803d;
  background: #f0fdf4;
}

.pf-pill-all {
  border-style: solid;
  border-color: #e5e7eb;
  color: #6b7280;
}

.pf-pill-all:hover {
  border-color: #9ca3af;
  color: #374151;
}

.pf-pill-all svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Chevron */
.pf-chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s ease;
}

.pf-pill-active .pf-chevron {
  transform: rotate(180deg);
}

/* Badge */
.pf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  background: #16a34a;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

/* Dropdown */
.pf-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 100;
  padding: 0.75rem 0 0;
}

.pf-dropdown-open {
  display: block;
}

/* Options grid */
.pf-options {
  padding: 0 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.pf-options-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Individual option (checkbox/radio label) */
.pf-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #374151;
  transition: background 0.1s ease;
  user-select: none;
}

.pf-option:hover {
  background: #f3f4f6;
}

/* Custom checkbox */
.pf-check {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.pf-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pf-option input[type="checkbox"]:checked + .pf-check {
  background: #16a34a;
  border-color: #16a34a;
}

.pf-option input[type="checkbox"]:checked + .pf-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Custom radio */
.pf-radio {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.pf-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pf-option input[type="radio"]:checked + .pf-radio {
  border-color: #16a34a;
}

.pf-option input[type="radio"]:checked + .pf-radio::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
}

/* Dropdown footer */
.pf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
}

.pf-reset {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.pf-reset:hover {
  color: #111827;
}

.pf-apply {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: #1d4ed8;
  border: none;
  border-radius: 100px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.pf-apply:hover {
  background: #1e40af;
}

/* ==========================================================================
   All Filters Panel
   ========================================================================== */

.af-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.af-overlay-open {
  display: block;
  opacity: 1;
}

.af-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
}

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

.af-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.af-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
}

.af-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  color: #6b7280;
  transition: background 0.15s ease, color 0.15s ease;
}

.af-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.af-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.af-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.af-section {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.af-section:last-child {
  border-bottom: none;
}

.af-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.65rem;
}

.af-options {
  display: flex;
  flex-direction: column;
}

.af-options-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.af-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #fff;
}

.af-reset {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.af-reset:hover {
  color: #111827;
}

.af-apply {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: #1d4ed8;
  border: none;
  border-radius: 100px;
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.af-apply:hover {
  background: #1e40af;
}

/* All-filters location section (mobile-only, hidden on desktop) */
.af-location-section {
  display: none; /* shown on mobile via media query */
}

/* Pill-duplicate filters shown in all-filters panel on all viewports.
   Inputs are disabled via JS to prevent radio/checkbox conflicts with pills,
   and enabled when the panel opens. */

.af-location-input-wrap {
  position: relative;
}

.af-location-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--jobs-text-muted, #9aa0a6);
  stroke-width: 1.5;
  fill: none;
  pointer-events: none;
}

.af-location-input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-weight: 400;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.af-location-input::placeholder {
  color: var(--jobs-text-muted, #9aa0a6);
}

.af-location-input:focus {
  border-color: var(--jobs-accent, #0d6efd);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
}

.af-radius-wrap {
  margin-top: 0.5rem;
}

.af-radius-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

/* Responsive */
@media (max-width: 768px) {
  .pf-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    min-width: auto;
    z-index: 200;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
  }

  /* Drag handle indicator */
  .pf-dropdown::after {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 8px auto 4px;
  }

  .pf-dropdown-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }

  .pf-footer {
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
  }

  .af-panel {
    width: 100vw;
    border-radius: 16px 0 0 0;
  }
}
