/* =========================================================
   nutricion.party — Liquid Glass
   Personalización: --accent, --font-size y [data-theme] en <html>
   ========================================================= */
:root {
  --accent: #10b981;
  --font-size: 16px;
  --accent-text: #fff;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);

  /* Claro */
  --bg-base: #eef3f1;
  --text: #15201c;
  --muted: #5b6863;
  --glass-tint: rgba(255, 255, 255, .52);
  --glass: color-mix(in srgb, var(--accent) 5%, var(--glass-tint));
  --glass-strong: color-mix(in srgb, var(--accent) 4%, rgba(255, 255, 255, .78));
  --glass-solid: color-mix(in srgb, var(--accent) 4%, #f8fbfa);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-edge-2: rgba(255, 255, 255, .18);
  --hairline: rgba(20, 40, 32, .09);
  --field: rgba(255, 255, 255, .6);
  --soft: rgba(255, 255, 255, .45);
  --shadow: 0 1px 1px rgba(16, 32, 26, .04), 0 10px 30px -6px rgba(16, 40, 30, .14), 0 30px 60px -20px rgba(16, 40, 30, .18);
  --shadow-sm: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 12px -2px rgba(16, 40, 30, .1);
  --spec: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .35);
  --blur: blur(28px) saturate(180%);
  --blob-1: #6ee7b7; --blob-2: #fcd34d; --blob-3: #f9a8d4; --blob-4: #93c5fd;
  --blob-op: .62;

  --t-desayuno: #f59e0b;
  --t-merienda: #ec4899;
  --t-almuerzo: #10b981;
  --t-cena: #6366f1;
  --t-otro: #64748b;
  --danger: #e11d48;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-base: #070b0a;
  --text: #ecf3f0;
  --muted: #9aa8a2;
  --glass-tint: rgba(26, 32, 30, .5);
  --glass: color-mix(in srgb, var(--accent) 7%, var(--glass-tint));
  --glass-strong: color-mix(in srgb, var(--accent) 6%, rgba(22, 28, 26, .82));
  --glass-solid: color-mix(in srgb, var(--accent) 6%, #141a18);
  --glass-edge: rgba(255, 255, 255, .16);
  --glass-edge-2: rgba(255, 255, 255, .04);
  --hairline: rgba(255, 255, 255, .08);
  --field: rgba(255, 255, 255, .06);
  --soft: rgba(255, 255, 255, .06);
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 14px 40px -8px rgba(0, 0, 0, .55), 0 40px 80px -30px rgba(0, 0, 0, .6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px -4px rgba(0, 0, 0, .45);
  --spec: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .03), inset 0 0 0 1px rgba(255, 255, 255, .05);
  --blob-1: #047857; --blob-2: #a16207; --blob-3: #9d174d; --blob-4: #1d4ed8;
  --blob-op: .5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--font-size); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg-base);
  font-family: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.45; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  letter-spacing: -.006em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- Fondo animado ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(100% 70% at 100% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
  var(--bg-base); }
.blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: var(--blob-op); mix-blend-mode: normal; will-change: transform; }
.b1 { background: radial-gradient(circle at 30% 30%, var(--blob-1), transparent 65%); top: -14vmax; left: -10vmax; animation: float1 26s var(--ease) infinite alternate; }
.b2 { background: radial-gradient(circle at 50% 50%, var(--blob-2), transparent 65%); top: 10vmax; right: -14vmax; animation: float2 32s var(--ease) infinite alternate; }
.b3 { background: radial-gradient(circle at 50% 50%, var(--blob-3), transparent 65%); bottom: -18vmax; left: 18vmax; animation: float3 29s var(--ease) infinite alternate; }
.b4 { background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 60%, var(--blob-4)), transparent 65%); top: 30vmax; left: -12vmax; width: 36vmax; height: 36vmax; animation: float2 36s var(--ease) infinite alternate-reverse; }
.grain { position: absolute; inset: 0; opacity: .035; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes float1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes float2 { to { transform: translate(-16vmax, 14vmax) scale(.9); } }
@keyframes float3 { to { transform: translate(-10vmax, -16vmax) scale(1.2); } }

/* ---------- Vidrio ---------- */
.glass, .glass-strong {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), var(--spec);
}
.glass-strong { background: var(--glass-strong); }
/* Brillo especular sutil en el borde superior */
.glass::before, .glass-strong::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .08) 22%, transparent 45%, transparent 80%, var(--glass-edge-2) 100%);
  mix-blend-mode: soft-light; opacity: .9;
}
:root[data-theme="dark"] .glass::before, :root[data-theme="dark"] .glass-strong::before { opacity: .45; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-strong { background: var(--glass-solid); }
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: max(.8rem, env(safe-area-inset-top)) 1.1rem .9rem; padding: .55rem .6rem .55rem 1rem; border-radius: 20px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.logo { width: 2.15rem; height: 2.15rem; display: block; flex: none; filter: drop-shadow(0 4px 10px rgba(16, 80, 50, .22)); transition: transform .4s var(--spring); }
.brand:hover .logo { transform: rotate(-6deg) scale(1.06); }
.brand h1 { font-size: 1.22rem; margin: 0; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: .45rem; align-items: center; }

/* Botones */
.btn { position: relative; border: 1px solid transparent; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; font-weight: 650; font-size: .88rem; transition: transform .25s var(--spring), filter .2s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.96); }
.btn.sm { padding: .32rem .75rem; font-size: .8rem; }
.btn.primary {
  color: var(--accent-text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 88%, #000) 100%);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,0,0,.08);
}
.btn.primary:hover { filter: brightness(1.06) saturate(1.05); }
.btn.primary:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--soft); border-color: var(--glass-edge); box-shadow: var(--spec); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 10%, var(--soft)); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.icon-btn {
  border: 1px solid var(--glass-edge); background: var(--soft); border-radius: 50%; width: 2.35rem; height: 2.35rem;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 1.05rem; line-height: 1; box-shadow: var(--spec);
  transition: transform .25s var(--spring), background .2s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--accent) 12%, var(--soft)); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 1.95rem; height: 1.95rem; font-size: .85rem; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 80%, #fff); outline-offset: 2px; }

