/* nestalo.ba. Mobile first; desktop tweaks at the bottom of each section. */
:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --ink: #0d1726;
  --ink-2: #3a4558;
  --muted: #6b7789;
  --line: #e2e8f1;
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 107, 255, 0.12);
  --water: #1593d6;
  --water-soft: rgba(21, 147, 214, 0.14);
  --power: #e08a00;
  --power-soft: rgba(245, 158, 11, 0.18);
  --live: #e5484d;
  --ok: #218358;
  --ok-soft: rgba(48, 164, 108, 0.14);
  --bad: #c9353a;
  --bad-soft: rgba(229, 72, 77, 0.12);
  --glass: rgba(255, 255, 255, 0.78);
  --stroke: rgba(13, 23, 38, 0.08);
  --shadow: 0 1px 2px rgba(13, 23, 38, 0.06), 0 12px 32px -12px rgba(30, 64, 140, 0.22);
  --shadow-lg: 0 -8px 40px -12px rgba(13, 23, 38, 0.25);
  --radius: 22px;
  --mask: rgba(150, 158, 170, 0.5);
  --chart-water: #1593d6;
  --chart-power: #e08a00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f19;
    --surface: #121a28;
    --surface-2: #182234;
    --ink: #eef3fb;
    --ink-2: #c3ccda;
    --muted: #8d98ab;
    --line: #233046;
    --accent: #5b8cff;
    --accent-soft: rgba(91, 140, 255, 0.18);
    --water: #4cc0f5;
    --water-soft: rgba(76, 192, 245, 0.18);
    --power: #ffb84d;
    --power-soft: rgba(255, 184, 77, 0.18);
    --live: #ff6b6f;
    --ok: #6ee7a8;
    --ok-soft: rgba(48, 164, 108, 0.22);
    --bad: #ff8b8f;
    --bad-soft: rgba(229, 72, 77, 0.2);
    --glass: rgba(18, 26, 40, 0.82);
    --stroke: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 -8px 40px -12px rgba(0, 0, 0, 0.7);
    --mask: rgba(4, 7, 12, 0.62);
    --chart-water: #2196d6;
    --chart-power: #c47c12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f19;
  --surface: #121a28;
  --surface-2: #182234;
  --ink: #eef3fb;
  --ink-2: #c3ccda;
  --muted: #8d98ab;
  --line: #233046;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.18);
  --water: #4cc0f5;
  --water-soft: rgba(76, 192, 245, 0.18);
  --power: #ffb84d;
  --power-soft: rgba(255, 184, 77, 0.18);
  --live: #ff6b6f;
  --ok: #6ee7a8;
  --ok-soft: rgba(48, 164, 108, 0.22);
  --bad: #ff8b8f;
  --bad-soft: rgba(229, 72, 77, 0.2);
  --glass: rgba(18, 26, 40, 0.82);
  --stroke: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 -8px 40px -12px rgba(0, 0, 0, 0.7);
  --mask: rgba(4, 7, 12, 0.62);
  --chart-water: #2196d6;
  --chart-power: #c47c12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 16px/1.5 ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.3; margin: 0 0 12px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none;
  background: linear-gradient(145deg, var(--accent), #19c2d6);
  box-shadow: 0 8px 18px -8px rgba(47, 107, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mark svg { width: 24px; height: 24px; display: block; filter: drop-shadow(0 1px 1px rgba(13, 23, 38, .2)); }
.brand b { font-size: 17px; letter-spacing: -0.02em; }
.brand small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none !important;
  color: var(--accent-ink); border: 0; border-radius: 999px; padding: 13px 22px; min-height: 48px;
  background: var(--accent);
  box-shadow: 0 10px 24px -12px rgba(47, 107, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform .12s, filter .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { color: var(--ink); background: var(--surface-2); box-shadow: none; border: 1px solid var(--line); }
.btn.soft { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: 14px; min-height: 38px; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { color: #fff; background: var(--bad); box-shadow: none; }
.btn.big { font-size: 17px; min-height: 56px; padding: 15px 24px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 16px; flex: none;
}
.icon-btn:hover { filter: brightness(0.97); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

/* ------------------------------------------------------------ forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 4px; }
.field > span .muted { font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); /* 16px stops iOS zoom */
  padding: 12px 14px; border-radius: 14px; min-height: 48px;
  border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7789' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 84px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* toggle row: label + switch */
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.toggle .txt { flex: 1; min-width: 0; }
.toggle .txt > b { display: block; font-weight: 600; font-size: 15px; }
.toggle .txt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.toggle .ico { font-size: 22px; width: 32px; text-align: center; flex: none; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; min-height: 0; z-index: 1; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .2s;
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }

/* checkbox for consent */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.45; }
.check input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; margin-top: 1px; border-radius: 7px; cursor: pointer;
  border: 2px solid var(--muted); background: var(--surface); display: grid; place-items: center; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }

/* selectable chips (reminders, labels, filters) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s, border-color .15s;
}
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: transparent; }
.chip[aria-pressed="true"].water { background: var(--water); }
.chip[aria-pressed="true"].power { background: var(--power); color: #1d1300; }
.chip .x { opacity: .7; margin-left: 2px; }
.chip b { font-weight: 700; }
.custom-rem { display: flex; gap: 8px; margin-top: 10px; }
.custom-rem input { width: 90px; flex: none; }
.custom-rem select { flex: 1; }

/* ------------------------------------------------------------ page layout */
.page { max-width: 600px; margin: 0 auto; padding: 12px 16px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.card {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 14px;
}
.card > h2:first-child { display: flex; align-items: center; gap: 10px; }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700;
}
.lead { color: var(--ink-2); font-size: 15px; margin: -4px 0 14px; }
.notice {
  padding: 12px 14px; border-radius: 16px; margin-bottom: 14px; font-size: 14px;
  background: var(--accent-soft); color: var(--ink);
}
.notice.ok { background: var(--ok-soft); }
.notice.bad, .error { background: var(--bad-soft); color: var(--bad); padding: 12px 14px; border-radius: 16px; font-size: 14px; margin-bottom: 14px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); margin: 24px 0 0; line-height: 1.8; }
.foot a { color: var(--muted); }
.my-cta {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-decoration: none;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
}
.my-cta .ico { font-size: 22px; }
.my-cta .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.my-cta .txt small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.my-cta .go { font-size: 24px; color: var(--muted); }
.my-cta.warn { border-color: rgba(229, 72, 77, .45); }
.my-cta.warn .txt small { color: var(--bad); font-weight: 600; }
.foot.company { margin: 0 auto; padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 12px; }
@media (min-width: 640px) {
  .page { padding: 24px 24px 64px; }
  .card { padding: 26px 26px; }
  h1 { font-size: 28px; }
}

/* ------------------------------------------------------------ address picker */
.picker { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.picker .map { height: 46vh; min-height: 280px; max-height: 460px; }
.picker-search { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 500; }
.picker-search .search-row { display: flex; gap: 6px; background: var(--surface); border-radius: 16px; padding: 5px; box-shadow: var(--shadow); }
.picker-search input { flex: 1; min-width: 0; border: 0; min-height: 42px; padding: 8px 10px; box-shadow: none !important; background: transparent; }
.picker-search .btn { flex: none; min-height: 42px; padding: 8px 14px; border-radius: 12px; }
.results {
  margin-top: 6px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  max-height: 34vh; overflow: auto; padding: 4px;
}
.results button {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none;
  font: inherit; color: var(--ink); padding: 10px 10px; border-radius: 12px; cursor: pointer;
}
.results button:hover, .results button:focus-visible { background: var(--surface-2); }
.results .n {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}
.results b { display: block; font-size: 15px; font-weight: 600; }
.results small { display: block; color: var(--muted); font-size: 13px; }
.results .empty { padding: 12px; font-size: 14px; color: var(--muted); }
.picker-me {
  position: absolute; left: 10px; bottom: 10px; z-index: 500; display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 650; color: #fff; background: var(--accent); box-shadow: var(--shadow);
  max-width: calc(100% - 80px);
}
.picker-me:active { transform: scale(.98); }
.picker-me[disabled] { opacity: .85; }
.picker-hint { margin: 8px 4px 0; }
.acc-note { margin: -4px 0 10px; color: var(--ink-2); background: var(--power-soft); padding: 8px 12px; border-radius: 12px; }
/* "you are here" dot */
/* "you are here": big, blue, pulsing, labelled; nothing else on the map looks like it */
.you { pointer-events: none; }
.you i {
  position: absolute; left: 8px; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: #1f5fff; border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(31, 95, 255, .55), 0 3px 10px rgba(0, 0, 0, .45); animation: you 1.8s infinite;
}
.you b {
  position: absolute; left: 50%; top: 23px; transform: translateX(-50%);
  font: 800 7px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; color: #fff;
  background: #1f5fff; border: 1.5px solid #fff; border-radius: 999px; padding: 1.5px 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
@keyframes you { 0% { box-shadow: 0 0 0 0 rgba(31, 95, 255, .55), 0 3px 10px rgba(0, 0, 0, .45); } 70% { box-shadow: 0 0 0 13px rgba(31, 95, 255, 0), 0 3px 10px rgba(0, 0, 0, .45); } 100% { box-shadow: 0 0 0 0 rgba(31, 95, 255, 0), 0 3px 10px rgba(0, 0, 0, .45); } }
@media (prefers-reduced-motion: reduce) { .you i { animation: none; } }

/* the user's own addresses: bigger green pins */
.pin.big span { width: 24px; height: 24px; border-width: 2px; }
.pin.big span em { font-size: 11px; }
.map-locate { position: absolute; z-index: 820; right: 10px; bottom: calc(var(--peek, 190px) + 92px); transition: bottom .32s;
  width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--surface); color: var(--accent);
  box-shadow: var(--shadow); font-size: 20px; cursor: pointer; display: grid; place-items: center; }
@media (min-width: 900px) { .map-locate { bottom: 104px; right: 10px; } }
.draft { margin-top: 12px; padding: 14px; border-radius: 18px; background: var(--accent-soft); }
.draft .where { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.draft .where .pin-ico { font-size: 22px; line-height: 1.1; }
.draft .where b { display: block; font-size: 16px; }
.draft .where small { color: var(--ink-2); font-size: 13px; }
.draft .field { margin-bottom: 10px; }
.draft .field input { background: var(--surface); }
.label-chips { margin-bottom: 12px; }

.addr-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.addr {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.addr .ico { font-size: 20px; flex: none; }
.addr .txt { flex: 1; min-width: 0; }
.addr .txt b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr .txt small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr .badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.addr .txt small.addr-notif { font-size: 12px; margin-top: 2px; white-space: normal; }
.addr .txt small.addr-notif.off { color: var(--bad); }

/* per-address notification dialog */
#dlg-notif .an-block { padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 6px; }
#dlg-notif .an-block > b { display: block; }
#dlg-notif .an-block p { margin: 2px 0 8px; }
#an-more { transition: opacity .15s; }
#an-more.dim { opacity: .45; }

/* "Na vašim adresama", grouped by address when there is a lot */
.addr-group { border-radius: 16px; background: var(--surface-2); }
.addr-group .ag-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; list-style: none; cursor: pointer; }
.addr-group .ag-head::-webkit-details-marker { display: none; }
.addr-group.empty .ag-head { cursor: default; }
.addr-group .ico { font-size: 20px; flex: none; }
.addr-group .txt { flex: 1; min-width: 0; }
.addr-group .txt b { display: block; font-size: 15px; }
.addr-group .txt small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-group .ag-sum { text-align: right; flex: none; font-size: 13px; line-height: 1.3; }
.addr-group .ag-sum b { display: block; font-size: 14px; white-space: nowrap; }
.addr-group .ag-sum small { display: block; color: var(--muted); white-space: nowrap; }
.addr-group .ag-sum small.ag-live { color: var(--live); font-weight: 650; }
.addr-group .ag-chev { color: var(--muted); font-size: 20px; transition: transform .2s; flex: none; }
.addr-group[open] .ag-chev { transform: rotate(90deg); }
.addr-group .ag-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; }
.addr-group .ag-body .out-card { background: var(--surface) !important; }
@media (prefers-reduced-motion: reduce) { .addr-group .ag-chev, #an-more { transition: none; } }

/* ------------------------------------------------------------ live map page */
.map-page { position: fixed; inset: 0; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); }
/* keep zoom buttons and attribution above the collapsed sheet on phones */
.map-page .leaflet-bottom { bottom: var(--peek, 190px); transition: bottom .32s; }
.topbar {
  position: absolute; z-index: 800; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.pill {
  background: var(--glass); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--stroke); border-radius: 999px; box-shadow: var(--shadow); padding: 6px 14px 6px 6px;
}
.pill.btnlike { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--ink); }
.filters {
  position: absolute; z-index: 790; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 0; right: 0;
  display: flex; gap: 8px; overflow-x: auto; padding: 0 10px 6px; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters .chip { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); border-color: var(--stroke); }
.filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filters .chip[aria-pressed="true"].water { background: var(--water); color: #fff; }
.filters .chip[aria-pressed="true"].power { background: var(--power); color: #1d1300; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }
.dot.live { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); } 70% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

.sheet {
  position: absolute; z-index: 850; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: 78dvh;
  transform: translateY(calc(100% - var(--peek, 190px))); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  border: 0; background: none; width: 100%; padding: 10px 0 4px; cursor: grab; display: grid; place-items: center; flex: none;
  touch-action: none;
}
.sheet-handle::before { content: ""; width: 42px; height: 5px; border-radius: 999px; background: var(--line); }
.sheet-head { padding: 2px 18px 12px; flex: none; }
.summary { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }
.summary .counts { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-toggle {
  flex: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 0; border-radius: 999px; padding: 7px 14px; min-height: 36px; cursor: pointer;
}
.summary b { color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 0 18px 18px; overscroll-behavior: contain; flex: 1; }
.day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.day:first-child { margin-top: 2px; }
.o-item {
  display: flex; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px;
}
.o-item:hover, .o-item.sel { border-color: var(--accent); background: var(--accent-soft); }
.o-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; }
.o-ico.water { background: var(--water-soft); }
.o-ico.power { background: var(--power-soft); }
.o-main { flex: 1; min-width: 0; }
.o-main b { display: block; font-size: 15px; }
.o-main .when { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.o-main .streets-s { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-tag { font-size: 11px; font-weight: 700; color: #fff; background: var(--live); padding: 1px 7px; border-radius: 999px; letter-spacing: .03em; }
.today-tag { font-size: 11px; font-weight: 700; color: var(--ink); background: var(--power-soft); padding: 1px 7px; border-radius: 999px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 16px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.legend i.w { background: var(--water); }
.legend i.p { background: var(--power); }
.legend i.soon { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.legend i.area { height: 12px; width: 14px; border-radius: 3px; background: var(--power-soft); border: 1.5px solid var(--power); }
/* legend on the map: always visible, folds to one line */
.map-legend {
  position: absolute; z-index: 820; left: 10px; bottom: calc(var(--peek, 190px) + 12px); transition: bottom .32s;
  max-width: calc(100% - 84px); background: var(--glass); backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%); border: 1px solid var(--stroke); border-radius: 16px;
  box-shadow: var(--shadow); padding: 4px 12px 8px; font-size: 12.5px; color: var(--ink);
}
.legend-head { border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); padding: 4px 0;
  cursor: pointer; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.legend-head span { transition: transform .2s; }
.map-legend.folded { padding-bottom: 4px; }
.map-legend.folded .legend-body { display: none; }
.map-legend.folded .legend-head span { transform: rotate(-90deg); }
.legend-body { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 6px 14px; }
.legend-body li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sw { flex: none; display: inline-block; width: 22px; height: 12px; position: relative; }
.sw.line::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 5px; border-radius: 3px; }
.sw.line.power::before { background: var(--power); box-shadow: 0 0 0 3px var(--power-soft); }
.sw.line.water::before { background: var(--water); box-shadow: 0 0 0 3px var(--water-soft); }
.sw.line.dashed::before { background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 10px); }
.sw.live::before { content: ""; position: absolute; left: 5px; top: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--power); box-shadow: 0 0 0 2.5px var(--live); }
.sw.area::before { content: ""; position: absolute; inset: 0 3px; border-radius: 3px; background: var(--power-soft); border: 2px solid var(--power); }
.sw.approx::before { content: ""; position: absolute; left: 4px; top: -1px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--power-soft); border: 1.5px dashed var(--power); }
.sw.house::before { content: ""; position: absolute; left: 6px; top: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--power); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw.me::before { content: ""; position: absolute; left: 4px; top: -1px; width: 14px; height: 14px; border-radius: 50%;
  background: #1f5fff; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(31, 95, 255, .35); }
.sw.pin::before { content: ""; position: absolute; left: 6px; top: -2px; width: 12px; height: 12px; transform: rotate(-45deg);
  border-radius: 50% 50% 50% 2px; background: var(--ok); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
@media (max-width: 380px) {
  .map-legend { font-size: 12px; padding-inline: 10px; }
  .legend-body { gap: 5px 10px; }
  .topbar .brand small { display: none; }
}
.topbar .pill.btnlike { white-space: nowrap; }
@media (min-width: 900px) { .map-legend { left: 432px; bottom: 16px; } }
.empty-state { text-align: center; padding: 22px 8px; color: var(--muted); }
.empty-state .big { font-size: 40px; line-height: 1; margin-bottom: 8px; }

@media (min-width: 900px) {
  .filters { top: 18px; left: 432px; right: auto; padding: 0; }
  .topbar { top: 16px; left: 16px; right: 16px; }
  .topbar .brand-pill { display: none; }
  .sheet {
    top: 16px; left: 16px; bottom: 16px; right: auto; width: 400px; max-height: none;
    border-radius: 24px; transform: none !important;
  }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 18px; }
  .map-page .leaflet-bottom { bottom: 0; }
}

/* ------------------------------------------------------------ leaflet bits */
.leaflet-container { font: inherit; background: var(--surface-2); }
/* OSM has no dark style: invert the base map only, overlays keep their colours */
.base-tiles { filter: saturate(.75); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .base-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6); } }
:root[data-theme="dark"] .base-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6); }
.leaflet-control-attribution { font-size: 10px; background: var(--glass) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 38px !important; height: 38px !important; line-height: 38px !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.45; }
.leaflet-popup-content b { font-size: 15px; }
.leaflet-tooltip.muni-label { background: transparent; border: 0; box-shadow: none; color: var(--ink-2); font-weight: 650; font-size: 12px; text-shadow: 0 0 3px var(--surface), 0 0 6px var(--surface); }
.leaflet-tooltip.muni-label::before { display: none; }
.pin { position: relative; }
.pin span {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 0) rotate(-45deg); transform-origin: center;
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .45); display: grid; place-items: center;
}
.pin span em { transform: rotate(45deg); font-style: normal; font-size: 15px; font-weight: 700; color: #fff; line-height: 1; }
.pin.draft span { background: var(--live); }
.pin.saved span { background: var(--ok); }
.pin.result span { background: var(--accent); width: 28px; height: 28px; }
.pin.result span em { font-size: 13px; }
.o-marker { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); display: grid !important; place-items: center; font-size: 13px; }
.o-marker.water { background: var(--water); }
.o-marker.power { background: var(--power); }
.o-marker.live { box-shadow: 0 0 0 4px rgba(229, 72, 77, .45), 0 2px 8px rgba(0, 0, 0, .35); }

