/* ===== HelperMatch — Design System ===== */

:root {
  /* Breakpoint tokens (for reference; media queries use literals) */
  --bp-sm: 480px;
  --bp-md: 720px;
  --bp-lg: 960px;
  --bp-xl: 1200px;

  /* Safe-area reads (iOS) */
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --sa-right: env(safe-area-inset-right, 0px);

  /* Virtual-keyboard offset (updated by JS via visualViewport) */
  --kb-offset: 0px;

  /* Heights used across sticky chrome */
  --nav-h: 72px;
  --bottom-cta-h: 68px;

  /* Core Warm palette */
  --coral: #E8856A;
  --coral-dark: #C0634B;
  --coral-light: #FFE8DE;
  --coral-bg: #FFF3ED;
  --mint: #48B8A0;
  --mint-dark: #2E8B74;
  --mint-light: #D7F0E9;
  --bg: #FFF8F0;
  --paper: #FFFFFF;
  --ink: #2A1C12;
  --ink-soft: #3D2B1F;
  --ink-muted: #6B5A4E;
  --ink-faint: #9A8B7F;
  --line: #EDE2D3;
  --line-strong: #D9CABA;
  --sand: #F6EDDF;
  --amber: #FFF3CD;
  --gold: #D4A554;
  --bronze: #B8865B;

  /* Trust color — softened indigo for CTAs, verified badges, contracts */
  --trust: oklch(0.46 0.12 275);
  --trust-deep: oklch(0.36 0.11 275);
  --trust-soft: oklch(0.90 0.04 275);
  --trust-bg: oklch(0.97 0.02 275);
  --trust-ink: oklch(0.42 0.12 275);

  /* Variant-adjustable tokens (default = Warm Home) */
  --t-bg: var(--bg);
  --t-paper: var(--paper);
  --t-ink: var(--ink);
  --t-ink-muted: var(--ink-muted);
  --t-line: var(--line);
  --t-accent: var(--trust);
  --t-accent-ink: #ffffff;
  --t-warm: var(--coral);
  --t-warm-ink: #ffffff;
  --t-radius: 14px;
  --t-radius-sm: 10px;
  --t-radius-lg: 22px;
  --t-body: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --t-display: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --t-shadow-card: 0 1px 2px rgba(40, 25, 15, 0.04), 0 6px 20px rgba(40, 25, 15, 0.06);
  --t-shadow-hover: 0 4px 12px rgba(40, 25, 15, 0.08), 0 18px 40px rgba(40, 25, 15, 0.12);
}

/* Editorial variant */
body.variant-editorial {
  --t-bg: #FAF6EF;
  --t-paper: #FFFFFF;
  --t-ink: #1F1811;
  --t-ink-muted: #6E5E4E;
  --t-line: #E5DCCB;
  --t-accent: #1D2951;
  --t-warm: #B8543A;
  --t-radius: 4px;
  --t-radius-sm: 3px;
  --t-radius-lg: 8px;
  --t-display: 'Fraunces', 'Noto Serif TC', serif;
  --t-shadow-card: none;
}

/* Modern variant */
body.variant-modern {
  --t-bg: #F5F2EC;
  --t-paper: #FFFFFF;
  --t-ink: #111111;
  --t-ink-muted: #6B6B6B;
  --t-line: #E6E2DB;
  --t-accent: #1F1F1F;
  --t-warm: #E8856A;
  --t-radius: 20px;
  --t-radius-sm: 14px;
  --t-radius-lg: 28px;
  --t-display: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: var(--t-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Prevent long non-breaking strings (URLs, long tokens) from causing horizontal scroll */
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Touch & selection niceties */
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
@media (hover: none) and (pointer: coarse) {
  .btn:active { transform: scale(0.98); }
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

.display {
  font-family: var(--t-display);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 600;
}

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* === Layout === */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; width: 100%; }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 32px; width: 100%; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* === Nav === */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--t-bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--t-line);
}
.nav-inner { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--t-accent); color: var(--t-accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
body.variant-editorial .brand-mark { border-radius: 3px; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500;
  color: var(--t-ink); transition: background 0.15s;
}
.nav-link:hover { background: color-mix(in srgb, var(--t-ink) 6%, transparent); }
.nav-link.active { background: color-mix(in srgb, var(--t-accent) 10%, transparent); color: var(--t-accent); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--t-accent); color: var(--t-accent-ink); }
.btn-primary:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn-ghost { color: var(--t-ink); border-color: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--t-ink) 6%, transparent); }
.btn-outline { border-color: var(--t-line); color: var(--t-ink); background: var(--t-paper); }
.btn-outline:hover { border-color: var(--t-ink); }
.btn-dark { background: var(--t-ink); color: white; }
.btn-dark:hover { filter: brightness(1.2); }
.btn-mint { background: var(--mint); color: white; }
.btn-mint:hover { background: var(--mint-dark); }
.btn-warm { background: var(--t-warm); color: var(--t-warm-ink); }
.btn-warm:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn-trust { background: var(--trust); color: white; }
.btn-trust:hover { background: var(--trust-deep); transform: translateY(-1px); }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
body.variant-editorial .btn { border-radius: 4px; }
body.variant-modern .btn { border-radius: 12px; }

