:root {
  --bg: #EFF3F1;
  --surface: #FFFFFF;
  --ink: #16221F;
  --ink-soft: #4B5A56;
  --border: #D7DFDB;
  --route: #0E6B57;
  --route-dark: #0A4F41;
  --open: #B9481F;
  --open-soft: #FBE9E1;
  --closed-soft: #E3F0EC;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .label, button, .btn {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 64px;
  min-height: 100vh;
}

/* header / masthead */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.masthead .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.masthead .brand span { color: var(--route); }
.masthead .who {
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  padding: 0;
}

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.card .sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 14px;
}

/* form elements */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}
input[type=text], input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 1px;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--route); color: #fff; }
.btn-primary:hover { background: var(--route-dark); }
.btn-ghost { background: transparent; color: var(--route); border: 1px solid var(--route); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-danger-text { background: none; color: var(--open); border: none; text-decoration: underline; width: auto; padding: 4px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* status badge */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}
.badge-aperta { background: var(--open-soft); color: var(--open); }
.badge-chiusa { background: var(--closed-soft); color: var(--route-dark); }

/* elenco trasferte */
.trasferta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.trasferta-item:last-child { border-bottom: none; }
.trasferta-item .motivo { font-weight: 500; }
.trasferta-item .data { font-size: 12px; color: var(--ink-soft); }

/* timeline tappe */
.timeline { list-style: none; margin: 0 0 16px; padding: 0; }
.timeline li {
  position: relative;
  padding-left: 28px;
  padding-bottom: 16px;
  border-left: 2px solid var(--border);
  margin-left: 10px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: attr(data-n);
  position: absolute;
  left: -12px;
  top: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--route);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline .tratta { font-size: 14px; font-weight: 500; }
.timeline .tratta small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.timeline .km-veicolo { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* documenti */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--border);
}
.doc-estratti { font-size: 12px; color: var(--route-dark); margin-top: 2px; }
.doc-list li:last-child { border-bottom: none; }
.doc-list .tipo-tag { font-size: 11px; color: var(--ink-soft); text-transform: lowercase; }

