/* ── Tokyo job-market statistics ──────────────────────────────────────────
   A dense editorial/data page, still using the site's black canvas and orange
   rank accent. All values are server-baked in production; these rules avoid
   chart libraries so the page remains fast, accessible and dependency-free. */
.statistics-page {
  min-height: 100vh;
  background: #000;
}
.statistics-page * {
  font-family: "Darker Grotesque", sans-serif;
}
.stats-hero,
#statistics-content,
.stats-explore {
  width: calc(100% - 4rem);
  margin-inline: auto;
  box-sizing: border-box;
}
/* Data dashboards use the available canvas, including space reclaimed when
   the rail closes. Four rem leaves a deliberate two-rem gutter on each side. */
/* (.stats-site-header lived here — a handful of one-off header tweaks and the
   hook the phone rules used to exclude the statistics header from the shared
   ones. Both are gone: this page wears the same header as every other, out of
   styles/header.css, and pages/Statistics.jsx renders it OUTSIDE
   .statistics-page so the `*` font rule above cannot reach into it.) */
/* The page title, deliberately small. It was clamp(3.4rem, 7vw, 5.8rem) over a
   20rem-tall block, so a data page opened with a magazine cover and you scrolled
   PAST the title to reach a number. These pages are dashboards: the title says
   which one you are on and then gets out of the way. The header above already
   names the page and describes it, so this does not have to. */
.stats-hero {
  padding: 1.6rem 0 0.9rem;
}
.stats-hero-copy { max-width: 48rem; }
.stats-hero h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.stats-snapshot {
  padding: 0 0 0.4rem;
}
.stats-snapshot--footer {
  margin-top: 2.5rem;
  padding-bottom: 0;
}
.stats-snapshot--page-top {
  padding-top: 1.4rem;
  padding-bottom: 0;
}
.stats-snapshot--page-top + .stats-section {
  padding-top: 1rem;
}
.stats-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stats-kpis {
  display: grid;
  /* auto-fit, because a page states as many numbers as it has — the salary
     page keeps three and lets its floor-to-ceiling band be the fourth. */
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0;
  margin-top: 0;
  /* ONE rule under the strip. It used to be framed top and bottom in orange
     with a divider between every tile — five lines around four numbers. */
  border-bottom: 0.0625rem solid rgba(255,255,255,0.08);
}
.stats-kpi {
  padding: 0 1.35rem 0.95rem 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.stats-kpi span,
.stats-insight span,
.stats-salary-band span {
  color: rgba(255,255,255,0.68);
  font-family: "Nunito", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}
.stats-kpi > span { color: rgb(190, 190, 190); }
.stats-kpi > small { color: rgb(70, 70, 70); }
.stats-kpi strong {
  order: -1;
  margin: 0 0 0.4rem;
  color: var(--brand);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stats-kpi small,
.stats-datestamp {
  color: rgba(255,255,255,0.64);
  font-family: "Nunito", sans-serif;
  font-size: 0.68rem;
  line-height: 1.45;
}
.stats-datestamp { margin-top: 0.85rem; text-align: right; }
.stats-trend-status {
  margin-top: 0.7rem;
  color: rgba(255,255,255,0.68);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: right;
}
.stats-on-page,
.stats-downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin-top: 0.75rem;
  padding-top: 0;
  font-size: 0.8rem;
  font-weight: 700;
}
.stats-on-page span,
.stats-downloads span { color: rgba(255,255,255,0.68); }
.stats-on-page a,
.stats-downloads a { color: var(--brand); opacity: 0.85; }
.stats-on-page a:hover,
.stats-downloads a:hover { opacity: 1; }
.stats-downloads { margin-top: 0.55rem; padding-top: 0; border-top: 0; }
.stats-kpis--trends .stats-kpi strong { color: white; }
.stats-trend-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0 1.5rem;
}
.stats-trend-skills > div {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-bottom: 0.0625rem solid rgba(255,255,255,0.18);
  font-size: 0.85rem;
}
.stats-trend-skills a { color: white; }
.stats-trend-skills a:hover { color: var(--brand); }
.stats-trend-skills strong { color: var(--brand); }
/* Sections are separated by SPACE, not by a rule. Each page carries two or
   three of them and every one drew an orange line across the page. */