/* === Chips / Tags === */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--sand); color: var(--ink-soft);
}
.chip-outline { background: transparent; border: 1px solid var(--t-line); }
.chip-coral { background: var(--coral-light); color: var(--coral-dark); }
.chip-mint { background: var(--mint-light); color: var(--mint-dark); }
.chip-sand { background: var(--amber); color: #8B6914; }
.chip-ghost { background: transparent; color: var(--t-ink-muted); }
.chip-trust { background: var(--trust-bg); color: var(--trust-ink); border: 1px solid var(--trust-soft); }
body.variant-editorial .chip { border-radius: 3px; }

/* Rich-text content (from contenteditable editor, rendered on job detail) */
.rich-content p { margin: 0 0 12px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 10px 0 14px; padding-left: 26px; }
.rich-content ul li, .rich-content ol li { margin: 4px 0; }
.rich-content h3 { font-size: 18px; font-weight: 600; margin: 16px 0 8px; color: var(--t-ink); }
.rich-content h3:first-child { margin-top: 0; }
.rich-content b, .rich-content strong { font-weight: 600; color: var(--t-ink); }
.rich-content u { text-decoration-thickness: 1.5px; text-underline-offset: 2px; }

/* === Cards === */
.card {
  background: var(--t-paper);
  border: 1px solid var(--t-line);
  border-radius: var(--t-radius);
  overflow: hidden;
  transition: all 0.2s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--t-shadow-hover); transform: translateY(-2px); }
.card-flat { background: var(--t-paper); border: 1px solid var(--t-line); border-radius: var(--t-radius); }

/* === Tier Badges === */
.tier-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  font-family: var(--t-body);
}
.tier-A { background: var(--coral); color: white; }
.tier-B { background: var(--mint); color: white; }
.tier-C { background: #E8DDD0; color: var(--ink-soft); }
.tier-D { background: #E8DDD0; color: var(--ink-muted); }
.tier-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
body.variant-editorial .tier-badge { border-radius: 2px; }

/* === Footer === */
.footer {
  margin-top: 80px;
  background: var(--ink);
  color: #D6CCBE;
  padding: 64px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer h5 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; font-weight: 600; }
/* Reset default <summary> disclosure chrome on desktop — only sm-down turns into a toggle */
.footer-col details > summary {
  list-style: none; cursor: default;
  display: block;
}
.footer-col details > summary::-webkit-details-marker { display: none; }
.footer-col details > summary::marker { content: ''; }
.footer-col details > summary h5 { margin: 0; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: #A89B8B; font-size: 15px; transition: color 0.15s; }
.footer a:hover { color: white; }
.footer-bottom {
  padding-top: 32px; border-top: 1px solid #3D2B1F;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #A89B8B;
}

/* === Avatar === */
.avatar {
  display: inline-block; border-radius: 50%; overflow: hidden;
  background: var(--sand);
  position: relative;
  flex-shrink: 0;
}
.avatar-square { border-radius: var(--t-radius-sm); }

/* === Inputs === */
.input, .select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--t-line);
  border-radius: var(--t-radius-sm);
  background: var(--t-paper);
  font-size: 15px;
  transition: border-color 0.15s;
}
/* Custom chevron for selects — the native arrow sits right against the
   border on most browsers, which feels cramped. Replace with an inline SVG
   positioned with explicit right offset so it has visible breathing room. */
.select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2316120F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 12px;
}
.select::-ms-expand { display: none; }
.input:focus, .select:focus { outline: none; border-color: var(--t-accent); }
.label { font-size: 14px; font-weight: 600; color: var(--t-ink); margin-bottom: 6px; display: block; }

/* === Section === */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.eyebrow { font-size: 14px; color: var(--t-accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; }

/* === Hero === */
.hero {
  position: relative;
  min-height: 620px;
  border-radius: var(--t-radius-lg);
  overflow: hidden;
  margin-top: 24px;
  background: #3D2B1F;
}
.hero-image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,25,15,0.1) 0%, rgba(40,25,15,0.35) 50%, rgba(40,25,15,0.7) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 64px 56px 48px;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 620px; color: white;
}

