/*
 * PlantID — sistema visual del core loop web (Loop 3B).
 * Fiel al UI kit "Plant ID Prototype" / paleta PlantWiseCare.
 * Móvil-first, columna única portrait, contenedor ~430px en desktop.
 */

/* ===== Tokens ===== */
:root {
  /* Paleta base */
  --green-primary: #1B8E4A;
  --green-cta-start: #16803C;
  --green-cta-end: #21A354;
  --green-tint: #E9F6EE;
  --green-ideal: #1E7A3C;
  --green-suitable: #8FCBA1;

  --ink: #1C1C1E;
  --grey-secondary: #6E7378;
  --grey-card: #F4F5F6;
  --grey-border: #E4E6E8;
  --surface: #FFFFFF;

  --accent-water: #3B9CE0;
  --accent-sun: #F4A62A;

  --warn-zone-start: #E8823C;
  --warn-zone-end: #D9534F;
  --danger: #E04040;

  --gradient-cta: linear-gradient(135deg, var(--green-cta-start), var(--green-cta-end));
  --gradient-zone: linear-gradient(135deg, var(--warn-zone-start), var(--warn-zone-end));
  --gradient-leaf: linear-gradient(135deg, var(--green-suitable), var(--green-primary));

  --color-border-subtle: rgba(28, 28, 30, 0.08);
  --color-overlay-scrim: rgba(28, 28, 30, 0.55);
  --color-overlay-blur-tint: rgba(244, 245, 246, 0.6);

  /* Tipografía */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-display: 26px;
  --text-headline: 22px;
  --text-section: 15px;
  --text-body: 15px;
  --text-caption: 13px;
  --text-micro: 11px;

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-card: 0 1px 2px rgba(28, 28, 30, 0.04), 0 2px 8px rgba(28, 28, 30, 0.06);
  --shadow-fab: 0 6px 16px rgba(27, 142, 74, 0.35);
  --shadow-sheet: 0 -8px 24px rgba(28, 28, 30, 0.12);
  --shadow-nav: 0 -1px 0 rgba(28, 28, 30, 0.06);

  /* Layout */
  --shell-width: 430px;
  --tab-bar-height: 76px;
  --fab-size: 56px;
  --button-height: 52px;
  --hit-min: 44px;
  --screen-pad: 20px;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
}

/* ===== Base / shell móvil ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--ink);
  background: #E6E8E4;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

.app-shell {
  max-width: var(--shell-width);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(28, 28, 30, 0.10);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--tab-bar-height);
}
body.screen-full .app-main { padding-bottom: 0; }

h1, h2, h3, p, ul { margin: 0; }
a { color: var(--green-primary); }
img { max-width: 100%; }

/* Flash toasts */
.flash {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(var(--shell-width) - 32px);
  width: calc(100% - 32px);
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.flash-alert { background: #FDECEA; color: #B3261E; }
.flash-notice { background: var(--green-tint); color: var(--green-primary); }

/* ===== Botones ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--hit-min);
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  width: 100%;
  height: var(--button-height);
  background: var(--gradient-cta);
  color: #fff;
  box-shadow: var(--shadow-fab);
}
.btn-secondary { background: var(--green-tint); color: var(--green-primary); }
.btn-ghost, .btn-link { background: transparent; color: var(--grey-secondary); font-size: 14px; }
.btn-block { width: 100%; height: var(--button-height); }
form.btn-form { display: contents; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }
.btn-row form { flex: 1; display: flex; }
.btn-row form .btn { flex: 1; }

/* ===== Cards y elementos comunes ===== */
.card {
  background: var(--grey-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.card-tint { background: var(--green-tint); }

.section-title {
  font-size: var(--text-section);
  font-weight: 700;
  color: var(--green-primary);
  margin: 24px 0 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--grey-card);
  color: var(--ink);
}
.chip-zone { background: var(--gradient-zone); color: #fff; }

.text-secondary { color: var(--grey-secondary); }

/* ===== Tab bar inferior + FAB ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-width);
  height: var(--tab-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-nav);
  padding-bottom: env(safe-area-inset-bottom, 8px);
  z-index: 40;
}
body.screen-full .tab-bar { display: none; }

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: var(--hit-min);
  min-height: var(--hit-min);
  text-decoration: none;
  color: var(--grey-secondary);
  font-size: var(--text-micro);
  font-weight: 500;
}
.tab-item.active { color: var(--green-primary); }
.tab-item svg { display: block; }

.tab-fab {
  position: relative;
  top: -22px;
  width: var(--fab-size);
  height: var(--fab-size);
  min-width: var(--fab-size);
  border-radius: var(--radius-pill);
  background: var(--gradient-cta);
  box-shadow: var(--shadow-fab);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
}

/* ===== 1. Onboarding paywall ===== */
.onboarding-paywall {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--surface);
}
.onboarding-hero {
  flex: 1;
  min-height: 46dvh;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(255,255,255,0.25), transparent 55%),
    linear-gradient(160deg, #2FA35B 0%, #1B8E4A 45%, #10693A 100%);
  position: relative;
  overflow: hidden;
}
.onboarding-hero svg { position: absolute; inset: auto 0 -8% 0; width: 100%; height: 80%; opacity: 0.9; }
.onboarding-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  margin-top: -20px;
  position: relative;
  padding: 24px var(--screen-pad) 32px;
}
.onboarding-sheet h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
}
.onboarding-offer { font-size: 15px; color: var(--grey-secondary); margin-bottom: 18px; }
.paywall-footnote {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  font-size: 13px;
}
.paywall-footnote .no-payment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-primary);
  font-weight: 600;
  text-decoration: none;
}
.paywall-footnote .restore { color: var(--grey-secondary); text-decoration: none; }

