/* ==========================================================================
   ReceTica · Cocina Viva
   Sistema de diseño único: tokens, base, layout, componentes y motion.
   Fuentes: Bricolage Grotesque (títulos) + DM Sans (texto).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #F3F1EC;
  --surface: #FFFFFF;
  --surface-2: #F3F1EC;
  --surface-3: #ECE8E0;
  --ink: #232B33;
  --ink-2: #3A434D;
  --muted: #5E646B;
  --faint: #8A8F94;
  --line: #ECE8E0;
  --line-strong: #D8D3C8;

  --orange: #F04E1C;
  --orange-ink: #15191D;
  --orange-deep: #C93D11;
  --orange-urgent: #9A2E0B;
  --orange-soft: #FDE4DA;
  --orange-light: #FF6A3D;

  --olive: #82822E;
  --olive-soft: #EEEED6;
  --olive-ink: #3F3F12;
  --lime: #C9C95E;

  --dark: #232B33;
  --dark-2: #313A44;
  --dark-3: #3A434D;
  --on-dark: #FFFFFF;
  --on-dark-muted: #C9C3B8;

  --danger: #B42318;
  --danger-soft: #FDE7E4;
  --focus: #F04E1C;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --gap: 16px;
  --page-max: 1320px;
  --page-pad: clamp(12px, 2.4vw, 32px);
  --header-h: 66px;
  --tabbar-h: 68px;

  --shadow-float: 0 30px 60px -30px rgba(35, 43, 51, .45);
  --shadow-pop: 0 18px 40px -18px rgba(35, 43, 51, .35);
  --shadow-ring: inset 0 0 0 1.5px var(--line);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.2, .9, .3, 1.4);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --t-fast: .18s;
  --t: .35s;
  --t-slow: .6s;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111417;
  --surface: #1B2026;
  --surface-2: #232A31;
  --surface-3: #2B333B;
  --ink: #F3F1EC;
  --ink-2: #D9D4CB;
  --muted: #A9AFB5;
  --faint: #7D848B;
  --line: #2B333B;
  --line-strong: #3A434D;

  --orange-deep: #FF8A5C;
  --orange-urgent: #FFA27E;
  --orange-soft: #3A2117;

  --olive: #A8A845;
  --olive-soft: #2A2B18;
  --olive-ink: #E1E1A8;

  --dark: #0B0E10;
  --dark-2: #20262C;
  --dark-3: #2B333B;

  --danger: #FF7B6E;
  --danger-soft: #3B1D1A;

  --shadow-float: 0 30px 60px -30px rgba(0, 0, 0, .8);
  --shadow-pop: 0 18px 40px -18px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #111417;
    --surface: #1B2026;
    --surface-2: #232A31;
    --surface-3: #2B333B;
    --ink: #F3F1EC;
    --ink-2: #D9D4CB;
    --muted: #A9AFB5;
    --faint: #7D848B;
    --line: #2B333B;
    --line-strong: #3A434D;
    --orange-deep: #FF8A5C;
    --orange-urgent: #FFA27E;
    --orange-soft: #3A2117;
    --olive: #A8A845;
    --olive-soft: #2A2B18;
    --olive-ink: #E1E1A8;
    --dark: #0B0E10;
    --dark-2: #20262C;
    --dark-3: #2B333B;
    --danger: #FF7B6E;
    --danger-soft: #3B1D1A;
    --shadow-float: 0 30px 60px -30px rgba(0, 0, 0, .8);
    --shadow-pop: 0 18px 40px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--orange-deep); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
ul, ol { margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: var(--orange); color: var(--orange-ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 24px; height: 24px; }
.i--fill { fill: currentColor; stroke: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* ---------- Tipografía ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .9;
  font-size: clamp(40px, 5vw, 72px);
}
.display--xl { font-size: clamp(52px, 8vw, 124px); letter-spacing: -.05em; line-height: .86; }
.display--md { font-size: clamp(32px, 4vw, 48px); }
.display .soft, .soft-ink { color: var(--faint); }
.dot { color: var(--orange); }
.h2 { font-size: clamp(26px, 3vw, 32px); }
.h3 { font-size: 22px; letter-spacing: -.02em; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--orange-deep);
  line-height: 1.2;
}
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.num { font-family: var(--font-display); font-weight: 800; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.text-balance { text-wrap: balance; }

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: calc(var(--page-max) + var(--page-pad) * 2);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
.stack { display: flex; flex-direction: column; gap: var(--stack, 16px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, 10px); }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.spread--end { align-items: flex-end; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--min, 240px), 1fr)); gap: var(--gap); }
.section { padding: 8px 0 0; }
.section + .section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.link-strong { font-weight: 700; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }

/* ---------- Header de la app ---------- */
.app-body { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .app-body { padding-bottom: 56px; } }

.app-header-wrap {
  position: sticky; top: 0; z-index: 50;
  padding-top: 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.app-header {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--header-h);
  transition: box-shadow var(--t) var(--ease);
}
.is-scrolled .app-header { box-shadow: var(--shadow-pop); }
.brand-link { display: flex; align-items: center; gap: 8px; padding: 0 6px; text-decoration: none; flex-shrink: 0; }
.brand-link img { width: 40px; height: 40px; object-fit: contain; }
.brand-link .wordmark { width: 104px; height: auto; }
:root[data-theme="dark"] .brand-link .wordmark-light { display: none; }
.brand-link .wordmark-dark { display: none; }
:root[data-theme="dark"] .brand-link .wordmark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-link .wordmark-light { display: none; }
  :root:not([data-theme="light"]) .brand-link .wordmark-dark { display: block; }
}

.app-tabs { display: none; gap: 4px; flex: 1 1 auto; }
@media (min-width: 900px) { .app-tabs { display: flex; } }
.app-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 14px;
  border-radius: var(--r-sm);
  font-weight: 700; font-size: 15px;
  text-decoration: none; color: var(--ink);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.app-tab:hover { background: var(--surface-2); color: var(--ink); }