/* Menú de calendarios (escritorio) */
.views { position: relative; display: flex; gap: .2rem; padding: .25rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 3px rgba(0,0,0,.06); }
.views-glider, .seg-glider, .tabs-glider, .tabbar-glider {
  position: absolute; top: .25rem; bottom: .25rem; left: 0; width: 0; border-radius: 999px; z-index: 0; pointer-events: none;
  background: var(--glass-strong); box-shadow: var(--shadow-sm), var(--spec);
  transform: translateX(var(--gx, 0)); width: var(--gw, 0); transition: transform .45s var(--spring), width .45s var(--spring); opacity: 0;
}
.views-glider.on, .seg-glider.on, .tabs-glider.on, .tabbar-glider.on { opacity: 1; }
.view-btn { position: relative; z-index: 1; display: flex; align-items: center; gap: .45rem; border: none; background: transparent; padding: .32rem .85rem .32rem .35rem; border-radius: 999px; cursor: pointer; font-weight: 650; font-size: .86rem; color: var(--muted); transition: color .2s; }
.view-btn:hover, .view-btn[aria-current="true"] { color: var(--text); }
.avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 750; font-size: .78rem; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--pc, var(--muted)) 75%, #fff), var(--pc, var(--muted)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 6px -1px color-mix(in srgb, var(--pc, #000) 50%, transparent);
}
.avatar.common { background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.5)); font-size: .85rem; box-shadow: var(--spec); }
:root[data-theme="dark"] .avatar.common { background: rgba(255,255,255,.12); }
.me-menu { position: relative; display: none; }
.me-btn { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--glass-edge); background: var(--soft); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; cursor: pointer; font-weight: 650; font-size: .85rem; box-shadow: var(--spec); }
.me-name { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 12rem; border-radius: 18px; padding: .35rem; z-index: 60; background: var(--glass-strong); animation: pop .25s var(--spring); }
.menu button { width: 100%; display: flex; align-items: center; gap: .55rem; border: none; background: transparent; padding: .55rem .6rem; border-radius: 12px; cursor: pointer; font-weight: 600; text-align: left; }
.menu button:hover, .menu button[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.menu .check { margin-left: auto; color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ---------- Layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 1rem; padding: 0 1.1rem 1.1rem; align-items: start; }
.layout.chat-collapsed { grid-template-columns: minmax(0, 1fr) 280px; }
.card { border-radius: var(--radius); }

/* ---------- Calendario ---------- */
.calendar-card { padding: 1.1rem; min-width: 0; animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.99); } }
.cal-toolbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.cal-nav { display: flex; gap: .35rem; align-items: center; }
.month-wrap { flex: 1; text-align: center; min-width: 0; }
.month-label { margin: 0; font-size: 1.45rem; font-weight: 750; letter-spacing: -.03em; }
.cal-name { color: var(--muted); font-size: .78rem; font-weight: 650; display: inline-flex; align-items: center; gap: .35rem; }
.cal-name i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--pc, var(--accent)); display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--accent)) 22%, transparent); }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .2rem .5rem .45rem; font-weight: 700; }
.grid { gap: 6px; }
.grid.anim { animation: gridIn .4s var(--ease); }
@keyframes gridIn { from { opacity: .3; transform: translateX(var(--dir, 0)); } }
.day {
  min-height: 7.4rem; border-radius: 16px; padding: .4rem; cursor: pointer; display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 0; overflow: hidden;
  background: var(--soft); border: 1px solid var(--glass-edge-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .3s var(--spring), background .2s, box-shadow .25s, border-color .2s;
}
:root[data-theme="dark"] .day { border-color: rgba(255,255,255,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.day:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 7%, var(--glass-strong)); box-shadow: var(--shadow-sm), var(--spec); }
.day:active { transform: scale(.98); }
.day.other { opacity: .45; }
.day.today { background: color-mix(in srgb, var(--accent) 14%, var(--soft)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.day.selected { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -2px; }
.day .num { font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding: 0 .1rem .1rem; }
.day .num b { font-weight: 700; min-width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; border-radius: 999px; }
.day.today .num b { background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--accent) 80%, transparent); }
.pill {
  font-size: .72rem; line-height: 1.25; padding: 3px 6px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--t-otro)) 15%, var(--glass-strong)); border-left: 3px solid var(--c, var(--t-otro));
  animation: pillIn .35s var(--ease) both;
}
@keyframes pillIn { from { opacity: 0; transform: translateY(3px); } }
.pill time { font-weight: 750; margin-right: 3px; font-variant-numeric: tabular-nums; opacity: .8; }
[data-type="desayuno"] { --c: var(--t-desayuno); }
[data-type="merienda"] { --c: var(--t-merienda); }
[data-type="almuerzo"] { --c: var(--t-almuerzo); }
[data-type="cena"] { --c: var(--t-cena); }
[data-type="otro"] { --c: var(--t-otro); }
.dots { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: auto; padding-bottom: 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--t-otro)); }
.more { font-size: .7rem; color: var(--muted); padding-left: 4px; font-weight: 600; }
.status { color: var(--muted); font-size: .78rem; min-height: 1.1em; margin: .6rem 0 0; }

