:root {
  --color-background: #fffdfb;
  --color-surface: #ffffff;
  --color-surface-soft: #f7f5f2;
  --color-text: #171717;
  --color-muted: #68645f;
  --color-accent: #7c3aed;
  --color-accent-dark: #6d28d9;
  --color-accent-soft: #f3eefe;
  --color-border: #e7e3df;
  --color-map: #dfe8e4;
  --shadow-soft: 0 12px 35px rgba(42, 31, 24, .12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--color-background); color: var(--color-text); font-family: var(--font-body); }
body { font-size: 15px; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--color-text); color: white; padding: 10px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(239, 91, 91, .55); outline-offset: 3px; }

.site-header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--color-border); background: rgba(255,253,251,.95); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 760; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--color-accent); color: white; font-size: 16px; letter-spacing: -.05em; }
.main-nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 34px); font-size: 14px; font-weight: 600; }
.main-nav a:not(.header-cta) { text-decoration: none; color: var(--color-muted); }
.main-nav a:not(.header-cta):hover { color: var(--color-text); }
.header-cta { padding: 11px 16px; border-radius: var(--radius-sm); background: var(--color-accent); color: white; text-decoration: none; }
.header-cta:hover, .search-button:hover, .view-job:hover { background: var(--color-accent-dark); }