.app-tab[aria-current="page"] { background: var(--dark); color: var(--on-dark); }
:root[data-theme="dark"] .app-tab[aria-current="page"] { background: var(--ink); color: var(--bg); }
.app-tab .badge-dot { position: absolute; top: 9px; right: 8px; }
@media (min-width: 900px) and (max-width: 1180px) {
  .app-tab span.lbl { display: none; }
  .app-tab { padding: 0 13px; }
}

.app-search {
  position: relative;
  flex: 1 1 200px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
}
.app-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.app-search:focus-within { box-shadow: 0 0 0 2px var(--orange); }
@media (min-width: 900px) { .app-search { flex: 0 1 300px; } }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  z-index: 60;
  max-height: min(70vh, 460px); overflow: auto;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--surface-2); }
.search-results img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.search-results .empty { padding: 12px; color: var(--muted); font-size: 14px; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.avatar-btn {
  width: 46px; height: 46px; border-radius: var(--r-sm); border: 0;
  background: var(--olive); color: #fff;
  font-weight: 800; font-size: 17px;
  display: grid; place-items: center; overflow: hidden; padding: 0;
  text-decoration: none;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* Menú desplegable */
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  min-width: 240px;
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  transform-origin: top right;
  animation: menuIn var(--t-fast) var(--ease);
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; background: transparent; border-radius: 12px;
  font-weight: 600; text-align: left; text-decoration: none; color: var(--ink);
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); color: var(--ink); }
.menu-panel .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-panel .menu-head { padding: 8px 12px 10px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* Barra inferior móvil */
.tabbar {
  position: fixed; z-index: 55;
  left: 10px; right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--tabbar-h);
  background: var(--dark);
  border-radius: 24px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 6px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .55);
}
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%;
  border-radius: 18px;
  color: var(--on-dark-muted);
  font-size: 11px; font-weight: 700;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.tabbar a[aria-current="page"] { color: var(--on-dark); background: var(--dark-2); }
.tabbar a[aria-current="page"] .i { color: var(--orange); }
.tabbar .tab-add {
  width: 54px; height: 54px; margin: 0 auto;
  border-radius: 18px;
  background: var(--orange); color: var(--orange-ink);
}
.tabbar .tab-add .i { width: 26px; height: 26px; stroke-width: 2.6; color: var(--orange-ink) !important; }
.tabbar .tab-add:active { transform: scale(.94); }

.badge-dot {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--orange); color: var(--orange-ink);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 22px 4px 18px; }
.page-head .display { max-width: 18ch; }
.back-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); text-decoration: none;
}

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 0; border-radius: var(--r-md);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 15px; line-height: 1.1;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), opacity var(--t-fast);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn--primary { --btn-bg: var(--orange); --btn-fg: var(--orange-ink); font-weight: 800; }
.btn--primary:hover { --btn-bg: #FF5E2B; }
.btn--dark { --btn-bg: var(--dark); --btn-fg: var(--on-dark); }
:root[data-theme="dark"] .btn--dark { --btn-bg: var(--ink); --btn-fg: var(--bg); }
.btn--white { --btn-bg: #FFFFFF; --btn-fg: #232B33; }
.btn--ghost { --btn-bg: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn--danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); }
.btn--olive { --btn-bg: var(--olive-soft); --btn-fg: var(--olive-ink); }
.btn--lg { min-height: 56px; padding: 0 24px; font-size: 16px; border-radius: var(--r-md); }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn .i { width: 18px; height: 18px; }
.btn.is-loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; flex-shrink: 0;
  border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink);
  text-decoration: none; position: relative;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-3); }
.icon-btn:active { transform: scale(.94); }
.icon-btn--sm { width: 38px; height: 38px; border-radius: 12px; }
.icon-btn--ghost { background: transparent; }
.icon-btn--dark { background: var(--dark-2); color: var(--on-dark); }
.icon-btn .badge-dot { position: absolute; top: -4px; right: -4px; }