/* Lista del día (móvil) */
.day-panel { margin-top: .9rem; }
.day-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.day-panel-head h3 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; text-transform: capitalize; }

/* ---------- Panel de chat ---------- */
.chat-card { display: flex; flex-direction: column; height: calc(100dvh - 6.6rem); position: sticky; top: 1rem; overflow: hidden; animation: rise .7s .08s var(--ease) both; }
.chat-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .65rem; border-bottom: 1px solid var(--hairline); }
.tabs { position: relative; display: flex; gap: .15rem; padding: .25rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--glass-edge); }
.tab { position: relative; z-index: 1; border: none; background: transparent; padding: .38rem .8rem; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .84rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; transition: color .2s; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); }
.chat-actions { display: flex; gap: .3rem; }
.badge { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; border-radius: 999px; font-size: .66rem; padding: 0 .38rem; min-width: 1.1rem; text-align: center; line-height: 1.1rem; font-weight: 750; box-shadow: 0 2px 6px -1px rgba(225,29,72,.6); }
.chat-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pane[hidden] { display: none !important; }
.pane.enter { animation: paneIn .35s var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } }
.chat-card.collapsed { height: auto; }
.chat-card.collapsed .chat-body { display: none !important; }
.pane-sub { font-size: .76rem; color: var(--muted); padding: .55rem .9rem; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.pane-sub b { color: var(--text); }
.bot-avatar { width: 1.6rem; height: 1.6rem; display: inline-block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.messages { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; overscroll-behavior: contain; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 10px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 10px), transparent 100%); }
.msg { max-width: 86%; padding: .6rem .85rem; border-radius: 20px; font-size: .9rem; white-space: pre-wrap; word-wrap: break-word; animation: bubble .35s var(--spring) both; }
@keyframes bubble { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.msg.user { align-self: flex-end; color: var(--accent-text); border-bottom-right-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.msg.assistant { align-self: flex-start; background: var(--glass-strong); border: 1px solid var(--glass-edge); border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm), var(--spec); }
.msg .speak { border: none; background: none; cursor: pointer; font-size: .8rem; opacity: .55; padding: 0 0 0 .3rem; vertical-align: middle; }
.msg .speak:hover { opacity: 1; }
.msg.error { align-self: center; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: .8rem; border-radius: 999px; padding: .3rem .8rem; }
.typing { display: inline-flex; gap: 4px; padding: .75rem .9rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.proposal { align-self: stretch; border-radius: 18px; padding: .7rem .8rem; font-size: .82rem; background: color-mix(in srgb, var(--accent) 10%, var(--glass-strong)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--glass-edge)); box-shadow: var(--shadow-sm), var(--spec); animation: bubble .4s var(--spring) both; }
.proposal h4 { margin: 0 0 .45rem; font-size: .85rem; }
.proposal ul { list-style: none; margin: 0 0 .6rem; padding: 0; max-height: 15rem; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.proposal li { display: flex; gap: .45rem; align-items: baseline; padding: .15rem .1rem; border-left: 3px solid var(--c, var(--t-otro)); padding-left: .45rem; }
.proposal li .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 7.2rem; font-weight: 600; }
.proposal .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.proposal.done { opacity: .7; }
.suggestions { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .9rem .6rem; }
.chip { border: 1px solid var(--glass-edge); background: var(--soft); border-radius: 999px; padding: .32rem .7rem; font-size: .77rem; cursor: pointer; box-shadow: var(--spec); transition: transform .25s var(--spring), background .2s; }
.chip:hover { background: color-mix(in srgb, var(--accent) 14%, var(--soft)); transform: translateY(-1px); }
.composer { display: flex; gap: .45rem; padding: .65rem; border-top: 1px solid var(--hairline); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--glass-edge); border-radius: 22px; padding: .6rem .9rem; background: var(--field); max-height: 8rem; font-size: .92rem; line-height: 1.35; box-shadow: inset 0 1px 2px rgba(0,0,0,.05); transition: border-color .2s, box-shadow .2s; }
.composer textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.mic-btn, .send-btn { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--glass-edge); background: var(--soft); color: var(--text); box-shadow: var(--spec); transition: transform .25s var(--spring), background .2s; touch-action: none; user-select: none; -webkit-user-select: none; }
.mic-btn:active, .send-btn:active { transform: scale(.9); }
.send-btn, .mic-btn.accent { border: none; color: var(--accent-text); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.4); }
.send-btn[hidden], .mic-btn[hidden] { display: none; }
.mic-btn.recording { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; animation: pulse 1.3s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225,29,72,.45); } 70% { box-shadow: 0 0 0 12px rgba(225,29,72,0); } 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); } }
.mic-btn.busy { opacity: .6; pointer-events: none; }