.app-shell { display: flex; flex-direction: column; height: calc(100dvh - 119px); min-height: 0; }
.map-toolbar { position: relative; z-index: 5; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 15px 0 10px; }
.toolbar-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.eyebrow { margin: 0 0 7px; color: var(--color-accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 31px); line-height: 1; letter-spacing: -.055em; }
.map-count { margin: 0 0 4px; color: var(--color-muted); font-size: 13px; }
.search-grid { display: grid; grid-template-columns: 1.15fr 1fr auto; gap: 8px; }
.search-field { display: flex; align-items: center; height: 44px; min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: 0 2px 8px rgba(20,20,20,.03); }
.search-icon { margin: 0 12px 0 16px; color: var(--color-muted); font-size: 24px; line-height: 1; transform: rotate(-15deg); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--color-text); }
.search-field input::placeholder { color: #98928c; }
.search-button { height: 44px; padding: 0 18px; border: 0; border-radius: 7px; background: var(--color-accent); color: white; cursor: pointer; font-size: 13px; font-weight: 750; }
.search-button:disabled { opacity: .65; cursor: wait; }
.search-status { min-height: 17px; margin: 5px 0 0; color: var(--color-muted); font-size: 12px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 3px; }
.filter-label { margin-right: 3px; color: var(--color-muted); font-size: 12px; font-weight: 700; }
.filter-chip { border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 7px 12px; background: var(--color-surface); color: var(--color-muted); cursor: pointer; font-size: 12px; font-weight: 650; }
.filter-chip:hover { border-color: #c9c2bc; color: var(--color-text); }
.filter-chip.is-active { border-color: var(--color-text); background: var(--color-text); color: white; }
.filter-toggle { margin-left: auto; }
.filter-toggle span { font-size: 15px; vertical-align: -1px; }
.remote-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: 5px; color: var(--color-muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.remote-toggle input { accent-color: var(--color-accent); }
.remote-list-button { border: 0; padding: 7px 9px; background: transparent; color: var(--color-accent-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.remote-list-button:hover { text-decoration: underline; }
.advanced-filters { display: flex; gap: 10px; padding-top: 12px; }
.advanced-filters label { display: flex; align-items: center; gap: 8px; color: var(--color-muted); font-size: 12px; font-weight: 650; }
.advanced-filters select { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 7px 25px 7px 9px; background: white; color: var(--color-text); }

.map-stage { position: relative; flex: 1; min-height: 0; margin: 0 16px; overflow: hidden; border-radius: 16px 16px 0 0; background: var(--color-map); box-shadow: var(--shadow-soft); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--color-map); }
.local-map-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.local-map-svg:active { cursor: grabbing; }
.local-map-ocean { fill: #edf3f1; }
.local-map-grid { opacity: .5; }
.local-map-land { fill: #d2ddd9; stroke: #b8c8c3; stroke-width: 1.2; vector-effect: non-scaling-stroke; fill-rule: evenodd; }
.local-map-country { fill: #d2ddd9; stroke: #aebfba; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.local-map-country:hover { fill: #c6d5d1; }
.local-map-markers { pointer-events: none; }
.local-map-marker { pointer-events: auto; cursor: pointer; outline: none; }
.local-map-marker:focus circle, .local-map-marker:focus rect, .local-map-marker:focus polygon { stroke: #171717; stroke-width: 3; }
.local-map-controls { position: absolute; top: 18px; right: 18px; z-index: 500; display: flex; flex-direction: column; box-shadow: var(--shadow-soft); }
.local-map-controls button { width: 36px; height: 34px; border: 0; border-bottom: 1px solid var(--color-border); background: rgba(255,255,255,.95); color: var(--color-text); cursor: pointer; font-size: 22px; line-height: 1; }
.local-map-controls button:first-child { border-radius: 8px 8px 0 0; }
.local-map-controls button:last-child { border-bottom: 0; border-radius: 0 0 8px 8px; }
.local-map-controls button:hover { background: white; }
.local-pin circle, .local-pin rect, .local-pin polygon { fill: #dc2626; stroke: white; stroke-width: 2; vector-effect: non-scaling-stroke; animation: local-pulse 1.8s ease-out infinite; }
.local-pin-hybrid circle, .local-pin-hybrid rect, .local-pin-hybrid polygon { fill: #7c3aed; }
.local-pin-approximate circle, .local-pin-approximate rect, .local-pin-approximate polygon { stroke-dasharray: 4 3; }
.local-cluster circle, .local-cluster rect, .local-cluster polygon { fill: #4b5563; stroke: white; stroke-width: 3; vector-effect: non-scaling-stroke; }
.local-cluster text { fill: white; font: 700 13px var(--font-body); pointer-events: none; }
@keyframes local-pulse { 0% { opacity: 1; } 70% { opacity: .58; } 100% { opacity: 1; } }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(70, 70, 80, .16); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: #4b5563; color: white; font-weight: 750; }
.map-legend, .locate-button, .map-attribution { position: absolute; z-index: 500; }
.map-legend { left: 18px; bottom: 62px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid rgba(0,0,0,.07); border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-soft); color: var(--color-muted); font-size: 11px; font-weight: 600; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-accent); }
.legend-onsite { background: #dc2626; }
.legend-remote { background: #2563eb; }
.legend-hybrid { background: #7c3aed; }
.legend-approx { border: 2px dashed #4b5563; background: transparent; }
.legend-divider { width: 1px; height: 13px; background: var(--color-border); }
.locate-button { left: 18px; bottom: 18px; padding: 10px 13px; border: 1px solid rgba(0,0,0,.07); border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-soft); color: var(--color-text); cursor: pointer; font-size: 13px; font-weight: 700; }
.locate-button:hover { background: white; }
.map-attribution { right: 5px; bottom: 2px; color: #5b625e; font-size: 10px; }
.map-attribution a { color: inherit; }
.job-preview { position: absolute; top: 50%; right: 22px; z-index: 600; width: min(360px, calc(100% - 44px)); max-height: calc(100% - 44px); overflow: hidden auto; padding: 0 18px 18px; border: 1px solid rgba(0,0,0,.08); border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: var(--shadow-soft); transform: translateY(-50%); }
.preview-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0 10px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--color-border); }
.preview-actions { display: flex; align-items: center; gap: 8px; }
.preview-collapse { border: 0; padding: 5px 7px; border-radius: 6px; background: var(--color-surface-soft); color: var(--color-muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.preview-collapse:hover { color: var(--color-text); }
.job-preview.is-collapsed { max-height: none; overflow: hidden; padding-bottom: 0; }
.job-preview.is-collapsed .preview-tools, .job-preview.is-collapsed #preview-content { display: none; }
.preview-eyebrow { margin: 0 0 3px; color: var(--color-accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.preview-close { width: 27px; height: 27px; border: 0; border-radius: 50%; background: var(--color-surface-soft); color: var(--color-muted); cursor: pointer; font-size: 21px; line-height: 1; }
.preview-tools { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 9px 0 3px; color: var(--color-muted); font-size: 11px; }
.preview-tools select { border: 1px solid var(--color-border); border-radius: 6px; padding: 5px 7px; background: white; color: var(--color-text); font-size: 11px; }
.preview-kicker { margin: 0 0 10px; color: var(--color-accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.preview-result-count { margin: 0; color: var(--color-muted); font-size: 12px; font-weight: 750; }
.preview-job-card + .preview-job-card { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--color-border); }
.job-preview h2 { max-width: 290px; margin: 0 0 6px; font-size: 20px; line-height: 1.12; letter-spacing: -.04em; }
.preview-company { margin: 0 0 19px; color: var(--color-muted); font-size: 13px; font-weight: 650; }
.preview-details { margin: 0 0 21px; }
.preview-details div { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--color-border); }
.preview-details dt { color: var(--color-muted); font-size: 11px; font-weight: 700; }
.preview-details dd { margin: 0; font-size: 12px; font-weight: 650; }
.preview-job-card { cursor: pointer; }
.preview-job-card:focus-visible { outline: 3px solid rgba(124, 58, 237, .3); outline-offset: 4px; }
.view-job { display: inline-block; padding: 0; background: transparent; color: var(--color-accent-dark); text-decoration: underline; font-size: 12px; font-weight: 750; }
.view-job:hover { background: transparent; color: var(--color-text); }
.compact-job-card { padding: 10px 0; }
.compact-job-card + .compact-job-card { border-top: 1px solid var(--color-border); }
.compact-job-card h2 { font-size: 15px; }
.compact-job-card .preview-company { margin-bottom: 7px; }
.compact-job-card .preview-details { margin-bottom: 7px; }
.remote-results { position: absolute; left: 18px; top: 18px; z-index: 600; width: min(390px, calc(100% - 36px)); max-height: calc(100% - 36px); overflow: hidden auto; padding: 0 18px 15px; border: 1px solid rgba(0,0,0,.08); border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: var(--shadow-soft); }
.remote-results-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 15px 0 9px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--color-border); }
.remote-results h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.remote-results-header button { width: 27px; height: 27px; border: 0; border-radius: 50%; background: var(--color-surface-soft); color: var(--color-muted); cursor: pointer; font-size: 21px; }
.remote-results > p { margin: 9px 0; color: var(--color-muted); font-size: 11px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 17px clamp(20px, 4vw, 64px); color: var(--color-muted); font-size: 11px; }
.site-footer a { color: var(--color-text); font-weight: 650; text-decoration: none; }
.footer-note { margin-left: auto; }

@media (max-width: 700px) {
  .site-header { height: 62px; padding: 0 17px; }
  .main-nav { gap: 12px; font-size: 12px; }
  .main-nav a:not(.header-cta) { display: none; }
  .header-cta { padding: 9px 11px; }
  .map-toolbar { width: calc(100% - 24px); padding: 12px 0 8px; }
  .toolbar-heading { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 13px; }
  .map-count { margin: 0; }
  .search-grid { grid-template-columns: 1fr auto; }
  .search-field:first-child { grid-column: 1 / -1; }
  .search-button { padding: 0 13px; }
  .filter-row { gap: 6px; }
  .filter-label { width: auto; margin-bottom: 1px; }
  .filter-chip { padding: 7px 10px; }
  .filter-toggle { margin-left: 0; }
  .remote-toggle { margin-left: 0; }
  .app-shell { height: calc(100dvh - 101px); }
  .map-stage { min-height: 0; margin: 0; border-radius: 0; }
  .map-legend { left: 10px; bottom: 54px; }
  .locate-button { left: 10px; bottom: 10px; }
  .locate-button span { display: none; }
  .job-preview, .remote-results { top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: 72%; border-width: 1px 0 0; border-radius: 16px 16px 0 0; padding: 0 20px 20px; transform: none; }
  .preview-details { margin-bottom: 14px; }
  .site-footer { padding: 13px 16px; }
  .footer-note { display: none; }
}
