html, body {
  max-width: 100%;
  overflow-x: hidden;
}
* {
  min-width: 0;
}

html { scroll-behavior: smooth; }

/* =========================
   COLOR SYSTEM
   ========================= */
:root {
  --bg: #fafafa;
  --text-main: #222;
  --text-secondary: #555;
  --border: #ddd;
  --card-bg: #fff;
  --card-border: #e5e5e5;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04);

  --button-bg: #000;
  --button-text: #fff;
  --banner-bg: #e8e8e8;   /* soft grey, subtle */
  --footer-hover: #222;   /* dark hover for light mode */
}

[data-theme="dark"] {
  --bg: #111;
  --text-main: #eee;
  --text-secondary: #bbb;
  --border: #444;
  --card-bg: #1a1a1a;
  --card-border: #333;
  --card-shadow: 0 2px 6px rgba(0,0,0,0.5);

  --button-bg: #fff;
  --button-text: #000;
  --banner-bg: #1c1c1c;  /* darker grey that fits dark theme */
  --footer-hover: #eee;   /* dark hover for light mode */
}

/* =========================
   GLOBAL
   ========================= */
* {
  box-sizing: border-box;
}

body {
  font-family: Inter, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--text-main);
  transition: opacity .15s ease;
}

a:hover {
  color: var(--footer-hover);
  opacity: 1;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 1rem;
  padding-top: .25rem;
}

/* =========================
   THEME TOGGLE + SCROLL TOP
   ========================= */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 10px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  font-size: 1.2rem;
}

#scrollTop {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--button-bg);
  color: var(--button-text);
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
}


/* =========================
   HERO IMAGE
   ========================= */
.hero-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
}

.hero-text h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.hero-text p {
  margin: 10px 0 0;
  font-size: 1.15rem;
}

.hero-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  width: 90%;
  max-width: 700px;
}

.hero-ctas {
  margin-top: 10px;       /* less gap above CTAs */
  display: flex;
  justify-content: center;
  gap: 8px;               /* slightly tighter */
}

.hero-btn {
  padding: 6px 12px;      /* smaller buttons */
  font-size: 0.75rem;
  border-radius: 4px;
}

.hero-btn:hover {
  background: var(--button-text);
  color: var(--button-bg);
}


/* =========================
   CTA BAR
   ========================= */
.cta-wrapper {
  margin-top: 10px;
  text-align: center;
}

.cta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}

.cta-bar a {
  background: var(--button-bg);
  color: var(--button-text);
  padding: 6px 10px;
  border: 2px solid var(--button-bg);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.cta-bar a:hover {
  background: var(--button-text);
  color: var(--button-bg);
}

/* =========================
   SIMPLE BANNER
   ========================= */
.simple-banner {
  display: inline-block;
  background: var(--banner-bg);
  color: var(--text-main);
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 40px;         /* ← pill shape */
  margin: 14px auto 14px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);  /* subtle lift */
  border: 1px solid var(--card-border);
   position: relative;
}
.simple-banner-wrapper {
  text-align: center;
}


/* =========================
   HOMEPAGE MAIN WRAPPER
   ========================= */
.homepage-inner {
  max-width: 720px;       /* or 740px if you want tighter */
  margin: 6px auto 60px; /* centered, with visual breathing room */
  padding: 0 20px;        /* prevents content touching edges */
  width: 100%;            /* ensures grid fits */
  box-sizing: border-box;
}


/* =========================
   HORIZONTAL JOB LINES (CORRECTED)
   ========================= */

/* =========================
   JOB CARD (FINAL, WORKING)
   ========================= */

.job-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 6px 0;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .15s ease;
}

.job-card:hover {
  transform: translateY(-2px);
}
.job-card {
  position: relative;
}

.job-age {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --- TOP ROW: logo + title/company + pay --- */
.job-card-top {
  display: flex;
  align-items: flex-start;  /* ensures all items align at top */
  gap: 12px;
  margin-bottom: 6px;
  width: 100%;
}

.job-logo img,
.job-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  object-fit: cover;
  background: var(--border);
}

