@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --page: #eef1ec;
  --surface: #fcfdfb;
  --surface-2: #f4f7f2;
  --ink: #12241b;
  --ink-2: #4a5a51;
  --muted: #74817a;
  --line: #dce3da;
  --line-strong: #c3cec4;
  --brand: #1e5b43;
  --brand-hover: #174a36;
  --brand-soft: #e1ede6;
  --on-brand: #eaf3ee;
  --on-brand-muted: #a9c6b6;
  --series-1: #14805a;
  --series-2: #c9821c;
  --track: #e0e9e2;
  /* status: teal-green / amber / red, validated for red-green colour blindness (ΔE 11.5);
     every status also has a shape (circle / triangle / square) so colour is never the only cue */
  --good: #0b8a7a;
  --warning: #e8a33d;
  --serious: #ec835a;
  --critical: #d0342c;
  --st-on: #0b8a7a;
  --st-wait: #e8a33d;
  --st-bad: #d0342c;
  --st-wait-text: #1a1a1a;  /* white on amber is 2.2:1, dark text is 8.1:1 */
  /* magnitude (fulfilment %, capacity share): one blue, never a status colour */
  --data: #2f62a8;
  /* base map stays recessive so the project markers carry the data */
  --map-on: #24365f;
  --map-off: #8e9dbb;
  --map-dim: #a9b5cc;
  --map-sel: #1b2a55;
  --map-hover: #34508e;
  --map-edge: #ffffff;
  --neutral: #98a39c;
  --good-ink: #006300;
  --critical-ink: #a32424;
  --shadow: 0 1px 2px rgba(18, 36, 27, .04), 0 8px 24px -14px rgba(18, 36, 27, .14);
}
/* light is the default; dark only when the viewer picks it with the theme button */
:root[data-theme="dark"] {
  color-scheme: dark;
  --shadow: none;
  --good: #0f9a88;
  --warning: #bf8a1e;
  --critical: #de4f6a;
  --st-on: #0f9a88;
  --st-wait: #bf8a1e;
  --st-bad: #de4f6a;
  --data: #5b8fd6;
  --map-on: #2e4a85;
  --map-off: #2a3242;
  --map-dim: #232a37;
  --map-sel: #3d5fa6;
  --map-hover: #3a5898;
  --map-edge: #141c18;
  --page: #0d1310;
  --surface: #141c18;
  --surface-2: #19231e;
  --ink: #e7eee9;
  --ink-2: #b3c1b8;
  --muted: #84928a;
  --line: #26322b;
  --line-strong: #35453b;
  --brand: #133b2c;
  --brand-hover: #18493a;
  --brand-soft: #1b2e25;
  --on-brand: #e3efe8;
  --on-brand-muted: #8fb19f;
  --series-1: #22a070;
  --series-2: #cc7f1f;
  --track: #23312a;
  --neutral: #6f7c74;
  --good-ink: #2fbf5a;
  --critical-ink: #ef7b7b;
}

html { background: var(--page); }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }

.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px; }

/* ---------- progress bar ---------- */
.rail {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.rail > .fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--data);
}
.rail.rail-sm { height: 6px; }

/* ---------- ledger table ---------- */
.ledger th { font-weight: 500; color: var(--muted); font-size: 13px; text-align: left; }
.ledger td, .ledger th { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .total td { background: var(--surface-2); font-weight: 600; }

.data-table th { font-weight: 500; color: var(--muted); font-size: 13px; text-align: left; white-space: nowrap; }
.data-table td, .data-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- svod table (mirrors the official Excel layout) ---------- */
.svod th { font-weight: 500; color: var(--muted); font-size: 12.5px; text-align: center; padding: 8px 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); line-height: 1.3; }
.svod thead tr:first-child th { color: var(--ink-2); font-size: 13px; }
.svod th:first-child { border-left: 0; text-align: left; }
.svod td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.svod td:first-child { text-align: left; font-variant-numeric: normal; }
.svod td:nth-child(2), .svod td:nth-child(5), .svod td:nth-child(8), .svod td:nth-child(12) { border-left: 1px solid var(--line); }
.svod tr:last-child td { border-bottom: 0; }
.svod tr.total td { background: var(--surface-2); font-weight: 600; }
.svod tbody tr:not(.total):hover td { background: var(--surface-2); }