/* Grabación */
.rec-bar { display: flex; align-items: center; gap: .55rem; padding: .65rem; border-top: 1px solid var(--hairline); animation: paneIn .25s var(--ease); }
.rec-bar[hidden] { display: none; }
.rec-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #e11d48; animation: recblink 1s infinite; flex: none; }
@keyframes recblink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.6rem; }
.rec-wave { display: flex; align-items: center; gap: 3px; flex: 1; height: 1.6rem; overflow: hidden; }
.rec-wave i { width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 70%, var(--muted)); height: 20%; transition: height .12s; }
.rec-hint { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* Mensajes entre perfiles */
.me-switch { display: inline-flex; gap: .25rem; }
.me-switch button { border: 1px solid var(--glass-edge); background: var(--soft); border-radius: 999px; padding: .12rem .6rem .12rem .15rem; font-size: .75rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; font-weight: 650; transition: background .2s; }
.me-switch button .avatar { width: 1.3rem; height: 1.3rem; font-size: .62rem; }
.me-switch button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--pc) 70%, transparent); background: color-mix(in srgb, var(--pc) 16%, var(--glass-strong)); }
.pmsg { display: flex; gap: .45rem; align-items: flex-end; max-width: 90%; animation: bubble .35s var(--spring) both; }
.pmsg .avatar { width: 1.65rem; height: 1.65rem; font-size: .68rem; }
.pmsg .bubble { position: relative; background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 20px; border-bottom-left-radius: 6px; padding: .45rem .75rem .35rem; font-size: .9rem; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow-sm), var(--spec); min-width: 0; }
.pmsg .meta { display: flex; gap: .4rem; justify-content: space-between; font-size: .66rem; color: var(--muted); margin-bottom: 1px; font-weight: 650; }
.pmsg .meta .who { color: color-mix(in srgb, var(--pc) 75%, var(--text)); }
.pmsg.mine { align-self: flex-end; flex-direction: row-reverse; }
.pmsg.mine .bubble { background: color-mix(in srgb, var(--pc, var(--accent)) 22%, var(--glass-strong)); border-color: color-mix(in srgb, var(--pc) 30%, var(--glass-edge)); border-bottom-left-radius: 20px; border-bottom-right-radius: 6px; }
.pmsg .del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: .72rem; opacity: 0; transition: opacity .2s; align-self: center; padding: .3rem; }
.pmsg:hover .del, .pmsg:focus-within .del { opacity: 1; }
@media (hover: none) { .pmsg .del { opacity: .5; } }
.day-sep { align-self: center; font-size: .68rem; color: var(--muted); background: var(--soft); border: 1px solid var(--glass-edge); border-radius: 999px; padding: .12rem .7rem; font-weight: 650; text-transform: capitalize; }
.empty-note { color: var(--muted); font-size: .86rem; text-align: center; margin: auto; padding: 1rem; }

