/* IBM Plex (SIL Open Font License 1.1, see fonts/LICENSE-OFL.txt), served from this site: no third-party requests. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
/* Arabic letters only: browsers download these files the first time a page shows Arabic text. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1; }
/* manzil: ink, paper and one amber accent. Plex Sans for words, Plex Mono for figures. */
:root {
  --ink: #13233a;          /* headings, rules, primary buttons */
  --text: #1f2a37;
  --muted: #6b6f76;
  --faint: #9a9890;
  --line: #e4e0d6;         /* hairlines */
  --paper: #f7f5f0;        /* page */
  --surface: #ffffff;
  --accent: #c26a12;       /* the one highlight colour */
  --link: #2563a8;
  --ok: #1f7a4d;
  --bad: #b3261e;
  --warn: #9a5b00;
  --sans: "IBM Plex Sans", "IBM Plex Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 var(--sans); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
.icon { width: 1em; height: 1em; vertical-align: -0.13em; flex: none; }

/* ---- top bar */
.top { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px; background: var(--ink); color: #e9ecf1; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -0.4px; }
.brand svg { width: 27px; height: 27px; }
nav { display: flex; gap: 2px; align-self: stretch; }
nav a, nav .soon { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: #b9c2cf; border-bottom: 2px solid transparent; }
nav a:hover { color: #fff; }
nav a.on { color: #fff; border-bottom-color: var(--accent); }
nav .soon { color: #5d6b80; cursor: default; }
.top .logout { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top .logout .muted { color: #8f9bb0; }
.top button.link { color: #e9ecf1; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 24px 56px; }
main.narrow { max-width: 380px; padding-top: 72px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.4px; color: var(--ink); margin: 4px 0 6px; }
h1 .unit { font-weight: 400; color: var(--muted); }
h2 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3 { font-size: 13px; font-weight: 600; color: var(--ink); margin: 16px 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); margin: 0 0 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px; margin-bottom: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.good { color: var(--ok); }
.right { text-align: right; }
.center { text-align: center; margin: 14px 0; }
.big { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -0.5px; color: var(--ink); }
.big.good { color: var(--ok); }
code { font-family: var(--mono); font-size: 12.5px; background: #efece4; padding: 1px 4px; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---- controls */
button { font: inherit; padding: 6px 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 3px; cursor: pointer; }
button:hover { background: #1d3354; }
button:disabled { opacity: .45; cursor: default; }
button.link { background: none; border: 0; color: var(--link); padding: 4px 6px; }
button.link:hover { text-decoration: underline; background: none; }
select, input, textarea { font: inherit; border: 1px solid #cfc9bc; border-radius: 3px; padding: 5px 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { padding: 0; accent-color: var(--ink); }
label.inline { display: inline-flex; align-items: center; gap: 6px; }
.flash { background: #eef6f0; border-left: 3px solid var(--ok); color: #1b5e3c; padding: 9px 14px; margin-bottom: 16px; }
.flash.bad { background: #fbeeec; border-left-color: var(--bad); color: var(--bad); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 2px; background: #efece4; font-size: 12px; white-space: nowrap; }
.tag.ok { background: #e6f2ea; color: var(--ok); }
.tag.bad { background: #fbeeec; color: var(--bad); }
.tag.warn { background: #fbf1e1; color: var(--warn); }
.chev::after, .ddbtn::after, #more-toggle::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-3px) rotate(45deg); }
#more-toggle.open::after { transform: translateY(1px) rotate(-135deg); }

/* ---- data page */
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.grid .num, .money .num { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid th.num { font-family: var(--sans); font-size: 12px; }
.grid .notes { font-size: 12px; color: var(--muted); max-width: 360px; }
.st-failed td:nth-child(4) { color: var(--bad); font-weight: 600; }
.st-done td:nth-child(4) { color: var(--ok); }
#jobs button { padding: 1px 8px; border-color: var(--line); background: #fff; color: var(--text); }
#progress { margin-top: 12px; }
.bar { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 13px; }
.bar .label { min-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.bar.ok .fill { background: var(--ok); }
.bar.bad { color: var(--bad); }
.bar .pct { min-width: 120px; text-align: right; font-family: var(--mono); font-size: 12px; }
.hscroll { overflow-x: auto; }

/* ---- screener */
body.loading #results { opacity: .5; transition: opacity .2s; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; }
.seg > * { padding: 5px 13px; background: var(--surface); color: var(--ink); border: 0; border-radius: 0; text-decoration: none; }
.seg > * + * { border-left: 1px solid var(--ink); }
.seg > .on { background: var(--ink); color: #fff; }
.seg .soon { color: var(--faint); }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pill { padding: 5px 11px; border: 1px solid #cfc9bc; border-radius: 3px; background: var(--surface); color: var(--text); }
.pill:hover { border-color: var(--ink); background: var(--surface); }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.dd { position: relative; }
.ddbtn { background: var(--surface); color: var(--text); border-color: #cfc9bc; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddbtn:hover { background: var(--surface); border-color: var(--ink); }
.dd-panel { position: absolute; z-index: 1100; top: 110%; left: 0; width: 320px; background: var(--surface); border: 1px solid var(--ink); border-radius: 3px; box-shadow: 0 10px 28px rgba(19,35,58,.14); padding: 8px; }
.dd-panel input[type=search] { width: 100%; }
.dd-list { max-height: 300px; overflow: auto; margin: 6px 0; }
.dd-list label { display: flex; gap: 6px; align-items: center; padding: 3px 4px; }
.dd-list .muted { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); padding: 14px; margin-bottom: 10px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px 28px; }
.fgrid > label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fgrid > label > span { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.panel-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.panel-actions .saved { display: inline-flex; align-items: center; gap: 4px; }
.panel-actions .saved select { max-width: 240px; }
.reshead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 16px 0 10px; }
#count { font-size: 15px; color: var(--ink); }
#why ul { margin: 6px 0; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.results th, .results td { padding: 8px 10px; }
.results tbody tr { cursor: pointer; }
.results tbody tr:hover { background: #fbf6ee; }
.results a { color: var(--ink); text-decoration: none; font-weight: 500; }
.results th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.results th.sortable:hover { color: var(--ink); }
.results tr.filters th { padding: 2px 4px 8px; border-bottom: 1px solid var(--ink); }
.results thead tr:first-child th { border-bottom: 0; }
.results tr.filters input { width: 100%; min-width: 48px; padding: 3px 6px; font-size: 12px; }
.results tr.filters input.bad { border-color: var(--bad); background: #fbeeec; }
.warnc { color: var(--warn); text-align: center; }
.est { font-style: italic; color: var(--muted); }
.cards { display: grid; gap: 10px; }
.rcard { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 3px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.rcard:hover { border-left-color: var(--accent); }
.rcard .row { justify-content: space-between; align-items: flex-start; }
.rcard .row + .row { margin-top: 8px; align-items: center; }
.rcard .big { font-size: 20px; }
#noleases summary { cursor: pointer; }
@media (max-width: 900px) { .results .opt { display: none; } }

/* ---- trend in the table */
.trend { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--mono); font-size: 13px; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--bad); }
.trend.flat { color: var(--muted); }
.trend .tbar { display: inline-block; width: 36px; height: 5px; background: var(--line); border-radius: 2px; overflow: hidden; }
.trend .tbar i { display: block; height: 100%; background: currentColor; }
.spark { vertical-align: middle; margin-left: 6px; }
.spark.up { color: var(--ok); }
.spark.down { color: var(--bad); }
.spark.flat { color: var(--muted); }

/* ---- explanations */
.tip { position: relative; display: inline-flex; color: var(--faint); cursor: help; margin-left: 3px; outline: none; vertical-align: middle; }
.tip:hover, .tip:focus { color: var(--ink); }
.tip .tipbox { display: none; position: absolute; z-index: 20; left: 50%; bottom: 140%; transform: translateX(-50%); width: 290px; max-width: 80vw;
  background: var(--ink); color: #fff; font: 400 12.5px/1.45 var(--sans); text-align: left; padding: 9px 11px; border-radius: 3px;
  box-shadow: 0 8px 22px rgba(19,35,58,.22); white-space: normal; text-transform: none; letter-spacing: 0; }
.tip:hover .tipbox, .tip:focus .tipbox { display: block; }
.kpis .tip .tipbox { left: 0; transform: none; }

/* ---- building page */
.kpis { display: flex; flex-wrap: wrap; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; min-width: 150px; border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis span:last-child { color: var(--muted); font-size: 12.5px; }
.kpis .bad { color: var(--bad); }
.card.warn { border-color: #ead7b8; border-left: 3px solid var(--warn); background: #fffbf3; }
.card.warn h2 { display: flex; align-items: center; gap: 8px; color: var(--warn); border-bottom-color: #ead7b8; }
.card.warn ul { margin: 0; padding-left: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
table.money { width: 100%; border-collapse: collapse; }
.money td { padding: 6px 0; border-bottom: 1px solid #f0ede6; }
.money .num { white-space: nowrap; padding-left: 12px; }
.money .sub td { font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--ink); }
.money .head { padding-top: 16px; font-size: 12px; font-weight: 600; color: var(--muted); }
.formula .num { white-space: normal; text-align: left; font-family: var(--sans); font-size: 14px; }
@media (max-width: 600px) { .formula td { display: block; padding: 2px 0; } .formula td.num { padding: 0 0 6px; color: var(--muted); } }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; }
.stack .row label { flex: 1; }
.stack button { align-self: flex-start; }
.stack label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.grid.compact td, .grid.compact th { padding: 4px 8px; }
.scrollbox { max-height: 420px; overflow-y: auto; }
.scrollbox thead th { position: sticky; top: 0; background: var(--surface); }

/* ---- charts */
.trendchart { display: block; width: 100%; height: auto; max-height: 320px; margin: 4px 0 6px; }
.trendchart .grid { stroke: var(--line); stroke-width: 1; }
.trendchart .axis { fill: var(--muted); font: 11px var(--mono); }
.trendchart .gap { fill: var(--faint); font: 10px var(--sans); }
.area-line { fill: none; stroke: #2563a8; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area-pt { fill: #2563a8; stroke: #fff; stroke-width: 2; }
.bdot { fill: #c26a12; fill-opacity: .8; stroke: #fff; stroke-width: 2; }
.bldg-line { fill: none; stroke: #c26a12; stroke-width: 2; stroke-dasharray: 6 3; stroke-linejoin: round; }
.bldg-pt { fill: #c26a12; stroke: #fff; stroke-width: 2; }
.trendchart .hit { fill: transparent; cursor: help; }
.trendchart circle:hover { stroke: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
#trend details summary { cursor: pointer; margin-top: 6px; }
#trend .charthead { font-size: 13px; margin: 16px 0 4px; padding: 0; border: 0; }

/* ---- map */
.maphead { justify-content: space-between; margin-bottom: 8px; }
#map { height: 540px; border: 1px solid var(--line); border-radius: 4px; background: #eceae3; isolation: isolate; }   /* keeps Leaflet's layers (z-index 400–1000) under the filter dropdowns */
@media (max-width: 600px) { #map { height: 60vh; } }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px #cfc9bc; }
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content button.link { padding: 4px 0 0; }

/* ---- settings */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px 36px; }
.field { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.field .inputs { display: inline-flex; align-items: center; gap: 6px; }
.field .inputs > input { width: 90px; text-align: right; font-family: var(--mono); }
.field .unit { color: var(--muted); min-width: 70px; font-size: 12px; }
.field .verify { font-size: 12px; color: var(--warn); display: inline-flex; gap: 4px; align-items: center; }
.field .was { width: 100%; text-align: right; font-size: 11px; color: var(--muted); }
.actions { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); }
#area-sc input { width: 100%; }

/* ---- phones */
@media (max-width: 600px) {
  .top { flex-wrap: wrap; height: auto; gap: 0 14px; padding: 8px 14px 0; }
  nav { width: 100%; order: 3; overflow-x: auto; }
  nav a, nav .soon { padding: 10px 10px 8px; }
  main { padding: 16px 14px 40px; }
  .fields { grid-template-columns: 1fr; }
  .kpis > div { flex: 1 1 45%; border-right: 0; border-bottom: 1px solid var(--line); }
}
.money .num.text { font-family: var(--sans); font-size: 14px; white-space: normal; }