/* holds title + company */
.job-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.job-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.job-company {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* top-right pay */
.job-pay {
  font-size: 1rem;          /* match .job-title */
  font-weight: 700;         /* match .job-title */
  color: var(--text-main);
  white-space: nowrap;
  align-self: flex-start;   /* aligns with top of the row */
}


/* --- BODY WRAPPER ENSURES PILLS DROP UNDER TOP ROW --- */
.job-card-body {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* --- PILLS ROW --- */
.job-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  order: 3; /* always below title/company */
}

/* individual pill */
.pill {
  padding: 4px 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--text-secondary);
  display: inline-block;
}

[data-theme="dark"] .pill {
  background: #222;
  border-color: #333;
  color: #ccc;
}

/* prevents pills from being stuck in a flex-row */
.job-line {
  display: block !important;
}


  .job-title {
    font-size: 1.25rem;
  }

  .job-company {
    font-size: .85rem;
  }

  .job-pay {
    font-size: 1.25rem;
  }

  .pill {
    font-size: 0.85rem;
  }

  .job-age {
    font-size: 0.8rem;
  }


.view-btn {
  pointer-events: none; /* Card handles click */
}

/* BUTTON STYLE (global) */
.btn {
  display: inline-block;
  background: var(--button-bg);
  color: var(--button-text);
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid var(--button-bg);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.btn:hover {
  background: var(--button-text);
  color: var(--button-bg);
}

/* =========================
   PAGINATION
   ========================= */
.pagination button {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 0.6rem 1.2rem;
  margin: 0 0.35rem;
  border-radius: 8px;
  cursor: pointer;
}

.pagination button:hover {
  opacity: 0.85;
}

.pagination {
  text-align: center;
  font-size: 0.85rem;      /* match button text */
  margin: 12px 0 20px;
}


/* =========================
   ABOUT BAND
   ========================= */
.about-band {
  max-width: 900px;          /* keep your centered width */
  margin: 30px auto 10px;   /* reduce bottom gap */  
  padding: 30px 20px;        /* keep internal breathing room */
  text-align: center;        /* keep centered text */
  border-top: 1px solid var(--card-border);   /* subtle divider */
}


.about-band h2 {
  font-size: 1.4rem;       /* slightly bigger */
  margin-bottom: 8px;
}

.jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 0rem;
  padding-bottom: 1rem;
  margin-top: 0px;
}

@media (max-width: 750px) {
  .jobs-grid {
    grid-template-columns: 1fr;  /* mobile collapses to single column */
  }
}

.nav-cta {
  background: var(--button-bg);
  color: var(--button-text);
  margin-top: 6px;

  /* balanced internal padding */
  padding: 4px 10px;   /* 4px top/bottom, 10px left/right */

  border-radius: 4px;
  border: 2px solid var(--button-bg);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}


.nav-cta:hover {
  background: var(--button-text);
  color: var(--button-bg);
  border-color: var(--button-bg);   /* <-- FIX */
}

/* Force homepage blocks to obey the wrapper width */
.homepage-inner > * {
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
/* Center homepage jobs & filters inside the wrapper */
.homepage-inner .filters,
.homepage-inner .jobs-grid,
.homepage-inner .pagination,
.homepage-inner .about-band,
.homepage-inner .explainer {
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}
.page-no-hero * {
  animation: none !important;
}

/* -----------------------------------
   FILTER TOGGLE BUTTON
----------------------------------- */
.filter-toggle-btn {
  background: var(--button-bg);
  color: var(--button-text);
  border: 2px solid var(--button-bg);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 10px;
}

.filter-toggle-btn:hover {
  background: var(--button-text);
  color: var(--button-bg);
}

/* -----------------------------------
   POP-OUT FILTER PANEL
----------------------------------- */
.filter-panel {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.filter-panel.show {
  display: block;
}

/* -----------------------------------
   FILTER GROUP
----------------------------------- */
.filter-group {
  margin-bottom: 14px;
}

.filter-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-main);
}

