/* Layout: barra crema in alto, mappa Google a tutto schermo, scheda bianca che sale dal basso.
   Palette del brand book BauBin, usata nelle sue proporzioni: tanto bianco e crema, verde foresta
   per struttura e navigazione, arancio solo per le azioni principali, Ink per i testi. Font: Fredoka. */
:root {
  --forest: #073F2B;      /* primario: logo, titoli, navigazione */
  --brand: #F36B16;       /* arancio BauBin: solo pulsanti principali e link */
  --brand-deep: #D9580A;  /* arancio al passaggio del mouse */
  --tangerine: #FF8A24;
  --brand-tint: #EAF2EC;  /* verde chiarissimo per riquadri */
  --orange-tint: #FFE8D6;
  --cream: #FFF7E8;       /* superfici calde e dettagli chiari su fondo scuro */
  --paw: #9A5A2E;
  --yellow: #F5C451;      /* Sun Yellow: solo per lo stato "da confermare" */
  --yellow-deep: #D9A72E;
  --ink: #20332B;         /* testi e contorni */
  --paper: #ffffff;
  --cloud: #F6F3EC;
  --line: #E6E1D6;
  --muted: #5E6661;
  --red: #C8322B;
  --green: #14583D;       /* verde del brand: stati positivi ("confermato") */
  --orange: #F36B16;
  --orange-ink: #B84A08;
  --grey: #9a9a94;
  --me: #1a73e8;
  --shadow: 0 8px 28px rgb(7 63 43 / .16);
  --font: "Fredoka", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--cream); }   /* colore dietro la barra di stato del telefono */
body { background: var(--paper); color: var(--ink); font: 400 15px/1.45 var(--font); }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.app { height: 100%; display: flex; flex-direction: column; }

/* ─── Striscia nera + barra gialla ──────────────────────────── */
.strip {
  background: var(--forest); color: var(--paper); font-size: .75rem; text-align: center;
  padding-top: max(5px, env(safe-area-inset-top, 0px)); padding-bottom: 5px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip b { color: var(--tangerine); font-weight: 600; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--cream); border-bottom: 2px solid var(--forest); padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 10;
}
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.brand__logo { height: 48px; width: auto; flex: none; display: block; }   /* mascotte: cane nel cestino */
@media (max-width: 719px) { .brand__logo { height: 42px; } }
.menu-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 0 4px 0 0;
  cursor: pointer; font-size: .62rem; font-weight: 600; flex: none; color: var(--forest); }
.menu-btn svg { width: 26px; height: 26px; fill: none; stroke: var(--forest); stroke-width: 2.6; stroke-linecap: round; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar { overflow: hidden; }
.brand__name { display: flex; align-items: center; gap: 6px; line-height: 1; margin: 0; }
.brand__word { height: 26px; width: auto; display: block; }   /* scritta ufficiale BauBin (vettoriale) */
.brand__ver { font-size: .6rem; font-weight: 600; letter-spacing: 0; background: var(--forest); color: var(--cream);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.menu__foot { font-size: .72rem; color: var(--muted); text-align: center; }
.menu__foot a { color: inherit; }
.brand__tag { font-weight: 500; font-size: .74rem; margin-top: 4px; color: var(--forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--forest); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; font-weight: 600; padding: 0;
}
.avatar svg { width: 20px; height: 20px; fill: var(--forest); }
.avatar.is-in { background: var(--forest); color: var(--cream); }

.banner {
  background: var(--brand-tint); border-bottom: 1px solid var(--brand-deep); font-size: .78rem; line-height: 1.35;
  padding-block: 7px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.banner code { font-size: .9em; background: var(--paper); padding: 0 4px; border-radius: 4px; }

/* ─── Mappa ─────────────────────────────────────────────────── */
.mapwrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--cloud); }

.zoomhint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--ink); color: var(--paper); padding: 7px 16px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow);
}

