:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #637083;
  --border: #e1e6ec;
  --primary: #0b6e99;
  --primary-text: #ffffff;
  --received: #8a5a00;
  --received-bg: #fff3d6;
  --in_progress: #0b5fa5;
  --in_progress-bg: #e1efff;
  --fixed: #1d7a3a;
  --fixed-bg: #e0f5e6;
  --error: #b42318;
  --radius: 14px;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23637083' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #1a2129;
    --text: #e6ebf0;
    --muted: #93a0b0;
    --border: #2b3540;
    --primary: #3aa3d4;
    --primary-text: #08131a;
    --received: #f2c062;
    --received-bg: #3a2e14;
    --in_progress: #7ab8f5;
    --in_progress-bg: #15304a;
    --fixed: #6fd18e;
    --fixed-bg: #173623;
    --error: #ff8a80;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2393a0b0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }

/* No accidental zoom: double-tap zoom off and no text inflation on rotation.
   Pinch-zoom stays available on purpose (residents with weaker eyesight; public-sector accessibility rules). */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--primary); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.error { color: var(--error); margin: 0.5rem 0; }
.empty { text-align: center; padding: 2rem 0; }

/* ---------- layout ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 26.25px; height: 33.6px; }
.topbar nav { display: flex; gap: 0.25rem; }
.topbar nav a {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.topbar nav a.active { background: var(--bg); color: var(--text); font-weight: 600; }

/* language switch + menu button, right side of the top bar */
.top-actions { display: flex; align-items: center; gap: 0.4rem; }
/* language: "HR ▾" button that opens a small list */
.lang-pick { position: relative; }
.lang-toggle {
  gap: 0.35rem;
  height: 44px;
  padding: 0 0.65rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.lang-toggle svg { color: var(--muted); transition: transform 0.2s; }
.lang-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.lang-switch {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 170px;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
.lang-switch[hidden] { display: none; }
.lang-switch button {
  justify-content: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 9px;
  background: none;
  font-weight: 500;
}
.lang-switch button strong { min-width: 1.6rem; font-size: 0.85rem; }
.lang-switch button[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.lang-switch button[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--primary); font-weight: 700; }
.lang-switch button:hover { background: var(--bg); }

/* hamburger menu (citizen app) */
.menu-toggle {
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topbar nav.menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 1rem;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 200px;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
.topbar nav.menu a {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 1rem;
  color: var(--text);
}
.topbar nav.menu a:hover { background: var(--bg); }
.topbar nav.menu a.active { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.topbar nav.menu .menu-logout {
  justify-content: flex-start;
  margin-top: 0.2rem;
  padding: 0.85rem 0.9rem 0.75rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  color: var(--error);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}
.topbar nav.menu .menu-logout:hover { background: var(--bg); }
.topbar nav.menu a.staff-link {
  margin-top: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle span { transition: none; }
}

.container { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.container.wide { max-width: 900px; }

/* ---------- controls ---------- */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button.primary, .button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
button:disabled { opacity: 0.6; cursor: wait; }
button.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
}

input, textarea, select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
/* own dropdown arrow, set in from the right edge (the built-in one can't be moved) */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 12px 8px;
  cursor: pointer;
}
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.field { display: block; margin: 1rem 0; }
.hint { display: block; margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; }
.field .hint { font-weight: 400; }

/* ---------- fire: emergency notice ---------- */

.emergency {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 2px solid #b42318;
  border-radius: var(--radius);
  background: color-mix(in srgb, #b42318 10%, var(--surface));
}
.emergency strong { display: block; font-size: 1.05rem; }
.emergency p { margin: 0.35rem 0 0; }
.emergency-calls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.8rem; }
.button.danger { flex-direction: column; gap: 0; padding: 0.6rem; background: #b42318; border-color: #b42318; color: #ffffff; }
.button.danger strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.button.danger span { font-size: 0.85rem; font-weight: 600; }

/* ---------- privacy notice ---------- */

.summary-box { margin: 1rem 0 0.5rem; padding: 1rem 1.1rem; }
.summary-box ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.summary-box li { margin: 0.25rem 0; }
.prose h2 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.4rem 0; }
.prose p, .prose li { line-height: 1.6; }
mark.fill { padding: 0 0.25em; border-radius: 4px; background: var(--received-bg); color: var(--received); font-weight: 600; }
.field > span { display: block; margin-bottom: 0.3rem; font-weight: 600; }

#report-form button[type="submit"] { width: 100%; margin-top: 0.5rem; padding: 0.9rem; font-size: 1.05rem; }

/* ---------- report form ---------- */

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0;
  border: 0;
}
.category {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.category { position: relative; }
.category input { position: absolute; inset: 0; width: auto; opacity: 0; pointer-events: none; }
.category .icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  background: var(--bg);
  font-size: 1.1rem;
  line-height: 1;
}
.category:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.category:has(input:focus-visible) { outline: 2px solid var(--primary); }

.photo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 160px;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.photo-drop img { max-height: 280px; border-radius: 10px; object-fit: cover; }
.photo-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  background: var(--bg);
  font-size: 1.9rem;
  line-height: 1;
}

.location {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.7rem;
  row-gap: 0.15rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.35;
}
/* animated status light (no box around it):
   searching = rings ripple out · found = dot pops in, two rings, then still · unavailable = slow red pulse */
.location .dot {
  --dot: var(--muted);
  position: relative;
  grid-row: span 2;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
}
.location .dot::before,
.location .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.location .dot::before { background: var(--dot); z-index: 1; }
.location .dot::after { border: 2px solid var(--dot); box-sizing: border-box; animation: ripple 1.4s ease-out infinite; }
.location > :not(.dot) { grid-column: 2; }
.location button.link { justify-self: start; font-size: 0.9rem; }
.location.ok { border-color: color-mix(in srgb, var(--fixed) 35%, var(--border)); }
.location.ok .dot { --dot: var(--fixed); }
.location.ok .dot::before { animation: pop 0.45s ease-out; }
.location.ok .dot::after { animation: ripple 1.2s ease-out 2; }
.location.bad { border-color: color-mix(in srgb, var(--error) 35%, var(--border)); }
.location.bad .dot { --dot: var(--error); }
.location.bad .dot::before { animation: throb 1.6s ease-in-out infinite; }
.location.bad .dot::after { animation: ripple 1.6s ease-out infinite; }
@keyframes ripple { from { transform: scale(1); opacity: 0.8; } to { transform: scale(3.2); opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.3); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes throb { 50% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .location .dot::before, .location .dot::after { animation: none !important; }
  .location .dot::after { display: none; }
}

/* ---------- sent ---------- */

.big-check {
  width: 72px;
  height: 72px;
  margin: 1.5rem auto 0.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fixed-bg);
  color: var(--fixed);
  font-size: 2.2rem;
  font-weight: 700;
}
.code {
  font: 700 1.8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  margin: 0.25rem 0 1rem;
}
.actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- lists & cards ---------- */

.lookup { display: flex; gap: 0.5rem; margin: 1rem 0; }
.lookup input { text-transform: uppercase; }

.list { display: flex; flex-direction: column; gap: 0.6rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  color: inherit;
  text-decoration: none;
}
.row img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.row .badge { align-self: flex-start; margin-top: 0.1rem; }
.row > img { align-self: flex-start; }
/* phones: put the status under the text so the text gets the full width */
@media (max-width: 480px) {
  .row { display: grid; grid-template-columns: 56px 1fr; align-items: start; row-gap: 0.4rem; }
  .row > img { grid-row: span 2; }
  .row .badge { grid-column: 2; justify-self: start; margin-top: 0; }
}
.row .grow { display: flex; flex-direction: column; gap: 0.1rem; }
.row strong { display: flex; align-items: center; gap: 0.4rem; line-height: 1.3; }
.row .cat-img { width: 1.1rem; height: 1.1rem; border-radius: 0; vertical-align: 0; }
button.row { width: 100%; border: 0; border-radius: 0; font-weight: normal; text-align: left; justify-content: flex-start; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.badge {
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.received { color: var(--received); background: var(--received-bg); }
.badge.in_progress { color: var(--in_progress); background: var(--in_progress-bg); }
.badge.fixed { color: var(--fixed); background: var(--fixed-bg); }

/* ---------- report detail ---------- */

.back { display: inline-block; margin-bottom: 0.5rem; text-decoration: none; }
.hero { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 1rem 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}
.steps li {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.steps li::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.steps li:first-child::before { display: none; }
.steps .step-dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.steps li.done { color: var(--text); font-weight: 600; }
.steps li.done::before, .steps li.done .step-dot { background: var(--fixed); }

.updates { list-style: none; padding: 0; margin: 0; }
.updates li { padding: 0.7rem 0; border-top: 1px solid var(--border); }
.updates p { margin: 0.4rem 0 0; }
.update-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.update-head time { color: var(--muted); font-size: 0.85rem; }

/* ---------- admin ---------- */

.login { max-width: 360px; margin: 3rem auto; padding: 1.5rem; }
.login button { width: 100%; }

.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar select { flex: 1; min-width: 160px; width: auto; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
/* status tiles: coloured blocks (number + label); tap one to filter the list by that status */
button.stat {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0.8rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 400;
  text-align: left;
}
.stat strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat.received { background: var(--received-bg); color: var(--received); }
.stat.in_progress { background: var(--in_progress-bg); color: var(--in_progress); }
.stat.fixed { background: var(--fixed-bg); color: var(--fixed); }
button.stat[aria-pressed="true"] { border-color: currentColor; }

.details { padding: 0 1rem 1rem; border-top: 1px solid var(--border); }
.update-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.update-form select { width: auto; }
.update-form input { flex: 1; min-width: 200px; }

/* staff page: name on one line, "Gradska uprava" small underneath */
.brand-staff { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-size: 0.78em; font-weight: 600; color: var(--muted); }

/* phones: tighter bar so "Prijavi problem – Supetar" stays on one line */
@media (max-width: 560px) {
  .topbar { gap: 0.5rem; padding-inline: 0.85rem; }
}

@media (max-width: 370px) {
  .brand img { display: none; }
}

@media (max-width: 420px) {
  .brand { font-size: 1rem; }
  .topbar nav a { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
}

/* image category icons sit like an emoji in running text */
.cat-img { width: 1.25em; height: 1.25em; vertical-align: -0.25em; }
.category .icon .cat-img { width: 1.4rem; height: 1.4rem; }

/* ---------- announcements ---------- */

.news-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--text);
  text-decoration: none;
}
.news-banner .icon { font-size: 1.4rem; }
.news-banner strong, .news-banner .small { display: block; }
.news-banner .small { color: var(--primary); font-weight: 600; margin-top: 0.1rem; }

.announcement { padding: 1rem 1.1rem; }
.announcement-head { display: flex; align-items: center; gap: 0.45rem; }
.announcement-head .icon { font-size: 1.2rem; }
.announcement h2 { margin: 0.4rem 0 0.3rem; font-size: 1.15rem; }
.announcement-body { margin: 0 0 0.5rem; white-space: pre-line; }
.announcement p.small { margin: 0; }
.announcement.warning { border-color: color-mix(in srgb, var(--error) 45%, var(--border)); }

.push-box { padding: 1rem 1.1rem; margin: 1rem 0 1.25rem; }
.push-box p { margin: 0.35rem 0 0.8rem; }
.push-box .push-on { color: var(--fixed); font-weight: 600; margin-bottom: 0.5rem; }

/* ---------- report map ---------- */

.map {
  height: 420px;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 0;
}
.container.wide .map { height: 520px; }
.leaflet-popup-content { color: #1c2430; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.leaflet-popup-content .popup-photo { display: block; width: 180px; height: 120px; object-fit: cover; border-radius: 6px; margin: 0.4rem 0; }
.pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
  color: #ffffff;
  font: 700 14px/1 system-ui, sans-serif;
}
.pin.small { display: inline-grid; width: 20px; height: 20px; font-size: 11px; box-shadow: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.9rem; }
.map-legend > span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---------- staff page: tabs, overview, announcements ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.tabs button { flex: 1 1 auto; padding: 0.6rem 0.3rem; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 0.92rem; }
.tabs button[aria-current="page"] { background: var(--bg); color: var(--text); }
@media (max-width: 420px) { .tabs button { font-size: 0.8rem; padding-inline: 0.2rem; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tile strong { font-size: 1.9rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile span { font-weight: 600; }
.tile small { color: var(--muted); font-size: 0.82rem; }

.chart { padding: 1rem 1.1rem; margin-bottom: 1rem; }
.chart h2 { margin: 0 0 0.8rem; font-size: 1.05rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--border) 60%, transparent); }
.bar { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--primary); }
.bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.announce-form { padding: 1rem 1.1rem; margin-bottom: 1.5rem; }
.announce-form h2 { margin-top: 0; }
.check { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0 1rem; font-weight: 600; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.announcement.expired { opacity: 0.6; }
button.link.danger-link { color: var(--error); }

/* ---------- staff report card ---------- */

button.report-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 0;
  border-radius: 0;
  background: none;
  font-weight: normal;
  text-align: left;
}
button.report-row:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.rc-title { display: flex; align-items: center; gap: 0.45rem; min-width: 0; font-size: 1rem; }
.rc-title .cat-img { width: 1.15rem; height: 1.15rem; }
.rc-body { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.rc-body img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.rc-text { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.rc-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.4;
}
.rc-desc.none { color: var(--muted); font-style: italic; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.rc-meta > span + span::before { content: "·"; margin-right: 0.5rem; }
.rc-dept { margin-top: -0.25rem; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.rc-code { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- waste collection ---------- */

.badge.cancelled { color: var(--muted); background: color-mix(in srgb, var(--muted) 15%, transparent); }
.waste-section { padding: 1rem 1.1rem; margin-bottom: 1rem; }
section.waste-section:not(.card) { padding-inline: 0; }
.waste-section h2 { margin-top: 0; }
.schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.schedule li { display: flex; gap: 0.75rem; align-items: flex-start; }
.schedule .icon { font-size: 1.4rem; line-height: 1.2; }
.schedule .grow > * { display: block; }
.schedule .next { margin-top: 0.15rem; color: var(--primary); font-weight: 600; }
.bulky-item { padding: 0.85rem 0.9rem; }
.bulky-item p { margin: 0.4rem 0 0; }
.bulky-item .facts { margin: 0.6rem 0 0; }
.date-group h3 { margin: 1rem 0 0.5rem; font-size: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0 0.6rem; align-items: flex-end; }
.inline-form .field { flex: 1 1 140px; margin: 0.5rem 0; }
.inline-form button { margin: 0.5rem 0; }
.slots { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.slots li { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.schedule-form { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.days { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.75rem; padding: 0; border: 0; }
.days legend { width: 100%; margin-bottom: 0.4rem; padding: 0; font-weight: 600; }
.day { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0 0.7rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.day input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.day:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* ---------- fire warning (city announcement of kind "fire") ---------- */

.fire-alert { background: #b42318; color: #ffffff; }
.fire-alert-inner { max-width: 560px; margin: 0 auto; padding: 0.9rem 1rem 1rem; }
.fire-alert-inner { padding-top: 0.5rem; padding-bottom: 0.6rem; }
.fire-alert-head { display: flex; align-items: center; gap: 0.5rem; }
button.fire-alert-toggle {
  flex: 1;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: #ffffff;
  text-align: left;
}
.fire-alert-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.fire-alert-action { flex-shrink: 0; font-size: 0.85rem; font-weight: 600; opacity: 0.9; white-space: nowrap; }
.fire-alert-112 {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 40px;
  border-radius: 10px;
  background: #ffffff;
  color: #b42318;
  font-weight: 800;
  text-decoration: none;
}
.fire-alert-details p { margin: 0.35rem 0 0; }
.fire-alert-details .emergency-calls { margin-top: 0.7rem; }
.fire-alert .button.danger { background: #ffffff; border-color: #ffffff; color: #b42318; }
.announcement.fire { border: 2px solid #b42318; }
.announcement.fire .emergency-calls { margin: 0.6rem 0; }
.staff-alerts { padding: 1rem 1.1rem; margin-bottom: 1rem; border-color: color-mix(in srgb, #b42318 45%, var(--border)); }
.staff-alerts h2 { margin-top: 0; }
.staff-alerts .push-on { color: var(--fixed); font-weight: 600; }

/* ---------- notification topics + first-visit invitation ---------- */

.topics { margin: 0.5rem 0 0.9rem; }
.topic { min-height: 40px; font-size: 0.9rem; }
.topic:has(input:disabled) { opacity: 0.85; cursor: default; }
.onboard { padding: 1rem 1.1rem; margin: 0 0 1rem; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.onboard p { margin: 0.35rem 0 0.8rem; }
p.onboard { margin: 0 0 1rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- location: actions + pick on map ---------- */

.location-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.location-actions button.link { min-height: 32px; }
.pick-map-wrap { margin: -0.4rem 0 1rem; }
.pick-map-wrap .hint { margin: 0 0 0.4rem; }
.map.pick-map { height: 300px; margin: 0; }

/* in-page confirmation (instead of pop-up dialogs) */
.confirm-box {
  margin: 0.75rem 0;
  padding: 0.85rem 0.9rem;
  border: 2px solid #b42318;
  border-radius: var(--radius);
  background: color-mix(in srgb, #b42318 10%, var(--surface));
}
.confirm-box p { margin: 0 0 0.7rem; font-weight: 600; }
button.danger-solid { background: #b42318; border-color: #b42318; color: #ffffff; }

/* iPhone zooms into any form field whose text is smaller than 16px – keep them all at least 16px.
   (Last in the file so the `font: inherit` rules above can't undo it.) */
/* date as Dan / Mjesec / Godina dropdowns */
.date-row { position: relative; }
.date-field {
  justify-content: flex-start;
  gap: 0.6rem;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  font-weight: 500;
  text-align: left;
}
.date-field svg { color: var(--muted); flex: none; }
.date-field[aria-expanded="true"] { border-color: var(--primary); }
.date-text.placeholder { color: var(--muted); }
/* the real input under the box: carries the value and the "required" bubble, never seen */
.date-value { position: absolute; inset: auto 0 0 0; width: 100%; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-clear { margin-top: 0.4rem; font-size: 0.9rem; }
.date-cal { margin-top: 0.5rem; }
.date-cal[hidden] { display: none; }
.date-cal .cal-day:not(:disabled) { border-color: var(--border); font-weight: 600; }
.date-cal .cal-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.inline-form .field-date { flex: 2 1 280px; }
/* ---------- collection zones map ---------- */
.zone-map { height: 230px; margin: 0.6rem 0 1rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; isolation: isolate; }
.zone-group + .zone-group { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.zone-group h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 1rem; }
.zone-swatch { width: 18px; height: 18px; border-radius: 5px; border: 2px solid; flex: none; }
.zone-west .zone-swatch, .zone-tag.zone-west { background: rgb(126 217 87 / 0.5); border-color: #7ed957; }
.zone-east .zone-swatch, .zone-tag.zone-east { background: rgb(47 128 237 / 0.5); border-color: #2f80ed; }
.zone-tag { display: inline-block; padding: 0 0.45rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; }
.zone-popup { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.95rem; }

/* ---------- booking: service, calendar, time slots ---------- */
.book-step { display: flex; align-items: center; gap: 0.55rem; margin: 1.3rem 0 0.6rem; font-size: 1rem; }
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: 0.85rem; font-weight: 700; flex: none; }
.service-pick { display: grid; gap: 0.5rem; }
.service { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 0.7rem; min-height: 56px; padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.service:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, transparent); }
.service input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.service-icon { font-size: 1.5rem; line-height: 1; }
.service-text { display: flex; flex-direction: column; gap: 0.1rem; }
.service-text small { font-size: 0.85rem; line-height: 1.35; }

.cal { border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.cal-month { text-transform: capitalize; }
.cal-nav { width: 44px; height: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }
.cal-nav:disabled { opacity: 0.35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays span { padding: 0.2rem 0; text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.cal-day { aspect-ratio: 1; min-height: 40px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: none; font-weight: 500; font-variant-numeric: tabular-nums; position: relative; }
.cal-day:disabled { opacity: 0.35; cursor: default; }
.cal-day.open { border-color: var(--border); background: color-mix(in srgb, var(--fixed) 10%, var(--surface)); font-weight: 700; }
.cal-day.open::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--fixed); }
.cal-day.full { opacity: 0.55; text-decoration: line-through; }
.cal-day.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.cal-day.selected::after { background: var(--primary-text); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cal-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); }
.cal-key.open { background: color-mix(in srgb, var(--fixed) 25%, var(--surface)); border-color: var(--fixed); }
.cal-key.full { background: var(--border); }

.slot-day { margin: 0 0 0.5rem; font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0.5rem; }
.slot { flex-direction: column; gap: 0.1rem; min-height: 56px; padding: 0.5rem; font-variant-numeric: tabular-nums; }
.slot small { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.slot:disabled { opacity: 0.45; cursor: default; text-decoration: line-through; }
.slot.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.slot.selected small { color: inherit; }
.chosen { margin: 0 0 0.5rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--fixed-bg); color: var(--fixed); font-weight: 600; }
.book-form .book-details .field:first-of-type { margin-top: 0.5rem; }
.slot-time { font-variant-numeric: tabular-nums; }
h3.sub { margin: 1.2rem 0 0.2rem; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .book-form * { scroll-behavior: auto; } }

/* ---------- full-screen photo ---------- */
button.photo-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
button.photo-open img { display: block; }
.photo-viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; overflow: hidden; padding: 0; border: 0; background: #000; }
.photo-viewer::backdrop { background: #000; }
.photo-viewer img { width: 100%; height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.photo-close {
  position: fixed; top: calc(env(safe-area-inset-top) + 12px); right: calc(env(safe-area-inset-right) + 12px);
  width: 48px; height: 48px; padding: 0; border: 1px solid rgb(255 255 255 / 0.35); border-radius: 50%;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 1.3rem;
}

/* location: a retry that fails again nudges the box so it is clear something happened */
.loc-again { display: block; margin-bottom: 0.25rem; }
.location.again { animation: loc-nudge 0.4s ease-out; }
@keyframes loc-nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .location.again { animation: none; } }

input, select, textarea { font-size: max(16px, 1em); }

/* ---------- pull to refresh (home-screen app) ---------- */

.ptr {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
  opacity: 0;
  transform: translate(-50%, -50px);
  pointer-events: none;
  transition: opacity 0.15s;
}
.ptr-arrow { display: inline-block; transition: transform 0.2s; }
.ptr.ready .ptr-arrow { transform: rotate(180deg); }
.ptr.loading .ptr-arrow { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr, .ptr-arrow { transition: none; } .ptr.loading .ptr-arrow { animation: none; } }