/* Favorito */
.fav-btn[aria-pressed="true"] .i { fill: var(--orange-deep); stroke: var(--orange-deep); animation: favPop .45s var(--ease-pop); }
.fav-btn .i { stroke: var(--orange-deep); }
@keyframes favPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Tiles (bento) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-auto-flow: dense;
  gap: var(--gap);
}
.tile {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
a.tile, .tile--hover { text-decoration: none; color: inherit; }
a.tile:hover, .tile--hover:hover { transform: translateY(-4px); color: inherit; }
.tile--dark { background: var(--dark); color: var(--on-dark); }
.tile--dark .eyebrow { color: var(--lime); }
.tile--dark .muted { color: var(--on-dark-muted); }
.tile--olive { background: var(--olive-soft); color: var(--olive-ink); }
.tile--olive .eyebrow { color: var(--olive-ink); }
.tile--orange { background: var(--orange); color: var(--orange-ink); }
.tile--orange .eyebrow { color: var(--orange-ink); font-weight: 800; }
.tile--soft { background: var(--surface-2); }
.tile--photo { padding: 0; justify-content: flex-end; min-height: 440px; background: var(--dark); }
.tile--photo > img, .tile--photo > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile--empty { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); box-shadow: none; border: 2px dashed var(--line-strong); }
.span-2 { grid-column: span 2; }
.row-2 { grid-row: span 2; }
@media (max-width: 599px) {
  .span-2 { grid-column: auto; }
  .row-2 { grid-row: auto; }
  .tile--photo { min-height: 360px; }
}
.tile-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; line-height: 1.02; }
.tile-foot { margin-top: auto; }
.float-card {
  position: relative;
  margin: 16px;
  background: var(--surface); color: var(--ink);
  border-radius: 24px;
  padding: 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card--ring { box-shadow: var(--shadow-ring); }
.panel { background: var(--surface); border-radius: var(--r-xl); padding: clamp(18px, 2.4vw, 26px); }

/* ---------- Chips, badges, segmented ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 4px 10px;
  border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
}
.chip--white { background: #FFFFFF; color: #232B33; }
.chip--olive { background: var(--olive-soft); color: var(--olive-ink); }
.chip--orange { background: var(--orange); color: var(--orange-ink); }
.chip--urgent { background: var(--orange-soft); color: var(--orange-urgent); }
.chip--dark { background: var(--dark); color: var(--on-dark); }
.chip .i { width: 14px; height: 14px; }

.filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 16px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.filter-chip:hover { color: var(--ink); transform: translateY(-1px); }
.filter-chip[aria-pressed="true"], .filter-chip[aria-current="true"], .filter-chip.is-active { background: var(--dark); color: var(--on-dark); }
:root[data-theme="dark"] .filter-chip[aria-pressed="true"], :root[data-theme="dark"] .filter-chip.is-active, :root[data-theme="dark"] .filter-chip[aria-current="true"] { background: var(--ink); color: var(--bg); }
.filter-chip .count { opacity: .6; font-weight: 600; }

.segmented {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: var(--r-sm);
}
.segmented button, .segmented a {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 11px;
  background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.segmented [aria-pressed="true"], .segmented [aria-selected="true"], .segmented .is-active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(35, 43, 51, .3); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error, .form-error { font-size: 13px; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  min-height: 50px; padding: 12px 14px;
  border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink);
  font-size: 16px;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow var(--t-fast) var(--ease), background var(--t-fast);
  appearance: none;
}
.panel .input, .panel .select, .panel .textarea, .card .input { background: var(--surface-2); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--orange); background: var(--surface); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235E646B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input-group { display: flex; gap: 8px; }
.input-group > .input { flex: 1; }
.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 44px; }

.check {
  display: flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 6px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-ring);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast);
}
.check input[type="checkbox"], .check input[type="radio"] { width: 22px; height: 22px; accent-color: var(--olive); flex-shrink: 0; margin: 0; }
.check:has(input:checked) { background: var(--surface-2); box-shadow: none; color: var(--muted); }
.check.is-strike:has(input:checked) .check-label { text-decoration: line-through; text-decoration-thickness: 2px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 50px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--line-strong); position: relative;
  transition: background var(--t-fast) var(--ease);
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: transform var(--t) var(--ease-pop);
}
.switch input:checked + .track { background: var(--olive); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  width: 44px; height: 44px; border-radius: var(--r-sm); border: 0;
  background: var(--surface-2); font-size: 22px; font-weight: 700; color: var(--ink);
  display: grid; place-items: center;
}
.stepper output, .stepper .value { min-width: 2.2ch; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 26px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--olive-soft); color: var(--olive-ink); font-weight: 600;
}
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--warn { background: var(--orange-soft); color: var(--orange-urgent); }

/* ---------- Recetas ---------- */
.recipe-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none; color: var(--ink);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  min-width: 0;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); color: var(--ink); }
.recipe-card .media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.recipe-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.recipe-card:hover .media img { transform: scale(1.04); }
.recipe-card .media .chips { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.recipe-card .media .fav-btn { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: #232B33; }
.recipe-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recipe-card .title { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.08; }
.recipe-card .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 14px; }
.recipe-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.recipe-card .meta .i { width: 15px; height: 15px; }
.recipe-card .card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.recipe-card .fav-btn, .recipe-card .card-actions { z-index: 2; }

.recipe-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border-radius: var(--r-lg);
  padding: 10px; text-decoration: none; color: var(--ink);
  transition: transform var(--t) var(--ease);
  min-width: 0;
}
.recipe-row:hover { transform: translateY(-3px); color: var(--ink); }
.recipe-row img, .recipe-row .thumb { width: 76px; height: 76px; border-radius: 16px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.recipe-row .title { font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1.1; letter-spacing: -.02em; }
.recipe-row .meta { font-size: 14px; color: var(--muted); }
.recipe-row > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.thumb-fallback {
  display: grid; place-items: center;
  background: var(--olive-soft); color: var(--olive-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 28px;
}
.media .thumb-fallback { position: absolute; inset: 0; font-size: 56px; }

/* ---------- Progreso ---------- */
.seg-progress { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 4px; }
.seg-progress span { height: 8px; border-radius: 4px; background: var(--dark-3); transition: background var(--t) var(--ease); }
.seg-progress span.on { background: var(--orange); }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); background: var(--olive); border-radius: 999px; transition: width var(--t-slow) var(--ease); }
.tile--olive .bar { background: rgba(255, 255, 255, .7); }

.ring { --p: 0; --size: 120px; --stroke: 10px; width: var(--size); height: var(--size); position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring .track { stroke: var(--dark-3); }
.ring .value { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }

/* ---------- Semana ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day {
  min-height: 92px; border-radius: 16px; padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  background: var(--surface-2); color: var(--ink); text-decoration: none;
  transition: transform var(--t-fast) var(--ease);
}
.week-day:hover { transform: translateY(-2px); color: var(--ink); }
.week-day .d { font-size: 12px; font-weight: 700; }
.week-day .m { font-size: 13px; line-height: 1.3; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.week-day.is-today { background: var(--orange); color: var(--orange-ink); }
.week-day.is-empty { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }
@media (max-width: 599px) {
  .week { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 112px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .week-day { scroll-snap-align: start; }
}

/* ---------- Listas genéricas ---------- */
.list { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 12px;
  background: var(--surface); border-radius: var(--r-sm);
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 700; overflow-wrap: anywhere; }
.list-row .sub { font-size: 13px; color: var(--muted); }
.pill-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 10px 12px; font-size: 15px;
}

