/* Crime Israel — Results / Neighborhood page (mobile-first). Ported from examples/mobile/style.css. */

/* Hebrew text nodes (per project RTL note) */
.results-loc__city,
.results-loc__name,
.results-loc__note,
.results-safety__label,
.results-stat__lbl,
.results-chart__title,
.results-pill,
.results-chart__col-label,
.results-card-head__title,
.results-donut__leg,
.results-hbar__label,
.results-table__title,
.results-table__sub,
.results-table__name,
.results-table__tag,
.results-share__text {
  direction: rtl;
  unicode-bidi: embed;
}

/* ----- Layout shell ----- */
.results {
  padding: 4px 16px 24px;
  max-width: 100%;
  overflow-x: clip;
}

.results__shell {
  background: #f3f7fe;
  border-radius: 16px;
  box-shadow: 0 3px 4px rgba(33, 33, 33, 0.25);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  /* Fluid mobile: .results pads 16px; avoid 358px artboard cap */
  max-width: none;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.results__card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 3px 4px rgba(33, 33, 33, 0.25);
  padding: 24px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ----- Mini ynet lockup (repeated across cards) ----- */
/* Figma Header Subtitle — single PNG per variant (QA Excel 72). */
.results-ynet {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  direction: ltr;
  flex-shrink: 0;
}

.results-ynet__img {
  display: block;
  width: 57px;
  height: 24px;
  object-fit: contain;
}

.results-ynet--white .results-ynet__img {
  width: 52px;
  height: 22px;
}

/* ----- Location / rank row ----- */
.results-loc {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  box-sizing: border-box;
}

.results-loc__cluster {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  /* LTR row: badge (lead) on the left, title (meta) on the right. */
  direction: ltr;
  gap: 8px;
}

.results-loc__lead {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-shrink: 0;
}

.results-badge {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}

.results-badge__star {
  position: absolute;
  inset: 2%;
  width: 96%;
  height: 96%;
  display: block;
  background-color: var(--results-badge-color, #e84829);
  mask-image: url("/images/results/badge-star.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("/images/results/badge-star.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.results-badge__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
}

.results-badge__txt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.results-badge__label {
  font-size: 11px;
  font-weight: var(--moses-bold);
}

.results-badge__num {
  font-size: 22px;
  font-weight: var(--moses-bold);
}

.results-loc__meta {
  display: flex;
  flex-direction: column;
  /* LTR column; titles/notes align to physical right */
  direction: ltr;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.results-loc__title {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  /* LTR + DOM … → pin: pack to physical right */
  justify-content: flex-end;
  direction: ltr;
  gap: 2px;
  max-width: 100%;
}

/* Ranked neighborhood: badge left; title + note share right edge (Figma loc-meta). */
.results-loc__cluster:has(.results-badge) .results-loc__meta {
  align-items: flex-end;
}

.results-loc__cluster:has(.results-badge) .results-loc__title {
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
}

.results-loc__cluster:has(.results-badge) .results-loc__note {
  direction: rtl;
  text-align: right;
  max-width: 100%;
  color: var(--ci-ink, #292c3b);
}

.results-loc__city {
  font-size: 14px;
  font-weight: var(--moses-rg-neg);
  color: var(--ci-ink, #292c3b);
  line-height: 25px;
}

.results-loc__name {
  font-size: 22px;
  font-weight: var(--moses-bold);
  line-height: 26px;
}

.results-loc__pin {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
}

.results-loc__note {
  font-size: 12px;
  font-weight: var(--moses-rg-neg);
  line-height: 1.35;
  text-align: center;
  color: var(--ci-ink, #292c3b);
  max-width: 36em;
}

.results-loc__note--unranked {
  font-size: 13px;
  font-weight: var(--moses-rg-neg);
}

.results-loc__note-star {
  color: #d70026;
  font-weight: var(--moses-bold);
}

/* ----- Safety bar ----- */
.results-safety {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.results-safety--inline {
  display: none;
}

.results-safety--stack {
  align-self: stretch;
}

.results-safety__label {
  font-size: 14px;
  font-weight: var(--moses-medium);
  text-align: center;
}

.results-safety__bar {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  direction: ltr;
}

.results-safety__bar--inline {
  width: auto;
  justify-content: flex-start;
}

.results-safety__seg {
  flex: 1 1 0;
  min-width: 0;
  height: 16px;
  border-radius: 5px;
}

.results-safety--stack .results-safety__seg--active {
  height: 28px;
}

/* Compare unranked: all safety cubes equal size + gray (Figma Disabled). */
.results-safety--disabled .results-safety__label {
  color: #78787b;
}

.results-safety--disabled .results-safety__seg,
.results-safety--disabled .results-safety__seg--active {
  height: 20px;
  background: #d4d7db;
}

.results-safety__bar--inline .results-safety__seg {
  flex: none;
  width: 38px;
  height: 20px;
}

.results-safety__bar--inline .results-safety__seg--active {
  height: 28px;
}

/* ----- 2x2 stats ----- */
.results-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 118px 118px;
  gap: 8px;
  height: auto;
  /* Figma Stats Section places cards in LTR cols: Rate|Pop / Change|Count */
  direction: ltr;
}

.results-stat {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 9px 8px rgba(33, 33, 33, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: center;
  box-sizing: border-box;
  height: 118px;
  min-height: 118px;
}

.results-stat--red {
  border: 1px solid #d70026;
}

.results-stat--change.results-stat--red {
  border-color: #d70026;
}

.results-stat__lbl {
  font-size: 13px;
  font-weight: var(--moses-medium);
  line-height: 16px;
  direction: rtl;
}

.results-stat__val {
  font-size: 24px;
  font-weight: var(--moses-bold);
  letter-spacing: -0.12px;
}

.results-stat__val--red {
  color: #d70026;
}

.results-stat__val--green {
  color: #04a620;
}

.results-hbar--nat-only .results-hbar__chart {
  height: 220px;
}

/* City (no badge): centered title + pin. */
.results--city .results-loc {
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
  direction: rtl;
}

.results--city .results-loc__name {
  font-size: 22px;
}

.results-loc--city .results-loc__meta {
  direction: ltr;
  align-items: flex-end;
  width: 100%;
}

.results-loc--city .results-loc__title {
  direction: ltr;
  justify-content: flex-end;
  align-self: stretch;
  gap: 2px;
}

.results-stats--city {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
}

.results-stats--city .results-stats__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 118px 118px;
  gap: 8px;
  height: auto;
  width: 100%;
  /* Figma city 2x2 LTR: Rate|Pop / Neighborhoods|Count */
  direction: ltr;
}

.results-stat--change {
  border: 1px solid #04a620;
  height: 118px;
  min-height: 118px;
  width: 100%;
}

.results-chart__title-sub {
  display: block;
  font-weight: var(--moses-regular);
}

.results-donut--city {
  width: 100%;
  max-width: 342px;
}

.city-widgets-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.city-nbh-widget {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(33, 33, 33, 0.25);
  overflow: hidden;
  padding-bottom: 4px;
}

.city-nbh-widget__head {
  display: grid;
  /* Figma Widget Heading: ynet left | title + icon right */
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  direction: ltr;
  height: 48px;
  padding: 0 8px;
  box-sizing: border-box;
}

.city-nbh-widget--green .city-nbh-widget__head {
  background: #02911b;
}

.city-nbh-widget--red .city-nbh-widget__head {
  background: #7e0015;
}

.city-nbh-widget__head > .results-ynet {
  justify-self: start;
  margin: 0;
}

.city-nbh-widget__title-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  direction: ltr;
}

.city-nbh-widget__title {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  font-weight: var(--moses-bold);
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 20px;
  text-align: right;
  direction: rtl;
  unicode-bidi: embed;
  white-space: nowrap;
}

.city-nbh-widget__title-sub {
  display: block;
  font-weight: var(--moses-regular);
}

.city-nbh-widget__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .city-nbh-widget__title-sub {
    display: inline;
    margin-inline-start: 0.25em;
  }
}

.city-nbh-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.city-nbh-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 10px;
  direction: ltr;
}

.city-nbh-row[data-entity-key] {
  cursor: pointer;
}

.city-nbh-row__pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: rgba(4, 166, 32, 0.18);
  color: #057118;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: var(--moses-medium);
  white-space: nowrap;
  /* Flex children ignore bidi reordering — count stays on the physical right */
  direction: ltr;
}

.city-nbh-row__pill-label {
  direction: rtl;
  unicode-bidi: isolate;
}

.city-nbh-row__pill-count {
  direction: ltr;
  unicode-bidi: isolate;
}

.city-nbh-widget--red .city-nbh-row__pill {
  background: rgba(215, 0, 38, 0.12);
  color: #d70026;
}

.city-nbh-row__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: var(--moses-bold);
  text-align: right;
}

.city-nbh-row__num {
  width: 25px;
  height: 25px;
  border-radius: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: rgba(126, 213, 124, 0.8);
  flex-shrink: 0;
}

.city-nbh-widget--red .city-nbh-row__num {
  background: rgba(215, 0, 38, 0.25);
}

.city-nbh-widget--green .city-nbh-row__num {
  background: rgba(4, 166, 32, 0.35);
}

.results-table--city .results-table__sub {
  display: none;
}

.results-table__tag--norank {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #292c3b;
  color: #fff;
  font-size: 11px;
  font-weight: var(--moses-bold);
  line-height: 1.15;
  padding: 4px 6px;
  white-space: normal;
  text-align: center;
  direction: rtl;
  min-height: 32px;
}

.results-table__tag-line {
  display: block;
}

.results--unranked .results-loc__cluster {
  justify-content: flex-end;
}

.results--unranked .results-loc__meta {
  flex: 1 1 auto;
  align-items: flex-end;
}

.results--unranked .results-loc__title {
  justify-content: flex-end;
}

.results--unranked .results-loc__note {
  direction: rtl;
  text-align: right;
  max-width: 100%;
}

/* ----- Empty / no results ----- */
.empty-state {
  padding: 4px 16px 16px;
}

.empty-state__shell {
  background: #f3f7fe;
  border-radius: 16px;
  box-shadow: 0 3px 4px rgba(33, 33, 33, 0.25);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: none;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.empty-state__message {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 9px 8px rgba(33, 33, 33, 0.1);
  padding: 24px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 100%;
}

.empty-state__title {
  margin: 0;
  font-size: 20px;
  font-weight: var(--moses-bold);
  line-height: 24px;
  color: #000;
}

.empty-state__body {
  margin: 0;
  font-size: 14px;
  font-weight: var(--moses-regular);
  line-height: 20px;
  color: #000;
  direction: rtl;
}

.empty-state__info-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  direction: ltr;
  width: 100%;
}

.empty-state__info-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  text-align: right;
  direction: rtl;
}

.empty-state__info-title {
  margin: 0;
  width: 100%;
  font-size: 15px;
  font-weight: var(--moses-bold);
  color: #3b3d53;
  line-height: normal;
  text-align: right;
}

.empty-state__info-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  font-size: 12px;
  color: #000;
  text-align: right;
  align-items: flex-start;
}