/* ---------- per-project plan/fact matrix ---------- */
.matrix th { font-weight: 500; color: var(--muted); font-size: 12.5px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.3; vertical-align: bottom; }
.matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.matrix td + td, .matrix th + th { border-left: 1px solid var(--line); }
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover td { background: var(--surface-2); }
/* project names stay put while the indicator columns scroll sideways */
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.matrix tbody tr:hover td:first-child { background: var(--surface-2); }

/* ---------- headline numbers: one panel split by hairlines ---------- */
.kpis { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.kpis > div { background: var(--surface); }

/* ---------- direction tabs & segmented control ---------- */
.tab { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 10px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab-on, .tab-on:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.tab-count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tab-on .tab-count { background: rgba(255,255,255,.16); color: var(--on-brand); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 7px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-lg a { padding: 8px 16px; font-size: 14.5px; }
.seg a .tab-count { background: var(--surface); }
.seg a[aria-current="page"] .tab-count { background: var(--brand-soft); color: var(--ink); }

/* ---------- one-row filter bar: small label above each select ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filter-bar label > span { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.filter-bar .field { width: auto; min-width: 170px; max-width: 320px; }

.bank-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.bank-tile { display: block; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; color: var(--ink); }
.bank-tile:hover { border-color: var(--line-strong); }
.bank-tile.on { border-color: var(--series-1); box-shadow: 0 0 0 1px var(--series-1); }

/* ---------- sortable headers, change since last month, data freshness ---------- */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--ink); }
th[data-sort]::after { content: "↕"; margin-left: 4px; font-size: 11px; color: var(--muted); opacity: .55; }
th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: var(--ink); }
th[aria-sort="descending"]::after { content: "↓"; opacity: 1; color: var(--ink); }
.delta { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.delta-good { color: var(--good-ink); }
.delta-bad { color: var(--critical-ink); }
.fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.fresh b { color: var(--ink); font-weight: 600; }
.fresh:not(.fresh-ok) { border-left: 4px solid var(--st-wait); }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.status svg { width: 16px; height: 16px; flex: none; }
.tone-good svg { color: var(--good); }
.tone-warning svg { color: var(--warning); }
.tone-critical svg { color: var(--critical); }
.tone-neutral svg { color: var(--neutral); }

/* ---------- form controls ---------- */
.field {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
}
.field:focus { outline: 2px solid var(--series-1); outline-offset: 0; border-color: transparent; }
.field.invalid { border-color: var(--critical); }
select.field {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2374817a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.unit-chip { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--brand-soft); border: 1px solid var(--line-strong); vertical-align: 1px; }
.num-wrap, .pw-wrap { position: relative; display: block; }
.num-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }
.pw-wrap .field { padding-right: 44px; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); padding: 6px; border-radius: 6px; color: var(--muted); line-height: 0; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--critical-ink); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--surface-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--series-1); background: var(--brand-soft); }
.choice input { accent-color: var(--series-1); width: 16px; height: 16px; }