/* ---------- Vacíos y skeleton ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 36px 20px;
  background: var(--surface); border-radius: var(--r-xl);
}
.empty img { width: 140px; height: auto; }
.empty h2, .empty h3 { font-size: 24px; }
.empty p { color: var(--muted); max-width: 42ch; margin: 0; }
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Diálogos y hojas ---------- */
dialog.sheet {
  border: 0; padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 860px);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetIn var(--t) var(--ease); }
dialog.sheet::backdrop { background: rgba(17, 20, 23, .55); backdrop-filter: blur(3px); animation: fadeIn var(--t) var(--ease); }
dialog.sheet.is-closing { animation: sheetOut var(--t-fast) var(--ease-in) forwards; }
dialog.sheet.is-closing::backdrop { animation: fadeOut var(--t-fast) var(--ease-in) forwards; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 8px 24px; }
.sheet-head h2 { font-size: 26px; }
.sheet-body { padding: 8px 24px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
@media (max-width: 599px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet[open] { animation: sheetUp var(--t) var(--ease); }
  dialog.sheet.is-closing { animation: sheetDown var(--t-fast) var(--ease-in) forwards; }
  .sheet-foot .btn { flex: 1; }
  .sheet-head::before { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-strong); }
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 300;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 16px;
  background: var(--dark); color: var(--on-dark);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  font-weight: 600; font-size: 15px;
  animation: toastIn var(--t) var(--ease-pop);
}
:root[data-theme="dark"] .toast { background: var(--surface-3); }
.toast .i { color: var(--lime); }
.toast--error .i { color: #FF8A5C; }
.toast .toast-msg { flex: 1; }
.toast button { border: 0; background: var(--dark-2); color: var(--on-dark); border-radius: 10px; min-height: 36px; padding: 0 12px; font-weight: 700; }
.toast.is-leaving { animation: toastOut var(--t-fast) var(--ease-in) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(.96); } }

.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  background: var(--dark); color: var(--on-dark);
  text-align: center; font-size: 13px; font-weight: 700;
  padding: 6px 12px calc(6px);
  transform: translateY(-100%);
  transition: transform var(--t) var(--ease);
}
.is-offline .offline-bar { transform: none; }

/* ---------- Avisos (campana) ---------- */
.notif-panel { width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; padding: 8px; }
.notif {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink);
}
.notif:hover { background: var(--surface-2); color: var(--ink); }
.notif .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-deep); display: grid; place-items: center; flex-shrink: 0; }
.notif.is-unread .t::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--orange); vertical-align: middle; }
.notif .t { font-weight: 700; line-height: 1.25; }
.notif .b { font-size: 14px; color: var(--muted); }