/* ===== 2. Home ===== */
.home-screen { padding: 20px var(--screen-pad) 24px; }
.home-screen > h1 { font-size: var(--text-headline); font-weight: 700; margin: 8px 0 16px; }

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grey-card);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
}
.search-field input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.search-field svg { flex-shrink: 0; }

.trending-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trending-card { text-decoration: none; display: block; }
.trending-card-photo {
  height: 90px;
  border-radius: var(--radius-md);
  background: var(--gradient-leaf);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.trending-card-pill {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trending-card-name { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 6px; }

.home-cta-scan {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  text-decoration: none;
}
.home-cta-scan svg { flex-shrink: 0; }
.home-cta-scan p { font-size: 14px; color: var(--ink); }
.home-cta-scan p strong { color: var(--green-primary); font-weight: 600; }

.article-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.article-item { display: flex; align-items: center; gap: 12px; }
.article-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-leaf);
}
.article-title { font-size: 14px; font-weight: 600; line-height: 1.3; }

/* ===== 3-4. Cámara + confirm ===== */
.camera-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #000;
  color: #fff;
}
.camera-topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--screen-pad) 16px;
}
.camera-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: none;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}
.camera-kind { font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0.02em; }

.camera-viewfinder {
  flex: 1;
  position: relative;
  background: linear-gradient(160deg, #2b3a2e, #101511);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46dvh;
}
.camera-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Retícula: 4 brackets + scanline animada */
.camera-reticle { position: relative; width: min(240px, 62vw); aspect-ratio: 3 / 4; }
.reticle-corner { position: absolute; width: 32px; height: 32px; border: 3px solid #fff; }
.reticle-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.reticle-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.reticle-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.reticle-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
.reticle-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: scanline 2.2s var(--ease-standard) infinite;
}
@keyframes scanline {
  0%, 100% { top: 0; }
  50% { top: calc(100% - 2px); }
}

/* Tarjeta Tips descartable */
.camera-tips {
  position: absolute;
  left: var(--screen-pad);
  right: var(--screen-pad);
  bottom: var(--screen-pad);
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  text-align: center;
  color: var(--ink);
}
.camera-tips-title { font-size: 15px; font-weight: 700; color: var(--green-primary); margin-bottom: 6px; }
.camera-tips p { font-size: 14px; line-height: 1.4; }
.camera-tips-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--grey-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Barra inferior de captura / confirm */
.camera-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  background: #000;
}
.camera-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  min-height: var(--hit-min);
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.camera-shutter {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 4px solid #fff;
  cursor: pointer;
  padding: 0;
}
.camera-shutter:active { background: rgba(255, 255, 255, 0.25); }
.camera-accept {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-pill);
  background: var(--green-primary);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-fab);
}
.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ===== 5-6. Resultado / informe ===== */
.result-screen { padding-bottom: 16px; }
.result-hero {
  height: 240px;
  background: var(--gradient-leaf);
  position: relative;
}
.result-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-back {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.result-body { padding: 16px var(--screen-pad) 0; }
.result-body h1 { font-size: var(--text-headline); font-weight: 700; margin-bottom: 2px; }
.species-botanical { font-size: 14px; font-style: italic; color: var(--grey-secondary); margin-bottom: 14px; }
.result-description { font-size: 14px; line-height: 1.55; color: var(--ink); }

.result-actions {
  display: flex;
  gap: 12px;
  padding: 16px var(--screen-pad) 8px;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: 20px;
}
.result-actions > *, .result-actions form { flex: 1; display: flex; }
.result-actions .btn { flex: 1; height: var(--button-height); }

/* Informe de diagnóstico */
.report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px var(--screen-pad) 8px;
  font-size: 15px;
  font-weight: 700;
}
.report-header a { color: var(--ink); display: flex; align-items: center; }
.report-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px var(--screen-pad) 16px;
}
.report-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--gradient-leaf);
  overflow: hidden;
  flex-shrink: 0;
}
.report-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-plant-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}
.health-badge.healthy { background: var(--green-tint); color: var(--green-primary); }
.health-badge.sick { background: rgba(224, 64, 64, 0.1); color: var(--danger); }