.empty-state__info-body p {
  margin: 0;
  line-height: 16px;
}

.empty-state__info-more {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ci-blue, #293da8);
  text-decoration: underline;
  font-size: 12px;
  line-height: 12px;
  align-self: flex-start;
  font-family: inherit;
}

.empty-state__info-extra p {
  margin: 0;
  line-height: 16px;
}

.empty-state__info-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 64px;
  background: var(--ci-blue, #293da8);
  color: #fff;
  font-size: 16px;
  line-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
  box-sizing: border-box;
}

.ad-slot--leaderboard,
.ad-slot--responsive {
  padding: 16px 16px 24px;
}

.ad-slot__box--leaderboard,
.ad-slot__box--fluid {
  width: 300px;
  max-width: 100%;
  height: 250px;
  min-height: 90px;
  margin: 0 auto;
  box-sizing: border-box;
}

.ad-slot--mpu .ad-slot__box--mpu {
  width: 300px;
  height: 250px;
  max-width: min(300px, 100%);
  box-sizing: border-box;
}

@media (min-width: 1280px) {
  .ad-slot__box--leaderboard,
  .ad-slot__box--fluid {
    width: 1190px;
    max-width: 100%;
    height: auto;
    min-height: 90px;
  }
}

/* ----- Quarterly chart card ----- */
.results-chart {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  /* Visible so horizontal bar scroll is not clipped (QA Excel 77) */
  overflow: visible;
}

