:root {
  --green: #0f5a3c;
  --green-dark: #0a3d29;
  --green-soft: #e8f5ee;
  --amber-bg: #fff6e5;
  --amber: #b45309;
  --text: #1a1a1a;
  --muted: #5c6670;
  --line: #d8e0da;
  --card: #ffffff;
  --radius: 14px;
  --touch: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #f3f6f4; color: var(--text); }
body { min-height: 100dvh; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.top {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 14px 16px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.logo { border-radius: 12px; background: #fff; flex-shrink: 0; }
.top h1 { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.subtitle { margin: 2px 0 0; font-size: .9rem; opacity: .92; }
.prova-badge {
  display: inline-block; margin-top: 12px; background: #fbbf24; color: #1a1a1a;
  font-weight: 800; font-size: .85rem; padding: 6px 12px; border-radius: 999px;
}
.tabs[hidden] { display: none !important; }
.tabs {
  display: flex; gap: 6px; padding: 10px 12px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.tab {
  flex: 1 1 auto; min-width: 0; min-height: var(--touch); border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--muted); font-size: .88rem; font-weight: 700; cursor: pointer;
  padding: 8px 6px; line-height: 1.15;
}
.tab.tab-wide { flex: 1 1 100%; }
.tab[aria-selected="true"] { background: var(--green); color: #fff; border-color: var(--green); }
main { padding: 14px 12px 24px; max-width: 520px; margin: 0 auto; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid var(--line);
}
.card h2 { margin: 0 0 10px; font-size: 1.15rem; color: var(--green-dark); }
.field { display: block; margin-bottom: 12px; }
.field-label {
  display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; color: var(--green-dark);
}
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"],
select.appunto-select {
  width: 100%; min-height: var(--touch); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.1rem; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.salvadanaio-card { border-color: var(--green); background: linear-gradient(160deg, #fff 0%, #e8f5ee 100%); }
.salvadanaio-big {
  text-align: center; padding: 18px 12px 14px;
  background: linear-gradient(135deg, var(--green-soft), #fff);
  border-radius: 12px; border: 2px solid var(--green); margin-bottom: 12px;
}
.salvadanaio-big .label { font-size: .95rem; color: var(--muted); font-weight: 700; }
.salvadanaio-big .amount {
  font-size: 2.5rem; font-weight: 900; color: var(--green-dark);
  letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.1;
}
.salvadanaio-sub { margin: 0; font-size: .88rem; color: var(--green); font-weight: 600; }
.hint { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.hours-list { display: grid; gap: 0; margin: 0; }
.hours-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 12px;
  align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.4;
}
.hours-row:last-child { border-bottom: none; padding-bottom: 0; }
.hours-row span { font-weight: 700; color: var(--green-dark); }
.hours-row strong { text-align: right; color: var(--text); }
.contact-actions { display: grid; gap: 10px; }
.contact-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--touch); padding: 10px 12px; border: 1.5px solid var(--green);
  border-radius: 12px; color: var(--green-dark); font-weight: 700; text-decoration: none;
  background: var(--green-soft);
}
.btn-primary, .btn-secondary, .btn-ghost {
  min-height: var(--touch); border-radius: 12px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; width: 100%; padding: 12px 16px; margin-top: 8px;
}
.btn-primary { background: var(--green); color: #fff; border: none; }
.btn-secondary { background: #fff; color: var(--green-dark); border: 2px solid var(--green); }
.btn-ghost {
  background: transparent; color: var(--muted); border: none; text-decoration: underline;
  font-weight: 600; font-size: .95rem; min-height: 40px;
}
.demo-otp {
  background: var(--amber-bg); color: var(--amber); border-radius: 10px;
  padding: 12px; font-weight: 700; margin: 10px 0; text-align: center;
}
.error-msg { color: #b91c1c; font-weight: 600; font-size: .95rem; margin: 8px 0; }
.auth-switch { text-align: center; margin-top: 12px; }
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  align-items: center; gap: 8px; padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: #fff;
  border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted);
}
.rules { margin: 0; padding-left: 1.2em; line-height: 1.55; font-size: 1.02rem; }
.rules li { margin-bottom: 8px; }
.meta-line { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }

.cove-toolbar { display: grid; gap: 10px; margin-bottom: 4px; }
.cove-search { margin-top: 12px !important; }
.cove-search input {
  width: 100%; min-height: var(--touch); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.05rem; background: #fff;
}
.cove-card { cursor: pointer; }
.cove-card:active { background: var(--green-soft); }
.cove-card .cove-title { margin: 0 0 6px; font-size: 1.1rem; color: var(--green-dark); font-weight: 800; }
.cove-card .cove-meta { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.cove-card .cove-meta strong { color: var(--text); font-weight: 700; }
.cove-empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.radio-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.radio-chip {
  flex: 1; min-width: 120px; min-height: var(--touch); border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; font-weight: 700; color: var(--muted); cursor: pointer;
}
.radio-chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.btn-danger {
  min-height: var(--touch); border-radius: 12px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; width: 100%; padding: 12px 16px; margin-top: 8px;
  background: #fff; color: #b91c1c; border: 2px solid #b91c1c;
}
textarea.cove-note {
  width: 100%; min-height: 88px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.05rem; font-family: inherit; resize: vertical;
}


/* Albero genealogico */
.pedigree {
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.pedigree-gen {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: stretch;
}
.pedigree-gen-2 {
  gap: 14px;
}
.pedigree-pair {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.pedigree-gen-0 { margin-top: 2px; }
.tree-box {
  flex: 1;
  min-width: 72px;
  max-width: 140px;
  background: var(--green-soft);
  border: 1.5px solid var(--green);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  font-size: .78rem;
  line-height: 1.25;
}
.tree-box.tree-self {
  max-width: 180px;
  background: #fff;
  border-width: 2px;
  font-size: .88rem;
}
.tree-box.tree-empty {
  background: #f7f7f7;
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
}
.tree-box.tree-missing {
  background: var(--amber-bg);
  border-color: #f0c070;
}
.tree-role {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--green);
  margin-bottom: 2px;
}
.tree-empty .tree-role,
.tree-missing .tree-role { color: var(--muted); }
.tree-title { font-weight: 800; color: var(--green-dark); word-break: break-word; }
.tree-sub { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.tree-self .tree-title { font-size: .95rem; }
.pedigree-links {
  display: flex;
  justify-content: center;
  height: 14px;
  margin: 2px 0;
  position: relative;
}
.pedigree-links-2 {
  gap: 14px;
}
.pedigree-link-pair {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.pedigree-link-pair::after,
.pedigree-links-1::after {
  content: '';
  position: absolute;
  left: 25%;
  right: 25%;
  top: 0;
  height: 1px;
  background: var(--line);
}
.pedigree-link-pair span,
.pedigree-links-1 span {
  width: 1px;
  height: 14px;
  background: var(--line);
  display: block;
}
.pedigree-links-1 {
  gap: 40%;
  align-items: flex-start;
}
.pedigree-links-1 span { margin: 0 10%; }
input[type="search"] {
  width: 100%; min-height: var(--touch); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.1rem; background: #fff; color: var(--text);
}


/* Controllo parentela */
.parentela-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.4;
}
.parentela-result.level-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #b91c1c;
}
.parentela-result.level-warn {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1.5px solid #f0c070;
}
.parentela-result.level-ok {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1.5px solid var(--green);
}
.parentela-result.level-info {
  background: #f7f7f7;
  color: var(--muted);
  border: 1.5px solid var(--line);
  font-weight: 600;
}
.parentela-result .parentela-detail {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-top: 6px;
}
.parentela-result .parentela-caveat {
  display: block;
  font-weight: 500;
  font-size: .8rem;
  margin-top: 6px;
  opacity: .9;
}


/* Segmenti Registro cove: Coppie | Archivio */
.segment {
  display: flex;
  gap: 6px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.segment-btn {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  padding: 8px 6px;
}
.segment-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.stagione-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
  padding: 12px;
  background: var(--green-soft);
  border: 1.5px solid var(--green);
  border-radius: 12px;
}
.stagione-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.stagione-year {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--green-dark);
}

.figlio-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.figlio-row:last-child { border-bottom: none; }
.figlio-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.figlio-meta { color: var(--muted); font-weight: 600; font-size: .88rem; }
.figlio-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.figlio-actions .btn-secondary,
.figlio-actions .btn-danger {
  width: auto;
  min-height: 40px;
  margin-top: 0;
  padding: 8px 12px;
  font-size: .9rem;
}

.archivio-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: var(--touch);
  border: none;
  background: transparent;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--green-dark);
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}
.archivio-count { font-size: .88rem; color: var(--muted); font-weight: 600; }
.archivio-body { margin-top: 10px; }
.archivio-stagione { padding-bottom: 8px; }

.coppia-card .cove-title { margin-bottom: 4px; }

/* Appunti allevamento */
.appunti-filtri {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 380px) {
  .appunti-filtri { grid-template-columns: 1fr; }
}
.appunto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.appunto-date {
  font-weight: 800;
  color: var(--green-dark);
  font-size: .95rem;
}
.appunto-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.appunto-badge-uova { background: #fff6e5; color: #b45309; }
.appunto-badge-schiuse { background: #e8f5ee; color: #0a3d29; }
.appunto-badge-malattia { background: #fef2f2; color: #b91c1c; }
.appunto-badge-generico { background: #eef2ff; color: #3730a3; }
.appunto-badge-altro { background: #f3f4f6; color: #4b5563; }
.appunto-testo {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 1.05rem;
  margin: 8px 0 14px;
  color: var(--text);
}


/* Quadro tabella coppie */
.coppie-table-wrap { padding: 10px 12px 12px; }
.coppie-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
}
.coppie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 280px;
}
.coppie-table th,
.coppie-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 90, 60, 0.12);
  vertical-align: top;
}
.coppie-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 800;
  position: sticky;
  top: 0;
  background: #fff;
}
.coppie-table tbody tr.coppia-row {
  cursor: pointer;
}
.coppie-table tbody tr.coppia-row:active,
.coppie-table tbody tr.coppia-row:hover {
  background: var(--green-soft);
}
.coppie-table .col-gabbia {
  font-weight: 800;
  color: var(--green-dark);
  white-space: nowrap;
  width: 18%;
}
.coppie-table .col-m,
.coppie-table .col-f {
  font-weight: 700;
  white-space: nowrap;
}
.coppie-table .col-figli {
  color: var(--muted);
  min-width: 4.5rem;
}
.coppie-table .col-figli strong { color: var(--text); }
.coppie-table .figli-preview {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  margin-top: 2px;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coppie-table-hint { margin: 10px 0 0; font-size: .85rem; }
.archivio-body .coppie-table-wrap {
  box-shadow: none;
  border: 1px solid rgba(15, 90, 60, 0.1);
  margin-top: 4px;
}


.cove-secondary-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px 0 16px;
  padding: 0 8px;
}
.cove-secondary-links .btn-ghost {
  width: auto;
  font-size: .88rem;
  min-height: 36px;
  opacity: .85;
}
.cove-back-row {
  margin: 0 0 8px;
}
.parentela-inline {
  margin: 4px 0 12px;
}
.parentela-inline #parentela-out {
  margin-top: 10px;
}


/* Cova / schiusa */
.cova-block {
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid rgba(15, 90, 60, 0.12);
}
.schiusa-calc {
  margin: -4px 0 10px;
  font-weight: 600;
  color: var(--green-dark);
}
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.35;
}
.field-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--green);
}
.schiusa-meta {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 2px 0 4px;
}
.schiusa-meta.schiusa-oggi {
  display: inline-block;
  color: #fff;
  background: var(--green-dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  margin-top: 4px;
}
.col-gabbia .schiusa-meta {
  display: block;
  font-weight: 600;
  white-space: normal;
}
.schiusa-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff8e6;
  border: 1px solid #e6c86a;
  color: #5c4a12;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.schiusa-banner-item {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.35;
}
.schiusa-banner-item + .schiusa-banner-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(92, 74, 18, 0.15);
}

.estrazione-card {
  border-color: #f59e0b;
  background: linear-gradient(160deg, #fff 0%, #fff6e5 100%);
}
.estrazione-card h2 { color: #92400e; }
.countdown-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 12px 0 4px;
}
.cd-unit {
  background: #fff; border: 1.5px solid #fcd34d; border-radius: 12px;
  text-align: center; padding: 10px 4px;
}
.cd-unit strong {
  display: block; font-size: 1.45rem; font-weight: 900; color: #92400e; line-height: 1.1;
}
.cd-unit span {
  display: block; font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; margin-top: 4px; letter-spacing: .02em;
}
.estrazione-wait {
  margin: 10px 0 0; font-weight: 700; color: #92400e; font-size: .95rem; line-height: 1.4;
}
.estrazione-winners {
  list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 8px;
}
.estrazione-winners li {
  display: grid; grid-template-columns: 2.2rem auto 1fr; gap: 8px; align-items: center;
  background: #fff; border: 1px solid #fcd34d; border-radius: 12px; padding: 10px 12px;
}
.estrazione-winners .posto { font-weight: 900; color: #92400e; font-size: 1.05rem; }
.estrazione-winners .premio {
  font-weight: 800; color: var(--green-dark); background: var(--green-soft);
  padding: 4px 8px; border-radius: 999px; font-size: .85rem; white-space: nowrap;
}
.estrazione-winners .winner { font-size: .92rem; color: var(--text); font-weight: 600; }

/* Pulsante Scarica l'app */
.install-banner {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px 14px;
  max-width: 520px;
  margin: 0 auto;
}
.install-banner[hidden] { display: none !important; }
.btn-install {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--touch);
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #1a1a1a;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 119, 6, .35);
  padding: 12px 16px;
}
.btn-install:active { transform: scale(.98); }
.btn-install-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}
.install-banner-hint {
  margin: 8px 0 0;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.install-sheet[hidden] { display: none !important; }
.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.install-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.install-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(85dvh, 560px);
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
}
.install-sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.install-sheet-panel h2 {
  margin: 0 40px 12px 0;
  font-size: 1.2rem;
  color: var(--green-dark);
}
.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.install-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--green-soft);
  border-radius: 12px;
  padding: 12px;
  line-height: 1.45;
  font-size: .98rem;
}
.install-steps .step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-share-icon {
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin: 0 2px;
}
.install-note {
  margin: 14px 0 0;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.45;
}

.foot { flex-direction: column; gap: 4px; text-align: center; }
.foot a, .link-privacy { color: inherit; font-weight: 700; text-decoration: underline; }
.foot-legal { font-size: 0.75rem; opacity: 0.8; line-height: 1.35; }
.legal ol, .legal ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.legal li { margin: 0.35rem 0; line-height: 1.45; }
.legal p { line-height: 1.5; }

.ultimo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; }
.ultimo-grid span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.ultimo-grid strong { font-size: 1.05rem; }
.ultimo-credito { color: var(--green); }