.filter-group input:focus,
.filter-group select:focus {
  outline: 2px solid var(--button-bg);
}

/* -----------------------------------
   FILTERS ROW
----------------------------------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.search-wrapper {
  flex: 1;
}

.mobile-filter-btn {
  flex-shrink: 0;
}

.filters input,
.filters select {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 16px;
}

#search { flex: 1; }

/* -----------------------------------
   SEARCH BAR (FINAL)
----------------------------------- */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: none;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-color: var(--text-secondary);
  mask-image: url('/assets/icons/search.svg');
  mask-repeat: no-repeat;
  mask-size: contain;
  pointer-events: none;
}

.mobile-filter-btn {
  height: 44px;
  width: 44px;
}

.filter-icon {
  width: 20px;
  height: 20px;
  background-color: var(--text-main);

  mask-image: url('/assets/icons/sliders.svg');
  mask-repeat: no-repeat;
  mask-size: contain;
}

.search-wrapper .search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem !important;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 1rem;
}


.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}


.search-input:focus {
  outline: none;
  border-color: var(--text-main);
}

/* -----------------------------------
   SUGGESTIONS DROPDOWN
----------------------------------- */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--card-shadow);

  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
  padding: 6px 0;
}

.suggestions.hidden {
  display: none;
}

.suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--border);
}

.suggestion-item.highlighted {
  background: var(--border);
}

.results-count {
  margin: 4px 0 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  margin: 40px 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.clear-search-btn {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border);
  cursor: pointer;
}

.clear-search-btn:hover {
  background: var(--border);
}

.active-filters {
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.filter-pill button {
  margin-left: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.suggestion-group-title {
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}

.recent-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.recent-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px; /* adjust */
}

.remove-recent {
  flex-shrink: 0; /* ← THE FIX */
  margin-left: 10px;
  cursor: pointer;
  color: var(--text-secondary);
}

.remove-recent:hover {
  color: var(--text-main);
}


.recent-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background-color: var(--text-secondary);
  mask-image: url('/assets/icons/recent.svg');
  mask-repeat: no-repeat;
  mask-size: contain; /* ↑ render at higher resolution */
}

.show-more-recents {
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.recent-extra-group.hidden {
  display: none;
}

.remove-recent {
  margin-left: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.remove-recent:hover {
  color: var(--text-main);
}

.clear-all-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 6px;
}

.clear-all-btn:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.tally-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.tally-iframe {
  width: 100%;
  border: none;
  display: block;
  overflow: hidden;
  background: transparent;
}



/* DARK MODE FIX */
[data-theme="dark"] .tally-wrapper {
  background: var(--bg);
}


.banner-close-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 2px;
  gap: 10px;
  flex-wrap: nowrap;
}

.results-count {
  font-weight: 600;
  white-space: nowrap;
}

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.active-filters .filter-pill,
.active-filters .clear-all-btn {
  white-space: nowrap;
}


/* =========================
   TIGHTEN FILTER + RESULTS SPACING
   ========================= */

/* Reduce vertical breathing room around entire filters row */
.filters {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  gap: 10px;
}

/* Reduce search-wrapper height impact slightly */
.search-wrapper .search-input {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}

/* Tighten spacing above/below results text */
.results-count {
  margin-top: 4px !important;
  margin-bottom: 4px !important;
}

/* Make pills row sit closer */
.results-row {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

/* Reduce spacing under pills themselves */
.active-filters {
  margin-bottom: 4px !important;
}

/* Slight tightening under the whole filter+results block */
.homepage-inner > #filters {
  margin-bottom: 8px !important;
}


/*search bar width fix for mobile */
@media (max-width: 640px) {

  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-wrapper {
    width: 100%;
    max-width: none;
  }

  #jobType {
    width: 100%;
  }

}

/* =========================
   FILTER TOGGLE (ALL SCREENS)
========================= */

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

.mobile-filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
}

.mobile-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* desktop */
  gap: 8px;

  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;

  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

@media (max-width: 640px) {

  .mobile-filters {
    grid-template-columns: repeat(2, 1fr);
  }

}