.disease-cards { display: flex; flex-direction: column; gap: 14px; padding: 0 var(--screen-pad); }
.disease-card {
  background: var(--grey-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.disease-card h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.disease-description { font-size: 14px; color: var(--grey-secondary); line-height: 1.45; margin: 10px 0 14px; }

/* Barra de confianza */
.confidence { margin-bottom: 4px; }
.confidence-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--grey-secondary);
}
.confidence-labels strong { color: var(--ink); font-weight: 600; }
.confidence-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--grey-border);
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-cta);
}

/* Segmented control (pestañas tratamiento y ficha) por radios, sin JS */
.seg-radio { position: absolute; opacity: 0; pointer-events: none; }
.segmented {
  display: flex;
  background: rgba(28, 28, 30, 0.055);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}
.disease-card .segmented { background: #E9EBEC; }
.segmented label {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-secondary);
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-standard);
}
.seg-panel { display: none; }
.seg-panel ul { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--ink); }

/* Cableado radios → labels/panels (3 opciones: a/b/c) */
.seg-a:checked ~ .segmented label:nth-of-type(1),
.seg-b:checked ~ .segmented label:nth-of-type(2),
.seg-c:checked ~ .segmented label:nth-of-type(3) {
  background: #fff;
  color: var(--green-primary);
  box-shadow: var(--shadow-card);
}
.seg-a:checked ~ .seg-panel-a { display: block; }
.seg-b:checked ~ .seg-panel-b { display: block; }
.seg-c:checked ~ .seg-panel-c { display: block; }

/* ===== 7. Ficha de especie ===== */
.species-screen { padding-bottom: 16px; }
.species-hero {
  height: 220px;
  background: var(--gradient-leaf);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.species-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.species-body { padding: 16px var(--screen-pad) 0; position: relative; }
.species-body h1 { font-size: var(--text-headline); font-weight: 700; margin-bottom: 2px; }
.species-body .segmented { margin-bottom: 20px; }

.keyfact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 14px;
}
.keyfact dt { color: var(--grey-secondary); }
.keyfact dd { margin: 0; font-weight: 600; text-align: right; }
dl.keyfacts { margin: 0; }

.leaf-swatch { width: 20px; height: 20px; border-radius: 6px; display: inline-block; }

.usda-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.usda-location {
  height: 90px;
  border-radius: var(--radius-md);
  background: var(--grey-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--grey-secondary);
  font-size: 13px;
}

/* Gauge de temperatura */
.temp-gauge-track {
  position: relative;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--green-suitable);
}
.temp-gauge-ideal {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--green-ideal);
}
.temp-gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--grey-secondary);
}
.temp-gauge-labels .ideal { color: var(--green-ideal); font-weight: 600; }