/* Nota de voz */
.voice { display: flex; align-items: center; gap: .55rem; min-width: 13.5rem; padding: .15rem 0 .1rem; }
.voice .play { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc, var(--accent)) 75%, #fff), var(--pc, var(--accent))); box-shadow: 0 4px 10px -4px var(--pc, var(--accent)), inset 0 1px 0 rgba(255,255,255,.4); transition: transform .25s var(--spring); }
.voice .play:active { transform: scale(.9); }
.voice .track { flex: 1; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.voice .bars { position: relative; height: 1.5rem; display: flex; align-items: center; gap: 2px; cursor: pointer; touch-action: none; }
.voice .bars i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); min-height: 3px; }
.voice .bars i.on { background: var(--pc, var(--accent)); }
.voice .vtime { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Modales ---------- */
.modal { border: 1px solid var(--glass-edge); border-radius: 26px; padding: 0; width: min(560px, calc(100vw - 1.5rem)); color: var(--text); max-height: calc(100dvh - 2rem); }
.modal[open] { animation: modalIn .4s var(--spring); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.modal.small { width: min(430px, calc(100vw - 1.5rem)); }
.modal::backdrop { background: rgba(8, 14, 12, .3); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); }
.modal-inner { position: relative; z-index: 1; padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; text-transform: capitalize; }
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.day-list li { display: flex; gap: .65rem; align-items: center; padding: .6rem .7rem; border-radius: 16px; background: var(--soft); border: 1px solid var(--glass-edge); box-shadow: var(--spec); animation: bubble .3s var(--ease) both; }
.day-list li.empty { color: var(--muted); justify-content: center; border-style: dashed; font-size: .88rem; box-shadow: none; }
.day-list .dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--c, var(--t-otro)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--t-otro)) 22%, transparent); }
.day-list .tm { font-variant-numeric: tabular-nums; font-weight: 750; font-size: .85rem; min-width: 2.8rem; }
.day-list .info { flex: 1; min-width: 0; }
.day-list .info strong { display: block; font-size: .92rem; font-weight: 650; }
.day-list .info small { color: var(--muted); font-size: .76rem; white-space: pre-wrap; display: block; }
.day-list .acts { display: flex; gap: .3rem; }
.entry-fields { border: 1px solid var(--glass-edge); border-radius: 18px; padding: .75rem .85rem .85rem; margin: 0; display: flex; flex-direction: column; gap: .65rem; background: var(--soft); }
.entry-fields legend { font-weight: 750; font-size: .85rem; padding: 0 .35rem; }
.row { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: .5rem; }
label { display: flex; flex-direction: column; gap: .28rem; font-size: .78rem; color: var(--muted); font-weight: 650; }
input[type="text"], input[type="date"], input[type="time"], select, textarea {
  border: 1px solid var(--glass-edge); border-radius: 12px; padding: .55rem .7rem; background: var(--field); color: var(--text); font-weight: 450; font-size: .92rem; width: 100%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, .entry-fields textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.form-error { color: var(--danger); font-size: .8rem; margin: 0; min-height: 1em; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.setting { display: flex; flex-direction: column; gap: .45rem; font-size: .78rem; color: var(--muted); font-weight: 650; }
.profile-edit { display: flex; gap: .5rem; align-items: center; }
.profile-edit input[type="text"] { flex: 1; }
.hint { font-weight: 450; font-size: .72rem; }
.swatches { display: flex; gap: .45rem; flex-wrap: wrap; }
.swatch { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); outline: 1px solid var(--hairline); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 3px 8px -3px rgba(0,0,0,.3); transition: transform .25s var(--spring); }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
input[type="color"] { width: 3rem; height: 2.1rem; border: 1px solid var(--glass-edge); border-radius: 10px; background: var(--field); padding: 3px; cursor: pointer; }
.segmented { display: flex; gap: .4rem; }
.segmented label { flex-direction: row; align-items: center; gap: .35rem; border: 1px solid var(--glass-edge); border-radius: 999px; padding: .42rem .85rem; cursor: pointer; color: var(--text); font-weight: 600; background: var(--soft); }
.segmented label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--soft)); }
.segmented input { accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }
output { color: var(--text); font-weight: 550; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: .6rem 1.1rem; border-radius: 999px; font-size: .86rem; font-weight: 600; z-index: 100; background: var(--glass-strong); animation: toastIn .4s var(--spring); }
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Vista sólo chat (ventana emergente) */
:root[data-view="chat"] .topbar, :root[data-view="chat"] .calendar-card, :root[data-view="chat"] #chat-popout, :root[data-view="chat"] #chat-collapse, :root[data-view="chat"] .tabbar { display: none !important; }
:root[data-view="chat"] .layout { grid-template-columns: 1fr; padding: .6rem; }
:root[data-view="chat"] .chat-card { height: calc(100dvh - 1.2rem); position: static; display: flex !important; }
:root[data-view="chat"] .chat-head { display: flex !important; }