.mobile-filters.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 10px;
}

.mobile-filters select {
  transform: translateY(-4px);
  transition: transform .25s ease;
}

.mobile-filters select {
  width: 100%;
}

.mobile-filters.open select {
  transform: translateY(0);
}


.tally-wrapper {
  width: 100%;
}

.tally-iframe {
  width: 100%;
  border: none;
  display: block;
}

.tally-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 40px;
}


/* =========================
   MOBILE JOB CARD TEXT BOOST
   ========================= */
@media (max-width: 640px) {

  .job-title {
    font-size: 1.75rem;
  }

  .job-company {
    font-size: 1.0rem;
  }

  .job-pay {
    font-size: 1.75rem;
  }

  .pill {
    font-size: 0.9rem;
  }

  .job-age {
    font-size: 0.7rem;
  }

}


@media (max-width: 640px) {

  .job-age {
    position: static;
    margin-top: 8px;
    text-align: right;
    order: 4;   /* ← THIS is the fix */
  }

}

/* Save button on job cards */
.job-save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;

  background: none;
  border: none;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  /* dark/light mode */
  color: var(--text-main);
}

.job-save-btn:hover {
  opacity: 0.75;
}

/* If the pay text is getting crowded, give the top row a little room */
.job-card-top {
  padding-right: 34px;
}

/* SVG icon: outline by default */
.job-save-icon {
  stroke: currentColor;
  fill: none;
}

/* Saved: filled */
.job-save-btn.saved .job-save-icon {
  fill: currentColor;
}

/* Mobile: bigger icon + bigger tap target */
@media (max-width: 640px) {
  .job-save-btn {
    padding: 10px;
  }

  .job-save-btn .job-save-icon {
    width: 22px;
    height: 22px;
  }

  .job-card-top {
    padding-right: 46px;
  }
}
/* Job-card save icon: follow theme (dark/light) via currentColor */
.job-save-btn {
  color: var(--text-main);
}

.job-save-icon {
  stroke: currentColor;
  fill: none;
}

.job-save-btn.saved .job-save-icon {
  fill: currentColor; /* makes it “filled” when saved */
}

/* Mobile: size up the job-card icon only */
@media (max-width: 640px) {
  .job-save-btn .job-save-icon {
    width: 22px;
    height: 22px;
  }
}


/* Job-card toast (anchored above the save icon) */
.toast {
  position: absolute;
  top: 10px;
  right: 10px;

  /* sit above the icon */
  transform: translateY(-120%);

  z-index: 7;

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);

  padding: 6px 10px;
  border-radius: 6px;

  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(-145%);
}

/* FORCE applied filter pills row (new two-row layout) to align left */
.results-meta-pills-row {
  justify-content: flex-start !important;
}