.accetta-card h2 { font-size: 1.4rem; }
.accetta-card p { line-height: 1.5; }
.accetta-links { display: grid; gap: 8px; margin: 12px 0 16px; }
.accetta-links .btn-ghost { width: 100%; text-align: left; }
.accetta-check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; line-height: 1.45; font-size: 1rem; }
.accetta-check input { width: 26px; height: 26px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--green); }
#acc-entra:disabled { opacity: .45; }

.accetta-avviso { background: var(--amber-bg); color: #7a2e0e; border: 2px solid #f79009; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; line-height: 1.45; font-size: 1rem; }

/* ——— Offerte del mese ——— */
.tabs .tab { flex: 1 1 22%; }
.tabs .tab.tab-wide { flex: 1 1 100%; }
.tabs { padding-top: 14px; }
.tab { position: relative; }
.tab-offerte { color: #92400e; border-color: #f59e0b; background: #fff6e5; }
.tab-offerte[aria-selected="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.tab-badge {
  position: absolute; top: -7px; right: -5px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: #dc2626; color: #fff; font-size: .82rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); line-height: 1;
}
.tab-badge[hidden] { display: none; }
.offerta-mese { border: 2px solid #f59e0b; background: linear-gradient(160deg, #fff 0%, #fff6e5 100%); padding: 14px; }
.offerta-tag {
  display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .03em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: #f59e0b; color: #1a1a1a; margin-bottom: 10px;
}
.offerta-body { display: flex; gap: 12px; align-items: center; }
.offerta-img {
  width: 92px; height: 92px; flex: 0 0 92px; border-radius: 12px; overflow: hidden;
  background: #fff; border: 1.5px solid #fcd34d; display: flex; align-items: center; justify-content: center;
}
.offerta-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.offerta-img-vuota { font-size: 2.4rem; }
.offerta-info { min-width: 0; flex: 1; }
.offerta-titolo { margin: 0 0 6px; font-size: 1.12rem; font-weight: 800; color: var(--green-dark); line-height: 1.25; overflow-wrap: anywhere; }
.offerta-prezzi { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; }
.prezzo-nuovo { font-size: 1.6rem; font-weight: 900; color: #b45309; line-height: 1; }
.prezzo-vecchio { font-size: .95rem; color: var(--muted); text-decoration: line-through; font-weight: 600; }
.offerta-validita { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 700; }
.offerta-desc { margin: 10px 0 0; font-size: .92rem; line-height: 1.4; color: var(--text); white-space: pre-line; }
.link-offerte { display: block; text-align: center; font-weight: 700; color: var(--green-dark); text-decoration: underline; margin: -4px 0 12px; font-size: .95rem; }
.offerte-intro { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.4; }
.notifiche-card .btn-primary, .notifiche-card .btn-ghost { width: 100%; }
.notifiche-msg { margin: 10px 0 0; line-height: 1.45; }
.notifiche-on { margin: 0 0 10px; font-weight: 700; color: var(--green-dark); line-height: 1.4; }

/* ——— Offerte del giorno + riquadro notifiche ——— */
.offerta-giorno { border: 2px solid #dc2626; background: linear-gradient(160deg, #fff 0%, #fff1ec 100%); padding: 14px; position: relative; }
.offerta-tag.solo-oggi { background: linear-gradient(90deg, #dc2626 0%, #f97316 100%); color: #fff; font-size: .82rem; box-shadow: 0 1px 4px rgba(220,38,38,.35); }
.offerta-giorno .offerta-img { border-color: #fca5a5; }
.offerta-giorno .prezzo-nuovo { color: #dc2626; }
.offerta-giorno .offerta-validita { color: #b91c1c; }
.notifiche-promo {
  border: 2px solid var(--green); background: linear-gradient(160deg, #e8f5ee 0%, #fff 55%, #fff6e5 100%);
  text-align: center; padding: 18px 16px;
}
.notifiche-promo h2 { font-size: 1.3rem; margin: 0 0 8px; color: var(--green-dark); }
.notifiche-promo p.testo { margin: 0 0 6px; font-size: 1rem; line-height: 1.5; color: var(--text); }
.notifiche-promo .vantaggi { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.notifiche-promo .vantaggi span { background: #fff; border: 1.5px solid #fcd34d; color: #92400e; font-weight: 800; font-size: .8rem; padding: 4px 10px; border-radius: 999px; }
.notifiche-promo .btn-primary { font-size: 1.15rem; min-height: 54px; box-shadow: 0 3px 10px rgba(15,90,60,.3); }
.notifiche-promo .hint { margin-top: 8px; }
.notifiche-promo .btn-primary, .notifiche-promo .btn-ghost { width: 100%; }
.notifiche-promo .notifiche-msg { text-align: left; }

/* ——— Notifiche attive + cliente avvisato ——— */
.notifiche-attive-box {
  border: 2px solid var(--green); background: linear-gradient(160deg, #e8f5ee 0%, #fff 100%);
  padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.notifiche-attive-box .ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.notifiche-attive-box p { margin: 0; font-weight: 800; color: var(--green-dark); font-size: 1.05rem; line-height: 1.4; }
.notifiche-attive-box .sub { margin-top: 4px; font-weight: 600; color: var(--muted); font-size: .88rem; }
.notifiche-attive-box a { display: inline-block; margin-top: 8px; font-size: .85rem; color: var(--muted); font-weight: 600; text-decoration: underline; }
.tessera-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tessera-row .meta-line { margin: 0; }
.chip-avvisato { display: inline-flex; align-items: center; gap: 4px; background: var(--green-soft); color: var(--green-dark); border: 1.5px solid var(--green); font-weight: 800; font-size: .82rem; padding: 4px 10px; border-radius: 999px; }
.chip-avvisato[hidden] { display: none; }

/* ——— Aiutaci a migliorare ——— */
.aiutaci-card { border: 2px solid var(--green); background: linear-gradient(160deg, #fff 0%, #e8f5ee 100%); }
.aiutaci-card h2 { font-size: 1.25rem; }
.aiutaci-card .intro { margin: 0 0 12px; font-size: 1rem; line-height: 1.45; color: var(--text); }
textarea.msg-testo {
  width: 100%; min-height: 110px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.05rem; font-family: inherit; resize: vertical; line-height: 1.4; background: #fff;
}
.contatore { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 600; margin: 4px 2px 0; }
.grazie-box { text-align: center; padding: 22px 16px; }
.grazie-box .big { font-size: 2.6rem; line-height: 1; }
.grazie-box p.tit { margin: 10px 0 6px; font-size: 1.2rem; font-weight: 800; color: var(--green-dark); line-height: 1.35; }
.grazie-box p.sub { margin: 0 0 4px; font-size: .95rem; color: var(--muted); line-height: 1.45; }
.aiutaci-card .btn-primary, .grazie-box .btn-secondary { width: 100%; }
.aiutaci-card .btn-primary:disabled { opacity: .5; }
.grazie-box .btn-secondary { margin-top: 12px; }

/* Stagioni del Registro cove: scelta dell'anno */
.stagione-picker {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 8px 0 10px; padding: 12px 14px; background: var(--green-soft); border: 2px solid var(--green);
  border-radius: 12px; cursor: pointer; font: inherit; text-align: left;
}
.stagione-picker .lab { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stagione-picker .val { font-size: 1.35rem; font-weight: 900; color: var(--green-dark); line-height: 1.15; }
.stagione-picker .stato { font-size: .85rem; font-weight: 700; color: var(--green); margin-top: 2px; }
.stagione-picker .freccia { font-size: 1.1rem; font-weight: 900; color: #fff; background: var(--green); border-radius: 10px; padding: 8px 12px; white-space: nowrap; }
.stagione-picker.archiviata { background: #f3f4f6; border-color: #9ca3af; }
.stagione-picker.archiviata .val { color: #374151; }
.stagione-picker.archiviata .stato { color: #6b7280; }
.stagione-picker.archiviata .freccia { background: #6b7280; }
.avviso-archivio { background: #f3f4f6; border: 1.5px solid #d1d5db; color: #374151; border-radius: 12px; padding: 10px 12px; font-size: .92rem; font-weight: 600; line-height: 1.4; margin: 0 0 10px; }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 14px 22px; box-shadow: 0 -4px 24px rgba(0,0,0,.2); }
.sheet h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--green-dark); }
.sheet .hint { margin-bottom: 10px; }
.anno-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; }
.anno-opt .anno { font-size: 1.2rem; font-weight: 900; color: var(--green-dark); }
.anno-opt .info { font-size: .85rem; color: var(--muted); font-weight: 600; text-align: right; line-height: 1.3; }
.anno-opt.on { border: 2px solid var(--green); background: var(--green-soft); }
.anno-opt.on .anno::before { content: '✓ '; color: var(--green); }
.chip-st { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; margin-left: 4px; }
.chip-st.attiva { background: var(--green); color: #fff; }
.chip-st.arch { background: #e5e7eb; color: #4b5563; }
.chip-st.nuova { background: #fff6e5; color: #b45309; border: 1px solid #fcd34d; }
.dialog-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
.dialog { position: fixed; left: 14px; right: 14px; top: 170px; z-index: 31; background: #fff; border-radius: 16px; padding: 18px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.dialog h2 { margin: 0 0 8px; font-size: 1.2rem; color: var(--green-dark); }
.dialog p { margin: 0 0 12px; line-height: 1.45; font-size: .98rem; }
.dialog select { width: 100%; min-height: 52px; border: 2px solid var(--green); border-radius: 12px; padding: 10px 12px; font-size: 1.15rem; font-weight: 800; color: var(--green-dark); background: var(--green-soft); }
.stagione-fissa { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--green-soft); border: 1.5px solid var(--green); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.stagione-fissa span { font-weight: 700; color: var(--muted); font-size: .9rem; }
.stagione-fissa strong { font-size: 1.15rem; color: var(--green-dark); }
.stagione-fissa a { font-size: .85rem; color: var(--green-dark); font-weight: 700; text-decoration: underline; }
.stagione-picker > div { min-width: 0; }
.dialog { max-height: calc(100vh - 190px); overflow-y: auto; }
.sheet { max-height: 80vh; overflow-y: auto; }
.sheet-back, .dialog-back { z-index: 1000; } .sheet, .dialog { z-index: 1001; }

/* Avvisi del negozio (in cima a Inizio) */
.avviso-negozio { display: flex; gap: 10px; align-items: flex-start; background: #fef3c7; border: 2px solid #f59e0b; border-radius: var(--radius); padding: 12px 12px 12px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.avviso-negozio .ico { font-size: 1.5rem; line-height: 1.2; }
.avviso-negozio .testo { min-width: 0; overflow-wrap: anywhere; }
.avviso-negozio strong { display: block; font-size: 1.08rem; color: #78350f; line-height: 1.35; }
.avviso-negozio span { display: block; font-size: .82rem; color: #92400e; font-weight: 600; margin-top: 3px; }
.avviso-negozio .x { margin-left: auto; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(120,53,15,.12); color: #78350f; font-size: 1.2rem; font-weight: 800; line-height: 1; cursor: pointer; }
