/* ============================================================
   LM Casting Calls — Discovery directory (Phase 5).

   Class names + values ported from
   /Applications/MAMP/htdocs/localmodels/designs/casting-calls/
     04-discovery-v2.html

   Scope under .lm-cd-dir-page so styles don't leak. Uses --cd-* tokens
   so dark-mode reuses the same palette logic as the detail page (see
   lm-casting.css).
   ============================================================ */

.lm-cd-dir-page {
  /* Token block: same fallback chain as lm-casting.css so the two
     surfaces stay visually identical. */
  --cd-primary:        var(--lm-primary,        #0f6f4f);
  --cd-primary-strong: var(--lm-primary-strong, #0a5439);
  --cd-primary-soft:   var(--lm-primary-soft,   #f3f8f5);
  --cd-primary-soft-2: var(--lm-primary-soft-2, #dcebe2);
  --cd-primary-text:   var(--lm-primary-text,   #0a5439);
  --cd-brand:          var(--lm-brand,          #00363f);
  --cd-brand-strong:   var(--lm-brand-strong,   #002429);
  --cd-brand-soft:     var(--lm-brand-soft,     #e8eef0);
  --cd-bg:             var(--lm-bg,             #fff);
  --cd-surface:        var(--lm-surface,        #f8fafc);
  --cd-surface-2:      var(--lm-surface-2,      #f1f5f9);
  --cd-text:           var(--lm-text,           #0f172a);
  --cd-text-secondary: var(--lm-text-secondary, #475569);
  --cd-muted:          var(--lm-muted,          #64748b);
  --cd-muted-2:        var(--lm-muted-2,        #94a3b8);
  --cd-border:         var(--lm-border,         #e2e8f0);
  --cd-border-2:       var(--lm-border-2,       #eef2f6);
  --cd-gold:           var(--lm-gold,           #C6A15B);
  --cd-gold-deep:      var(--lm-gold-deep,      #7a5e2e);
  --cd-gold-soft:      var(--lm-gold-soft,      #fef7d6);
  --cd-gold-soft-2:    var(--lm-gold-soft-2,    #f5deb3);
  --cd-danger:         var(--lm-danger,         #c0392b);
  --cd-warning:        var(--lm-warning,        #f59e0b);
  --cd-r-card:         12px;
  --cd-r-btn:          8px;
  --cd-shadow-sm:      0 1px 2px rgba(15,23,42,0.04), 0 1px 0 rgba(15,23,42,0.02);
  --cd-shadow-md:      0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --cd-mono:           "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Page bg matches global LM white so it flows into the footer
     seamlessly (was #eef2f6 light grey). */
  background: var(--cd-bg, #fff);
  color: var(--cd-text);
  min-height: 60vh;
}
.lm-cd-dir-page * { box-sizing: border-box; }

.lm-cd-dir-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 32px;
}

/* ── Page header ──────────────────────────────────────────── */
.lm-cd-dir-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}
.lm-cd-dir-head-left { flex: 1; min-width: 0; }
/* Subtitle + Notify CTA share one row, Notify pushed right. */
.lm-cd-dir-sub-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.lm-cd-dir-sub-row .lm-cd-dir-sub { margin: 0; flex: 1 1 auto; min-width: 0; }
.lm-cd-dir-sub-row .lm-cd-dir-notify-btn { flex: 0 0 auto; }
.lm-cd-dir-kicker {
  font-family: var(--cd-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--cd-muted);
  margin-bottom: 6px;
}
.lm-cd-dir-h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cd-text);
  flex-wrap: wrap;
}
.lm-cd-dir-count-pill {
  font-family: var(--cd-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  /* Neutral pill (not green) — surface + muted text. */
  background: var(--cd-surface-2);
  color: var(--cd-text-secondary);
  border: 1px solid var(--cd-border);
  letter-spacing: 0;
}
.lm-cd-dir-count-pill strong { font-weight: 700; }
/* Yellow/gold "X closing this week" pill — sits in the h1 next to the
   green count pill, doubles as the closing_within=7 filter toggle. Soft
   gold by default, fills with a deeper gold when the filter is active. */
button.lm-cd-dir-count-pill--soon {
  font: inherit;
  font-family: var(--cd-mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--cd-gold-soft);
  color: var(--cd-gold-deep);
  border: 1px solid var(--cd-gold-soft-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
button.lm-cd-dir-count-pill--soon:hover {
  background: var(--cd-gold-soft-2);
  border-color: var(--cd-gold);
}
button.lm-cd-dir-count-pill--soon.is-active {
  background: var(--cd-gold);
  color: #fff;
  border-color: var(--cd-gold);
}
button.lm-cd-dir-count-pill--soon.is-active:hover {
  background: var(--cd-gold);
  filter: brightness(0.95);
}
.lm-cd-dir-sub {
  margin: 6px 0 0;
  color: var(--cd-text-secondary);
  font-size: 14px;
  line-height: 1.55;
}
.lm-cd-dir-sub-row .lm-cd-dir-sub { margin: 0; }
/* NOTE: the old .lm-cd-dir-urgent inline-text "X closing this week"
   button (counter-line) was replaced by the gold .lm-cd-dir-count-pill--soon
   pill in the h1 — see the count-pill block above. */
.lm-cd-dir-notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-r-btn);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  color: var(--cd-text);
  font-family: inherit;
}
.lm-cd-dir-notify-btn svg { width: 14px; height: 14px; }
.lm-cd-dir-notify-btn:hover { background: var(--cd-surface); }

/* Bell icon button inside h1, sits to the right of the count pill. */
.lm-cd-dir-notify-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  color: var(--cd-text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  vertical-align: middle;
  margin-left: auto; /* push to the right edge of the H1 row */
}
.lm-cd-dir-notify-lbl { white-space: nowrap; }
.lm-cd-dir-notify-bell svg { width: 16px; height: 16px; }
.lm-cd-dir-notify-bell:hover {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
  transform: scale(1.05);
}
.lm-cd-dir-notify-bell.is-on,
.lm-cd-dir-notify-bell.is-active {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
  color: #fff;
}
.lm-cd-dir-notify-bell.is-active:hover {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
  color: #fff;
  filter: brightness(0.96);
}

/* Lightweight confirmation toast — fired by the notify bell. Fixed
   bottom-centre, auto-dismisses after ~3s (fade handled by the
   .is-leaving class added in JS). Self-contained: no dependency on the
   detail-page lmNotify() modal. */
.lm-cd-dir-notify-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  z-index: 9999;
  max-width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.28);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.lm-cd-dir-notify-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lm-cd-dir-notify-toast.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}
.lm-cd-dir-notify-toast svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--cd-primary);
}

/* ── Filter bar ───────────────────────────────────────────── */
.lm-cd-dir-filter-bar {
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--cd-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lm-cd-dir-filter-row-1 {
  display: flex;
  /* No wrap — all controls stay on a single row even on narrow screens
     (MacBook 14" sub-1600px). Chips shrink instead of wrapping below. */
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
}
/* Type-seg = natural width (segmented toggle), no flex-grow. */
.lm-cd-dir-filter-row-1 .lm-cd-dir-type-seg { flex: 0 0 auto; }
/* Chip dropdowns shrink to fit available room; min-width: 0 lets them
   compress past their content size, and summary's overflow-hidden +
   ellipsis prevents wrapping. */
.lm-cd-dir-filter-row-1 .lm-cd-dir-filter-chip { flex: 1 1 0; min-width: 0; }
.lm-cd-dir-filter-row-1 .lm-cd-dir-filter-chip > summary {
  width: 100%;
  justify-content: space-between;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Hiring-now toggle: natural width, pinned to the end. */
.lm-cd-dir-filter-row-1 .lm-cd-dir-toggle { flex: 0 0 auto; margin-left: auto; }

/* Below a phone width fall back to wrapping — chips would shrink past
   readability if forced to stay one-row on a tiny screen. */
@media (max-width: 560px) {
  .lm-cd-dir-filter-row-1 { flex-wrap: wrap; }
  .lm-cd-dir-filter-row-1 .lm-cd-dir-filter-chip { min-width: 120px; }
}

/* Mobile "Filters" button — hidden on desktop, shown ≤767px. */
.lm-cd-dir-mobile-filters-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cd-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.lm-cd-dir-mobile-filters-btn svg { width: 14px; height: 14px; }
.lm-cd-dir-mobile-filters-btn:hover { background: var(--cd-surface-2); border-color: var(--cd-muted-2); }
.lm-cd-dir-mobile-filters-btn.is-open {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
}
.lm-cd-dir-mobile-filters-btn .lm-cd-dir-active-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--cd-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  margin-left: 2px;
}

/* Desktop default: chip-group wrapper is transparent so its children
   participate in the parent .lm-cd-dir-filter-row-1 flex layout. */
.lm-cd-dir-filter-chips { display: contents; }
.lm-cd-dir-filter-row-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid var(--cd-border-2);
}

/* Type segmented toggle (All / Offline / Digital) */
.lm-cd-dir-type-seg {
  display: inline-flex;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  padding: 2px;
}
.lm-cd-dir-type-opt {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cd-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}
.lm-cd-dir-type-opt.is-active {
  background: var(--cd-bg);
  color: var(--cd-text);
  font-weight: 600;
  box-shadow: var(--cd-shadow-sm);
}
/* Dark mode — the default active state above uses --cd-bg (#0d1117)
   which is DARKER than the segmented container's --cd-surface
   (#161b22), so the picked option appears as a "depressed inset"
   instead of a visible highlight. Paint it with the same bright
   green band the selected filter rows use so the picked type
   (All / Offline / Digital) is obviously the active one. */
html[data-lm-theme="dark"] .lm-cd-dir-type-opt.is-active {
  background: rgba(46, 161, 111, .32);
  color: #7adfb3;
  box-shadow: none;
}
.lm-cd-dir-em { font-size: 12px; line-height: 1; }

/* Filter chip dropdowns (native <details>) */
.lm-cd-dir-filter-chip {
  position: relative;
}
.lm-cd-dir-filter-chip > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--cd-text);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
}
.lm-cd-dir-filter-chip > summary::-webkit-details-marker { display: none; }
.lm-cd-dir-filter-chip > summary:hover { background: var(--cd-surface); border-color: var(--cd-muted-2); }
.lm-cd-dir-filter-chip[open] > summary {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
}
.lm-cd-dir-chev { width: 11px; height: 11px; color: var(--cd-muted-2); }
/* Leading icon inside each filter chip's summary. Muted by default,
   picks up the green chip-text colour when the chip is open. */
.lm-cd-dir-chip-ic {
  width: 14px;
  height: 14px;
  color: var(--cd-muted);
  flex: none;
}
.lm-cd-dir-filter-chip[open] > summary .lm-cd-dir-chip-ic { color: var(--cd-primary-text); }

/* Hiring-now pill toggle — mirrors brand directory .lm-bd-toggle.
   Pill chip on the right of the filter row with a tiny sliding
   switch inside; goes green when active. */
.lm-cd-dir-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--cd-border);
  background: var(--cd-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--cd-text);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.lm-cd-dir-pill-toggle input { display: none; }
.lm-cd-dir-pill-switch {
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--cd-surface-2);
  border: 1px solid var(--cd-border);
  position: relative;
  flex: none;
  transition: background 120ms, border-color 120ms;
}
.lm-cd-dir-pill-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cd-bg);
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: left 150ms;
}
.lm-cd-dir-pill-toggle.is-on .lm-cd-dir-pill-switch {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
}
.lm-cd-dir-pill-toggle.is-on .lm-cd-dir-pill-switch::after { left: 15px; }
.lm-cd-dir-pill-toggle.is-on {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
}
/* Toggle state synced via JS — fallback :has() for browsers that support it. */
.lm-cd-dir-pill-toggle:has(input:checked) {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
}
.lm-cd-dir-pill-toggle:has(input:checked) .lm-cd-dir-pill-switch {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
}
.lm-cd-dir-pill-toggle:has(input:checked) .lm-cd-dir-pill-switch::after { left: 15px; }

/* Pop-over panel */
.lm-cd-dir-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  box-shadow: var(--cd-shadow-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
.lm-cd-dir-radio-row,
.lm-cd-dir-check-row,
.lm-cd-dir-text-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--cd-text);
}
.lm-cd-dir-radio-row:hover,
.lm-cd-dir-check-row:hover { background: var(--cd-surface); }
/* Selected (checked) rows — green tint + green text so the user can
   tell at a glance what's active in each filter dropdown. Mirrors
   the People-page .dc-pop-item.is-selected look. */
.lm-cd-dir-radio-row:has(input:checked),
.lm-cd-dir-check-row:has(input:checked) {
  background: var(--cd-primary-soft);
  color: var(--cd-primary-text);
  font-weight: 600;
}
/* Dark-mode bump — the default --cd-primary-soft (rgba(46,161,111,.18))
   is barely visible against the dark page bg. Use a stronger green
   tint so the active selection actually reads. */
html[data-lm-theme="dark"] .lm-cd-dir-radio-row:has(input:checked),
html[data-lm-theme="dark"] .lm-cd-dir-check-row:has(input:checked) {
  background: rgba(46, 161, 111, .32);
  color: #7adfb3;
}
.lm-cd-dir-radio-row:has(input:checked) .lm-cd-dir-row-count,
.lm-cd-dir-check-row:has(input:checked) .lm-cd-dir-row-count {
  color: var(--cd-primary-text);
}
/* Hide native radios inside sort dropdown — the row background +
   text colour already signals the active choice. Native circles
   look out of place next to the green-pill row. (Categories +
   industries keep their native inputs since they convey "multi vs
   single" affordance more obviously.) */
.lm-cd-dir-sort-chip .lm-cd-dir-radio-row input[type="radio"] { display: none; }
.lm-cd-dir-sort-chip .lm-cd-dir-radio-row { padding-left: 12px; }
.lm-cd-dir-row-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--cd-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lm-cd-dir-row-lbl-text { flex: 1; min-width: 0; }
/* Custom check-mark visual — mirrors the brand directory pattern.
   Native input is hidden; this <span> is the visible toggle. Fills
   with the primary accent when its sibling input is :checked. */
.lm-cd-dir-radio-row,
.lm-cd-dir-check-row {
  position: relative;
}
.lm-cd-dir-radio-row input[type="radio"],
.lm-cd-dir-check-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lm-cd-dir-check-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--cd-border);
  display: grid;
  place-items: center;
  flex: none;
  background: var(--cd-bg);
  color: transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.lm-cd-dir-radio-row input:checked ~ .lm-cd-dir-check-mark,
.lm-cd-dir-check-row input:checked ~ .lm-cd-dir-check-mark {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
  color: #fff;
}
/* Sort dropdown — show the check-mark slot too, but make it a
   CIRCLE to read as a radio indicator (mirrors the People-page
   .dc-pop-check). Same fill behaviour as the square check-mark
   on Categories/Industries — empty until the input is checked,
   then filled with the primary green + visible tick. */
.lm-cd-dir-sort-chip .lm-cd-dir-check-mark {
  border-radius: 50%;
  width: 16px;
  height: 16px;
}
.lm-cd-dir-text-row { flex-direction: column; align-items: stretch; gap: 4px; cursor: default; }
.lm-cd-dir-text-row .lm-cd-dir-row-lbl {
  font-family: var(--cd-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cd-muted);
}
.lm-cd-dir-text-row input[type="text"],
.lm-cd-dir-text-row input[type="number"],
.lm-cd-dir-range-row input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--cd-border);
  border-radius: 7px;
  background: var(--cd-bg);
  color: var(--cd-text);
  font-family: inherit;
  font-size: 13px;
}
.lm-cd-dir-range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lm-cd-dir-range-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--cd-text-secondary); }
.lm-cd-dir-popover-empty { padding: 16px; font-size: 12.5px; color: var(--cd-muted); text-align: center; }

/* Months grid in popover */
.lm-cd-dir-month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lm-cd-dir-month-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 0;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-2);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--cd-text-secondary);
  user-select: none;
}
.lm-cd-dir-month-chip:has(input:checked) {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
  font-weight: 600;
}
.lm-cd-dir-month-chip input { display: none; }

/* Toggle (Hiring now) */
.lm-cd-dir-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cd-text);
  cursor: pointer;
  font-weight: 500;
  padding: 6px 10px;
}
.lm-cd-dir-toggle input { display: none; }
.lm-cd-dir-toggle-track {
  width: 30px; height: 18px;
  border-radius: 999px;
  background: var(--cd-border);
  position: relative;
  transition: background 150ms;
}
.lm-cd-dir-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: left 150ms;
}
.lm-cd-dir-toggle input:checked + .lm-cd-dir-toggle-track { background: var(--cd-primary); }
.lm-cd-dir-toggle input:checked + .lm-cd-dir-toggle-track .lm-cd-dir-toggle-knob { left: 14px; }

