/* Plantatam: one column for the phone, light and dark like the phone. */
:root {
  --fondo: #f4f7ef;
  --carta: #ffffff;
  --testo: #1c2418;
  --tenue: #5c6955;
  --bordo: #dbe3d2;
  --verde: #2f6b2f;
  --verde-chiaro: #e3efdc;
  --su-verde: #ffffff; /* text on a green button */
  --sana: #2e7d32;
  --problema: #b35c00;
  --urgente: #b3261e;
  --foto: #5c6955;
  --ombra: 0 1px 2px rgba(28, 36, 24, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #131711;
    --carta: #1c2219;
    --testo: #e6ecdf;
    --tenue: #a4b09b;
    --bordo: #313a2c;
    --verde: #79b86f;
    --verde-chiaro: #24331f;
    --su-verde: #0f1a0d; /* the dark-mode green is light: dark text on it */
    --sana: #3f8f44;
    --problema: #b8670d;
    --urgente: #c0392b;
    --foto: #56614f;
    --ombra: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--testo);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
button:focus-visible, .slot-scegli:focus-within, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 2px;
}

.barra {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--fondo);
  border-bottom: 1px solid var(--bordo);
}
.marca { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.marca img { border-radius: 8px; }
.bottone-testo { background: none; border: 0; color: var(--verde); font-weight: 700; padding: 8px 4px; }
.barra-destra { display: flex; align-items: center; gap: 6px; }
.lingua { padding: 6px 8px; border: 1px solid var(--bordo); border-radius: 10px; background: var(--carta); color: inherit; font: inherit; font-size: 0.95rem; }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 6px; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 10px 0 8px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 6px 0; }
.guida { font-size: 1.05rem; }
.tenue { color: var(--tenue); }
.piccolo { font-size: 0.9rem; text-align: center; }
.avviso-home { background: var(--verde-chiaro); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.avviso-home.errore { background: rgba(179, 38, 30, 0.12); color: var(--urgente); }
.per-pianta { margin: 4px 0 0; font-weight: 700; color: var(--verde); }
.seguito { margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--verde-chiaro); }
.unisce { margin: 0 0 8px; font-size: 0.9rem; }
.riga-nome a.secondario { display: flex; align-items: center; }
.secondario[aria-disabled="true"] { opacity: 0.45; }
.nota-vicini { margin: 10px 0 0; }
/* Where the plant is, its place and the weather of the last days. */
.dove { border: 0; margin: 0; padding: 0; min-width: 0; }
.dove legend { padding: 0; }
.scelte-dove { display: flex; flex-wrap: wrap; gap: 8px; }
.scelta-dove { border: 2px solid var(--verde); border-radius: 99px; background: var(--carta); color: var(--verde); font: inherit; font-weight: 700; padding: 8px 14px; cursor: pointer; }
.scelta-dove[aria-pressed="true"] { background: var(--verde); color: var(--su-verde); }
.zona-scelta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px; font-weight: 600; }
.zona-scelta .bottone-testo { padding: 4px; }
.avviso-zona { margin: 8px 0 0; color: var(--problema); }
.scegli-luogo { margin: 10px 0 6px; }
.luoghi { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.luogo { width: 100%; text-align: left; border: 1px solid var(--bordo); border-radius: 12px; background: var(--carta); color: var(--testo); font: inherit; padding: 10px 12px; cursor: pointer; }
.nota-zona { margin: 8px 0 0; font-size: 0.9rem; }
/* The next look at the plant: on the result, on the home screen when its day has come, and in the history. */
.controllo p { margin: 4px 0 12px; font-weight: 600; }
.controllo .primario { margin-top: 0; }
.da-rivedere { display: grid; gap: 10px; margin: 0 0 14px; }
.avviso-controllo { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 12px; background: var(--verde-chiaro); border: 2px solid var(--verde); border-radius: 14px; padding: 12px; }
.avviso-controllo img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; grid-row: span 1; }
.avviso-controllo p { margin: 0; font-weight: 700; }
.avviso-controllo .primario, .avviso-controllo .bottone-testo { grid-column: 1 / -1; margin: 0; }
.avviso-controllo:not(:has(img)) p { grid-column: 1 / -1; }
.voce-controllo { display: block; margin-top: 2px; color: var(--verde); font-size: 0.9rem; font-weight: 600; }
.voce-controllo.dovuto { color: var(--urgente); }
.meteo p { margin: 4px 0; }
.meteo .zona-meteo { margin-top: -2px; color: var(--tenue); font-size: 0.9rem; }
.meteo .effetto { font-weight: 600; margin-bottom: 8px; }
.meteo .fonte { font-size: 0.8rem; color: var(--tenue); margin-top: 8px; }
.lista-altre { list-style: none; padding: 0; margin: 0; }
.lista-altre li { margin: 0; border-top: 1px solid var(--bordo); }
.lista-altre li:first-child { border-top: 0; }
.altra-analisi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; background: none; border: 0; color: inherit; text-align: left; }
.altra-analisi img, .altra-analisi .voce-segnaposto { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.altra-testo { display: flex; flex-direction: column; min-width: 0; }
.altra-analisi .tenue { font-size: 0.82rem; }
.altra-testo > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* How the plant changed since the analysis before («Hacer otras fotos»). */
.andamento { display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 99px; color: #fff; font-weight: 700; background: var(--foto); }
.andamento.better { background: var(--sana); }
.andamento.worse { background: var(--urgente); }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 6px; }
.slot { position: relative; }
.slot-scegli {
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  aspect-ratio: 3 / 4;
  border: 2px dashed var(--bordo);
  border-radius: 14px;
  background: var(--carta);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--ombra);
}
.input-foto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.slot-vuoto {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--tenue);
}
.slot-vuoto strong { color: var(--testo); font-size: 0.85rem; }
.slot-piu {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--verde-chiaro);
  color: var(--verde);
  font-size: 1.6rem;
  font-weight: 700;
}
.slot-foto { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot.piena .slot-scegli { border-style: solid; border-color: var(--verde); }
.slot-togli {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
}

.etichetta { display: block; margin: 14px 0 6px; font-weight: 700; }
textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--bordo);
  border-radius: 12px;
  background: var(--carta);
  color: inherit;
  font: inherit;
  resize: vertical;
}
.contatore { text-align: right; font-size: 0.85rem; margin: 2px 0 0; }
.rimaste { text-align: center; font-weight: 700; color: var(--verde); margin-top: 10px; }
/* «Compra altre 20 · 8,99 €» under the analyses left; a big button when none is left. */
.bottone-testo.compra-altre { display: block; margin: 0 auto; }
a.bottone-testo.link-bottone { display: block; } /* «Escríbenos», small under the pack button */
.primario.compra-altre { margin-top: 10px; }
.campo {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--bordo);
  border-radius: 12px;
  background: var(--carta);
  color: inherit;
  font: inherit;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* The plant's name is written as the person types it (the access code field above is in capitals). */
