/* Cifras: todas las cifras de la app salen de Lexend (sin cero tachado); las letras siguen en Atkinson Hyperlegible */
@font-face {
  font-family: "Cifras"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(https://fonts.gstatic.com/s/lexend/v26/wlpwgwvFAVdoq2_v-6QU.woff2) format("woff2");
  unicode-range: U+0030-0039, U+003A, U+0025;
}
/* Pastillero — sistema visual
   Dirección: para una persona mayor en el móvil (y su familia en el ordenador), obvio y cálido,
   como la etiqueta de una farmacia. Firma: el bote naranja (a sangre en móvil, raíl lateral en escritorio).
   Todo lo demás, sobrio: neutros tintados de naranja, una sola tipografía muy legible. */

:root {
  /* Rampa naranja completa */
  --o-50: #FFF7F0;
  --o-100: #FFEBD9;
  --o-200: #FFD3AD;
  --o-300: #FFB37A;
  --o-400: #FF8D45;
  --o-500: #FF6B1A;   /* marca */
  --o-600: #EB5208;
  --o-700: #C43F06;   /* texto naranja sobre claro (5,2:1) */
  --o-800: #9C330D;
  --o-900: #7D2C10;
  --o-950: #441305;

  /* Roles (modo claro) */
  --bg: var(--o-50);
  --surface: #FFFFFF;
  --sunken: var(--o-100);
  --line: #F1DCCB;
  --ink: #2A160B;      /* 15:1 sobre --bg */
  --ink-2: #6B4A36;    /* 7,1:1 sobre --bg */
  --ink-3: #94705A;    /* metadatos, 3,9:1 — solo texto grande o no esencial */
  --accent: var(--o-500);
  --accent-ink: var(--o-700);
  --on-accent: #1F0C02;
  --label: #FFFFFF;
  --done: var(--o-700);
  --late: #C81E1E;
  --late-soft: #FDE4E1;
  --focus: #1D4ED8;
  --shadow: 0 1px 2px rgb(68 19 5 / .06), 0 6px 18px rgb(68 19 5 / .07);

  /* Tipografía: base 18 px, escala 1,25 */
  --t-meta: .78rem;   /* 14 */
  --t-body: 1rem;     /* 18 */
  --t-lg: 1.25rem;    /* 22,5 */
  --t-xl: 1.56rem;    /* 28 */
  --t-2xl: 1.95rem;   /* 35 */
  --t-hero: 3.05rem;  /* 55 */

  /* Espaciado 4/8 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-xl: 32px;

  color-scheme: light;
  font-size: 18px;
}
:root[data-size="l"] { font-size: 20px; }
:root[data-size="xl"] { font-size: 23px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150C07; --surface: #20140D; --sunken: #2B1B11; --line: #3B2819;
    --ink: #FBEFE6; --ink-2: #D9BFAE; --ink-3: #A88A77;
    --accent: #F2600F; --accent-ink: var(--o-300); --on-accent: #1F0C02;
    --label: #FFF7F0; --done: var(--o-400); --late: #FF8A80; --late-soft: #3D1612;
    --focus: #93C5FD; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #150C07; --surface: #20140D; --sunken: #2B1B11; --line: #3B2819;
  --ink: #FBEFE6; --ink-2: #D9BFAE; --ink-3: #A88A77;
  --accent: #F2600F; --accent-ink: var(--o-300); --on-accent: #1F0C02;
  --label: #FFF7F0; --done: var(--o-400); --late: #FF8A80; --late-soft: #3D1612;
  --focus: #93C5FD; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Cifras", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ================= Estructura ================= */
.app { min-height: 100dvh; }
.shell { max-width: 36rem; margin: 0 auto; padding: 0 var(--s4) calc(7rem + env(safe-area-inset-bottom)); }
.aside { display: none; }

/* Cabecera naranja (móvil): a sangre */
.appbar {
  margin: 0 calc(var(--s4) * -1);
  padding: calc(var(--s4) + env(safe-area-inset-top)) var(--s5) var(--s4);
  background: var(--accent); color: var(--on-accent);
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
body[data-view="hoy"] .appbar { border-radius: 0; padding-bottom: var(--s2); }
.date { font-size: var(--t-body); font-weight: 700; }
.date::first-letter { text-transform: uppercase; }
.clock { font-size: var(--t-body); font-weight: 700; font-variant-numeric: tabular-nums; opacity: .8; }

.section-title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: var(--s6) 0 var(--s3); text-wrap: balance; }
.view > .section-title:first-child { margin-top: var(--s5); }
.hint { color: var(--ink-2); font-size: var(--t-meta); margin: calc(var(--s2) * -1) 0 var(--s4); }

/* ================= Firma: el bote ================= */
.bottle {
  position: relative; background: var(--accent); color: var(--on-accent);
  margin: 0 calc(var(--s4) * -1); padding: var(--s2) var(--s5) var(--s5);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.bottle::before { /* brillo del plástico */
  content: ""; position: absolute; top: var(--s3); bottom: var(--s6); left: 10px; width: 8px;
  background: rgb(255 255 255 / .32); border-radius: 8px;
}
.bottle-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 0 0 var(--s3); font-weight: 700; }
.bottle-head .when { font-size: var(--t-meta); text-align: right; }
.label {
  position: relative; background: var(--label); color: #2A160B;
  border-radius: var(--r-m); padding: var(--s4) var(--s5) var(--s5);
  box-shadow: 0 2px 0 rgb(68 19 5 / .14);
}
.label::after { /* troquel de la etiqueta */
  content: ""; position: absolute; left: var(--s5); right: var(--s5); top: 0; height: 6px;
  background: radial-gradient(circle at 6px -2px, var(--accent) 5px, transparent 5.5px) 0 0 / 14px 6px repeat-x;
}
.label-moment { display: block; font-size: var(--t-meta); font-weight: 700; color: #C43F06; margin-bottom: var(--s1); }
.label-time { font-size: var(--t-hero); font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.label-name { font-size: var(--t-xl); font-weight: 700; line-height: 1.15; margin-top: var(--s2); text-wrap: balance; }
.label-dose { font-size: var(--t-body); color: #6B4A36; }
.label-rule { margin-top: var(--s3); padding-top: var(--s3); border-top: 2px dashed #F1DCCB; color: #4A2E1E; }
.bottle-actions { display: grid; gap: var(--s2); margin-top: var(--s4); }
.bottle .btn { width: 100%; }
.bottle .btn-take { background: #2A160B; color: #FFF7F0; min-height: 3.4rem; font-size: var(--t-lg); }
.bottle .btn-snooze { background: rgb(255 255 255 / .2); color: var(--on-accent); border: 2px solid rgb(31 12 2 / .22); }

/* ================= Blíster: progreso del día ================= */
.blister {
  display: flex; align-items: center; gap: var(--s4);
  margin: var(--s5) 0 0; padding: var(--s3) var(--s4);
  background: var(--sunken); border-radius: var(--r-l);
}
.cells { display: flex; gap: 6px; }
.cell {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none;
  background: var(--surface); box-shadow: inset 0 2px 3px rgb(68 19 5 / .14);
  display: grid; place-items: center;
}
.cell svg { width: 1rem; height: 1rem; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.cell.ok { background: var(--done); box-shadow: none; }
.cell.late { box-shadow: inset 0 0 0 3px var(--late); }
.cell.skip { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); }
.blister-text { margin-left: auto; font-weight: 700; font-size: var(--t-meta); color: var(--ink-2); white-space: nowrap; }

/* Aviso de existencias */
.alert {
  display: flex; gap: var(--s3); align-items: center; margin-top: var(--s3);
  background: var(--surface); color: var(--ink); border-radius: var(--r-l); padding: var(--s3) var(--s4);
  border: 2px solid var(--o-300); width: 100%; text-align: left; font-size: var(--t-meta);
}
.alert strong { display: block; font-size: var(--t-body); }
.alert svg { flex: none; width: 28px; height: 28px; stroke: var(--accent-ink); fill: none; stroke-width: 2; }

/* ================= Línea del día ================= */
.timeline { list-style: none; margin: 0; padding: var(--s1) var(--s4); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); }
.trow {
  display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 0 var(--s3); align-items: center;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.trow:last-child { border-bottom: 0; }
.trow .t { font-size: var(--t-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.trow .body { min-width: 0; text-align: left; background: none; border: 0; padding: var(--s1) 0; display: grid; gap: 2px; }
.trow .name { font-size: var(--t-body); font-weight: 700; display: flex; align-items: center; gap: var(--s2); }
.trow .meta { color: var(--ink-2); font-size: var(--t-meta); }
.trow .state { font-size: var(--t-meta); font-weight: 700; }
.trow.ok .state { color: var(--done); }
.trow.late .state { color: var(--late); }
.trow.skip .state { color: var(--ink-3); }
.trow.now .state { color: var(--accent-ink); }
.trow.ok .name, .trow.skip .name { color: var(--ink-2); }
.trow.now { margin: 0 calc(var(--s4) * -1); padding-left: var(--s4); padding-right: var(--s4); background: var(--o-50); }
:root[data-theme="dark"] .trow.now { background: var(--sunken); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .trow.now { background: var(--sunken); } }
.dot { width: .75rem; height: .75rem; border-radius: 50%; flex: none; background: var(--c, var(--accent)); }

.check {
  width: 3rem; height: 3rem; border-radius: 50%; border: 3px solid var(--line); background: var(--surface);
  display: grid; place-items: center; transition: transform .15s cubic-bezier(.2,.7,.2,1), background .2s, border-color .2s;
}
.check svg { width: 1.4rem; height: 1.4rem; stroke: transparent; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check:active { transform: scale(.92); }
.trow.ok .check { background: var(--done); border-color: var(--done); }
.trow.ok .check svg { stroke: #fff; }
.trow.late .check { border-color: var(--late); }
.trow.now .check { border-color: var(--accent); }
.trow.skip .check { background: var(--sunken); border-color: var(--sunken); }
.trow.skip .check svg { stroke: var(--ink-3); }
.trow.just .check { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ================= Botones ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 3rem; padding: var(--s3) var(--s5); border-radius: var(--r-m); border: 0;
  font-weight: 700; font-size: var(--t-body); background: var(--ink); color: var(--bg);
}
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.quiet { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.btn.danger { background: transparent; color: var(--late); border: 2px solid var(--late-soft); }
.btn svg { width: 1.2rem; height: 1.2rem; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ================= Listas ================= */
.list { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: var(--s4); width: 100%; padding: var(--s4); text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); min-height: 3.6rem;
}
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; font-size: var(--t-lg); line-height: 1.25; }
.item .sub { color: var(--ink-2); font-size: var(--t-meta); }
.item .chev { width: 1.1rem; height: 1.1rem; stroke: var(--ink-3); fill: none; stroke-width: 2.4; flex: none; }

.pill { width: 2.8rem; height: 2.8rem; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, var(--surface)); display: grid; place-items: center; }
.pill i { display: block; width: 1.7rem; height: .8rem; border-radius: 1rem; background: linear-gradient(90deg, var(--c) 50%, color-mix(in srgb, var(--c) 40%, #fff) 50%); transform: rotate(-35deg); }

.stock { margin-top: var(--s2); height: 6px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.stock > b { display: block; height: 100%; background: var(--o-400); border-radius: 4px; }
.stock.low > b { background: var(--late); }
.low-text { color: var(--late); font-weight: 700; }

/* ================= Historial ================= */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); }
.day {
  display: grid; justify-items: center; gap: var(--s1); padding: var(--s2) 0 var(--s3); border-radius: var(--r-m);
  background: var(--surface); border: 2px solid transparent; box-shadow: var(--shadow);
}
.day .wd { font-size: var(--t-meta); color: var(--ink-2); }
.day .dn { font-size: var(--t-body); font-weight: 700; }
.day[aria-pressed="true"] { border-color: var(--accent); background: var(--o-50); }
.ring { width: 1.8rem; height: 1.8rem; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bgc { stroke: var(--sunken); }
.ring .fg { stroke: var(--done); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring.part .fg { stroke: var(--o-400); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.stat { background: var(--surface); border-radius: var(--r-l); padding: var(--s4) var(--s5); box-shadow: var(--shadow); }
.stat b { display: block; font-size: var(--t-2xl); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.stat span { color: var(--ink-2); font-size: var(--t-meta); }
.empty { color: var(--ink-2); padding: var(--s5) var(--s4); text-align: center; }

/* ================= Ajustes ================= */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunken); border-radius: var(--r-s); padding: var(--s1); gap: var(--s1); }
.seg button { border: 0; background: none; border-radius: 9px; padding: var(--s2) var(--s1); font-weight: 700; color: var(--ink-2); min-height: 2.8rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
.setting { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting > .title { font-weight: 700; margin-bottom: var(--s2); display: block; }
.setting p { color: var(--ink-2); font-size: var(--t-meta); margin-bottom: var(--s3); }
.setting .btn + .btn { margin-top: var(--s2); }

/* ================= Hoja inferior ================= */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 36rem; max-height: 92dvh;
  background: var(--surface); color: var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.sheet::backdrop { background: rgb(42 22 11 / .5); }
.sheet[open] { animation: up .25s cubic-bezier(.2,.7,.2,1); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-inner { padding: var(--s2) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92dvh; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: var(--s1) auto var(--s4); }
.sheet h2 { font-size: var(--t-xl); line-height: 1.2; margin-bottom: var(--s1); }
.sheet .lead { color: var(--ink-2); margin-bottom: var(--s4); }
.sheet .actions { display: grid; gap: var(--s2); margin-top: var(--s5); }
.sheet h3 { font-size: var(--t-lg); margin: var(--s5) 0 var(--s1); }
.note-box { background: var(--o-50); border-radius: var(--r-m); padding: var(--s4); }
:root[data-theme="dark"] .note-box { background: var(--sunken); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note-box { background: var(--sunken); } }

.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.field > span { font-weight: 700; font-size: var(--t-meta); }
.input {
  width: 100%; min-height: 3rem; padding: var(--s2) var(--s3); border-radius: var(--r-s);
  border: 2px solid var(--line); background: var(--bg); font-size: var(--t-body);
}
.input:focus { border-color: var(--accent); outline: none; }
textarea.input { min-height: 4.4rem; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--s3); }
.swatches button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 2px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.dose-row { display: grid; grid-template-columns: 6.6rem 1fr 3rem; gap: var(--s2); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.dose-row textarea.input { min-height: 3rem; grid-column: 1 / -1; }
.icon-btn { width: 3rem; height: 3rem; border-radius: var(--r-s); border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--late); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }

/* ================= Navegación (móvil: barra inferior) ================= */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: var(--s1) var(--s2) calc(var(--s1) + env(safe-area-inset-bottom));
}
.brand { display: none; }
.tabbar button {
  display: grid; justify-items: center; gap: 2px; background: none; border: 0; color: var(--ink-2);
  font-size: var(--t-meta); font-weight: 700; padding: var(--s2) 2px; min-height: 3.6rem; border-radius: var(--r-m);
}
.tabbar svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--accent-ink); }
.tabbar button[aria-current="page"] svg { stroke-width: 2.5; }

.toast {
  position: fixed; left: var(--s4); right: var(--s4); bottom: calc(5.6rem + env(safe-area-inset-bottom)); z-index: 30;
  max-width: 30rem; margin: 0 auto; background: var(--ink); color: var(--bg);
  padding: var(--s3) var(--s3) var(--s3) var(--s4); border-radius: var(--r-m); font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--o-300); font-weight: 700; padding: var(--s2); min-height: 2.6rem; }
.footnote { color: var(--ink-3); font-size: var(--t-meta); text-align: center; margin: var(--s6) 0 var(--s2); }

/* ================= Panel lateral (escritorio) ================= */
.panel { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel h2 { font-size: var(--t-lg); margin-bottom: var(--s3); }
.panel .week { gap: var(--s1); }
.panel .day { box-shadow: none; background: var(--bg); padding: var(--s2) 0; }
.panel .row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.panel .row:last-child { border-bottom: 0; padding-bottom: 0; }
.panel .row .grow { flex: 1; min-width: 0; }
.panel .row b { display: block; }
.panel .row small { color: var(--ink-2); font-size: var(--t-meta); }
.panel .big { font-size: var(--t-2xl); font-weight: 700; color: var(--accent-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ================= Escritorio ================= */
@media (min-width: 1024px) {
  :root { font-size: 17px; }
  :root[data-size="l"] { font-size: 19px; }
  :root[data-size="xl"] { font-size: 22px; }
  .app {
    display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: var(--s6);
    max-width: 1360px; margin: 0 auto; padding-right: var(--s6);
  }
  .shell { max-width: 640px; width: 100%; padding: 0 0 var(--s8); margin: 0 auto; }
  .aside { display: block; padding-top: var(--s6); position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow: auto; padding-bottom: var(--s6); }

  /* El naranja pasa a ser el raíl lateral */
  .tabbar {
    position: sticky; top: 0; height: 100dvh; align-self: start;
    display: flex; flex-direction: column; gap: var(--s1);
    background: var(--accent); border: 0; padding: var(--s6) var(--s4);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3) var(--s6); color: var(--on-accent); font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; }
  .brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 2px rgb(255 255 255 / .5); }
  .tabbar button {
    display: flex; justify-content: flex-start; align-items: center; gap: var(--s3);
    font-size: var(--t-body); color: var(--on-accent); padding: var(--s3) var(--s4); min-height: 3.2rem;
  }
  .tabbar button:hover { background: rgb(255 255 255 / .16); }
  .tabbar button[aria-current="page"] { background: var(--label); color: #9C330D; }

  .appbar { margin: 0; background: none; color: var(--ink); padding: var(--s6) 0 var(--s4); border-radius: 0; }
  body[data-view="hoy"] .appbar { padding-bottom: var(--s4); }
  .date { font-size: var(--t-xl); }
  .clock { font-size: var(--t-xl); color: var(--ink-2); opacity: 1; }

  .bottle { margin: 0; border-radius: var(--r-xl); padding: var(--s5) var(--s6) var(--s6); }
  .bottle::before { top: var(--s6); bottom: var(--s6); left: 14px; }
  .bottle-actions { grid-template-columns: 1fr auto; }
  .bottle .btn-snooze { width: auto; }
  .label-time { font-size: 4rem; }

  .toast { bottom: var(--s6); }
  .sheet { margin: auto; border-radius: var(--r-xl); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= Estado de ánimo ================= */
.face { display: block; width: 100%; height: 100%; }
.mood-card { margin-top: var(--s3); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s4) var(--s5); }
.mood-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.mood-head h2 { font-size: var(--t-lg); }
.mood-head .btn { min-height: 2.6rem; padding: var(--s2) var(--s4); }
.mood-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); }
.mood-trail li { display: grid; justify-items: center; gap: var(--s1); width: 2.6rem; }
.mood-trail .face { width: 2.4rem; height: 2.4rem; }
.mood-trail span { font-size: var(--t-meta); color: var(--ink-2); }
.mood-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.mood-pick button {
  display: grid; justify-items: center; gap: var(--s2); padding: var(--s4) var(--s2);
  background: var(--bg); border: 2px solid var(--line); border-radius: var(--r-l); font-weight: 700; font-size: var(--t-lg);
  transition: transform .15s cubic-bezier(.2,.7,.2,1), border-color .15s;
}
.mood-pick button:active { transform: scale(.95); }
.mood-pick button:hover { border-color: var(--accent); }
.mood-pick .face { width: 4.6rem; height: 4.6rem; }
.panel .mood-trail li { width: 2.4rem; }

/* ================= Números: Lexend (cero sin barra, cifras limpias) ================= */
:root { --font-num: "Lexend", "Cifras", "Atkinson Hyperlegible", system-ui, sans-serif; }
.label-time, .trow .t, .clock, .stat b, .panel .big, .mood-trail span, .day .dn, .num, .streak b {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
}
.label-time { font-weight: 600; letter-spacing: -.04em; }
.trow .t { font-weight: 600; letter-spacing: -.01em; }
.clock { font-weight: 500; }
.stat b, .panel .big { font-weight: 600; letter-spacing: -.02em; }

/* ================= Racha (cabecera) ================= */
.appbar > div { min-width: 0; }
.streak { font-size: var(--t-meta); font-weight: 700; margin-top: 2px; }
.streak:empty { display: none; }
.streak b { font-size: var(--t-body); }
@media (min-width: 1024px) { .streak { color: var(--accent-ink); } }

/* ================= Blíster: la pastilla sale del hueco ================= */
.cell { position: relative; }
.cell.just { animation: press .45s cubic-bezier(.2,.7,.2,1); }
.cell.just::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.3rem; height: .62rem; border-radius: 1rem;
  background: linear-gradient(90deg, var(--o-500) 50%, var(--o-200) 50%);
  transform: translate(-50%, -50%) rotate(-35deg); opacity: 0;
  animation: popout .7s cubic-bezier(.2,.7,.2,1);
}
@keyframes press { 0% { transform: scale(1); } 35% { transform: scale(.78); } 100% { transform: scale(1); } }
@keyframes popout {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(-35deg) scale(.6); }
  60% { opacity: 1; transform: translate(-50%, -190%) rotate(20deg) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -260%) rotate(40deg) scale(1); }
}

/* ================= Ánimo en el historial ================= */
.face.mini { width: 1.4rem; height: 1.4rem; }
.face-empty { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px dashed var(--line); }
.insight { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.insight > div { display: grid; justify-items: start; gap: 2px; background: var(--bg); border-radius: var(--r-m); padding: var(--s3) var(--s4); }
.insight-face { width: 2.4rem; height: 2.4rem; margin-bottom: var(--s1); }
.insight small { color: var(--ink-2); font-size: var(--t-meta); }
.insight-text { margin-top: var(--s3); font-weight: 700; }

/* =====================================================================
   NARANJO QUE CRECE — firma de la pantalla Hoy
   El cielo cambia con la hora; la copa crece con la racha; cada toma es una
   naranja que madura (verde → naranja) al marcarla.
   ===================================================================== */
body[data-view="hoy"] .appbar { background: var(--sky-top, var(--accent)); color: var(--sky-ink, var(--on-accent)); transition: background .6s; }
body[data-view="hoy"] .streak { display: none; }

.scene { position: relative; margin: 0 calc(var(--s4) * -1); overflow: hidden; }
.scene svg { display: block; width: 100%; height: clamp(250px, 70vw, 330px); }
.scene-cap {
  position: absolute; left: var(--s5); top: var(--s2); margin: 0;
  color: var(--sky-ink, var(--on-accent)); font-size: var(--t-meta); font-weight: 700; line-height: 1.3;
}
.scene-cap b { display: block; font-size: var(--t-xl); letter-spacing: -.01em; }
.scene-cap span { display: block; font-weight: 400; opacity: .85; }

.scene .sun { fill: #FFF7F0; opacity: .9; }
.scene .moon { fill: #FFEBD9; }
.scene .stars circle { fill: #FFEBD9; opacity: .8; }
.scene .hill.back { fill: var(--o-300); }
.scene .hill.front { fill: var(--o-400); }
.scene.night .hill.back { fill: #5A2410; }
.scene.night .hill.front { fill: #7D2C10; }
.scene .trunk { fill: #6B2A0E; }
.scene .canopy circle { fill: #3F7A3E; }
.scene .canopy-hl circle { fill: #5E9A4F; opacity: .55; }
.scene.night .canopy circle { fill: #26462A; }
.scene.night .canopy-hl circle { fill: #3F6B3E; }

/* Naranjas */
.fruit { cursor: pointer; outline: none; }
.fruit .hit { fill: transparent; }
.fruit .stem { fill: none; stroke: #5A2A10; stroke-width: 2; stroke-linecap: round; }
.fruit .leaf { fill: #2F6B32; }
.fruit .peel, .fruit .shine { transform-box: fill-box; transform-origin: center; transition: transform .3s cubic-bezier(.2,.7,.2,1), fill .4s; }
.fruit .peel { fill: #A8CC7C; stroke: #6E9A4A; stroke-width: 1.5; transform: scale(.78); }   /* verde: aún no */
.fruit .shine { fill: #fff; opacity: 0; }
.fruit.ok .peel { fill: var(--o-500); stroke: var(--o-700); transform: scale(1); }         /* madura: tomada */
.fruit.ok .shine { opacity: .6; }
.fruit.late .peel { stroke: var(--late); stroke-width: 3; stroke-dasharray: 4 3; }
.fruit.skip { opacity: .45; }
.fruit.now .peel { stroke: #FFF7F0; stroke-width: 3; animation: glow 1.8s ease-in-out infinite; }
.fruit:focus-visible .peel { stroke: var(--focus); stroke-width: 3; }
.fruit.just .peel { animation: ripen .9s cubic-bezier(.2,.7,.2,1); }
@keyframes ripen {
  0% { fill: #A8CC7C; transform: scale(.78); }
  45% { fill: var(--o-400); transform: scale(1.22); }
  100% { fill: var(--o-500); transform: scale(1); }
}
@keyframes glow { 0%, 100% { transform: scale(.78); } 50% { transform: scale(.9); } }

/* Tarjeta de la próxima toma: etiqueta blanca que se apoya sobre la colina */
.bottle {
  position: relative; z-index: 2; background: var(--surface); color: var(--ink);
  margin: calc(var(--s7) * -1) 0 0; padding: var(--s4) var(--s5) var(--s5);
  border-radius: var(--r-xl); box-shadow: 0 2px 4px rgb(68 19 5 / .06), 0 16px 36px rgb(68 19 5 / .16);
}
.bottle::before { display: none; }
.bottle-head { color: var(--accent-ink); padding-bottom: var(--s2); }
.label { background: none; box-shadow: none; padding: 0; color: var(--ink); border-radius: 0; }
.label::after { display: none; }
.label-moment { color: var(--ink-2); }
.label-dose { color: var(--ink-2); }
.label-rule { border-top-color: var(--line); color: var(--ink-2); }
.bottle .btn-take { background: var(--accent); color: var(--on-accent); }
.bottle .btn-snooze { background: var(--sunken); color: var(--ink); border: 0; }

/* Aviso de modo familia */
.fam {
  display: grid; gap: 2px; margin: var(--s3) 0 0; padding: var(--s3) var(--s4);
  background: var(--ink); color: var(--bg); border-radius: var(--r-m); font-size: var(--t-meta);
}
.fam b { font-size: var(--t-body); }
body.readonly .check, body.readonly .mood-head .btn, body.readonly .bottle-actions,
body.readonly .sheet .actions [data-act="take"], body.readonly .sheet .actions [data-act="untake"],
body.readonly .sheet .actions [data-act="snooze"], body.readonly .sheet .actions [data-act="skip"],
body.readonly .sheet .actions [data-act="edit-med"], body.readonly [data-act="new-med"], body.readonly .item .chev { display: none; }
body.readonly .item { pointer-events: none; }
body.readonly .trow { grid-template-columns: 3.4rem 1fr; }

@media (min-width: 1024px) {
  body[data-view="hoy"] .appbar { background: none; color: var(--ink); }
  body[data-view="hoy"] .streak { display: block; }
  .scene { margin: 0; border-radius: var(--r-xl); }
  .scene svg { height: 340px; }
  .scene-cap { left: var(--s6); top: var(--s5); }
  .bottle { margin: calc(var(--s7) * -1) var(--s5) 0; }
}

/* ================= Avatares ================= */
.avatar { display: block; width: 100%; height: 100%; }
.me { flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 2px solid rgb(255 255 255 / .7); border-radius: 50%; background: none; align-self: center; overflow: hidden; }
.appbar > div { flex: 1; }
.avatar-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.avatar-pick button {
  aspect-ratio: 1; padding: var(--s1); border-radius: 50%; border: 3px solid transparent; background: none;
  transition: transform .15s cubic-bezier(.2,.7,.2,1), border-color .15s;
}
.avatar-pick button[aria-checked="true"] { border-color: var(--accent); transform: scale(1.06); }
.avatar-pick button:active { transform: scale(.94); }
.avatar.big { width: 4rem; height: 4rem; flex: none; }
.profile-row { display: flex; align-items: center; gap: var(--s4); }
.profile-row b { display: block; font-size: var(--t-lg); }
.profile-row small { color: var(--ink-2); font-size: var(--t-meta); }

/* ================= Pantalla de entrada ================= */
.auth { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: linear-gradient(180deg, var(--o-200) 0%, var(--bg) 42%); }
:root[data-theme="dark"] .auth { background: linear-gradient(180deg, #4A1F0A 0%, var(--bg) 42%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth { background: linear-gradient(180deg, #4A1F0A 0%, var(--bg) 42%); } }
.auth-inner { max-width: 26rem; margin: 0 auto; padding: calc(var(--s7) + env(safe-area-inset-top)) var(--s5) var(--s7); }
.auth h1 { font-size: var(--t-2xl); letter-spacing: -.02em; text-align: center; margin-top: var(--s4); }
.auth .lead { text-align: center; color: var(--ink-2); margin: var(--s1) 0 var(--s5); }
.auth-form { background: var(--surface); border-radius: var(--r-xl); padding: var(--s5); box-shadow: var(--shadow); }
.auth-error { color: var(--late); font-weight: 700; font-size: var(--t-meta); min-height: 1.2em; margin: 0 0 var(--s2); }
.auth-hero { display: flex; justify-content: center; align-items: flex-end; gap: var(--s2); }
.auth-hero .avatar { width: 4.2rem; height: 4.2rem; animation: bob 3s ease-in-out infinite; }
.auth-hero .a2 { width: 5.6rem; height: 5.6rem; animation-delay: .4s; }
.auth-hero .a3 { animation-delay: .8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.btn.link { background: none; color: var(--ink-2); width: 100%; margin-top: var(--s3); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ================= Grupo ================= */
.group-empty { text-align: center; }
.group-empty p { margin: var(--s4) 0; }
.members { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); }
.member { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s4); }
.member.mine { box-shadow: inset 0 0 0 2px var(--o-300), var(--shadow); }
.m-top { display: flex; align-items: center; gap: var(--s3); }
.m-top .grow { flex: 1; min-width: 0; }
.m-top b { display: block; font-size: var(--t-lg); line-height: 1.2; }
.m-top b em { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: var(--t-meta); }
.m-top small { color: var(--ink-2); font-size: var(--t-meta); }
.m-avatar { width: 3.2rem; height: 3.2rem; flex: none; }
.m-mood { display: grid; justify-items: center; gap: 2px; width: 2.6rem; }
.m-mood .face { width: 2.2rem; height: 2.2rem; }
.m-mood small { font-size: .7rem; color: var(--ink-2); }
.m-row { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); }
.mdots { display: flex; gap: 6px; }
.mdot { width: 1rem; height: 1rem; border-radius: 50%; background: #A8CC7C; box-shadow: inset 0 0 0 1.5px #6E9A4A; }
.mdot.ok { background: var(--o-500); box-shadow: none; }
.mdot.late { box-shadow: inset 0 0 0 2.5px var(--late); }
.mdot.skip { opacity: .4; }
.m-count { color: var(--ink-2); font-size: var(--t-meta); }
.m-count b { color: var(--ink); }
.m-streak { margin: var(--s2) 0 0; font-size: var(--t-meta); color: var(--accent-ink); font-weight: 700; }
.join-me { display: flex; align-items: center; gap: var(--s3); background: var(--bg); border-radius: var(--r-m); padding: var(--s3); }
.join-me .avatar { width: 3rem; height: 3rem; flex: none; }
@media (min-width: 1024px) { .me { border-color: var(--line); } }

/* =====================================================================
   CAJITA — personaje de la marca, voz, escáner, huerto y alto contraste
   ===================================================================== */
.cajita { display: block; width: 100%; height: 100%; overflow: visible; }
.auth-hero .cajita { width: 6rem; height: 6rem; animation: bob 3s ease-in-out .4s infinite; }
.brand img { border-radius: 12px; }

/* Cajita habla: bocadillo en la tarjeta de la próxima toma */
.says { display: flex; align-items: flex-end; gap: var(--s2); margin: calc(var(--s7) * -1 - var(--s2)) 0 var(--s3); }
.says-face { width: 4.4rem; height: 4.4rem; flex: none; filter: drop-shadow(0 4px 6px rgb(68 19 5 / .18)); animation: bob 3.2s ease-in-out infinite; }
.bubble {
  position: relative; flex: 1; margin: 0 0 var(--s2); padding: var(--s2) var(--s3);
  background: var(--o-50); color: var(--ink); border-radius: var(--r-m) var(--r-m) var(--r-m) 4px;
  font-size: var(--t-meta); font-weight: 700; line-height: 1.35; box-shadow: 0 0 0 2px var(--o-200);
}
:root[data-theme="dark"] .bubble { background: var(--sunken); box-shadow: 0 0 0 2px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble { background: var(--sunken); box-shadow: 0 0 0 2px var(--line); } }
.speak {
  flex: none; width: 3rem; height: 3rem; margin-bottom: var(--s2); border-radius: 50%; border: 0;
  background: var(--sunken); color: var(--accent-ink); display: grid; place-items: center;
}
.speak svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bottle { padding-top: var(--s4); }

/* Hoy vacío */
.empty-cajita { text-align: center; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: var(--s6) var(--s5) var(--s5); margin-top: var(--s5); }
.empty-cajita .cajita.big { width: 7rem; height: 7rem; margin: 0 auto var(--s3); animation: bob 3s ease-in-out infinite; }
.empty-cajita h2 { font-size: var(--t-xl); }
.empty-cajita p { color: var(--ink-2); margin: var(--s1) 0 var(--s4); }
.empty-cajita .btn + .btn { margin-top: var(--s2); }

/* Invitar a la familia */
.nudge { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s3); background: var(--o-100); border-radius: var(--r-l); padding: var(--s4); }
:root[data-theme="dark"] .nudge { background: var(--sunken); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nudge { background: var(--sunken); } }
.nudge-face { width: 4rem; height: 4rem; flex: none; }
.nudge b { display: block; font-size: var(--t-body); }
.nudge p { color: var(--ink-2); font-size: var(--t-meta); margin: 2px 0 var(--s2); }
.nudge .btn { min-height: 2.6rem; padding: var(--s2) var(--s4); }

/* Escáner */
.scan-btn { margin-bottom: var(--s4); }
.scan { position: relative; border-radius: var(--r-l); overflow: hidden; background: #1F0C02; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 22% 12%; border: 3px solid var(--o-400); border-radius: var(--r-m); box-shadow: 0 0 0 999px rgb(31 12 2 / .35); }
.scan-status { text-align: center; color: var(--ink-2); font-size: var(--t-meta); margin: var(--s3) 0 var(--s4); min-height: 1.3em; }

/* Huerto */
.huerto { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: var(--s3); }
.pot {
  display: grid; justify-items: center; gap: 2px; padding: var(--s3) var(--s2) var(--s4); border: 0; border-radius: var(--r-l);
  background: linear-gradient(180deg, var(--o-100) 0 62%, var(--o-200) 62%); color: var(--ink); text-align: center;
  transition: transform .15s cubic-bezier(.2,.7,.2,1);
}
:root[data-theme="dark"] .pot { background: linear-gradient(180deg, var(--sunken) 0 62%, #3B2819 62%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pot { background: linear-gradient(180deg, var(--sunken) 0 62%, #3B2819 62%); } }
.pot:active { transform: scale(.96); }
.pot .pill-art { width: 5.6rem; height: 7.2rem; transform-origin: 50% 90%; animation: sway 4s ease-in-out var(--d, 0s) infinite; }
.pot b { font-size: var(--t-body); line-height: 1.2; margin-top: var(--s1); word-break: break-word; }
.pot small { color: var(--ink-2); font-size: var(--t-meta); }
.pot.low small { color: var(--late); font-weight: 700; }
.pot.add { background: none; border: 2px dashed var(--o-300); align-content: center; min-height: 11rem; }
.add-plus { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--o-100); display: grid; place-items: center; color: var(--accent-ink); }
.add-plus svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

/* Alto contraste: textos secundarios igual de oscuros que el principal y bordes marcados */
:root[data-contrast="si"] { --ink-2: var(--ink); --ink-3: #4A2E1E; --line: #94705A; --o-700: #9C330D; --accent-ink: #7D2C10; }
:root[data-contrast="si"][data-theme="dark"] { --ink-2: var(--ink); --ink-3: #E8D3C4; --line: #A88A77; --accent-ink: #FFD3AD; }
:root[data-contrast="si"] .btn.quiet, :root[data-contrast="si"] .input { border-color: var(--ink); }

/* =====================================================================
   BROTINO — sistema tipográfico y tono visual (sustituye a lo anterior)
   Fredoka (títulos y cifras, redonda como los personajes) + Nunito (texto).
   Tinta más suave, radios más amplios, sombras cálidas y botones en píldora.
   ===================================================================== */
:root {
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-text: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Fredoka", "Nunito", system-ui, sans-serif;
  --r-s: 14px; --r-m: 20px; --r-l: 26px; --r-xl: 34px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --ink: #3A2316; --ink-2: #7A5845; --ink-3: #A07E68; --line: #F3E0D0; --shadow: 0 2px 6px rgb(120 50 10 / .05), 0 14px 30px rgb(120 50 10 / .08); }
}
:root[data-theme="light"] { --ink: #3A2316; --ink-2: #7A5845; --ink-3: #A07E68; --line: #F3E0D0; --shadow: 0 2px 6px rgb(120 50 10 / .05), 0 14px 30px rgb(120 50 10 / .08); }

body { font-family: var(--font-text); font-weight: 500; letter-spacing: .003em; }
b, strong { font-weight: 800; }
h1, h2, h3, .section-title, .label-time, .label-name, .date, .clock, .trow .t, .stat b, .brand, .pcard-name,
.m-top b, .scene-cap b, .mood-head h2, .empty-cajita h2, .profile-row b, .item .title, .sheet h2, .sheet h3, .panel h2,
.auth h1, .nudge b, .mood-pick button, .day .dn, .streak b, .m-count b {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -.005em;
}
.section-title { font-weight: 600; font-size: 1.62rem; }
.label-time { font-weight: 600; letter-spacing: -.02em; }
.label-name { font-weight: 600; }
.hint, .lead, .trow .meta, .item .sub { font-weight: 500; }

/* Botones en píldora */
.btn { border-radius: 999px; font-family: var(--font-display); font-weight: 500; font-size: 1.08rem; letter-spacing: .005em; min-height: 3.3rem; }
.bottle .btn-take { font-size: 1.22rem; min-height: 3.6rem; box-shadow: 0 6px 0 var(--o-700); transform: translateY(-3px); }
.bottle .btn-take:active { box-shadow: 0 2px 0 var(--o-700); transform: translateY(1px); }
.seg { border-radius: 999px; }
.seg button { border-radius: 999px; font-family: var(--font-display); font-weight: 500; }
.input { border-radius: 16px; }
.tabbar button { font-family: var(--font-display); font-weight: 500; }

/* ---------- El bancal (Hoy) ---------- */
.garden svg { height: clamp(270px, 76vw, 350px); }
.garden .cloud path { fill: #FFF7F0; opacity: .85; }
.garden.night .cloud path { opacity: .1; }
.cloud { animation: drift 70s linear infinite alternate; }
.cloud.c2 { animation-duration: 90s; animation-direction: alternate-reverse; }
@keyframes drift { from { translate: -20px 0; } to { translate: 60px 0; } }
.hill.far { fill: var(--o-200); }
.hill.near { fill: var(--o-300); }
.garden.night .hill.far { fill: #4A1F0A; }
.garden.night .hill.near { fill: #5A2410; }
.far-tree rect { fill: #6B2A0E; }
.far-tree circle { fill: #5E9A4F; }
.far-tree .ft-o { fill: var(--o-500); }
.bed-soil { fill: #6B2A0E; }
.bed-wood { fill: #9C330D; }
.bed-line { stroke: #7D2C10; stroke-width: 1.6; }
.bed-label { fill: #FFE8D9; font-family: var(--font-display); font-size: 10.5px; font-weight: 500; }
.tufts path { fill: #5E9A4F; }
.plant { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out var(--d, 0s) infinite; }
.pfruit { cursor: pointer; outline: none; }
.pfruit .hit { fill: transparent; }
.pfruit.now .hit { fill: rgb(255 247 240 / .55); animation: glowc 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pfruit.late .pf-body > :first-child { stroke: var(--late); stroke-width: 2.4; stroke-dasharray: 3 2; }
.pfruit.skip { opacity: .4; }
.pfruit.just .hit { animation: popring .8s ease-out; transform-box: fill-box; transform-origin: center; fill: rgb(255 179 122 / .6); }
.pfruit:focus-visible .hit { fill: none; stroke: var(--focus); stroke-width: 2.5; }
@keyframes glowc { 0%, 100% { transform: scale(.7); opacity: .4; } 50% { transform: scale(1); opacity: 1; } }
@keyframes popring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.bee { animation: buzz 6s ease-in-out infinite; }
@keyframes buzz { 0%, 100% { translate: 0 0; } 25% { translate: -30px -12px; } 50% { translate: -60px 6px; } 75% { translate: -24px 14px; } }
.scene-cap b { font-weight: 600; font-size: 1.7rem; }

/* ---------- Fichas de planta (Medicinas) ---------- */
.huerto { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--s3); }
.pcard {
  position: relative; display: grid; justify-items: start; align-content: start; gap: 2px; text-align: left;
  padding: var(--s2) var(--s4) var(--s4); border: 0; border-radius: var(--r-l); color: var(--ink);
  background: color-mix(in srgb, var(--c, var(--o-500)) 11%, var(--surface)); box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.2,.7,.2,1);
}
.pcard:active { transform: scale(.97); }
.pcard-art { width: 100%; height: auto; display: block; margin-bottom: var(--s1); }
.pot-shadow { fill: rgb(68 19 5 / .12); }
.pcard-stage {
  font-family: var(--font-display); font-weight: 500; font-size: .8rem; padding: 2px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--o-500)) 22%, var(--surface)); color: var(--ink);
}
.pcard-name { font-weight: 600; font-size: 1.22rem; line-height: 1.15; margin-top: var(--s1); word-break: break-word; }
.pcard small { color: var(--ink-2); font-size: var(--t-meta); line-height: 1.35; }
.pcard .pcard-grow { color: var(--accent-ink); font-weight: 800; }
.pcard .low-text { color: var(--late); }
.pcard.low { box-shadow: inset 0 0 0 2px var(--late-soft), var(--shadow); }
.pcard.add { background: none; box-shadow: none; border: 2px dashed var(--o-300); justify-items: center; align-content: center; text-align: center; min-height: 15rem; }

/* ---------- Bienvenida con diseño propio ---------- */
.auth h1 { font-weight: 600; font-size: 2.7rem; color: var(--o-700); letter-spacing: -.02em; }
.auth-wrap { max-width: 26rem; margin: 0 auto; }
.auth-art { display: none; }
@media (min-width: 1024px) {
  .auth { background: var(--bg); }
  .auth-wrap { max-width: 1160px; min-height: 100dvh; display: grid; grid-template-columns: 1.15fr .85fr; gap: 72px; align-items: center; padding: 48px 56px; }
  .auth-art { display: block; }
  .auth-garden { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 40px rgb(120 50 10 / .14)); }
  .auth-art h2 { font-family: var(--font-display); font-weight: 600; font-size: 3.2rem; line-height: 1.04; letter-spacing: -.025em; margin: 36px 0 14px; text-wrap: balance; }
  .auth-art p { font-size: 1.18rem; color: var(--ink-2); max-width: 34ch; line-height: 1.55; }
  .auth-inner { padding: 0; }
  .auth-hero { display: none; }
  .auth h1, .auth .lead { text-align: left; }
}

/* ---------- Escritorio: la barra lateral como objeto de marca ---------- */
@media (min-width: 1024px) {
  .brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.85rem; letter-spacing: -.02em; }
  .brand img { width: 46px; height: 46px; border-radius: 14px; box-shadow: none; }
  .tabbar { border-radius: 0 34px 34px 0; }
  .tabbar::after { content: ""; margin-top: auto; height: 150px; border-radius: 28px; background: url(icons/icon-512.png) center / contain no-repeat; }
  .tabbar button { border-radius: 999px; }
  .tabbar button[aria-current="page"] { color: #9C330D; }
  .date { font-size: 1.9rem; font-weight: 600; letter-spacing: -.015em; }
  .panel { border-radius: var(--r-xl); }
  .panel h2 { font-weight: 600; }
}

/* Ajuste: el bancal se ve entero; Cajita habla dentro de la tarjeta */
.garden + .bottle { margin-top: calc(var(--s4) * -1); }
.says { margin: 0 0 var(--s3); align-items: center; }
.says-face { width: 3.6rem; height: 3.6rem; }
.bubble { margin: 0; }
.speak { margin: 0; }
.pfruit:not(.ok) .pf-body > :first-child { stroke: #7FA65A; stroke-width: 1.2; }
.pfruit.late .pf-body > :first-child { stroke: var(--late); stroke-width: 2.2; stroke-dasharray: 3 2; }
.huerto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .huerto { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); } }
.pcard-name { font-size: 1.1rem; }
.auth-garden .cloud path { fill: #FFF7F0; opacity: .9; }

/* =====================================================================
   PULIDO — microinteracciones, ficha, ajustes, primer uso e idioma
   ===================================================================== */
/* Pétalos y hojas al tomar */
.burst { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.burst i {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  animation: petal .95s cubic-bezier(.2,.7,.2,1) forwards;
}
.burst i.leafy { width: 14px; height: 7px; border-radius: 10px 0; }
@keyframes petal {
  0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)) scale(1); opacity: 0; }
}
/* Cajita da un brinco */
.says-face.joy { animation: hop .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(1.08, .94); } 60% { transform: translateY(0) scale(.94, 1.06); } 100% { transform: none; } }
.view { animation: viewin .22s ease-out; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Celebración de etapa */
.celebrate { text-align: center; }
.celebrate-art { width: 11rem; height: auto; display: block; margin: 0 auto; animation: grow .7s cubic-bezier(.3,1.5,.5,1); transform-origin: 50% 90%; }
@keyframes grow { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate-kicker { font-family: var(--font-display); color: var(--accent-ink); font-weight: 500; font-size: 1.05rem; margin-top: var(--s2); }
.celebrate h2 { font-size: 1.8rem; text-wrap: balance; }

/* Ficha del medicamento */
.med-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.med-preview { width: 6.5rem; height: auto; flex: none; }
.med-head h2 { font-size: 1.6rem; }
.fgroup { background: var(--bg); border-radius: var(--r-l); padding: var(--s4); margin-top: var(--s3); }
.fgroup h3 { font-size: 1.05rem; margin: 0 0 var(--s3); color: var(--accent-ink); }
.fgroup .field:last-child { margin-bottom: 0; }
.fgroup .input { background: var(--surface); }
.shape-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s4); }
.shape-pick button {
  display: grid; justify-items: center; gap: var(--s1); padding: var(--s3) var(--s1); border-radius: var(--r-m);
  border: 2px solid var(--line); background: var(--surface); font-family: var(--font-display); font-weight: 500; color: var(--ink);
}
.shape-pick svg { width: 44px; height: 24px; }
.shape-pick button[aria-pressed="true"] { border-color: var(--accent); background: var(--o-50); }
.input.time { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; }
.dose-row { border-bottom-color: var(--line); }
.stock-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.stepper { display: flex; align-items: center; background: var(--surface); border-radius: 999px; border: 2px solid var(--line); padding: 3px; }
.stepper button { width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 0; background: var(--o-100); color: var(--accent-ink); font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.stepper input { width: 4rem; border: 0; background: none; text-align: center; font-family: var(--font-display); font-size: 1.35rem; min-height: 2.6rem; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet .actions .btn.link { margin-top: 0; }

/* Ajustes ilustrados */
.profile-card { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border-radius: var(--r-xl); padding: var(--s4); box-shadow: var(--shadow); }
.profile-card .avatar.big, .profile-card .cajita.big { width: 4rem; height: 4rem; flex: none; }
.profile-card .grow { flex: 1; min-width: 0; }
.profile-card b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.profile-card small { color: var(--ink-2); font-size: var(--t-meta); }
.profile-card .btn { min-height: 2.6rem; padding: var(--s2) var(--s4); font-size: .95rem; }
.profile-card.guest { background: var(--o-100); box-shadow: none; }
.sgroup-title { font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--ink-2); margin: var(--s5) var(--s2) var(--s2); }
.sgroup { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: var(--s1) var(--s4); }
.srow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.srow.stack { border-bottom: 0; padding-bottom: var(--s2); }
.sgroup > :last-child { border-bottom: 0; }
.sicon { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 14px; background: var(--o-100); color: var(--accent-ink); display: grid; place-items: center; }
.sicon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stext { flex: 1; min-width: 0; }
.stext b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
.stext small { color: var(--ink-2); font-size: var(--t-meta); }
.sctl { flex: none; }
.sctl .seg { min-width: 7.5rem; }
.srow-ctl { padding: 0 0 var(--s3) calc(2.5rem + var(--s3)); border-bottom: 1px solid var(--line); }
.srow-ctl.two { display: flex; gap: var(--s2); flex-wrap: wrap; padding-top: 0; }
.btn.sm { min-height: 2.5rem; padding: var(--s1) var(--s4); font-size: .95rem; }
.pill-note { font-size: var(--t-meta); color: var(--ink-2); background: var(--sunken); padding: 4px 10px; border-radius: 999px; }
.danger-link { color: var(--late); margin-top: var(--s4); }
.settings-foot { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) var(--s2) 0; color: var(--ink-3); font-size: var(--t-meta); }
.foot-face { width: 2.6rem; height: 2.6rem; flex: none; }

/* Primer uso guiado */
.onb { z-index: 55; }
.onb-inner { max-width: 26rem; margin: 0 auto; padding: calc(var(--s7) + env(safe-area-inset-top)) var(--s5) var(--s7); text-align: center; }
.onb-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: var(--s5); }
.onb-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--o-200); transition: width .25s; }
.onb-dots i.on { width: 26px; background: var(--accent); }
.onb-art { display: grid; place-items: center; margin-bottom: var(--s4); }
.onb-face { width: 8rem; height: 8rem; animation: bob 3s ease-in-out infinite; }
.onb-garden { width: 100%; max-width: 22rem; height: auto; }
.onb h1 { font-family: var(--font-display); font-weight: 600; font-size: 2.1rem; line-height: 1.1; color: var(--ink); margin-bottom: var(--s2); text-wrap: balance; }
.onb .lead { color: var(--ink-2); margin-bottom: var(--s5); text-align: center; }
.onb .btn + .btn { margin-top: var(--s2); }
.onb .btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.h1-alt { display: block; font-size: 1.1rem; font-weight: 500; color: var(--ink-2); margin-top: var(--s1); }
.lang-pick { display: grid; gap: var(--s2); margin-top: var(--s5); }
.auth-lang { display: flex; justify-content: flex-end; margin-bottom: var(--s3); }
.auth-lang .seg { width: 7rem; }

/* Ajustes: tarjeta de perfil y controles con aire en el móvil */
.profile-card { flex-wrap: wrap; }
.profile-card .grow { flex: 1 1 10rem; }
.profile-card.guest .btn { flex: 1 1 100%; }
.srow-ctl { padding-left: 0; }
.seg button { white-space: nowrap; font-size: .95rem; padding-left: 2px; padding-right: 2px; }
.sctl .seg { min-width: 6.5rem; }

/* =====================================================================
   HOY EN DOS COLUMNAS + ESCRITORIO CON BARRA SUPERIOR
   ===================================================================== */
/* Móvil: el mismo orden de siempre (las dos columnas se «disuelven») */
.hoy-grid { display: flex; flex-direction: column; margin-top: calc(var(--s4) * -1); position: relative; z-index: 2; }
.hoy-main, .hoy-side { display: contents; }
.hoy-grid .bottle { order: 1; margin: 0; }
.hoy-grid .alert { order: 2; }
.hoy-grid .mood-card { order: 3; }
.hoy-grid .nudge { order: 4; }
.hoy-grid .hoy-title { order: 5; }
.hoy-grid .timeline { order: 6; }
.hoy-grid .footnote { order: 7; }
.hoy-grid .panel { display: none; }
.cap-date { display: none; }

@media (min-width: 1024px) {
  :root { font-size: 17px; }
  body { overflow-x: hidden; }
  .app { display: block; max-width: none; padding: 0; gap: 0; }
  .aside { display: none !important; }

  /* Barra superior */
  .tabbar {
    position: sticky; top: 0; z-index: 40; height: 76px; width: 100%;
    display: flex; flex-direction: row; align-items: center; gap: 4px;
    padding: 0 calc(max(32px, (100vw - 1200px) / 2) + 60px) 0 max(32px, calc((100vw - 1200px) / 2));
    border-radius: 0; border: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    transition: background .25s, border-color .25s;
  }
  .tabbar::after { display: none; }
  .brand { display: flex; padding: 0; margin-right: auto; gap: 10px; color: var(--ink); }
  .brand img { width: 40px; height: 40px; border-radius: 12px; }
  .brand span { color: var(--o-700); font-size: 1.75rem; }
  .tabbar button {
    flex-direction: row; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px;
    font-size: 1rem; color: var(--ink); border-radius: 999px; background: transparent;
  }
  .tabbar button svg { width: 1.2rem; height: 1.2rem; }
  .tabbar button:hover { background: color-mix(in srgb, var(--o-200) 55%, transparent); }
  .tabbar button[aria-current="page"] { background: var(--ink); color: var(--bg); }
  .me {
    position: fixed; z-index: 41; top: 16px; right: max(32px, calc((100vw - 1200px) / 2));
    width: 44px; height: 44px; border: 2px solid var(--surface); box-shadow: var(--shadow);
  }

  /* Hoy: la barra flota sobre el cielo hasta que bajas */
  body[data-view="hoy"]:not(.scrolled) .tabbar { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body[data-view="hoy"]:not(.scrolled) .tabbar button:not([aria-current="page"]) { color: var(--sky-ink, var(--ink)); }
  body[data-view="hoy"]:not(.scrolled) .brand span { color: var(--sky-ink, var(--o-700)); }
  body[data-view="hoy"] .appbar { display: none; }

  .shell { max-width: 1200px; padding: 0 32px var(--s8); margin: 0 auto; }
  .appbar { margin: 0; padding: var(--s6) 0 var(--s2); background: none; color: var(--ink); border-radius: 0; }

  /* Paisaje a todo lo ancho */
  .garden { width: 100vw; margin: -76px 0 0 calc(50% - 50vw); border-radius: 0; }
  .garden svg { height: 430px; }
  .scene-cap { left: max(32px, calc((100vw - 1200px) / 2)); top: 104px; }
  .scene-cap .cap-date { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; opacity: 1; margin-bottom: var(--s1); }
  .scene-cap b { font-size: 2.6rem; line-height: 1; }

  /* Dos columnas bajo el paisaje */
  .hoy-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: -64px; }
  .hoy-main, .hoy-side { display: block; }
  .hoy-side { display: grid; gap: var(--s4); padding-top: 64px; }
  .hoy-side .mood-card, .hoy-side .nudge { margin: 0; }
  .hoy-grid .panel { display: block; }
  .hoy-side .panel + .panel { margin-top: 0; }
  .hoy-grid .bottle { margin: 0; }
  .label-time { font-size: 4.2rem; }

  /* Resto de pestañas: columna centrada */
  #view-historial, #view-grupo, #view-ajustes { max-width: 820px; margin: 0 auto; }
  #view-medicinas { max-width: 1100px; margin: 0 auto; }
  .huerto { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: var(--s4); }
  .toast { bottom: var(--s6); }
}
@media (min-width: 1024px) { .hoy-side > * { order: 0 !important; } }
.scene-cap .cap-date { display: none; }
@media (min-width: 1024px) { .scene-cap .cap-date { display: block; } }

/* =====================================================================
   HUERTO 2: especies, cesta, bocadillo y estaciones (todo en bucle sin cortes)
   ===================================================================== */
.phit { fill: transparent; cursor: pointer; }
.sunhead { transform-box: fill-box; transform-origin: center; animation: nod 6s ease-in-out infinite; }
@keyframes nod { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }

/* Cesta de Cajita */
.basket-n { font-family: var(--font-display); font-size: 11px; font-weight: 600; fill: #FFF7F0; paint-order: stroke; stroke: #6B2A0E; stroke-width: 3px; }
.flyfruit { animation: harvest 1s cubic-bezier(.45,0,.7,.4) forwards; }
@keyframes harvest {
  0% { translate: 0 0; scale: 1.25; opacity: 1; }
  45% { translate: calc(var(--dx) * .45) calc(var(--dy) * .45 - 34px); scale: 1.1; opacity: 1; }
  100% { translate: var(--dx) var(--dy); scale: .45; opacity: 0; }
}
.basket { animation: basketpop .5s cubic-bezier(.3,1.6,.5,1) .95s both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes basketpop { 0% { scale: 1; } 40% { scale: 1.18 .9; } 100% { scale: 1; } }

/* Bocadillo de planta */
.plant-pop {
  position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 14px));
  display: grid; gap: 2px; min-width: 13rem; padding: var(--s3) var(--s4); border-radius: var(--r-l);
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 30px rgb(68 19 5 / .22); text-align: left;
  animation: popin .22s cubic-bezier(.3,1.5,.5,1);
}
.plant-pop::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: var(--surface); transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.plant-pop b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.plant-pop small { color: var(--ink-2); font-size: var(--t-meta); }
.plant-pop .pop-next { color: var(--accent-ink); font-weight: 800; }
.plant-pop .btn { margin-top: var(--s2); justify-self: start; }
@keyframes popin { from { opacity: 0; scale: .9; } to { opacity: 1; scale: 1; } }

/* Estaciones: hojas, pétalos y nieve que caen sin fin */
.fx-fall { animation: fall var(--t, 9s) linear calc(var(--d, 0s) * -1) infinite; }
@keyframes fall { from { translate: 0 0; } to { translate: var(--sx, 20px) 300px; } }
.fx-fall .spin { transform-box: fill-box; transform-origin: center; animation: spin 3.2s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.frost { fill: #FFF7F0; opacity: .85; }
.rays rect { fill: #FFF7F0; opacity: .55; }
.rays { animation: spin 40s linear infinite; transform-box: view-box; }
.season-invierno .canopy circle { fill: #3F6B48; }

/* Mariposas (de día) y luciérnagas (de noche) */
.bfly { animation: flutter 14s ease-in-out infinite; }
.bfly.b1 { animation-duration: 18s; animation-direction: reverse; }
@keyframes flutter {
  0%, 100% { translate: 0 0; } 20% { translate: 40px -26px; } 40% { translate: 86px -6px; }
  60% { translate: 60px 22px; } 80% { translate: 18px 8px; }
}
.bfly .wings { transform-box: fill-box; transform-origin: center; animation: flap .28s ease-in-out infinite alternate; }
@keyframes flap { from { scale: 1 1; } to { scale: .25 1; } }
.ff { fill: #FFE08A; animation: glow 3s ease-in-out calc(var(--d, 0s) * -1) infinite; }
@keyframes glow { 0%, 100% { opacity: .15; translate: 0 0; } 50% { opacity: 1; translate: 4px -6px; } }

@media (prefers-reduced-motion: reduce) {
  .fx-fall, .bfly, .ff, .rays, .flyfruit, .sunhead { animation: none !important; }
  .fx-fall { display: none; }
}
.garden { overflow: visible; }
.garden svg { overflow: hidden; }
.plant-pop.below { transform: translate(-50%, 16px); }
.plant-pop.below::after { bottom: auto; top: -8px; }

/* =====================================================================
   PLANTAS COMO FAMILIA + INTERACCIÓN
   ===================================================================== */
.bed-label { display: none; }
.stake-t { font-family: var(--font-display); font-size: 9.5px; font-weight: 500; fill: #3A2316; }
.stake { filter: drop-shadow(0 1.5px 0 rgb(68 19 5 / .25)); }
.crown { transform-box: fill-box; transform-origin: 50% 100%; }
.sp-girasol .crown { animation: nod 6s ease-in-out infinite; transform-origin: center; }

/* Frutos: mantener pulsado para cosechar */
.pfruit { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.pfruit .ring { fill: none; stroke: #FFF7F0; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; transform: rotate(-90deg); transform-box: fill-box; transform-origin: center; }
.pfruit.pressing .ring { opacity: 1; animation: fillring .65s linear forwards; }
.pfruit.pressing .pf-body { animation: squeeze .65s ease-in forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fillring { to { stroke-dashoffset: 0; } }
@keyframes squeeze { to { scale: .82; } }

/* La planta se sacude al tocarla */
.plant.wiggle { animation: wiggle .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes wiggle {
  0% { rotate: 0deg; scale: 1 1; } 20% { rotate: -7deg; scale: 1.04 .96; } 45% { rotate: 6deg; scale: .97 1.03; }
  70% { rotate: -3deg; scale: 1.01 .99; } 100% { rotate: 0deg; scale: 1 1; }
}

/* Profundidad: cada capa se mueve distinto con el ratón */
.layer { transition: translate .7s cubic-bezier(.2,.7,.2,1); }
.l-sky { translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -6px); }
.l-far { translate: calc(var(--px, 0) * -22px) 0; }
.l-near { translate: calc(var(--px, 0) * -10px) 0; }

/* Pista discreta */
.scene-hint {
  position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); margin: 0; z-index: 3;
  padding: 6px 14px; border-radius: 999px; background: rgb(255 247 240 / .92); color: #3A2316;
  font-family: var(--font-display); font-weight: 500; font-size: .82rem; white-space: nowrap;
  box-shadow: 0 6px 16px rgb(68 19 5 / .15); animation: hintin .5s ease-out 1s both;
}
@keyframes hintin { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 1024px) { .scene-hint { bottom: 76px; } }
@media (prefers-reduced-motion: reduce) { .layer { transition: none; translate: none; } .plant.wiggle { animation: none; } }
.scene-hint { left: 24px; top: 98px; bottom: auto; transform: none; font-size: .78rem; }
@media (min-width: 1024px) { .scene-hint { left: max(32px, calc((100vw - 1200px) / 2)); top: 236px; bottom: auto; } }

/* Nada tapa el huerto; regla de toma como etiqueta; frutos olvidados sin rayas */
.scene-hint { position: static; display: inline-block; transform: none; margin-top: 8px; padding: 5px 12px; border-radius: 999px; background: rgb(255 247 240 / .9); color: #3A2316; font-style: normal; font-family: var(--font-display); font-weight: 500; font-size: .78rem; box-shadow: 0 4px 12px rgb(68 19 5 / .12); animation: hintin .5s ease-out 1s both; }
@media (min-width: 1024px) { .scene-hint { position: static; top: auto; left: auto; font-size: .85rem; } .hoy-grid { margin-top: -20px; } .hoy-side { padding-top: 20px; } }
.label-rule { display: none; }
.rule-chip { display: flex; align-items: flex-start; gap: 10px; margin: var(--s3) 0 0; padding: 10px 14px; border-radius: 16px; background: var(--o-50); color: var(--ink); font-weight: 600; line-height: 1.35; }
:root[data-theme="dark"] .rule-chip { background: var(--sunken); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rule-chip { background: var(--sunken); } }
.rule-chip svg { width: 1.3rem; height: 1.3rem; flex: none; margin-top: 1px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pfruit.late .pf-body > :first-child, .pfruit:not(.ok) .pf-body > :first-child { stroke: none; }
.late-dot circle { fill: var(--late); stroke: #FFF7F0; stroke-width: 1.4; }
.late-dot path { stroke: #FFF7F0; stroke-width: 1.6; stroke-linecap: round; }

/* Fotos de perfil y caras: cuadradas en cualquier navegador (Safari incluido) */
.avatar-pick .avatar, .me .avatar { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
.avatar-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avatar-pick button { aspect-ratio: auto; height: auto; min-width: 0; padding: 3px; border-width: 3px; line-height: 0; overflow: hidden; border-radius: 50%; }
.avatar-pick button[aria-checked="true"] { transform: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--o-300); }
.me { padding: 0; line-height: 0; overflow: hidden; }
.me .avatar { width: 100%; height: 100%; }
.m-avatar, .join-me .avatar, .profile-card .avatar.big { overflow: hidden; border-radius: 50%; }
.m-avatar .avatar { width: 100%; height: 100%; }

/* =====================================================================
   FOTOS DE PERFIL: más grandes y con el tacto de Brotino
   ===================================================================== */
.avatar-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 6px 4px 2px; }
.avatar-pick button {
  position: relative; padding: 0; border: 0; border-radius: 50%; background: none; overflow: visible;
  transition: transform .2s cubic-bezier(.3,1.5,.5,1), box-shadow .2s;
  box-shadow: 0 3px 0 rgb(107 42 14 / .1);
}
.avatar-pick button .avatar { border-radius: 50%; }
.avatar-pick button:hover { transform: translateY(-2px); }
.avatar-pick button:active { transform: scale(.94); }
.avatar-pick button[aria-checked="true"] { transform: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent), 0 6px 14px rgb(196 63 6 / .25); }
.avatar-pick button[aria-checked="true"]::after {
  content: ""; position: absolute; right: -4px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--surface); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFF7F0' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
  animation: popin .25s cubic-bezier(.3,1.5,.5,1);
}
.avatar-pick button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* Pantalla de entrada: los personajes, protagonistas */
.auth-hero { gap: var(--s3); margin-bottom: var(--s2); }
.auth-hero .avatar { width: 5.4rem; height: 5.4rem; filter: drop-shadow(0 6px 10px rgb(107 42 14 / .14)); }
.auth-hero .a2 { width: 7.2rem; height: 7.2rem; }

/* Tu foto en la barra de arriba */
.me { width: 2.9rem; height: 2.9rem; }
.m-avatar { width: 3.6rem; height: 3.6rem; }
.profile-card .avatar.big, .profile-card .cajita.big { width: 4.8rem; height: 4.8rem; }
@media (min-width: 1024px) { .me { width: 48px; height: 48px; } }
@media (prefers-reduced-motion: reduce) { .avatar-pick button[aria-checked="true"]::after { animation: none; } }
.avatar-pick { gap: 8px; padding: 8px; margin-inline: -14px; }
@media (min-width: 420px) { .avatar-pick { gap: 12px; } }

/* =====================================================================
   CUIDADOS: herramientas, avisos, ficha, citas, informe y viaje
   ===================================================================== */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 1024px) { .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tool {
  display: grid; align-content: start; gap: 4px; text-align: left; padding: var(--s4); min-height: 8.5rem;
  border: 0; border-radius: var(--r-l); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.3,1.5,.5,1);
}
.tool:hover { transform: translateY(-2px); }
.tool:active { transform: scale(.97); }
.tool-ic { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 14px; background: var(--o-100, #FFEBD9); margin-bottom: var(--s2); }
.tool-ic svg, .alert svg, .fam-alerts svg, .btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-ic svg { width: 1.5rem; height: 1.5rem; color: var(--accent-ink); }
.tool b { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.2; }
.tool small { color: var(--ink-2); font-size: var(--t-meta); line-height: 1.35; }

/* Avisos en Hoy */
.alert { width: 100%; text-align: left; }
.alert + .alert { margin-top: var(--s2); }
.alert.low { display: flex; align-items: center; gap: var(--s3); }
.alert.low .alert-ic { display: grid; place-items: center; }
.alert.low .btn { flex: none; }
.alert.cita svg { stroke: var(--accent-ink); }
.alert.fam { background: color-mix(in srgb, var(--late) 12%, var(--surface)); border-color: color-mix(in srgb, var(--late) 35%, transparent); }
.alert.fam svg { stroke: var(--late); }

/* Grupo */
.fam-alerts { display: grid; gap: var(--s2); margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-l);
  background: color-mix(in srgb, var(--late) 12%, var(--surface)); color: var(--ink); }
.fam-alerts p { display: flex; gap: var(--s3); align-items: flex-start; margin: 0; }
.fam-alerts svg { width: 1.4rem; height: 1.4rem; flex: none; color: var(--late); margin-top: 2px; }
.member.missing { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--late) 55%, transparent), var(--shadow); }
.tabbar button { position: relative; }
.tabbar button.has-alert::after { content: ""; position: absolute; top: 6px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: var(--late); border: 2px solid var(--surface); }
@media (min-width: 1024px) { .tabbar button.has-alert::after { top: 8px; right: 8px; } }

/* Ficha de emergencia */
.ice { border-radius: var(--r-xl); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); padding: var(--s4); margin-bottom: var(--s4); }
.ice-head { display: flex; gap: var(--s3); align-items: center; padding-bottom: var(--s3); border-bottom: 2px solid var(--line); }
.ice-cross { width: 3.2rem; height: 3.2rem; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--late); color: #fff; }
.ice-cross svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ice-head small { display: block; color: var(--late); font-weight: 800; font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .04em; }
.ice-head b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.15; }
.ice-head span { color: var(--ink-2); font-size: var(--t-meta); }
.ice-warn { margin: var(--s3) 0 0; padding: var(--s3); border-radius: var(--r-m, 14px); background: color-mix(in srgb, var(--late) 13%, var(--surface)); color: var(--ink); }
.ice-warn b { display: block; color: var(--late); font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.ice-list { margin: var(--s3) 0 0; display: grid; gap: var(--s2); }
.ice-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: var(--s2); }
.ice-row dt { color: var(--ink-2); font-size: var(--t-meta); font-weight: 700; padding-top: 2px; }
.ice-row dd { margin: 0; font-weight: 700; white-space: pre-line; }
@media (max-width: 380px) { .ice-row { grid-template-columns: 1fr; gap: 0; } }
.ice-sub { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: var(--s4) 0 var(--s2); }
.ice-meds { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.ice-meds li { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s2); align-items: center; }
.ice-meds .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.ice-meds small { grid-column: 2; color: var(--ink-2); font-size: var(--t-meta); }
.ice-contact { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s3); border-radius: var(--r-l); background: var(--bg); }
.ice-contact > div { flex: 1; min-width: 0; }
.ice-contact small { display: block; color: var(--ink-2); font-size: var(--t-meta); }
.ice-contact b { display: block; font-size: 1.1rem; }
.ice-contact span { color: var(--ink-2); }
.ice-contact .btn svg { width: 1.2rem; height: 1.2rem; }
.ice-qr { width: 11rem; margin: var(--s4) auto 0; padding: 6px; background: #fff; border-radius: 12px; }
.ice-qr svg { display: block; width: 100%; height: auto; }
.ice-qr-hint { text-align: center; margin: var(--s2) 0 0; }

/* Citas */
.cita-list { display: grid; gap: var(--s2); }
.cita-item { display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left; padding: var(--s3); border: 0; border-radius: var(--r-l); background: var(--bg); color: var(--ink); }
.cita-item.past { opacity: .6; }
.cita-date { width: 3.4rem; flex: none; display: grid; place-items: center; padding: 6px 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.cita-date b { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1; }
.cita-date small { color: var(--accent-ink); font-weight: 800; font-size: .78rem; text-transform: uppercase; }
.cita-item .grow b { display: block; font-size: 1.05rem; }
.cita-item .grow small { color: var(--ink-2); font-size: var(--t-meta); }
.cita-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-style: normal; font-size: .8rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.tag.hot { background: var(--accent); color: #fff; box-shadow: none; }
.check-row { display: flex; align-items: center; gap: var(--s3); margin: var(--s2) 0 var(--s3); font-weight: 700; }
.check-row input, .trip-row input { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); flex: none; }

/* Informe */
.rep-big { display: flex; align-items: center; gap: var(--s4); margin: var(--s4) 0; padding: var(--s4); border-radius: var(--r-l); background: var(--bg); }
.rep-big > b { font-family: var(--font-display); font-weight: 600; font-size: 2.6rem; line-height: 1; color: var(--accent-ink); }
.rep-big span { font-weight: 700; }
.rep-big small { display: block; color: var(--ink-2); font-weight: 600; font-size: var(--t-meta); margin-top: 2px; }
.rep-meds .row, .trip-list .trip-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.rep-meds .row + .row, .trip-row + .trip-row { border-top: 1px solid var(--line); }
.rep-meds small, .trip-row small { display: block; color: var(--ink-2); font-size: var(--t-meta); }
.rep-pct, .trip-n { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }


/* ¿Y si se me olvida? */
.forgot blockquote { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-l); background: var(--bg); border-left: 4px solid var(--accent); }
.forgot blockquote p { margin: 0 0 var(--s2); font-size: 1.08rem; line-height: 1.5; }
.forgot blockquote p:last-child { margin: 0; }
.btn svg { width: 1.2rem; height: 1.2rem; }

/* Viaje */
.trip-sum { margin: var(--s3) 0; font-size: 1.05rem; }
.trip-sum b { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--accent-ink); }
.trip-row { cursor: pointer; }
.trip-row.done .grow b { text-decoration: line-through; color: var(--ink-2); }
.trip-tips { margin: var(--s4) 0 0; padding-left: 1.2rem; color: var(--ink-2); display: grid; gap: var(--s2); }
.alert.low { flex-wrap: wrap; }
.alert.low .grow { flex: 1 1 11rem; min-width: 0; }
.alert.low .btn { margin-left: auto; }
.ice-meds li { grid-template-columns: 12px 1fr; column-gap: var(--s3); align-items: start; }
.ice-meds .dot { margin-top: 7px; }
.ice-meds small { display: block; }
a.btn { text-decoration: none; }
.cita-item .grow { flex: 1; min-width: 0; display: block; }
.cita-item .chev { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row2 > .field, .row2 .input { min-width: 0; }
.input[type="date"], .input[type="time"] { min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }

/* ¿Se te ha olvidado? — tarjetas claras y con aire */
.fg-top { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.fg-top .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; margin-top: .7rem; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.fg-top h2 { margin: 0; }
.fg-top .lead { margin: 4px 0 0; }
.fg-card { border-radius: var(--r-l); background: var(--bg); padding: var(--s4); margin-bottom: var(--s3); }
.fg-head { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s3); }
.fg-head b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.2; }
.fg-head small { display: block; color: var(--ink-2); font-size: var(--t-meta); line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.fg-ic { width: 2.4rem; height: 2.4rem; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
.fg-ic svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fg-body > p { margin: 0 0 var(--s4); font-size: 1.05rem; line-height: 1.55; }
.fg-body blockquote { margin: 0 0 var(--s4); padding: 0 0 0 var(--s4); border-left: 4px solid var(--accent); }
.fg-body blockquote p { margin: 0 0 var(--s2); font-size: 1.08rem; line-height: 1.55; }
.fg-body blockquote p:last-child { margin: 0; }
.fg-body .btn { background: var(--surface); }
.fg-doctor { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.fg-doctor .fg-head { margin-bottom: var(--s2); }
.fg-note { margin: 0; font-size: 1.15rem; line-height: 1.5; font-weight: 700; white-space: pre-line; }
.fg-warn { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-m); font-size: var(--t-meta); font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--late) 9%, var(--surface)); border-left: 4px solid var(--late); }
.fg-edit { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.fg-edit .field { margin-bottom: var(--s3); }
.fg-loading { display: flex; gap: 6px; padding: var(--s2) 0 var(--s3); }
.fg-loading i { width: 9px; height: 9px; border-radius: 50%; background: var(--o-300); animation: fgdot 1s ease-in-out infinite; }
.fg-loading i:nth-child(2) { animation-delay: .15s; } .fg-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes fgdot { 0%, 100% { opacity: .3; translate: 0 0; } 50% { opacity: 1; translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .fg-loading i { animation: none; } }
.fg-body blockquote p { font-size: 1rem; }

/* El logo lleva a Hoy */
a.brand { text-decoration: none; color: inherit; cursor: pointer; border-radius: 12px; }
a.brand:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* =====================================================================
   INFORME IMPRESO con la marca Brotino
   ===================================================================== */
#print-report { display: none; }
#print-report.preview { display: block; position: fixed; inset: 0; z-index: 999; overflow: auto; background: #E9DED6; padding: 24px; }
#print-report.preview .rp { max-width: 780px; margin: 0 auto; box-shadow: 0 20px 50px rgb(68 19 5 / .2); border-radius: 8px; padding: 40px 44px; }
.rp { --o: #FF6B1A; --o7: #C43F06; --o1: #FFF3E9; --o2: #FFE3CC; --ink: #3A2316; --ink2: #7A5A47; --line: #F0DDD0;
  background: #FFFBF7; color: var(--ink); font: 10.5pt/1.45 Nunito, system-ui, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp h1, .rp h2, .rp-brand span, .rp-kpi b { font-family: Fredoka, Nunito, sans-serif; }
.rp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 18px; background: var(--o); color: #FFF7F0; }
.rp-brand { display: flex; align-items: center; gap: 10px; }
.rp-logo { width: 46px; height: 46px; display: block; }
.rp-head .rp-logo { background: #FFF7F0; border-radius: 14px; padding: 4px; }
.rp-brand span { font-weight: 600; font-size: 22pt; letter-spacing: -.02em; line-height: 1; }
.rp-title { text-align: right; }
.rp-title h1 { margin: 0; font-weight: 600; font-size: 15pt; line-height: 1.1; }
.rp-title p { margin: 2px 0 0; font-size: 9.5pt; opacity: .9; }
.rp-patient { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 16px 2px 12px; }
.rp-patient small { display: block; color: var(--o7); font-weight: 800; font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; }
.rp-patient b { display: block; font-family: Fredoka, sans-serif; font-weight: 600; font-size: 17pt; line-height: 1.15; }
.rp-patient span { color: var(--ink2); font-size: 9.5pt; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.rp-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--o2); font-size: 9pt; color: var(--ink); }
.rp-chip b { display: inline; font: 800 8pt Nunito, sans-serif; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; color: var(--o7); }
.rp-chip.warn { background: #FDE4E1; }
.rp-chip.warn b { color: #C81E1E; }
.rp-kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.rp-kpi { padding: 10px 12px; border-radius: 14px; background: var(--o1); display: flex; flex-direction: column; justify-content: space-between; min-height: 72px; }
.rp-kpi b { font-weight: 600; font-size: 20pt; line-height: 1; color: var(--ink); display: flex; align-items: baseline; }
.rp-kpi b small { font-size: 11pt; color: var(--ink2); font-weight: 500; }
.rp-kpi span { font-size: 8.5pt; color: var(--ink2); font-weight: 700; margin-top: 6px; }
.rp-kpi.main { background: var(--o7); }
.rp-kpi.main b { color: #FFF7F0; font-size: 28pt; }
.rp-kpi.main span { color: #FFE3CC; }
.rp-face { width: 28px; height: 28px; display: block; }
.rp h2 { font-weight: 600; font-size: 12pt; margin: 18px 0 8px; padding-left: 10px; border-left: 4px solid var(--o); line-height: 1.2; }
.rp-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.rp-day { width: 19px; height: 19px; border-radius: 5px; display: inline-grid; place-items: center; vertical-align: middle; }
.rp-day i { font-style: normal; font-size: 6.5pt; font-weight: 800; color: rgb(58 35 22 / .55); }
.rp-day.full { background: var(--o); }
.rp-day.full i { color: #FFF7F0; }
.rp-day.part { background: #FFB37A; }
.rp-day.low { background: #FDE4E1; box-shadow: inset 0 0 0 1.5px #E79A91; }
.rp-day.na { background: #F3ECE6; }
.rp-legend { margin: 6px 0 0; font-size: 8pt; color: var(--ink2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.rp-legend .rp-day { width: 11px; height: 11px; border-radius: 3px; margin-left: 8px; }
.rp-legend .rp-day:first-child { margin-left: 0; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 9.5pt; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.rp-table th { text-align: left; font-size: 8pt; text-transform: uppercase; letter-spacing: .05em; color: var(--o7); background: var(--o1); padding: 6px 10px; font-weight: 800; }
.rp-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.rp-table td small { display: block; color: var(--ink2); font-size: 8.5pt; margin-left: 16px; }
.rp-c { width: 30%; }
td.rp-c { white-space: nowrap; }
.rp-c b { font-weight: 800; margin: 0 4px 0 8px; }
td.rp-c small { display: inline; margin: 0; }
.rp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; }
.rp-bar { display: inline-block; width: 46%; height: 8px; border-radius: 99px; background: var(--o2); vertical-align: middle; overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--o); }
.rp-tag { font-size: 8pt; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #FDE4E1; color: #C81E1E; }
.rp-tag.skip { background: #F3ECE6; color: var(--ink2); }
.rp-missed tr { break-inside: avoid; }
.rp-ok { padding: 10px 14px; border-radius: 12px; background: var(--o1); font-weight: 700; margin: 0; }
.rp-note { font-size: 8.5pt; color: var(--ink2); margin: 4px 0 0; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; break-inside: avoid; }
.rp-moods { display: flex; gap: 10px; }
.rp-moods span { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px; border-radius: 14px; background: var(--o1); }
.rp-moods .rp-face { width: 30px; height: 30px; }
.rp-moods b { font-family: Fredoka, sans-serif; font-weight: 600; font-size: 15pt; line-height: 1; }
.rp-moods small { font-size: 8pt; color: var(--ink2); font-weight: 700; }
.rp-citas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 9.5pt; }
.rp-citas li { padding: 6px 10px; border-radius: 10px; background: var(--o1); }
.rp-citas b { display: block; color: var(--o7); font-size: 8.5pt; }
.rp-citas em { color: var(--ink2); }
.rp-foot { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 10px; border-top: 1.5px solid var(--line); font-size: 8pt; color: var(--ink2); break-inside: avoid; }
.rp-foot p { margin: 0; }
.rp-logo.sm { width: 26px; height: 26px; flex: none; }
@media print {
  body > *:not(#print-report) { display: none !important; }
  html, body { background: #FFFBF7 !important; }
  #print-report { display: block !important; position: static; padding: 0; background: none; }
  .rp { background: none; }
  @page { size: A4; margin: 14mm; }
}
@media (max-width: 640px) {
  #print-report.preview { padding: 8px; }
  #print-report.preview .rp { padding: 18px 14px; }
  #print-report.preview .rp-kpis { grid-template-columns: 1fr 1fr; }
  #print-report.preview .rp-cols { grid-template-columns: 1fr; }
  #print-report.preview .rp-head { flex-direction: column; align-items: flex-start; }
  #print-report.preview .rp-title { text-align: left; }
}

/* =====================================================================
   CALMA: todo se mueve despacio, sin rebotes bruscos
   ===================================================================== */
:root { --ease-calm: cubic-bezier(.25, .8, .3, 1); --t-calm: .38s; }

/* Botones y tarjetas: cambios suaves, pulsación apenas perceptible */
button, .btn, a.btn, .tool, .pcard, .item, .cita-item, .trow .body, .check, .seg button, .tabbar button, .avatar-pick button, .alert, .member, .day {
  transition: transform var(--t-calm) var(--ease-calm), background-color var(--t-calm) ease, color var(--t-calm) ease,
    box-shadow var(--t-calm) ease, border-color var(--t-calm) ease, opacity var(--t-calm) ease !important;
}
.btn:active, .tool:active, .pcard:active, .item:active, .cita-item:active, .alert:active, .seg button:active, .check:active { transform: scale(.985) !important; }
.tool:hover, .pcard:hover { transform: translateY(-1px); }
.btn { box-shadow: none; }
.btn.primary { box-shadow: 0 6px 16px -6px rgb(196 63 6 / .45); }
.btn.primary:hover { box-shadow: 0 10px 22px -8px rgb(196 63 6 / .5); }
:focus-visible { outline-offset: 3px; transition: outline-offset .2s ease; }

/* Cambiar de pestaña: un fundido lento */
.view { animation: viewin .5s var(--ease-calm) both; }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Hojas: suben despacio y bajan igual de suaves */
.sheet[open] { animation: sheetup .5s var(--ease-calm); }
.sheet[open]::backdrop { animation: veil .5s ease both; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes veil { from { opacity: 0; } to { opacity: 1; } }
.sheet.closing { animation: sheetdown .3s ease-in forwards; }
.sheet.closing::backdrop { animation: veilout .3s ease forwards; }
@keyframes sheetdown { to { transform: translateY(40px); opacity: 0; } }
@keyframes veilout { to { opacity: 0; } }
.sheet::backdrop { background: rgb(42 22 11 / .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#sheet-form.swap { animation: swap .4s var(--ease-calm); }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (min-width: 1024px) { @keyframes sheetup { from { transform: translateY(16px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } } }

/* Avisos y mensajes */
.toast { transition: opacity .45s var(--ease-calm), transform .45s var(--ease-calm); transform: translateY(16px); }
.alert { animation: viewin .6s var(--ease-calm) both; }
.alert + .alert { animation-delay: .08s; }

/* Celebraciones más tranquilas */
.says-face.joy { animation: hop 1s var(--ease-calm); }
.plant.wiggle { animation-duration: 1.1s; animation-timing-function: var(--ease-calm); }
.avatar-pick button[aria-checked="true"]::after { animation: popsoft .4s var(--ease-calm); }
@keyframes popsoft { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* Fotos de perfil: más aire */
.avatar-pick { gap: 14px; padding: 8px 6px; }
@media (min-width: 420px) { .avatar-pick { gap: 18px; } }
.avatar-pick button { box-shadow: none; }
.avatar-pick button:hover { transform: translateY(-1px); }
.avatar-pick button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.auth-hero .avatar { filter: none; }

@media (prefers-reduced-motion: reduce) {
  .view, .sheet[open], .sheet.closing, .alert, #sheet-form.swap { animation: none !important; }
  button, .btn, .tool, .pcard { transition: none !important; }
}

/* Aviso de mudanza a brotino.com */
.move {
  position: fixed; z-index: 60; left: var(--s4); right: var(--s4); top: calc(var(--s3) + env(safe-area-inset-top)); max-width: 30rem; margin: 0 auto;
  display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r-l);
  background: var(--surface); color: var(--ink); box-shadow: 0 16px 40px rgb(68 19 5 / .22);
  animation: sheetup .6s var(--ease-calm, ease) both; transition: opacity .4s ease, transform .4s ease;
}
.move.out { opacity: 0; transform: translateY(-12px); }
.move-face { width: 3.2rem; height: 3.2rem; flex: none; }
.move b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.25; }
.move span { display: block; color: var(--ink-2); font-size: var(--t-meta); margin-top: 4px; line-height: 1.45; }
.move span b { display: inline; font-family: inherit; font-size: inherit; color: var(--ink); }
.move-actions { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s3); flex-wrap: wrap; }

/* =====================================================================
   MACETAS: al pasar el ratón la planta se despereza, se riega y brilla
   ===================================================================== */
.pcard-art .pc-glow path { fill: #FFC93D; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pcard-art .pc-drops path { fill: #6FB3F2; opacity: 0; }
.pcard-art .pc-wet { fill: #3A1606; opacity: 0; transition: opacity 1.2s ease; }
.pcard-art .pc-lean { transform-box: view-box; transform-origin: 70px 98px; transform: rotate(calc(var(--lean, 0) * 5deg)); transition: transform .9s var(--ease-calm, ease); }
.pcard-art .pc-sway { transform-box: view-box; transform-origin: 70px 98px; }
.pcard-art .pc-pot { transform-box: view-box; transform-origin: 70px 140px; }
.pcard-art .pot-shadow { transform-box: fill-box; transform-origin: center; transition: transform .7s var(--ease-calm, ease), opacity .7s ease; }
.pcard-art .crown { transition: scale .9s var(--ease-calm, ease); }

@media (hover: hover) and (pointer: fine) {
  .pcard:not(.add):hover, .pcard:not(.add):focus-visible { transform: translateY(-4px); box-shadow: 0 18px 34px -14px rgb(120 45 10 / .35); }
  .pcard:not(.add):hover .pot-shadow { transform: scale(.88); opacity: .7; }
  .pcard:not(.add):hover .pc-pot { animation: potsettle .9s var(--ease-calm, ease); }
  .pcard:not(.add):hover .pc-sway { animation: plantsway 3.6s ease-in-out .2s infinite; }
  .pcard:not(.add):hover .crown { scale: 1.05; }
  .pcard:not(.add):hover .pfruit { animation: fruitbob 2.4s ease-in-out infinite; animation-delay: calc(var(--n, 0) * .3s); }
  .pcard:not(.add):hover .pc-drops path { animation: waterdrop 2.4s cubic-bezier(.45, 0, .8, .6) infinite; animation-delay: calc(.3s + var(--n) * .55s); }
  .pcard:not(.add):hover .pc-wet { opacity: .28; }
  .pcard:not(.add):hover .pc-glow path { animation: twinkle 2.8s ease-in-out infinite; animation-delay: calc(.6s + var(--n) * .6s); }
  .pcard:not(.add):hover .pcard-stage { background: color-mix(in srgb, var(--c, var(--o-500)) 32%, var(--surface)); }

  /* La maceta de «Plantar otra» invita: el + respira */
  .pcard.add:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
  .pcard.add:hover .add-plus { animation: breathe 2.2s ease-in-out infinite; }
}
@keyframes potsettle { 0% { transform: none; } 30% { transform: scale(1.025, .975); } 65% { transform: scale(.99, 1.01); } 100% { transform: none; } }
@keyframes plantsway { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-2.4deg); } 70% { transform: rotate(2.4deg); } }
@keyframes fruitbob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.5px; } }
@keyframes waterdrop {
  0% { opacity: 0; translate: 0 0; }
  12% { opacity: .9; }
  70% { opacity: .9; }
  85%, 100% { opacity: 0; translate: 0 66px; }
}
@keyframes twinkle { 0%, 100% { opacity: 0; scale: .3; rotate: 0deg; } 40% { opacity: 1; scale: 1; rotate: 45deg; } 70% { opacity: 0; scale: .5; rotate: 90deg; } }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }

@media (prefers-reduced-motion: reduce) {
  .pcard:hover .pc-sway, .pcard:hover .pc-pot, .pcard:hover .pfruit, .pcard:hover .pc-drops path, .pcard:hover .pc-glow path, .pcard.add:hover .add-plus { animation: none !important; }
  .pcard-art .pc-lean { transition: none; transform: none; }
}
.auth-garden .aa-small { font: 600 9.5px Nunito, sans-serif; fill: #7A5A47; }
.auth-garden .aa-big { font: 600 12.5px Fredoka, Nunito, sans-serif; fill: #3A2316; }
.auth-garden { filter: drop-shadow(0 24px 40px rgb(120 50 10 / .12)); }

/* Contraseña con ojo para verla */
.pass-wrap { position: relative; display: block; }
.pass-wrap .input { padding-right: 3.4rem; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%) !important; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); }
.pass-eye:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-ink); }
.pass-eye svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pass-eye .slash { opacity: 0; transition: opacity .3s ease; }
.pass-eye[aria-pressed="true"] .slash { opacity: 1; }
.auth-garden { border-radius: 28px; }

/* =====================================================================
   MODO OSCURO: «huerto al anochecer». Gris cálido poco saturado, relieve suave,
   un brillo naranja tenue arriba y el paisaje fundido con el fondo.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #1B1613; --surface: #26201C; --sunken: #302823; --line: #3D342E;
  --ink: #F7EEE7; --ink-2: #CDBCB0; --ink-3: #9E8B7E;
  --accent: #FF7A2E; --accent-ink: #FFB37A; --on-accent: #1F0C02;
  --label: #FFF7F0; --done: #FF9A57; --late: #FF8E84; --late-soft: #3A1D1A;
  --o-100: #3A2A20; --o-200: #5A3A26; --o-300: #FF9A57;
  --focus: #93C5FD;
  --shadow: inset 0 1px 0 rgb(255 255 255 / .045), 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -10px rgb(0 0 0 / .55);
  color-scheme: dark;
}
  :root:not([data-theme="light"]) body { background: radial-gradient(1100px 520px at 50% -8%, rgb(255 122 46 / .09), transparent 62%) fixed, var(--bg); }
  :root:not([data-theme="light"]) .garden svg { filter: brightness(.84) saturate(.9) contrast(1.02); }
  :root:not([data-theme="light"]) .garden { position: relative; }
  :root:not([data-theme="light"]) .garden::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg)); }
  :root:not([data-theme="light"]) body[data-view="hoy"] .appbar { filter: brightness(.84) saturate(.9); }
  :root:not([data-theme="light"]) .bottle, :root:not([data-theme="light"]) .panel, :root:not([data-theme="light"]) .list, :root:not([data-theme="light"]) .setting, :root:not([data-theme="light"]) .sgroup, :root:not([data-theme="light"]) .pcard, :root:not([data-theme="light"]) .tool, :root:not([data-theme="light"]) .member, :root:not([data-theme="light"]) .profile-card, :root:not([data-theme="light"]) .nudge, :root:not([data-theme="light"]) .auth-form { box-shadow: var(--shadow); }
  :root:not([data-theme="light"]) .pcard { background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)); }
  :root:not([data-theme="light"]) .pcard-stage { background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--surface)); color: var(--ink); }
  :root:not([data-theme="light"]) .pcard-art .pot-shadow, :root:not([data-theme="light"]) .pot-shadow { fill: rgb(0 0 0 / .35); }
  :root:not([data-theme="light"]) .btn.quiet { background: var(--sunken); border-color: transparent; color: var(--ink); }
  :root:not([data-theme="light"]) .btn.quiet:hover { background: color-mix(in srgb, var(--accent) 14%, var(--sunken)); }
  :root:not([data-theme="light"]) .btn.primary { box-shadow: 0 8px 22px -10px rgb(255 122 46 / .55); }
  :root:not([data-theme="light"]) .input { background: var(--sunken); border-color: transparent; color: var(--ink); }
  :root:not([data-theme="light"]) .input:focus { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--sunken)); }
  :root:not([data-theme="light"]) .input::placeholder { color: var(--ink-3); }
  :root:not([data-theme="light"]) .seg { background: var(--sunken); }
  :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
  :root:not([data-theme="light"]) .tabbar { background: rgb(27 22 19 / .82); border-color: var(--line); }
  :root:not([data-theme="light"]) .tabbar button[aria-current="page"] { color: var(--accent-ink); }
  :root:not([data-theme="light"]) .sheet { background: var(--surface); box-shadow: 0 -10px 40px rgb(0 0 0 / .5); }
  :root:not([data-theme="light"]) .sheet::backdrop { background: rgb(8 5 3 / .62); }
  :root:not([data-theme="light"]) .toast { background: #F7EEE7; color: #1B1613; }
  :root:not([data-theme="light"]) .alert { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  :root:not([data-theme="light"]) .alert.fam { background: color-mix(in srgb, var(--late) 10%, var(--surface)); }
  :root:not([data-theme="light"]) .tool-ic, :root:not([data-theme="light"]) .fg-ic { background: var(--sunken); }
  :root:not([data-theme="light"]) .fg-card, :root:not([data-theme="light"]) .cita-item, :root:not([data-theme="light"]) .rep-big, :root:not([data-theme="light"]) .ice-contact { background: var(--sunken); }
  :root:not([data-theme="light"]) .fg-doctor { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
  :root:not([data-theme="light"]) .ice { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
  :root:not([data-theme="light"]) .ice-qr { background: #FFFFFF; }
  :root:not([data-theme="light"]) .cita-date { background: var(--surface); }
  :root:not([data-theme="light"]) .tag { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
  :root:not([data-theme="light"]) .avatar-pick button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
  :root:not([data-theme="light"]) .auth { background: radial-gradient(900px 480px at 50% -10%, rgb(255 122 46 / .14), transparent 65%), var(--bg); }
  :root:not([data-theme="light"]) .auth-garden { filter: brightness(.9) saturate(.92) drop-shadow(0 24px 40px rgb(0 0 0 / .45)); }
  :root:not([data-theme="light"]) .move { background: var(--surface); box-shadow: 0 16px 40px rgb(0 0 0 / .5); }
  :root:not([data-theme="light"]) .mood-pick button, :root:not([data-theme="light"]) .mood-pick .opt { background: var(--sunken); }
  :root:not([data-theme="light"]) .stock { background: var(--sunken); }
  :root:not([data-theme="light"]) .member.mine { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow); }
}
:root[data-theme="dark"] {
  --bg: #1B1613; --surface: #26201C; --sunken: #302823; --line: #3D342E;
  --ink: #F7EEE7; --ink-2: #CDBCB0; --ink-3: #9E8B7E;
  --accent: #FF7A2E; --accent-ink: #FFB37A; --on-accent: #1F0C02;
  --label: #FFF7F0; --done: #FF9A57; --late: #FF8E84; --late-soft: #3A1D1A;
  --o-100: #3A2A20; --o-200: #5A3A26; --o-300: #FF9A57;
  --focus: #93C5FD;
  --shadow: inset 0 1px 0 rgb(255 255 255 / .045), 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -10px rgb(0 0 0 / .55);
  color-scheme: dark;
}
:root[data-theme="dark"] body { background: radial-gradient(1100px 520px at 50% -8%, rgb(255 122 46 / .09), transparent 62%) fixed, var(--bg); }
:root[data-theme="dark"] .garden svg { filter: brightness(.84) saturate(.9) contrast(1.02); }
:root[data-theme="dark"] .garden { position: relative; }
:root[data-theme="dark"] .garden::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg)); }
:root[data-theme="dark"] body[data-view="hoy"] .appbar { filter: brightness(.84) saturate(.9); }
:root[data-theme="dark"] .bottle, :root[data-theme="dark"] .panel, :root[data-theme="dark"] .list, :root[data-theme="dark"] .setting, :root[data-theme="dark"] .sgroup, :root[data-theme="dark"] .pcard, :root[data-theme="dark"] .tool, :root[data-theme="dark"] .member, :root[data-theme="dark"] .profile-card, :root[data-theme="dark"] .nudge, :root[data-theme="dark"] .auth-form { box-shadow: var(--shadow); }
:root[data-theme="dark"] .pcard { background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)); }
:root[data-theme="dark"] .pcard-stage { background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--surface)); color: var(--ink); }
:root[data-theme="dark"] .pcard-art .pot-shadow, :root[data-theme="dark"] .pot-shadow { fill: rgb(0 0 0 / .35); }
:root[data-theme="dark"] .btn.quiet { background: var(--sunken); border-color: transparent; color: var(--ink); }
:root[data-theme="dark"] .btn.quiet:hover { background: color-mix(in srgb, var(--accent) 14%, var(--sunken)); }
:root[data-theme="dark"] .btn.primary { box-shadow: 0 8px 22px -10px rgb(255 122 46 / .55); }
:root[data-theme="dark"] .input { background: var(--sunken); border-color: transparent; color: var(--ink); }
:root[data-theme="dark"] .input:focus { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--sunken)); }
:root[data-theme="dark"] .input::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] .seg { background: var(--sunken); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
:root[data-theme="dark"] .tabbar { background: rgb(27 22 19 / .82); border-color: var(--line); }
:root[data-theme="dark"] .tabbar button[aria-current="page"] { color: var(--accent-ink); }
:root[data-theme="dark"] .sheet { background: var(--surface); box-shadow: 0 -10px 40px rgb(0 0 0 / .5); }
:root[data-theme="dark"] .sheet::backdrop { background: rgb(8 5 3 / .62); }
:root[data-theme="dark"] .toast { background: #F7EEE7; color: #1B1613; }
:root[data-theme="dark"] .alert { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-theme="dark"] .alert.fam { background: color-mix(in srgb, var(--late) 10%, var(--surface)); }
:root[data-theme="dark"] .tool-ic, :root[data-theme="dark"] .fg-ic { background: var(--sunken); }
:root[data-theme="dark"] .fg-card, :root[data-theme="dark"] .cita-item, :root[data-theme="dark"] .rep-big, :root[data-theme="dark"] .ice-contact { background: var(--sunken); }
:root[data-theme="dark"] .fg-doctor { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
:root[data-theme="dark"] .ice { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
:root[data-theme="dark"] .ice-qr { background: #FFFFFF; }
:root[data-theme="dark"] .cita-date { background: var(--surface); }
:root[data-theme="dark"] .tag { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
:root[data-theme="dark"] .avatar-pick button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
:root[data-theme="dark"] .auth { background: radial-gradient(900px 480px at 50% -10%, rgb(255 122 46 / .14), transparent 65%), var(--bg); }
:root[data-theme="dark"] .auth-garden { filter: brightness(.9) saturate(.92) drop-shadow(0 24px 40px rgb(0 0 0 / .45)); }
:root[data-theme="dark"] .move { background: var(--surface); box-shadow: 0 16px 40px rgb(0 0 0 / .5); }
:root[data-theme="dark"] .mood-pick button, :root[data-theme="dark"] .mood-pick .opt { background: var(--sunken); }
:root[data-theme="dark"] .stock { background: var(--sunken); }
:root[data-theme="dark"] .member.mine { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth h1, :root:not([data-theme="light"]) .brand span { color: #FF9A57; } :root:not([data-theme="light"]) .bottle .btn-take { box-shadow: 0 6px 0 #9C330D; } }
:root[data-theme="dark"] .auth h1, :root[data-theme="dark"] .brand span { color: #FF9A57; }
:root[data-theme="dark"] .bottle .btn-take { box-shadow: 0 6px 0 #9C330D; }

/* =====================================================================
   BIENVENIDA (escritorio): marca arriba, historia a la izquierda,
   formulario sereno a la derecha
   ===================================================================== */
.aw-form-head { display: none; }
@media (min-width: 1024px) {
  .auth { background: var(--bg); }
  .auth-wrap { max-width: none; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 0; align-items: stretch; padding: 0; }
  .auth-art {
    display: flex; flex-direction: column; justify-content: center; gap: 0; position: relative; overflow: hidden;
    margin: 16px 0 16px 16px; padding: 48px clamp(40px, 5vw, 80px); border-radius: 36px;
    background: radial-gradient(700px 420px at 85% 0%, rgb(255 255 255 / .55), transparent 60%), linear-gradient(160deg, #FFE7D3 0%, #FFD3AD 100%);
  }
  .aw-brand { position: absolute; top: 36px; left: clamp(40px, 5vw, 80px); display: flex; align-items: center; gap: 10px; }
  .aw-logo { width: 44px; height: 44px; }
  .aw-brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; letter-spacing: -.02em; color: #C43F06; }
  .auth-art h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 3.4vw, 3.4rem); line-height: 1.02; letter-spacing: -.03em; margin: 64px 0 14px; color: #2A160B; max-width: 14ch; text-wrap: balance; }
  .auth-art p { font-size: 1.12rem; color: #6B4A36; max-width: 38ch; line-height: 1.55; margin: 0 0 32px; }
  .auth-garden { width: 100%; max-width: 620px; height: auto; display: block; border-radius: 26px; filter: drop-shadow(0 28px 44px rgb(150 60 10 / .2)); }
  .aw-points { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 28px 0 0; padding: 0; }
  .aw-points li { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; color: #4A2C1A; }
  .aw-points span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgb(255 255 255 / .7); color: #C43F06; }
  .aw-points svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .auth-inner { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 27rem; margin: 0 auto; padding: 48px 32px; position: relative; }
  .auth-lang { position: absolute; top: 32px; right: 32px; margin: 0; }
  .auth-inner > h1, .auth-inner > .lead { display: none; }
  .aw-form-head { display: block; margin-bottom: 22px; }
  .aw-form-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 2.1rem; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 6px; }
  .aw-form-head p { color: var(--ink-2); margin: 0; }
  .auth-form { box-shadow: none; background: transparent; padding: 0; }
  .auth-inner > .btn.link { align-self: center; margin-top: 14px; }
  .auth .seg { margin-bottom: 22px !important; }
}
@media (min-width: 1024px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-art { background: radial-gradient(700px 420px at 85% 0%, rgb(255 154 87 / .16), transparent 60%), linear-gradient(160deg, #2E231D 0%, #3A2A20 100%); }
  :root:not([data-theme="light"]) .auth-art h2 { color: #F7EEE7; }
  :root:not([data-theme="light"]) .auth-art p { color: #CDBCB0; }
  :root:not([data-theme="light"]) .aw-brand span { color: #FF9A57; }
  :root:not([data-theme="light"]) .aw-points li { color: #E8D9CE; }
  :root:not([data-theme="light"]) .aw-points span { background: rgb(255 255 255 / .07); color: #FF9A57; }
}
@media (min-width: 1024px) {
  :root[data-theme="dark"] .auth-art { background: radial-gradient(700px 420px at 85% 0%, rgb(255 154 87 / .16), transparent 60%), linear-gradient(160deg, #2E231D 0%, #3A2A20 100%); }
  :root[data-theme="dark"] .auth-art h2 { color: #F7EEE7; }
  :root[data-theme="dark"] .auth-art p { color: #CDBCB0; }
  :root[data-theme="dark"] .aw-brand span { color: #FF9A57; }
  :root[data-theme="dark"] .aw-points li { color: #E8D9CE; }
  :root[data-theme="dark"] .aw-points span { background: rgb(255 255 255 / .07); color: #FF9A57; }
}
@media (min-width: 1024px) {
  .auth-lang { position: static; align-self: flex-end; margin: 0 0 28px; }
  .auth-inner { justify-content: center; padding-top: 28px; }
  .auth-art h2 { margin-top: 56px; font-size: clamp(2.3rem, 3.1vw, 3.1rem); }
  .auth-art p { margin-bottom: 26px; }
  .auth-garden { max-width: 540px; }
  .aw-points { margin-top: 24px; }
}
@media (min-width: 1024px) and (max-height: 820px) { .auth-garden { max-width: 440px; } .auth-art h2 { margin-top: 48px; } }

/* =====================================================================
   HOY: las plantas del paisaje también despiertan al pasar el ratón
   ===================================================================== */
.gplant .pc-glow path { fill: #FFC93D; opacity: 0; transform-box: fill-box; transform-origin: center; }
.gplant .pc-drops path { fill: #6FB3F2; opacity: 0; }
.gplant .pc-lean, .gplant .pc-sway { transform-box: view-box; transform-origin: 0 0; }
.gplant .pc-lean { transform: rotate(calc(var(--lean, 0) * 5deg)); transition: transform .9s var(--ease-calm, ease); }
.gplant .crown { transition: scale .9s var(--ease-calm, ease); }
@media (hover: hover) and (pointer: fine) {
  .gplant:hover .pc-sway { animation: plantsway 3.6s ease-in-out .15s infinite; }
  .gplant:hover .crown { scale: 1.06; }
  .gplant:hover .pc-drops path { animation: gdrop 2.4s cubic-bezier(.45, 0, .8, .6) infinite; animation-delay: calc(.25s + var(--n) * .55s); }
  .gplant:hover .pc-glow path { animation: twinkle 2.8s ease-in-out infinite; animation-delay: calc(.5s + var(--n) * .6s); }
  .gplant:hover .pfruit:not(.pressing) .pf-body { animation: fruitbob 2.4s ease-in-out infinite; }
  .gplant:hover .phit { cursor: pointer; }
}
@keyframes gdrop {
  0% { opacity: 0; translate: 0 0; }
  12%, 70% { opacity: .9; }
  85%, 100% { opacity: 0; translate: 0 var(--fall, 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .gplant:hover .pc-sway, .gplant:hover .pc-drops path, .gplant:hover .pc-glow path, .gplant:hover .pf-body { animation: none !important; }
  .gplant .pc-lean { transition: none; transform: none; }
}

/* Los paneles de Hoy, más abajo: el huerto se ve entero */
.hoy-grid { margin-top: var(--s3); }
@media (min-width: 1024px) { .hoy-grid { margin-top: 36px !important; } .hoy-side { padding-top: 0 !important; } }