/* ------------------------------------------------------------ toast + dialog */
.toast {
  position: fixed; z-index: 2000; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
dialog {
  border: 0; border-radius: 22px; padding: 22px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); width: min(420px, calc(100% - 32px));
}
dialog::backdrop { background: rgba(5, 10, 20, .5); backdrop-filter: blur(2px); }
dialog[open] { animation: dlg-in .18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
.dialog-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.remove-addr { margin-top: 12px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.share-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.share-apps a, .share-apps button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; text-decoration: none;
}
.share-apps .ico { font-size: 22px; }
.copy-row { display: flex; gap: 6px; margin-top: 10px; }
.copy-row input { font-size: 14px; }

.out-list { display: flex; flex-direction: column; gap: 8px; }
.out-card { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.big-icon { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.success { text-align: center; padding: 18px 4px 8px; }
.success h1 { margin-bottom: 8px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* skeleton placeholders while a part of the page is still loading */
.skel {
  display: block; border-radius: 8px; color: transparent !important; pointer-events: none;
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 40%, var(--line) 80%) 0 0 / 300% 100%;
  animation: skel 1.3s ease-in-out infinite;
}
.skel-line { height: 12px; margin: 6px 0; }
.skel-line.lg { height: 16px; }
.skel-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.out-card.skel-card { background: var(--surface-2); }
.out-card.skel-card .o-main { flex: 1; min-width: 0; }
/* the map stays usable while it loads; only its empty background shimmers */
.map.map-loading {
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 40%, var(--line) 80%) 0 0 / 300% 100%;
  animation: skel 1.6s ease-in-out infinite;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel, .map.map-loading { animation: none; } }

/* ------------------------------------------------------------ prose (privacy) */
.prose h2 { margin-top: 26px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.prose table { font-size: 14px; }

/* ------------------------------------------------------------ admin (kept compact) */
.wrap { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.glass { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); box-shadow: var(--shadow); }
.wrap > .card, .wrap > .glass.card { width: 100%; max-width: 440px; }
.wide { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }
.sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.flash { padding: 12px 18px; border-radius: 18px; margin-bottom: 18px; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top .brand { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 900px) { .grid { grid-template-columns: 2fr 1fr; } }
.panel { padding: 20px; margin-bottom: 18px; overflow-x: auto; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 16px; color: inherit; background: var(--surface-2); border: 1px solid var(--line);
}
a.item:hover { text-decoration: none; border-color: var(--accent); }
.item .t { font-weight: 600; font-size: 14px; }
.item .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.date { text-align: center; min-width: 46px; }
.date b { display: block; font-size: 18px; line-height: 1; }
.date span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.water { background: var(--water-soft); color: var(--water); }
.tag.power { background: var(--power-soft); color: var(--power); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.dim { background: var(--surface-2); color: var(--muted); }
.streets { display: flex; flex-wrap: wrap; gap: 6px; }
.streets span { padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
pre.raw { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; color: var(--muted); margin: 0; max-height: 260px; overflow: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; margin-bottom: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.seg { display: flex; gap: 6px; margin-bottom: 12px; }
.seg label { flex: 1; }
.seg input { display: none; }
.seg span {
  display: block; text-align: center; padding: 10px; border-radius: 14px; cursor: pointer; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.seg input:checked + span { background: var(--accent); color: #fff; border-color: transparent; }

/* ------------------------------------------------------------ admin analytics */
.an .top .actions .chip { text-decoration: none; }
.an .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis > div { padding: 14px 16px; }
.kpis span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpis b { display: block; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; margin: 4px 0; }
.kpis small { font-size: 12.5px; color: var(--ink-2); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.key.water { background: var(--chart-water); }
.key.power { background: var(--chart-power); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h2 { margin: 0; }
.legend-inline { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.chart { width: 100%; min-height: 180px; }
.chart svg { display: block; overflow: visible; }
.chart .bar.water { fill: var(--chart-water); }
.chart .bar.power { fill: var(--chart-power); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--accent-soft); }
.tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: var(--shadow); line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.an-table td.num, .an-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-table th[data-k] { cursor: pointer; user-select: none; }
.an-table th[aria-sort="descending"]::after { content: " ▾"; }
.an-table th[aria-sort="ascending"]::after { content: " ▴"; }
.an-table thead th { position: sticky; top: 0; background: var(--surface); }
.hbar { display: flex; gap: 2px; height: 10px; }
.hbar i { display: block; height: 100%; border-radius: 3px; }
.hbar i.water { background: var(--chart-water); }
.hbar i.power { background: var(--chart-power); }

/* ============================================================ Liquid Glass (Apple-inspired)
   Translucent material: strong blur + saturation, a specular highlight on the top edge,
   a hairline bright border, capsule shapes and a springy press. Later rules override the
   base styles above. People who ask for less transparency get solid surfaces. */
:root {
  --sys-blue: #007aff; --sys-green: #34c759; --sys-red: #ff3b30;
  --lg-fill: rgba(255, 255, 255, 0.56);
  --lg-fill-strong: rgba(255, 255, 255, 0.78);
  --lg-edge: rgba(255, 255, 255, 0.7);
  --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0.16) 100%);
  --lg-blur: blur(22px) saturate(185%);
  --lg-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 28px -10px rgba(15, 23, 42, 0.28);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.25), inset 0 0 0 0.5px rgba(255, 255, 255, 0.4);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --accent: var(--sys-blue);
  --accent-soft: rgba(0, 122, 255, 0.12);
  --ok: #248a3d;
  --glass: var(--lg-fill-strong);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sys-blue: #0a84ff; --sys-green: #30d158; --sys-red: #ff453a;
    --lg-fill: rgba(44, 52, 68, 0.48);
    --lg-fill-strong: rgba(28, 34, 46, 0.72);
    --lg-edge: rgba(255, 255, 255, 0.16);
    --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0.05) 100%);
    --lg-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 30px -10px rgba(0, 0, 0, 0.7);
    --lg-inner: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    --accent: var(--sys-blue);
    --accent-soft: rgba(10, 132, 255, 0.2);
    --ok: #30d158;
  }
}
:root[data-theme="dark"] {
  --sys-blue: #0a84ff; --sys-green: #30d158; --sys-red: #ff453a;
  --lg-fill: rgba(44, 52, 68, 0.48);
  --lg-fill-strong: rgba(28, 34, 46, 0.72);
  --lg-edge: rgba(255, 255, 255, 0.16);
  --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0.05) 100%);
  --lg-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  --accent: var(--sys-blue);
  --accent-soft: rgba(10, 132, 255, 0.2);
  --ok: #30d158;
}
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif; letter-spacing: -0.005em; }
h1, h2, .brand b { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, sans-serif; }

/* the material */
.pill, .filters .chip, .map-locate, .map-legend, .btn.ghost, .icon-btn, .list-toggle, .my-cta, .toast,
.leaflet-control-zoom, .maplibregl-ctrl-attrib.maplibregl-compact {
  background: var(--lg-sheen), var(--lg-fill) !important;
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur);
  border: 0.5px solid var(--lg-edge) !important;
  box-shadow: var(--lg-inner), var(--lg-shadow) !important;
}
.pill, .filters .chip, .map-locate, .map-legend { background: var(--lg-sheen), var(--lg-fill-strong) !important; }

/* buttons: capsules, springy press */
.btn, .chip, .icon-btn, .pill.btnlike, .map-locate, .list-toggle, .my-cta {
  transition: transform .35s var(--spring), filter .2s, background-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .chip:active, .icon-btn:active, .pill.btnlike:active, .map-locate:active, .list-toggle:active, .my-cta:active {
  transform: scale(0.95); transition-duration: .12s;
}
.btn { min-height: 50px; letter-spacing: -0.01em; }
/* filled (primary): system blue with a glassy sheen and a soft coloured glow */
.btn:not(.ghost):not(.soft):not(.danger), .btn.danger.solid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 52%), var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 8px 22px -8px rgba(0, 122, 255, 0.55);
  border: 0.5px solid rgba(255, 255, 255, 0.25);
}
.btn.danger.solid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 52%), var(--sys-red);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 22px -8px rgba(255, 59, 48, 0.6);
}
.btn.ghost { color: var(--ink); }
.btn.soft { background: var(--lg-sheen), var(--accent-soft); color: var(--accent);
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur); border: 0.5px solid var(--lg-edge); box-shadow: var(--lg-inner); }
.btn.danger:not(.solid) { color: var(--sys-red); }
.btn:hover { filter: brightness(1.04); }

