:root {
  --paper: #f4efe4; --card: #fffdf8; --ink: #1b2430; --ink2: #465160; --muted: #6b7482; --line: #ddd4c2; --line2: #ece5d6;
  --blue: #1f4e8c; --blue-ink: #173d70; --red: #c8372d; --green: #1f7a4d; --amber: #f3e3a6; --focus: #2a78d6;
  --shadow: 0 1px 0 rgba(27,36,48,.06), 0 8px 24px -14px rgba(27,36,48,.28);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --sans: 'Rubik', 'Noto Sans Ethiopic', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Hebrew', 'Noto Sans Arabic', Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.5; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--blue); }
h1, h2, h3 { text-wrap: balance; }
.num, .n, td.n, .mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 1200; background: rgba(244,239,228,.93); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-weight: 900; font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap; }
.sections { display: flex; gap: 4px; margin-inline-start: auto; }
.sections a { color: var(--ink2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; font-weight: 500; white-space: nowrap; }
.sections a:hover { background: rgba(27,36,48,.07); color: var(--ink); }
.lang select { font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }

/* hero */
.hero { border-bottom: 1px solid var(--line); background:
  linear-gradient(transparent 31px, rgba(31,78,140,.07) 32px) 0 0 / 100% 32px, var(--paper); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: center; padding-block: 34px 30px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.06; font-weight: 900; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--red); white-space: nowrap; }
