/* Eco Solution — design B, "Fatura e kursimit" (user's choice, 2026-11-02).
   Electric-cobalt ground; every page is a sheet of white receipt paper; Archivo for words, JetBrains Mono
   for numbers. One colour per resource: water cobalt, sun amber, waste red-orange, food mint. */
:root {
  --ground: #1d2bff;
  --ground-2: #1520d6;
  --on-ground: #ffffff;
  --on-ground-2: #c9cdff;
  --paper: #f3f4fa;      /* inputs, wells inside the sheet */
  --paper-2: #e6e8f3;
  --card: #ffffff;       /* the receipt paper */
  --ink: #111318;
  --ink-2: #4a4f5e;
  --ink-3: #7c8193;
  --rule: #d9dce8;
  --water: #1d2bff;
  --water-soft: #dfe2ff;
  --waste: #ff5a1f;
  --waste-soft: #ffe2d6;
  --food: #00a874;
  --food-soft: #d4f5ea;
  --sun: #ffb000;
  --sun-soft: #fff0c9;
  --stamp: #ff3b1f;
  --mint: #00d68f;
  --em: var(--ground);   /* highlighted words on the paper */
  --w-food: var(--food); --w-paper: #b08a4f; --w-plastic: #2fa3c4; --w-glass: #3fb36b; --w-metal: #7c8193; --w-mixed: #3a3d48; --w-hazardous: #e0201b;
  --alarm: #e0201b;
  --ok: #00a874;
  --serif: "Archivo", system-ui, -apple-system, sans-serif;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Design B keeps its white receipt paper at night; only the ground darkens. */
    --ground: #070a33; --ground-2: #0d1150; --on-ground-2: #9aa0e6;
  }
}
:root[data-theme="dark"] {
  --ground: #070a33; --ground-2: #0d1150; --on-ground-2: #9aa0e6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }

/* ---------- shell: cobalt top bar; on the phone the menu is a white bar at the bottom ---------- */
.shell { min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 22px; padding: 14px clamp(16px, 4vw, 48px); color: var(--on-ground); }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-ground); font: 800 15px var(--sans); font-stretch: 125%; letter-spacing: .04em; white-space: nowrap; }
.mark i { width: 13px; height: 13px; background: var(--on-ground); transform: rotate(45deg); }
.tabs { display: flex; gap: 2px; flex: 1; justify-content: center; }
.tab { display: flex; align-items: center; gap: 7px; padding: 8px 12px; text-decoration: none; color: var(--on-ground-2); font: 500 12.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.tab svg { width: 17px; height: 17px; }
.tab:hover { color: var(--on-ground); }
.tab[aria-current="page"] { color: var(--on-ground); border-bottom-color: var(--mint); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .co { color: var(--on-ground); font: 600 13px var(--sans); text-decoration: none; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions .co[aria-current] { text-decoration: underline; }
.lang { background: none; border: 1.5px solid rgba(255,255,255,.45); color: var(--on-ground); border-radius: 0; padding: 5px 10px; font: 600 12px var(--mono); cursor: pointer; min-height: 32px; }

main { min-width: 0; padding: 8px clamp(10px, 3vw, 40px) 70px; outline: none; }
/* Every screen is one sheet of receipt paper, scalloped at the top. */
.page { max-width: 1180px; margin: 0 auto; background: var(--card); padding: 34px clamp(16px, 3.4vw, 44px) 44px; position: relative;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 40, .55); }
.page::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: radial-gradient(circle 6px at 8px 8px, transparent 5.5px, var(--card) 6px) 0 0 / 16px 8px repeat-x; }
.page.bare { background: none; box-shadow: none; padding: 0; } .page.bare::before { display: none; }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar .tabs { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; background: var(--card); justify-content: space-around; gap: 0;
    padding: 0 0 env(safe-area-inset-bottom); box-shadow: 0 -10px 30px -12px rgba(0,0,40,.35); }
  .tab { flex: 1; flex-direction: column; gap: 4px; padding: 9px 2px 8px; font-size: 9.5px; letter-spacing: .02em; color: var(--ink-3); border-bottom: 0; border-top: 3px solid transparent; }
  .tab:hover { color: var(--ink); }
  .tab[aria-current="page"] { color: var(--ink); border-top-color: var(--ground); }
  .tab svg { width: 21px; height: 21px; }
  .top-actions { margin-left: auto; } .top-actions .co { display: none; }
  main { padding: 6px 8px 100px; }
  .page { padding: 24px 16px 32px; }
}