/* chips: glass capsules; selected = tinted, still with the sheen */
.chip { border-radius: 999px; background: var(--lg-sheen), var(--surface-2); border: 0.5px solid var(--line); box-shadow: var(--lg-inner); }
.chip[aria-pressed="true"], .filters .chip[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 55%), var(--ink) !important;
  color: var(--bg); border-color: transparent !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--lg-shadow) !important;
}
.chip[aria-pressed="true"].water, .filters .chip[aria-pressed="true"].water {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 55%), var(--water) !important; color: #fff; }
.chip[aria-pressed="true"].power, .filters .chip[aria-pressed="true"].power {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 55%), var(--power) !important; color: #231500; }
.label-chips .chip[aria-pressed="true"], #reminders .chip[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 55%), var(--accent) !important; color: #fff; }

/* round controls */
.map-locate { border-radius: 50%; width: 46px; height: 46px; color: var(--accent); }
.icon-btn { color: var(--ink); }
.leaflet-control-zoom { border-radius: 999px !important; }
.leaflet-control-zoom a { background: transparent !important; border-color: var(--lg-edge) !important; }
.list-toggle { color: var(--accent); }

/* iOS switch */
.switch { width: 51px; height: 31px; }
.switch i { background: rgba(120, 120, 128, 0.22); box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.switch i::after { width: 27px; height: 27px; top: 2px; left: 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--sys-green); }