.lede { margin-top: 16px; font-size: 1.1rem; color: var(--ink2); max-width: 54ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 10px; border: 1.5px solid var(--ink); color: var(--ink); background: var(--card); text-decoration: none; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--red); }
[dir=rtl] .btn.primary { box-shadow: -4px 4px 0 var(--red); }
.btn:hover { transform: translateY(-1px); }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 12px 34px; margin-top: 28px; }
.hero-stats div { min-width: 0; }
.hero-stats dt { font-size: .8rem; color: var(--muted); }
.hero-stats dd { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-art { min-width: 0; margin-block: -30px; }
.hero-art svg { width: 100%; height: auto; display: block; max-height: 470px; overflow: visible; }
.hero-art text { font-family: var(--sans); }
.b-h { font-size: 13px; font-weight: 700; } .b-s { font-size: 8.5px; font-family: var(--mono); } .b-t { font-size: 10px; font-weight: 700; fill: #1b2430; }
.b-r text { font-size: 9.5px; fill: #465160; } .b-n { font-family: var(--mono); fill: #1b2430 !important; }
.b-big { font-size: 19px; font-weight: 900; font-family: var(--mono); fill: #1b2430; }
.scrap-shadow { fill: rgba(27,36,48,.16); }
.tape { fill: rgba(243,227,166,.78); stroke: rgba(27,36,48,.18); stroke-width: .6; }
.stamp { mix-blend-mode: multiply; opacity: .9; }
.st-big { font-size: 25px; font-weight: 900; letter-spacing: .5px; } .st-sub { font-size: 11px; font-weight: 700; }

/* cards */
main { padding-block: 22px 8px; display: grid; gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.sec-head { margin-bottom: 16px; }
.sec-head h2 { font-size: 1.55rem; font-weight: 900; letter-spacing: -.01em; }
.sec-head p { color: var(--ink2); margin-top: 3px; }
.note, .hint { font-size: .86rem; color: var(--muted); margin-top: 10px; }

/* finder */
.finder-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.step + .step { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.step h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin-bottom: 10px; }
.step h3 .num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: .82rem; font-weight: 700; flex: none; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: block; grid-column: span 2; min-width: 0; }
.field.wide { grid-column: 1 / -1; } .field.narrow { grid-column: span 1; }
.field > span { display: block; font-size: .82rem; color: var(--ink2); margin-bottom: 4px; font-weight: 500; }
input[type=text], input[type=number], input[type=search], select {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 42px; }
input:focus, select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(42,120,214,.18); }
.zone-where { margin-top: 10px; font-size: .88rem; color: var(--ink2); background: #f7f2e6; border-inline-start: 3px solid var(--blue); padding: 8px 12px; border-radius: 6px; }

.combo { position: relative; }
.combo input { padding-inline-end: 38px; font-weight: 500; }
.combo-clear { position: absolute; inset-inline-end: 6px; top: 6px; width: 30px; height: 30px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 6px; }
.combo-clear:hover { background: var(--line2); color: var(--ink); }
.combo-list { position: absolute; z-index: 1100; inset-inline: 0; top: calc(100% + 4px); max-height: 340px; overflow: auto; background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; list-style: none; box-shadow: 0 14px 30px -12px rgba(27,36,48,.45); }
.combo-list li { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line2); }
.combo-list li:last-child { border-bottom: 0; }
.combo-list li[aria-selected=true], .combo-list li:hover { background: #eef3fa; }
.combo-list .nm { font-weight: 500; flex: 1; min-width: 0; }
.combo-list .nm mark { background: var(--amber); color: inherit; border-radius: 2px; }
.combo-list .meta { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo-list .empty { color: var(--muted); cursor: default; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; vertical-align: middle; }

.cats { display: grid; gap: 14px; }
.cat-group h4 { font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; letter-spacing: .02em; }
.cat-items { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .9rem; cursor: pointer; user-select: none; max-width: 100%; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--ink2); }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip .pct { font-size: .76rem; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.chip:has(input:checked) .pct { color: #b9f0d2; }

/* result: a bill stub */
.finder-result { position: sticky; top: 72px; }
.stub { background: #fff; border: 1.5px solid var(--ink); border-radius: 4px 4px 0 0; position: relative; box-shadow: var(--shadow); }
.stub::after { content: ''; position: absolute; inset-inline: -1.5px; bottom: -9px; height: 10px;
  background: linear-gradient(135deg, #fff 6px, transparent 0) 0 0 / 14px 10px repeat-x, linear-gradient(225deg, #fff 6px, transparent 0) 0 0 / 14px 10px repeat-x;
  filter: drop-shadow(0 1.5px 0 var(--ink)); }
.stub-head { background: var(--blue); color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stub-head b { font-size: 1.05rem; } .stub-head span { font-size: .78rem; opacity: .9; font-family: var(--mono); white-space: nowrap; }
.stub-body { padding: 12px 14px 16px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: .95rem; }
.row .k { color: var(--ink2); min-width: 0; } .row .k small { display: block; color: var(--muted); font-size: .78rem; }
.row .v { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.row.minus .v { color: var(--green); } .row.plus .v { color: var(--ink); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 12px; }
.total .k { font-weight: 700; } .total .v { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.total-sub { text-align: end; color: var(--muted); font-size: .84rem; font-family: var(--mono); }
.save { margin-top: 12px; padding: 9px 12px; border: 2px solid var(--red); color: var(--red); border-radius: 8px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; transform: rotate(-1deg); background: #fff8f6; }
.barcode { height: 26px; margin-top: 14px; opacity: .8; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px); }
.after { margin-top: 22px; display: grid; gap: 12px; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.box h4 { font-size: .95rem; margin-bottom: 6px; }
.box ol, .box ul { padding-inline-start: 20px; font-size: .9rem; color: var(--ink2); display: grid; gap: 4px; }
.box .ref { font-size: .76rem; color: var(--muted); }
.elig { list-style: none !important; padding: 0 !important; }
.elig li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px dotted var(--line); }
.elig li:last-child { border: 0; }
.elig .best { font-weight: 700; color: var(--ink); }
.elig .amt { font-family: var(--mono); white-space: nowrap; }
.badge { font-size: .7rem; font-weight: 700; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.badge.must { background: #e3f3ea; color: #14573a; } .badge.may { background: #f4ecd2; color: #6d5410; }
.empty-state { border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px 18px; text-align: center; color: var(--ink2); }

/* map */
.map-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--line2); border-radius: 10px; padding: 4px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 500; color: var(--ink2); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(27,36,48,.2); font-weight: 700; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, .7fr); gap: 16px; align-items: start; }
.map-wrap { position: relative; min-width: 0; }
#map { height: 880px; border-radius: 12px; border: 1px solid var(--line); background: #e9eef2; z-index: 0; }
#map .leaflet-tile-pane { filter: grayscale(.85) contrast(.92) brightness(1.06); }
.map-side { display: grid; gap: 14px; min-width: 0; }
.legend { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .84rem; }
.legend h5 { font-size: .86rem; margin-bottom: 8px; line-height: 1.3; }
.legend ul { list-style: none; display: grid; gap: 4px; }
.legend li { display: flex; align-items: center; gap: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend i { width: 26px; height: 15px; border-radius: 3px; border: 1px solid rgba(27,36,48,.25); flex: none; }
.legend .cnt { color: var(--muted); margin-inline-start: auto; font-size: .74rem; }
.rank { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .86rem; }
.rank h5 { font-size: .8rem; color: var(--muted); margin: 0 0 4px; }
.rank ol + h5 { margin-top: 12px; }
.rank ol { list-style: none; }
.rank li { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.rank li:hover { background: #eef3fa; }
.rank .rk { color: var(--muted); font-size: .74rem; width: 1.9em; font-variant-numeric: tabular-nums; flex: none; }
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .val { font-family: var(--mono); font-weight: 700; white-space: nowrap; font-size: .82rem; }
.leaflet-tooltip.tt { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; font-family: var(--sans); font-size: .84rem; box-shadow: 0 6px 18px -6px rgba(0,0,0,.5); }
.leaflet-tooltip.tt::before { display: none; }
.tt b { display: block; font-size: .95rem; } .tt .r { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tt .r span:first-child { opacity: .75; }

/* city */
.city-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin-bottom: 14px; }
.city-head .big { font-size: 1.35rem; font-weight: 900; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; min-width: 0; }
.kpi .l { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.kpi .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -.01em; }
.kpi .s { font-size: .78rem; color: var(--ink2); }
.kpi .bar { height: 6px; border-radius: 3px; background: var(--line2); margin-top: 8px; position: relative; }
.kpi .bar i { position: absolute; top: -3px; width: 3px; height: 12px; background: var(--ink); border-radius: 2px; }
.zones { display: grid; gap: 10px; }
.zone { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.zone > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.zone > summary::-webkit-details-marker { display: none; }
.zone > summary .zn { font-weight: 700; } .zone > summary .zr { font-family: var(--mono); font-weight: 700; margin-inline-start: auto; white-space: nowrap; }
.zone > summary .zw { flex-basis: 100%; font-size: .86rem; color: var(--ink2); }
.zone[open] > summary { border-bottom: 1px solid var(--line2); background: #faf6ec; }
.zone table { font-size: .88rem; }
.zone td { padding: 6px 14px; border-bottom: 1px solid var(--line2); }
.zone td.n { font-family: var(--mono); white-space: nowrap; text-align: end; font-weight: 700; }
.zone tr.aux td { color: var(--muted); font-weight: 400; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.h3 { font-size: 1.02rem; font-weight: 700; margin: 18px 0 8px; }

/* table */
.tbl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.tbl-bar input[type=search] { flex: 1 1 220px; max-width: 340px; }
.tbl-bar select { width: auto; }
.count { color: var(--muted); font-size: .86rem; margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.tbl-scroll { max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
#tbl th { position: sticky; top: 0; z-index: 2; background: #f7f2e6; text-align: start; padding: 0; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
#tbl th button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 9px 10px; font-weight: 700; font-size: .82rem; width: 100%; box-sizing: border-box; }
#tbl th.num button { justify-content: flex-end; }
#tbl th button:hover { background: var(--line2); }
#tbl th .arr { font-size: .7rem; opacity: .25; } #tbl th[aria-sort] .arr { opacity: 1; color: var(--red); }
#tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line2); }
#tbl td.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
#tbl tbody tr { cursor: pointer; } #tbl tbody tr:hover { background: #f4f8fd; }
#tbl tbody tr.sel { background: #fdf3d0; }
#tbl td .dim { color: var(--muted); }
.spark { display: inline-block; width: 46px; height: 6px; background: var(--line2); border-radius: 3px; vertical-align: middle; margin-inline-start: 6px; overflow: hidden; }
.spark i { display: block; height: 100%; background: var(--blue); }

.src { display: grid; gap: 10px; font-size: .93rem; color: var(--ink2); }
.src dt { font-weight: 700; color: var(--ink); } .src dd { margin-bottom: 8px; }
.foot { padding: 18px 16px 40px; color: var(--muted); font-size: .85rem; }

.mini { display: none; }
@media (max-width: 900px) {
  .mini { position: fixed; z-index: 1300; inset-inline: 10px; bottom: 10px; display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; background: var(--ink); color: #fff; border-radius: 12px; text-decoration: none; box-shadow: 0 10px 26px -8px rgba(0,0,0,.55); font-size: .92rem; }
  .mini span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
  .mini b { font-family: var(--mono); font-size: 1.05rem; } .mini em { font-style: normal; font-family: var(--mono); color: #9be7bd; font-size: .9rem; }
  .hero-grid, .finder-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; margin-block: -10px -30px; max-height: 250px; overflow: hidden; }
  .finder-result { position: static; }
  .sections { display: none; }
  .lang { margin-inline-start: auto; }
  #map { height: 560px; }
  .map-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .card { padding: 16px 14px; border-radius: 14px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field { grid-column: 1 / -1; } .field.narrow { grid-column: span 1; }
  #map { height: 480px; }
  .total .v { font-size: 1.6rem; }
}
@media print { .top, .hero-art, #mapsec, .cta { display: none; } .card { box-shadow: none; } }
