/* ─────────────────────────────────────────────────────────────
   Erika · Candidate Price Map (Results & benchmarks)
   Self-contained widget layer on top of /site.css: uses its :root tokens
   only (--ink, --mute, --paper, --line, --white, --f-*, --r-*).
   The role cards (.pm-grid / .pm-card) and tooltip (.pm-tip) are also
   embedded on industry pages, so keep these class names stable.
   ───────────────────────────────────────────────────────────── */

.pm, .pm-grid, .pm-tip, .pm-chart, .pm-geowrap {
  --accent: var(--g-blue);
  --pm-card: var(--white);
  --pm-line: var(--line);
  --pm-soft: rgba(13, 13, 12, .045);
}

/* ───────────────────────────  SHELL  ─────────────────────────── */
.pm-shell { padding-top: 56px; }
.pm-hero__meta { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 860px) { .pm-shell { padding-top: 40px; } }

/* ──────────────────────  HERO LINE CHART  ───────────────────── */
.pm-chart {
  margin: 0;
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  border-radius: 20px;
  padding: 28px 28px 16px;
}
.pm-chart__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.pm-chart__h {
  margin: 0 0 10px;
  font: 400 13px/1.4 var(--f-mono);
  letter-spacing: 0;
  color: var(--mute);
}
.pm-chart__readout { display: flex; flex-direction: column; min-width: 160px; }
.pm-readout__val {
  font: 400 var(--fs-metric)/1 var(--f-display);
  letter-spacing: -.03em;
  color: var(--ink);
}
.pm-readout__lbl { margin-top: 10px; font-size: 14px; color: var(--mute); }

/* Odometer roll for the readout value */
.pm-roll { display: inline-flex; align-items: flex-end; }
.pm-roll__s { display: inline-block; white-space: pre; }
.pm-roll__d { display: inline-block; height: 1em; line-height: 1; overflow: hidden; vertical-align: bottom; }
.pm-roll__strip { display: flex; flex-direction: column; transition: transform .45s var(--ease); will-change: transform; }
.pm-roll__n { display: block; height: 1em; line-height: 1; text-align: center; }

.pm-seg--time { align-self: flex-start; }