/* Active filter pills (row 2) */
.lm-cd-dir-active-pills { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.lm-cd-dir-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--cd-primary-soft);
  border: 1px solid var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.lm-cd-dir-active-pill button {
  background: none;
  border: 0;
  color: var(--cd-muted);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  margin-left: 2px;
}
.lm-cd-dir-clear-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--cd-text-secondary);
  font-weight: 600;
  text-decoration: none;
  border-radius: 7px;
}
.lm-cd-dir-clear-link svg { width: 11px; height: 11px; }
.lm-cd-dir-clear-link:hover { background: var(--cd-surface); }
/* Legacy native-select sort dropdown — kept for the few surfaces
   that still use it (currently none on /castings; replaced by the
   .lm-cd-dir-sort-chip <details> below). */
.lm-cd-dir-sort-control {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cd-text-secondary);
}

/* Sort dropdown — same chip pattern as the filter chips above, but
   the summary shows "Sort: <Current value>" instead of just a label
   and gets pushed to the right of the tools row. */
.lm-cd-dir-sort-chip { margin-left: auto; }
.lm-cd-dir-sort-chip > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lm-cd-dir-sort-lbl { color: var(--cd-muted); font-weight: 500; }
.lm-cd-dir-sort-val { color: var(--cd-text); font-weight: 600; }
.lm-cd-dir-sort-chip .lm-cd-dir-popover { min-width: 180px; right: 0; left: auto; }