.results-chart__title {
  margin: 0;
  font-size: 16px;
  font-weight: var(--moses-bold);
  text-align: center;
}

.results-chart__pills {
  /* RTL wrap so DOM-first pill (כל העבירות) sits on the right */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  direction: rtl;
  overflow: visible;
}

.results-pill {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: 100px;
  background: rgba(41, 61, 168, 0.08);
  border: 1px solid rgba(41, 61, 168, 0.08);
  font-size: 13px;
  font-weight: var(--moses-medium);
  line-height: 13px;
  color: var(--ci-ink, #292c3b);
  white-space: nowrap;
  direction: rtl;
}

.results-pill--on {
  background: var(--ci-ink, #292c3b);
  border-color: var(--ci-ink, #292c3b);
  color: #fff;
  /* Keep same weight as idle so pills do not resize/shift on select */
  font-weight: var(--moses-medium);
}

.results-pill--disabled,
.results-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.results-chart__bars {
  display: flex;
  gap: 12px;
  width: 100%;
  /* LTR: Y-axis on the left (Figma); page RTL must not reverse this */
  direction: ltr;
  overflow: visible;
}

.results-chart__axis {
  width: 22px;
  height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: var(--moses-rg-neg);
  color: #666;
  text-align: center;
  line-height: 1;
}

/* Zero-height slots so tick text centers sit on grid lines (not offset by font metrics). */
.results-chart__axis span {
  display: block;
  height: 0;
  line-height: 0;
  overflow: visible;
  transform: translateY(-50%);
}

.results-chart__area {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 324px;
  /* Horizontal only — overflow-y:visible becomes auto when paired with overflow-x:auto */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.results-chart__plot {
  position: relative;
  min-width: max-content;
  width: max-content;
  height: 324px;
}

.results-chart__grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  /* 10 intervals → 11 lines matching Y-axis ticks (0 … axisMax) */
  background-image: repeating-linear-gradient(
    to bottom,
    #ebebeb 0,
    #ebebeb 1px,
    transparent 1px,
    transparent calc(100% / 10)
  );
  pointer-events: none;
}

.results-chart__cols {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  align-items: flex-end;
  /* Figma bar columns: 36px bars + room between (QA Excel 76) */
  gap: 12px;
  min-width: max-content;
  width: max-content;
  box-sizing: border-box;
  padding-inline: 4px;
}

.results-chart__col {
  flex: 0 0 auto;
  /* Wide enough for “רבעון N | YYYY” under a 36px bar */
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 100%;
}

.results-chart__bar {
  position: relative;
  width: 36px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(to bottom, #293da8 40%, #101842 95%);
  overflow: visible;
}

.results-chart__bar-value {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: var(--moses-bold);
  color: #fff;
  padding: 8px 0;
  white-space: nowrap;
}

.results-chart__bar--value-above .results-chart__bar-value {
  top: auto;
  bottom: calc(100% + 4px);
  padding: 0;
  color: var(--ci-ink, #292c3b);
}

.results-chart__col-label {
  display: block;
  font-size: 12px;
  font-weight: var(--moses-rg-neg);
  color: var(--ci-ink, #292c3b);
  white-space: nowrap;
  text-align: center;
}

.results-chart__col-label b {
  font-weight: var(--moses-bold);
}

.results-chart__col-label em {
  font-style: normal;
}

/* ----- Shared dark header used by donut / hbar cards ----- */
.results-card-head {
  width: 100%;
  min-height: 48px;
  background: var(--ci-ink, #292c3b);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px;
  color: #fff;
  box-sizing: border-box;
  /* LTR shell so ynet stays physical left, title block physical right */
  direction: ltr;
}

.results-card-head .results-ynet {
  margin: 0;
  flex-shrink: 0;
  align-self: center;
}

.results-card-head__titles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  margin-inline-start: auto;
  text-align: right;
  /* Hebrew in children (.results-card-head__title has direction:rtl) */
}

.results-card-head__title {
  font-size: 16px;
  font-weight: var(--moses-bold);
  line-height: 20px;
  text-align: right;
  white-space: nowrap;
}

.results-card-head__sub {
  font-size: 12px;
  font-weight: var(--moses-regular);
  line-height: 16px;
  text-align: right;
  white-space: nowrap;
}

/* ----- Donut + horizontal bars row ----- */
.results-charts-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

/* ----- Donut ----- */
.results-donut {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 24px;
  gap: 32px;
}

.results-donut__wrap {
  position: relative;
  width: 290px;
  height: 290px;
  max-width: calc(100% - 16px);
}

.results-donut__ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.results-donut__hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.results-donut__tag {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: var(--moses-medium);
  line-height: 12px;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  direction: ltr;
  unicode-bidi: isolate;
}

.results-donut__tag--sm {
  background: none;
  padding: 0;
  font-size: 11px;
}

.results-donut__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 4px 16px;
  padding: 0 32px;
  width: 100%;
  box-sizing: border-box;
}

.results-donut__leg {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: var(--moses-medium);
  color: var(--ci-ink, #292c3b);
  /* LTR: label then swatch → color on the physical right (Figma) */
  direction: ltr;
}

.results-donut__leg span {
  direction: rtl;
  unicode-bidi: embed;
}

.results-donut__leg i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.results-donut__note {
  margin: 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: var(--moses-regular);
  color: #666;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.results-donut__note-star {
  margin-inline-end: 2px;
}

/* ----- Horizontal comparison bars (Figma: labels above bars, LTR axis) ----- */
.results-hbar {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.results-hbar__chart {
  position: relative;
  padding: 8px 16px 20px;
  direction: ltr;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  box-sizing: border-box;
}

.results-hbar__axis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: var(--moses-rg-neg);
  color: #666;
  margin-bottom: 0;
  /* Figma / desktop prototype: baseline under axis tick numbers */
  padding-bottom: 6px;
  border-bottom: 1px solid #e9edf3;
}

.results-hbar__label {
  font-size: 14px;
  font-weight: var(--moses-bold);
  color: #2d2d2d;
  /* Chart is LTR; sit labels above the bar origin with a small inset */
  text-align: left;
  padding-left: 8px;
  direction: rtl;
  unicode-bidi: embed;
  margin: 0;
  line-height: 1.2;
}

.results-hbar__bar span {
  font-size: 14px;
  font-weight: var(--moses-bold);
  color: #fff;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.results-hbar__grid {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  bottom: 0;
  background-image: repeating-linear-gradient(
    to right,
    rgba(235, 235, 235, 0.7) 0,
    rgba(235, 235, 235, 0.7) 1px,
    transparent 1px,
    transparent calc(100% / 8)
  );
  pointer-events: none;
}

.results-hbar__row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.results-hbar__bar {
  position: relative;
  height: 52px;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  min-width: 0;
  box-sizing: border-box;
}

/* QA: short values — number sits just past the bar end so it never clips */
.results-hbar__bar--value-out {
  justify-content: flex-start;
  min-width: 8px;
  padding: 0;
}

.results-hbar__bar--value-out span {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  color: #2d2d2d;
}

.results-hbar__bar--nbh { background: linear-gradient(to right, #122544, #2d5daa); }
.results-hbar__bar--city { background: linear-gradient(to right, #444a58, #8f9ab2); }
.results-hbar__bar--nat { background: linear-gradient(to right, #383838, #9e9e9e); }

/* ----- Neighborhood comparison table ----- */
.results-table {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 7.5px rgba(0, 0, 0, 0.08);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.results-table > .results-ynet {
  margin: 0 auto;
}

.results-table__head {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.results-table__head--title-only {
  justify-content: center;
}

.results-table__title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--moses-bold);
  text-align: center;
  line-height: 20px;
  color: #131313;
}

.results-table__sub {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  color: #131313;
}

.results-table__sub b {
  font-weight: var(--moses-bold);
}

.results-table__sub-reg {
  font-weight: var(--moses-regular);
}

.results-table__sub-rg {
  font-weight: var(--moses-rg-neg);
}

.results-table__scroll-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-chart__scroll-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.hscroll-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  /* Keep [← left][right →] on physical sides despite page RTL */
  direction: ltr;
}

.hscroll-hints[hidden] {
  display: none !important;
}

.hscroll-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  color: var(--ci-blue, #293da8);
  flex-shrink: 0;
}

.hscroll-hint[hidden] {
  visibility: hidden;
  /* Keep space-between layout so the other arrow stays on its side */
  display: inline-flex !important;
  pointer-events: none;
}

.hscroll-hint img {
  display: block;
  width: 12px;
  height: 12px;
}

/* End arrow = same glyph mirrored to point right */
.hscroll-hint--end img {
  transform: scaleX(-1);
}

.results-table__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table__grid {
  min-width: 820px;
  display: flex;
  flex-direction: column;
}

.results-table__row {
  display: grid;
  /* change | count | rate | safety | neighborhood | city-rank */
  grid-template-columns: 69px 142px 168px 86px minmax(150px, 1fr) 64px;
  column-gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #dfdfdf;
  background: #fff;
  /* Column order follows Figma DOM (LTR). Page is dir=rtl — see PROJECT_INSTRUCTIONS § RTL. */
  direction: ltr;
}

.results-table--city .results-table__row {
  grid-template-columns: 69px 142px 196px 86px minmax(150px, 1fr) 64px;
}

.results-table__row[data-entity-key] {
  cursor: pointer;
}

.results-table__row[data-entity-key]:hover:not(.results-table__row--highlight) {
  background: #f3f7fe;
}

.results-table__row--head {
  background: var(--ci-ink, #292c3b);
  color: #fff;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  font-weight: var(--moses-bold);
  padding: 20px 16px;
  cursor: default;
}

.results-table__row--head .results-table__cell,
.results-table__row--head .results-table__name,
.results-table__row--head .results-table__rank {
  min-width: 0;
}

.results-table__row--head .results-table__cell {
  color: #fff;
  font-size: 14px;
  font-weight: var(--moses-bold);
  text-align: center;
  white-space: nowrap;
}

.results-table__row--head .results-table__name,
.results-table__row--head .results-table__rank {
  color: #fff;
  font-size: 14px;
  font-weight: var(--moses-bold);
  text-align: center;
  white-space: nowrap;
}

.results-table__row--highlight {
  background: #eaecf6;
}

.results-table__row--last {
  border-bottom: none;
}

.results-table__cell {
  min-width: 0;
  font-size: 14px;
  text-align: center;
  color: #131313;
}

.results-table__cell--change {
  font-weight: var(--moses-medium);
  font-size: 16px;
}

.results-table__cell--up { color: #04a620; }
.results-table__cell--down { color: #d70026; }
.results-table__cell--muted { color: #78787b; }

.results-table__cell--rate {
  white-space: nowrap;
}

.results-table__cell--label {
  display: flex;
  justify-content: center;
}

.results-table__name {
  min-width: 0;
  font-weight: var(--moses-bold);
  text-align: center;
  font-size: 14px;
}

.results-table__rank {
  white-space: nowrap;
  text-align: center;
}

.results-table__rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 24px;
  height: 24px;
  border-radius: 72px;
  background: #efefef;
  font-size: 13px;
}

.results-table__rank-num--current {
  background: var(--ci-blue, #293da8);
  color: #fff;
}

.results-table__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: var(--moses-bold);
  width: 82px;
  min-height: 24px;
  box-sizing: border-box;
  text-align: center;
  direction: rtl;
  white-space: nowrap;
  color: #fff;
}

.results-table__tag--very-safe { background: #008217; }
.results-table__tag--safe { background: #25ba48; }
.results-table__tag--medium { background: #f7c310; color: #131313; }
.results-table__tag--danger { background: #e84829; }
.results-table__tag--very-danger { background: #d70026; }

/* ----- Share block ----- */
.results-share {
  width: 100%;
  background: var(--ci-ink, #292c3b);
  border-radius: 16px;
  padding: 10px 16px;
  /* Text above icons (QA Excel 82); DOM already text → icons */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.results-share__icons {
  display: flex;
  gap: 14px;
  /* LTR so DOM X → FB → WA matches Figma left-to-right */
  direction: ltr;
}

.results-share__icons a {
  width: 30px;
  height: 30px;
}

.results-share__icons img {
  width: 100%;
  height: 100%;
}

.results-share__text {
  font-size: 16px;
  font-weight: var(--moses-bold);
  color: #fff;
  text-align: center;
  line-height: 1.3;
  margin: 0;
}

.results__info {
  width: 100%;
}

/* QA row 31 / Excel 83: info on shell tint — no white card background */
.results__shell .info-card--in-shell,
.compare__shell .info-card--in-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 8px 0;
}

.results__shell .info-card--in-shell .info-card__row,
.compare__shell .info-card--in-shell .info-card__row {
  /* Icon on the physical right (Figma) */
  direction: ltr;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.results__shell .info-card--in-shell .info-card__text,
.compare__shell .info-card--in-shell .info-card__text {
  direction: rtl;
  text-align: right;
  flex: 1;
  min-width: 0;
  gap: 10px;
}

.results__shell .info-card--in-shell .info-card__title,
.compare__shell .info-card--in-shell .info-card__title {
  font-size: 16px;
}

.results__shell .info-card--in-shell .info-card__body p,
.compare__shell .info-card--in-shell .info-card__body p {
  line-height: 18px;
}

.results__shell .info-card--in-shell .info-card__icon,
.compare__shell .info-card--in-shell .info-card__icon {
  order: 2;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 18px;
  padding-top: 0;
}

/* ----- Breakpoints ----- */
@media (min-width: 768px) {
  /* Figma D variants: no ynet lockup inside results cards (header only). */
  .results-ynet {
    display: none;
  }

  /* Donut / h-bar card heads keep ynet left + title right on all viewports. */
  .results-card-head .results-ynet {
    display: flex;
  }

  /* City green/red widget heads: same ynet + title row grid as mobile. */
  .city-nbh-widget__head .results-ynet {
    display: flex;
  }

  .city-nbh-widget__title-row {
    width: 100%;
    justify-self: stretch;
  }

  .results__shell {
    max-width: none;
  }

  /* Charts fill the results card (not the mobile 310px cap). */
  .results-chart,
  .results-hbar {
    max-width: 100%;
  }

  .results-donut--city {
    max-width: 100%;
  }

  .results-chart__area {
    min-width: 0;
  }

  .results-chart__area {
    overflow-x: visible;
  }
}

@media (min-width: 1280px) {
  .results {
    padding: 24px;
  }

  .results__shell {
    max-width: var(--ci-content-w);
  }

  .results__card {
    padding: 32px 24px 16px;
    /* Figma / QA row 32: uniform 24px between result blocks */
    gap: 24px;
  }

  .results-safety--stack {
    display: none;
  }

  .results-safety--inline {
    display: flex;
  }

  .results:not(.results--city) .results-loc {
    gap: 0;
    direction: ltr;
    padding: 0 8px;
  }

  .results:not(.results--city) .results-loc__cluster {
    width: 100%;
    align-items: center;
  }

  .results-loc__meta {
    align-items: flex-end;
  }

  .results-loc__cluster:has(.results-badge) .results-loc__meta {
    align-items: flex-end;
  }

  .results-loc__title {
    justify-content: flex-end;
  }

  .results-loc__cluster:has(.results-badge) .results-loc__title {
    justify-content: flex-end;
    gap: 6px;
    max-width: 100%;
  }

  .results-loc--city .results-loc__meta {
    direction: ltr;
    align-items: flex-end;
  }

  .results-loc--city .results-loc__title {
    justify-content: flex-end;
    align-self: stretch;
  }

  .results-loc__note {
    text-align: center;
  }

  .results-loc__cluster:has(.results-badge) .results-loc__note {
    direction: rtl;
    text-align: right;
    max-width: 100%;
    color: var(--ci-ink, #292c3b);
  }

  .results-badge {
    width: 92px;
    height: 92px;
  }

  .results-badge__circle {
    width: 62px;
    height: 62px;
  }

  .results-badge__label {
    font-size: 12px;
  }

  .results-badge__num {
    font-size: 26px;
  }

  .results__shell .info-card--in-shell,
  .compare__shell .info-card--in-shell {
    padding: 20px 24px;
  }

  .results__shell .info-card--in-shell .info-card__row,
  .compare__shell .info-card--in-shell .info-card__row {
    gap: 24px;
  }

  .results__shell .info-card--in-shell .info-card__icon,
  .compare__shell .info-card--in-shell .info-card__icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 18px;
  }

  .results__shell .info-card--in-shell .info-card__title,
  .compare__shell .info-card--in-shell .info-card__title {
    font-size: 16px;
  }

  .results__shell .info-card--in-shell .info-card__body,
  .compare__shell .info-card--in-shell .info-card__body {
    font-size: 15px;
  }

  .results__shell .info-card--in-shell .info-card__body p,
  .compare__shell .info-card--in-shell .info-card__body p {
    line-height: 18px;
  }

  .results-chart {
    /* Fill results shell (--ci-content-w: 1040@1280 / 1120@1920) */
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 32px 40px;
    gap: 24px;
    align-items: stretch;
  }

  .results-chart__title {
    font-size: 18px;
    text-align: right;
    white-space: nowrap;
    width: 100%;
  }

  /* QA row 18: title + "(קטגוריות נבחרות)" on one right-aligned line */
  .results-chart__title-sub {
    display: inline;
    margin-inline-start: 0.25em;
  }

  .results-chart__area {
    min-width: 0;
    width: 100%;
  }

  .results-chart__plot {
    width: 100%;
    min-width: 0;
  }

  .results-chart__cols {
    width: 100%;
    max-width: none;
    min-width: 0;
    gap: 0;
    padding-inline: 0;
  }

  .results-chart__col {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .results-chart__bar {
    width: 36px;
  }

  .results-chart__pills {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    direction: rtl;
  }

  .results-chart__col-label {
    font-size: 12px;
  }

  .results-charts-row {
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .results-donut,
  .results-hbar {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }

  /*
   * Axis flush under the header; grid to the bottom.
   * Bar pair sits in the upper-middle of leftover height (not top, not fully split).
   */
  .results-hbar {
    display: flex;
    flex-direction: column;
  }

  .results-hbar__chart {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 8px 16px 16px;
    gap: 0;
  }

  .results-hbar__axis {
    order: 1;
    flex: 0 0 auto;
  }

  .results-hbar__chart::before {
    content: "";
    order: 2;
    flex: 1 1 0;
    min-height: 0;
  }

  .results-hbar__grid {
    top: 28px;
    bottom: 0;
  }

  .results-hbar__row {
    order: 3;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 6px;
  }

  .results-hbar__row + .results-hbar__row {
    margin-top: 52px;
  }

  .results-hbar__chart::after {
    content: "";
    order: 4;
    flex: 2 1 0;
    min-height: 0;
  }

  .results-stats:not(.results-stats--city) {
    direction: ltr;
    height: auto;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
    max-width: 100%;
    width: 100%;
  }

  /* Visual L→R: Change | Count | Rate | Pop (page stays RTL elsewhere). */
  .results-stats:not(.results-stats--city) .results-stat--change {
    order: 1;
  }

  .results-stats:not(.results-stats--city) .results-stat--count {
    order: 2;
  }

  .results-stats:not(.results-stats--city) .results-stat--rate {
    order: 3;
  }

  .results-stats:not(.results-stats--city) .results-stat--pop {
    order: 4;
  }

  .results-stats--city {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto;
    gap: 8px;
    height: auto;
    max-width: 100%;
    width: 100%;
    /* LTR so Figma order is physical L→R (Change…Neighborhoods) */
    direction: ltr;
  }

  .results-stats--city .results-stats__grid {
    display: contents;
  }

  /* Figma city Stats L→R: Change | Count | Rate | Pop | Neighborhoods */
  .results-stats--city .results-stat--change {
    order: 1;
  }

  .results-stats--city .results-stat--count {
    order: 2;
  }

  .results-stats--city .results-stat--rate {
    order: 3;
  }

  .results-stats--city .results-stat--pop {
    order: 4;
  }

  .results-stats--city .results-stat--hoods {
    order: 5;
  }

  .city-widgets-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    max-width: 100%;
    width: 100%;
  }

  .city-nbh-widget {
    flex: 1;
    max-width: none;
  }

  .results-donut--city {
    max-width: 100%;
    width: 100%;
  }

  .results-table {
    max-width: 100%;
    width: 100%;
    padding: 32px 24px;
    gap: 25px;
  }

  .results-table__scroll {
    overflow-x: visible;
  }

  .results-table__scroll-hints,
  .hscroll-hints {
    display: none !important;
  }

  .results-table__grid {
    min-width: 0;
    width: 100%;
  }

  .results-table__row {
    grid-template-columns: 69px 142px 170px 86px minmax(150px, 1fr) 64px;
    column-gap: 12px;
    padding: 12px 20px;
  }

  .results-table--city .results-table__row {
    grid-template-columns: 69px 142px 196px 86px minmax(150px, 1fr) 64px;
  }

  .results-table__head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .results-table__head--title-only {
    justify-content: center;
  }

  .results-table__title,
  .results-table__sub {
    text-align: center;
  }

  /* QA row 30: narrower share bar, larger type, text + icons in one row */
  .results-share {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 120px;
    gap: 20px;
  }

  .results-share__text {
    font-size: 18px;
    white-space: nowrap;
  }

  .results-share__icons a {
    width: 30px;
    height: 30px;
  }

  .results-card-head__title {
    font-size: 18px;
  }

  .results-card-head {
    padding: 10px 16px;
  }

  .results-donut__note {
    font-size: 13px;
  }

  .results:not(.results--city) .results-loc {
    direction: ltr;
    padding: 0 8px;
  }

  .results--city .results-loc {
    direction: rtl;
    padding: 0 8px;
  }

  .results-loc__meta {
    flex: 1;
  }

  .empty-state {
    padding: 24px;
  }

  .empty-state__shell {
    max-width: var(--ci-content-w);
    padding: 20px 24px;
  }

  .empty-state__message {
    padding: 32px 50px;
    gap: 20px;
  }

  .empty-state__ynet {
    display: none;
  }

  .empty-state__title {
    font-size: 32px;
    line-height: 32px;
  }

  .empty-state__body {
    font-size: 18px;
    line-height: 26px;
    max-width: 900px;
  }

  .empty-state__info-title {
    font-size: 16px;
  }

  .empty-state__info-body {
    font-size: 15px;
  }

  .empty-state__info-body p {
    line-height: 21px;
  }

  .empty-state__info-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 18px;
  }
}