/* ---------- Footer simple ---------- */
.app-foot { padding: 32px 0 8px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.app-foot a { color: inherit; }

/* ---------- Motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px) scale(.98); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.no-js [data-reveal], .reduced [data-reveal] { opacity: 1; transform: none; }

.pop { display: inline-block; animation: pop .35s var(--ease-pop); }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }
.slide-in { animation: slideIn .4s var(--ease) both; }
.bob { animation: bob 5s ease-in-out infinite; }

.is-removing { animation: rowOut .32s var(--ease-in) forwards; }
@keyframes rowOut { to { opacity: 0; transform: translateX(-24px); height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(240, 78, 28, .55); } 100% { box-shadow: 0 0 0 14px rgba(240, 78, 28, 0); } }

/* Transiciones entre páginas (Chrome / WebView Android) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .22s var(--ease-in) both; }
::view-transition-new(root) { animation: vtIn .38s var(--ease) both; }
::view-transition-group(*) { animation-duration: .42s; animation-timing-function: var(--ease); }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(12px); } }
.app-header-wrap { view-transition-name: app-header; }
.tabbar { view-transition-name: tabbar; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ---------- Utilidades ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: initial; } .hide-desktop { display: none !important; } }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-variant-numeric: tabular-nums; }

/* ---------- Receta: detalle ---------- */
.menu-panel .menu-note { padding: 8px 12px; font-size: 13px; color: var(--muted); max-width: 260px; }
.menu-panel .is-danger, .menu-panel .is-danger:hover { color: var(--danger); }
.menu-panel form { margin: 0; }
.recipe-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0 14px; }
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--gap); align-items: stretch; }
@media (max-width: 900px) { .recipe-hero { grid-template-columns: 1fr; } }
.recipe-hero-media { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 320px; background: var(--surface-2); }
.recipe-hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recipe-hero-media .thumb-fallback { position: absolute; inset: 0; font-size: 120px; }
@media (max-width: 900px) { .recipe-hero-media { min-height: 0; aspect-ratio: 4 / 3; } }
.recipe-hero-body { background: var(--surface); border-radius: var(--r-xl); padding: clamp(20px, 3vw, 34px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.recipe-title { font-size: clamp(40px, 5.4vw, 72px); overflow-wrap: anywhere; }
.recipe-servings { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-2); border-radius: var(--r-md); padding: 10px 10px 10px 16px; }
.recipe-servings .stepper button { background: var(--surface); }
.recipe-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.recipe-stats > div { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.recipe-stats strong { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.recipe-stats .is-cost { background: var(--olive-soft); color: var(--olive-ink); }
.recipe-stats .is-cost .eyebrow { color: inherit; }
.recipe-layout { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); align-items: start; }
.recipe-aside { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 96px; }
@media (max-width: 900px) { .recipe-layout { grid-template-columns: 1fr; } .recipe-aside { position: static; } }
.ingredient { min-height: 48px; }
.ingredient .ing-qty { font-weight: 800; white-space: nowrap; color: var(--orange-deep); }
.ingredient.has-it .ing-name::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--olive); vertical-align: middle; }
.ing-qty.pop { animation: pop .35s var(--ease-pop); }
.cost-box { background: var(--olive-soft); color: var(--olive-ink); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.cost-box a { color: inherit; font-weight: 800; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.step-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  min-height: 150px; padding: 18px; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: transform var(--t) var(--ease), background var(--t) var(--ease);
}
.step-tile:hover { transform: translateY(-3px); }
.step-tile .step-n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.step-tile .step-n .ok { display: none; }
.step-tile .step-text { line-height: 1.5; }
.step-tile[aria-pressed="true"] { background: var(--olive-soft); }
.step-tile[aria-pressed="true"] .step-n { background: var(--olive); color: #fff; }
.step-tile[aria-pressed="true"] .step-n .n { display: none; }
.step-tile[aria-pressed="true"] .step-n .ok { display: block; animation: pop .35s var(--ease-pop); }
.stars { display: inline-flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.stars label { cursor: pointer; color: var(--line-strong); }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars .i { width: 34px; height: 34px; transition: transform var(--t-fast) var(--ease-pop), color var(--t-fast); }
.stars label:hover .i, .stars label:hover ~ label .i, .stars input:checked ~ .i, .stars label:has(input:checked) ~ label .i, .stars label:has(input:checked) .i { color: var(--orange); fill: var(--orange); }
.stars label:hover .i { transform: scale(1.15); }
.stars input:focus-visible ~ .i { outline: 3px solid var(--focus); border-radius: 6px; }
.i--fill { fill: currentColor; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--olive); color: #fff; font-weight: 800; flex-shrink: 0; }
.segmented--wrap { flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.segmented label input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(35, 43, 51, .3); }
.segmented label input:focus-visible + span { outline: 3px solid var(--focus); }

/* ---------- Modo cocina ---------- */
.cook-body .app-header-wrap, .cook-body .tabbar, .cook-body .app-foot { display: none !important; }
.cook-body main.page { max-width: none; padding: 0; }
.cook { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); z-index: 40; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.cook-bar { display: flex; align-items: center; gap: 12px; padding: 14px clamp(14px, 3vw, 28px); }
.cook-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-awake { color: var(--lime); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cook-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.cook-track::-webkit-scrollbar { display: none; }
.cook-step { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; padding: 12px clamp(18px, 6vw, 80px); overflow-y: auto; }
.cook-step-inner { max-width: 820px; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.cook-text { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4.4vw, 46px); line-height: 1.18; letter-spacing: -.015em; margin: 0; }
.cook-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 12px clamp(14px, 3vw, 28px) 18px; }
.cook-nav .btn { min-height: 64px; font-size: 18px; }
.cook-prev { --btn-bg: var(--dark-2); --btn-fg: var(--on-dark); }
.cook-timers { display: flex; gap: 8px; overflow-x: auto; padding: 0 clamp(14px, 3vw, 28px); scrollbar-width: none; }
.cook-timers:empty { display: none; }
.cook-timer { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; background: var(--dark-2); color: var(--on-dark); border-radius: 18px; padding: 8px 10px; min-width: 250px; animation: slideIn var(--t) var(--ease); }
.cook-timer .num { font-size: 26px; }
.cook-timer.is-paused .num { opacity: .5; }
.cook-timer.is-done { background: var(--orange); color: var(--orange-ink); animation: flash 1s ease-out infinite; }
.cook-timer .ring .value { transition: stroke-dashoffset 1s linear; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; opacity: .95; animation: confetti var(--d, 2.4s) cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes confetti { to { transform: translate3d(var(--x, 0), 110vh, 0) rotate(var(--r, 540deg)); opacity: .9; } }

/* ---------- Receta: formulario ---------- */
.recipe-form { display: flex; flex-direction: column; gap: var(--gap); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: var(--gap); align-items: start; }
.form-aside { position: sticky; top: 96px; }
@media (max-width: 960px) { .form-layout { grid-template-columns: 1fr; } .form-aside { position: static; } }
.input--lg { min-height: 58px; font-size: 20px; font-weight: 700; }
.phase-block { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.phase-head { display: flex; gap: 8px; align-items: center; }
.phase-name { font-weight: 700; background: var(--surface) !important; }
.phase-block:first-child:only-child .phase-head [data-remove-block] { visibility: hidden; }
.ing-row { display: grid; grid-template-columns: 22px 84px 108px minmax(0, 1fr) minmax(0, .8fr) 38px; gap: 6px; align-items: center; }
.ing-row .input, .step-row .textarea, .step-row .input { background: var(--surface) !important; }
.ing-row .row-error, .step-row .row-error { grid-column: 1 / -1; }
.drag { cursor: grab; color: var(--faint); display: grid; place-items: center; touch-action: none; }
.drag .i { width: 18px; height: 18px; }
.is-dragging { opacity: .6; outline: 2px dashed var(--orange); border-radius: 12px; }
@media (max-width: 700px) {
  .ing-row { grid-template-columns: 22px 72px minmax(0, 1fr) 38px; }
  .ing-row .ing-u { grid-column: 3; }
  .ing-row .ing-n { grid-column: 2 / 4; }
  .ing-row .ing-notes { grid-column: 2 / 4; }
  .ing-row [data-remove-row] { grid-column: 4; grid-row: 1; }
  .ing-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
}
.step-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 110px 38px; gap: 8px; align-items: start; }
.step-num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--dark); color: var(--on-dark); font-weight: 800; margin-top: 6px; }
.step-row .textarea { min-height: 76px; }
.timer-input { position: relative; display: block; }
.timer-input .i { position: absolute; left: 10px; top: 15px; color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.timer-input .input { padding-left: 32px; }
@media (max-width: 700px) {
  .step-row { grid-template-columns: 32px minmax(0, 1fr) 38px; }
  .step-row .timer-input { grid-column: 2; }
  .step-row [data-remove-row] { grid-column: 3; grid-row: 1; }
}
.photo-drop { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-md); background: var(--surface-2); border: 2px dashed var(--line-strong); cursor: pointer; overflow: hidden; text-align: center; transition: border-color var(--t-fast), background var(--t-fast); }
.photo-drop:hover, .photo-drop.is-over { border-color: var(--orange); background: var(--orange-soft); }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop .photo-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; padding: 16px; }
.photo-drop.has-image { border-style: solid; border-color: transparent; }
.photo-drop.has-image .photo-empty { opacity: 0; }
.photo-drop.has-image:hover .photo-empty { opacity: 1; background: rgba(17, 20, 23, .55); color: #fff; position: relative; z-index: 1; border-radius: 14px; }
.photo-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.visibility { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vis-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vis-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; transition: background var(--t-fast), box-shadow var(--t-fast); }
.vis-card > span { display: flex; flex-direction: column; gap: 2px; }
.vis-option input:checked + .vis-card { background: var(--dark); color: var(--on-dark); }
.vis-option input:checked + .vis-card .muted { color: var(--on-dark-muted); }
.vis-option input:focus-visible + .vis-card { outline: 3px solid var(--focus); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border-radius: var(--r-sm); background: var(--surface-2); }
.tag-input .input { flex: 1; min-width: 120px; background: transparent !important; box-shadow: none; min-height: 38px; }
.tag-input .tag { border: 0; cursor: pointer; background: var(--surface); }
.form-bar { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 30; display: flex; justify-content: flex-end; gap: 10px; padding: 10px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-float); }
@media (max-width: 860px) { .form-bar { bottom: calc(env(safe-area-inset-bottom) + 84px); } }
.slide-in { animation: slideIn var(--t) var(--ease); }

/* ---------- Compras ---------- */
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: var(--gap); align-items: start; }
@media (max-width: 960px) { .shop-layout { grid-template-columns: 1fr; } }
.shop-add { display: grid; grid-template-columns: 82px 110px minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 600px) { .shop-add { grid-template-columns: 70px 90px minmax(0, 1fr) 48px; } .shop-add .btn { padding: 0; } }
.shop-group { display: flex; flex-direction: column; gap: 8px; }
.shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shop-row { position: relative; display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: var(--r-sm); padding-right: 6px; touch-action: pan-y; transition: background var(--t-fast), transform var(--t) var(--ease), opacity var(--t); }
.shop-row.is-swiping { transition: none; }
.shop-check { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 6px 8px 14px; cursor: pointer; }
.shop-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shop-check .tick { width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line-strong); color: transparent; transition: background var(--t-fast), box-shadow var(--t-fast); }
.shop-check .tick .i { width: 16px; height: 16px; }
.shop-check input:checked + .tick { background: var(--olive); box-shadow: none; color: #fff; animation: pop .3s var(--ease-pop); }
.shop-check input:focus-visible + .tick { outline: 3px solid var(--focus); outline-offset: 2px; }
.shop-row .name { font-weight: 700; overflow-wrap: anywhere; position: relative; }
.shop-row .name::after { content: ''; position: absolute; left: 0; top: 52%; height: 2px; width: 0; background: currentColor; transition: width var(--t) var(--ease); }
.shop-row.is-checked { background: var(--surface-2); color: var(--muted); }
.shop-row.is-checked .name::after { width: 100%; }
.shop-row .sub { font-size: 12px; color: var(--muted); }
.shop-row .qty { font-weight: 800; white-space: nowrap; color: var(--orange-deep); }
.shop-row.is-checked .qty { color: inherit; }
.shop-done .shop-row { opacity: .85; }
.member { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--olive); color: #fff; font-weight: 800; border: 2px solid var(--dark); }
.member img { width: 100%; height: 100%; object-fit: cover; }
.invite { background: var(--dark-2); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.invite-code { font-size: 34px; letter-spacing: .12em; color: var(--lime); }

/* ---------- Plan semanal ---------- */
.week-nav { display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border-radius: var(--r-sm); }
.week-nav .icon-btn { width: 40px; height: 40px; background: transparent; }
.week-nav-label { min-width: 13ch; text-align: center; font-weight: 800; font-size: 15px; }
.plan-layout { display: flex; flex-direction: column; gap: var(--gap); }
.plan-aside { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 900px) { .plan-aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .plan-hint { grid-column: 1 / -1; } }
.plan-hint .i { vertical-align: -3px; }

/* Agenda (móvil y tablet): un bloque por día. */
.plan-strip { margin-bottom: 12px; }
.plan-board { display: flex; flex-direction: column; gap: 12px; }
.plan-meal-label { display: none; }
.plan-day { background: var(--surface); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: calc(var(--header-h) + 16px); }
.plan-day.is-today { box-shadow: inset 0 0 0 2px var(--orange); }
.plan-day.is-past > * { opacity: .72; }
.plan-day-head { display: flex; align-items: center; gap: 8px; }
.plan-day-head .dow { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.plan-day-head .num { color: var(--muted); font-weight: 700; }
.plan-day-add { margin-left: auto; }
.plan-slot { display: flex; flex-direction: column; gap: 6px; border-radius: 14px; transition: background var(--t-fast), box-shadow var(--t-fast); }
.plan-slot.is-empty { display: none; }
.plan-slot-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.plan-slot-add { display: none; }
.plan-free { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.plan-free:hover { color: var(--ink); border-color: var(--orange); }
.plan-entry { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--surface-2); cursor: pointer; user-select: none; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), opacity var(--t-fast); }
.plan-entry:hover { transform: translateY(-1px); box-shadow: var(--shadow-ring); }
.plan-entry:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.plan-entry.is-dragging { opacity: .35; }
.plan-entry.is-new { animation: pop .45s var(--ease-pop); }
.plan-entry-media { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--olive-soft); color: var(--olive-ink); }
.plan-entry-media img { width: 100%; height: 100%; object-fit: cover; }
.plan-entry-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan-entry .t { font-weight: 700; font-size: 14px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.plan-entry .s { font-size: 12px; color: var(--muted); }

/* Calendario (escritorio): filas = comidas, columnas = días. */
@media (min-width: 1000px) {
  .plan-strip { display: none; }
  .plan-board {
    display: grid; gap: 6px;
    grid-template-columns: 78px repeat(7, minmax(0, 1fr));
    grid-template-rows: auto repeat(var(--rows), minmax(76px, auto));
    padding: 14px; background: var(--surface); border-radius: var(--r-xl);
  }
  .plan-meal-label { display: block; grid-column: 1; grid-row: var(--r); padding: 10px 4px 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .plan-day { display: contents; }
  .plan-day-head { grid-column: var(--c); grid-row: 1; flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 10px 8px; border-radius: 14px; }
  .plan-day-head .dow { font-size: 15px; }
  .plan-day-head .num { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
  .plan-day.is-today .plan-day-head { background: var(--orange); color: var(--orange-ink); }
  .plan-day.is-today .plan-day-head .num { color: inherit; }
  .plan-day-head .chip, .plan-day-add, .plan-free, .plan-slot-label { display: none; }
  .plan-slot, .plan-slot.is-empty { display: flex; grid-column: var(--c); grid-row: var(--r); padding: 4px; background: var(--surface-2); }
  .plan-day.is-today .plan-slot { background: color-mix(in srgb, var(--orange) 9%, var(--surface-2)); }
  .plan-slot.is-over { background: var(--olive-soft); box-shadow: inset 0 0 0 2px var(--olive); }
  .plan-slot-add { display: grid; place-items: center; min-height: 30px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity var(--t-fast), background var(--t-fast); }
  .plan-slot.is-empty .plan-slot-add { flex: 1; opacity: .35; }
  .plan-slot:hover .plan-slot-add, .plan-slot-add:focus-visible { opacity: 1; }
  .plan-slot-add:hover { background: var(--surface); color: var(--ink); }
  .plan-entry { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; background: var(--surface); box-shadow: 0 1px 2px rgba(35, 43, 51, .08); }
  .plan-entry[draggable="true"] { cursor: grab; }
  .plan-entry-media { width: 100%; height: 58px; border-radius: 0; }
  .plan-entry-text { padding: 6px 8px 8px; }
  .plan-entry .t { font-size: 13px; }
}

.plan-summary .plan-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-stats strong { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.plan-stats span { font-size: 13px; color: var(--on-dark-muted); }
.plan-cost { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--dark-2); }
.plan-cost-total { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--lime); }
.plan-cost a { color: var(--on-dark); }
.plan-templates .list-row { background: var(--surface); }
.plan-templates form { margin: 0; }

.picker-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.picker-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.picker-results button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 12px 6px 6px; border: 0; border-radius: 14px; background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--t-fast), transform var(--t-fast) var(--ease); }
.picker-results button:hover, .picker-results button:focus-visible { background: var(--olive-soft); transform: translateX(2px); }
.picker-results .media { width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--olive-soft); color: var(--olive-ink); }
.picker-results .media img { width: 100%; height: 100%; object-fit: cover; }
.picker-results .t { font-weight: 700; display: block; }
.picker-results .s { font-size: 13px; color: var(--muted); }
.picker-results .go { margin-left: auto; color: var(--orange-deep); }
.picker-results .is-empty { padding: 18px; text-align: center; color: var(--muted); }
.plan-entry-hero { aspect-ratio: 16 / 7; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; background: var(--olive-soft); color: var(--olive-ink); }
.plan-entry-hero img { width: 100%; height: 100%; object-fit: cover; }
.plan-entry-hero .i { width: 40px; height: 40px; }