/* ---------- headings ---------- */
.eyebrow { font: 600 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
h1, h2, h3 { font-family: var(--sans); font-weight: 800; margin: 0; letter-spacing: -.02em; font-stretch: 112%; }
h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1; }
h2 { font-size: 24px; line-height: 1.1; }
h3 { font-size: 17px; line-height: 1.2; font-stretch: 118%; letter-spacing: -.005em; }
.lede { color: var(--ink-2); max-width: 62ch; margin: 10px 0 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1.5px dashed var(--rule); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- ledger hero (dashboard) ---------- */
.ledger { position: relative; padding: 4px 0 28px; margin-bottom: 26px; border-bottom: 1.5px solid var(--ink); }
.ledger .contours { position: absolute; inset: -34px -56px 0 auto; width: min(560px, 70%); height: calc(100% + 34px); color: var(--rule); pointer-events: none; z-index: 0; }
.ledger > *:not(.contours) { position: relative; z-index: 1; }
.ledger h1 em { font-style: italic; font-weight: 400; }
.ledger .company { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.ledger .company b { font: 600 13px var(--sans); }
.statement { font: 500 clamp(18px, 2.2vw, 24px)/1.4 var(--sans); max-width: 34em; margin-top: 14px; }
.statement .w { color: var(--water); font-weight: 600; }
.statement .f { color: var(--food); font-weight: 600; }
.statement .x { color: var(--waste); font-weight: 600; }
.statement .s { color: var(--sun); font-weight: 600; }
.statement.money { font-size: clamp(22px, 3vw, 34px); }
.statement.money b { font-weight: 600; }
.statement.money b.s { color: var(--ok); }

/* ---------- modules grid ---------- */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1020px) { .modules { grid-template-columns: 1fr; } }
.mod {
  --c: var(--ink); --cs: var(--paper-2);
  background: var(--card); border: 1px solid var(--rule); border-top: 6px solid var(--c);
  border-radius: 0 0 var(--r) var(--r); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: inherit; position: relative; min-height: 330px;
}
.mod:hover { border-color: var(--c); }
.mod.water { --c: var(--water); --cs: var(--water-soft); }
.mod.waste { --c: var(--waste); --cs: var(--waste-soft); }
.mod.sun { --c: var(--sun); --cs: var(--sun-soft); }
.mod .top { display: flex; justify-content: space-between; align-items: baseline; }
.mod .top .eyebrow { color: var(--c); }
.big { font: 800 48px/1 var(--sans); font-stretch: 78%; letter-spacing: -.035em; }
.big small { font: 500 15px var(--mono); margin-left: 6px; color: var(--ink-2); letter-spacing: 0; }
.mod .sub { color: var(--ink-2); font-size: 13.5px; }
.mod .foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--rule); padding-top: 10px; font-size: 13px; }
.mod .foot b { font-family: var(--mono); font-weight: 500; }
.empty-mod { color: var(--ink-3); font-size: 14px; }

/* ---------- panels, cards ---------- */
.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.grid2.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 960px) { .grid2, .grid2.even { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px; }
.panel + .panel { margin-top: 18px; }
.grid2 > div > .panel + .panel { margin-top: 18px; }
.panel h3 { margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.kpi { padding: 14px 16px 14px 0; }
.kpi + .kpi { padding-left: 16px; border-left: 1px solid var(--rule); }
.kpi .v { font: 800 32px/1.05 var(--sans); font-stretch: 80%; letter-spacing: -.03em; }
.kpi .v small { font: 400 13px var(--mono); color: var(--ink-2); margin-left: 4px; }
.kpi .l { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.kpi.hl .v { color: var(--accent, var(--ink)); }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; }
.field > span { font: 500 12px/1.2 var(--sans); color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=number], input[type=month], input[type=date], select, textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--rule); border-bottom: 1.5px solid var(--ink-2);
  border-radius: 2px; padding: 9px 10px; font-size: 15px; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent, var(--ink)); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.form-row + .form-row { margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 42px; padding: 0 16px; border-radius: 2px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); font: 500 14px var(--sans); text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* ---------- tables ---------- */
table.ledger-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger-t th { text-align: left; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px; border-bottom: 1.5px solid var(--ink); }
.ledger-t td { padding: 8px; border-bottom: 1px solid var(--rule); }
.ledger-t td.n, .ledger-t th.n { text-align: right; font-family: var(--mono); }
.ledger-t tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; max-height: 360px; overflow-y: auto; }

/* ---------- chips, notes ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); padding: 3px 8px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.chip.example { background: repeating-linear-gradient(-45deg, var(--sun-soft) 0 6px, transparent 6px 12px); color: var(--ink); border: 1px solid var(--sun); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink)); display: inline-block; }
.note { font-size: 13px; color: var(--ink-2); border-left: 3px solid var(--rule); padding: 4px 0 4px 12px; margin: 12px 0 0; }
.note.warn { border-color: var(--sun); }
.note.alarm { border-color: var(--alarm); }
.src { font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); }
.src a { color: var(--ink-3); }
.banner-example {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 20px; font-size: 13.5px;
  background: repeating-linear-gradient(-45deg, var(--sun-soft) 0 10px, var(--card) 10px 20px); border: 1px solid var(--sun);
}

/* ---------- idea / action list ---------- */
.ideas { list-style: none; padding: 0; margin: 0; counter-reset: i; }
.ideas li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); counter-increment: i; }
.ideas li::before { content: counter(i, decimal-leading-zero); font: 500 13px var(--mono); color: var(--accent, var(--ink-3)); padding-top: 2px; }
.ideas li:last-child { border-bottom: 0; }
.ideas .t { font-weight: 600; }
.ideas .d { color: var(--ink-2); font-size: 13.5px; }
.ideas .gain { text-align: right; font: 500 14px var(--mono); white-space: nowrap; }
.ideas .gain small { display: block; color: var(--ink-3); font-size: 11px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 11px var(--mono); fill: var(--ink-3); }
.chart .axis { stroke: var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* compare bar */
.cmp { display: grid; gap: 8px; margin-top: 6px; }
.cmp .row { display: grid; grid-template-columns: 120px 1fr 80px; gap: 10px; align-items: center; font-size: 13px; }
.cmp .bar { height: 14px; background: var(--paper-2); position: relative; }
.cmp .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--ink)); }
.cmp .row .n { text-align: right; font-family: var(--mono); }

/* transformation flow (waste → what it becomes) */
.flow { display: grid; grid-template-columns: 1fr 26px 1fr; gap: 10px; align-items: stretch; }
.flow .from, .flow .to { background: var(--paper); border: 1px solid var(--rule); padding: 12px; }
.flow .arrow { display: grid; place-items: center; color: var(--ink-3); }
.flow .to { display: grid; gap: 10px; }
.flow .out { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: baseline; border-bottom: 1px dashed var(--rule); padding-bottom: 8px; }
.flow .out:last-child { border-bottom: 0; padding-bottom: 0; }
.flow .out b { font: 700 18px var(--mono); }
@media (max-width: 560px) { .flow { grid-template-columns: 1fr; } .flow .arrow { transform: rotate(90deg); height: 20px; } }