/* Body: role rail (left) + plot (right) */
.pm-chart__body { display: flex; gap: 24px; align-items: flex-start; }
.pm-rolerail {
  display: flex; flex-direction: column; gap: 2px;
  width: 240px; flex: 0 0 auto;
  overflow-y: auto;            /* max-height set in JS = chart height */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.pm-rolerail::-webkit-scrollbar { width: 6px; }
.pm-rolerail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.pm-role {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2);
  font: 500 14px/1.3 var(--f-body);
  text-align: left; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.pm-role:hover { background: var(--paper); color: var(--ink); }
.pm-role.is-active { background: var(--ink); color: var(--white); }
.pm-role.is-active .pm-role__val { color: rgba(252, 251, 249, .7); }
.pm-role__ic { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.pm-role__lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-role__val { font: 400 12px/1 var(--f-mono); color: var(--mute); }

.pm-chart__plot { flex: 1; min-width: 0; }
.pm-chart__plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.pm-chart__empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 240px; color: var(--mute); font-size: 15px; text-align: center;
}

/* SVG chart primitives */
.pm-c-grid { stroke: var(--pm-line); stroke-width: 1; }
.pm-c-ylab, .pm-c-xlab { font-family: var(--f-mono); font-size: 12px; fill: var(--mute); }
.pm-c-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.pm-cdot { stroke: rgba(252, 251, 249, .9); stroke-width: 1.4; opacity: .55; cursor: pointer; transition: opacity .12s; }
.pm-cdot:hover { opacity: 1; }
.pm-c-tagdot { fill: var(--accent); }
.pm-c-tagbg { fill: var(--ink); }
.pm-c-tagtx { fill: var(--white); font-family: var(--f-mono); font-weight: 500; font-size: 13px; }
.pm-c-crossline { stroke: rgba(13, 13, 12, .3); stroke-width: 1; stroke-dasharray: 3 3; }
.pm-c-crossdot { fill: var(--accent); stroke: var(--white); stroke-width: 2; }
.pm-c-hit { cursor: crosshair; }

@media (max-width: 760px) {
  .pm-chart { padding: 20px 16px 10px; }
  .pm-chart__body { flex-direction: column; }
  .pm-rolerail { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .pm-role { width: auto; padding: 6px 12px; border-color: var(--line); border-radius: var(--r-pill); background: var(--white); font-size: 13px; }
  .pm-role__val { display: none; }
}

/* ─────────────────────────  CONTROLS  ───────────────────────── */
.pm-controls {
  position: sticky; top: 76px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap;
  margin: 24px 0 0;
  padding: 10px 14px;
  background: rgba(252, 251, 249, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.pm-controls__group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-controls__label { font: 400 12px/1 var(--f-mono); color: var(--mute); }
.pm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pm-chip {
  font: 500 13px/1 var(--f-body);
  height: 32px; padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--white); color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.pm-chip:hover { border-color: var(--ink); color: var(--ink); }
.pm-chip.is-active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Segmented control (time range, sort, country) */
.pm-seg {
  display: inline-flex;
  background: var(--paper);
  border-radius: var(--r-pill);
  padding: 3px;
}
.pm-seg button {
  font: 500 13px/1 var(--f-body);
  border: 0; background: transparent; color: var(--ink-2);
  height: 30px; padding: 0 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.pm-seg button:hover { color: var(--ink); }
.pm-seg button.is-active { background: var(--ink); color: var(--white); }
@media (max-width: 760px) { .pm-controls { position: relative; top: auto; border-radius: var(--r-card); } }

/* ─────────────────────────  SECTIONS  ───────────────────────── */
.pm-section { padding-top: 96px; }
.pm-section__head { max-width: 760px; margin-bottom: 32px; }
.pm-section__head h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; }
.pm-section__head p { margin-top: 12px; color: var(--mute); font-size: var(--fs-lead); line-height: 1.6; }
.pm-section__head--row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; max-width: none;
}
@media (max-width: 860px) { .pm-section { padding-top: 64px; } }

/* ───────────────────────  MARKET CARDS  ─────────────────────── */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 16px;
}
/* Embedded on landing pages (industry + cz): a couple of role cards,
   centred and never stretched to fill the row. */
.pm-grid--embed {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 340px));
  justify-content: center;
  margin-top: 28px;
}
.pm-card {
  position: relative;
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  border-radius: var(--r-card);
  padding: 22px;
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
}
.pm-card:hover { border-color: rgba(13, 13, 12, .28); box-shadow: 0 12px 32px -18px rgba(13, 13, 12, .25); }
.pm-card.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pm-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pm-card__role { margin: 0; font: 500 17px/1.25 var(--f-display); letter-spacing: -.01em; }
.pm-card__ic { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.pm-card__price { display: flex; align-items: baseline; gap: 6px; margin: 20px 0 4px; }
.pm-card__price-num { font: 400 40px/1 var(--f-display); letter-spacing: -.03em; }
.pm-card__price-unit { font-size: 14px; color: var(--mute); }
.pm-card__median-tag { font: 400 12px/1.3 var(--f-mono); color: var(--eye); }

/* Range bar: quiet track (min → max, log scale), the P25–P75 band in ink,
   median as a ring marker. Same language as the .stats row: ink on paper. */
.pm-range { margin: 30px 0 6px; }
.pm-range__bar {
  position: relative; height: 4px; border-radius: 999px;
  background: rgba(13, 13, 12, .08);
}
.pm-range__fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--ink); opacity: .78; }
.pm-range__tick {
  position: absolute; top: 0; bottom: 0; width: 0;
  transform: translateX(-50%);
}
.pm-range__tick i {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  font: 400 10px/1 var(--f-mono); font-style: normal; letter-spacing: .04em; color: var(--mute); white-space: nowrap;
}
.pm-range__pt {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--white); border: 2px solid var(--ink);
  box-shadow: 0 0 0 3px var(--pm-card), 0 2px 6px rgba(13, 13, 12, .18);
  transition: left .25s var(--ease);
}
.pm-range__hit { position: absolute; left: 0; right: 0; top: -12px; bottom: -12px; cursor: crosshair; }
.pm-card--probing .pm-card__median-tag { visibility: hidden; }
.pm-card--probing .pm-range__pt { transition: none; }
.pm-range__labels {
  display: flex; justify-content: space-between; margin-top: 10px;
  font: 400 12px/1 var(--f-mono); color: var(--mute);
}
.pm-card__meta { display: flex; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--pm-line); }
.pm-card__meta div { display: flex; flex-direction: column; gap: 3px; }
.pm-card__meta b { font: 500 15px/1.2 var(--f-mono); }
.pm-card__meta span { font: 400 11px/1.2 var(--f-mono); color: var(--mute); }
.pm-card__flags { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pm-flag {
  font: 400 11px/1 var(--f-mono);
  padding: 5px 8px; border-radius: 6px;
  background: var(--paper); color: var(--ink-2);
}
.pm-flag--small { background: rgba(10, 79, 208, .08); color: var(--g-blue); }

/* ─────────────────────────  HEATMAP  ────────────────────────── */
.pm-heatwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pm-heat { display: grid; gap: 6px; min-width: 560px; }
.pm-heat__cell {
  border-radius: 10px; padding: 12px 10px; min-height: 56px;
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--pm-line);
}
.pm-heat__corner, .pm-heat__colhead, .pm-heat__rowhead { background: transparent; border: none; }
.pm-heat__colhead { font: 400 12px/1.2 var(--f-mono); text-align: center; align-items: center; min-height: 0; padding: 4px; }
.pm-heat__rowhead { font-size: 14px; font-weight: 500; justify-content: center; padding-right: 12px; min-height: 0; }
.pm-heat__val { font: 500 15px/1 var(--f-mono); }
.pm-heat__sub { font: 400 11px/1 var(--f-mono); opacity: .7; margin-top: 4px; }
.pm-heat__cell--data { cursor: pointer; transition: box-shadow .12s; }
.pm-heat__cell--data:hover { box-shadow: 0 6px 18px rgba(13, 13, 12, .18); z-index: 2; }
.pm-heat__cell--empty { background: var(--paper); color: var(--eye); }

