/* Workforce Monitor — a full-screen atlas with floating glass instruments.
   One system: paper surfaces, ink text, a green<->pink diverging pair for
   "percentage of jobs vs the U.S." and a single blue ramp for unemployment. */

:root {
  color-scheme: light;
  --page: #1f1e1e;   /* near-black outside the U.S. */
  --marker: #d6ce76; /* round MSA markers */
  --marker-edge: #b3aa66;
  --paper: #fcfcfb;
  --land: #fbfaf6;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --rule: #c3c2b7;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(11, 11, 11, 0.09);
  --shadow: 0 18px 50px rgba(20, 20, 15, 0.12), 0 2px 6px rgba(20, 20, 15, 0.06);
  --green: #148f62;
  --green-deep: #0e6b49;
  --pink: #d4417f;
  --pink-deep: #a92a60;
  --pink-soft: rgba(212, 65, 127, 0.1);
  --neutral: #b5b3ab;
  --blue: #2a78d6;
  --sans: "Source Code Pro", "Source Code Variable", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
::selection { background: var(--pink-soft); }

/* ---------- stage ---------- */
.stage { position: fixed; inset: 0; left: 372px; }
.zoom-layer { will-change: transform; }
#map { width: 100%; height: 100%; display: block; cursor: grab; }
#map:active { cursor: grabbing; }

.state { fill: var(--land); stroke: #b9b3a8; stroke-width: 0.75; vector-effect: non-scaling-stroke; transition: fill 0.35s; }
.state:hover { fill: #f1efe6; }
.state.is-selected { stroke: var(--ink); stroke-width: 1.4; fill: #efede3; }
.state-label { font-family: var(--sans); font-size: 7.5px; font-weight: 600; letter-spacing: 0.14em; fill: #cfc7b6; text-anchor: middle; pointer-events: none; }
.nation-outline { fill: none; stroke: var(--ink); stroke-width: 0.8; vector-effect: non-scaling-stroke; opacity: 0.6; pointer-events: none; }

.footprint { fill: rgba(11, 11, 11, 0.045); stroke: rgba(11, 11, 11, 0.32); stroke-width: 0.6; vector-effect: non-scaling-stroke; pointer-events: none; transition: fill 0.3s, stroke 0.3s; }
.footprint.is-selected { fill: var(--pink-soft); stroke: var(--pink-deep); stroke-width: 1.2; }
.footprint.is-dim { fill: rgba(11, 11, 11, 0.02); stroke: rgba(11, 11, 11, 0.15); }

.glyph { cursor: pointer; outline: none; }
.glyph .core { fill: var(--ink); stroke: var(--paper); stroke-width: 1.2; }
.glyph circle.core { fill: var(--marker); stroke: var(--marker-edge); stroke-width: 1.2; }
.glyph .halo { fill: none; stroke: var(--ink); stroke-width: 0.9; opacity: 0; }
.glyph .hit { fill: transparent; }
.glyph.is-selected .halo, .glyph:focus-visible .halo, .glyph:hover .halo { opacity: 0.85; }
.glyph.is-dim { opacity: 0.22; }
.glyph.no-industry .ring { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3; }
.glyph-label { font-family: var(--sans); font-size: 8.5px; font-weight: 500; fill: var(--ink-2); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--land); stroke-width: 2.5px; stroke-linejoin: round; }

.udot { stroke: var(--paper); stroke-width: 1.2; cursor: pointer; }
.udot.is-selected, .udot:hover { stroke: var(--ink); }

/* ---------- glass instruments ---------- */
.hud {
  position: fixed;
  z-index: 5;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.left-stack { position: fixed; z-index: 6; top: 22px; left: 22px; width: 330px; display: flex; flex-direction: column; gap: 12px; }
.left-stack .hud { position: static; }
.hud-masthead { padding: 20px 22px 16px; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { font-size: 23px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.logo { flex: 0 0 auto; height: 54px; width: auto; display: block; }
.wordmark span { font-weight: 400; }
.release { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 10px; }
.release-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; font-weight: 600; white-space: nowrap; }
.release-month { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.foot { position: fixed; z-index: 4; left: 372px; right: 0; bottom: 0; padding: 8px 90px 8px 24px; font-size: 10.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.55); text-align: center; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nation-stat { display: flex; justify-content: space-between; align-items: baseline; width: 100%; margin-top: 14px; padding: 0 2px; background: none; border: 0; cursor: pointer; text-align: left; }
.nation-stat:hover .nation-open { color: var(--ink); }
.nation-label { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.nation-open { font-size: 11px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { padding: 10px 12px; background: rgba(11, 11, 11, 0.035); border-radius: 12px; min-width: 0; }
.kpi dt { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.kpi dd { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; white-space: nowrap; }
.kpi dd small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi .kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.kpi .kpi-delta { display: block; font-size: 11px; margin-top: 4px; color: var(--ink-2); }
.kpi .kpi-delta b { font-weight: 600; color: var(--ink); }
.kpi .kpi-delta b.up { color: var(--green-deep); }   /* positive change: green */
.kpi .kpi-delta b.down { color: var(--pink-deep); }   /* negative change: pink */
.updated { margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.updated b { font-weight: 600; color: var(--ink-2); }
.updated.is-sample { color: var(--pink-deep); font-weight: 600; }

/* toolbar floating over the map */
.hud-toolbar { padding: 12px 14px; }
.filters { display: flex; gap: 4px; padding: 3px; background: rgba(11, 11, 11, 0.06); border-radius: 99px; }
.lens-btn { flex: 1; border: 0; background: transparent; border-radius: 99px; padding: 7px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.lens-btn:hover { color: var(--ink); }
.lens-btn.is-active { background: var(--ink); color: #fff; }
.search-wrap { position: relative; margin-top: 8px; }
.search { width: 100%; padding: 8px 14px; font: inherit; font-size: 13px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--glass-border); border-radius: 99px; color: var(--ink); }
.search::placeholder { color: var(--muted); }
.search:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.search-results { position: absolute; left: 0; top: calc(100% + 8px); list-style: none; padding: 6px; margin: 0; background: #fff; border: 1px solid var(--glass-border); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; z-index: 6; width: 340px; }
.search-results button { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; font-size: 13px; }
.search-results button:hover, .search-results button:focus-visible { background: rgba(11, 11, 11, 0.06); outline: none; }
.search-results .sub { display: block; font-size: 11px; color: var(--muted); }
.search-results .kind { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }

.hud-legend { left: 22px; bottom: 22px; width: 330px; padding: 16px 20px 14px; }
.legend-title { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.legend-key svg { display: block; overflow: visible; }
.legend-key text { font-family: var(--sans); font-size: 8.5px; fill: var(--ink-2); }
.legend-note { font-size: 11px; color: var(--ink-2); line-height: 1.45; margin-top: 6px; }
.legend-note b { font-weight: 600; color: var(--ink); }
.legend-ramp { height: 8px; border-radius: 4px; margin: 6px 0 4px; }
.legend-ramp-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.legend-ring { display: inline-block; width: 9px; height: 9px; border: 1.2px solid var(--ink); border-radius: 50%; vertical-align: -1px; margin-right: 4px; background: var(--paper); }
.legend-cap { display: inline-block; width: 8px; height: 8px; background: var(--ink); vertical-align: -1px; margin: 0 5px 0 2px; transform: rotate(45deg); }

.hud-zoom { right: 22px; bottom: 22px; display: flex; flex-direction: column; padding: 4px; background: rgba(255, 255, 255, 0.9); }
.zoom-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 10px; font-size: 18px; cursor: pointer; color: var(--ink); }
.zoom-btn:hover { background: rgba(11, 11, 11, 0.07); }
.zoom-reset { font-size: 15px; }

/* ---------- drawer ---------- */
.drawer {
  position: fixed; z-index: 7; top: 22px; right: 22px; bottom: 22px; width: 500px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--shadow);
  transform: translateX(calc(100% + 30px)); opacity: 0; visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, visibility 0s 0.45s;
}
.drawer.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(11, 11, 11, 0.06); font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; }
.drawer-close:hover { background: rgba(11, 11, 11, 0.12); }
.drawer-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 26px 26px 30px; scrollbar-width: thin; }

.d-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 40px; }
.d-tag { display: inline-block; padding: 5px 10px; background: var(--ink); color: #fff; border-radius: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.d-tag-geo { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.d-name { font-size: 23px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; margin-top: 12px; padding-right: 36px; }
.d-geo { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }
.d-geo b { color: var(--ink); font-weight: 600; }
.d-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

.d-section { margin-top: 24px; }
.d-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 12px; }
.d-section-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.d-section-sub { font-size: 11px; color: var(--muted); }
.view-toggle { display: inline-flex; gap: 2px; padding: 2px; background: rgba(11, 11, 11, 0.06); border-radius: 99px; }
.view-toggle button { border: 0; background: transparent; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.view-toggle button.is-active { background: var(--ink); color: #fff; }

.rose-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.petal { stroke: var(--paper); stroke-width: 2; cursor: pointer; transition: opacity 0.2s; }
.petal.is-dim { opacity: 0.3; }
.rose-ref { fill: none; stroke: var(--ink); stroke-width: 1.6; pointer-events: none; }
.rose-spoke { stroke: var(--hairline); stroke-width: 1; }
.rose-ring { fill: none; stroke: var(--hairline); stroke-width: 1; }
.rose-ring-label { font-family: var(--sans); font-size: 10px; fill: var(--muted); }
.rose-label { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--ink); }
.rose-label.is-lead { fill: var(--pink-deep); }
.rose-value { font-family: var(--sans); font-size: 10px; font-weight: 500; fill: var(--ink-2); }
.rose-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.rose-legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--ink); vertical-align: 3px; margin-right: 4px; }
.rose-note { font-size: 12.5px; color: var(--ink-2); padding: 10px 0; }

.ind-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ind-table th { text-align: right; font-weight: 600; font-size: 10.5px; color: var(--muted); padding: 4px 0 6px; border-bottom: 1px solid var(--rule); letter-spacing: 0.04em; }
.ind-table th:first-child, .ind-table td:first-child { text-align: left; }
.ind-table th + th, .ind-table td + td { padding-left: 12px; white-space: nowrap; }
.ind-table td { padding: 5px 0; border-bottom: 1px solid var(--hairline); text-align: right; font-variant-numeric: tabular-nums; }
.ind-table td:first-child { padding-right: 8px; }
.ind-table .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: -0.5px; }
.ind-table tfoot td { color: var(--muted); border-bottom: 0; }

/* dominant-sector highlight */
.dominant { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--pink-soft); border-left: 4px solid var(--pink); }
.dominant-largest { background: rgba(11, 11, 11, 0.045); border-left-color: var(--ink); }
.dominant-largest .dom-label { color: var(--ink-2); }
.dom-none { color: var(--muted); }
.dom-label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pink-deep); font-weight: 700; }
.dom-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.dom-stat { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.dom-stat b { color: var(--ink); font-weight: 600; }
.dom-bars { margin-top: 10px; display: grid; grid-template-columns: 52px 1fr 46px; row-gap: 5px; column-gap: 8px; align-items: center; font-size: 11px; color: var(--ink-2); }
.dom-bars .bar { height: 8px; border-radius: 4px; background: var(--pink); }
.dom-bars .bar.us { background: var(--neutral); }
.dom-bars .val { text-align: right; font-variant-numeric: tabular-nums; }
.dom-second { font-size: 12px; color: var(--ink-2); margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(11, 11, 11, 0.1); }
.dom-second b { color: var(--ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-inline { margin-top: 12px; }
.chips-label { display: block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.chip { border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.7); border-radius: 99px; padding: 5px 11px; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip b { font-weight: 600; }
.chip .cap { color: var(--muted); font-size: 10.5px; margin-left: 4px; }

.d-foot { margin-top: 24px; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* unemployment + earnings pop-outs */
.trend-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { font-family: var(--sans); font-size: 10px; fill: var(--muted); }
.axis line { stroke: var(--hairline); }
.axis path { display: none; }
.trend-sel { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-nat { fill: none; stroke: var(--neutral); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-end { font-family: var(--sans); font-size: 10.5px; font-weight: 600; fill: var(--ink-2); }
.trend-end.nat { fill: var(--muted); font-weight: 500; }
.crosshair { stroke: var(--rule); stroke-width: 1; pointer-events: none; }
.trend-hit { fill: transparent; cursor: crosshair; }
.standing { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(11, 11, 11, 0.045); }
.standing .dom-label { color: var(--ink-2); }
.standing p { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.standing p b { color: var(--ink); font-weight: 600; }
.rank-strip { position: relative; height: 10px; border-radius: 5px; margin: 10px 0 4px; background: linear-gradient(to right, var(--green), var(--neutral), var(--pink)); }
.rank-strip i { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; background: var(--ink); border-radius: 2px; }
.rank-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.burst-spoke { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.burst-spoke-faint { stroke: var(--hairline); stroke-width: 1; }
.burst-tip { stroke: var(--paper); stroke-width: 1.5; cursor: pointer; }
.burst-us { stroke: var(--ink); stroke-width: 1.6; }
.burst-avg { fill: none; stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.7; }
.burst-avg-label { fill: var(--ink-2); }
.rose-legend b { font-weight: 600; color: var(--ink-2); }
.bars { display: grid; grid-template-columns: 150px 1fr 54px 52px; gap: 6px 8px; align-items: center; font-size: 11.5px; }
.bars .name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .name.is-total { color: var(--ink); font-weight: 600; }
.bars .track { position: relative; height: 10px; }
.bars .bar { position: absolute; left: 0; top: 0; height: 10px; border-radius: 0 4px 4px 0; background: var(--marker); border: 1px solid var(--marker-edge); }
.bars .bar.is-total { background: var(--ink); border-color: var(--ink); }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; }
.bars .chg { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bars .chg.up { color: var(--green-deep); }
.bars .chg.down { color: var(--pink-deep); }
.metro-rates { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 12px; }
.metro-rates button { text-align: left; border: 0; background: none; padding: 3px 0; cursor: pointer; border-bottom: 1px solid var(--hairline); }
.metro-rates button:hover { color: var(--pink-deep); }
.metro-rates .v { font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--hairline); padding: 3px 0; }

/* ---------- tooltip & boot ---------- */
.tip { position: fixed; z-index: 9; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4; padding: 10px 14px 12px; border-radius: 10px; max-width: 440px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.tip b { font-weight: 600; font-size: 13px; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; }
.tip .muted { color: rgba(255, 255, 255, 0.65); }
.tip i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.tip-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; margin-top: 10px; align-items: end; min-width: 300px; }
.tip-figs .fig { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.tip-figs .fig small { font-size: 12px; font-weight: 500; opacity: 0.7; }
.tip-figs .fig-text { font-size: 15px; line-height: 1.15; white-space: normal; max-width: 160px; }
.tip-figs .fig.up { color: #5fd3a3; }
.tip-figs .fig.down { color: #f08ab5; }
.tip-figs .lab { display: block; font-size: 10.5px; color: rgba(255, 255, 255, 0.65); margin-top: 4px; max-width: 160px; line-height: 1.3; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink); z-index: 3; pointer-events: none; }
.boot.is-error { color: var(--pink-deep); pointer-events: auto; padding: 40px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .state, .footprint, .glyph, .petal { transition: none !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .stage { left: 0; }
  .left-stack { width: calc(100% - 32px); left: 16px; top: 16px; gap: 8px; }
  .hud-masthead { padding: 14px 16px; }
  .wordmark { font-size: 24px; }
  .dek, .kpis-us { display: none; }
  .release { margin-top: 8px; padding: 6px 10px; }
  .release-month { font-size: 16px; }
  .hud-toolbar { padding: 8px 10px; }
  .foot { left: 0; padding: 6px 70px 6px 16px; }
  .search-results { width: 100%; }
  .hud-legend { display: none; }
  .hud-zoom { right: 16px; bottom: 16px; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 76vh; border-radius: 20px 20px 0 0; transform: translateY(110%); }
  .drawer-scroll { padding: 22px 18px 30px; }
  .kpis-3 { grid-template-columns: 1fr 1fr; }
}