/* ---------- map ---------- */
.map-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 0; border: 1.5px solid var(--ink); min-height: 70vh; background: var(--card); }
#map { min-height: 70vh; background: var(--paper-2); }
.map-side { border-left: 1.5px solid var(--ink); padding: 16px; overflow-y: auto; max-height: 80vh; }
.map-side h3 { margin: 4px 0 10px; }
.layer { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: start; cursor: pointer; }
.layer input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }
.layer .name { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.layer .swatch { width: 18px; height: 10px; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.near { margin-top: 14px; }
#near > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: 13.5px; }
.near b { font-family: var(--mono); font-weight: 500; }
.placeholder-flag { background: repeating-linear-gradient(-45deg, var(--sun-soft) 0 8px, var(--card) 8px 16px); border: 1px solid var(--sun); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
@media (max-width: 860px) {
  .map-wrap { grid-template-columns: 1fr; }
  #map { min-height: 56vh; }
  .map-side { border-left: 0; border-top: 1.5px solid var(--ink); max-height: none; }
}
.leaflet-container { font: 13px var(--sans); }
.leaflet-popup-content-wrapper { border-radius: 2px; }
.site-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--stamp); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* ---------- report ---------- */
.sheet {
  background: #fff; color: #111318; max-width: 820px; margin: 0 auto; padding: 44px 50px 36px;
  border: 1.5px dashed var(--rule);
  --ink: #111318; --ink-2: #4a4f5e; --ink-3: #7c8193; --rule: #d9dce8; --paper: #f3f4fa; --paper-2: #e6e8f3;
  --water: #1d2bff; --waste: #ff5a1f; --food: #00a874; --sun: #e09a00;
}
.sheet .rhead { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; gap: 20px; }
.sheet .rhead h1 { font-size: 34px; }
.sheet .rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 18px 0; border-bottom: 1px solid var(--rule); }
.sheet .rcol { padding: 0 16px 16px; border-left: 1px solid var(--rule); }
.sheet .rcol:first-child { padding-left: 0; border-left: 0; }
.sheet .rcol h3 { font-size: 15px; display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.sheet .line { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; gap: 10px; }
.sheet .line b { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.sheet .total { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; background: var(--paper); padding: 14px 16px; }
.sheet .total .big { font-size: 40px; }
.sheet .foot { font: 10.5px/1.45 var(--mono); color: var(--ink-3); margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 10px; }
.sheet .foot ol { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 700px) { .sheet { padding: 22px 18px; } .sheet .rgrid { grid-template-columns: 1fr; } .sheet .rcol { border-left: 0; padding: 12px 0; border-top: 1px solid var(--rule); } }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .rail, .no-print, .banner-example .btn { display: none !important; }
  .shell { display: block; }
  main { padding: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

/* ---------- onboarding / company ---------- */
.sector-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.sector-pick label { border: 1px solid var(--rule); background: var(--paper); padding: 12px; cursor: pointer; display: grid; gap: 4px; }
.sector-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sector-pick label:has(input:checked) { border: 1.5px solid var(--ink); background: var(--card); box-shadow: inset 0 -4px 0 var(--ink); }
.sector-pick b { font-family: var(--sans); font-weight: 800; font-stretch: 112%; font-size: 16px; }
.sector-pick small { color: var(--ink-3); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 14px; z-index: 2000; border-radius: 2px; }
.muted { color: var(--ink-3); }
.mt { margin-top: 18px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* bills table: a paper ledger you type into */
.bills-t td { padding: 4px 6px; }
.bills-t td:first-child { white-space: nowrap; font-weight: 500; }
input.cell { min-height: 36px; padding: 6px 8px; text-align: right; font-family: var(--mono); font-size: 14px; background: transparent; border: 1px solid transparent; border-bottom: 1px dashed var(--rule); width: 100%; min-width: 84px; }
input.cell:hover { border-bottom-color: var(--ink-3); }
input.cell:focus { background: var(--paper); border-color: var(--ink); outline: none; }
@media (max-width: 760px) {
  .tabs { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 64px; }
}

/* documents */
.seg { display: inline-flex; border: 1.5px solid var(--ink); margin-bottom: 20px; }
.seg a { padding: 9px 16px; text-decoration: none; font-size: 14px; font-weight: 500; }
.seg a[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.sheet table.kv { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 12.5px; }
.sheet .kv th { text-align: left; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 6px 8px 6px 0; width: 16%; vertical-align: top; }
.sheet .kv td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--rule); }
.sheet .annex { font-size: 12px; }
.sheet .annex th { font-size: 9.5px; letter-spacing: .04em; vertical-align: bottom; }
.sheet .annex td { vertical-align: top; padding: 6px 6px; }
.sheet .annex .src { font-size: 10px; }
.sheet .annex tr.tot td { border-top: 1.5px solid var(--ink); }
.sheet .reg td { padding: 3px 6px; }
.sheet .signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; font-size: 11.5px; color: var(--ink-2); }
.sheet .signs span { display: block; border-bottom: 1px solid var(--ink); height: 34px; }
.sheet.example { position: relative; overflow: hidden; }
.sheet.example::before {
  content: "SHEMBULL · SAMPLE"; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-28deg);
  font: 800 92px/1 var(--sans); color: rgba(255, 59, 31, .12); white-space: nowrap; pointer-events: none; z-index: 0;
}
.sheet > * { position: relative; z-index: 1; }
.oblig { border: 1.5px solid var(--ink); background: var(--card); padding: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 18px; }
.oblig .days { font: 800 56px/0.9 var(--sans); font-stretch: 78%; text-align: center; min-width: 96px; }
.oblig .days small { display: block; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.oblig .bar { height: 8px; background: var(--paper-2); margin: 8px 0 4px; max-width: 360px; }
.oblig .bar i { display: block; height: 100%; background: var(--ok); }
.oblig .qs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; }
.oblig .qs select { min-height: 30px; padding: 2px 6px; width: auto; font-size: 13px; }
@media (max-width: 700px) { .oblig { grid-template-columns: 1fr; } .oblig .days { text-align: left; } }
/* On screen the mark sits on the first page; in print, fixed repeats it on every page. */
.sheet.example::before { top: 420px; }
@media print { .sheet.example::before { color: rgba(255, 59, 31, .16); position: fixed; top: 50%; } .seg { display: none; } }
#view .panel td select.prof, #view .panel td input.prof { min-height: 34px; padding: 4px 6px; font-size: 13px; }
#view .panel td input.prof { min-width: 110px; }
@media (max-width: 700px) {
  .sheet.legal { overflow-x: auto; }
  .sheet.legal .annex, .sheet.legal .kv { min-width: 620px; }
  .sheet.legal .rhead { flex-direction: column; }
  .sheet.legal .rhead > div:last-child { text-align: left !important; }
}
.grid2 > *, .modules > * { min-width: 0; }
#view .panel td select.prof[data-field="code"] { min-width: 112px; }
#view .panel td select.prof[data-field="treatment"] { min-width: 118px; }

.autofill tr.srcrow td { padding-top: 0; }
.autofill tr:not(.srcrow) td { border-bottom: 0; padding-bottom: 2px; }

/* monthly bill card (APP-SPEC §3) */
.month-card { border: 1.5px solid var(--ink); background: var(--card); }
.month-card .strip { display: grid; grid-template-columns: repeat(12, minmax(44px, 1fr)); border-bottom: 1.5px solid var(--ink); overflow-x: auto; }
.month-card .strip .m { background: none; border: 0; border-right: 1px solid var(--rule); padding: 8px 2px; cursor: pointer; display: grid; gap: 2px; justify-items: center; font: 500 12px var(--sans); color: var(--ink-2); }
.month-card .strip .m small { font: 500 12px var(--mono); }
.month-card .strip .m.full small { color: var(--ok); }
.month-card .strip .m.part small { color: var(--sun); }
.month-card .strip .m.none small { color: var(--ink-3); }
.month-card .strip .m[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.month-card .strip .m[aria-selected="true"] small { color: inherit; }
.mc-body { padding: 18px; }
.mc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.mc-grid fieldset { border: 1px solid var(--rule); border-top: 4px solid var(--c); margin: 0; padding: 10px 14px 14px; display: grid; gap: 10px; min-width: 0; }
.mc-grid fieldset.wide { grid-column: 1 / -1; }
.mc-grid legend { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c); padding: 0 6px; }
.kg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.unit-in { position: relative; }
.unit-in input { padding-right: 42px; font-family: var(--mono); }
.unit-in i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 400 12px var(--mono); color: var(--ink-3); font-style: normal; }
@media (max-width: 700px) { .mc-grid { grid-template-columns: 1fr; } .month-card .strip { grid-template-columns: repeat(12, 52px); } }

/* D-011: KPI card, solar monitoring, wastewater */
.kpi6 { border: 1.5px solid var(--ink); background: var(--card); padding: 18px; margin-bottom: 18px; }
.kpi6 .kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 14px; border-top: 1px solid var(--rule); }
.kpi6 .k { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); border-top: 3px solid var(--c); }
.kpi6 .k + .k { padding-left: 14px; }
.kpi6 .kl { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.kpi6 .kv { font: 800 30px/1.1 var(--sans); font-stretch: 80%; letter-spacing: -.02em; margin-top: 4px; }
.kpi6 .kv small { font: 400 12px var(--mono); color: var(--ink-2); margin-left: 4px; }
.kpi6 .kc { font: 500 12px var(--mono); margin-top: 4px; }
.kpi6 .kc .good { color: var(--ok); } .kpi6 .kc .bad { color: var(--alarm); } .kpi6 .kc .nb { color: var(--ink-3); }
.kpi6 .ks .src { font-size: 10px; }
@media (max-width: 900px) { .kpi6 .kgrid { grid-template-columns: repeat(2, 1fr); } .kpi6 .k:nth-child(odd) { padding-left: 0; } }
.chip.bad { background: var(--alarm); color: #fff; } .chip.good { background: var(--ok); color: #fff; }
.lab { border-top: 1px dashed var(--rule); padding: 10px 0; }
.lab tr.over td { color: var(--alarm); font-weight: 600; }
.lab-add { border-top: 1.5px solid var(--ink); margin-top: 14px; padding-top: 12px; }

/* Certifikimi (D-011) */
.gk-score { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; border: 1.5px solid var(--ink); background: var(--card); padding: 18px; }
.gk-score .big { font-size: 64px; }
.gk-score .big small { font-size: 22px; }
.gk-score .bar { height: 10px; background: var(--paper-2); margin: 8px 0; }
.gk-score .bar i { display: block; height: 100%; background: var(--ok); }
.gk-sec { border-top: 1.5px solid var(--ink); padding: 10px 0; }
.gk-sec summary { display: flex; justify-content: space-between; cursor: pointer; font-size: 16px; padding: 4px 0; }
.gk-list { list-style: none; margin: 6px 0 0; padding: 0; }
.gk-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: start; font-size: 14px; }
.gk-list .ic { font: 600 15px var(--mono); text-align: center; }
.gk-list li.ok .ic { color: var(--ok); } .gk-list li.part .ic { color: var(--sun); } .gk-list li.miss .ic { color: var(--alarm); } .gk-list li.todo .ic { color: var(--ink-3); }
.gk-list .auto { font: 500 11px var(--mono); color: var(--ok); white-space: nowrap; }
.gk-list select { min-height: 32px; padding: 2px 6px; width: auto; font-size: 13px; }
.chip.imp { background: var(--ink); color: var(--paper); }
.plan-t td { padding: 4px; vertical-align: top; }
.plan-t input, .plan-t textarea, .plan-t select { min-height: 34px; padding: 5px 6px; font-size: 13px; }
.plan-t textarea { min-width: 220px; resize: vertical; }
.staff-form { margin: 6px 0 12px; }
.staff-form input { min-height: 34px; }
.policy summary { cursor: pointer; }
.policy-body { margin: 12px 0; font-size: 14px; }
.policy-body mark { background: var(--sun-soft); color: var(--ink); padding: 0 2px; }
.sheet .pk-h { display: flex; gap: 10px; align-items: baseline; margin: 22px 0 8px; border-bottom: 1.5px solid var(--ink); padding-bottom: 4px; font-size: 17px; }
.sheet .pk-h span { font: 500 12px var(--mono); color: var(--ink-3); }
.sheet.pack .ledger-t { font-size: 12px; }
.sheet.pack .ledger-t td, .sheet.pack .ledger-t th { padding: 4px 6px; }
.sheet .pk-check tr.miss td { color: #a3261b; }
.sheet .pk-2 { gap: 14px; }
@media print {
  .sheet.pack .pk-h { break-after: avoid; }
  .sheet.pack table { break-inside: auto; }
  body.print-policy .page > *:not(.policy) { display: none !important; }
  body.print-policy .policy { border: 0; }
  body.print-policy .policy .btn { display: none; }
}
@media (max-width: 700px) { .gk-score { grid-template-columns: 1fr; } .gk-list li { grid-template-columns: 22px 1fr; } .gk-list li > :last-child { grid-column: 2; } }

.tg-t td { padding: 5px 4px; } .tg-t input.tg { width: 64px; min-height: 32px; padding: 4px 6px; font-size: 13px; font-family: var(--mono); }

.kpi6 .cmp-list { font: 400 11px var(--mono); color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.kpi6 .cmp-list .good, .pk-cmp .good { color: var(--ok); }
.kpi6 .kc > div { margin-top: 2px; }
.sheet .pk-cmp { font: 400 11px var(--mono); }
.sheet .pk-cmp .good { color: #2f6b3e; } .sheet .pk-cmp .bad { color: #a3261b; }
.kpi6 .ks .src { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi6 .ks:hover .src { -webkit-line-clamp: unset; }

/* ===================== Design B component layer (2026-11-02) ===================== */
.panel { border: 1.5px dashed var(--rule); border-radius: 0; }
.btn { background: var(--ground); border-color: var(--ground); color: #fff; border-radius: 0; font: 700 14px var(--sans); font-stretch: 108%; min-height: 46px; padding: 0 18px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.accent { background: var(--accent, var(--ground)); border-color: var(--accent, var(--ground)); color: #fff; }
input[type=text], input[type=number], input[type=month], input[type=date], select, textarea { border-radius: 0; border: 1.5px solid var(--rule); border-bottom-color: var(--ink-2); background: var(--paper); }
.chip { border-radius: 0; font-weight: 600; }
.chip.example { background: var(--ink); color: #fff; border: 0; }
.banner-example { background: var(--paper); border: 1.5px dashed var(--stamp); }
.banner-example .btn { background: var(--ink); border-color: var(--ink); }
.kpis { border-top: 1.5px dashed var(--ink-3); border-bottom: 1.5px dashed var(--rule); }
.seg { border: 1.5px solid var(--ink); }
.seg a[aria-selected="true"] { background: var(--ground); color: #fff; }
.month-card, .oblig, .kpi6, .gk-score { border: 1.5px dashed var(--ink-3); }
.month-card .strip { border-bottom: 1.5px dashed var(--ink-3); }
.month-card .strip .m[aria-selected="true"] { background: var(--ground); color: #fff; }
.oblig .bar i, .gk-score .bar i { background: var(--mint); }
.map-wrap { border: 1.5px solid var(--ink); }
.toast { background: var(--ink); color: #fff; border-radius: 0; font-family: var(--mono); }
.dot { border-radius: 0; }
.eyebrow[style*="color"] { filter: saturate(1.2); }

/* ---- the savings test (FLOW.md) ---- */
.test { max-width: 760px; }
.test .prog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 22px; }
.test .prog i { height: 5px; background: var(--paper-2); } .test .prog i.on { background: var(--em); }
.test .qnum { font: 600 12px var(--mono); letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.test h1 { margin: 8px 0 6px; }
.test .hint { color: var(--ink-2); margin: 0 0 20px; }
.test .private { font: 500 11.5px var(--mono); color: var(--ink-3); margin-top: 22px; }
.test .navrow { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice label { border: 1.5px solid var(--rule); padding: 14px; cursor: pointer; display: grid; gap: 4px; background: var(--card); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--em); box-shadow: inset 0 0 0 1.5px var(--em); background: var(--water-soft); }
.choice b { font: 800 16px var(--sans); font-stretch: 112%; } .choice small { color: var(--ink-3); font: 12px var(--mono); }
.toggle { display: inline-flex; border: 1.5px solid var(--ink); margin-bottom: 12px; }
.toggle label { padding: 7px 14px; cursor: pointer; font: 600 13px var(--mono); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label:has(input:checked) { background: var(--ink); color: #fff; }
.big-in { display: flex; align-items: baseline; gap: 10px; border-bottom: 3px solid var(--ink); padding: 4px 0; max-width: 420px; }
.big-in input { border: 0 !important; background: transparent !important; font: 800 44px/1.1 var(--sans) !important; font-stretch: 80% !important; letter-spacing: -.03em; padding: 0 !important; min-height: 0 !important; width: 100%; outline: none; }
.big-in span { font: 600 16px var(--mono); color: var(--ink-2); white-space: nowrap; }
.start { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.start h1 { font-size: clamp(38px, 6vw, 76px); line-height: .95; letter-spacing: -.035em; }
.start h1 em { font-style: normal; color: var(--em); }
.start .steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.start .steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1.5px dashed var(--rule); }
.start .steps li::before { content: counter(s, decimal-leading-zero); font: 700 13px var(--mono); color: var(--em); padding-top: 2px; }
@media (max-width: 760px) { .start { grid-template-columns: 1fr; gap: 18px; } .big-in input { font-size: 36px !important; } }

/* ---- the result = the savings receipt ---- */
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 40px; align-items: start; }
.result .side h1 { font-size: clamp(32px, 4.4vw, 56px); line-height: .98; letter-spacing: -.03em; margin: 10px 0 14px; }
.result .side h1 em { font-style: normal; color: var(--em); }
.result .side p { color: var(--ink-2); max-width: 46ch; }
.result .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.result .chips span { border: 1.5px solid var(--ink); padding: 6px 10px; font: 600 12px var(--mono); }
.result .btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.rc { background: #fff; color: #111318; padding: 24px 24px 28px; position: relative; font: 13.5px/1.55 var(--mono); transform: rotate(-.8deg);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 60, .55), 0 0 0 1px #e6e8f3;
  -webkit-mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) top/14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) bottom/14px 51% repeat-x;
          mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) top/14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) bottom/14px 51% repeat-x; }
.rc .c { text-align: center; } .rc h2 { font: 800 18px var(--sans); font-stretch: 125%; letter-spacing: .06em; }
.rc .muted { color: #7c8193; font-size: 11.5px; }
.rc .dash { border-top: 1.5px dashed #c9ccd8; margin: 13px 0; }
.rc .row { display: flex; justify-content: space-between; gap: 10px; } .rc .row b { font-weight: 700; text-align: right; }
.rc .row.weak { color: #7c8193; }
.rc .sec { font-weight: 700; letter-spacing: .12em; font-size: 12px; margin: 2px 0 6px; display: flex; justify-content: space-between; align-items: center; }
.rc .sec a { font-weight: 500; letter-spacing: 0; color: #4a4f5e; }
.rc .sec i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.rc .total { position: relative; font: 800 13px var(--sans); font-stretch: 125%; letter-spacing: .08em; }
.rc .total .big { display: block; font: 800 64px/1 var(--sans); font-stretch: 80%; letter-spacing: -.04em; margin-top: 4px; }
.rc .stamp { position: absolute; right: 0; top: -30px; width: 112px; height: 112px; border: 3px solid var(--stamp); border-radius: 50%; color: var(--stamp);
  display: grid; place-items: center; text-align: center; transform: rotate(14deg); font: 800 13px/1.1 var(--sans); font-stretch: 120%; letter-spacing: .06em; opacity: .9; }
.rc .stamp small { display: block; font: 700 9px var(--mono); letter-spacing: .1em; margin-top: 4px; }
.rc .rank { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rc .rank li { counter-increment: r; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; padding: 5px 0; }
.rc .rank li::before { content: counter(r) "."; font-weight: 700; }
.rc .rank small { display: block; color: #7c8193; font-size: 11px; }
.rc .barcode { height: 40px; margin-top: 14px; background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px, #111 8px 11px, #fff 11px 12px); }
.rc .src { font-size: 10.5px; color: #7c8193; margin-top: 10px; }
.after { margin-top: 40px; }
@media (max-width: 900px) { .result { grid-template-columns: 1fr; gap: 20px; } .rc { transform: none; } .rc .stamp { width: 92px; height: 92px; top: -22px; font-size: 11px; } }
@media print { body { background: #fff; } .topbar { display: none !important; } .page { box-shadow: none; } .page::before { display: none; } .rc { transform: none; box-shadow: none; } }

/* ---- B pass on the dense screens (D-013) ---- */
/* Checklist: each status is a small stamp. */
.gk-list .ic { width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid currentColor; font: 700 13px var(--mono); }
.gk-list li.ok .ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.gk-list li.part .ic { color: #b07800; background: var(--sun-soft); }
.gk-list li.miss .ic { color: var(--stamp); }
.gk-list li.todo .ic { color: var(--ink-3); border-style: dashed; }
.gk-list li.na .ic { color: var(--ink-3); }
.gk-sec summary b { font-stretch: 112%; }
.gk-sec { border-top: 1.5px dashed var(--ink-3); }
/* The Green Key score reads like the total of a receipt. */
.gk-score { position: relative; background: var(--card); }
.gk-score .big { font-size: 72px; }
.gk-score::after { content: "GREEN KEY"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%) rotate(-10deg); border: 3px solid var(--ok); color: var(--ok);
  padding: 6px 10px; font: 800 13px var(--sans); font-stretch: 120%; letter-spacing: .1em; opacity: .85; }
@media (max-width: 700px) { .gk-score::after { display: none; } }
/* Numbers in tables are receipt mono. */
.ledger-t td.n, .plan-t input[type=number], .tg-t input { font-family: var(--mono); }
.ledger-t th { border-bottom: 1.5px solid var(--ink); }
.ledger-t td { border-bottom: 1px dashed var(--rule); }
/* Map side panel and layers. */
.map-side { border-left: 1.5px dashed var(--ink-3); }
.layer { border-bottom: 1px dashed var(--rule); }
/* Month strip, KPI tiles. */
.kpi + .kpi { border-left: 1px dashed var(--rule); }

/* Print: always light, A4, only the document (D-013). */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  .topbar, .no-print, .banner-example, .seg, .toast { display: none !important; }
  main { padding: 0 !important; }
  .page { max-width: none; padding: 0 !important; box-shadow: none !important; background: #fff !important; }
  .page::before { display: none !important; }
  .sheet { border: 0 !important; padding: 0 !important; }
  .rc { transform: none !important; box-shadow: none !important; -webkit-mask: none !important; mask: none !important; }
}

/* ---- 3D map (D-014) ---- */
#map { position: relative; }
/* A fixed map height: the side panel scrolls instead of stretching the map (that left a grey band under the canvas). */
.map-page .map-wrap { min-height: 0; align-items: start; }
.map-page #map { height: clamp(420px, 72vh, 780px); min-height: 0; }
.map-page .map-side { max-height: clamp(420px, 72vh, 780px); }
@media (max-width: 860px) { .map-page #map { height: 64vh; } .map-page .map-side { max-height: none; } }
.map-badge { position: absolute; z-index: 5; right: 10px; top: 10px; background: var(--ground); color: #fff; font: 700 11.5px var(--mono); letter-spacing: .06em; padding: 6px 10px; pointer-events: none; }
.map-badge.flat { background: var(--ink); }
.mode-toggle { margin: 0; }
.maplibregl-popup-content { border-radius: 0; font: 13px var(--sans); box-shadow: 0 10px 30px -10px rgba(0,0,40,.4); padding: 12px 14px; }
.maplibregl-ctrl-group { border-radius: 0 !important; }
.maplibregl-canvas { cursor: crosshair; }
@media (max-width: 860px) { #map { min-height: 62vh; } }
.map-loading { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--card); border: 1.5px dashed var(--ink-3); padding: 10px 14px; font: 600 12px var(--mono); }
.map-loading i { display: block; height: 3px; margin-top: 8px; background: var(--paper-2); }
.map-loading b { display: block; height: 100%; width: 6%; background: var(--ground); transition: width .3s; }
.map-btns { position: absolute; z-index: 5; right: 10px; bottom: 34px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mbtn { font: 700 12px var(--mono); background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); padding: 8px 11px; cursor: pointer; min-height: 36px; }
.mbtn:hover { background: var(--ground); color: #fff; border-color: var(--ground); }
.mbtn[data-go="north"] span { display: inline-block; transform: rotate(var(--rot, 0deg)); }
.pin3d { z-index: 3; display: flex; flex-direction: column; align-items: center; cursor: grab; pointer-events: auto; }
.pin3d b { background: var(--ink); color: #fff; font: 700 11.5px var(--mono); padding: 5px 8px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.pin3d i { width: 2px; height: 34px; background: var(--ink); }
.pin3d s { width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--ground); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--ink); }
.map-label { pointer-events: none; font: 700 12px var(--sans); color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; white-space: nowrap; letter-spacing: .01em; }
.map-label.town.r1 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; }
.map-label.town.r2 { font-size: 11px; font-weight: 600; color: #333845; }
.map-label.peak { font: 600 10.5px var(--mono); color: #0d1366; }
.map-label.peak i { font-style: normal; margin-right: 3px; color: var(--ground); }
.map-label.peak small { font-size: 10px; opacity: .8; }
.map-label.hidden, .map-label.clash { visibility: hidden; }
.legend3d .lg { padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: 13px; }
.legend3d .lg > b { display: block; margin-bottom: 6px; font-weight: 600; }
.legend3d .ramp { height: 10px; border: 1px solid rgba(0,0,0,.15); }
.legend3d .ticks { display: flex; justify-content: space-between; font: 11px var(--mono); margin-top: 3px; }
.legend3d .src { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.35; }
.legend3d .colkey { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.legend3d .colkey i { width: 10px; height: 26px; background: linear-gradient(#ff5a1f, #c23b0b); display: inline-block; }
.legend3d .colkey i.wline { width: 28px; height: 4px; background: #0a8cff; border-radius: 2px; }
.legend3d .bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; font: 11px var(--mono); }
.legend3d .bins i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }
.map-side .field { display: block; margin: 4px 0 6px; }
.map-side .field select { width: 100%; }
@media (max-width: 860px) { .map-btns { bottom: 30px; } .mbtn { padding: 7px 9px; font-size: 11.5px; } }
/* Installed app (iPhone, D-015): keep the status bar on the cobalt ground, and the top bar below it. */
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
body::after { content: ""; position: fixed; z-index: 2000; left: 0; right: 0; top: 0; height: env(safe-area-inset-top); background: var(--ground); pointer-events: none; }
@media (max-width: 860px) { .topbar { padding-top: max(12px, env(safe-area-inset-top)); } }
@media print { body::after { display: none; } }
/* Phones: iOS zooms the page into any field whose text is under 16 px; keep fields at 16 px on touch screens. */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }

/* D-016: "Fotografo faturën" (the bill-photo hook; Bill Reader's sheet opens from it). */
.scan-btn { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 4px; min-height: 44px; padding: 8px 14px; border: 1.5px dashed var(--c, var(--ground)); background: transparent; color: var(--c, var(--ground)); font: 600 14px/1 var(--sans, inherit); cursor: pointer; }
.scan-btn svg { width: 20px; height: 20px; flex: none; }
.scan-btn:disabled { opacity: .5; }
fieldset > .scan-btn { margin-top: 0; min-height: 40px; }
@keyframes scanned { from { background: #fff3a8; } to { background: inherit; } }
input.scanned { animation: scanned 1.6s ease-out; }

/* D-016 "proper app": inside the iPhone app, no grey tap flashes, no long-press callouts or text selection on
   controls, and a pressed state like a native button. Content text stays selectable. */
.native-ios { -webkit-tap-highlight-color: transparent; }
.native-ios a, .native-ios button, .native-ios .tab, .native-ios label, .native-ios .topbar, .native-ios .mbtn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.native-ios .btn:active, .native-ios .scan-btn:active, .native-ios .tab:active, .native-ios .choice label:active { transform: scale(.97); transition: transform .08s; }
.native-ios img { -webkit-touch-callout: none; }
.legend3d .colkey i.panelkey { width: 18px; height: 12px; background: repeating-linear-gradient(90deg, #172a63 0 5px, #8fa0d8 5px 6px); border: 2px solid #1d2bff; }
.map-page .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* BUG-003: between phone and wide screens the header has to fit: tabs can shrink, the company name goes. */
.tabs { min-width: 0; }
@media (min-width: 761px) and (max-width: 1180px) {
  .topbar { gap: 12px; }
  .top-actions .co { display: none; }
  .tab { padding: 8px 7px; gap: 5px; letter-spacing: .03em; font-size: 11.5px; }
}
@media (min-width: 761px) and (max-width: 900px) { .tab svg { display: none; } .mark span { display: none; } }
/* BUG-013: nothing wider than the phone. Lab results scroll inside their box; the segmented tabs wrap. */
.lab, .lab-add { max-width: 100%; overflow-x: auto; }
.lab table { min-width: 0; }
.seg { flex-wrap: wrap; max-width: 100%; }
.seg a { flex: 1 1 auto; text-align: center; }
.panel .src, .lab .src { overflow-wrap: anywhere; }
/* receipt notes (BUG-008/009) */
.rc .rnote { font-size: 11px; line-height: 1.35; margin: 4px 0 2px; }
.rc .rnote.alarm { color: var(--alarm); font-weight: 600; }
.rc .row.strong b { color: var(--ink); }

/* ---------- D-017: staff contact, water per hour, water test by post, our bins ---------- */
.tbf { display: inline-block; font: 600 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--alarm); border: 1px dashed currentColor; padding: 1px 6px; white-space: nowrap; }
.contact-btn { display: inline-flex; align-items: center; gap: 8px; }
.contact-btn svg { width: 18px; height: 18px; flex: none; }
.flow-card { margin-bottom: 18px; }
.flow-card .ledger-t td:first-child { color: var(--ink-2, var(--ink)); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; margin: 14px 0; counter-reset: st; }
.stepper li { position: relative; padding: 26px 4px 0; text-align: center; font-size: 12px; color: var(--ink-3); counter-increment: st; }
.stepper li::before { content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border: 1.5px solid var(--rule); background: var(--card); font: 600 11px/17px var(--mono); color: var(--ink-3); z-index: 1; }
.stepper li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; border-top: 1.5px dashed var(--rule); }
.stepper li:first-child::after { display: none; }
.stepper li b { display: block; font-weight: 600; }
.stepper li small { display: block; font: 11px var(--mono); }
.stepper li.done, .stepper li.now { color: var(--ink); }
.stepper li.done::before { content: "✓"; background: var(--ground); border-color: var(--ground); color: #fff; }
.stepper li.now::before { border-color: var(--ground); color: var(--ground); }
.stepper li.done::after, .stepper li.now::after { border-top: 1.5px solid var(--ground); }
.stepper.small li { font-size: 11px; }
.howto { margin: 10px 0 14px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.howto li { margin: 4px 0; }
.bin-types { display: grid; gap: 10px; margin: 12px 0; }
.bin-type { display: grid; grid-template-columns: 44px 1fr 84px; gap: 12px; align-items: center; border: 1.5px solid var(--rule); padding: 10px 12px; }
.bin-ic { width: 40px; height: 44px; position: relative; }
.bin-ic i { position: absolute; left: 6px; right: 6px; top: 8px; bottom: 0; background: var(--waste); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.bin-ic::before { content: ""; position: absolute; left: 2px; right: 2px; top: 2px; height: 5px; background: var(--ink); }
.bin-type .mono { font: 600 13px var(--mono); margin-top: 3px; }
.bin-type .qty input { width: 100%; text-align: center; font: 600 18px var(--mono); min-height: 44px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.order-sum { border-top: 1.5px solid var(--ink); padding-top: 10px; margin: 6px 0 12px; display: grid; gap: 6px; }
.order-sum .row-between b { text-align: right; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.svc-sheet { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 12, 60, .55); display: flex; align-items: flex-end; justify-content: center; }
.svc-card { background: var(--card); width: min(640px, 100%); max-height: 92vh; overflow: auto; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,40,.4); }
@media (min-width: 761px) { .svc-sheet { align-items: center; } }
.svc-card header { position: sticky; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; padding: 16px 0 10px; border-bottom: 1.5px solid var(--ink); margin-bottom: 12px; z-index: 1; }
.svc-card h2 { font-size: 22px; margin: 0; }
.svc-x { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; color: var(--ink); }
.svc-card .needs { border: 1.5px solid var(--rule); padding: 8px 12px; margin: 10px 0; display: grid; gap: 6px; }
.svc-card .needs label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.svc-card textarea { width: 100%; font: inherit; }
.svc-msg { white-space: pre-wrap; font: 12.5px/1.45 var(--mono); background: var(--paper); border: 1px dashed var(--rule); padding: 10px 12px; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.svc-channels { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.svc-channels .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) { .stepper li b { font-size: 10.5px; } .bin-type { grid-template-columns: 36px 1fr 64px; gap: 8px; } }
#flow-form .btn { width: auto; justify-self: start; }