/* ---------- Despensa ---------- */
.pantry-add { display: grid; grid-template-columns: minmax(0, 1fr) 82px 110px 150px auto; gap: 8px; align-items: end; }
.pantry-date { display: flex; flex-direction: column; gap: 2px; }
.pantry-date .tiny { padding-left: 4px; }
@media (max-width: 760px) {
  .pantry-add { grid-template-columns: 1fr 1fr; }
  .pantry-add-name, .pantry-date { grid-column: 1 / -1; }
  .pantry-add .btn { grid-column: 1 / -1; }
}
.pantry-group { display: flex; flex-direction: column; gap: 8px; }
.pantry-group-title { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.pantry-group-title .count { font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--muted); }
.pantry-group--soon .pantry-group-title { color: var(--orange-deep); }
.pantry-group--soon .pantry-row { box-shadow: inset 3px 0 0 var(--orange); }
.pantry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pantry-row { display: flex; align-items: center; gap: 2px; padding-right: 6px; background: var(--surface); border-radius: var(--r-sm); transition: transform var(--t) var(--ease), opacity var(--t); }
.pantry-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 8px 8px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); }
.pantry-main:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.pantry-main .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pantry-main .name { font-weight: 700; overflow-wrap: anywhere; }
.pantry-main .sub { font-size: 13px; color: var(--muted); }
.pantry-main .chip { flex-shrink: 0; }
@media (max-width: 420px) { .pantry-main { flex-wrap: wrap; } }