.hint { font-size: 12px; color: var(--ink-soft); margin-top: -6px; margin-bottom: 14px; }
.empty { text-align: center; color: var(--ink-soft); padding: 24px 0; font-size: 14px; }
.error-msg { background: var(--open-soft); color: var(--open); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* ---- masthead con freccia indietro ---- */
.masthead-left { display: flex; align-items: center; gap: 10px; }
.back-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 36px; height: 36px; font-size: 20px; line-height: 1;
  color: var(--ink); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.back-btn:hover { border-color: var(--route); color: var(--route); }

/* ---- anagrafica ---- */
.anag-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.anag-item:last-of-type { border-bottom: none; }
.anag-titolo { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.anag-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.anag-azioni { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.anag-riepilogo { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.anag-riepilogo:hover { border-color: var(--route); }

.link-btn {
  background: none; border: none; padding: 2px 0; font-size: 13px; font-family: inherit;
  color: var(--route); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn.danger { color: var(--open); }

details.aggiungi { margin-top: 10px; }
details.aggiungi summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--route);
  list-style: none; padding: 8px 0;
}
details.aggiungi summary::-webkit-details-marker { display: none; }
details.aggiungi[open] summary { margin-bottom: 8px; }

.totale-riga {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 14px;
}
.totale-riga strong { color: var(--route-dark); font-size: 16px; }

.ok-msg { background: var(--closed-soft); color: var(--route-dark); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.avviso-memoria { background: #FBE9E1; color: #B9481F; font-size: 12px; text-align: center; padding: 6px 10px; font-family: Inter, sans-serif; }
.anag-item.in-modifica { background: var(--closed-soft); margin: 0 -18px; padding-left: 18px; padding-right: 18px; border-radius: 6px; }

/* ---- modifica / eliminazione dentro la trasferta ---- */
.btn-danger-outline { background: transparent; color: var(--open); border: 1px solid var(--open); }
.btn-danger-outline:hover { background: var(--open-soft); }
.tappa-azioni { display: flex; gap: 12px; margin-top: 4px; }
.timeline li.in-modifica .tratta { color: var(--route-dark); }
.timeline li.in-modifica::before { background: var(--open); }
.card-modifica { border-color: var(--route); }
.doc-azioni { display: flex; align-items: center; gap: 10px; }
.doc-tipo-sel { width: auto; padding: 4px 8px; font-size: 12px; }
.sub .link-btn { font-size: 12px; margin-left: 6px; }
.luogo-fisso {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 15px;
}
.luogo-fisso span { flex: 1; }
.luogo-fisso .link-btn { flex-shrink: 0; font-size: 12px; }
.salto-avviso { font-size: 11px; color: var(--open); margin-bottom: 2px; }

/* ---- foto documenti ---- */
.pagine { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pagina { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--bg); }
.pagina img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; display: block; cursor: zoom-in; background: #fff; }
.pagina-n { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pagina-tipo { font-size: 12px; color: var(--ink-soft); margin-top: 6px; text-align: center; }
.pagina .doc-tipo-sel { width: 100%; margin-top: 6px; }
.pagina-azioni { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.pagina-azioni .link-btn { text-decoration: none; font-size: 14px; }
.pagina-azioni .link-btn.danger { font-size: 12px; text-decoration: underline; }
.pagina-azioni .link-btn[disabled] { opacity: 0.3; cursor: default; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.overlay img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- lingua ---- */
.masthead-right { display: flex; align-items: center; gap: 10px; }
.lang-btn { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; font-family: inherit; }
.lang-btn:hover { border-color: var(--route); color: var(--route); }
html[lang="zh-CN"] body, html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] h3, html[lang="zh-CN"] button, html[lang="zh-CN"] .btn, html[lang="zh-CN"] input, html[lang="zh-CN"] select {
  font-family: 'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

/* ---- pulsanti-icona ---- */
.icon-btn {
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.icon-btn:hover { color: var(--route); border-color: var(--route); }
.icon-btn.danger { color: var(--open); }
.icon-btn.danger:hover { border-color: var(--open); background: var(--open-soft); }
.icon-btn[disabled] { opacity: 0.3; cursor: default; }
.icon-btn.inline { width: 30px; height: 30px; vertical-align: middle; margin-left: 4px; }
.icon-btn.inline svg { width: 15px; height: 15px; }
.anag-azioni { flex-direction: row; gap: 6px; align-items: center; }
.star-on { color: #C79A00; display: inline-flex; vertical-align: middle; }
.star-on svg { width: 16px; height: 16px; }
.tappa-azioni { gap: 6px; margin-top: 6px; }
.pagina-azioni { justify-content: flex-start; gap: 4px; }
.pagina-azioni .icon-btn { width: 34px; height: 34px; }
.pagina-azioni .icon-btn svg { width: 16px; height: 16px; }
.btn-danger-outline svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }

/* ---- adattamento telefono ---- */
/* iOS: evita l'ingrandimento automatico del testo in orizzontale. Su Android (Chrome) il valore 100% rende
   tutto MINUSCOLO su schermi ad alta densita: quindi si applica solo a iOS, altrove resta 'auto'. */
@supports (-webkit-touch-callout: none) { html { -webkit-text-size-adjust: 100%; } }
html { text-size-adjust: auto; }
body { overflow-x: hidden; overscroll-behavior-y: contain; }
#app {
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-right: calc(14px + env(safe-area-inset-right));
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  padding-left: calc(14px + env(safe-area-inset-left));
}
/* 16px nei campi: sotto questa soglia iPhone ingrandisce la pagina al tocco */
input[type=text], input[type=email], input[type=date], input[type=number], select, textarea { font-size: 16px; min-height: 44px; max-width: 100%; }
.btn { min-height: 46px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
button, select, input, a.btn { touch-action: manipulation; }
.masthead { flex-wrap: wrap; gap: 8px; }
.masthead .brand { font-size: 18px; }
.trasferta-item { min-height: 48px; }
.link-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (max-width: 380px) { .row-2 { grid-template-columns: 1fr; gap: 0; } }
.impost-archivio { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.impost-archivio .anag-sub { margin-top: 4px; }

/* ---- impostazioni e configurazione iniziale ---- */
.impost-riga {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-weight: 500; min-height: 48px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.impost-riga:last-child { border-bottom: none; }
.impost-riga:hover { color: var(--route); }
.impost-freccia { color: var(--ink-soft); font-size: 20px; }
.home-chi { font-size: 13px; color: var(--ink-soft); margin: -12px 0 14px; }
.setup-passo { font-size: 12px; font-weight: 600; color: var(--route); margin: -8px 0 10px; letter-spacing: 0.02em; }

/* iOS: il campo data ha una larghezza interna propria e sfora il riquadro. Lo si forza alla larghezza del contenitore. */
input[type=date] {
  -webkit-appearance: none; appearance: none;
  width: 100%; max-width: 100%; display: block;
  min-width: 0;                 /* evita che il contenuto interno imponga una larghezza minima */
}
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { margin-left: auto; }
.field { min-width: 0; }        /* nel grid a due colonne, permette al campo di restringersi */

/* ---- stati trasferta e note invio ---- */
.badge-aperta { background: var(--open-soft); color: var(--open); }
.badge-inviata, .badge-chiusa { background: var(--closed-soft); color: var(--route-dark); }
.badge-annullata { background: #E7E2E2; color: #6B5E5E; text-decoration: line-through; }
.nota-invio { font-size: 12px; color: var(--ink-soft); margin: 4px 0 0; font-style: italic; }

/* riga trasferta: area info cliccabile a sinistra, badge + matita a destra */
.trasferta-item { gap: 10px; }
.trasferta-info { flex: 1; cursor: pointer; min-width: 0; padding: 4px 0; }
.trasferta-dx { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---- modale aggiornamento ---- */
.modale-agg-overlay { position: fixed; inset: 0; background: rgba(22,34,31,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 100; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.modale-agg { background: var(--surface); border-radius: 14px; padding: 18px; width: 100%; max-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.modale-agg-testo { font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.modale-agg-azioni { display: flex; gap: 10px; }
.modale-agg-azioni .btn { flex: 1; }
.icon-btn svg, .btn svg { pointer-events: none; }   /* il tap conta sul bottone, non sull'icona interna */

/* ---- flusso a passi ---- */
.flusso-titolo { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }
.flusso-sotto { font-size: 13px; color: var(--ink-soft); margin: 0 0 2px; }
.flusso-sotto .badge { margin-left: 6px; }
.setup-passo { font-size: 12px; font-weight: 600; color: var(--route); margin: 2px 0 14px; letter-spacing: 0.02em; }

/* spese */
.spesa-dx { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.spesa-importo { font-weight: 600; color: var(--route-dark); font-size: 15px; }

/* riepilogo-documento a schermo */
.riepilogo-doc { padding: 18px; }
.riep-tit { text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: 0.02em; padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.riep-tit2 { font-weight: 700; font-size: 13px; color: var(--route-dark); margin: 18px 0 8px; letter-spacing: 0.02em; }
.riep-tab { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; }
.riep-tab td, .riep-tab th { padding: 6px 4px; vertical-align: top; text-align: left; }
.riep-tab td.k { color: var(--ink-soft); font-weight: 600; width: 34%; }
.riep-tab td.c, .riep-tab th.c { text-align: center; white-space: nowrap; }
.riep-tab td.r, .riep-tab th.r { text-align: right; white-space: nowrap; }
.riep-tab.bordata { margin-top: 10px; }
.riep-tab.bordata th { background: var(--bg); font-size: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.riep-tab.bordata td { border-bottom: 1px solid var(--border); }
.riep-tab .tot td { font-weight: 700; background: var(--bg); }
.riep-tab.totali { margin-top: 12px; }
.riep-tab .tot-finale td { font-weight: 700; font-size: 15px; color: var(--route-dark); background: var(--closed-soft); }
.riep-nota { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; font-style: italic; }
.promemoria-diaria { background: var(--open-soft); color: var(--open); border: 1px solid var(--open); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin: 12px 0; }
.nota-comune { font-size: 12px; color: var(--ink-soft); font-style: italic; margin: 12px 0; }

/* ---- home v3: banner, in corso, tile ---- */
.banner { background: var(--route-dark); color: #fff; margin: -16px -16px 18px; padding: 18px 16px 14px; border-radius: 0 0 18px 18px; }
.banner-riga { display: flex; align-items: flex-start; justify-content: space-between; }
.banner-saluto { font-size: 20px; font-weight: 700; }
.banner-azienda { font-size: 11px; opacity: 0.8; margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.banner-gear { border-color: rgba(255,255,255,0.5); color: #fff; }
.banner-gear svg { stroke: #fff; }
.banner-chip { margin-top: 12px; background: #fff; color: var(--route-dark); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; text-align: center; }
.sezione-titolo { font-size: 15px; font-weight: 700; margin: 6px 0 8px; }
.card-corso { border: 2px solid var(--route); }
.corso-testa { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-corso .motivo, .cestino .motivo { font-weight: 700; font-size: 15px; }
.card-corso .data, .card .data { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.sintesi { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.corso-azioni { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.corso-azioni .btn { margin: 0; flex: 1; }
.icon-btn.grande { width: 46px; height: 44px; flex: 0 0 46px; }
.btn-grande { font-size: 16px; min-height: 50px; margin: 14px 0 18px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.tile:active { background: var(--bg); }
.tile-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--closed-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tile-ico svg { width: 16px; height: 16px; stroke: var(--route-dark); }
.tile-nome { font-weight: 700; font-size: 13px; }
.tile-sub { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }

/* concluse: chip mesi + totale */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 6px 12px; font-size: 12px; min-height: 32px; }
.chip.on { background: var(--route-dark); color: #fff; border-color: var(--route-dark); font-weight: 600; }
.totale-mese { display: flex; justify-content: space-between; align-items: center; background: var(--closed-soft); border-radius: 10px; padding: 10px 14px; margin-top: 10px; font-size: 13px; }
.totale-mese strong { color: var(--route-dark); font-size: 15px; }
.impost-freccia { color: var(--ink-soft); font-size: 20px; margin-left: 6px; }

/* cestino */
.badge-eliminata { background: #E8E8E8; color: #6B7280; }

/* documenti: spartiriga tra azione principale e opzione secondaria */
.spartiriga { height: 2px; background: var(--border); margin: 14px 0; }
.tile-largo { grid-column: 1 / -1; }

/* ---- barra in basso (tab bar) ---- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 4px 6px; background: none; border: 0; color: var(--ink-soft); font-size: 10px; font-weight: 500; min-height: 56px; cursor: pointer; }
.tab svg { width: 22px; height: 22px; stroke: currentColor; }
.tab.on { color: var(--route-dark); font-weight: 700; }
.tab.on svg { stroke: var(--route-dark); }
.tab:active { background: var(--bg); }
/* spazio in fondo alle pagine, cosi i pulsanti non finiscono sotto la barra */
#app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ---- foto in lista compatta (documenti e ricevute) ---- */
.lista-foto { display: flex; flex-direction: column; }
.riga-foto { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.riga-foto:first-child { border-top: 0; }
.riga-foto-thumb { position: relative; width: 48px; height: 48px; flex: 0 0 48px; }
.riga-foto-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: zoom-in; display: block; }
.riga-foto-n { position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.riga-foto-info { flex: 1; min-width: 0; }
.riga-foto-tipo { font-weight: 600; font-size: 14px; }
.riga-foto-sel { width: 100%; min-height: 40px; font-size: 14px; font-weight: 600; }
.riga-foto-azioni { flex-shrink: 0; }
.riep-sotto { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin: -6px 0 12px; }
.riep-sotto.fuori { color: var(--open); }
.riep-sotto.dentro { color: var(--route-dark); }
