:root {
  --fons: #0A0B0E;
  --fons-2: #15171C;
  --fons-3: #1F2229;
  --crema: #F6EFE2;
  --crema-2: #B9B2A5;
  --taronja: #FFA82E;
  --taronja-fosc: #F2650F;
  --perill: #C62828;
  --radi: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fons);
  color: var(--crema);
  font-family: "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

/* Capçalera, estil XoriguerPressió */
.capcalera {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--taronja-fosc);
}
.capcalera-simbol { width: 96px; height: auto; }
.capcalera-text { display: flex; flex-direction: column; line-height: 1.05; }
.marca { font-weight: 700; font-style: italic; font-size: 24px; letter-spacing: .5px; }
.marca .x { color: var(--taronja); }
.submarca { color: var(--taronja); font-weight: 700; font-size: 12px; letter-spacing: 5px; }

main { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.vista { display: flex; flex-direction: column; gap: 14px; }

#vista-buida { align-items: center; text-align: center; padding-top: 8px; }
.heroi { width: min(78vw, 340px); height: auto; }

.boto-gran {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; max-width: 380px; padding: 22px 20px;
  border: 0; border-radius: 22px;
  background: linear-gradient(90deg, var(--taronja-fosc), var(--taronja));
  color: var(--fons); font: 700 italic 24px "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif;
  box-shadow: 0 6px 24px rgba(242, 101, 15, .35);
  cursor: pointer;
}
.boto-gran:active { transform: scale(.98); }
.boto-gran-icona {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--fons); color: var(--taronja); font: 700 28px "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif; font-style: normal;
}

.boto {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 14px; border-radius: 12px; border: 0;
  background: var(--taronja); color: var(--fons);
  font: 700 16px "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.boto:active { background: var(--taronja-fosc); }
.boto-sec { background: var(--fons-3); color: var(--crema); border: 1px solid #2E323B; }
.boto-sec:active { background: #2A2E37; }
.boto-perill { background: transparent; color: var(--crema); border: 2px solid var(--perill); }
.boto-perill:active { background: var(--perill); }
.fila-botons { display: flex; gap: 10px; flex-wrap: wrap; }

#mapa {
  height: 42vh; min-height: 260px; border-radius: var(--radi);
  border: 2px solid var(--fons-3); background: var(--fons-2);
}
.leaflet-container { font-family: "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif; background: #1a1c21; }
/* Mapa OSM en mode fosc */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
.marcador-cotxe, .marcador-jo { background: none; border: 0; }
.marcador-jo span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #2E9BFF; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(46,155,255,.25);
}

.dades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dada {
  background: var(--fons-2); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.etiqueta { color: var(--crema-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; }
.valor { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fletxa { display: inline-block; color: var(--taronja); transition: transform .3s; }
.petit { color: var(--crema-2); font-size: 13px; margin: 0; }

.targeta {
  background: var(--fons-2); border-radius: var(--radi); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
details.targeta > summary { cursor: pointer; font-weight: 700; list-style: none; }
details.targeta > summary::-webkit-details-marker { display: none; }
details.targeta[open] > summary { margin-bottom: 10px; }
details.targeta > *:not(summary) + * { margin-top: 10px; }

textarea, input[type=time] {
  width: 100%; background: var(--fons); color: var(--crema);
  border: 1px solid #2E323B; border-radius: 10px; padding: 10px; font: 16px "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif;
}
textarea:focus, input:focus { outline: 2px solid var(--taronja); border-color: transparent; }
#foto { width: 100%; border-radius: 12px; }

/* Parquímetre */
.parquimetre { border: 2px solid var(--crema); border-radius: 80px 80px var(--radi) var(--radi); padding-top: 18px; }
.pq-cap { display: flex; align-items: center; gap: 16px; padding: 0 6px; }
.pq-esfera { width: 92px; height: 92px; flex: none; }
.pq-info { display: flex; flex-direction: column; gap: 2px; }
.pq-temps { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pq-temps.avis { color: var(--taronja); }
.pq-temps.expirat { color: #FF5A4E; }
.pq-opcions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pq-opcions input[type=time] { width: auto; flex: 1; min-width: 110px; padding: 8px; }
.xip {
  padding: 9px 13px; border-radius: 999px; border: 1px solid var(--taronja);
  background: transparent; color: var(--taronja); font: 700 14px "Segoe UI", "Segoe UI Variable", Roboto, system-ui, sans-serif; cursor: pointer;
}
.xip:active { background: var(--taronja); color: var(--fons); }

#historial { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
#historial li { font-size: 14px; }
#historial a { color: var(--taronja); }

.peu { text-align: center; color: #5B5850; font-size: 12px; padding: 8px 0 18px; }

.avis-toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--crema); color: var(--fons); padding: 14px 16px; border-radius: 12px;
  font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 2000; text-align: center;
}