/* Mobile sort icon — hidden on desktop. */
.lm-cd-dir-sort-mobile { display: none; position: relative; }
.lm-cd-dir-sort-mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  padding: 0;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 999px;
  color: var(--cd-text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.lm-cd-dir-sort-mobile-btn svg { width: 16px; height: 16px; }
.lm-cd-dir-sort-mobile-btn:hover,
.lm-cd-dir-sort-mobile-btn[aria-expanded="true"] {
  background: var(--cd-primary-soft);
  border-color: var(--cd-primary-soft-2);
  color: var(--cd-primary-text);
}
.lm-cd-dir-sort-mobile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lm-cd-dir-sort-mobile-menu[hidden] { display: none; }
.lm-cd-dir-sort-mobile-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cd-text);
  cursor: pointer;
}
.lm-cd-dir-sort-mobile-item:hover { background: var(--cd-surface); }
.lm-cd-dir-sort-mobile-item.is-selected {
  background: var(--cd-primary-soft);
  color: var(--cd-primary-text);
  font-weight: 600;
}

/* ── Counter + view toggle row ────────────────────────────── */
.lm-cd-dir-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  /* Keep counts (left) + tools (right) on ONE line on desktop. The mobile
     media query below re-enables wrap for narrow viewports. */
  flex-wrap: nowrap;
  gap: 10px;
}
.lm-cd-dir-view-toggle {
  display: inline-flex;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  padding: 2px;
}
.lm-cd-dir-view-opt {
  border: none;
  background: transparent;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--cd-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
}
.lm-cd-dir-view-opt svg { width: 13px; height: 13px; }
.lm-cd-dir-view-opt.is-active {
  /* Match the brand directory's view toggle: solid teal (--cd-brand ==
     brand --bd-client) + white, not the soft-green tint. */
  background: var(--cd-brand);
  color: #fff;
  font-weight: 600;
}
/* Controls row: counts on the LEFT, Sort + Grid/List grouped on the RIGHT. */
.lm-cd-dir-counts { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.lm-cd-dir-tools { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; white-space: nowrap; }

/* ── Discovery body ───────────────────────────────────────── */
.lm-cd-dir-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  /* Note: align-items intentionally LEFT as the grid default (stretch) so
     the rail track has the full row height — that's what gives
     .lm-cd-dir-rail-sticky something to stick against on scroll. */
  margin-top: 8px;
}
.lm-cd-dir-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
.lm-cd-dir-cards-grid[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ── Card ─────────────────────────────────────────────────── */
.lm-cd-dir-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-r-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--cd-shadow-sm);
  transition: border-color 150ms, box-shadow 150ms;
}
.lm-cd-dir-card:hover {
  border-color: var(--cd-primary-soft-2);
  box-shadow: var(--cd-shadow-md);
}
.lm-cd-dir-card.is-featured {
  border-color: var(--cd-gold-soft-2);
}

/* Cover area */
.lm-cd-dir-card-cover {
  position: relative;
  /* Grid card banner = 2.5:1 (width-driven). The list + rail variants
     below set their own ratios/heights. */
  aspect-ratio: 2.5 / 1;
  width: 100%;
  overflow: hidden;
}
/* Category gradients apply ONLY when the cover doesn't have an uploaded
   image. .has-image is added when card.cover_image is set; the inline
   background-image then takes over. */