.mobile-only, .tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; } .vname { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
@media (max-width: 920px) and (min-width: 768px) { .views .vname { display: none; } .view-btn { padding: .32rem; } }

/* ---------- Móvil: app con barra inferior ---------- */
@media (max-width: 767px) {
  html, body { height: 100%; }
  body { height: 100dvh; overflow: hidden; }
  .topbar { margin: max(.5rem, env(safe-area-inset-top)) max(.6rem, env(safe-area-inset-left)) .5rem max(.6rem, env(safe-area-inset-right)); padding: .4rem .45rem .4rem .8rem; border-radius: 18px; }
  .brand h1 { font-size: 1.08rem; }
  .views { display: none; }
  .me-menu { display: block; }
  .mobile-only { display: block; }
  .layout, .layout.chat-collapsed { display: block; flex: 1; min-height: 0; padding: 0 max(.6rem, env(safe-area-inset-left)) calc(5.1rem + env(safe-area-inset-bottom)) max(.6rem, env(safe-area-inset-right)); position: relative; }
  .screen { display: none !important; }
  body[data-screen="cal"] .calendar-card { display: block !important; }
  body[data-screen="bot"] #pane-bot, body[data-screen="people"] #pane-people { display: flex !important; }
  .calendar-card { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: .8rem .7rem 1rem; -webkit-overflow-scrolling: touch; }
  body[data-screen="cal"] .chat-card { display: none; }
  body:not([data-screen="cal"]) .chat-card { display: flex; height: 100%; position: static; }
  .chat-head { display: none; }
  .chat-card.collapsed .chat-body { display: flex !important; }
  .pane-sub { padding: .6rem .85rem; }
  .composer, .rec-bar { padding: .55rem; }
  .composer textarea { font-size: 16px; } /* evita zoom en iOS */
  input[type="text"], input[type="date"], input[type="time"], select, textarea { font-size: 16px; }
  .mic-btn, .send-btn { width: 2.85rem; height: 2.85rem; }

  .seg { position: relative; display: flex; padding: .25rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--glass-edge); margin-bottom: .75rem; }
  .seg button { position: relative; z-index: 1; flex: 1; border: none; background: transparent; padding: .5rem .5rem; border-radius: 999px; font-weight: 700; font-size: .86rem; color: var(--muted); cursor: pointer; transition: color .2s; }
  .seg button[aria-selected="true"] { color: var(--text); }
  .cal-toolbar { flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
  .month-wrap { order: -1; flex-basis: 100%; text-align: left; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
  .month-label { font-size: 1.3rem; }
  #add-today { display: none; }
  .cal-nav { width: 100%; justify-content: space-between; }
  .cal-nav .icon-btn { width: 2.6rem; height: 2.6rem; }
  .weekdays span { font-size: .62rem; padding: .2rem 0 .35rem; text-align: center; letter-spacing: .04em; }
  .grid { gap: 4px; }
  .day { min-height: 3.3rem; padding: .25rem .1rem; border-radius: 12px; align-items: center; }
  .day:hover { transform: none; }
  .day .num { justify-content: center; padding: 0; font-size: .82rem; }
  .day .num .add-hint { display: none; }
  .pill, .more { display: none; }
  .dots { display: flex; }
  .day-list li { padding: .7rem .75rem; }
  .day-list .acts .icon-btn { width: 2.3rem; height: 2.3rem; }

  .tabbar {
    display: flex; position: fixed; z-index: 40; left: max(.7rem, env(safe-area-inset-left)); right: max(.7rem, env(safe-area-inset-right));
    bottom: max(.6rem, env(safe-area-inset-bottom)); padding: .3rem; border-radius: 26px; gap: .2rem;
  }
  .tabbar button { position: relative; z-index: 1; flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .4rem .2rem .35rem; border-radius: 22px; cursor: pointer; font-size: .68rem; font-weight: 700; color: var(--muted); transition: color .2s; min-height: 3.3rem; justify-content: center; }
  .tabbar button[aria-current="page"] { color: var(--text); }
  .tabbar .ti { position: relative; font-size: 1.3rem; line-height: 1.2; transition: transform .35s var(--spring); }
  .tabbar button[aria-current="page"] .ti { transform: scale(1.12) translateY(-1px); }
  .tabbar-glider { top: .3rem; bottom: .3rem; background: color-mix(in srgb, var(--accent) 16%, var(--glass-strong)); }
  .dot-badge { position: absolute; top: -2px; right: -6px; width: .6rem; height: .6rem; min-width: 0; padding: 0; border: 2px solid var(--glass-strong); }
  body.kb-open .tabbar { display: none; }
  body.kb-open .layout { padding-bottom: .5rem; }
  .row { grid-template-columns: 1fr 1fr; }
  .row label:last-child { grid-column: span 2; }
  .modal { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); overflow-y: auto; }
  .voice { min-width: 11.5rem; }
  .toast { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .blob { animation: none; }
}
#pane-bot .pane-sub { flex-wrap: nowrap; } #pane-bot .pane-sub > span { flex: 1; min-width: 0; }

/* ---------- Cuentas: arranque, login y registro ---------- */
.auth, .boot { display: none; }
body[data-auth="loading"] .boot { display: grid; position: fixed; inset: 0; place-items: center; z-index: 5; }
.boot img { animation: bootPulse 1.4s var(--ease) infinite; filter: drop-shadow(0 10px 24px rgba(16, 80, 50, .25)); }
@keyframes bootPulse { 50% { transform: scale(.92); opacity: .7; } }
body:not([data-auth="in"]) .topbar, body:not([data-auth="in"]) .layout, body:not([data-auth="in"]) .tabbar { display: none !important; }
body[data-auth="out"] { overflow-y: auto; }
body[data-auth="out"] .auth {
  display: grid; place-items: center; min-height: 100vh; min-height: 100dvh;
  padding: max(1.2rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.auth-card { width: min(420px, 100%); border-radius: 30px; padding: 2rem 1.6rem 1.5rem; text-align: center; animation: modalIn .6s var(--spring); }
.auth-card > * { position: relative; z-index: 1; }
.auth-logo { width: 88px; height: 88px; display: block; margin: 0 auto .7rem; filter: drop-shadow(0 12px 24px rgba(16, 80, 50, .25)); animation: floatLogo 6s var(--ease) infinite alternate; }
@keyframes floatLogo { to { transform: translateY(-5px) rotate(-3deg); } }
.auth-title { margin: 0; font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em; }
.auth-sub { margin: .35rem auto 1.2rem; color: var(--muted); font-size: .9rem; max-width: 30ch; }
.auth-seg { position: relative; display: flex; padding: .25rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--glass-edge); margin-bottom: 1rem; }
.auth-seg button { position: relative; z-index: 1; flex: 1; border: none; background: transparent; padding: .55rem .5rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; transition: color .2s; }
.auth-seg button[aria-selected="true"] { color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: .75rem; text-align: left; }
.auth-form input { font-size: 16px; padding: .7rem .85rem; border-radius: 14px; }
.auth-form .reg-only { display: none; }
.auth-form.register .reg-only { display: flex; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: none; background: transparent; cursor: pointer; font-size: 1rem; padding: .35rem; opacity: .6; }
.pw-toggle:hover { opacity: 1; }
.btn.big { padding: .8rem 1rem; font-size: 1rem; margin-top: .2rem; }
.auth-hint { text-align: center; font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.auth-hint a { color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-weight: 700; text-decoration: none; }
.auth-form .form-error:empty { display: none; }
input[type="email"], input[type="password"] {
  border: 1px solid var(--glass-edge); border-radius: 12px; padding: .55rem .7rem; background: var(--field); color: var(--text); font-weight: 450; font-size: .92rem; width: 100%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05); transition: border-color .2s, box-shadow .2s;
}

/* Menú de cuenta (escritorio y móvil) */
.me-menu { display: block; }
.menu .menu-head { padding: .5rem .6rem .6rem; border-bottom: 1px solid var(--hairline); margin-bottom: .3rem; display: flex; gap: .55rem; align-items: center; }
.menu .menu-head b { display: block; font-size: .9rem; }
.menu .menu-head small { color: var(--muted); font-size: .75rem; word-break: break-all; }
.menu .danger-item { color: var(--danger); }
.people-list { display: inline-flex; margin-left: auto; }
.people-list .avatar { width: 1.35rem; height: 1.35rem; font-size: .6rem; margin-left: -.35rem; border: 2px solid var(--glass-strong); }
.pw-change summary { cursor: pointer; color: var(--text); font-weight: 650; }
.pw-change[open] { gap: .45rem; }
.pw-change > * + * { margin-top: .45rem; }
.pw-change .form-error.ok { color: color-mix(in srgb, var(--accent) 80%, var(--text)); }
.spacer { flex: 1; }
.day-list .by { font-size: .7rem; color: var(--muted); }
@media (max-width: 767px) { .me-name { max-width: 5.5rem; } .auth-card { padding: 1.6rem 1.2rem 1.3rem; border-radius: 26px; } }

/* ---------- Nutri: complejidad, recetas y memoria ---------- */
.cx-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-bottom: 1px solid var(--hairline); }
.cx-label { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cx-seg { position: relative; display: flex; flex: 1; padding: .2rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--glass-edge); }
.cx-seg .seg-glider { top: .2rem; bottom: .2rem; }
.cx-seg button { position: relative; z-index: 1; flex: 1; border: none; background: transparent; padding: .3rem .35rem; border-radius: 999px; font-weight: 700; font-size: .74rem; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .2s; }
.cx-seg button[aria-checked="true"] { color: var(--text); }
.rmeta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.rmeta span { font-size: .68rem; font-weight: 650; color: var(--muted); background: var(--soft); border: 1px solid var(--glass-edge); border-radius: 999px; padding: .05rem .45rem; white-space: nowrap; }
.rmeta .kcal { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
details.recipe { margin-top: .3rem; font-size: .8rem; }
details.recipe summary { cursor: pointer; font-weight: 700; color: color-mix(in srgb, var(--accent) 70%, var(--text)); font-size: .76rem; list-style: none; display: inline-flex; align-items: center; gap: .25rem; }
details.recipe summary::-webkit-details-marker { display: none; }
details.recipe summary::before { content: "▸"; transition: transform .2s; display: inline-block; }
details.recipe[open] summary::before { transform: rotate(90deg); }
.recipe-body { margin-top: .4rem; padding: .55rem .65rem; border-radius: 12px; background: var(--soft); border: 1px solid var(--glass-edge); animation: paneIn .25s var(--ease); }
.recipe-body h5 { margin: .2rem 0 .3rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.recipe-body h5:not(:first-child) { margin-top: .6rem; }
.recipe-body ul.ing { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.recipe-body ul.ing li { display: flex; gap: .5rem; justify-content: space-between; border: none; padding: .1rem 0; background: none; box-shadow: none; animation: none; border-bottom: 1px dashed var(--hairline); border-radius: 0; }
.recipe-body ul.ing .q { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; text-align: right; }
.recipe-body ul.ing .q small { display: block; font-weight: 500; color: var(--muted); font-size: .7rem; }
.recipe-body ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.macros div { text-align: center; background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 10px; padding: .3rem .2rem; }
.macros b { display: block; font-size: .9rem; font-variant-numeric: tabular-nums; }
.macros small { font-size: .62rem; color: var(--muted); font-weight: 650; }
.estimate { font-size: .66rem; color: var(--muted); margin: .3rem 0 0; }
.proposal li { flex-direction: column; align-items: stretch; gap: .1rem; }
.proposal li .prow { display: flex; gap: .45rem; align-items: baseline; }
.day-list li { align-items: flex-start; }
.day-list li .dot, .day-list li .tm { margin-top: .2rem; }
.memory summary { cursor: pointer; color: var(--text); font-weight: 700; font-size: .85rem; }
.memory[open] > * + * { margin-top: .55rem; }
.mem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mem-grid label { font-size: .72rem; }
.mem-grid label.wide { grid-column: span 2; }
.mem-grid label.allergy { color: var(--danger); }
.mem-grid textarea, .mem-grid input { font-size: .82rem; padding: .4rem .55rem; min-height: 2.2rem; }
.mem-actions { display: flex; gap: .5rem; align-items: center; }
.form-error.ok { color: color-mix(in srgb, var(--accent) 80%, var(--text)); }
@media (max-width: 767px) { .mem-grid { grid-template-columns: 1fr; } .mem-grid label.wide { grid-column: auto; } .cx-seg button { font-size: .72rem; padding: .38rem .2rem; } }
/* filas de ingredientes: nombre a la izquierda, cantidad a la derecha (también dentro de la propuesta) */
.proposal .recipe-body ul.ing li, .recipe-body ul.ing li { flex-direction: row; flex-wrap: nowrap; align-items: baseline; }
.recipe-body ul.ing li > span:first-child { min-width: 0; flex: 1 1 auto; }