.care-cards { display: flex; gap: 12px; margin: 20px 0; }
.care-card { flex: 1; background: var(--grey-card); border-radius: var(--radius-md); padding: 16px; }
.care-card-label { font-size: 13px; color: var(--grey-secondary); margin-top: 8px; }
.care-card-value { font-size: 14px; font-weight: 700; }

/* Guías con candado (no pro) */
.guides { display: flex; flex-direction: column; gap: 12px; }
.guide {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--grey-card);
  padding: 16px;
}
.guide h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.guide p { font-size: 14px; color: var(--grey-secondary); line-height: 1.45; }
.guide.locked p { filter: blur(4px); user-select: none; }
.guide-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-overlay-blur-tint);
  color: var(--grey-secondary);
}
.guide-unlock {
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  min-height: 40px;
  background: var(--green-primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Cabecera de pantalla con acción (jardín, historial, hub, más) ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 16px;
}
.screen-header h1 { font-size: var(--text-headline); font-weight: 700; }
.screen-header-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--hit-min);
  height: var(--hit-min);
  border-radius: var(--radius-pill);
  background: var(--grey-card);
  color: var(--grey-secondary);
}

/* ===== 9. Mi Jardín ===== */
.garden-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 48px 12px 32px;
}
.garden-empty h2 { font-size: 18px; font-weight: 700; }
.garden-empty p { font-size: 14px; line-height: 1.5; max-width: 300px; }
.garden-empty .btn { margin-top: 8px; width: auto; padding: 0 28px; }

.garden-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.garden-card { position: relative; padding: 0; overflow: hidden; }
.garden-card-link { display: block; text-decoration: none; color: var(--ink); }
.garden-card-photo {
  display: block;
  height: 110px;
  background: var(--gradient-leaf);
}
.garden-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.garden-card-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px 0;
}
.garden-card-botanical {
  display: block;
  font-size: 12px;
  color: var(--grey-secondary);
  padding: 2px 12px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.garden-card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* ===== 10. Historial de escaneos ===== */
.history-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.history-item > svg:last-child { margin-left: auto; flex-shrink: 0; }
.history-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-leaf);
  overflow: hidden;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.history-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.history-name { font-size: 15px; font-weight: 600; }
.history-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-kind { padding: 3px 10px; font-size: 11px; }
.history-kind.identify { background: var(--green-tint); color: var(--green-primary); }
.history-kind.diagnose { background: rgba(59, 156, 224, 0.12); color: var(--accent-water); }
.history-date { font-size: 12px; color: var(--grey-secondary); }

/* ===== 11. Diagnose hub ===== */
.diagnose-hub { display: flex; flex-direction: column; flex: 1; }
.diagnose-hero {
  position: relative;
  height: 260px;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diagnose-hero-disc {
  width: 190px;
  height: 190px;
  border-radius: var(--radius-pill);
  background:
    radial-gradient(100% 100% at 30% 20%, rgba(255, 255, 255, 0.7), transparent 60%),
    var(--green-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.diagnose-chip {
  position: absolute;
  gap: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  animation: chip-float 3.6s ease-in-out infinite;
}
.diagnose-chip.dc-1 { top: 14px; right: 8px; }
.diagnose-chip.dc-2 { top: 108px; left: 0; animation-delay: -1.2s; }
.diagnose-chip.dc-3 { bottom: 6px; right: 26px; animation-delay: -2.4s; }
@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.diagnose-copy { text-align: center; padding: 0 12px; }
.diagnose-copy h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.diagnose-copy p { font-size: 15px; line-height: 1.5; }
.diagnose-cta { margin-top: auto; }
.diagnose-hub .diagnose-cta { margin-top: 28px; }

/* ===== 12. Artículo + búsqueda ===== */
.article-item { text-decoration: none; color: var(--ink); }

.article-hero {
  height: 200px;
  background: var(--gradient-leaf);
  position: relative;
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-body { padding: 20px var(--screen-pad) 24px; }
.article-body h1 {
  font-size: var(--text-headline);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
}
.article-body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 12px;
}

.search-form { display: block; }
.search-hint { margin-top: 16px; font-size: 14px; line-height: 1.5; }
.search-results .history-date em { font-style: italic; }

/* ===== 13. Más / Ajustes ===== */
.upsell-card { display: flex; align-items: flex-start; gap: 14px; }
.upsell-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}
.upsell-copy { flex: 1; }
.upsell-copy h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.upsell-copy p { font-size: 13px; line-height: 1.45; }
.upsell-btn { min-height: 40px; padding: 0 16px; font-size: 14px; background: var(--gradient-cta); color: #fff; }

.settings-group { padding: 0; overflow: hidden; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 16px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  border-bottom: 1px solid var(--color-border-subtle);
}
.settings-group .settings-row:last-child { border-bottom: none; }
.settings-row-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--green-tint);
  color: var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-row-label { flex: 1; }
.settings-row-chevron { color: var(--grey-secondary); font-size: 20px; line-height: 1; }
.settings-row form { display: flex; }

/* Toggle iOS-style (button server-side, sin JS) */
.switch {
  position: relative;
  width: 50px;
  height: 30px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--grey-border);
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-base) var(--ease-standard);
}
.switch.on { background: var(--green-primary); }
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 28, 30, 0.25);
  transition: transform var(--duration-base) var(--ease-standard);
}
.switch.on .switch-knob { transform: translateX(20px); }