/* Floating hero search */
.hero-search {
  position: absolute; bottom: -36px; left: 56px; right: 56px;
  background: var(--t-paper);
  padding: 14px;
  border-radius: var(--t-radius-lg);
  box-shadow: var(--t-shadow-hover);
  border: 1px solid var(--t-line);
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 0;
  z-index: 3;
}
.hero-search-cell {
  padding: 10px 20px;
  border-right: 1px solid var(--t-line);
  min-width: 0;
}
.hero-search-cell:nth-child(3) { border-right: none; }
.hero-search-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--t-ink-muted); font-weight: 600; margin-bottom: 2px;
}
.hero-search-btn {
  margin: 4px;
  border-radius: calc(var(--t-radius-lg) - 4px);
}
@media (max-width: 960px) {
  .hero-search {
    left: 16px; right: 16px; bottom: -28px;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    gap: 4px;
  }
  .hero-search-cell { padding: 8px 12px; border-right: none; }
  .hero-search-cell:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--t-line); padding-top: 10px; }
  .hero-search-btn { grid-column: 1 / -1; margin: 4px 0 0; min-height: 44px; }
  .hero-search-btn span { display: inline; }
}
@media (max-width: 480px) {
  .hero-search { grid-template-columns: 1fr; }
  .hero-search-cell { border-top: 1px solid var(--t-line); padding: 8px 12px; }
  .hero-search-cell:first-child { border-top: none; }
}

/* === Tweaks Panel === */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  background: var(--t-paper);
  border: 1px solid var(--t-line);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
  width: 280px;
  display: none;
  font-size: 13px;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 10px; font-weight: 600; }
.tweaks-panel h4:not(:first-child) { margin-top: 18px; }
.tweaks-panel .opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks-panel .opt {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--t-line); cursor: pointer; background: var(--t-paper);
  transition: all 0.1s;
}
.tweaks-panel .opt.active { background: var(--t-ink); color: var(--t-paper); border-color: var(--t-ink); }

/* === Modal === */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(40,25,15,0.5); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 40px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--t-paper); border-radius: var(--t-radius);
  max-width: 480px; width: 100%; padding: 32px; position: relative;
}

/* === Scroll helpers === */
.scroll-x {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: thin;
}
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* === Page transitions === */
/* Opacity-only fade — no transforms, since transformed ancestors
   create containing blocks and break position:fixed drawers (filter sheet etc). */
.page { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Utility === */
.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--t-ink-muted); }
.text-sm { font-size: 14px; } .text-xs { font-size: 13px; } .text-lg { font-size: 18px; } .text-xl { font-size: 21px; }
.text-2xl { font-size: 24px; } .text-3xl { font-size: 32px; } .text-4xl { font-size: 44px; } .text-5xl { font-size: 56px; }
.text-6xl { font-size: 72px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; } .mb-12 { margin-bottom: 48px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.w-full { width: 100%; }
.rounded { border-radius: var(--t-radius); }
.rounded-sm { border-radius: var(--t-radius-sm); }
.rounded-full { border-radius: 999px; }

/* === Tooltip / Locked === */
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(40,25,15,0.55); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; color: white;
  border-radius: inherit;
}

/* === Divider === */
.divider { height: 1px; background: var(--t-line); margin: 32px 0; border: none; }