.stats-section {
  padding: 1.9rem 0 0;
}
.stats-section-heading {
  margin-bottom: 0.9rem;
}
/* The section NUMERAL is gone. These were sections 01-09 of one long page; a
   page holding two of them opened at "03", which numbers nothing. Kept in the
   markup (the renderer is shared with the full page) and hidden here. */
.stats-section-heading > span {
  display: none;
}
/* A caption, not a headline. At 3.4rem it read as a second page title — and on
   the single-section pages it was very nearly the h1 again, one line below it. */
.stats-section-heading h2 {
  color: rgba(255,255,255,0.92);
  font-family: "Nunito", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}
.stats-explore h2,
.stats-error h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stats-section-heading p {
  max-width: 48rem;
  margin-top: 0.4rem;
  color: rgb(150, 150, 150);
  font-family: "Nunito", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ===== Method and caveats =====
   Every explanatory sentence on a data page, collected into one disclosure at
   the foot. Closed by default: the page is numbers, and the prose is for the
   reader who wants to know how they were arrived at. Crawlers read a closed
   <details> as ordinary markup, so nothing is hidden from search — and nothing
   is deleted, which matters because the salary comparisons are unadjusted
   associations and have to say so. */
.stats-notes {
  margin: 1.6rem 0 2.5rem;
  border-top: 0.0625rem solid rgba(255,255,255,0.08);
}
.stats-notes > summary {
  padding: 0.7rem 0;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  list-style: none;
  text-transform: uppercase;
}
.stats-notes > summary::-webkit-details-marker { display: none; }
.stats-notes > summary::after {
  content: " +";
  color: var(--brand);
}
.stats-notes[open] > summary::after { content: " −"; }
.stats-notes > summary:hover { color: var(--brand); }
.stats-snapshot--footer + .stats-notes {
  margin-top: 0;
  border-top: 0;
}
.stats-snapshot--footer + .stats-notes > summary {
  padding-top: 0.45rem;
  color: var(--brand);
  text-align: right;
}
.stats-snapshot--footer + .stats-notes > summary::after {
  content: none;
}
.stats-notes-body {
  padding-bottom: 1.2rem;
  columns: 2;
  column-gap: 2.5rem;
}
.stats-notes-body > * { break-inside: avoid; }
/* Inside the notes everything is the same quiet footnote, whatever it was on
   the page: section descriptions, table caveats and the methodology grid. */
.stats-notes-body p,
.stats-notes-body .stats-comparison-intro,
.stats-notes-body .stats-comparison-note {
  max-width: none;
  margin: 0 0 0.7rem;
  padding: 0;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-family: "Nunito", sans-serif;
  font-size: 0.72rem;
  line-height: 1.45;
}
.stats-notes-body .stats-comparison-intro { display: block; }
/* The intro is a <strong> plus a <p>; both need bringing down to footnote size,
   and the <p> needs the extra specificity to beat .stats-comparison-intro p. */
.stats-notes-body .stats-comparison-intro strong,
.stats-notes-body .stats-comparison-intro p { font-size: 0.72rem; line-height: 1.45; }
.stats-notes-body .stats-comparison-intro p { margin: 0; }
.stats-notes-body .stats-section { padding: 0; }
.stats-notes-body .stats-section-heading { margin-bottom: 0.5rem; }
.stats-notes-body .stats-method-grid { display: block; }
.stats-notes-body .stats-method-grid > div { margin-bottom: 0.7rem; }
.stats-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 1.5rem;
}
.stats-insight {
  padding: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.stats-insight strong {
  margin-top: 0.35rem;
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stats-insight p {
  margin-top: 0.3rem;
  color: rgba(255,255,255,0.68);
  font-family: "Nunito", sans-serif;
  font-size: 0.72rem;
  line-height: 1.45;
}
.stats-overview-details {
  padding-top: 1.8rem;
}
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 4vw, 5rem);
}
.stats-overview-panel {
  min-width: 0;
  padding-top: 0.8rem;
  border-top: 0.0625rem solid rgba(255,255,255,0.08);
}
/* Keep concise answers available, but visually secondary to the data. */
#statistics-content { display: flex; flex-direction: column; }
#statistics-content > .stats-quick-answers {
  order: 1;
  margin-top: 1.5rem;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.stats-quick-answers .stats-section-heading h2 {
  font-family: "Nunito", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: rgb(150,150,150);
}
.stats-quick-answers .stats-overview-grid { gap: 1rem 2rem; }
.stats-quick-answers .stats-overview-panel { padding-top: 0; border-top: 0; }
.stats-quick-answers .stats-overview-panel h3 {
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  color: rgb(170,170,170);
}
/* Match the compact, muted Nunito notes used on the profile page. */
.stats-quick-answers .stats-overview-panel > p {
  font-family: "Nunito", sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgb(150, 150, 150);
  margin: 0;
}
.stats-overview-panel h3 {
  margin-bottom: 0.65rem;
  font-family: "Nunito", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.stats-overview-panel h3 a { color: var(--brand); }
.stats-overview-panel h3 a:hover { color: white; }
.stats-chart--overview .stat-bar-row {
  grid-template-columns: minmax(8rem, 13rem) minmax(3rem, 1fr) 6rem;
  gap: 0.8rem;
}
.stats-overview-salary-row {
  min-height: 2.45rem;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto 4.5rem;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 0.0625rem solid rgba(255,255,255,0.05);
  font-family: "Nunito", sans-serif;
}
.stats-overview-salary-row > span {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-overview-salary-row > span a:hover { color: var(--brand); }
.stats-overview-salary-row strong {
  color: white;
  font-size: 1rem;
  font-weight: 700;
}
.stats-overview-salary-row small {
  color: rgba(255,255,255,0.58);
  font-size: 0.68rem;
  text-align: right;
}
.stats-overview-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.stats-overview-facts > div { display: flex; flex-direction: column; min-width: 0; }
.stats-overview-facts span,
.stats-overview-facts small {
  color: rgba(255,255,255,0.62);
  font-family: "Nunito", sans-serif;
  font-size: 0.62rem;
  line-height: 1.3;
}
.stats-overview-facts span {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats-overview-facts strong {
  margin: 0.2rem 0 0.1rem;
  color: var(--brand);
  font-size: 1.35rem;
  line-height: 1;
}
.stats-salary-band {
  padding: 1rem 0;
  display: grid;
  grid-template-columns: auto minmax(4rem, 1fr) auto;
  align-items: center;
  gap: 2rem;
  border-bottom: 0.0625rem solid rgba(255,255,255,0.08);
}
.stats-salary-band > div:not(.stats-salary-line) { display: flex; flex-direction: column; gap: 0.45rem; }
.stats-salary-band strong { font-size: 1.85rem; line-height: 1; }
.stats-salary-line { height: 0.0625rem; position: relative; background: rgba(255, 128, 0, 0.55); }
.stats-salary-line::before,
.stats-salary-line::after,
.stats-salary-line i {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  position: absolute;
  top: 50%;
  border-radius: 50%;
  background: var(--brand-fill);
  transform: translateY(-50%);
}
.stats-salary-line::before { left: 0; }
.stats-salary-line::after { right: 0; }
.stats-salary-line i { left: 50%; opacity: 0.5; }
.stats-subheading {
  margin: 1.6rem 0 0.6rem;
  color: var(--brand);
  font-family: "Nunito", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.stats-subheading--spaced { margin-top: 1.8rem; }
.stats-chart {
  display: grid;
  gap: 0;
  padding: 0;
}
.stat-bar-row {
  min-height: 2.45rem;
  display: grid;
  grid-template-columns: minmax(10rem, 17rem) minmax(5rem, 1fr) 7rem;
  align-items: center;
  gap: 1.2rem;
  padding: 0.4rem 0;
  /* The row rules stay — they are what lets the eye track a long bar to its
     number — but at a third of the weight they read as guides, not as a grid. */
  border-bottom: 0.0625rem solid rgba(255,255,255,0.05);
}
.stat-bar-label {
  overflow: hidden;
  font-family: "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-bar-label a:hover { color: var(--brand); }
.stat-bar-track { height: 0.42rem; overflow: hidden; background: rgba(255,128,0,0.13); }
.stat-bar-track span { height: 100%; display: block; background: linear-gradient(90deg, #a64f00, var(--brand-fill)); }
.stat-bar-value { display: grid; grid-template-columns: 1fr 2.5rem; align-items: baseline; gap: 0.5rem; text-align: right; }
.stat-bar-value strong { font-size: 1.3rem; font-weight: 650; }
.stat-bar-value span { color: rgba(255,255,255,0.66); font-family: "Nunito", sans-serif; font-size: 0.68rem; }
.stats-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 5rem); }
.stats-chart--compact .stat-bar-row { grid-template-columns: minmax(9rem, 14rem) minmax(3rem, 1fr) 6.5rem; gap: 0.8rem; }
.stats-table-scroll {
  overflow-x: auto;
}
.stats-table { width: 100%; min-width: 46rem; font-family: "Nunito", sans-serif; }
.stats-table th,
.stats-table td { padding: 0.5rem 0.75rem; border-top: 0.0625rem solid rgba(255,255,255,0.05); text-align: right; }
.stats-table thead th {
  color: rgba(255,255,255,0.66);
  background: transparent;
  border-top: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stats-table th:first-child,
.stats-table td:first-child { text-align: left; }
.stats-table tbody th { font-size: 0.86rem; font-weight: 650; }
.stats-table tbody th a:hover { color: var(--brand); }
.stats-table tbody td { color: rgba(255,255,255,0.7); font-size: 0.78rem; }
.stats-table tbody td strong { color: white; font-size: 1rem; font-weight: 700; }
.stats-table--comparison { min-width: 40rem; }
.stats-comparison-intro {
  display: grid;
  grid-template-columns: minmax(10rem, 0.65fr) minmax(0, 1.5fr);
  gap: 1.2rem;
  padding: 0.7rem 0;
  border-bottom: 0.0625rem solid rgba(255,255,255,0.08);
}
.stats-comparison-intro strong { color: var(--brand); font-size: 0.9rem; font-weight: 700; }
.stats-comparison-intro p,
.stats-comparison-note,
.stats-comparison-pending {
  color: rgb(150, 150, 150);
  font-family: "Nunito", sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
}
.stats-comparison-note { max-width: 54rem; margin-top: 0.8rem; }
.stats-comparison-note strong { color: white; font-weight: 700; }
.stats-comparison-pending {
  padding: 1rem 0;
  border-top: 0.0625rem solid rgba(255,255,255,0.08);
  border-bottom: 0.0625rem solid rgba(255,255,255,0.14);
}
/* Methodology stays on every page — a median with no method beside it is the
   kind of number that gets quoted wrongly — but it reads as a footnote now
   rather than as a fifth section of headlines. */
.stats-methodology { padding-bottom: 2.5rem; }
.stats-method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem 2rem;
}
.stats-method-grid > div { padding: 0; box-sizing: border-box; }
.stats-method-grid h3 { color: rgba(255,255,255,0.8); font-family: "Nunito", sans-serif; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stats-method-grid p,
.stats-error p {
  margin-top: 0.35rem;
  color: rgba(255,255,255,0.55);
  font-family: "Nunito", sans-serif;
  font-size: 0.72rem;
  line-height: 1.45;
}
.stats-explore { padding: 2rem 0 3rem; border-top: 0.0625rem solid rgba(255,255,255,0.08); }
.stats-explore h2 { max-width: 45rem; }
.stats-explore > div { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.stats-explore a { padding: 0.2rem 0; border-bottom: 0.0625rem solid rgba(255,255,255,0.08); font-size: 0.85rem; font-weight: 700; color: var(--brand); opacity: 0.85; }
.stats-explore a:hover { color: var(--brand); border-color: var(--brand); opacity: 1; }
/* .stats-loading went with the in-content loading paragraph — the page header's
   activity ring is the site's one busy indicator (functions/headerLoader.js). */
.stats-error { padding: 5rem 0; color: rgba(255, 255, 255, 0.6); font-family: "Nunito", sans-serif; }
.stats-error { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; }
.stats-error a { color: var(--brand); text-decoration: underline; }

@media (max-width: 900px) {
  .stats-hero,
  #statistics-content,
  .stats-explore { width: calc(100% - 4rem); }
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.9rem; }
  /* The tile dividers went with the desktop rules — nothing to re-draw here. */
  .stats-insight-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .stats-insight,
  .stats-insight:first-child,
  .stats-insight:last-child { min-height: auto; padding: 0; }
  .stats-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-split { grid-template-columns: 1fr; }
  .stats-overview-grid { grid-template-columns: 1fr; }
}

/* Phones. NOTE the root font here is 3.6vw (see html.statistics-page-html
   above), so a rem in this block is ~14px on a 390px screen — these values are
   not directly comparable with the desktop ones.

   This block used to restate the OLD design in full — an 18rem hero, a
   clamp(3.5rem, 16vw, 5rem) title, one KPI per row at 8.2rem tall with an
   orange rule over each, and a 2.8rem section headline — so none of the
   dashboard treatment reached a phone. It follows the desktop design now and
   only says what genuinely differs on a narrow screen. */
@media (max-width: 600px) {
  .stats-hero { padding: 1.1rem 0 0.7rem; }
  .stats-hero h1 { font-size: 1.5rem; }
  /* Two up, not one: the tiles are short now, so four of them stack into a
     screen's worth of scrolling instead of a page's. */
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.85rem; }
  .stats-kpi,
  .stats-kpi:nth-child(3),
  .stats-kpi:nth-child(4) { min-height: 0; padding: 0 0.9rem 0 0; border: 0; }
  .stats-kpi strong { font-size: 1.5rem; }
  .stats-overview-facts { grid-template-columns: 1fr; gap: 0.55rem; }
  .stats-overview-facts > div { display: grid; grid-template-columns: minmax(8rem, 1fr) auto 5rem; align-items: baseline; gap: 0.65rem; }
  .stats-overview-facts strong { margin: 0; text-align: right; }
  .stats-overview-facts small { text-align: right; }
  .stats-section-heading { margin-bottom: 0.7rem; }
  .stats-explore h2 { font-size: 1.5rem; }
  .stats-salary-band { padding: 0.9rem 0; grid-template-columns: 1fr; gap: 0.8rem; }
  .stats-comparison-intro { grid-template-columns: 1fr; gap: 0.65rem; }
  .stats-salary-line { width: 100%; }
  .stat-bar-row,
  .stats-chart--compact .stat-bar-row { grid-template-columns: minmax(7.5rem, 1fr) 4.5rem; gap: 0.65rem; }
  .stat-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .stat-bar-value { grid-column: 2; grid-row: 1; grid-template-columns: 1fr auto; }
  .stats-method-grid { grid-template-columns: 1fr; }
  /* One column of footnotes on a phone — two would be ~20 characters wide. */
  .stats-notes-body { columns: 1; }
  .stats-method-grid > div { border-left: 0; }
}