.app-version { text-align: center; font-size: 12px; margin: 24px 0 8px; }

/* ===== 8. Paywall post-scan ===== */
.paywall-post-scan {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: linear-gradient(to bottom, var(--green-tint) 0%, #F2FAF5 35%, #FFFFFF 62%);
  padding: 32px var(--screen-pad) 32px;
  position: relative;
}
.paywall-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
}
.paywall-post-scan h1 {
  font-size: var(--text-display);
  font-weight: 700;
  color: var(--green-primary);
  margin: 16px 0 24px;
}
.paywall-illustration { display: flex; justify-content: center; margin: 8px 0 24px; }
.paywall-lead { font-size: 24px; font-weight: 700; line-height: 1.25; margin-bottom: 20px; }
.paywall-lead .green { color: var(--green-primary); }
.paywall-offer { font-size: 15px; line-height: 1.55; margin: auto 0 24px; }
.paywall-offer strong { color: var(--green-primary); font-weight: 700; }

/* ===== 14. Auth: login y registro ===== */
.auth-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--surface);
}
.auth-hero {
  flex: 1;
  min-height: 30dvh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px var(--screen-pad) 52px;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(255,255,255,0.25), transparent 55%),
    linear-gradient(160deg, #2FA35B 0%, #1B8E4A 45%, #10693A 100%);
}
.auth-screen.auth-compact .auth-hero { min-height: 20dvh; padding-bottom: 44px; }
.auth-hero-decor {
  position: absolute;
  inset: auto 0 -6% 0;
  width: 100%;
  height: 70%;
  opacity: 0.85;
  pointer-events: none;
}
.auth-logo {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.auth-screen.auth-compact .auth-logo { width: 56px; height: 56px; border-radius: 16px; }
.auth-wordmark {
  position: relative;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.auth-screen.auth-compact .auth-wordmark { font-size: 20px; }

.auth-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  margin-top: -20px;
  position: relative;
  padding: 28px var(--screen-pad) calc(28px + env(safe-area-inset-bottom, 0px));
}
.auth-sheet h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
}
.auth-lead { font-size: 15px; color: var(--grey-secondary); margin-bottom: 22px; }

.auth-form .field { margin-bottom: 14px; }
.auth-form .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-secondary);
  margin: 0 0 6px 6px;
}
.auth-form .field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--grey-card);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}
.auth-form .field input:focus {
  background: var(--surface);
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(27, 142, 74, 0.14);
}
.auth-form .btn-primary { margin-top: 8px; }

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--grey-secondary);
}
.auth-switch a { font-weight: 600; text-decoration: none; }

.auth-errors {
  background: #FDECEA;
  color: #B3261E;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
}
.auth-errors strong { font-weight: 700; }
.auth-errors ul { margin: 6px 0 0; padding-left: 18px; }

/* Desktop: fondo tipo "stage" alrededor del móvil */
@media (min-width: 480px) {
  body { padding: 0; }
}