/* === Stars === */
.stars { color: #E8A52A; letter-spacing: 2px; font-size: 14px; }

/* === Icons (SVG stroke) === */
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* =======================================================================
   ========================  Responsive (RWD)  ===========================
   Root-fix system. Breakpoints: sm 480, md 720, lg 960, xl 1200.
   We provide utility classes + component-scoped rules instead of brittle
   attribute-selector !important overrides. Pages that still use inline
   gridTemplateColumns get safety-net rules at the bottom.
   ======================================================================= */

/* Prevent horizontal scroll; protect media */
body { overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }
img { -webkit-touch-callout: none; }

/* -------- Container widths -------- */
@media (max-width: 1200px) {
  .container { max-width: 1120px; padding-left: 28px; padding-right: 28px; }
  .container-wide { max-width: 1120px; padding-left: 28px; padding-right: 28px; }
  .container-narrow { max-width: 800px; padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 960px) {
  .container, .container-wide, .container-narrow { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 720px) {
  .container, .container-wide, .container-narrow { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .container, .container-wide, .container-narrow { padding-left: 14px; padding-right: 14px; }
}

/* -------- Section padding -------- */
@media (max-width: 960px) {
  .section { padding: 56px 0; }
  .section-sm { padding: 32px 0; }
  .hero { min-height: 520px; border-radius: 16px; margin-top: 12px; }
  .hero-content { padding: 32px 24px; min-height: 520px; }
}
@media (max-width: 720px) {
  .section { padding: 40px 0; }
  .hero { min-height: 460px; }
  .hero-content { padding: 24px 20px; min-height: 460px; }
}
@media (max-width: 480px) {
  .section { padding: 32px 0; }
}

/* -------- Typography scale -------- */
@media (max-width: 720px) {
  .text-6xl { font-size: 48px !important; }
  .text-5xl { font-size: 40px !important; }
  .text-4xl { font-size: 32px !important; }
  .text-3xl { font-size: 26px !important; }
  .text-2xl { font-size: 21px !important; }
}
@media (max-width: 480px) {
  .text-6xl { font-size: 38px !important; }
  .text-5xl { font-size: 32px !important; }
  .text-4xl { font-size: 26px !important; }
}

/* =======================================================================
   NAV / BURGER
   ======================================================================= */
.nav-burger {
  display: none; background: none; border: none; padding: 8px;
  border-radius: 10px; color: var(--t-ink); cursor: pointer;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.nav-burger:hover { background: color-mix(in srgb, var(--t-ink) 6%, transparent); }
.nav-mobile-panel {
  position: fixed; top: 72px; left: 0; right: 0;
  bottom: 0;
  background: var(--t-paper); z-index: 99;
  padding: 20px calc(20px + var(--sa-right)) calc(20px + var(--sa-bottom)) calc(20px + var(--sa-left));
  display: none; flex-direction: column; gap: 4px;
  overflow-y: auto; overscroll-behavior: contain;
}
.nav-mobile-panel.open { display: flex; animation: nav-panel-in 0.18s ease-out; }
@keyframes nav-panel-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nav-mobile-panel .nav-link {
  padding: 14px 16px; font-size: 16px; border-radius: 12px; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px;
}
.nav-mobile-panel .nav-link.active { background: color-mix(in srgb, var(--t-accent) 10%, transparent); color: var(--t-accent); }
.nav-mobile-actions {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--t-line);
  display: flex; flex-direction: column; gap: 10px;
}
/* Scroll-lock body when nav/sheet open */
body.rwd-scroll-lock { overflow: hidden; touch-action: none; }

@media (max-width: 960px) {
  .nav-inner { gap: 12px; height: 64px; }
  .nav-mobile-panel { top: 64px; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-right .chip-outline { display: none; }
  .nav-right .btn-ghost[title="Style tweaks"] { display: none; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .nav-right { gap: 6px; }
  .nav-right .btn { padding: 8px 12px; font-size: 13px; min-height: 40px; }
}

/* =======================================================================
   FOOTER — 4-col → 2-col → accordion on sm
   ======================================================================= */
@media (max-width: 960px) {
  .footer { margin-top: 56px; padding: 48px 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 8px; }
  .footer-col { border-top: 1px solid #3D2B1F; padding: 14px 0; }
  .footer-col:first-child { border-top: none; padding-top: 0; }
  .footer-col.footer-col-brand { border-top: none; padding-top: 0; margin-bottom: 12px; }
  .footer-col details > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0; color: white; font-size: 13px; text-transform: uppercase;
    letter-spacing: 0.1em; font-weight: 600; min-height: 44px;
  }
  .footer-col details > summary::-webkit-details-marker { display: none; }
  .footer-col details > summary::after {
    content: '＋'; font-size: 18px; font-weight: 400; transition: transform 0.15s;
  }
  .footer-col details[open] > summary::after { content: '−'; }
  .footer-col details > ul { padding: 6px 0 10px; gap: 14px; }
  .footer-col details > ul a { padding: 6px 0; display: inline-block; min-height: 32px; }
}

/* =======================================================================
   RWD UTILITY CLASSES — prefer these over inline gridTemplateColumns
   ======================================================================= */
.rwd-grid { display: grid; gap: 20px; }
.rwd-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rwd-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rwd-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.rwd-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* Hide/show by breakpoint */
.show-lg-up { display: initial; }
.show-md-down { display: none; }
@media (max-width: 960px) {
  .show-lg-up { display: none !important; }
  .show-md-down { display: initial; }
  .hide-md-down { display: none !important; }
}
@media (max-width: 720px) {
  .hide-sm-down { display: none !important; }
  .show-sm-down { display: initial; }
}

/* Generic collapse at md */
@media (max-width: 960px) {
  .rwd-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rwd-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .rwd-grid-4, .rwd-grid-3, .rwd-grid-2 { grid-template-columns: 1fr; gap: 14px; }
}

/* =======================================================================
   SAFETY NET — collapse stubborn inline multi-col grids on small screens.
   (We're progressively migrating pages off inline grids. Until then.)
   ======================================================================= */
@media (max-width: 960px) {
  /* Sidebar + main patterns collapse to single column */
  [style*="280px 1fr"],
  [style*="260px 1fr"],
  [style*="240px 1fr"],
  [style*="220px 1fr"],
  [style*="1fr 380px"],
  [style*="1fr 340px"],
  [style*="1fr 360px"],
  [style*="1.4fr 1fr"],
  [style*="1.2fr 1fr"],
  [style*="1fr 1.2fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Auth split — full-bleed form on tablet (hides the marketing panel) */
  .auth-split { grid-template-columns: 1fr !important; }
  .auth-split > .auth-marketing { display: none !important; }
  /* 4-col stat/feature grids → 2-col */
  [style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  /* Hero floating search bar */
  [style*="1.2fr 1fr 1fr auto"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 720px) {
  /* Everything collapses to single column by default */
  [style*="gridTemplateColumns"],
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Auto-fill grids stay fluid */
  [style*="auto-fill"],
  [style*="auto-fit"] {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
  }
  /* Opt-in: keep 2-col at sm (e.g. date month/year pair, currency + amount) */
  [data-rwd="keep-2col"] { grid-template-columns: 1fr 1fr !important; }
  [data-rwd="keep-3col"] { grid-template-columns: repeat(3, 1fr) !important; }
  /* Hero floating search anchor → stack in flow */
  [style*="bottom:-36px"],
  [style*="bottom: -36px"] {
    position: static !important; left: auto !important; right: auto !important;
    margin-top: 16px !important;
  }
  [style*="bottom:-36px"] > div,
  [style*="bottom: -36px"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--t-line);
  }
}

/* Sticky sidebars become static below lg */
@media (max-width: 960px) {
  aside[style*="position:sticky"],
  aside[style*="position: sticky"] {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
  /* Inner sticky wrappers inside an <aside> also become static */
  aside > div[style*="position:sticky"],
  aside > div[style*="position: sticky"] { position: static !important; top: auto !important; }
}

/* Candidate detail header (120px avatar + name) stacks on narrow */
@media (max-width: 640px) {
  .page.has-sticky-cta h1.display { font-size: 26px !important; }
  /* The header row "Avatar gap:24 flex:1 text" — collapse to column */
  .page.has-sticky-cta .container-wide > div[style*="1fr 380px"] > div:first-child > div[style*="gap:24px"],
  .page.has-sticky-cta .container-wide > div[style*="1fr 380px"] > div:first-child > div[style*="gap: 24px"] {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: flex-start !important;
  }
}

/* =======================================================================
   DASHBOARD
   ======================================================================= */
@media (max-width: 960px) {
  .dash-layout { grid-template-columns: 1fr !important; gap: 20px; padding: 24px 16px 64px; }
  .dash-side { position: static; }
  .dash-nav { display: none !important; }
  .dash-section-picker { display: block !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-header h1 { font-size: 24px !important; }
  .dash-two-col { grid-template-columns: 1fr !important; gap: 16px !important; }
  .stat-tile { padding: 14px; }
  .stat-value { font-size: 26px !important; }
  .dash-profile-card, .dash-agencies-card, .dash-sign-out { display: none !important; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .pipeline-steps { grid-template-columns: 1fr; gap: 8px; }
  .pipeline-step + .pipeline-step::before { display: none; }
  .pipeline-step { display: flex; align-items: center; gap: 12px; text-align: left; }
  .pipeline-dot { margin: 0; }
}

/* =======================================================================
   INBOX — list/thread swap on lg-down, safe-area composer, keyboard offset
   ======================================================================= */
.inbox-mobile-back { display: none; }
@media (max-width: 960px) {
  /* Use dvh so iOS dynamic URL bar doesn't overflow */
  .inbox-shell.mobile-has-thread .inbox-side { display: none; }
  .inbox-shell:not(.mobile-has-thread) .thread { display: none; }
  .inbox-mobile-back {
    display: inline-flex !important; min-width: 40px; min-height: 40px;
    align-items: center; justify-content: center;
    background: var(--t-bg); border: 1px solid var(--t-line);
    border-radius: 8px; color: var(--t-ink);
  }
  .inbox-mobile-back:hover { background: var(--t-paper); }
  .inbox-side { border-right: none; }
  /* Hide secondary thread-header actions on narrow to make room for the back button + name */
  .thread-header > .btn-outline.btn-sm,
  .thread-header > .btn-ghost.btn-sm:not(.inbox-mobile-back) { display: none; }
  .thread-header { padding: 12px 16px; gap: 10px; }
  .thread-body { padding: 16px; scroll-padding-bottom: calc(80px + var(--kb-offset)); }
  .thread-composer {
    padding: 12px 16px calc(12px + var(--sa-bottom));
    transform: translateY(calc(-1 * var(--kb-offset)));
    transition: transform 0.15s ease-out;
  }
  .thread-composer textarea { font-size: 16px; min-height: 44px; }
  .msg { max-width: 85%; }
}

/* =======================================================================
   MODAL → bottom-sheet on md-down
   ======================================================================= */
.modal-backdrop {
  animation: modal-fade 0.18s ease-out;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    padding: 20px 20px calc(20px + var(--sa-bottom));
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    animation: sheet-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .modal::before {
    content: ''; display: block; width: 40px; height: 4px;
    background: var(--t-line); border-radius: 99px;
    margin: -6px auto 12px;
  }
  .modal .btn-lg { width: 100%; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* =======================================================================
   BOTTOM-SHEET (reusable, used by Filter drawer etc.)
   ======================================================================= */
.bottom-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(40,25,15,0.5); z-index: 200;
  display: none; animation: modal-fade 0.18s ease-out;
}
.bottom-sheet-backdrop.open { display: block; }
.bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
  background: var(--t-paper);
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding-bottom: var(--sa-bottom);
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
  width: 40px; height: 4px; background: var(--t-line); border-radius: 99px;
  margin: 10px auto 4px; flex-shrink: 0;
}
.bottom-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 14px; border-bottom: 1px solid var(--t-line);
  flex-shrink: 0;
}
.bottom-sheet-header h3 { font-size: 17px; font-weight: 700; }
.bottom-sheet-body { flex: 1; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.bottom-sheet-footer {
  padding: 12px 16px calc(12px + var(--sa-bottom));
  border-top: 1px solid var(--t-line);
  display: flex; gap: 10px; flex-shrink: 0; background: var(--t-paper);
}

/* =======================================================================
   STICKY BOTTOM CTA BAR (detail pages on md-down)
   ======================================================================= */
.sticky-cta-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 10px 16px calc(10px + var(--sa-bottom));
  background: color-mix(in srgb, var(--t-paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--t-line);
  align-items: center; gap: 10px;
}
.sticky-cta-bar .cta-meta { flex: 1; min-width: 0; font-size: 13px; color: var(--t-ink-muted); }
.sticky-cta-bar .cta-meta strong { color: var(--t-ink); font-size: 14px; display: block; }
.sticky-cta-bar .btn { min-height: 48px; }
.sticky-cta-bar .btn-icon { min-width: 48px; padding: 0; }
@media (max-width: 960px) {
  .sticky-cta-bar { display: flex; }
  .has-sticky-cta { padding-bottom: calc(var(--bottom-cta-h) + var(--sa-bottom) + 16px); }
}

/* =======================================================================
   SCROLL-TO-TOP (mobile only, appears after scrolling)
   ======================================================================= */
.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--sa-bottom));
  width: 44px; height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--t-ink) 85%, transparent);
  color: white;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  z-index: 80;
  opacity: 0; transition: opacity 0.2s;
}
.scroll-top-btn.visible { opacity: 1; }
@media (max-width: 720px) {
  .scroll-top-btn.active { display: flex; }
}
/* When sticky CTA bar is shown, lift scroll-top above it */
.scroll-top-btn.lifted { bottom: calc(var(--bottom-cta-h) + var(--sa-bottom) + 16px); }

/* =======================================================================
   SNAP SCROLLER (Featured, Testimonials on md-down)
   ======================================================================= */
.snap-scroller {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
@media (max-width: 960px) {
  .snap-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 4px 16px 12px;
    margin: 0 -16px;
    scroll-padding: 16px;
  }
  .snap-scroller > * {
    flex: 0 0 clamp(260px, 78vw, 320px);
    scroll-snap-align: start;
  }
  .snap-scroller::-webkit-scrollbar { display: none; }
}

/* =======================================================================
   TWEAKS PANEL — full-width bottom on md-down
   ======================================================================= */
@media (max-width: 720px) {
  .tweaks-panel {
    right: 12px; left: 12px; bottom: calc(12px + var(--sa-bottom));
    width: auto; max-height: 72dvh; overflow-y: auto;
  }
}

/* =======================================================================
   INPUT / TOUCH TARGET NORMALIZATION (md-down)
   ======================================================================= */
@media (max-width: 720px) {
  .input, .select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; min-height: 48px; }
  .btn-sm { min-height: 36px; padding: 8px 14px; }
  /* Form field label/input gap */
  .label { font-size: 13px; }
}

/* Horizontal scrollers gutter */
@media (max-width: 720px) {
  .scroll-x { margin: 0 -16px; padding: 0 16px 8px; }
}

/* =======================================================================
   TAB BARS — horizontal scroll with snap on md-down
   ======================================================================= */
.rwd-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .rwd-tabs {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 0 16px;
  }
  .rwd-tabs::-webkit-scrollbar { display: none; }
  .rwd-tabs > * { flex-shrink: 0; scroll-snap-align: start; min-height: 44px; }
}

/* =======================================================================
   Hide sparkle tweaks button on sm-down (keep in mobile nav panel)
   ======================================================================= */
@media (max-width: 480px) {
  .nav-right .btn-ghost[title="Style tweaks"] { display: none; }
}

/* === Dashboard === */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 40px 16px 96px; }
.dash-side { position: sticky; top: 96px; align-self: start; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 15px; color: var(--t-ink-muted); font-weight: 500;
  text-align: left; width: 100%;
  transition: all 0.15s;
}
.dash-nav-item:hover { background: color-mix(in srgb, var(--t-ink) 5%, transparent); color: var(--t-ink); }
.dash-nav-item.active { background: var(--trust); color: white; }
.dash-nav-item.active .badge-count { background: rgba(255,255,255,0.22); color: white; }

/* Mobile section picker (hidden on desktop; shown via media query) */
.dash-section-picker { display: none; position: relative; }
.dash-section-picker-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--t-paper);
  border: 1px solid var(--t-line);
  border-radius: 12px;
  color: var(--t-ink);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17,24,39,0.02);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-section-picker-trigger:hover { border-color: color-mix(in srgb, var(--t-ink) 16%, var(--t-line)); }
.dash-section-picker-trigger:focus-visible { outline: 2px solid var(--trust); outline-offset: 2px; }
.dash-section-picker-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--trust-bg); color: var(--trust-ink);
  flex-shrink: 0;
}
.dash-section-picker-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  z-index: 40;
  background: var(--t-paper);
  border: 1px solid var(--t-line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(17,24,39,0.12), 0 2px 6px rgba(17,24,39,0.06);
  display: flex; flex-direction: column; gap: 2px;
  animation: dash-picker-in 0.14s ease-out;
}
@keyframes dash-picker-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dash-section-picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--t-ink-muted);
  font: inherit; font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  text-align: left;
}
.dash-section-picker-item:hover { background: color-mix(in srgb, var(--t-ink) 5%, transparent); color: var(--t-ink); }
.dash-section-picker-item.active { background: var(--trust-bg); color: var(--trust-ink); font-weight: 600; }
.badge-count {
  margin-left: auto; background: var(--trust-soft); color: var(--trust-ink);
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; min-width: 22px; text-align: center;
}
.dash-header { margin-bottom: 24px; }
.dash-header h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.dash-header p { color: var(--t-ink-muted); font-size: 15px; }