.campo-nome { font-size: 1rem; letter-spacing: normal; text-transform: none; }
.riga-nome { display: flex; gap: 8px; }
.riga-nome .campo { flex: 1; min-width: 0; }
.riga-nome .secondario { flex: none; width: auto; margin-top: 0; padding: 0 18px; }
.secondario:disabled { opacity: 0.45; cursor: default; }
.nome-salvato { margin: 6px 0 0; font-weight: 700; color: var(--verde); }
.riga-lingua { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.riga-lingua label { font-weight: 700; }
.nota-traduzione { margin: 6px 0 0; font-size: 0.9rem; }
.nome-salvato::before { content: '✓ '; }
.link-bottone { text-align: center; text-decoration: none; }

.primario, .secondario {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.05rem;
}
.primario { background: var(--verde); color: var(--su-verde); border: 0; }
.primario:disabled { opacity: 0.45; cursor: default; }
.secondario { background: var(--carta); color: var(--verde); border: 2px solid var(--verde); }

.banda { border-radius: 14px; padding: 12px 16px; color: #fff; font-weight: 800; font-size: 1.15rem; }
.banda.sana { background: var(--sana); }
.banda.problema { background: var(--problema); }
.banda.urgente { background: var(--urgente); }
.banda.foto { background: var(--foto); }
.foto-usate { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.gruppo-foto { display: flex; flex-direction: column; gap: 4px; }
.gruppo-foto .tenue { font-size: 0.85rem; font-weight: 600; }
.riga-foto { display: flex; gap: 8px; }
.foto-apri { padding: 0; border: 0; border-radius: 10px; background: none; overflow: hidden; cursor: zoom-in; }
.foto-apri img { display: block; width: 72px; height: 72px; object-fit: cover; }
.problema { font-size: 1.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.chip { background: var(--verde-chiaro); border-radius: 99px; padding: 4px 12px; font-size: 0.9rem; font-weight: 600; }
.sezione { background: var(--carta); border: 1px solid var(--bordo); border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--ombra); }
.sezione ul, .sezione ol { margin: 0; padding-left: 20px; }
.sezione li { margin: 4px 0; }
.quando { display: inline-block; margin-left: 6px; color: var(--tenue); font-size: 0.88rem; }
.nota-legale { margin-top: 16px; font-size: 0.88rem; color: var(--tenue); }
.azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.azioni button { margin-top: 8px; }
.azioni .primario { grid-column: 1 / -1; } /* «Compartir» and «Descargar» side by side, «Nueva consulta» below */

/* «Hacer una foto» or «Elegir de la galería», at the bottom of the screen like the phone's own menus. */
.foglio { width: min(420px, calc(100% - 32px)); margin: auto auto 16px; padding: 16px; border: 0; border-radius: 18px; background: var(--carta); color: var(--testo); box-shadow: var(--ombra); }
.foglio::backdrop { background: rgba(0, 0, 0, 0.45); }
.foglio .primario { margin-top: 0; }
.foglio .bottone-testo { display: block; width: 100%; margin-top: 8px; }
/* A photo in large, over everything; a tap closes it. */
.visore { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, 0.94); }
.visore::backdrop { background: rgba(0, 0, 0, 0.6); }
.visore img { display: block; width: 100%; height: 100%; object-fit: contain; }
.visore-chiudi { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #1c2418; font-size: 1.6rem; font-weight: 700; line-height: 1; }

.lista-storico { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.voce { display: flex; align-items: stretch; background: var(--carta); border: 1px solid var(--bordo); border-radius: 14px; overflow: hidden; box-shadow: var(--ombra); }
.voce-apri { flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px; background: none; border: 0; color: inherit; text-align: left; min-width: 0; }
.voce-apri img, .voce-segnaposto { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; background: var(--verde-chiaro); }
.voce-testo { min-width: 0; display: flex; flex-direction: column; }
.voce-testo .tenue { font-size: 0.82rem; }
.voce-testo strong, .voce-testo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puntino { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.puntino.sana { background: var(--sana); } .puntino.problema { background: var(--problema); }
.puntino.urgente { background: var(--urgente); } .puntino.foto { background: var(--foto); }
.voce-togli { flex: none; width: 52px; border: 0; border-left: 1px solid var(--bordo); background: none; color: var(--tenue); font-size: 1.3rem; }
.vuoto { text-align: center; color: var(--tenue); padding: 24px 0; }

.attesa {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(244, 247, 239, 0.94);
  text-align: center;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) { .attesa { background: rgba(19, 23, 17, 0.94); } }
.ruota {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border: 5px solid var(--verde-chiaro);
  border-top-color: var(--verde);
  border-radius: 50%;
  animation: gira 0.9s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ruota { animation-duration: 3s; } }
