html[data-mode="light"] body.horizontal .wrapper {
  background-color:#f3f4f6!important;
  background-image:linear-gradient(rgba(241,245,249,0.91),rgba(241,245,249,0.91)),
    url("../../assets/images/cbu-bg-pic-3.2ec7ebae08c6.jpg")!important;
  background-repeat:no-repeat!important;background-size:cover!important;background-attachment:fixed!important;
}
html[data-mode="dark"] body.horizontal .wrapper {
  background-color:#1a1d21!important;
  background-image:linear-gradient(rgba(26,29,33,0.93),rgba(26,29,33,0.93)),
    url("../../assets/images/cbu-bg-pic-3.2ec7ebae08c6.jpg")!important;
  background-repeat:no-repeat!important;background-size:cover!important;background-attachment:fixed!important;
}
html, body { overflow-y: auto; overflow-x: hidden; }

.cpi2-wrap { padding: .4188rem .8375rem 1.675rem; max-width: 100%; box-sizing: border-box; }

/* ── Hero ── */
.cpi2-hero {
  background: #1A2B4B;
  border-radius: .5863rem;
  padding: .7538rem 1.1725rem;
  display: flex; align-items: center; gap: .8375rem; flex-wrap: wrap;
  margin-bottom: .8375rem;
  box-shadow: 0 .1256rem .67rem rgba(26,43,75,.22);
}
html[data-mode="dark"] .cpi2-hero { background: #1a1d21; box-shadow: 0 .1256rem .67rem rgba(0,0,0,.35); }
.cpi2-hero-title { font-size: 1.0888rem; font-weight: 800; color: #fff; margin: 0; }
.cpi2-hero-sub { font-size: .5863rem; color: rgba(255,255,255,.6); margin: .2513rem 0 0; }

/* ── Sections ── */
.cpi2-section { margin-bottom: 1.1725rem; }
.cpi2-section-title { font-size: .7956rem; font-weight: 800; margin: 0 0 .5863rem; }
html[data-mode="dark"]  .cpi2-section-title { color: #f1f5f9; }
html[data-mode="light"] .cpi2-section-title { color: #1e293b; }

/* ── Card grid (non-parameterized charts) ── */
.db-charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .67rem; }
.db-chart-wrap {
  border-radius: .5863rem; padding: .5025rem; box-sizing: border-box; min-height: 27.2188rem; position: relative;
  display: flex; flex-direction: column;
}
html[data-mode="dark"]  .db-chart-wrap { background: rgba(255,255,255,0.04); border: .0419rem solid rgba(255,255,255,0.08); }
html[data-mode="light"] .db-chart-wrap { background: rgba(255,255,255,0.92); border: .0419rem solid rgba(0,0,0,0.08); box-shadow: 0 .0419rem .2513rem rgba(0,0,0,0.07); }
.db-chart-wrap.db-full, .cpi2-card.db-full { grid-column: 1 / -1; }
.db-chart-wrap > .cpi2-card-title { flex: 0 0 auto; }
.db-chart-wrap > .db-chart-target, .db-chart-wrap > .db-tab-pane { flex: 1 1 0; height: auto; min-height: 0; width: 100%; }

/* ── Tabbed card (two charts sharing one card, e.g. movers/dumbbell) ──
   Title stays first (each pane's own, like any other card). The tab buttons
   live inside the controls row, pinned to its right edge (margin-left:auto)
   so they read as "one row: filters left, tabs right" — for a card whose
   controls differ per pane (region-trend), the one .db-tabbar node gets
   moved into whichever pane's controls row is now active (see the generic
   tab-click handler below), instead of existing once per pane. */
.db-tabbar { display: flex; flex-wrap: wrap; gap: .335rem; flex: 0 1 auto; min-width: 0; max-width: 100%; margin-left: auto; }
.db-pane-flexcol { display: flex; flex-direction: column; }
.db-pane-flexcol > .cpi2-card-title { flex: 0 0 auto; }
.db-pane-flexcol > .db-chart-target { flex: 1 1 0; min-height: 0; }
.db-tab-pane.db-tab-hidden { display: none; }

.db-fs-btn {
  position: absolute; top: .335rem; right: .335rem; z-index: 10;
  background: rgba(127,127,127,0.1); border: .0419rem solid rgba(127,127,127,0.2); color: inherit;
  border-radius: .335rem; width: 1.2563rem; height: 1.2563rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .6281rem; transition: all .2s cubic-bezier(.4,0,.2,1); outline: none; line-height: 1;
}
.db-fs-btn:hover { background: rgba(76,175,80,0.15); border-color: #4caf50; color: #4caf50; transform: translateY(-.0419rem); }
html[data-mode="dark"] .db-fs-btn { background: rgba(255,255,255,0.05); color: #ccc; }
html[data-mode="dark"] .db-fs-btn:hover { background: rgba(76,175,80,0.25); color: #4caf50; }

.db-chart-target:fullscreen { padding: .8375rem; box-sizing: border-box; }
html[data-mode="dark"]  .db-chart-target:fullscreen { background: #1a1d21; }
html[data-mode="light"] .db-chart-target:fullscreen { background: #f4f6f9; }

#dbFsExitBtn {
  display: none; position: fixed; top: .5863rem; right: .5863rem; z-index: 99999;
  background: rgba(0,0,0,0.55); color: #fff; border: .0419rem solid rgba(255,255,255,0.35);
  border-radius: .2513rem; padding: .2094rem .5025rem; font-size: .5863rem; cursor: pointer; line-height: 1.4;
}
#dbFsExitBtn:hover { background: rgba(0,0,0,0.75); }

/* ── Interactive (parameterized) cards ── */
.cpi2-card {
  border-radius: .5863rem; padding: .5863rem; box-sizing: border-box; position: relative;
}
html[data-mode="dark"]  .cpi2-card { background: rgba(255,255,255,0.04); border: .0419rem solid rgba(255,255,255,0.08); }
html[data-mode="light"] .cpi2-card { background: rgba(255,255,255,0.92); border: .0419rem solid rgba(0,0,0,0.08); box-shadow: 0 .0419rem .2513rem rgba(0,0,0,0.07); }

.cpi2-row { display: flex; gap: .67rem; flex-wrap: wrap; }
.cpi2-row > .cpi2-card { flex: 1 1 19.2625rem; min-width: 0; }

.cpi2-card-title { font-size: .8375rem; font-weight: 700; margin: 0 0 .4188rem; }
html[data-mode="dark"]  .cpi2-card-title { color: rgba(241,245,249,0.85); }
html[data-mode="light"] .cpi2-card-title { color: rgba(30,41,59,0.85); }

/* ── Title + info icon row (the icon opens cpi2InfoModal with a short
   explanation of that specific chart) ── */
.cpi2-title-row { display: flex; align-items: center; gap: .335rem; margin: 0 0 .4188rem; flex: 0 0 auto; }
.cpi2-title-row > .cpi2-card-title, .cpi2-title-row > .cpi-title { margin: 0; flex: 0 1 auto; min-width: 0; }
.cpi2-info-btn {
  flex: 0 0 auto; width: .8375rem; height: .8375rem; padding: 0; border: none; background: none;
  cursor: pointer; opacity: .55; font-size: .67rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  color: inherit; transition: opacity .15s, color .15s;
}
.cpi2-info-btn:hover { opacity: 1; color: #1A2B4B; }
html[data-mode="dark"] .cpi2-info-btn:hover { color: #4caf50; }

.cpi2-info-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.45); align-items: center; justify-content: center; padding: .8375rem;
}
.cpi2-info-modal-overlay.open { display: flex; }
.cpi2-info-modal {
  max-width: 25.9625rem; width: 100%; border-radius: .5863rem; padding: 1.1725rem 1.2563rem;
  box-sizing: border-box; position: relative; box-shadow: 0 .5025rem 1.675rem rgba(0,0,0,0.3);
}
html[data-mode="dark"]  .cpi2-info-modal { background: #22262b; border: .0419rem solid rgba(255,255,255,0.1); }
html[data-mode="light"] .cpi2-info-modal { background: #fff; border: .0419rem solid rgba(0,0,0,0.08); }
.cpi2-info-modal-title { font-size: .8375rem; font-weight: 700; margin: 0 1.2563rem .5863rem 0; }
html[data-mode="dark"]  .cpi2-info-modal-title { color: #f1f5f9; }
html[data-mode="light"] .cpi2-info-modal-title { color: #1e293b; }
.cpi2-info-modal-body { font-size: .6281rem; line-height: 1.65; }
.cpi2-info-modal-body ul { margin: .335rem 0; padding-left: .8375rem; }
.cpi2-info-modal-body li { margin: .1675rem 0; }
html[data-mode="dark"]  .cpi2-info-modal-body { color: rgba(241,245,249,0.8); }
html[data-mode="light"] .cpi2-info-modal-body { color: rgba(30,41,59,0.8); }
.cpi2-info-modal-close {
  position: absolute; top: .5863rem; right: .5863rem; width: 1.0888rem; height: 1.0888rem; border: none; background: none;
  cursor: pointer; font-size: .67rem; opacity: .6; color: inherit; display: flex; align-items: center; justify-content: center;
}
.cpi2-info-modal-close:hover { opacity: 1; }

.cpi2-controls { display: flex; align-items: center; gap: .4188rem; flex-wrap: wrap; margin-bottom: .4188rem; }
.cpi2-controls label { font-size: .5444rem; opacity: .7; }

/* multi-select toggle: same look as the other selectors (--ctl-h, 8px corners) */
.cpi2-msel-toggle.cpi2-select {
  box-sizing: border-box; border-radius: .335rem;
  border: .0419rem solid #e5e7eb; background: #fff; color: #0f172a;
}
html[data-mode="dark"] .cpi2-msel-toggle.cpi2-select { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #e5e7eb; }

/* Label + selector pairs are wrapped in .cpi2-field (script below). On
   desktop the wrapper is invisible, so the inline layout is unchanged. */
.cpi2-field { display: contents; }

/* Phones/tablets: each selector has its name above it and the selectors sit
   side by side in equal columns (2 selectors -> 2 columns, 3 -> 3; 4 -> 2x2);
   a 2-option switch joins the row when there is room, a 3-option one gets
   its own full row. Every card is the standard 650px mobile box height. */
@media (max-width: 991.98px) {
  .cpi2-controls {
    display: grid;
    grid-template-columns: repeat(var(--cpi-cols, 2), minmax(0, 1fr));
    gap: .4188rem .4188rem;
    align-items: end;
  }
  .cpi2-field { display: flex; flex-direction: column; gap: .1675rem; min-width: 0; }
  .cpi2-field > label {
    margin: 0; font-size: .5025rem; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cpi2-field > .csel, .cpi2-field > .cpi2-msel { width: 100%; min-width: 0; max-width: none; }
  .cpi2-field .csel-button, .cpi2-field .cpi2-msel-toggle { width: 100%; max-width: none; }
  .cpi2-controls > .db-tabbar { width: 100%; margin-left: 0; }
  .cpi2-controls > .db-tabbar.cpi2-tab-row { grid-column: 1 / -1; }
  .cpi2-controls > .db-tabbar > button {
    flex: 1 1 0; min-width: 0; padding: 0 .2513rem !important;
    white-space: normal; text-align: center; line-height: 1.15;
  }
  .cpi2-controls > button, .cpi2-controls > .cpi2-btn { grid-column: 1 / -1; margin-left: 0; }
  .db-charts-grid > .db-chart-wrap,
  .cpi-main-row > .cpi-panel { height: 27.2188rem; min-height: 27.2188rem; }
}
}
/* explicit line-heights: the dark stylesheet otherwise inherits a fixed px
   line-height and the cards jump when the theme is switched */
.cpi2-wrap .cpi2-card-title, .cpi2-wrap .cpi2-section-title { line-height: 1.3; }
.cpi2-controls label { line-height: 1.3; }
.cpi2-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border-radius: .335rem; padding: .2513rem 1.2563rem .2513rem .5025rem; font-size: .5444rem; font-weight: 600;
  border: .0419rem solid rgba(127,127,127,.3); background-color: rgba(127,127,127,.06); color: inherit;
  cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%231e293b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .4188rem center; background-size: .4606rem;
}
.cpi2-select:hover { border-color: #1A2B4B; background-color: rgba(26,43,75,.06); }

/* Multi-select as a checkbox dropdown (dispersion's "+ Hudud") — a native
   <select multiple> picks up OS-level list-box chrome that fights our own
   background/border styling (looked doubled-up), so this is a plain button
   + an absolutely-positioned checkbox panel instead. */
.cpi2-msel { position: relative; display: inline-block; }
.cpi2-msel-toggle {
  /* Uses .cpi2-select's own chevron bg-image (same as every other select on
     this page) — no separate custom arrow character. */
  min-width: 7.9563rem; max-width: 9.2125rem; text-align: left; display: flex; align-items: center;
  justify-content: space-between; gap: .335rem;
}
.cpi2-msel-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.cpi2-msel-panel {
  display: none; position: absolute; top: calc(100% + .1675rem); left: 0; z-index: 60;
  min-width: 9.2125rem; max-height: 10.8875rem; overflow-y: auto; border-radius: .4188rem;
  padding: .2513rem; box-shadow: 0 .335rem 1.005rem rgba(0,0,0,.22); box-sizing: border-box;
}
.cpi2-msel-panel.open { display: block; }
html[data-mode="dark"]  .cpi2-msel-panel { background: #22262b; border: .0419rem solid rgba(255,255,255,.12); }
html[data-mode="light"] .cpi2-msel-panel { background: #fff; border: .0419rem solid rgba(0,0,0,.1); }
.cpi2-msel-item {
  display: flex; align-items: center; gap: .335rem; padding: .2513rem .335rem; border-radius: .2513rem;
  cursor: pointer; font-size: .5444rem; font-weight: 500; user-select: none;
}
.cpi2-msel-item:hover { background: rgba(127,127,127,.12); }
.cpi2-msel-item input { cursor: pointer; margin: 0; accent-color: #1A2B4B; }
html[data-mode="dark"] .cpi2-msel-item input { accent-color: #4caf50; }
.cpi2-msel-swatch { width: .4188rem; height: .4188rem; border-radius: 50%; flex: 0 0 auto; }
.cpi2-select:focus { outline: none; border-color: #1A2B4B; box-shadow: 0 0 0 .1256rem rgba(26,43,75,.15); }
html[data-mode="dark"] .cpi2-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23f1f5f9' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-mode="dark"] .cpi2-select:hover { border-color: #4caf50; background-color: rgba(76,175,80,.08); }
html[data-mode="dark"] .cpi2-select:focus { border-color: #4caf50; box-shadow: 0 0 0 .1256rem rgba(76,175,80,.18); }
.cpi2-select option { background: #fff; color: #1e293b; }
html[data-mode="dark"] .cpi2-select option { background: #22262b; color: #f1f5f9; }
.cpi2-btn {
  border-radius: .335rem; padding: .2094rem .5863rem; font-size: .5444rem; font-weight: 700; cursor: pointer;
  border: .0419rem solid rgba(127,127,127,.3); background: rgba(127,127,127,.08); color: inherit;
}
.cpi2-btn:hover { background: rgba(26,43,75,.12); border-color: #1A2B4B; }
.cpi2-btn.active { background: #1A2B4B; border-color: #1A2B4B; color: #fff; }
html[data-mode="dark"] .cpi2-btn:hover { background: rgba(76,175,80,.18); border-color: #4caf50; }
html[data-mode="dark"] .cpi2-btn.active { background: #4caf50; border-color: #4caf50; color: #fff; }
.cpi2-slider { flex: 1 1 6.7rem; min-width: 5.025rem; }
.cpi2-date-label { font-size: .5444rem; font-weight: 700; opacity: .8; min-width: 2.5125rem; text-align: right; }

/* ── Play/slider row below a chart (matches /expectations/ box21 style) ── */
.cpi2-anim-row { display: flex; align-items: center; gap: .335rem; margin-top: .4188rem; }
.cpi2-play-btn {
  width: 1.4238rem; height: 1.4238rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: .335rem; border: .0419rem solid rgba(127,127,127,0.25); background: rgba(0,86,69,0.07);
  color: #1A2B4B; cursor: pointer; padding: 0; transition: background .2s, border-color .2s, box-shadow .2s;
}
.cpi2-play-btn:hover { background: rgba(0,86,69,0.15); border-color: rgba(0,86,69,0.4); box-shadow: 0 .0419rem .1675rem rgba(0,86,69,0.12); }
.cpi2-play-btn svg { width: .67rem; height: .67rem; fill: currentColor; }
html[data-mode="dark"] .cpi2-play-btn { color: #fff; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
html[data-mode="dark"] .cpi2-play-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.35); box-shadow: 0 .0419rem .1675rem rgba(255,255,255,0.08); }

.cpi2-range { -webkit-appearance: none; appearance: none; height: .2513rem; border-radius: .1256rem; background: #1A2B4B; outline: none; flex: 1; }
.cpi2-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: .67rem; height: .67rem; border-radius: 50%;
  background: #1A2B4B; cursor: pointer; border: .0838rem solid #fff; box-shadow: 0 .0419rem .1675rem rgba(0,0,0,0.3);
}
.cpi2-range::-moz-range-thumb {
  width: .67rem; height: .67rem; border-radius: 50%; background: #1A2B4B; cursor: pointer;
  border: .0838rem solid #fff; box-shadow: 0 .0419rem .1675rem rgba(0,0,0,0.3);
}
html[data-mode="dark"] .cpi2-range { background: #4caf50; }

.cpi2-map-target, .cpi2-chart-target { width: 100%; height: 27.2188rem; }
.cpi2-chart-target.short { height: 23.0312rem; }
.cpi2-chart-target.tall { height: 32.6625rem; }

/* ── Item/group compare tree picker ── */
.cpi2-tree-wrap { display: flex; gap: .67rem; flex-wrap: wrap; }
.cpi2-tree-panel { flex: 1 1 13.4rem; max-width: 15.9125rem; max-height: 20.1rem; overflow-y: auto; border-radius: .4188rem; padding: .335rem; }
html[data-mode="dark"]  .cpi2-tree-panel { background: rgba(255,255,255,0.03); border: .0419rem solid rgba(255,255,255,.08); }
html[data-mode="light"] .cpi2-tree-panel { background: rgba(0,0,0,0.02); border: .0419rem solid rgba(0,0,0,.08); }
.cpi2-tree-chart-panel { flex: 2 1 20.9375rem; min-width: 0; }
.cpi2-tree ul { list-style: none; margin: 0; padding-left: .67rem; }
.cpi2-tree > ul { padding-left: 0; }
.cpi2-tree li { margin: .0838rem 0; }
.cpi2-tree label { font-size: .5444rem; cursor: pointer; display: inline-flex; align-items: center; gap: .2094rem; }
.cpi2-tree-toggle { cursor: pointer; width: .5863rem; display: inline-block; opacity: .6; font-size: .4188rem; }
.cpi2-tree-toggle-spacer { display: inline-block; width: .5863rem; }

/* phones: one column (tablets keep two) */
@media (max-width: 767.98px) {
  .db-charts-grid { grid-template-columns: 1fr; }
  .db-chart-wrap.db-full { grid-column: 1; }
  .cpi2-row { flex-direction: column; }
}
@media (max-width: 900px) {
  /* Fixed 650px card/chart heights (set for 2-up desktop columns) leave a
     mostly-empty box once cards stack full-width on a phone — shrink them,
     and give the tabbar's wrapped 2nd/3rd line room instead of overlapping
     the top-right fullscreen button (db-fs-btn sits at top:8px;right:8px). */
  .db-chart-wrap { min-height: 19.2625rem; }
  /* Movers/dumbbell tabs hold up to 16 horizontal bars — the generic 460px
     squeezes their data labels into overlapping each other (fine on desktop's
     650px, not here), so this card alone gets extra room. */
  #moversCardWrap { min-height: 26.8rem; }
  .cpi2-map-target, .cpi2-chart-target { height: 19.2625rem; }
  .cpi2-chart-target.short { height: 16.75rem; }
  .cpi2-chart-target.tall { height: 22.6125rem; }
  .cpi2-controls { gap: .2513rem .4188rem; }
  .cpi2-controls label { font-size: .5025rem; }
  .cpi2-select { font-size: .5025rem; padding: .2094rem 1.0888rem .2094rem .4188rem; }
  .cpi2-btn { font-size: .5025rem; padding: .2094rem .4188rem; }
}

/* ── Basket hierarchy: sunburst + linked bar chart (ported from
   cpi_hierarchy_page.html, data from the INI tahlili store instead of the
   admin-upload table) — placed at the bottom of the page ── */
.cpi-page {
  width: 100%;
  height: 29.3125rem;
  min-height: 20.9375rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5025rem;
  box-sizing: border-box;
  overflow: hidden;
}
.cpi-page-header { flex-shrink: 0; display: flex; align-items: center; gap: .5863rem; }
.cpi-main-row { flex: 1 1 auto; min-height: 0; display: flex; gap: .67rem; overflow: hidden; }
.cpi-panel {
  border-radius: .7538rem; padding: .5863rem .67rem; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
html[data-mode="dark"]  .cpi-panel { background: rgba(255,255,255,0.04); border: .0419rem solid rgba(255,255,255,0.1); }
html[data-mode="light"] .cpi-panel { background: rgba(255,255,255,0.88); border: .0419rem solid rgba(0,0,0,0.09); box-shadow: 0 .0419rem .2513rem rgba(0,0,0,0.06); }
.cpi-title { font-size: .8375rem; font-weight: 700; } /* matches .cpi2-card-title */
html[data-mode="dark"]  .cpi-title { color: #f1f5f9; }
html[data-mode="light"] .cpi-title { color: #1e293b; }
html[data-mode="dark"]  .cpi-muted { color: rgba(241,245,249,0.58); }
html[data-mode="light"] .cpi-muted { color: rgba(30,41,59,0.58); }
html[data-mode="dark"]  .cpi-accent { color: #f1f5f9; font-weight: 700; }
html[data-mode="light"] .cpi-accent { color: #1e293b; font-weight: 700; }
.cpi-bc { font-size: .5863rem; min-height: 1.005rem; flex-shrink: 0; margin-bottom: .2513rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpi-bc-link { cursor: pointer; text-decoration: underline; text-underline-offset: .1256rem; color: #9ca3af; }
.cpi-bc-link:hover { color: #cbd5e1; }
html[data-mode="light"] .cpi-bc-link:hover { color: #475569; }
.cpi-bc-sep { margin: 0 .2513rem; opacity: .45; color: #9ca3af; }
html[data-mode="dark"]  .cpi-bc-cur { color: #e5e7eb; font-weight: 600; }
html[data-mode="light"] .cpi-bc-cur { color: #1e293b; font-weight: 600; }
#cpiChartArea, #cpiBarArea { flex: 1 1 auto; min-height: 0; height: 100%; position: relative; overflow: hidden; }
#cpiSunburst, #cpiBar { width: 100%; height: 100%; min-height: 1.7588rem; }
#cpiSunburst:fullscreen, #cpiBar:fullscreen { background: #fff; padding: .8375rem; box-sizing: border-box; }
.cpi-legend {
  flex-shrink: 0; padding: .335rem .1675rem .1675rem; display: flex; flex-direction: column;
  gap: .2094rem; overflow-y: auto; max-height: 6.0719rem; border-top: .0419rem solid; margin-top: .2513rem;
}
html[data-mode="dark"]  .cpi-legend { border-color: rgba(255,255,255,0.08); }
html[data-mode="light"] .cpi-legend { border-color: rgba(0,0,0,0.08); }
.cpi-legend-item { display: flex; align-items: center; gap: .2931rem; font-size: .5444rem; line-height: 1.25; }
html[data-mode="dark"]  .cpi-legend-item { color: #e2e8f0; }
html[data-mode="light"] .cpi-legend-item { color: #334155; }
.cpi-state { height: 100%; min-height: 13.4rem; display: flex; align-items: center; justify-content: center; font-size: .67rem; }
html[data-mode="dark"]  .cpi-state { color: rgba(241,245,249,0.48); }
html[data-mode="light"] .cpi-state { color: rgba(30,41,59,0.48); }
#cpiCenterLabel {
  position: absolute; pointer-events: none; text-align: center; font-size: .6281rem; font-weight: 700;
  max-width: 5.8625rem; line-height: 1.25; word-break: break-word;
  text-shadow: 0 .0838rem .2513rem rgba(0,0,0,0.95); color: #fff; z-index: 5; display: none;
  transform: translate(-50%, -50%);
}
@keyframes hcFadeIn { from { opacity: 0; transform: scale(.87) translateY(.5863rem); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes hcFadeOut { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(.92) translateY(-.335rem); } }
.hc-anim-in { transform-origin: center center; animation: hcFadeIn .48s cubic-bezier(.34,1.15,.64,1) both; }
.hc-anim-out { transform-origin: center center; animation: hcFadeOut .18s cubic-bezier(.55,0,1,.45) both; pointer-events: none; }

@media (max-width: 820px) {
  .cpi-page { height: auto; overflow: visible; padding: .4188rem 0; }
  .cpi-main-row { flex-direction: column; overflow: visible; }
  .cpi-panel { min-height: 20.1rem; }
  #cpiChartArea, #cpiBarArea, #cpiSunburst, #cpiBar { height: 16.75rem; min-height: 16.75rem; }
  #cpiCenterLabel { font-size: .5444rem; max-width: 4.6063rem; }
}

/* ── Large monitors (matches tuman_shahar_page.html's isLg() threshold) ──
   Card/chart heights were fixed px, so on a wide screen the grid columns
   stretched a lot wider while height stayed put — every card and chart
   ended up looking flat and elongated. Grow both the containers and the
   text (CSS here for HTML chrome; Highcharts' own SVG text is bumped in
   the matching isLg() JS block instead, since CSS can't reach into it). */
@media (min-width: 1720px) {
  .db-chart-wrap { min-height: 35.5938rem; }
  .cpi2-map-target, .cpi2-chart-target { height: 35.5938rem; }
  .cpi2-chart-target.short { height: 29.3125rem; }
  .cpi2-chart-target.tall { height: 39.7812rem; }
  .cpi-page { height: 37.6875rem; }
  .cpi-panel { padding: .7538rem .8375rem; }
  .cpi2-card-title, .cpi-title { font-size: 1.0888rem; }
  .cpi2-controls label { font-size: .67rem; }
  .cpi2-select, .cpi2-btn, .cpi2-date-label { font-size: .67rem; }
  .cpi-bc { font-size: .7119rem; }
  .cpi-legend-item { font-size: .67rem; }
  .cpi-state { font-size: .8375rem; }
  #cpiCenterLabel { font-size: .7956rem; max-width: 7.5375rem; }
  .cpi2-tree label { font-size: .6281rem; }
}


/* ── moved from inline style attributes ── */
.cpi2-controls.is-fixed { flex:0 0 auto; }
.db-chart-target.db-chart-fill { flex:1 1 0; min-height:0; }
.cpi2-note { font-size:.5025rem; opacity:.65; margin:.4188rem 0 0; flex:0 0 auto; }
.cpi2-card-title.cpi2-card-subtitle { font-size:.5025rem; opacity:.7; font-weight:600; }
.cpi-panel.cpi-panel-flex { flex: 1; min-width: 0; position: relative; }
.cpi2-title-row.is-tight { margin:0 0 .1675rem; }
.cpi-panel-head { flex-shrink: 0; margin-bottom: .335rem; }
.cpi-muted.cpi-legend-row { font-size: .5863rem; margin-top: .1675rem; display: flex; align-items: center; gap: .335rem; flex-wrap: wrap; }


/* ── page end: the same gap above the site footer on every page ── */
.cpi2-wrap { padding-bottom: .4375rem; }
.cpi2-wrap > .cpi2-section:last-child { margin-bottom: 0; }
.cpi-page { padding-bottom: 0; }

/* ── tablets: the cards of one row are as tall as the tallest of them ── */
@media (min-width: 768px) and (max-width: 991.98px) {
  .db-charts-grid { align-items: stretch; }
  .db-charts-grid > .db-chart-wrap, .db-charts-grid > .cpi2-card { height: auto; }
}
