:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #4a4741;
  --brand: #0b5d4b;
  --brand-text: #ffffff;
  --brand-ink: #0b5d4b; /* brand colour used for text, links and outlines */
  --tint-opacity: .1;
  --border: #d6d1c4;
  --warm: #f4a261; /* the app's orange (logo, icons in the bottom bar) */
  --tab-icon: #f4a261;
  --danger: #b3261e;
  --danger-text: #ffffff;
  /* One colour per province, used as a light tint behind each town in the list. */
  --prov-ancona: #2f6fb2;
  --prov-pesaro: #7b4fb5;
  --prov-macerata: #2a9d8f;
  --prov-fermo: #d08a1e;
  --prov-ascoli: #c2476b;
  --prov-altro: #8a8578;
  --warn-bg: #fff3cd;
  --warn-text: #5c4300;
  --info-bg: #e3efff;
  --info-text: #0b3a75;
}
/* Light theme only (decision of 22/11/2026): the app looks the same whatever the phone's setting. */
:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 18px; }
body {
  margin: 0 auto; max-width: 640px; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
  padding-bottom: 76px;
}
a { color: var(--brand-ink); }
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.25rem; margin: .4rem 0; }
h3 { font-size: 1.05rem; margin: .8rem 0 .3rem; }
.top { background: var(--brand); color: var(--brand-text); padding: 12px 16px 10px; }
.top a { color: var(--brand-text); font-weight: 600; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.place { margin: 4px 0 0; font-size: .95rem; }
.lang { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 22px; border: 2px solid var(--brand-text); color: var(--brand-text); font-size: .9rem; font-weight: 700; text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.status { margin: 0; padding: 10px 16px; background: var(--info-bg); color: var(--info-text); font-size: .9rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chips a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap; }
.chips a[aria-current="true"] { background: var(--c, var(--brand)); border-color: var(--c, var(--brand-ink)); color: var(--brand-text); }
main { padding: 0 16px 16px; outline: none; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 7px solid var(--c, var(--border)); border-radius: 12px; color: var(--text); text-decoration: none; }
.card-icon { flex: none; line-height: 0; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-title { font-weight: 700; }
.card-meta { color: var(--muted); font-size: .88rem; }
.card-dist { flex: none; font-weight: 700; font-size: .9rem; color: var(--brand-ink); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.detail-tipi { margin: 0; color: var(--muted); }
.detail-where { margin: 0 0 10px; }
.notice { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }
.actions { display: grid; gap: 8px; margin: 14px 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--brand-ink); background: var(--surface); color: var(--brand-ink); font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-call { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn-go { background: var(--surface); border-color: var(--brand-ink); color: var(--brand-ink); }
.access { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px 12px; }
dl { margin: 12px 0; }
.field { padding: 8px 0; border-bottom: 1px solid var(--border); }
dt { font-size: .85rem; color: var(--muted); }
dd { margin: 0; }
.updated { color: var(--muted); font-size: .88rem; }
.info-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px 10px; margin-bottom: 10px; }
.city-picker .btn { margin: 10px 0 14px; width: 100%; }
.cities { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.city { width: 100%; min-height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .95rem; padding: 4px 8px; }
#map { height: 60vh; min-height: 320px; border-radius: 12px; border: 1px solid var(--border); }
.map-popup-btn { margin-top: 6px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--brand); color: var(--brand-text); font-weight: 700; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--brand); }
/* Design 4 (26/11/2026): green bar, white labels, orange icons; the current page on a lighter background. */
.tabs a { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 4px; border-radius: 12px; text-align: center; font-size: .85rem; font-weight: 600; color: var(--brand-text); text-decoration: none; }
.tabs a svg { color: var(--tab-icon); }
.tabs a[aria-current="page"] { background: rgba(255, 255, 255, .16); font-weight: 800; }
.social { margin: 14px 0; padding: 4px 14px 12px; border-radius: 12px; border: 2px dashed var(--brand-ink); background: var(--surface); }
.social .btn { margin-top: 8px; }

/* Startup animation (~1.2 s). Disappears by CSS alone, even if JavaScript fails. */
#splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-text); animation: splash-out .5s 3.2s ease-in forwards; }
.no-splash #splash { display: none; }
#splash svg { overflow: visible; }
#splash circle { transform-box: view-box; transform-origin: 50px 50px; }
#splash .s-ring { animation: splash-ring 2s ease-out both; }
#splash .s-ring2 { animation: splash-ring 2s .4s ease-out both; }
#splash .s-you { animation: splash-left 1.2s .4s ease-out both; }
#splash .s-other { animation: splash-right 1.2s .4s ease-out both; }
.splash-name { margin: 8px 0 0; font-size: 1.6rem; font-weight: 700; animation: splash-up .8s .3s ease-out both; }
.splash-tag { margin: 0; font-size: 1rem; opacity: .9; animation: splash-up .8s .6s ease-out both; }
@keyframes splash-ring { from { transform: scale(.4); opacity: .9; } }
@keyframes splash-left { from { transform: translateX(-14px); } }
@keyframes splash-right { from { transform: translateX(14px); } }
@keyframes splash-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  #splash * { animation: none !important; }
  #splash { animation: splash-out .3s 1.5s forwards; }
}
.social-note { margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.town { margin: 18px 0 8px; font-size: 1.15rem; color: var(--brand-ink); }
.town-group:first-child .town { margin-top: 4px; }

/* Canteens and shelters: square tiles, two per row, shown first in each town. */
.tiles { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.tiles li:last-child:nth-child(odd) .tile { aspect-ratio: auto; min-height: 120px; }
.tile { display: flex; flex-direction: column; gap: 4px; aspect-ratio: 1 / 1; padding: 12px; background: var(--surface); border: 2px solid var(--c, var(--warm)); border-radius: 14px; color: var(--text); text-decoration: none; }
.tile-icon { line-height: 0; }
.tile-title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { color: var(--muted); font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tile-dist { margin-top: auto; align-self: flex-end; font-weight: 700; font-size: .9rem; color: var(--brand-ink); }

/* Drawn category icons */
.card-icon svg, .tile-icon svg { display: block; }
.detail-tipi { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0; }
.detail-tipi .tipo { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 12px; background: var(--c); color: #fff; font-size: .85rem; font-weight: 700; }
.pin svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.ui-icon { flex: none; vertical-align: -4px; }
.notice-period { display: flex; align-items: center; gap: 8px; }

/* Scripts for Arabic, Dari, Pashto, Urdu, Bengali and Punjabi (Gurmukhi). Files are only downloaded when the language is in use. */
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 400; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 700; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 400; font-display: swap; src: url("vendor/fonts/noto-nastaliq-urdu-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 700; font-display: swap; src: url("vendor/fonts/noto-nastaliq-urdu-arabic-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Gurmukhi"; font-weight: 400; font-display: swap; src: url("vendor/fonts/noto-sans-gurmukhi-gurmukhi-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Gurmukhi"; font-weight: 700; font-display: swap; src: url("vendor/fonts/noto-sans-gurmukhi-gurmukhi-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Bengali"; font-weight: 400; font-display: swap; src: url("vendor/fonts/noto-sans-bengali-bengali-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Bengali"; font-weight: 700; font-display: swap; src: url("vendor/fonts/noto-sans-bengali-bengali-700-normal.woff2") format("woff2"); }
html[lang="ar"] body, html[lang="fa"] body, html[lang="ps"] body { font-family: "Noto Naskh Arabic", system-ui, sans-serif; }
html[lang="bn"] body { font-family: "Noto Sans Bengali", system-ui, sans-serif; }
html[lang="ur"] body { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", system-ui, sans-serif; line-height: 1.9; }
html[lang="pa"] body { font-family: "Noto Sans Gurmukhi", system-ui, sans-serif; }
/* Service names, towns and addresses stay Italian: keep them in the Latin face even in right-to-left layouts. */
html[lang="ur"] .tile-title, html[lang="ur"] .card-title, html[lang="ur"] .town { line-height: 1.45; }
.offmap { margin-top: 14px; }
.offmap-text { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.chips-sub { padding-top: 0; }
.chips-sub a { min-height: 40px; font-size: .9rem; }
.chips-label { flex: none; align-self: center; font-weight: 700; color: var(--muted); font-size: .9rem; }
.badge-open, .badge-unknown { align-self: flex-start; display: inline-block; margin-top: 2px; padding: 2px 8px; border-radius: 10px; font-size: .78rem; font-weight: 700; }
.badge-open { background: var(--brand); color: var(--brand-text); }
.badge-unknown { background: var(--warn-bg); color: var(--warn-text); }
.report-link { margin: 12px 0 4px; font-size: .95rem; }
.report-link a { font-weight: 600; }

/* Town groups tinted by province (low opacity, the cards stay white on top). */
.town-group, .city-group { --tint: transparent; position: relative; margin: 0 -8px 10px; padding: 2px 8px 6px; border-radius: 14px; }
.town-group::before, .city-group::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tint); opacity: var(--tint-opacity); pointer-events: none; }
.town-group > *, .city-group > * { position: relative; }
.prov-ancona { --tint: var(--prov-ancona); }
.prov-pesaro-e-urbino { --tint: var(--prov-pesaro); }
.prov-macerata { --tint: var(--prov-macerata); }
.prov-fermo { --tint: var(--prov-fermo); }
.prov-ascoli-piceno { --tint: var(--prov-ascoli); }
.prov-fuori-regione { --tint: var(--prov-altro); }
.city-group { margin: 0 -8px 10px; padding: 2px 8px 10px; border-radius: 14px; }
.prov-title { margin: 8px 0 8px; font-size: 1rem; color: var(--brand-ink); }

/* Home: start from the need */
.home { display: grid; gap: 12px; padding-top: 6px; }
.home-question { margin: 6px 0 0; font-size: 1.3rem; }
.needs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.need { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 104px; padding: 12px 10px; border: 0; border-radius: 18px; background: var(--c); color: #fff; text-decoration: none; font-size: .92rem; font-weight: 700; text-align: start; overflow-wrap: anywhere; hyphens: auto; }
.need svg { flex: none; }
.all-services { width: 100%; }
.install { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 10px; padding: 12px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); }
.install-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; }
.install-text { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; line-height: 1.3; }
.install-text span { color: var(--muted); }
.install-close { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.install-btn, .install-ios, .install-android { grid-column: 1 / -1; }
.install-btn { width: 100%; }
.install-ios, .install-android { margin: 0; font-size: .95rem; }
.install-ios svg, .install-android svg { vertical-align: -3px; color: var(--brand-ink); }

/* Urgent help */
.urgent { display: grid; gap: 10px; }
.urgent h3 { margin: 10px 0 0; }
.urgent h4 { margin: 0 0 4px; font-size: 1rem; }
.urgent-item { display: grid; gap: 8px; padding: 10px 14px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.urgent-item p { margin: 0; }
.btn-112 { min-height: 64px; font-size: 1.2rem; background: var(--danger); border-color: var(--danger); color: var(--danger-text); }

/* One notices box on the service card */
.notices { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); }
.notices ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.notices li { font-weight: 600; }
.notices .notice-period { display: flex; align-items: center; gap: 8px; }
.notices .notice-general { font-weight: 400; }

/* Call without opening the card: a separate button over the card's top end corner */
.cards li, .tiles li { position: relative; }
.card-call { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; background: var(--brand); color: var(--brand-text); }
.cards li.has-call .card { padding-inline-end: 60px; }
.cards li.has-call .card-dist { align-self: flex-end; }
.tiles li.has-call .tile-icon { margin-inline-end: 48px; }
.today { display: inline-block; margin-top: 2px; font-size: .82rem; font-weight: 700; color: var(--brand-ink); }
.today-closed { color: var(--muted); }

/* Compact header: title, place and language on one row when there is room */
.top { padding: 8px 16px; }
.top-row { flex-wrap: nowrap; gap: 10px; }
.top h1 { font-size: 1.15rem; flex: none; }
.top-logo { flex: none; display: block; }
.top-logo + h1 { margin-inline-start: -2px; }
.top .place { margin: 0; flex: 1 1 0; min-width: 0; font-size: .85rem; line-height: 1.25; overflow-wrap: anywhere; }
.top .lang span { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.first-run .top .lang { visibility: hidden; }
.top .lang { flex: none; margin-inline-start: auto; }

/* First-run language screen */
.lang-picker { display: grid; gap: 14px; padding-top: 16px; justify-items: center; }
.lang-picker-icon { color: var(--brand-ink); }
.lang-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.lang-choice.lang-suggested { grid-column: 1 / -1; }
.lang-choice { min-height: 60px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.lang-choice.lang-suggested { border-color: var(--brand-ink); background: var(--brand); color: var(--brand-text); }

/* Icons in the bottom bar and on the category chips */
.tabs a { flex-direction: column; gap: 2px; }
.tabs a svg { flex: none; }
.chips a { gap: 6px; }
.chips a svg { flex: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