.pm-legend { display: flex; align-items: center; gap: 10px; margin-top: 16px; font: 400 12px/1 var(--f-mono); color: var(--mute); }
.pm-legend__bar {
  width: 160px; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, hsl(152 55% 42%), hsl(48 85% 50%), hsl(8 70% 52%));
}

/* ─────────────────────────  GEO MAP  ────────────────────────── */
.pm-seg--geo { flex: 0 0 auto; }
.pm-geowrap {
  display: flex; gap: 24px; align-items: stretch;
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  border-radius: 20px;
  padding: 24px;
}
.pm-geo { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.pm-geo svg { width: 100%; height: auto; max-height: 520px; display: block; overflow: visible; }
.pm-geo__land { fill: var(--paper); stroke: rgba(13, 13, 12, .22); stroke-width: 1.2; stroke-linejoin: round; }
.pm-geo__dot { stroke: rgba(252, 251, 249, .9); stroke-width: 1.4; transition: opacity .12s; }
.pm-geo__pt { cursor: pointer; }
.pm-geo__pt:hover .pm-geo__dot { stroke-width: 2.4; }
.pm-geo__lab {
  font-family: var(--f-mono); font-size: 13px; font-weight: 500;
  fill: var(--ink); paint-order: stroke;
  stroke: var(--white); stroke-width: 3.5px; stroke-linejoin: round;
}
.pm-geo__side { flex: 0 0 240px; display: flex; flex-direction: column; gap: 2px; align-self: center; }
.pm-geo__sidehead { font: 400 12px/1.3 var(--f-mono); color: var(--mute); margin: 0 0 8px 10px; }
.pm-geo__row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2); font-family: inherit;
  text-align: left; cursor: pointer; transition: background-color .15s;
}
.pm-geo__row:hover { background: var(--paper); }
.pm-geo__rowdot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(13, 13, 12, .1); }
.pm-geo__rowcity { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-geo__rowval { font: 400 12.5px/1 var(--f-mono); color: var(--mute); }
@media (max-width: 760px) {
  .pm-geowrap { flex-direction: column; padding: 16px; }
  .pm-geo__side { flex-basis: auto; width: 100%; }
}

/* ───────────────────────  METHODOLOGY  ──────────────────────── */
.pm-method { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); list-style: none; margin: 0; padding: 0; }
.pm-method li { padding: 24px 24px 0 0; font-size: 15px; line-height: 1.6; color: var(--mute); }
.pm-method li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.pm-method strong { display: block; margin-bottom: 6px; font: 500 17px/1.3 var(--f-display); color: var(--ink); }
@media (max-width: 1100px) {
  .pm-method { grid-template-columns: 1fr 1fr; }
  .pm-method li:nth-child(3) { padding-left: 0; border-left: 0; }
  .pm-method li:nth-child(n+3) { margin-top: 24px; border-top: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .pm-method { grid-template-columns: 1fr; }
  .pm-method li, .pm-method li + li { padding: 20px 0; border-left: 0; margin-top: 0; }
  .pm-method li + li { border-top: 1px solid var(--line); }
}

/* ─────────────────  CTA band: work-email lead form  ─────────────── */
.pm-cta p.pm-cta__sub { max-width: 560px; margin: 20px auto 0; font-size: var(--fs-lead); line-height: 1.6; color: rgba(252, 251, 249, .9); }
.pm-cta .lead-form { max-width: 520px; margin: 36px auto 0; }
.lead-form__row { display: flex; gap: 10px; }
.lead-form__input {
  flex: 1; min-width: 0; height: 47px; padding: 0 20px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--white); color: var(--ink);
  font: 400 16px/1 var(--f-body);
}
.lead-form__input::placeholder { color: var(--eye); }
.lead-form__input:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.lead-form__msg.is-err { font-weight: 600; }
.lead-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lead-form__consent {
  display: flex; gap: 10px; align-items: flex-start; justify-content: center;
  margin-top: 16px; font-size: 14px; line-height: 1.5; color: rgba(252, 251, 249, .9); text-align: left;
}
.lead-form__consent input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--ink); }
.lead-form__consent a { color: inherit; }
.lead-form__msg { margin-top: 14px; font-size: 15px; color: var(--white); }
.pm-cta .cta__a { margin-top: 28px; }
@media (max-width: 620px) {
  .lead-form__row { flex-direction: column; }
  .lead-form__input { flex: none; width: 100%; }
  .lead-form__row .wbtn { width: 100%; }
}

/* ─────────────────────────  TOOLTIP  ────────────────────────── */
.pm-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--white);
  border-radius: 12px; padding: 10px 13px;
  font: 400 13px/1.4 var(--f-body);
  max-width: 240px;
  box-shadow: 0 14px 34px -10px rgba(13, 13, 12, .45);
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity .1s;
}
.pm-tip__role { font-weight: 600; }
.pm-tip__price { font: 500 16px/1.3 var(--f-mono); margin: 2px 0; }
.pm-tip__meta { opacity: .75; font-size: 12px; }
.pm-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}

/* Reveal-on-scroll for cards (JS adds .in) */
.pm-card, .pm-stat { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .pm-reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  .pm-reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-roll__strip, .pm-range__pt { transition: none; }
}
