/* Weights come from the OS/2 table of the local Abar Mid FaNum files.
   No italic file is included, and no missing weight is synthesized. */
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Abar Mid FaNum";
  src: url("/fonts/AbarMidFaNum-ExtraBlack.ttf") format("truetype");
  font-weight: 950;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family: "Abar Mid FaNum", "Segoe UI", Tahoma, sans-serif;
  --navy: #1e3a8a;
  --cyan: #06b6d4;
  --ink: #142033;
  --muted: #52627a;
  --line: #e1e8f2;
  --paper: #f3f6fb;
  --white: #ffffff;
  --soft: #e7f0fa;
  --cyan-wash: #e7f8fb;
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.85;
  overflow-x: clip;
}

button, input, select { font: inherit; }

h1, h2, h3, p { margin: 0; }

img { max-width: 100%; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  direction: rtl;
}

.sidebar {
  width: 252px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--navy);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: var(--white);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0 8px;
}

.brand img {
  width: 168px;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand-sub {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-button {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: start;
  color: var(--white);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.nav-button svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: rgba(255, 255, 255, 0.86);
}

.nav-button:hover { background: rgba(255, 255, 255, 0.1); }

.nav-button.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  font-weight: 700;
}

.nav-button.is-active svg { color: var(--cyan); }

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 32px 8px;
  background: var(--paper);
}

.title-block { flex: 1; min-width: 180px; }