/* sheet, dialogs, toast: thicker material */
.sheet { background: var(--lg-sheen), var(--lg-fill-strong); backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%);
  border-top: 0.5px solid var(--lg-edge); }
dialog { background: var(--lg-sheen), var(--lg-fill-strong); backdrop-filter: blur(34px) saturate(190%); -webkit-backdrop-filter: blur(34px) saturate(190%);
  border: 0.5px solid var(--lg-edge); box-shadow: var(--lg-inner), 0 30px 80px -20px rgba(0, 0, 0, 0.45); border-radius: 28px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(3px); }
.toast { color: var(--ink); font-weight: 600; }
.toast.bad { background: var(--lg-sheen), rgba(255, 59, 48, 0.88) !important; color: #fff; }

/* respect "Reduce transparency" (iOS / macOS / Windows accessibility settings) */
@media (prefers-reduced-transparency: reduce) {
  .pill, .filters .chip, .map-locate, .map-legend, .btn.ghost, .icon-btn, .list-toggle, .my-cta, .toast, .sheet, dialog,
  .leaflet-control-zoom, .btn.soft, .maplibregl-ctrl-attrib.maplibregl-compact {
    background: var(--surface) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .icon-btn, .pill.btnlike, .map-locate, .list-toggle, .my-cta, .switch i::after { transition: none; }
}

/* water / power filter icons sit in a small circle, so they stay visible on the coloured (selected) chip */
.chip .ci { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: -6px; border-radius: 50%;
  font-size: 12px; line-height: 1; background: var(--surface-2); }
.chip.water .ci { background: var(--water-soft); }
.chip.power .ci { background: var(--power-soft); }
.chip[aria-pressed="true"] .ci { background: rgba(255, 255, 255, 0.95); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }

/* theme switch: small and quiet (auto / light / dark) */
.theme-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  cursor: pointer; color: var(--ink); }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.theme-link { background: none; border: 0; padding: 0 0 0 2px; font: inherit; color: var(--muted); cursor: pointer; }
.theme-link:hover { color: var(--ink); }

/* vector base map under the Leaflet layers */
.leaflet-gl-layer { z-index: 1; }
/* OSM credit folded into a small ⓘ; a tap shows "© OpenStreetMap" */
.leaflet-control-attribution.compact { margin: 0 8px 8px 0 !important; border-radius: 999px; font-size: 11px; line-height: 22px;
  padding: 0 9px !important; color: var(--muted); cursor: pointer; }
.leaflet-control-attribution.compact:not(.open) { width: 24px; height: 24px; padding: 0 !important; font-size: 0; overflow: hidden; }
.leaflet-control-attribution.compact:not(.open)::before { content: "i"; display: block; width: 24px; text-align: center;
  font: italic 700 13px/24px Georgia, serif; color: var(--ink-2); }
.leaflet-control-attribution.compact a { color: var(--muted); }

/* top bar with the theme button: brand subtitle stays on one line */
.topbar .brand-pill { min-width: 0; flex: 1 1 auto; max-width: max-content; }
.topbar .brand { min-width: 0; }
.topbar .brand > span:last-child { min-width: 0; }
.topbar .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .theme-btn { flex: none; width: 38px; height: 38px; font-size: 16px; }
/* locate button clear of the zoom capsule */
.map-locate { bottom: calc(var(--peek, 190px) + 132px); }
@media (min-width: 900px) { .map-locate { bottom: 140px; } }

/* ------------------------------------------------------------ outage card (map popup) */
.pc-popup .leaflet-popup-content-wrapper {
  background: var(--lg-sheen), var(--lg-fill-strong); color: var(--ink); border-radius: 22px; padding: 0;
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid var(--lg-edge); box-shadow: var(--lg-inner), 0 18px 44px -14px rgba(15, 23, 42, 0.45);
}
.pc-popup .leaflet-popup-tip { background: var(--lg-fill-strong); box-shadow: none; border: 0.5px solid var(--lg-edge); }
.pc-popup .leaflet-popup-content { margin: 14px 16px 12px; font-size: 14px; line-height: 1.4; }
.pc-popup a.leaflet-popup-close-button {
  top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; font: 400 18px/25px -apple-system, sans-serif;
  color: var(--muted); background: rgba(120, 120, 128, 0.14); text-align: center;
}
.pc-popup a.leaflet-popup-close-button:hover { color: var(--ink); background: rgba(120, 120, 128, 0.22); }
.pc-head { display: flex; align-items: center; gap: 11px; padding-right: 26px; }
.pc-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
.pc.water .pc-ico { background: var(--water-soft); }
.pc.power .pc-ico { background: var(--power-soft); }
.pc-title { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.pc-title b { font-size: 16px; letter-spacing: -0.01em; }
.pc-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: rgba(120, 120, 128, 0.14); color: var(--ink-2); }
.pc-state.now { background: var(--bad-soft); color: var(--bad); }
.pc-state.now i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.pc-state.today { background: var(--accent-soft); color: var(--accent); }
.pc-place { margin-top: 12px; }
.pc-place b { display: block; font-size: 15px; }
.pc-place small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.pc-time { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.pc-window { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-left { display: block; margin-top: 2px; font-size: 13.5px; }
.pc.water .pc-left { color: var(--water); }
.pc.power .pc-left { color: var(--power); }
.pc-nums { margin-top: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding-top: 9px;
  border-top: 0.5px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pc-foot a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.pc-foot span:empty { display: none; }

/* ------------------------------------------------------------ smooth map: no blur while it moves */
.map-moving .pill, .map-moving .filters .chip, .map-moving .map-legend, .map-moving .map-locate,
.map-moving .leaflet-control-zoom, .map-moving .sheet, .map-moving .leaflet-control-attribution,
.map-moving .pc-popup .leaflet-popup-content-wrapper {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.map-moving .sheet { background: var(--surface); }
.leaflet-gl-layer, .leaflet-overlay-pane canvas { will-change: transform; }

/* ============================================================ Apple-style cards
   iOS grouped look: grey page, white rounded cards with an almost invisible shadow,
   rows with icon tiles and inset hairline separators, filled inputs, Maps-like list rows. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --ink: #1d1d1f;
  --ink-2: #3c3c43;
  --muted: #8a8a8e;
  --line: rgba(60, 60, 67, 0.13);
  --fill: rgba(118, 118, 128, 0.12);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -14px rgba(0, 0, 0, 0.14);
  --radius: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --ink: #f5f5f7; --ink-2: #d1d1d6; --muted: #98989f;
    --line: rgba(84, 84, 88, 0.55); --fill: rgba(118, 118, 128, 0.24); --card-shadow: none;
    --lg-fill: rgba(44, 44, 46, 0.5); --lg-fill-strong: rgba(28, 28, 30, 0.74);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --ink: #f5f5f7; --ink-2: #d1d1d6; --muted: #98989f;
  --line: rgba(84, 84, 88, 0.55); --fill: rgba(118, 118, 128, 0.24); --card-shadow: none;
  --lg-fill: rgba(44, 44, 46, 0.5); --lg-fill-strong: rgba(28, 28, 30, 0.74);
}

/* cards */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 18px 18px 16px; margin-bottom: 16px; }
.card > h2:first-child { font-size: 20px; font-weight: 700; letter-spacing: -0.022em; margin-bottom: 10px; }
.card h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.page h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; }
.lead { color: var(--muted); font-size: 15px; line-height: 1.45; }
.step-n { background: var(--accent); color: #fff; width: 26px; height: 26px; font-size: 13px; }

/* rows with switches: icon tile + inset hairline like iOS Settings */
.toggle { border-top: 0; position: relative; padding: 11px 0; }
.toggle:not(:first-of-type)::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: 0.5px; background: var(--line); }
.toggle .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--fill); }
.toggle .txt > b { font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.toggle .txt small { color: var(--muted); }

/* inputs: filled, no border */
input, select, textarea { border: 0; background-color: var(--fill); border-radius: 12px; }
input:focus, select:focus, textarea:focus { background-color: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px var(--accent); }
.draft .field input { background-color: var(--surface); }
.field > span { font-weight: 500; color: var(--muted); font-size: 13px; text-transform: none; }

/* list rows (outages, upcoming, addresses, my addresses): Apple Maps style */
.o-item, .out-card, .addr, .my-cta {
  border: 0 !important; border-radius: 18px; background: var(--surface) !important; box-shadow: var(--card-shadow) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.card .out-card, .card .addr { background: var(--surface-2) !important; box-shadow: none !important; }
.o-item { position: relative; padding: 13px 34px 13px 13px; margin-bottom: 10px; }
.o-item::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-52%); font-size: 22px; color: var(--muted); opacity: .7; }
.o-item:hover { background: var(--surface) !important; filter: brightness(0.98); }
.o-item.sel { box-shadow: inset 0 0 0 2px var(--accent), var(--card-shadow) !important; }
.o-ico { width: 42px; height: 42px; border-radius: 13px; font-size: 21px; }
.o-main b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.o-main .when { color: var(--ink-2); }
.my-cta.warn { box-shadow: inset 0 0 0 1.5px rgba(255, 59, 48, 0.45), var(--card-shadow) !important; }
.day { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; text-transform: none; color: var(--muted); margin: 16px 4px 8px; }
.live-tag { background: var(--sys-red); border-radius: 6px; padding: 1px 6px; }
.today-tag { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; }

/* notices and small surfaces */
.notice, .notice.ok, .notice.bad, .error { border-radius: 14px; }
.success .big-icon { font-size: 56px; }
.sheet-handle::before { width: 36px; height: 5px; background: rgba(120, 120, 128, 0.35); }

/* location refused / blocked: no location buttons at all */
.no-geo #locate, .no-geo .picker-me, .no-geo .locate { display: none !important; }

/* ------------------------------------------------------------ invite: what to do, at a glance */
.invite-hero { text-align: left; padding: 22px 20px 20px; }
.invite-hero .inv-top { display: flex; align-items: center; gap: 14px; }
.invite-hero .inv-avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; flex: none;
  background: linear-gradient(145deg, var(--accent), #5ac8fa); box-shadow: 0 8px 20px -10px rgba(0, 122, 255, 0.7); }
.invite-hero h1 { font-size: 24px; line-height: 1.15; }
.invite-hero .inv-sub { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.invite-hero .inv-where { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: flex; gap: 10px; align-items: center; }
.invite-hero .inv-where b { display: block; font-size: 15px; }
.invite-hero .inv-where small { color: var(--muted); }
.inv-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.inv-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.inv-steps li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); margin-top: -1px; }
.inv-steps li small { display: block; color: var(--muted); font-size: 13px; }
.invite-hero .btn { margin-top: 18px; }

/* a touch more squared (cards, rows, popups) */
:root { --radius: 20px; }
.card { border-radius: var(--radius); }
.o-item, .out-card, .addr, .my-cta { border-radius: 15px; }
.o-ico { border-radius: 11px; }
.pc-popup .leaflet-popup-content-wrapper { border-radius: 18px; }
dialog { border-radius: 24px; }
.sheet { border-radius: 20px 20px 0 0; }
input, select, textarea { border-radius: 11px; }
.toggle .ico { border-radius: 8px; }
.map-legend { border-radius: 14px; }

/* "Nisam kod kuće" */
#pause-card.paused { box-shadow: inset 0 0 0 1.5px rgba(255, 149, 0, 0.55), var(--card-shadow); }
#pause-card.paused #pause-text b { color: #c76a00; }
.pause-date { position: relative; }
.pause-date input { position: absolute; inset: 0; opacity: 0; min-height: 0; padding: 0; cursor: pointer; }
.pause-card { text-align: center; }
.pause-card .pause-ico { font-size: 52px; line-height: 1; margin: 6px 0 12px; }
.pause-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 12px; }