.lm-cd-dir-card-cover.has-image::after { display: none; }
.lm-cd-dir-card-cover:not(.has-image).cat-event {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(80% 80% at 10% 110%, rgba(198,161,91,.18) 0%, transparent 50%),
    linear-gradient(135deg, #0a2a30 0%, #00363f 50%, #06181d 100%);
}
.lm-cd-dir-card-cover:not(.has-image).cat-digital {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(80% 80% at 10% 110%, rgba(236,72,153,.2) 0%, transparent 50%),
    linear-gradient(135deg, #3b1361 0%, #5b21b6 50%, #1d0942 100%);
}
.lm-cd-dir-card-cover:not(.has-image).cat-consulting {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(80% 80% at 10% 110%, rgba(56,189,248,.2) 0%, transparent 50%),
    linear-gradient(135deg, #082f49 0%, #075985 50%, #021a2e 100%);
}
.lm-cd-dir-card-cover:not(.has-image).cat-other {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.06) 0%, transparent 50%),
    linear-gradient(135deg, #3f3f46 0%, #52525b 50%, #18181b 100%);
}
.lm-cd-dir-card-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.lm-cd-dir-cover-content {
  position: absolute; inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;       /* category chip pinned bottom-left */
  padding: 12px;
  z-index: 1;
}
/* Category chip overlaid on the cover. Same colour family as the
   in-body version but with a translucent-light background so it reads
   against any cover gradient. */
.lm-cd-dir-cover-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: var(--lm-font-mono, ui-monospace, monospace);
}
/* Tinted to match the Discover Talents service labels (.lm-svf-section-title):
   green Event / amber Digital / neutral other — not a plain white pill. */
.lm-cd-dir-cover-cat-chip.cat-event      { background: var(--lm-primary-soft, #f3f8f5); color: var(--lm-primary-text, #0f6f4f); border-color: var(--lm-primary-soft-2, #c8e6d4); }
.lm-cd-dir-cover-cat-chip.cat-digital    { background: #fff8eb; color: #92400e; border-color: #fde9c4; }
.lm-cd-dir-cover-cat-chip.cat-consulting { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.lm-cd-dir-cover-cat-chip.cat-other      { background: var(--lm-surface-2, #f1f5f9); color: var(--lm-text, #0f172a); border-color: var(--lm-border, #e2e8f0); }
html[data-lm-theme="dark"] .lm-cd-dir-cover-cat-chip.cat-event      { background: rgba(46,161,111,.18); color: #5fcc94; border-color: rgba(46,161,111,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cover-cat-chip.cat-digital    { background: rgba(245,158,11,.18); color: #fbbf24; border-color: rgba(245,158,11,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cover-cat-chip.cat-consulting { background: rgba(56,189,248,.18); color: #7dd3fc; border-color: rgba(56,189,248,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cover-cat-chip.cat-other      { background: rgba(148,163,184,.16); color: #c9d1d9; border-color: rgba(148,163,184,.38); }
.lm-cd-dir-cover-cat-chip .lm-cd-dir-em  { font-size: 12px; }

/* Category pill relocated onto the "looking-for" row (right side), no icon.
   Reuses the cover-chip colour scheme but as a compact inline pill. */
.lm-cd-dir-looking-split { justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
.lm-cd-dir-looking-role  { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.lm-cd-dir-looking-role strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-cd-dir-cat-pill {
  flex: none;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: var(--lm-font-mono, ui-monospace, monospace);
}
.lm-cd-dir-cat-pill.cat-event      { background: var(--lm-primary-soft, #f3f8f5); color: var(--lm-primary-text, #0f6f4f); border-color: var(--lm-primary-soft-2, #c8e6d4); }
.lm-cd-dir-cat-pill.cat-digital    { background: #fff8eb; color: #92400e; border-color: #fde9c4; }
.lm-cd-dir-cat-pill.cat-consulting { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.lm-cd-dir-cat-pill.cat-other      { background: var(--lm-surface-2, #f1f5f9); color: var(--lm-text, #0f172a); border-color: var(--lm-border, #e2e8f0); }
html[data-lm-theme="dark"] .lm-cd-dir-cat-pill.cat-event      { background: rgba(46,161,111,.18); color: #5fcc94; border-color: rgba(46,161,111,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cat-pill.cat-digital    { background: rgba(245,158,11,.18); color: #fbbf24; border-color: rgba(245,158,11,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cat-pill.cat-consulting { background: rgba(56,189,248,.18); color: #7dd3fc; border-color: rgba(56,189,248,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-cat-pill.cat-other      { background: rgba(148,163,184,.16); color: #c9d1d9; border-color: rgba(148,163,184,.38); }

/* Featured ribbon */
.lm-cd-dir-ribbon {
  position: absolute;
  top: 14px;
  left: -38px;
  background: linear-gradient(135deg, #d4b46a, #C6A15B 60%, #9a7a3f);
  color: #1f1408;
  font-family: var(--cd-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  padding: 5px 44px;
  transform: rotate(-45deg);
  box-shadow: 0 6px 14px rgba(198,161,91,.35);
  z-index: 3;
}

/* Status pill */
.lm-cd-dir-cover-markers {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.lm-cd-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--cd-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lm-cd-dir-pill .lm-cd-dir-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.lm-cd-dir-pill-open    { background: rgba(15,111,79,.16);  color: #34d399; border: 1px solid rgba(52,211,153,.35);  backdrop-filter: blur(8px); }
.lm-cd-dir-pill-closing { background: rgba(245,158,11,.18); color: #fbbf24; border: 1px solid rgba(251,191,36,.4);   backdrop-filter: blur(8px); }
.lm-cd-dir-pill-closed  { background: rgba(148,163,184,.2); color: #cbd5e1; border: 1px solid rgba(203,213,225,.3); backdrop-filter: blur(8px); }

/* Card body */
.lm-cd-dir-card-body {
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.lm-cd-dir-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* Date pill left, location pill right (one row). Each is content-sized
   and they push apart; wrap to 2 lines only if both don't fit. */
.lm-cd-dir-meta-row-split {
  justify-content: space-between;
  gap: 6px 10px;
}
.lm-cd-dir-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--cd-primary-soft);
  color: var(--cd-primary-text);
  border: 1px solid var(--cd-primary-soft-2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}
.lm-cd-dir-category-chip.cat-event      { background: var(--lm-primary-soft, #f3f8f5); color: var(--lm-primary-text, #0f6f4f); border-color: var(--lm-primary-soft-2, #c8e6d4); }
.lm-cd-dir-category-chip.cat-digital    { background: #fff8eb;               color: #92400e;          border-color: #fde9c4; }
.lm-cd-dir-category-chip.cat-consulting { background: #e0f2fe;               color: #075985;          border-color: #bae6fd; }
.lm-cd-dir-category-chip.cat-other      { background: var(--cd-surface-2);   color: var(--cd-text-secondary); border-color: var(--cd-border); }
html[data-lm-theme="dark"] .lm-cd-dir-category-chip.cat-event      { background: rgba(46,161,111,.18); color: #5fcc94; border-color: rgba(46,161,111,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-category-chip.cat-digital    { background: rgba(245,158,11,.18); color: #fbbf24; border-color: rgba(245,158,11,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-category-chip.cat-consulting { background: rgba(56,189,248,.18); color: #7dd3fc; border-color: rgba(56,189,248,.4); }
html[data-lm-theme="dark"] .lm-cd-dir-category-chip.cat-other      { background: rgba(148,163,184,.16); color: #c9d1d9; border-color: rgba(148,163,184,.38); }

.lm-cd-dir-event-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--cd-text-secondary);
  line-height: 1.3;
  white-space: nowrap;
}
.lm-cd-dir-event-pill svg { width: 11px; height: 11px; flex: none; color: var(--cd-muted); }
.lm-cd-dir-event-pill .lm-cd-dir-mono {
  font-family: var(--cd-mono);
  font-weight: 600;
  color: var(--cd-text);
  font-size: 13px;
  letter-spacing: .03em;
}
.lm-cd-dir-event-pill .lm-cd-dir-dot-sep {
  width: 3px; height: 3px;
  background: var(--cd-muted-2);
  border-radius: 50%;
  margin: 0 2px;
}

.lm-cd-dir-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
/* Location pill (row 2) — slightly muted look so the dates pill on row 1
   stays visually primary. */
.lm-cd-dir-loc-pill {
  background: var(--cd-bg);
  border-color: var(--cd-border);
  color: var(--cd-text-secondary);
}
.lm-cd-dir-loc-pill svg { color: var(--cd-muted); }
/* Flag emoji (or twemoji <img>) sits inline after the country code.
   Keep its size in line with the surrounding 11px text. */
.lm-cd-dir-flag,
.lm-cd-dir-flag img { display: inline-block; vertical-align: -1px; }
.lm-cd-dir-flag img { width: 12px; height: 12px; }
/* Per CLAUDE.md feedback "No round flags" — keep flags rectangular. */
.lm-cd-dir-flag img { border-radius: 0 !important; clip-path: none !important; }
.lm-cd-dir-cd-green   { background: var(--cd-primary-soft); color: var(--cd-primary-text); border-color: var(--cd-primary-soft-2); }
.lm-cd-dir-cd-gold    { background: var(--cd-gold-soft);    color: var(--cd-gold-deep);    border-color: var(--cd-gold-soft-2); }
.lm-cd-dir-cd-red     { background: #fef2f2;                color: var(--cd-danger);       border-color: #fecaca; }
.lm-cd-dir-cd-neutral { background: var(--cd-surface-2);    color: var(--cd-muted);        border-color: var(--cd-border); }
.lm-cd-dir-pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: lm-cd-dir-pulse 1.8s ease-out infinite;
}
@keyframes lm-cd-dir-pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; }
  80%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.lm-cd-dir-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cd-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: -2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lm-cd-dir-looking {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--cd-text-secondary);
}
.lm-cd-dir-looking svg { width: 13px; height: 13px; color: var(--cd-muted); flex: none; }
.lm-cd-dir-looking strong { color: var(--cd-text); font-weight: 600; }

/* Earnings — hero.
   Layout: left column stacks [big total] + [breakdown line] vertically;
   countdown chip pinned to the top-right of the card. */
.lm-cd-dir-earnings {
  margin-top: auto;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--cd-primary-soft), #eaf3ed);
  border: 1px solid var(--cd-primary-soft-2);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
/* Consistent earnings-box height across GRID cards: single-line budgets
   ("EUR 300 fixed") match the taller per-day variant ("EUR 750 total /
   EUR 250/day × 3 days") so card footers align. Content centered vertically.
   Scoped to grid so the list view, featured rail and sidebar keep their own
   compact sizing. */
.lm-cd-dir-cards-grid[data-view="grid"] .lm-cd-dir-earnings {
  min-height: 64px;
  align-items: center;
}
.lm-cd-dir-earnings-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.lm-cd-dir-earnings-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.lm-cd-dir-total {
  font-family: var(--cd-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cd-primary-text);
  line-height: 1;
}
.lm-cd-dir-unit {
  font-size: 13px;
  color: var(--cd-text-secondary);
  font-weight: 500;
  line-height: 1.2;
}
.lm-cd-dir-breakdown {
  font-family: var(--cd-mono);
  font-size: 10.5px;
  color: var(--cd-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 500;
  line-height: 1.3;
}
.lm-cd-dir-breakdown strong { color: var(--cd-text-secondary); font-weight: 600; }
/* Countdown chip inside the earnings card — pin to top-right. */
.lm-cd-dir-earnings .lm-cd-dir-countdown {
  flex: 0 0 auto;
  margin-left: 0;
  align-self: center;
}

/* Card foot — brand + apply */
.lm-cd-dir-card-foot {
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--cd-border-2);
  margin-top: 8px;
}
.lm-cd-dir-brand-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--cd-text-secondary);
}
/* Clickable when data-brand-url is present (JS intercepts the click
   and routes to the brand/user page instead of the card's casting). */
.lm-cd-dir-brand-inline[data-brand-url] {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background-color 120ms;
}
.lm-cd-dir-brand-inline[data-brand-url]:hover { background: var(--cd-surface); }
.lm-cd-dir-brand-inline[data-brand-url]:hover .lm-cd-dir-brand-name strong { text-decoration: underline; }
.lm-cd-dir-brand-inline[data-brand-url]:focus-visible {
  outline: 2px solid var(--cd-brand);
  outline-offset: 1px;
}
.lm-cd-dir-brand-avatar {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0a2a30, #00363f);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 10px;
  flex: none;
  object-fit: cover;
}
.lm-cd-dir-brand-avatar-img { padding: 0; }
.lm-cd-dir-brand-name strong { color: var(--cd-text); font-weight: 600; }
/* Verified mark = brand/company-page .lm-bv-shield look: teal chip + white
   shield + teal check (NOT a green glyph), for cross-site consistency. */
.lm-cd-dir-brand-verified {
  display: inline-grid;
  place-items: center;
  width: 17px; height: 17px;
  border-radius: 4px;
  background: var(--lm-client, #00363f);
  color: #fff;
  flex: none;
}
.lm-cd-dir-brand-verified svg { width: 11px; height: 11px; }

/* Personal/individual owner KYC mark: the green circle-check is fully
   self-contained in the SVG, so drop the teal chip backing and let the
   round glyph render on its own. */
.lm-cd-dir-brand-verified--kyc {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: transparent;
}
.lm-cd-dir-brand-verified--kyc svg { width: 15px; height: 15px; }

.lm-cd-dir-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Price + deadline summary leads the action row (moved from the old earnings hero);
   Save + Apply sit on the right. */
.lm-cd-dir-action-money {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.lm-cd-dir-am-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--cd-text);
  white-space: nowrap;
}
.lm-cd-dir-am-days {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.lm-cd-dir-apply-btn {
  flex: none;
  background: var(--cd-brand);
  color: #fff;
  border: none;
  border-radius: var(--cd-r-btn);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.lm-cd-dir-apply-btn svg { width: 13px; height: 13px; }
.lm-cd-dir-apply-btn.is-applied {
  background: var(--cd-primary-soft);
  color: var(--cd-primary-text);
  border: 1px solid var(--cd-primary-soft-2);
}
.lm-cd-dir-card:hover .lm-cd-dir-apply-btn:not(.is-applied) { background: var(--cd-brand-strong); }
.lm-cd-dir-icon-action {
  width: 38px;
  height: 38px;   /* square — was unset, which let it stretch tall in some rows */
  flex: none;
  display: grid;
  place-items: center;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-r-btn);
  color: var(--cd-text-secondary);
}
.lm-cd-dir-icon-action svg { width: 14px; height: 14px; }
/* Phase 9 — in saved-list contexts (topbar dropdown / /saved) the save icon
   is a live un-bookmark toggle, not decoration: give it a pointer + a filled
   "saved" state. The discovery-grid icon (no .dc-card-bookmark) is unaffected. */
.lm-cd-dir-icon-action.dc-card-bookmark { cursor: pointer; }
.lm-cd-dir-icon-action.dc-card-bookmark.is-saved {
  color: var(--lm-primary, #10b981);
  border-color: var(--lm-primary, #10b981);
}
.lm-cd-dir-icon-action.dc-card-bookmark.is-saved svg { fill: currentColor; stroke: currentColor; }

/* Phase 9 — the /saved "Casting Calls" tab renders the discovery card
   (_lm_casting_card.tpl) OUTSIDE .lm-cd-dir-page, so the card's border /
   border-radius / background (all var(--cd-*)) had no token context to resolve
   against → no frame + square cover corners. Re-expose the same --cd-* tokens
   (light + dark, identical to .lm-cd-dir-page) on the saved grid so the card
   looks pixel-identical to the directory. Layout of the grid itself lives in
   lm-profile.css (.lm-saved-grid--castings). */
.lm-saved-grid--castings {
  --cd-primary:        var(--lm-primary,        #0f6f4f);
  --cd-primary-strong: var(--lm-primary-strong, #0a5439);
  --cd-primary-soft:   var(--lm-primary-soft,   #f3f8f5);
  --cd-primary-soft-2: var(--lm-primary-soft-2, #dcebe2);
  --cd-primary-text:   var(--lm-primary-text,   #0a5439);
  --cd-brand:          var(--lm-brand,          #00363f);
  --cd-brand-strong:   var(--lm-brand-strong,   #002429);
  --cd-brand-soft:     var(--lm-brand-soft,     #e8eef0);
  --cd-bg:             var(--lm-bg,             #fff);
  --cd-surface:        var(--lm-surface,        #f8fafc);
  --cd-surface-2:      var(--lm-surface-2,      #f1f5f9);
  --cd-text:           var(--lm-text,           #0f172a);
  --cd-text-secondary: var(--lm-text-secondary, #475569);
  --cd-muted:          var(--lm-muted,          #64748b);
  --cd-muted-2:        var(--lm-muted-2,        #94a3b8);
  --cd-border:         var(--lm-border,         #e2e8f0);
  --cd-border-2:       var(--lm-border-2,       #eef2f6);
  --cd-gold:           var(--lm-gold,           #C6A15B);
  --cd-gold-deep:      var(--lm-gold-deep,      #7a5e2e);
  --cd-gold-soft:      var(--lm-gold-soft,      #fef7d6);
  --cd-gold-soft-2:    var(--lm-gold-soft-2,    #f5deb3);
  --cd-danger:         var(--lm-danger,         #c0392b);
  --cd-warning:        var(--lm-warning,        #f59e0b);
  --cd-r-card:         12px;
  --cd-r-btn:          8px;
  --cd-shadow-sm:      0 1px 2px rgba(15,23,42,0.04), 0 1px 0 rgba(15,23,42,0.02);
  --cd-shadow-md:      0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --cd-mono:           "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
/* Phase 9.5 — "All my castings" toggle in the directory tools row. Mirrors
   the Brands directory's .lm-bd-mine-btn (pill + count badge; active = primary
   fill) using the casting --cd-* token set so it sits cleanly in the row. */
.lm-cd-dir-mine-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--cd-bg, #fff);
  border: 1px solid var(--cd-border, #e2e8f0);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cd-text, #0f172a);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.lm-cd-dir-mine-btn:hover {
  background: var(--cd-surface, #f8fafc);
  border-color: var(--cd-muted-2, #94a3b8);
}
.lm-cd-dir-mine-btn.is-active {
  /* Teal (brand color), not green — matches brand directory "All my brands". */
  background: var(--cd-brand, #00363f);
  border-color: var(--cd-brand, #00363f);
  color: #fff;
}
.lm-cd-dir-mine-btn.is-active:hover {
  background: var(--cd-brand-strong, #002429);
  border-color: var(--cd-brand-strong, #002429);
}
.lm-cd-dir-mine-btn svg { flex: none; }
.lm-cd-dir-mine-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--cd-mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--cd-text-secondary, #475569);
  background: var(--cd-surface-2, #f1f5f9);
  border-radius: 999px;
}
.lm-cd-dir-mine-btn.is-active .lm-cd-dir-mine-count {
  color: var(--cd-primary, #0f6f4f);
  background: #fff;
}
/* On narrow widths the label can drop to keep the row tidy; the icon + count
   still convey the control. */
@media (max-width: 420px) {
  .lm-cd-dir-mine-btn span:not(.lm-cd-dir-mine-count) { display: none; }
}
/* Phase 9.6 — non-live cards (draft/paused/filled/closed/expired/cancelled),
   which now appear in the owner's "All my castings" + saved-castings views,
   show their status label in the CTA slot styled neutral (not an actionable
   green "Apply" button). The hover selector matches the card-hover rule's
   specificity and comes later, so it wins. */
.lm-cd-dir-apply-btn.is-inactive,
.lm-cd-dir-card:hover .lm-cd-dir-apply-btn.is-inactive {
  background: var(--cd-surface-2, #f1f5f9);
  color: var(--cd-muted, #64748b);
  border-color: var(--cd-border, #e2e8f0);
  cursor: default;
}

html[data-lm-theme="dark"] .lm-saved-grid--castings {
  --cd-bg:             #0d1117;
  --cd-surface:        #161b22;
  --cd-surface-2:      #1c232c;
  --cd-text:           #e6edf3;
  --cd-text-secondary: #c9d1d9;
  --cd-muted:          #8b949e;
  --cd-muted-2:        #6e7681;
  --cd-border:         #30363d;
  --cd-border-2:       #232830;
  --cd-primary-soft:   rgba(46,161,111,.18);
  --cd-primary-soft-2: rgba(46,161,111,.36);
  --cd-primary-text:   #7adfb3;
  --cd-brand:          #318b99;
  --cd-brand-strong:   #45a8b8;
  --cd-brand-soft:     rgba(49,139,153,.18);
  --cd-gold-soft:      rgba(198,161,91,.16);
  --cd-gold-soft-2:    rgba(198,161,91,.36);
}

/* ── List view variant ──────────────────────────────────────
   Layout (no vertical separator, title spans the full body width):
     [cover 200px] [ body (meta + title + looking + earnings) ......... ]
                                                        [brand / apply]
   The brand+apply group floats to the bottom-right of the body via
   absolute positioning, so the title and other body rows can use the
   full available width instead of being squeezed into a middle column. */
/* ============================================================
   LIST VIEW — design reflow (designs/casting-calls/listing-card-redesign.html)
   Banner-left + info-right top zone over a FULL-WIDTH footer action bar
   (price pill on the left, brand + save + apply on the right). CSS-only
   reflow of the same card DOM; grid view is untouched.
   ============================================================ */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card {
  display: grid;
  /* Banner column sizes to the cover (2.8:1, full height); info takes the rest. */
  grid-template-columns: auto 1fr;
  grid-template-areas: "cover body" "foot foot";
  align-items: stretch;
  position: relative;
  overflow: hidden;
}
/* Banner — top-left, EXACTLY 2.5:1, filling the top-zone height (width follows). */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-cover {
  grid-area: cover;
  height: 100%;
  width: auto;
  aspect-ratio: 2.5 / 1;
  min-height: 150px;
  flex: none;
}
/* Info column — vertically centred */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-body {
  grid-area: body;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;   /* align info to the TOP */
  gap: 11px;
  min-width: 0;
}
/* meta row: date left, location right (normal flow, not the old absolute pin) */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0;
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-loc-pill {
  position: static; margin: 0; top: auto; right: auto;
  background: transparent; box-shadow: none;
}
html[data-lm-theme="dark"] .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-loc-pill {
  background: transparent; box-shadow: none; color: var(--cd-text-secondary);
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-title {
  margin: 0; margin-right: 0; padding-right: 0;
  font-size: 17px; line-height: 1.25;   /* smaller so more fits on one line */
  display: block; -webkit-line-clamp: unset;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-langs { margin: 0; }
/* role row: role on the LEFT, category pill (Event Service / Digital Content)
   pushed to the RIGHT, full width. */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-looking {
  margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-cat-pill { margin-left: auto; flex: none; }

/* Price pill (price + countdown) — stays in the info column, UNDER the age
   row; shrinks to content (align-self) rather than filling the column. */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-earnings {
  position: static; left: auto; bottom: auto; margin: 3px 0 0;
  align-self: stretch; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--cd-primary-soft); border: 1px solid var(--cd-primary-soft-2);
  padding: 9px 16px; border-radius: 11px;
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-earnings-main { display: inline-flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-countdown { margin: 0; flex: none; }

/* Footer action bar — full width, row 2: brand on the LEFT, save + apply RIGHT */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-foot {
  grid-area: foot;
  position: static; width: auto; margin: 0;
  padding: 12px 22px;
  border-top: 1px solid var(--cd-border-2); border-left: none;
  background: var(--cd-surface);
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 0;
}
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-brand-inline { justify-content: flex-start; flex: 1; min-width: 0; }
/* Bookmark — normal square button (was stretching tall in the footer). */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-icon-action { width: 40px; height: 40px; }
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-action-row {
  margin: 0; flex: none; display: inline-flex; align-items: center; gap: 12px;
}
/* Wider Apply Now on its footer row. */
.lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-apply-btn {
  min-width: 156px; justify-content: center;
}

/* ── Mobile: stack (<=760px) ── */
@media (max-width: 760px) {
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card {
    grid-template-columns: 1fr; grid-template-areas: "cover" "body" "foot";
  }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-cover { width: 100%; height: 160px; min-height: 0; }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-title { white-space: normal; }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-foot {
    padding: 12px 16px; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 0;
  }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-earnings {
    position: static; left: auto; bottom: auto; order: -1; width: 100%; max-width: none;
  }
}

/* ── Featured rail ────────────────────────────────────────── */
/* Outer rail is NOT sticky — header + sub scroll away normally.
   The inner .lm-cd-dir-rail-sticky pins the cards-only block, so the
   user can see two full featured cards when scrolling past the header. */
.lm-cd-dir-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Push the rail down so its header aligns with the Sort + Grid/List
     tools row in the left column (rather than sitting flush against
     the filter bar above). */
  padding-top: 20px;
  /* Stretch to the row height so .lm-cd-dir-rail-sticky has a tall
     container to stick inside on scroll. align-self: flex-start would
     collapse this to content height and kill sticky. */
}
.lm-cd-dir-rail-sticky {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
}
.lm-cd-dir-rail-head {
  padding: 0 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.lm-cd-dir-rail-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cd-text);
}
.lm-cd-dir-rail-head h3::before { content: "◆"; color: var(--cd-gold); font-size: 14px; }
.lm-cd-dir-rail-viewall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cd-gold-deep);
  text-decoration: none;
  white-space: nowrap;
}
.lm-cd-dir-rail-viewall svg { width: 11px; height: 11px; }
.lm-cd-dir-rail-viewall:hover { text-decoration: underline; }
/* Bottom-of-rail View all — surface-card style with a gold accent border,
   sits naturally below the two featured cards. Mirrors the "See all
   premium" CTA on /pages. */
.lm-cd-dir-rail-viewall-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-gold-soft-2);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cd-gold-deep);
  text-decoration: none;
  transition: background 140ms, border-color 140ms, transform 140ms;
}
.lm-cd-dir-rail-viewall-foot svg { width: 13px; height: 13px; }
.lm-cd-dir-rail-viewall-foot:hover {
  background: var(--cd-gold-soft);
  border-color: var(--cd-gold);
  text-decoration: none;
  transform: translateY(-1px);
}
.lm-cd-dir-rail-sub {
  margin: 4px 2px 0;
  font-size: 12.5px;
  color: var(--cd-muted);
  line-height: 1.5;
}
/* In the rail, cards are single-column-ish with featured emphasis. */
.lm-cd-dir-rail .lm-cd-dir-card {
  border: 1.5px solid var(--cd-gold-soft-2);
  box-shadow: 0 8px 22px -10px rgba(198,161,91,.25);
}
.lm-cd-dir-rail .lm-cd-dir-card-cover { aspect-ratio: 2.5 / 1; height: auto; }
.lm-cd-dir-rail .lm-cd-dir-card-body { padding: 12px 14px 0; gap: 8px; }
.lm-cd-dir-rail .lm-cd-dir-card-title { font-size: 14px; }
.lm-cd-dir-rail .lm-cd-dir-earnings { padding: 10px 12px; }
.lm-cd-dir-rail .lm-cd-dir-earnings .lm-cd-dir-total { font-size: 18px; }
.lm-cd-dir-rail .lm-cd-dir-card-foot { padding: 10px 14px 12px; }

/* (.lm-cd-dir-see-all was the gold pill below the featured rail.
   Removed in favour of the inline "View all" link in the rail head.) */

/* ── Empty state ──────────────────────────────────────────── */
.lm-cd-dir-empty {
  padding: 60px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--cd-bg);
  border: 1px dashed var(--cd-border);
  border-radius: 14px;
  grid-column: 1 / -1;
}
.lm-cd-dir-empty-glyph {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--cd-surface);
  display: grid;
  place-items: center;
  color: var(--cd-muted);
  border: 1px solid var(--cd-border);
}
.lm-cd-dir-empty-glyph svg { width: 24px; height: 24px; }
.lm-cd-dir-empty h3 {
  margin: 8px 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cd-text);
}
.lm-cd-dir-empty p {
  margin: 0;
  font-size: 13.5px;
  color: var(--cd-muted);
  max-width: 38ch;
  line-height: 1.55;
}

/* ── Load more ────────────────────────────────────────────── */
.lm-cd-dir-load-more-wrap { display: flex; justify-content: center; margin-top: 18px; }
.lm-cd-dir-load-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--cd-bg);
  border: 1px solid var(--cd-border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--cd-text);
  cursor: pointer;
  font-family: inherit;
}
.lm-cd-dir-load-more svg { width: 12px; height: 12px; color: var(--cd-muted); }
.lm-cd-dir-load-more:hover { background: var(--cd-surface); }

/* ── Mobile (≤767px) ──────────────────────────────────────── */
@media (max-width: 767px) {
  .lm-cd-dir-content { padding: 14px 14px 18px; }
  .lm-cd-dir-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
  .lm-cd-dir-h1 { font-size: 22px; }
  .lm-cd-dir-h1 .lm-cd-dir-count-pill { font-size: 11px; }
  .lm-cd-dir-sub { font-size: 12.5px; }
  .lm-cd-dir-body { grid-template-columns: 1fr; gap: 18px; }
  .lm-cd-dir-cards-grid { grid-template-columns: 1fr; gap: 12px; }
  /* Force list view OFF on mobile — always grid (single column). */
  .lm-cd-dir-cards-grid[data-view="list"] { grid-template-columns: 1fr; }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card { flex-direction: column; }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-cover { width: 100%; height: 120px; }
  .lm-cd-dir-cards-grid[data-view="list"] .lm-cd-dir-card-foot { width: auto; border-top: 1px solid var(--cd-border-2); border-left: none; margin-top: 8px; }
  .lm-cd-dir-view-toggle { display: none; }
  .lm-cd-dir-rail,
  .lm-cd-dir-rail-sticky { position: static; }
  .lm-cd-dir-filter-bar { padding: 8px; }
  /* Mobile: chips stay natural-width and wrap (full-width distribution
     would make them awkwardly tall in narrow viewports). */
  .lm-cd-dir-filter-row-1 .lm-cd-dir-filter-chip { flex: 0 0 auto; min-width: 0; }
  .lm-cd-dir-filter-row-1 .lm-cd-dir-filter-chip > summary { justify-content: flex-start; width: auto; }
  .lm-cd-dir-filter-row-1 .lm-cd-dir-toggle { margin-left: 0; }

  /* Mobile filters toggle: show button, collapse chip group. */
  .lm-cd-dir-filter-row-1 { flex-wrap: wrap; align-items: center; }
  .lm-cd-dir-mobile-filters-btn { display: inline-flex; margin-left: auto; }
  .lm-cd-dir-filter-chips {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    flex-basis: 100%;
  }
  .lm-cd-dir-filter-chips.is-open { display: flex; }
  .lm-cd-dir-filter-chips .lm-cd-dir-filter-chip { width: 100%; min-width: 0; }
  .lm-cd-dir-filter-chips .lm-cd-dir-filter-chip > summary {
    width: 100%;
    justify-content: space-between;
  }
  .lm-cd-dir-filter-chips .lm-cd-dir-toggle { margin-left: 0; padding-top: 4px; }
  .lm-cd-dir-card-cover { height: 120px; }
  .lm-cd-dir-card-title { font-size: 14.5px; }
  .lm-cd-dir-earnings { padding: 10px 12px; }
  .lm-cd-dir-total { font-size: 20px; }

  /* On mobile the view-toggle is hidden (see above). The controls row holds
     the counts (left) + tools (Sort, right). Keep them on one row when they
     fit; wrap gracefully on very narrow viewports (375px). */
  .lm-cd-dir-counter-row {
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }
  .lm-cd-dir-tools { flex: 0 0 auto; margin-left: auto; }
  /* On mobile collapse the full "Sort: X" dropdown chip to a compact icon
     button (the JS-wired .lm-cd-dir-sort-mobile menu). */
  .lm-cd-dir-sort-chip { display: none; }
  .lm-cd-dir-sort-mobile { display: inline-block; }
}

/* ── Dark mode overrides (same palette as lm-casting.css) ─ */
html[data-lm-theme="dark"] .lm-cd-dir-page {
  --cd-bg:             #0d1117;
  --cd-surface:        #161b22;
  --cd-surface-2:      #1c232c;
  --cd-text:           #e6edf3;
  --cd-text-secondary: #c9d1d9;
  --cd-muted:          #8b949e;
  --cd-muted-2:        #6e7681;
  --cd-border:         #30363d;
  --cd-border-2:       #232830;
  --cd-primary-soft:   rgba(46,161,111,.18);
  --cd-primary-soft-2: rgba(46,161,111,.36);
  --cd-primary-text:   #7adfb3;
  --cd-brand:          #318b99;
  --cd-brand-strong:   #45a8b8;
  --cd-brand-soft:     rgba(49,139,153,.18);
  --cd-gold-soft:      rgba(198,161,91,.16);
  --cd-gold-soft-2:    rgba(198,161,91,.36);
  background: #0d1117;
}
/* Cards lift to --cd-surface (#161b22) so they stand out from the page
   bg (#0d1117); chrome bits keep --cd-bg so they feel flat against the
   page. Previously cards shared --cd-bg → they vanished into the page. */
html[data-lm-theme="dark"] .lm-cd-dir-card {
  background: var(--cd-surface);
  border-color: var(--cd-border);
  color: var(--cd-text);
}
html[data-lm-theme="dark"] .lm-cd-dir-notify-btn,
html[data-lm-theme="dark"] .lm-cd-dir-notify-bell,
html[data-lm-theme="dark"] .lm-cd-dir-mobile-filters-btn,
html[data-lm-theme="dark"] .lm-cd-dir-filter-bar,
html[data-lm-theme="dark"] .lm-cd-dir-filter-chip > summary,
html[data-lm-theme="dark"] .lm-cd-dir-load-more,
html[data-lm-theme="dark"] .lm-cd-dir-empty,
html[data-lm-theme="dark"] .lm-cd-dir-popover,
html[data-lm-theme="dark"] .lm-cd-dir-icon-action {
  background: var(--cd-bg);
  border-color: var(--cd-border);
  color: var(--cd-text);
}
html[data-lm-theme="dark"] .lm-cd-dir-event-pill {
  background: transparent;
  border-color: transparent;
}
/* Earnings hero card: in light mode it's a green→cream gradient with
   dark-green text. In dark mode that gradient washes out the white
   "× 4 days" breakdown — switch to a deep-teal gradient with mint text
   so all three pieces read clearly. */
html[data-lm-theme="dark"] .lm-cd-dir-earnings {
  background: linear-gradient(135deg, rgba(46,161,111,.22), rgba(46,161,111,.10));
  border-color: rgba(122,223,179,.32);
}
html[data-lm-theme="dark"] .lm-cd-dir-total { color: #b5f1cf; }
html[data-lm-theme="dark"] .lm-cd-dir-unit  { color: #c9d1d9; }
html[data-lm-theme="dark"] .lm-cd-dir-breakdown { color: #8b949e; }
html[data-lm-theme="dark"] .lm-cd-dir-breakdown strong { color: #c9d1d9; }
/* Same fix for the detail-page budget card (earnings hero on /casting/X). */
html[data-lm-theme="dark"] .lm-cd-amount-math { color: rgba(255,255,255,.7); }
html[data-lm-theme="dark"] .lm-cd-amount-math .lm-cd-math-x { color: rgba(255,255,255,.5); }

/* ════════════════════════════════════════════════════════════
   Rail-footer integration on /castings.
   Shared partial _lm_rail_footer.tpl is position:fixed (CSS in
   lm-profile.css). It's pinned to the right edge with width 366px,
   computed against a 1440-wide reference. The castings page caps at
   1280, so on a wider viewport the footer slightly overhangs the rail
   column — acceptable since it's still in the right gutter.
   We just need to:
     1. reserve bottom padding inside the sticky rail so the last
        featured card isn't hidden behind the fixed footer, and
     2. provide a dark-mode bg for the footer that matches our palette.
   ════════════════════════════════════════════════════════════ */
.lm-cd-dir-page .lm-cd-dir-rail-sticky { padding-bottom: 90px; }
@media (max-width: 767px) {
  /* On mobile the rail is static and the footer flattens — no padding. */
  .lm-cd-dir-page .lm-cd-dir-rail-sticky { padding-bottom: 0; }
}
html[data-lm-theme="dark"] .lm-cd-dir-page ~ .lm-rail-footer,
html[data-lm-theme="dark"] body:has(.lm-cd-dir-page) .lm-rail-footer {
  background: var(--cd-bg);
  border-top: 0;
}

/* Dark-mode View-all CTA — light surface bg lifts off page bg
   (#0d1117) so the button doesn't read as a dark hole. */
html[data-lm-theme="dark"] .lm-cd-dir-rail-viewall-foot {
  background: var(--cd-surface);
  border-color: rgba(198,161,91,.42);
  color: #e9c97a;
}
html[data-lm-theme="dark"] .lm-cd-dir-rail-viewall-foot:hover {
  background: rgba(198,161,91,.18);
  border-color: #d4ad5e;
  color: #f4d889;
}

/* Top inline "View all" link sits on the rail head against the page bg —
   the default --cd-gold-deep (#7a5e2e) is too dim there. Brighten it to
   the same hue as the bottom CTA so both links read clearly. */
html[data-lm-theme="dark"] .lm-cd-dir-rail-viewall { color: #e9c97a; }
html[data-lm-theme="dark"] .lm-cd-dir-rail-viewall:hover { color: #f4d889; }

/* Dark-mode countdown pills.
   - Gold "X days left" used to be gold-deep (#7a5e2e) on faint gold soft —
     both dim against #161b22 cards. Brighten text to a true amber.
   - Red "URGENT" was on light pink #fef2f2 — replace with a translucent
     red so it pops on dark cards instead of looking washed-out. */
html[data-lm-theme="dark"] .lm-cd-dir-cd-gold {
  background: rgba(245,158,11,.18);
  color: #fbbf24;
  border-color: rgba(251,191,36,.42);
}
html[data-lm-theme="dark"] .lm-cd-dir-cd-red {
  background: rgba(239,68,68,.18);
  color: #fca5a5;
  border-color: rgba(252,165,165,.42);
}

/* Dark-mode "X closing this week" pill. --cd-gold-soft / -soft-2 are
   already redefined for dark above, but --cd-gold-deep (#7a5e2e) is too
   dim on the dark page bg — brighten the resting text to a true amber
   (same hue as the gold countdown pills). Active state keeps a solid
   amber fill with white text. */
html[data-lm-theme="dark"] button.lm-cd-dir-count-pill--soon {
  color: #fbbf24;
  border-color: rgba(251,191,36,.42);
}
html[data-lm-theme="dark"] button.lm-cd-dir-count-pill--soon:hover {
  background: rgba(245,158,11,.28);
  border-color: rgba(251,191,36,.6);
}
html[data-lm-theme="dark"] button.lm-cd-dir-count-pill--soon.is-active {
  background: #d4a437;
  color: #1a1206;
  border-color: #d4a437;
}
/* Toast on dark — invert so it's a light chip on the dark page. */
html[data-lm-theme="dark"] .lm-cd-dir-notify-toast {
  background: var(--cd-surface-2);
  color: var(--cd-text);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
html[data-lm-theme="dark"] .lm-cd-dir-notify-toast svg { color: var(--cd-primary-text); }

/* Nudge the rail-footer 10px right on /castings per user request.
   Default right offset comes from lm-profile.css. */
body:has(.lm-cd-dir-page) .lm-rail-footer {
  right: max(14px, calc((100vw - 1440px) / 2 + 14px));
}
@media (max-width: 1550px) {
  body:has(.lm-cd-dir-page) .lm-rail-footer { right: 25px; }
}

/* Right-side tools strip in the counter row — Sort dropdown + Grid/List
   toggle, sitting above the featured rail. */
.lm-cd-dir-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* Inline pills inside the .lm-cd-dir-looking row — age range +
   language chips with flag emojis. Compact so several fit on the row
   next to the role label. */
.lm-cd-dir-looking {
  flex-wrap: wrap;
  row-gap: 4px;
}
.lm-cd-dir-look-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 6px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cd-text-secondary);
}
.lm-cd-dir-look-lang {
  background: var(--cd-bg);
}

/* Languages row in the card — own line, green pills with flag. */
.lm-cd-dir-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.lm-cd-dir-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--cd-primary-soft);
  color: var(--cd-primary-text);
  border: 1px solid var(--cd-primary-soft-2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.lm-cd-dir-lang-pill-flags {
  gap: 6px;
  padding: 2px 9px;
}
/* Birthday-cake glyph leading the age pill. */
.lm-cd-dir-pill-ico { width: 13px; height: 13px; flex: none; opacity: .9; }
/* "LANG" abbreviation leading the languages-flags pill. */
.lm-cd-dir-lang-tag {
  font-family: var(--cd-mono, ui-monospace, monospace);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}
.lm-cd-dir-lang-flag {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  line-height: 1;
  cursor: default;
}

/* ── .lm-tip hover tooltip (pure-CSS) ─────────────────────────────────────
   Copied from lm-brand.css / lm-discover.css so the language-flag (and
   verified-badge) tooltip works on /castings, where neither of those
   stylesheets is loaded. Reads data-lm-tip via ::after, near-instant. */
.lm-tip { position: relative; }
.lm-tip::after {
  content: attr(data-lm-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #fff;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 200;
  box-shadow: 0 8px 20px -6px rgba(15,23,42,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.lm-tip:hover::after,
.lm-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html[data-lm-theme="dark"] .lm-tip::after {
  background: #1f2937;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.55);
}

/* Top date + location row — plain text + icon, no pill chrome. */
.lm-cd-dir-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 12.5px;
  color: var(--cd-text-secondary);
  font-weight: 500;
}
.lm-cd-dir-meta-item svg { width: 13px; height: 13px; color: var(--cd-muted); flex: none; }
.lm-cd-dir-meta-item.lm-cd-dir-meta-loc { color: var(--cd-text-secondary); }

/* ════════════════════════════════════════════════════════════
   Location regions/countries picker — namespaced port of the
   brand directory's .lm-bd-loc-* pattern. Same look + behaviour:
   collapsible region groups, country rows with flag + count +
   checkbox, per-region "select all" link, footer Clear/Apply.
   ════════════════════════════════════════════════════════════ */
.lm-cd-dir-loc-pop {
  width: 260px;
  max-height: 460px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
}
.lm-cd-dir-loc-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}
.lm-cd-dir-loc-region { border-radius: 6px; }
.lm-cd-dir-loc-region-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 0;
}
.lm-cd-dir-loc-region-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--cd-text);
  cursor: pointer;
  text-align: left;
  transition: background 120ms;
}
.lm-cd-dir-loc-region-toggle:hover { background: var(--cd-surface-2); }
.lm-cd-dir-loc-region-chev-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.lm-cd-dir-loc-region-chev {
  color: var(--cd-muted);
  transition: transform 150ms;
  transform: rotate(-90deg);
}
.lm-cd-dir-loc-region.is-open .lm-cd-dir-loc-region-chev { transform: rotate(0deg); }
.lm-cd-dir-loc-region-name { flex: 1; }
.lm-cd-dir-loc-count {
  color: var(--cd-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.lm-cd-dir-loc-select-all {
  background: transparent;
  border: none;
  color: var(--cd-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: lowercase;
  transition: background 120ms, color 120ms;
}
.lm-cd-dir-loc-select-all:hover {
  background: var(--cd-surface-2);
  color: var(--cd-primary-text);
}
.lm-cd-dir-loc-region-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 22px;
  padding-bottom: 4px;
}
.lm-cd-dir-loc-region-body[hidden] { display: none; }
.lm-cd-dir-loc-country {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--cd-text);
  transition: background 120ms;
  position: relative;
}
.lm-cd-dir-loc-country:hover { background: var(--cd-surface-2); }
.lm-cd-dir-loc-country input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lm-cd-dir-loc-check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--cd-border);
  display: grid;
  place-items: center;
  flex: none;
  background: var(--cd-bg);
  color: transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.lm-cd-dir-loc-country input:checked ~ .lm-cd-dir-loc-check-box {
  background: var(--cd-primary);
  border-color: var(--cd-primary);
  color: #fff;
}
.lm-cd-dir-loc-flag {
  font-size: 16px;
  line-height: 1;
  flex: none;
}
.lm-cd-dir-loc-country-name { flex: 1; }
.lm-cd-dir-loc-empty {
  padding: 16px 12px;
  color: var(--cd-muted);
  font-size: 13px;
  text-align: center;
}
.lm-cd-dir-loc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  border-top: 1px solid var(--cd-border-2);
  margin-top: 4px;
}
.lm-cd-dir-loc-clear {
  background: transparent;
  border: none;
  color: var(--cd-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.lm-cd-dir-loc-clear:hover { background: var(--cd-surface-2); color: var(--cd-text); }
.lm-cd-dir-loc-apply {
  background: var(--cd-primary);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background 120ms;
}
.lm-cd-dir-loc-apply:hover { background: var(--cd-primary-strong); }
.lm-cd-dir-loc-count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--cd-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Loc chip popover — narrower than the brand-directory equivalent
   per UX request; fits two long country names + count + checkbox
   without horizontal overflow. */
.lm-cd-dir-loc-chip > .lm-cd-dir-popover {
  width: 260px;
  max-width: calc(100vw - 32px);
}

/* ============================================================
   Dark theme — lift the "black" buttons/pills on /castings, and reshape the
   Notify button. The card bookmark, the filter dropdown chips and the notify
   button all used var(--cd-bg) (page-darkest), so they read as black. Raise
   inactive fills to an elevated surface; active/open states keep their green.
   ============================================================ */
html[data-lm-theme="dark"] .lm-cd-dir-icon-action,
html[data-lm-theme="dark"] .lm-cd-dir-filter-chip > summary,
html[data-lm-theme="dark"] .lm-cd-dir-pill-toggle:not(.is-on),
html[data-lm-theme="dark"] .lm-cd-dir-notify-bell {
  background: var(--lm-surface-2, #222a33);
  border-color: var(--lm-border, #2a3038);
  color: var(--lm-text, #e6e8eb);
}
html[data-lm-theme="dark"] .lm-cd-dir-icon-action:hover,
html[data-lm-theme="dark"] .lm-cd-dir-pill-toggle:not(.is-on):hover,
html[data-lm-theme="dark"] .lm-cd-dir-filter-chip > summary:hover {
  background: var(--lm-surface, #1c232c);
  border-color: var(--lm-muted-2, #6e7681);
}

/* "Notify me of new castings" — taller, rounded-rectangle (not a thin pill). */
.lm-cd-dir-notify-bell {
  padding: 10px 16px;
  border-radius: 10px;
}