/* Mirino per posizionare un nuovo cestino */
.crosshair { display: none; position: absolute; left: var(--aim-x, 50%); top: var(--aim-y, 50%); z-index: 6; pointer-events: none;
  width: 44px; height: 56px; transform: translate(-50%, -100%); }
.crosshair svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 4px rgb(0 0 0 / .35)); animation: hop .5s ease-out; }
.crosshair path { fill: var(--ink); stroke: var(--cream); stroke-width: 2; }
.crosshair circle { fill: var(--cream); }
.adding .crosshair { display: block; }
.adding .fabs { display: none; }
@keyframes hop { from { transform: translateY(-14px); } to { transform: none; } }

/* Segnaposto cestini */
.pin { position: relative; width: 36px; height: 46px; cursor: pointer; transition: transform .15s ease; transform-origin: 50% 100%; }
.pin svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); }
.pin__body { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.pin__icon { fill: var(--ink); }
.pin__hole { fill: var(--yellow); }            /* occhi e naso del cane: "bucati" nel colore del segnaposto */
.pin--confirmed .pin__hole { fill: var(--green); }
.pin--absent .pin__hole { fill: var(--red); }
.pin--sel .pin__hole { fill: var(--ink); }
.pin--confirmed .pin__body { fill: var(--green); stroke: #0d4a27; }
.pin--confirmed .pin__icon { fill: var(--paper); }
.pin--absent .pin__body { fill: var(--red); stroke: #7a1016; }
.pin--absent .pin__icon { fill: var(--paper); }
.pin--absent { opacity: .85; }
.pin--sel { transform: scale(1.25); }
.pin--sel .pin__body { fill: var(--ink); stroke: var(--cream); }
.pin--sel .pin__icon { fill: var(--cream); }
.pin:hover { transform: scale(1.12); }
.pin--sel:hover { transform: scale(1.25); }
.pin__badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; border-radius: 999px; padding: 0 4px;
  background: var(--ink); color: var(--cream); font-size: .62rem; font-weight: 800; display: grid; place-items: center;
  border: 1.5px solid var(--paper);
}
.pin__badge--warn { background: var(--red); color: var(--paper); right: auto; left: -6px; }

.me-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--me); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px rgb(26 115 232 / .35), 0 2px 6px rgb(0 0 0 / .3); transform: translateY(10px); }

/* Pulsanti flottanti */
.fabs { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--sheet-h, 140px) + 16px);
  z-index: 7; display: flex; flex-direction: column; gap: 12px; align-items: center; transition: bottom .2s ease; }
.fab { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow); padding: 0; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.fab.is-active { background: var(--me); border-color: var(--me); color: var(--paper); }
.fab.is-active svg { fill: currentColor; }
.fab--primary { width: 62px; height: 62px; background: var(--brand); border-color: var(--forest); color: var(--paper); }
.fab--primary:hover { background: var(--brand-deep); }
.fab--primary svg { width: 30px; height: 30px; stroke-width: 3; }

/* ─── Scheda inferiore ──────────────────────────────────────── */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; max-height: 62%; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 24px rgb(0 0 0 / .14);
  padding-top: 10px; padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .sheet { left: 16px; right: auto; bottom: 16px; width: 390px; border-radius: 22px; max-height: calc(100% - 32px); box-shadow: var(--shadow); }
  .fabs { bottom: 24px; }
}
/* Maniglia: tocca o trascina per abbassare/alzare la scheda */
.sheet__grip { display: block; width: 100%; height: 22px; margin: -6px 0 8px; padding: 0; border: 0; background: none; cursor: pointer;
  touch-action: none; }