.cook-list { gap: 8px; }
.cook-pick { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); background: var(--dark-2); color: var(--on-dark); text-decoration: none; transition: transform var(--t-fast) var(--ease), background var(--t-fast); }
.cook-pick:hover { color: var(--on-dark); transform: translateX(3px); background: var(--dark-3); }
.cook-pick .media { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: var(--dark-3); }
.cook-pick .media img { width: 100%; height: 100%; object-fit: cover; }
.cook-pick .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cook-pick .name { font-weight: 700; }
.cook-pick .sub { font-size: 13px; color: var(--on-dark-muted); }
.pct-ring { --p: 0; width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--dark-3) 0); }
.pct-ring .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--dark-2); font-size: 11px; font-weight: 800; }

.price-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.price-form-name, .price-form-submit { grid-column: 1 / -1; }
.price-list { gap: 6px; max-height: 420px; overflow: auto; }
.price-list .list-row { min-height: 52px; }

/* ---------- Inicio ---------- */
.home-lead { margin: 0; font-size: 18px; }
.home-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .home-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .home-bento { grid-template-columns: minmax(0, 1fr); } }
.home-hero { min-height: 480px; }
.home-hero .float-card { align-items: flex-end; }
.home-hero .float-card .tile-title { font-size: clamp(26px, 3vw, 36px); }
.home-start { justify-content: flex-start; min-height: 420px; }
.home-start-art { position: absolute; right: 18px; bottom: 76px; width: clamp(110px, 22%, 180px); opacity: .95; pointer-events: none; }
@media (max-width: 599px) { .home-start-art { display: none; } }
.inline-form { margin: 0; display: inline-flex; }
.home-big { display: flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; line-height: .9; }
.home-big strong { font-size: 64px; }
.home-big span { font-size: 28px; opacity: .7; }
.home-names { font-size: 14px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.home-link .i { transition: transform var(--t-fast) var(--ease); }
a.tile:hover .home-link .i { transform: translateX(4px); }
.home-soon { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-soon li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .6); font-weight: 700; }
:root[data-theme="dark"] .home-soon li { background: rgba(0, 0, 0, .18); }
.home-continue-body { display: flex; align-items: center; gap: 12px; }
.home-continue .media { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: var(--dark-3); }
.home-continue .media img { width: 100%; height: 100%; object-fit: cover; }
.home-continue .tile-title { font-size: 22px; }
.home-ideas .home-idea { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; }
.home-ideas .home-idea:not([hidden]) { animation: pop .4s var(--ease-pop); }
.home-idea .media { aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; background: var(--olive-soft); color: var(--olive-ink); }
.home-idea .media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.home-idea .media:hover img { transform: scale(1.05); }
.home-idea-title { color: var(--ink); text-decoration: none; }
@media (max-width: 420px) { .home-ideas .home-idea { grid-template-columns: 92px minmax(0, 1fr); } }
.home-week .week-day .m { -webkit-line-clamp: 2; }
.home-community { grid-column: 1 / -1; }
.home-community-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .home-community-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 150px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; } }
.mini-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; scroll-snap-align: start; min-width: 0; }
.mini-card:hover { color: var(--ink); }
.mini-card .media { aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.mini-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.mini-card:hover .media img { transform: scale(1.05); }
.mini-card .t { font-weight: 700; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-card .s { font-size: 13px; color: var(--muted); }

/* ---------- Comunidad y perfil público ---------- */
.cook-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 14px; margin: 0 -2px 4px; scroll-snap-type: x proximity; }
.cook-strip::-webkit-scrollbar { display: none; }
.cook-chip { flex: 0 0 auto; width: 148px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px 14px; background: var(--surface); border-radius: var(--r-lg); text-align: center; }
.cook-chip-link { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; min-width: 0; width: 100%; }
.cook-chip-link:hover { color: var(--ink); }
.cook-chip .avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--olive); color: #fff; font-family: var(--font-display); font-size: 26px; font-weight: 800; transition: transform var(--t) var(--ease-pop); }
.cook-chip-link:hover .avatar { transform: scale(1.06) rotate(-3deg); }
.cook-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.cook-chip .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cook-chip .btn { width: 100%; }