/* Dashboard stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-tile {
  background: var(--t-paper); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); padding: 20px;
}
.stat-tile.trust-accent { background: linear-gradient(135deg, var(--trust-bg), var(--t-paper)); border-color: var(--trust-soft); }
.stat-label { font-size: 12px; color: var(--t-ink-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { font-size: 12px; color: var(--t-ink-muted); margin-top: 4px; }

/* Progress pipeline */
.pipeline {
  background: var(--t-paper); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 24px; margin-bottom: 24px;
}
.pipeline-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 16px; position: relative; }
.pipeline-step { text-align: center; position: relative; }
.pipeline-dot {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; background: var(--t-paper);
  border: 2px solid var(--t-line); color: var(--t-ink-muted);
  position: relative; z-index: 2; font-weight: 700; font-size: 13px;
}
.pipeline-step.done .pipeline-dot { background: var(--trust); color: white; border-color: var(--trust); }
.pipeline-step.current .pipeline-dot { background: var(--coral); color: white; border-color: var(--coral); box-shadow: 0 0 0 6px var(--coral-light); }
.pipeline-step + .pipeline-step::before {
  content: ''; position: absolute; left: -50%; right: 50%; top: 20px;
  height: 2px; background: var(--t-line); z-index: 1;
}
.pipeline-step.done + .pipeline-step::before,
.pipeline-step.current + .pipeline-step::before { background: var(--trust); }
.pipeline-label { font-size: 12px; font-weight: 600; color: var(--t-ink); }
.pipeline-sub { font-size: 11px; color: var(--t-ink-muted); margin-top: 2px; }