.sheet__grip i { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.sheet__grip:hover i { background: var(--grey); }
.sheet__peek { display: none; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none;
  padding: 0 0 2px; font-size: .9rem; text-align: left; cursor: pointer; }
.sheet__peektxt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__open { flex: none; font-size: .75rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; }
.sheet.is-collapsed { overflow: hidden; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.sheet.is-collapsed .sheet__body { display: none; }
.sheet.is-collapsed .sheet__peek { display: flex; }
.sheet.is-collapsed .sheet__grip { margin-bottom: 2px; }

/* Riquadro "Powered by Netlify" (iframe #nl-badge-frame in basso a destra): quando c'è, gli lasciamo spazio
   così non copre il pulsante "Apri", i pulsanti della scheda e quelli tondi. */
body:has(#nl-badge-frame) .fabs { bottom: calc(var(--sheet-h, 140px) + 16px); }
@media (min-width: 720px) { body:has(#nl-badge-frame) .fabs { bottom: 64px; } }
@media (max-width: 719px) {
  body:has(#nl-badge-frame) .sheet { padding-bottom: max(54px, calc(env(safe-area-inset-bottom, 0px) + 46px)); }
}

/* Telefono: più spazio alla mappa */
@media (max-width: 719px) {
  .sheet { max-height: 55%; }
  .strip { display: none; }
  .topbar { padding-top: max(6px, env(safe-area-inset-top, 0px)); padding-bottom: 6px; gap: 10px; }
  .brand__word { height: 22px; }
  .brand__tag { font-size: .66rem; }
  .avatar { width: 36px; height: 36px; }
  .fab { width: 46px; height: 46px; }
  .fab--primary { width: 56px; height: 56px; }
}
.sheet h2 { font-weight: 700; color: var(--forest); font-size: 1.3rem; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.01em; text-wrap: balance; }
.sheet p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 130px; }
.muted { color: var(--muted); font-size: .85rem; }
.label { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.big { font-weight: 900; font-size: 2.4rem; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dist { font-weight: 700; margin-top: 2px; }
.note { background: var(--cloud); border-radius: 12px; padding: 10px 12px; margin-top: 10px !important; font-size: .9rem; }

/* Etichette a pillola */
.tag { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  border: 1.5px solid var(--ink); background: var(--paper); white-space: nowrap; }
.tag--yellow { background: var(--orange-tint); border-color: var(--brand); }
.tag--pending { background: var(--yellow); }
.tag--confirmed { background: var(--green); border-color: var(--green); color: var(--paper); }
.tag--absent { background: var(--red); border-color: var(--red); color: var(--paper); }
.tag--removed { background: var(--cloud); border-color: var(--grey); color: var(--muted); }

/* Legenda colori */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .75rem; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-block; }
.sw--confirmed { background: var(--green); border-color: #0d4a27; }
.sw--pending { background: var(--yellow); }
.sw--absent { background: var(--red); border-color: #7a1016; }

/* Gioco: di chi è il cestino */
.game { border: 2px solid var(--ink); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.claim { display: flex; align-items: center; gap: 12px; }
.claim__paw { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; flex: none; }
.claim__paw svg { width: 26px; height: 26px; fill: var(--cream); }
.claim div { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.claim span { font-size: .75rem; font-weight: 700; color: var(--muted); }
.claim b { font-size: 1.35rem; font-weight: 900; letter-spacing: -.01em; overflow-wrap: anywhere; }
.claim.is-mine .claim__paw { background: var(--me); }
.claim.is-mine .claim__paw svg { fill: var(--paper); }
.claim--free .claim__paw { background: var(--cloud); border: 2px dashed var(--grey); }
.claim--free .claim__paw svg { fill: var(--grey); }
.game__row { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.game__hint { font-size: .75rem; color: var(--muted); }
.pips { display: inline-flex; gap: 3px; flex: none; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); }
.pips i.on { background: var(--brand); }
.claim { position: relative; }
.claim__paw img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.claim.has-photo .claim__paw { width: 60px; height: 60px; border: 3px solid var(--ink); overflow: hidden; }
.claim.is-mine.has-photo .claim__paw { border-color: var(--me); }
.value { margin-left: auto; align-self: flex-start; display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  color: var(--brand); font-size: .8rem; letter-spacing: 1px; text-shadow: 0 0 1px var(--ink); flex: none; }
.value b { color: var(--muted); text-shadow: none; font-size: .65rem; letter-spacing: 0; text-transform: uppercase; }
.value small { color: var(--muted); font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-shadow: none; }
.value--3 { color: var(--green); }
.you { font-size: .62rem; font-weight: 800; background: var(--me); color: var(--paper); border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.game__limit { font-size: .72rem; color: var(--muted); text-align: center; }
.dogpick { display: flex; flex-direction: column; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 3px 12px 3px 3px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--forest); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--forest); }
.chip__face { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--ink); }
.chip__face svg { width: 14px; height: 14px; fill: var(--cream); }
.pin__owner img { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; flex: none; }

/* @username del proprietario principale accanto al nome del cane */
.otag { font-size: .72em; font-weight: 500; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.claim b .otag { font-size: .55em; }
/* Mini classifica del singolo cestino */
.minirank { display: flex; flex-direction: column; gap: 6px; }
.minirank ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.minirank__row { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 12px; background: var(--cloud); font-size: .85rem; }
.minirank__row:first-child { background: var(--brand-tint); }
.minirank__row.is-me { outline: 2px solid var(--me); }
.minirank__pos { width: 18px; text-align: center; font-weight: 700; color: var(--forest); flex: none; font-variant-numeric: tabular-nums; }
.minirank__who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.minirank__n { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Traguardo delle 10 cacche: foto sul cestino */
.milestone { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--orange-tint); border: 1.5px solid var(--brand); border-radius: 14px; padding: 8px 12px; font-size: .82rem; }
/* Conferma "Sei fuori con…?" prima di segnare la cacca */
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; border: 2px solid var(--brand); border-radius: 16px;
  padding: 12px; background: var(--cream); }
.confirm p { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.confirm p b { font-size: 1.05rem; color: var(--forest); }
.confirm p span { font-size: .8rem; color: var(--muted); }
.confirm .row { flex: 1 1 100%; }
/* Scelta del proprietario principale */
.primary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.primary select { border: 2px solid var(--forest); border-radius: 999px; padding: 4px 10px; background: var(--paper); color: var(--ink); font-weight: 500; }
/* Admin: segnaposto che si sta spostando */
.pin--moving { animation: wiggle .6s ease-in-out infinite alternate; cursor: grab; }
.pin--moving .pin__body { stroke: var(--brand); stroke-width: 3; }
@keyframes wiggle { from { transform: rotate(-6deg) scale(1.2); } to { transform: rotate(6deg) scale(1.2); } }

/* Facce dei cani (foto o zampa) */
.face, .dogcard__face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--ink); }
.face svg, .dogcard__face svg { width: 22px; height: 22px; fill: var(--cream); }
.dogcard__face { width: 56px; height: 56px; }
.dogcard__face svg { width: 28px; height: 28px; }

/* Menù */
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu__item { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 8px; padding: 14px 16px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--paper); cursor: pointer; }
.menu__item b { font-weight: 800; font-size: 1rem; }
.menu__item span { grid-column: 1; font-size: .8rem; color: var(--muted); }
.menu__item i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: 1.6rem; font-weight: 800; }
.menu__item:hover { background: var(--brand-tint); }
.sheet .row h2 { margin: 0; flex: 1; }
.rules p { font-size: .9rem; }

/* Classifica */
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--cloud); }
.rank.is-me { background: #e7f0fd; outline: 2px solid var(--me); }
.rank__pos { width: 28px; text-align: center; font-weight: 900; font-size: 1.05rem; font-variant-numeric: tabular-nums; flex: none; }
.rank:nth-child(1) .rank__pos { color: #b8860b; } .rank:nth-child(2) .rank__pos { color: #7d7d7d; } .rank:nth-child(3) .rank__pos { color: #a0522d; }
.rank__who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.rank__who b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__who span { font-size: .75rem; color: var(--muted); }
.rank__pts { display: flex; flex-direction: column; align-items: flex-end; font-weight: 900; font-size: 1.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.rank__pts small { font-size: .6rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* I miei cani */
.dogs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dogcard { display: flex; gap: 12px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 18px; }
.dogcard.is-active { border-color: var(--ink); }
.dogcard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.dogcard__body > b { font-size: 1.05rem; font-weight: 800; }
.dogcard__body > span { font-size: .78rem; color: var(--muted); }
.locked { font-size: .75rem; font-weight: 700; color: var(--muted); }

/* Strumenti admin nella scheda del cestino */
.admin { border: 2px dashed var(--ink); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--brand-tint); }
.admin__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }
.admin__row small { color: var(--muted); }
.admin .btn--sm { min-height: 34px; padding: 4px 12px; }

/* Etichette in alto: ADMIN e DOG SITTER */
.account { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }
.badge { border-radius: 999px; padding: 4px 9px; font-size: .62rem; font-weight: 700; letter-spacing: .04em; border: 2px solid var(--forest);
  white-space: nowrap; line-height: 1; flex: none; }
.badge--admin { background: var(--brand); border-color: var(--forest); color: var(--paper); }
/* Telefono: l'etichetta ADMIN diventa un bollino appoggiato sotto l'avatar, così non schiaccia la barra */
@media (max-width: 719px) {
  .badge--admin { position: absolute; right: -6px; bottom: -7px; z-index: 1; font-size: .5rem; padding: 2px 5px; border-width: 1.5px; }
}
.badge--sitter { background: var(--me); border-color: var(--me); color: var(--paper); cursor: pointer; }

/* Interruttore modalità dog sitter */
.switch { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 2px solid var(--ink); border-radius: 18px;
  padding: 12px 14px; background: var(--paper); cursor: pointer; }
.switch.is-on { background: #e7f0fd; border-color: var(--me); }
.switch__track { width: 52px; height: 30px; border-radius: 999px; background: var(--grey); position: relative; flex: none; transition: background .2s; }
.switch__track i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper);
  box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
.switch.is-on .switch__track { background: var(--me); }
.switch.is-on .switch__track i { transform: translateX(22px); }
.switch__txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.switch__txt span { font-size: .78rem; color: var(--muted); }

/* Richieste da approvare / in attesa */
.requests { display: flex; flex-direction: column; gap: 8px; }
.request { background: var(--brand-tint); border: 1.5px solid var(--brand-deep); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.request p { font-size: .88rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.request--mine { background: var(--cloud); border-color: var(--line); flex-direction: row; align-items: center; justify-content: space-between; }

@media (max-width: 400px) { .brand__tag { font-size: .62rem; margin-top: 3px; } .badge { padding: 3px 6px; } }

.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn--dark svg { fill: var(--cream); }
.toast.toast--win { background: var(--cream); color: var(--forest); border: 2px solid var(--brand); font-size: .95rem; }

/* Punteggio unico con tendenza */
.score { background: var(--cloud); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.score__top { display: flex; align-items: center; gap: 12px; }
.score__arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--grey); }
.score__arrow svg { width: 26px; height: 26px; fill: var(--paper); }
.score--up .score__arrow { background: var(--green); }
.score--down .score__arrow { background: var(--orange); }
.score__num { display: flex; flex-direction: column; align-items: center; line-height: 1; flex: none; }
.score__num b { font-weight: 900; font-size: 1.9rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score__num span { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 2px; }
.score--up .score__num b { color: var(--green); }
.score--down .score__num b { color: var(--orange-ink); }
.score__txt { display: flex; flex-direction: column; font-size: .78rem; line-height: 1.3; min-width: 0; }
.score__txt b { font-size: .88rem; }

.scale { display: flex; flex-direction: column; gap: 4px; }
.scale__track { position: relative; height: 10px; border-radius: 999px; overflow: visible; background: var(--paper); }
.scale__zone { position: absolute; top: 0; bottom: 0; }
.scale__zone--red { left: 0; background: color-mix(in srgb, var(--red) 75%, white); border-radius: 999px 0 0 999px; }
.scale__zone--yellow { background: var(--yellow); }
.scale__zone--green { background: color-mix(in srgb, var(--green) 85%, white); border-radius: 0 999px 999px 0; }
.scale__mark { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--ink);
  border: 3px solid var(--paper); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.scale__labels { position: relative; height: 14px; font-size: .65rem; font-weight: 700; color: var(--muted); }
.scale__labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.scale__labels span:first-child { left: 0; transform: none; }

.tl { display: flex; flex-direction: column; gap: 6px; }
.tl__lbl { font-size: .68rem; font-weight: 700; color: var(--muted); }
.tl__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tl__dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: .62rem; font-weight: 900; color: var(--paper); }
.tl__dot--yes { background: var(--green); }
.tl__dot--no { background: var(--orange); }
.tl__now { font-size: .65rem; font-weight: 800; margin-left: 4px; }

.pin__trend { position: absolute; top: -6px; left: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); border: 1.5px solid var(--paper); display: grid; place-items: center; }
.pin__trend svg { width: 12px; height: 12px; fill: var(--paper); }
/* Segnalino "cestino conquistato": bandierina con zampa e nome del cane sopra il segnaposto */
.pin__owner {
  position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 3px; max-width: 110px;
  background: var(--ink); color: var(--cream); border: 1.5px solid var(--paper);
  border-radius: 999px; padding: 2px 7px 2px 4px; box-shadow: 0 2px 5px rgb(0 0 0 / .35);
  font-size: .64rem; font-weight: 800; white-space: nowrap;
}
.pin__owner svg { width: 13px; height: 13px; fill: currentColor; flex: none; }
.pin__owner b { overflow: hidden; text-overflow: ellipsis; }
.pin__owner.is-mine { background: var(--me); color: var(--paper); }
#map[data-zoom="far"] .pin__owner { padding: 2px; bottom: calc(100% - 2px); }
#map[data-zoom="far"] .pin__owner b { display: none; }

#map[data-zoom="far"] .pin { width: 24px; height: 31px; }
#map[data-zoom="far"] .pin__badge { transform: scale(.8); top: -6px; right: -8px; }
#map[data-zoom="far"] .pin__trend { transform: scale(.8); top: -7px; left: -8px; }
.close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--cloud);
  font-size: 1.35rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }

/* Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px;
  border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: .95rem; cursor: pointer;
  text-decoration: none; border: 2px solid var(--ink); color: var(--ink); background: var(--paper); text-align: center; }
.btn--yellow { background: var(--brand); border-color: var(--brand); color: var(--paper); font-weight: 600; }  /* pulsante principale arancio (nome storico) */
.btn--yellow:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn--dark { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.btn--outline:hover { background: var(--cloud); }
.btn--sm { min-height: 36px; padding: 6px 16px; font-size: .85rem; }
.btn.is-on { background: var(--green); border-color: var(--green); color: var(--paper); }
.btn.is-on--red { background: var(--red); border-color: var(--red); }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; text-align: left; font-size: .9rem; }
.linkbtn--red { color: var(--red); }
.btn--google { background: var(--paper); border-color: #c9c9c4; font-weight: 700; }
.btn--google:hover { background: var(--cloud); }
.btn--google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 10px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.credit { font-size: .68rem; color: var(--muted); }
.credit a, .sheet .muted a { color: inherit; }

/* Il più vicino */
.nearest { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.nearest .row { width: 100%; }

/* Stato posizione */
.geo { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 10px 12px; background: var(--cloud); }
.geo__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grey); flex: none; }
.geo--asking .geo__dot { background: var(--me); animation: pulse 1s ease-in-out infinite alternate; }
.geo--denied .geo__dot, .geo--unavailable .geo__dot { background: var(--red); }
.geo__txt { display: flex; flex-direction: column; font-size: .8rem; line-height: 1.3; min-width: 0; flex: 1; }
.geo__txt b { font-size: .88rem; }
@keyframes pulse { to { opacity: .3; } }

/* Dati del cestino */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.facts div { background: var(--cloud); border-radius: 14px; padding: 10px; min-width: 0; }
.facts dt { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Moduli */
.field { display: flex; flex-direction: column; gap: 8px; }
.field input { width: 100%; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 12px 18px; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind { border: 2px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--paper); cursor: pointer;
  font-size: .82rem; font-weight: 700; line-height: 1.15; display: flex; align-items: center; justify-content: center; gap: 8px; }
.kind__icon { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--forest); padding: 2px; }
.kind__icon .pin__icon { fill: var(--forest); }
.kind__icon .pin__hole { fill: var(--cream); }
.kind[aria-pressed="true"] .kind__icon { background: var(--paper); }
.kind[aria-pressed="true"] .kind__icon .pin__hole { fill: var(--paper); }
.kind[aria-pressed="true"] { border-color: var(--forest); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--forest); }
.warnbox { background: #fff6c2; border: 1.5px solid var(--yellow-deep); border-radius: 14px; padding: 10px 12px; font-size: .85rem; }

.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 110px); transform: translateX(-50%);
  z-index: 50; background: var(--ink); color: var(--paper); padding: 11px 20px; border-radius: 999px;
  font-weight: 700; font-size: .85rem; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 380px) { .brand__name { font-size: 1.25rem; } .kinds { grid-template-columns: 1fr; } }
.sw-dog { width: 16px; height: 16px; }
.sw-dog .pin__icon { fill: var(--ink); }
.sw-dog .pin__hole { fill: var(--paper); }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ─── V 0.5: scheda del cane, famiglia, amici, medaglie ─────── */
.dogcard__facts { font-size: .8rem; color: var(--forest); }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; border: 2px solid var(--line); border-radius: 999px; padding: 9px 12px; font-weight: 600; cursor: pointer; background: var(--paper); }
.seg input:checked + span { border-color: var(--forest); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--forest); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.select, .field input[type="date"] { width: 100%; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 11px 16px; min-height: 48px; }
.facts__small { font-size: .85rem !important; overflow-wrap: anywhere; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 18px; }
.person__face { width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: var(--cream); display: grid; place-items: center; font-weight: 700; flex: none; }
.person__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.person__body span { font-size: .8rem; color: var(--muted); }
.person__dogs { display: flex; gap: 2px; }
.medals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: 18px; background: var(--cloud); color: var(--muted); }
.medal > b { color: var(--ink); font-size: .9rem; }
.medal__note { font-size: .72rem; }
.medal__disc { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #d9d6cf; border: 3px solid #bdb9b0; filter: grayscale(1); }
.medal__disc svg { width: 30px; height: 30px; fill: #fff; opacity: .9; }
.medal__disc b { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: #bdb9b0; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .72rem; }
.medal.is-on { background: var(--orange-tint); color: var(--forest); }
.medal.is-on .medal__disc { filter: none; background: var(--yellow); border-color: var(--yellow-deep); box-shadow: 0 4px 10px rgb(217 167 46 / .45); }
.medal.is-on .medal__disc svg { fill: var(--forest); }
.medal.is-on .medal__disc b { background: var(--forest); }
.medal.is-on .medal__note { color: var(--green); font-weight: 600; }

/* iOS ingrandisce la pagina quando scrivi in un campo con testo sotto i 16 px (e poi resta ingrandita, tagliata a destra). */
input, select, textarea { font-size: max(16px, 1em); }

/* Accesso con codice via email */
.field input.code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.pwd summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.pwd[open] summary { margin-bottom: 12px; }

/* Admin: cacche del cestino */
.drops summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--forest); }
.drops[open] summary { margin-bottom: 8px; }
.drops ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.drop { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--paper); border-radius: 12px; padding: 7px 10px; }
.drop__who { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; }
.drop__who span { color: var(--muted); font-size: .75rem; }
.drop .linkbtn { flex: none; font-size: .82rem; }