/* Sort control: tighter spacing + match "X results" styling */
.results-meta-controls-right {
  color: var(--text-secondary) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

.sort-minimal {
  gap: 6px !important;   /* was 10px */
}

.sort-minimal select {
  padding-right: 6px !important;  /* was 18px */
}

.sort-minimal-icon {
  opacity: 0.9 !important; /* was 0.75 */
}

.sort-minimal::after {
  opacity: 0.65 !important;
  font-size: 11px !important;
}

.results-meta-controls-row {
  margin-bottom: -6px !important;
}

/* Remove bold styling from results meta controls row */
.results-meta-controls-row {
  font-weight: 400 !important;
}

/* FINAL OVERRIDES: unbold + tighten spacing without fighting earlier rules */
.results-meta-controls-right {
  font-weight: 400 !important; /* overrides the earlier 600 */
}

/* results-count is bolded elsewhere in your CSS */
.results-count {
  font-weight: 400 !important;
}

/* If pills row is empty, don't reserve vertical space */
.results-meta-pills-row:empty {
  display: none !important;
}

/* Avoid negative margin wars: prefer a small normal margin */
.results-meta-controls-row {
  margin-top: 0 !important;
  margin-bottom: 0px !important; /* change to 2px if you want tighter */
}


/* Tighten space between sort text and caret */
.sort-minimal select {
  padding-right: -4px !important;  /* was 6px */
}

.sort-minimal::after {
  right: -4px !important;         /* pulls caret closer */
}


/* Sort caret: place it right after the selected text (no big empty gap) */
.sort-minimal select {
  padding-right: 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

/* Override the injected absolute caret and make it inline */
.sort-minimal::after {
  position: static !important;
  transform: none !important;
  margin-left: -2px !important;  /* adjust to taste: 4px–8px */
  display: inline-block !important;
}

/* Make the sort label hug the caret even when the select is wide */
.sort-minimal select {
  text-align: right !important;
  text-align-last: right !important;  /* Chrome/Firefox */
  direction: rtl;                     /* fallback that works widely */
  padding-right: 12px !important;     /* small breathing room before caret */
}

/* Keep option text normal reading direction in the dropdown list */
.sort-minimal select option {
  direction: ltr;
}


/* Sort UI: make icon + label + caret hug tightly, regardless of select width */
.sort-minimal::after {
  content: none !important; /* kill the old injected caret */
}

/* Compact inline cluster */
.sort-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;                 /* icon ↔ text spacing */
  color: var(--text-secondary);
}

/* Label + caret tight */
.sort-selected {
  white-space: nowrap;
}

.sort-caret {
  opacity: 0.65;
  font-size: 11px;
  line-height: 1;
}

/* Invisible native select over the whole cluster (still clickable + keyboard) */
.sort-select-wrap select {
  position: absolute;
  inset: -6px -8px;         /* larger click target */
  opacity: 0;
  cursor: pointer;
}

/* IMPORTANT: remove the RTL hack you added earlier (no longer needed) */
.sort-minimal select {
  direction: ltr !important;
  text-align: left !important;
  text-align-last: left !important;
}


/* Tighten spacing: search bar -> filter dropdowns -> results bar */
.filters {
  gap: 6px !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.mobile-filters.open {
  margin-top: 4px !important;
}

.results-count {
  margin: 0 !important;
}

.results-meta-controls-row {
  margin-top: 2px !important;
}


.results-meta-controls-row {
  margin: 0 0 6px !important;
}

.results-meta-pills-row {
  margin: 0 !important;
}


.simple-banner {
  margin: 4px auto 6px !important;
}

/* Make the sort control match the other dropdown selects (theme-aware) */
.sort-select-wrap {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;      /* matches your other selects */
  padding: 10px 12px !important;      /* matches .filters select */
  height: 44px !important;            /* matches search/filter controls */
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Text/icon colors should match your other dropdown text */
.sort-minimal-icon,
.sort-selected {
  color: var(--text-main) !important;
  opacity: 1 !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.sort-caret {
  color: var(--text-secondary) !important;
  opacity: 0.8 !important;
}

/* IMPORTANT: style the REAL select so the opened menu respects theme */
#sortTopRight {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  font-size: 16px !important;
}


/* ===== Sort dropdown: match results text exactly ===== */

.sort-select-wrap {
  outline: none !important;
  box-shadow: none !important;
}

/* remove focus outline */
.sort-select-wrap:focus,
.sort-select-wrap:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* match "X results" text */
.sort-selected,
.sort-minimal-icon,
.sort-caret {
  font-size: 0.9rem !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

/* real select should not show native focus ring */
#sortTopRight {
  outline: none !important;
  box-shadow: none !important;
}

/* ===== Kill native focus outline completely ===== */

#sortTopRight,
#sortTopRight:focus,
#sortTopRight:focus-visible,
.sort-select-wrap,
.sort-select-wrap:focus,
.sort-select-wrap:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove browser appearance styles */
#sortTopRight {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

/* ===== Make sort control compact ===== */

.sort-select-wrap {
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

#sortTopRight {
  height: auto !important;
  padding: 0 !important;
  font-size: 0.9rem !important;
  line-height: 1.2 !important;
  border: none !important;
  background: transparent !important;
}