/* === Inbox === */
.inbox-shell {
  display: grid; grid-template-columns: 340px 1fr;
  height: calc(100vh - 72px);
  background: var(--t-paper);
}
@media (max-width: 960px) {
  .inbox-shell { grid-template-columns: 1fr; height: calc(100dvh - 64px); }
}
.inbox-side {
  border-right: 1px solid var(--t-line);
  overflow-y: auto; background: var(--t-paper);
}
.inbox-search {
  padding: 16px; border-bottom: 1px solid var(--t-line);
  position: sticky; top: 0; background: var(--t-paper); z-index: 2;
}
.inbox-item {
  display: flex; gap: 12px; padding: 16px;
  border-bottom: 1px solid var(--t-line);
  cursor: pointer; transition: background 0.1s;
  align-items: flex-start;
}
.inbox-item:hover { background: color-mix(in srgb, var(--t-ink) 3%, transparent); }
.inbox-item.active { background: var(--trust-bg); border-left: 3px solid var(--trust); padding-left: 13px; }
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inbox-item-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-time { font-size: 11px; color: var(--t-ink-muted); flex-shrink: 0; }
.inbox-item-preview {
  font-size: 13px; color: var(--t-ink-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.inbox-item.unread .inbox-item-name { font-weight: 700; }
.inbox-item.unread .inbox-item-preview { color: var(--t-ink); font-weight: 500; }
.inbox-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex-shrink: 0; margin-top: 6px; }

.thread {
  display: flex; flex-direction: column; height: 100%;
  background: var(--t-bg);
}
.thread-header {
  padding: 16px 24px; background: var(--t-paper);
  border-bottom: 1px solid var(--t-line);
  display: flex; align-items: center; gap: 14px;
}
.thread-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.msg { max-width: 560px; display: flex; gap: 10px; }
.msg-bubble {
  padding: 12px 16px; border-radius: 18px;
  font-size: 14px; line-height: 1.55;
}
.msg.them .msg-bubble { background: var(--t-paper); border: 1px solid var(--t-line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .msg-bubble { background: var(--trust); color: white; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 11px; color: var(--t-ink-muted); margin-top: 4px; padding: 0 4px; }
.msg-day {
  align-self: center; font-size: 11px; font-weight: 600;
  color: var(--t-ink-muted); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 12px; background: var(--t-paper); border: 1px solid var(--t-line); border-radius: 99px;
}
.thread-composer {
  padding: 16px 24px; background: var(--t-paper);
  border-top: 1px solid var(--t-line);
  display: flex; gap: 10px; align-items: flex-end;
}
.thread-composer textarea {
  flex: 1; border: 1.5px solid var(--t-line); border-radius: 20px;
  padding: 10px 16px; resize: none; background: var(--t-paper); font-family: inherit;
  font-size: 14px; min-height: 40px; max-height: 120px;
}
.thread-composer textarea:focus { outline: none; border-color: var(--trust); }

/* Context panel inside thread */
.thread-context {
  background: var(--trust-bg);
  border: 1px solid var(--trust-soft);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
}

/* =======================================================================
   FILTERS — desktop sticky sidebar → mobile drawer
   Used by CandidatesPage (.helpers-*) and JobsPage (.jobs-*)
   ======================================================================= */
.helpers-mobile-filters-btn, .jobs-mobile-filters-btn { display: none; }
.helpers-sidebar, .jobs-sidebar { position: sticky; top: 90px; align-self: flex-start; }
.helpers-sidebar > .helpers-sidebar-scrim,
.jobs-sidebar > .jobs-sidebar-scrim { display: none; }
.helpers-sidebar-close, .jobs-sidebar-close { display: none; }
.helpers-sidebar-actions, .jobs-sidebar-actions { display: none; }
.helpers-sidebar-panel, .jobs-sidebar-panel {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

/* Desktop: strip the card chrome so filters blend into the page */
@media (min-width: 961px) {
  .helpers-sidebar-panel, .jobs-sidebar-panel {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 4px 20px 4px 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 960px) {
  .helpers-mobile-filters-btn, .jobs-mobile-filters-btn { display: inline-flex; }
  .helpers-layout, .jobs-layout { grid-template-columns: 1fr !important; }

  /* Sidebar becomes a bottom-anchored drawer, hidden by default */
  .helpers-sidebar, .jobs-sidebar {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100dvh;
    z-index: 200;
    pointer-events: none;
  }
  .helpers-sidebar.open, .jobs-sidebar.open {
    pointer-events: auto;
  }

  /* Scrim */
  .helpers-sidebar-scrim, .jobs-sidebar-scrim {
    display: block !important;
    position: absolute; inset: 0; background: rgba(20, 14, 10, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .helpers-sidebar.open .helpers-sidebar-scrim,
  .jobs-sidebar.open .jobs-sidebar-scrim { opacity: 1; }

  /* Drawer panel slides up from bottom */
  .helpers-sidebar-panel, .jobs-sidebar-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 88dvh; overflow-y: auto;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 72px; /* room for sticky actions */
  }
  .helpers-sidebar.open .helpers-sidebar-panel,
  .jobs-sidebar.open .jobs-sidebar-panel {
    transform: translateY(0);
  }
  /* Drawer panel visual chrome */
  .helpers-sidebar-panel, .jobs-sidebar-panel {
    background: var(--t-paper);
    box-shadow: 0 -12px 40px rgba(0,0,0,0.2);
    padding: 20px 20px calc(90px + var(--sa-bottom)) !important;
  }

  /* Grab-handle top indicator */
  .helpers-sidebar-panel::before, .jobs-sidebar-panel::before {
    content: ''; display: block; width: 44px; height: 4px;
    background: var(--t-line); border-radius: 99px;
    margin: -6px auto 12px;
  }

  .helpers-sidebar-close, .jobs-sidebar-close { display: inline-flex; }

  /* Sticky bottom actions bar inside the drawer */
  .helpers-sidebar-actions, .jobs-sidebar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1.4fr; gap: 10px;
    position: sticky; bottom: 0; left: 0; right: 0;
    margin: 16px -20px calc(-1 * (90px + var(--sa-bottom)));
    padding: 14px 20px calc(14px + var(--sa-bottom));
    background: var(--t-paper);
    border-top: 1px solid var(--t-line);
  }
}