/* ---------- monthly entry cards ---------- */
.entry-card { padding: 22px 24px; scroll-margin-top: 16px; container-type: inline-size; }
.entry-card.has-error { border-color: var(--critical); }
.ec-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; }
.ec-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; }
/* on the single-project page the card has no header: its first block needs no divider */
.entry-card form > input[type=hidden] + input[type=hidden] + .ec-block { margin-top: 0; border-top: 0; padding-top: 0; }
.ec-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ec-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ec-label { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.ec-hint { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.ec-err { display: block; margin-top: 4px; font-size: 12.5px; color: var(--critical-ink); }
.ec-req { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--critical-ink); border: 1px solid currentColor; vertical-align: 1px; }
.ec-prev { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ec-link { font-size: 13px; color: var(--series-1); text-decoration: underline; text-underline-offset: 2px; }
.ec-summary { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.ec-summary b { color: var(--ink); font-weight: 600; }
/* field widths follow the expected text: a long company name, a 9–14 digit STIR, a person's name */
.ec-company { margin-top: 10px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .ec-company { grid-template-columns: minmax(0, 1.6fr) 13ch minmax(0, 1.2fr); } }
.ec-f-stir input { letter-spacing: .04em; }
.ec-yesno { margin-top: 8px; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.ec-foot { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

/* full card: the official table's sections fold; the count says what is left */
.ec-sec { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.ec-sec > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; cursor: pointer; list-style: none; }
.ec-sec > summary::-webkit-details-marker { display: none; }
.ec-sec > summary .ec-title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 10px 2px 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; }
.ec-sec[open] > summary .ec-title::before { transform: rotate(45deg); }
.filebtn { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.filebtn:focus-within .btn { outline: 2px solid var(--series-1); outline-offset: 2px; }
.filebtn.invalid .btn { border-color: var(--critical); }
.filebtn-name { min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-sec[open] > summary { border-bottom: 1px solid var(--line); }
.ec-sec .pf { margin-top: 0; padding-bottom: 6px; }
.ec-count { font-size: 12.5px; color: var(--critical-ink); white-space: nowrap; }
.ec-count-ok { color: var(--good-ink); }
.ec-texts { display: grid; gap: 12px; padding: 4px 0 16px; }
@media (min-width: 900px) { .ec-texts { grid-template-columns: 1fr 1fr; } }
.ec-fixed { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.ec-fixed b { color: var(--ink); font-weight: 600; }
.ec-mon { margin-top: 10px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ec-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--series-1); }
.ec-file svg { width: 14px; height: 14px; }
.ec-file { max-width: 100%; min-width: 0; }
.ec-file-cut, .ec-file-name span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-file-new { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; min-width: 0; font-size: 12.5px; }
.ec-file-name { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-weight: 500; }
.ec-file-name svg { width: 14px; height: 14px; flex: none; }
.ec-mon-hint { grid-column: 1 / -1; margin: 0; }
/* a part sits under its whole: indented, hung on a thin line, opened once the whole has a number */
.pf-row.pf-child { position: relative; margin-left: 22px; padding-left: 20px; border-top-style: dotted; }
.pf-child::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line-strong); }
.pf-child::after { content: ""; position: absolute; left: 0; top: 50%; width: 10px; border-top: 2px solid var(--line-strong); }
.pf-child .pf-name { font-weight: 400; color: var(--ink-2); }
.pf-child .pf-input { height: 42px; font-size: 16px; }
/* bracketed details of a figure, asked under it */
.pf-detail { position: relative; margin: 2px 0 6px 22px; padding: 12px 14px 14px 20px; border-left: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.pf-detail-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.pf-detail-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pf-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pf-detail-wide { grid-column: 1 / -1; } }
.pf-rate { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
/* credit currency: which currencies, then each part typed by hand */
.cr-modes { margin-top: 6px; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .cr-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cr-modes .choice { padding: 10px 12px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13.5px; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--series-1); background: var(--brand-soft); }
.chip input { accent-color: var(--series-1); width: 15px; height: 15px; }
.pf-noplan { color: var(--muted); }
@media (min-width: 760px) { .ec-f-phone { grid-column: span 2; max-width: 320px; } }

/* plan | fact | share: one row per indicator, the fact input is the largest thing in the row */
.pf { margin-top: 10px; display: grid; }
.pf-row { display: grid; gap: 6px 16px; align-items: start; padding: 12px 0; border-top: 1px dashed var(--line-strong); grid-template-columns: minmax(0, 1fr); }
.pf-row:first-child, .pf-headrow + .pf-row { border-top: 0; }
.pf-headrow { display: none; }
.pf-name { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.3; padding-top: 2px; }
.pf-unit { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pf-plan { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--ink-2); }
.pf-plan .tnum { font-size: 16px; font-weight: 600; color: var(--ink); }
.pf-plan-label { font-size: 12.5px; color: var(--muted); }
.pf-plan-in { flex-wrap: wrap; align-items: center; }
.pf-plan-field { height: 40px; width: 100%; max-width: 150px; text-align: right; font-size: 15px; font-weight: 600; }
.field-ro { display: flex; align-items: center; min-height: 42px; background: var(--surface-2); color: var(--ink); font-weight: 500; cursor: default; }
.pf-input { height: 48px; font-size: 18px; font-weight: 600; padding-right: 64px; }
.pf-fact .num-unit { font-size: 12.5px; }
.pf-prev { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.pf-bad .pf-name { color: var(--critical-ink); }
@media (min-width: 900px) {
  .pf-row { grid-template-columns: minmax(150px, 1.15fr) minmax(110px, .8fr) minmax(200px, 1.5fr) minmax(110px, .8fr); align-items: center; }
  .pf-headrow { display: grid; padding: 0 0 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
  .pf-plan { flex-direction: column; align-items: flex-end; gap: 0; text-align: right; }
  .pf-plan-in { gap: 4px; align-items: flex-end; }
  .pf-plan-field { max-width: 170px; }
  .pf-plan-label { display: none; }
  .pf-fact .ec-err, .pf-prev { position: static; }
}
/* a wide card (one card on a big screen): short sections side by side, the long one across,
   and the number columns kept to a readable width instead of stretching */
@container (min-width: 1250px) {
  .ec-secs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; margin-top: 14px; }
  .ec-secs > .ec-sec { margin-top: 0; }
  .ec-sec-wide { grid-column: 1 / -1; }
  .ec-sec-wide .pf-row { grid-template-columns: minmax(240px, 1.3fr) minmax(130px, 180px) minmax(260px, 420px) minmax(180px, 1fr); }
}
.only-todo .entry-card[data-state="done"] { display: none; }
.asset-card { padding: 16px 18px; }
.asset-card .choice { padding: 9px 12px; font-size: 14px; }
.hide-sold .asset-card[data-status="sold"] { display: none; }
.facts { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.facts > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin-top: 2px; }
.filepick { display: block; width: 100%; font-size: 13px; color: var(--ink-2); }
.filepick::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.filepick.invalid::file-selector-button { border-color: var(--critical); }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request button { opacity: .6; pointer-events: none; }
.howto summary { padding: 12px 16px; cursor: pointer; font-weight: 500; }
.howto ol { list-style: decimal; padding: 0 20px 14px 40px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.howto b { color: var(--ink); font-weight: 600; }

/* ---------- phone book: one group per project / bank, coloured stripe and number pills ---------- */
/* group colours only tell neighbours apart; each keeps white text at 4.5:1 or more */
/* newspaper columns: groups of different heights pack without gaps and read top to bottom */
.pb-list { columns: 620px; column-gap: 12px; }
.pb-group { --gc: #2563eb; break-inside: avoid; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--gc); border-radius: 6px 12px 12px 6px; box-shadow: var(--shadow); padding: 12px 16px 10px 18px; }
.pb-group:nth-child(12n+1) { --gc: #2563eb; }
.pb-group:nth-child(12n+2) { --gc: #0f766e; }
.pb-group:nth-child(12n+3) { --gc: #7e22ce; }
.pb-group:nth-child(12n+4) { --gc: #c2410c; }
.pb-group:nth-child(12n+5) { --gc: #4d7c0f; }
.pb-group:nth-child(12n+6) { --gc: #b91c1c; }
.pb-group:nth-child(12n+7) { --gc: #0e7490; }
.pb-group:nth-child(12n+8) { --gc: #9d174d; }
.pb-group:nth-child(12n+9) { --gc: #4338ca; }
.pb-group:nth-child(12n+10) { --gc: #b45309; }
.pb-group:nth-child(12n+11) { --gc: #1e40af; }
.pb-group:nth-child(12n+12) { --gc: #78350f; }
.pb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pb-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.pb-meta { margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.pb-edit { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ink-2); border: 1px solid var(--line-strong); background: var(--surface); }
.pb-edit:hover { color: var(--ink); background: var(--surface-2); }
.pb-edit svg { width: 16px; height: 16px; }
.pb-rows { margin-top: 6px; }
.pb-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 0; }
.pb-row + .pb-row { border-top: 1px dashed var(--line-strong); }
.pb-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--gc); color: #fff; font-size: 11px; font-weight: 700; }
.pb-who { display: grid; gap: 1px; min-width: 0; }
.pb-name { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.pb-pos { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pb-pill { min-width: 176px; padding: 5px 16px; border-radius: 999px; background: var(--gc); color: #fff; font-size: 15.5px; font-weight: 700; letter-spacing: .02em; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-pill:hover { filter: brightness(1.12); }
.pb-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pb-empty .pb-num { background: var(--track); color: var(--muted); }
.pb-empty .pb-name { font-size: 13.5px; color: var(--muted); }
@media (max-width: 520px) { .pb-row { grid-template-columns: 24px minmax(0, 1fr); } .pb-pill, .pb-empty .btn { grid-column: 2; justify-self: start; } }
.phone-form { display: grid; gap: 10px; margin-top: 10px; }
.phone-input-row { display: grid; grid-template-columns: minmax(140px, 170px) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .phone-input-row { grid-template-columns: minmax(0, 1fr) auto; } .phone-input-row > input:not(:first-child) { grid-column: 1; } .phone-input-row > button { grid-row: 1; grid-column: 2; } }

/* ---------- chart chrome ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }

.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--on-brand-muted); font-size: 14px; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover { color: var(--on-brand); background: rgba(255,255,255,.06); }
.nav-link.active { color: var(--on-brand); background: rgba(255,255,255,.10); box-shadow: inset 3px 0 0 #d9a849; }

/* ---------- dashboard in the digest style ---------- */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.shape { display: inline-block; flex: none; vertical-align: -1px; }
.legend .key { gap: 6px; }

/* headline: one large share-launched tile, then four supporting tiles */
.kpi-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-hero { grid-column: span 2; }
@media (min-width: 900px) { .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpi-hero { grid-column: span 4; } .kpi-short .kpi-hero { grid-column: span 2; } }
@media (min-width: 1380px) { .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } .kpi-hero { grid-column: span 2; } .kpi-short { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi-value { margin-top: 8px; font-size: 30px; line-height: 1.05; font-weight: 650; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.kpi-value span { margin-left: 6px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.kpi-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-bar { margin-top: 10px; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.kpi-bar > div { height: 100%; background: var(--st-on); border-radius: 999px; }
.kpi-hero .kpi-value { font-size: 40px; }
.kpi-hero .sbar { height: 22px; margin-top: 12px; }
.kpi-hero .legend { margin-top: 8px; font-size: 12.5px; }

.map-panel { padding: 18px 20px; }
.uz-map { display: block; width: 100%; height: auto; }
.uz-map .rg { stroke: var(--map-edge); stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: fill .15s ease; }
.uz-map .rg.on { fill: var(--map-on); }
.uz-map .rg.off { fill: var(--map-off); }
.uz-map .rg.dim { fill: var(--map-dim); }
.uz-map .rg.sel { fill: var(--map-sel); }
.uz-map a .rg:hover, .uz-map .rg.on:hover { fill: var(--map-hover); cursor: pointer; }
.uz-map .pt { stroke: var(--surface); stroke-width: var(--pt-stroke, 1.6); }
.uz-map .pt-launched { fill: var(--st-on); }
.uz-map .pt-inprogress { fill: var(--st-wait); }
.uz-map .pt-overdue { fill: var(--st-bad); }
.uz-map a:hover .pt { stroke: var(--ink); }
.map-tip { position: absolute; top: 4px; right: 4px; min-width: 190px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgba(0,0,0,.25); pointer-events: none; }

.sbar-row { display: grid; grid-template-columns: minmax(96px, 128px) 1fr 28px; align-items: center; gap: 10px; font-size: 13.5px; }
a.sbar-row:hover .sbar-label { text-decoration: underline; }
.sbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.sbar { display: flex; gap: 2px; height: 20px; }
.sbar > span { display: flex; align-items: center; justify-content: center; min-width: 18px; font-size: 11.5px; font-weight: 650; color: #fff; }
.sbar > span:first-child { border-radius: 4px 0 0 4px; }
.sbar > span:last-child { border-radius: 0 4px 4px 0; }
.sbar > span:only-child { border-radius: 4px; }
.seg-on { background: var(--st-on); }
.seg-wait { background: var(--st-wait); color: var(--st-wait-text) !important; }
.seg-bad { background: var(--st-bad); }
.sbar-n { text-align: right; font-weight: 600; color: var(--ink); }

.problems .problem { padding-left: 14px; border-left: 2px solid var(--st-bad); }

/* ---------- digests ---------- */
.digest-card { display: block; padding: 20px; transition: border-color .15s ease, transform .15s ease; }
.digest-card:hover { border-color: var(--series-1); transform: translateY(-1px); }
.digest-featured { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 70%); border-color: var(--line-strong); }
.digest-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, .18); }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live 2s ease-in-out infinite; }
  @keyframes live { 50% { box-shadow: 0 0 0 6px rgba(12, 163, 12, .05); } }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  aside, .no-print { display: none !important; }
  main { padding: 0 !important; }
  html, body { background: #fff !important; }
  .panel, .kpis { box-shadow: none !important; }
  .overflow-x-auto { overflow: visible !important; }
  .print-block, .kpis, tr { break-inside: avoid; }
  table { min-width: 0 !important; font-size: 11px; }
  a { color: inherit; text-decoration: none; }
}