.eyebrow {
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

h1 {
  margin-top: 2px;
  color: var(--navy);
  font-size: 32px;
  line-height: 1.4;
  font-weight: 700;
}

.intro {
  margin: 0 0 8px;
  padding: 0;
  background: transparent;
  border: 0;
}

.intro h2,
.section-break {
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
}

.intro p { margin-top: 8px; }

.jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.section-break { margin: 22px 0 8px; }

.source-panel { margin-top: 12px; }

.source-panel p { margin-top: 8px; }

.search { width: min(340px, 32vw); }

.search input {
  width: 100%;
  border: 1px solid #d5deea;
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}

.search input:focus-visible,
.nav-button:focus-visible,
.menu-button:focus-visible,
.legend-item:focus-visible,
.rank-row:focus-visible,
.column:focus-visible,
.treemap-cell:focus-visible,
.treemap-key:focus-visible,
.focus-row:focus-visible,
.donut-slice:focus-visible,
.filter input:focus-visible,
.filter select:focus-visible,
.text-button:focus-visible,
.company-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.search-note {
  margin-top: 6px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.7;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.user-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan-wash);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.user-text strong,
.user-text small { display: block; }

.user-text small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.menu-button {
  display: none;
  border: 1px solid #d5deea;
  background: var(--white);
  color: var(--navy);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.canvas {
  min-width: 0;
  padding: 4px 32px 40px;
}

.observed {
  margin: 8px 0 22px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 0;
}

.observed h2,
.observed .observed-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
}

.observed-total {
  margin-top: 4px;
  color: var(--navy);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
}

.observed-gaps,
.chart-sum {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.observed .charts { grid-template-columns: 1fr; }

.tag-real {
  color: var(--white);
  background: var(--navy);
}

.experimental {
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: var(--cyan-wash);
  border: 1px solid #b7e8f2;
  border-radius: 12px;
  color: #0f3a4a;
}

.experimental strong { color: var(--navy); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat,
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stat { padding: 18px 18px 16px; }

.stat-lead {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.stat-kicker {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
}

.stat-lead .stat-kicker { color: #b7e8f2; }

.stat-label {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.stat-value {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--navy);
}

.stat-lead .stat-value {
  font-size: 36px;
  color: var(--white);
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
}

.stat-lead .stat-note { color: #d6e0f5; }

.charts {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-top: 14px;
}

.chart-filter-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

#home-stats { margin-top: 14px; }

#home-charts {
  grid-template-columns: 1fr;
  min-width: 0;
}

#home-charts > .panel,
.observed-chart {
  min-width: 0;
}

#home-review { margin-top: 14px; }

.review-company {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 6px 0;
}

.review-company p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel { padding: 18px; }

.quality { margin-top: 14px; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}

.tag {
  flex: none;
  color: var(--navy);
  background: var(--cyan-wash);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.panel-note {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
}

.donut-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 28px;
  align-items: center;
}

.donut-layout.is-compact {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  grid-template-columns: 240px max-content;
}

.donut-layout.is-compact .legend-item {
  width: auto;
  grid-template-columns: 10px auto auto auto;
}

.donut-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin-inline: auto;
}

.donut-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.donut-track,
.donut-slice {
  fill: none;
  stroke-width: 14;
}

.donut-track { stroke: var(--soft); }

.donut-slice {
  cursor: pointer;
  transition: opacity 120ms ease;
}

.donut-slice.is-dim { opacity: 0.28; }

.donut-center {
  position: absolute;
  inset: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-total {
  color: var(--navy);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.donut-caption {
  max-width: 7.5rem;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.legend-item {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 2.4rem 4.2rem;
  gap: 0 12px;
  align-items: center;
  text-align: start;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 500;
  cursor: pointer;
}

.legend-item:hover { background: var(--paper); }

.legend-item.is-selected { background: var(--soft); }

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-name {
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.legend-count,
.legend-percent {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.legend-count {
  color: var(--navy);
  text-align: start;
}

.legend-percent {
  color: var(--muted);
  font-weight: 500;
  text-align: end;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(6.5rem, 9.2rem) minmax(0, 1fr) 2.2rem;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 5px 4px;
  cursor: pointer;
}

.rank-row.is-leader { background: var(--cyan-wash); }

.rank-index {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.rank-name {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rank-row.is-leader .rank-name,
.rank-row.is-leader .rank-index { color: var(--navy); }

.rank-track {
  height: 6px;
  background: var(--soft);
  border-radius: 99px;
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  background: var(--navy);
  border-radius: inherit;
}

.rank-fill.is-leader { background: var(--cyan); }

.rank-value {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: start;
}

.treemap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}

.treemap-cell {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--white);
  color: var(--white);
  text-align: right;
  overflow: hidden;
  cursor: pointer;
}

.treemap-cell strong,
.treemap-cell span {
  color: var(--white);
  line-height: 1.35;
}

.treemap-cell strong {
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.treemap-cell span {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.treemap-cell.is-compact strong,
.treemap-cell.is-compact span { display: none; }

.treemap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}

.treemap-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.treemap-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.treemap-key strong {
  color: var(--navy);
  font-weight: 700;
}

.column-chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 420px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.column {
  flex: 1 0 58px;
  min-width: 58px;
  max-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.column-value {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.column-chart:not(.is-pair) .column-value {
  position: absolute;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.column-plot {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.column-bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  transform: translateX(-50%);
  border-radius: 8px 8px 2px 2px;
  background: var(--navy);
}

.column-name {
  height: 148px;
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  writing-mode: horizontal-tb;
  transform: none;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.column-chart:not(.is-pair) .column-name-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.column-chart.is-pair {
  height: 260px;
  direction: rtl;
  justify-content: center;
  gap: 48px;
  overflow: visible;
}

.column-chart.is-pair .column {
  flex: 0 0 120px;
  max-width: 140px;
}

.column-chart.is-pair .column-plot {
  width: 84px;
  background: #d9e3f0;
  border-radius: 10px;
}

.column-chart.is-pair .column-bar {
  width: 100%;
  left: 0;
  transform: none;
  border-radius: 10px 10px 4px 4px;
}

.column-chart.is-pair .column-name {
  display: block;
  height: auto;
  writing-mode: horizontal-tb;
  transform: none;
  text-align: center;
  font-size: 16px;
}

.split-bar {
  display: flex;
  direction: rtl;
  width: 100%;
  min-height: 84px;
  border-radius: 14px;
  overflow: hidden;
}

.split-part {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 14px 18px;
  border: 0;
  text-align: right;
  cursor: pointer;
}

.split-part.is-dim { opacity: 0.35; }

.split-label,
.split-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.split-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.4fr) minmax(6.5rem, 0.9fr) minmax(4rem, 1.2fr) 3rem;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.focus-row:hover { background: var(--paper); }

.focus-domain,
.focus-place {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.focus-place { color: var(--navy); font-weight: 700; }

.focus-row .rank-track {
  height: 14px;
  background: #d9e3f0;
}

.focus-value {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-align: start;
}

.chart-tip {
  position: fixed;
  z-index: 40;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  pointer-events: none;
}

.chart-tip[hidden] { display: none; }

.chart-tip span { display: block; }

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.quality-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: 12px;
}

.quality-item h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.quality-value {
  margin-top: 4px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.quality-reason {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
}

.unbuilt {
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 48px 28px;
  background: var(--white);
  border: 1px dashed #c9d5e6;
  border-radius: 16px;
}

.unbuilt h2 {
  color: var(--navy);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
}

.unbuilt p:last-child {
  max-width: 46rem;
  color: var(--muted);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 51, 0.32);
  z-index: 15;
}

.backdrop[hidden] { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app { display: block; }

  .menu-button { display: inline-flex; }

  .main { width: 100%; }

  .sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    right: -280px;
    height: auto;
    visibility: hidden;
    transition: right 160ms ease;
    box-shadow: none;
  }

  .sidebar.is-open {
    right: 0;
    visibility: visible;
    box-shadow: -12px 0 40px rgba(20, 32, 51, 0.12);
  }

  .topbar,
  .canvas { padding-right: 16px; padding-left: 16px; }

  .topbar { flex-wrap: wrap; gap: 12px; }

  .search,
  .user { width: 100%; }
}

@media (max-width: 720px) {
  .donut-layout { grid-template-columns: 1fr; }

  .legend { width: 100%; }

  .rank-row {
    grid-template-columns: 1.5rem minmax(0, 1fr) 2.2rem;
    grid-template-areas:
      "index name value"
      "index bar bar";
    row-gap: 4px;
  }

  .rank-index { grid-area: index; }
  .rank-name { grid-area: name; }
  .rank-track { grid-area: bar; }
  .rank-value { grid-area: value; }
}

@media (max-width: 560px) {
  .stats,
  .meters { grid-template-columns: 1fr; }

  h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .donut-slice { transition: none; }
}

.source-note,
.empty-note {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.source-note p + p { margin-top: 8px; }

.source-kicker {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.source-note a {
  color: var(--navy);
  font-weight: 600;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
}

#map-filters {
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto;
  margin-top: 0;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.filter input,
.filter select,
.text-button {
  border: 1px solid #d5deea;
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}

.text-button {
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover { background: var(--paper); }

.result-count {
  margin-top: 12px;
  color: var(--navy);
  font-weight: 700;
}

.province-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 10px;
  margin-top: 14px;
}

.province-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.province-card:hover,
.province-card.is-selected {
  border-color: var(--cyan);
  background: var(--cyan-wash);
}

.province-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.province-count {
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.map-limits {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.map-limits p {
  margin: 0 0 6px;
}

.map-stage { min-width: 0; margin-top: 8px; }

#company-map {
  position: relative;
  z-index: 0;
  isolation: isolate;
  width: 100%;
  height: 700px;
  border: 1px solid var(--line);
  border-radius: 12px;
  direction: ltr;
  background: #d5deea;
}

.map-popup-kicker {
  margin: 0;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.leaflet-container img {
  max-width: none !important;
  max-height: none !important;
}

.leaflet-popup-content,
.leaflet-popup-content .text-button {
  direction: rtl;
  text-align: right;
}

.map-tile-error {
  margin: 8px 0 0;
  color: #9f1239;
  font-weight: 700;
}

.map-legend {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.review-title {
  margin: 12px 0 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.review-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.map-review { margin-top: 8px; }

.map-popup p { margin: 4px 0; }

.map-popup-list {
  max-height: 200px;
  margin: 6px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.map-popup button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-align: right;
  padding: 3px 0;
  cursor: pointer;
}

.leaflet-div-icon.city-marker {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  line-height: 1;
  font-family: "Abar Mid FaNum", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.28);
}

.leaflet-div-icon.city-marker.is-selected {
  background: var(--cyan);
  color: #083344;
}

.leaflet-div-icon.place-marker {
  display: block;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.28);
}

.leaflet-div-icon.place-marker.is-selected {
  background: var(--cyan);
}

.map-legend a {
  color: var(--navy);
  font-weight: 700;
}

#company-map .leaflet-top.leaflet-left { z-index: 1000; }

#company-map .leaflet-bottom.leaflet-right {
  top: 8px;
  right: 8px;
  bottom: auto;
  left: auto;
  width: max-content;
  max-width: min(440px, calc(100% - 56px));
  z-index: 800;
}

.leaflet-control-attribution {
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 860px) {
  #view-map .map-stage {
    margin-right: -16px;
    margin-left: -16px;
  }

  #company-map {
    width: 100%;
    height: min(750px, calc(100dvh - 220px));
    min-height: 480px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }
}

.coverage { margin-top: 12px; }

.coverage h3 {
  margin-top: 14px;
  color: var(--navy);
  font-size: 16px;
}

.coverage-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 8px;
  margin-top: 10px;
}

.coverage-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.coverage-metric span,
.coverage-line span { display: block; }

.coverage-metric strong,
.coverage-line strong {
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
}

.coverage-list,
.coverage-gaps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.coverage-line,
.coverage-gap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: 8px;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.coverage-gap {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) auto;
}

.coverage-gap p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

.company-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.company-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 11rem minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 8px 14px;
  align-items: center;
  text-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.company-row:hover,
.company-row.is-selected {
  border-color: var(--cyan);
  background: var(--cyan-wash);
}

.company-name {
  color: var(--navy);
  font-weight: 700;
}

.company-id,
.company-place,
.company-domain { color: var(--ink); }

.detail {
  margin-top: 14px;
  padding: 18px;
  scroll-margin-top: 132px;
}

.detail h2 {
  margin-top: 4px;
  color: var(--navy);
  font-size: 26px;
  font-weight: 700;
}

.detail dl {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 14px;
}

.detail dt {
  color: var(--muted);
  font-weight: 600;
}

.detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail a { color: var(--navy); font-weight: 600; }

.detail-notes {
  margin: 14px 0 0;
  padding: 0 1.2rem 0 0;
  color: var(--muted);
}

.detail .text-button { margin-top: 14px; }

.dossier-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dossier-block h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
}

.dossier-warning {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #fff7e8;
  border: 1px solid #f0d7a2;
  border-radius: 12px;
}

.dossier-warning p {
  margin: 0;
  font-weight: 700;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.notice-card,
.observation-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--white);
}

.notice-card h4,
.observation-card h4 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.notice-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.dossier-warning {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff6e8;
  color: var(--navy);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .filters,
  #map-filters { grid-template-columns: 1fr 1fr; }
  .company-row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 720px) {
  .filters,
  .detail dl,
  .company-row,
  .coverage-gap { grid-template-columns: 1fr; }

  #map-filters { grid-template-columns: 1fr 1fr; }
}

.fact-unverified { color: var(--navy); font-weight: 700; }

.enrichment-block + .enrichment-block { margin-top: 8px; }

body.profile-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.profile-modal[hidden] { display: none; }

.profile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(20, 32, 51, 0.55);
  cursor: pointer;
}

.profile-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--ink);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(20, 32, 51, 0.28);
  overflow: hidden;
}

.profile-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.profile-back {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
}

.profile-close {
  width: 40px;
  height: 40px;
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--navy);
  cursor: pointer;
}

.profile-close svg { width: 18px; height: 18px; }

.profile-scroll {
  min-height: 0;
  overflow: auto;
  padding: 8px 28px 32px;
}

.profile-head { padding-bottom: 8px; }

.profile-name {
  color: var(--navy);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-meta,
.profile-icons,
.profile-place-switch,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-meta { margin-top: 14px; }

.profile-chip,
.profile-place-tab,
.profile-source,
.profile-certificate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.profile-chip-label,
.profile-muted,
.profile-fact span,
.notice-tile-kicker,
.notice-tile-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-chip strong { color: var(--navy); font-weight: 700; }

.profile-icons { margin-top: 16px; }

.profile-icon {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.profile-icon svg { width: 22px; height: 22px; }

.profile-icon:hover,
.notice-tile:hover,
.profile-place-tab.is-selected,
.profile-source:hover {
  border-color: var(--cyan);
  background: var(--cyan-wash);
  color: var(--navy);
}

.profile-section { margin-top: 22px; }

.profile-section h3 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
}

.profile-copy,
.profile-notice-text {
  max-width: 68ch;
  margin: 0;
}

.profile-notice-text {
  max-width: none;
  white-space: pre-wrap;
  line-height: 2;
  text-align: justify;
  overflow-wrap: anywhere;
}

.profile-copy + .profile-copy { margin-top: 8px; }

.profile-cards,
.notice-grid,
.profile-facts,
.profile-people {
  display: grid;
  gap: 10px;
}

.profile-cards,
.profile-people { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.profile-card,
.profile-person,
.profile-fact,
.notice-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.profile-card,
.profile-person,
.profile-fact { padding: 12px 14px; }

.profile-person {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.profile-card strong,
.profile-person strong { color: var(--navy); }

.profile-card p,
.profile-person span,
.profile-address { margin: 4px 0 0; }

.profile-card a,
.profile-person a {
  display: inline-block;
  margin-top: 6px;
  color: var(--navy);
}

.notice-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.notice-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 112px;
  padding: 12px 14px;
  text-align: start;
  cursor: pointer;
}

.notice-tile-type {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cyan-wash);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.notice-tile strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.profile-facts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.profile-fact { display: flex; flex-direction: column; gap: 2px; }

.profile-fact strong { font-weight: 700; overflow-wrap: anywhere; }

.profile-subject { margin-top: 10px; }

.profile-map-wrap { margin-top: 10px; }

.profile-map {
  height: 140px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper);
}

.profile-map-large { height: min(68vh, 640px); }

.profile-map-note { margin-top: 8px; color: var(--muted); font-size: 13px; }

.profile-city-pin {
  width: 16px;
  height: 16px;
  border: 3px solid var(--navy);
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25);
}

.profile-place-tab {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.profile-actions { margin-top: 22px; }

.profile-map .leaflet-control-attribution {
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .profile-modal { padding: 0; }

  .profile-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .profile-scroll { padding: 8px 16px 28px; }

  .profile-name { font-size: 26px; }

  .profile-map { height: 168px; }

  .notice-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .notice-grid,
  .profile-cards,
  .profile-people,
  .profile-facts { grid-template-columns: 1fr; }
}