.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; padding: clamp(22px, 3vw, 36px); background: var(--surface); border-radius: var(--r-xl); }
@media (max-width: 640px) { .profile-hero { grid-template-columns: 1fr; justify-items: start; } }
.profile-avatar { width: clamp(96px, 14vw, 156px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--orange); color: var(--orange-ink); font-family: var(--font-display); font-size: clamp(40px, 6vw, 64px); font-weight: 800; box-shadow: 0 0 0 6px var(--surface), 0 0 0 8px var(--orange-soft); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-bio { margin: 0; max-width: 60ch; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); }
.profile-stats strong { color: var(--ink); font-size: 20px; }

/* ---------- Perfil ---------- */
.profile-hero--app { margin-top: 18px; }
.profile-avatar--edit { position: relative; cursor: pointer; }
.profile-avatar--edit [data-avatar] { width: 100%; height: 100%; display: grid; place-items: center; }
.profile-avatar--edit [data-avatar] img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-cam { position: absolute; inset: auto 0 0 0; height: 34%; display: grid; place-items: center; background: rgba(17, 20, 23, .55); color: #fff; opacity: 0; transition: opacity var(--t-fast); }
.profile-avatar--edit:hover .profile-avatar-cam, .profile-avatar--edit:focus-within .profile-avatar-cam { opacity: 1; }
@media (hover: none) { .profile-avatar-cam { opacity: 1; } }
.profile-avatar--edit.is-loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.profile-stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); margin: var(--gap) 0; }
@media (max-width: 900px) { .profile-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.profile-stats-grid .tile { gap: 4px; padding: 18px; }
.profile-stats-grid .tile > .i { color: var(--orange-deep); }
.profile-stats-grid strong { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 960px) { .profile-layout { grid-template-columns: minmax(0, 1fr); } }
.input-prefix { display: flex; align-items: center; gap: 4px; padding-left: 14px; background: var(--surface-2); border-radius: var(--r-sm); }
.input-prefix .input { background: transparent; padding-left: 2px; min-width: 0; }
.input-prefix:focus-within { box-shadow: 0 0 0 2px var(--orange); }
@media (max-width: 420px) { .input-prefix { flex-direction: column; align-items: stretch; padding: 8px 0 0 14px; gap: 0; } }
.danger-zone { box-shadow: inset 0 0 0 2px var(--orange-soft); }
.danger-zone h2 { color: var(--danger); }
