/* =========================================================
   Cocina Radial — Sistema de diseño
   1. Tokens (colores, sombras, radios, espaciado, tipografía)
   2. Base y tipografía
   3. Barra superior y controles
   4. Menú circular y escenario principal
   5. Tarjetas y modales
   6. Receta: ingredientes, pasos, modo paso a paso
   7. Comparador de supermercados
   8. Temporizador flotante
   9. Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root,
[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-accent: radial-gradient(1200px 500px at 50% -10%, rgba(79, 70, 229, 0.1), transparent 70%);
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --text: #0f172a;
  --text-muted: #55627a;
  --border: #e2e6f0;
  --hover: #e8ebf5;

  --primary: #4f46e5;
  --primary-strong: #3f38c4;
  --primary-soft: rgba(79, 70, 229, 0.12);
  --primary-text: #4338ca;
  --on-primary: #ffffff;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;

  --wheel-bg: radial-gradient(circle at 50% 45%, rgba(79, 70, 229, 0.07), var(--surface) 70%);
  --wheel-backdrop: #e9ecf5;
  --wheel-wedge: #ffffff;
  --wheel-wedge-hover: #f4f6ff;
  --wheel-divider: #e4e8f3;
  --wheel-step-bg: #eef1f9;
  --wheel-step-active: #ffffff;
  --wheel-step-done: #f5f7ff;
  --wheel-hub-bg: #ffffff;
  --wheel-pill-bg: rgba(15, 23, 42, 0.065);
  --wheel-pill-text: #475569;
  --overlay: rgba(15, 23, 42, 0.55);
}

[data-theme="warm"] {
  --bg: #fbf7f1;
  --bg-accent: radial-gradient(1200px 520px at 50% -10%, rgba(217, 72, 15, 0.13), transparent 72%);
  --surface: #ffffff;
  --surface-2: #f5ede3;
  --surface-glass: rgba(251, 247, 241, 0.86);
  --text: #231912;
  --text-muted: #6e5947;
  --border: #eadbc7;
  --hover: #f1e3d1;

  --primary: #d9480f;
  --primary-strong: #b83c0a;
  --primary-soft: rgba(217, 72, 15, 0.12);
  --primary-text: #b83c0a;
  --on-primary: #ffffff;
  --accent: #2f7d4b;
  --danger: #c92a2a;
  --success: #2f7d4b;

  --wheel-bg: radial-gradient(circle at 50% 45%, rgba(217, 72, 15, 0.10), var(--surface) 70%);
  --wheel-backdrop: #f1e6d8;
  --wheel-wedge: #fffcf8;
  --wheel-wedge-hover: #fff4e8;
  --wheel-divider: #ecdcc9;
  --wheel-step-bg: #f6ece0;
  --wheel-step-active: #ffffff;
  --wheel-step-done: #fff8f0;
  --wheel-hub-bg: #ffffff;
  --wheel-pill-bg: rgba(35, 25, 18, 0.065);
  --wheel-pill-text: #624a38;
  --overlay: rgba(35, 25, 18, 0.56);
}

[data-theme="dark"] {
  --bg: #12100e;
  --bg-accent: radial-gradient(1200px 520px at 50% -10%, rgba(249, 115, 22, 0.22), transparent 70%);
  --surface: #1c1916;
  --surface-2: #26221e;
  --surface-glass: rgba(28, 25, 22, 0.86);
  --text: #f5f0ea;
  --text-muted: #b5a899;
  --border: #36302a;
  --hover: #2f2a24;

  --primary: #f97316;
  --primary-strong: #ea580c;
  --primary-soft: rgba(249, 115, 22, 0.18);
  --primary-text: #fdba74;
  --on-primary: #ffffff;
  --accent: #4ade80;
  --danger: #f87171;
  --success: #4ade80;

  --wheel-bg: radial-gradient(circle at 50% 45%, rgba(249, 115, 22, 0.16), var(--surface) 72%);
  --wheel-backdrop: #211d19;
  --wheel-wedge: #27221d;
  --wheel-wedge-hover: #312b24;
  --wheel-divider: #3a332c;
  --wheel-step-bg: #1a1714;
  --wheel-step-active: #2e2822;
  --wheel-step-done: #28231e;
  --wheel-hub-bg: #241f1b;
  --wheel-pill-bg: rgba(255, 255, 255, 0.10);
  --wheel-pill-text: #dfd5c8;
  --overlay: rgba(8, 6, 4, 0.74);
}

:root {
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-editorial: "Fraunces", "Plus Jakarta Sans", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --fs-sm: clamp(0.8rem, 0.78rem + 0.12vw, 0.88rem);
  --fs-md: clamp(0.92rem, 0.9rem + 0.15vw, 1rem);
  --fs-lg: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  --fs-xl: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.18);

  --ease: all 0.25s ease;
}

[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.6);
}

/* ---------- 2. Base y tipografía ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-accent) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

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

/* ---------- 3. Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--border);
}

.brand h1 {
  font-family: var(--font-editorial);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.theme-switcher {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.theme-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: var(--ease);
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 4rem 0.65rem 2.6rem;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: var(--ease);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:hover {
  border-color: var(--primary);
}

.search-box input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.search-submit {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.38rem 0.8rem;
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.search-submit:hover {
  background: var(--primary-strong);
}

.btn-fav-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.6rem 1rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.btn-fav-filter svg {
  width: 16px;
  height: 16px;
}

.btn-fav-filter:hover {
  border-color: var(--danger);
  color: var(--danger);
  transform: translateY(-1px);
}

.btn-fav-filter.is-active {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-fav-filter.is-active svg {
  fill: #ffffff;
}

.badge-count {
  min-width: 1.5rem;
  text-align: center;
  padding: 0.05rem 0.45rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
}

.btn-fav-filter.is-active .badge-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- 4. Escenario y menú circular ---------- */
.main-stage {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-6);
}

.wheel-section {
  padding: var(--space-4);
  background: var(--wheel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.wheel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 36px;
  margin-bottom: var(--space-2);
}

.wheel-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.wheel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-back {
  padding: 0.4rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.btn-back:hover {
  background: var(--hover);
  transform: translateX(-2px);
}

.btn-reset {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  transition: var(--ease);
}

.btn-reset:hover {
  text-decoration: underline;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}

.crumb-root,
.crumb-sep {
  color: var(--text-muted);
}

.crumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.crumb-btn:hover {
  background: var(--hover);
}

.crumb-btn.is-current {
  border-color: var(--crumb-color, var(--primary));
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.crumb-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.radial-menu-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 580px;
  height: clamp(390px, 60vh, 540px);
  margin: 0 auto;
}

.radial-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: visible;
  user-select: none;
}

.radial-ring-main.is-entering {
  transform-origin: 0 0;
  animation: ringPop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ringPop {
  from {
    opacity: 0.4;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.radial-svg text {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  user-select: none;
}

.main-ring-backdrop {
  stroke: var(--wheel-backdrop);
}

/* Sectores del anillo principal (Corona 3) */
.radial-sector {
  cursor: pointer;
  outline: none;
}

.radial-sector .sector-wedge {
  fill: var(--wheel-wedge);
  stroke: var(--wheel-divider);
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.radial-sector .sector-tint {
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.radial-sector:hover .sector-wedge,
.radial-sector:focus-visible .sector-wedge {
  fill: var(--wheel-wedge-hover);
}

.radial-sector:hover .sector-tint,
.radial-sector:focus-visible .sector-tint,
.radial-sector.is-selected .sector-tint {
  opacity: 1;
}

.radial-sector .sector-accent {
  pointer-events: none;
  opacity: 0.78;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.radial-sector:hover .sector-accent,
.radial-sector:focus-visible .sector-accent,
.radial-sector.is-selected .sector-accent {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--sector-color, rgba(255, 255, 255, 0.5)));
}

.radial-sector .sector-halo {
  pointer-events: none;
  opacity: 0.16;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.radial-sector:hover .sector-halo,
.radial-sector:focus-visible .sector-halo,
.radial-sector.is-selected .sector-halo {
  opacity: 0.28;
  transform: scale(1.12);
}

.radial-sector .sector-badge {
  transition: filter 0.25s ease;
}

.radial-sector:hover .sector-badge,
.radial-sector:focus-visible .sector-badge,
.radial-sector.is-selected .sector-badge {
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.22));
}

.radial-sector .sector-icon {
  pointer-events: none;
}

.radial-sector .sector-label {
  fill: var(--text);
  pointer-events: none;
}

.radial-sector .sector-count-pill {
  pointer-events: none;
}

.radial-sector .sector-pill-bg {
  fill: var(--wheel-pill-bg);
  transition: fill 0.25s ease;
}

.radial-sector:hover .sector-pill-bg,
.radial-sector.is-selected .sector-pill-bg {
  fill: var(--primary-soft);
}

.radial-sector .sector-pill-text {
  fill: var(--wheel-pill-text);
}

.radial-sector.is-empty {
  opacity: 0.48;
}

/* Anillo interior de pasos (Corona 2) */
.inner-step-sector {
  outline: none;
}

.inner-step-sector.is-done {
  cursor: pointer;
}

.inner-step-wedge {
  fill: var(--wheel-step-bg);
  stroke: var(--wheel-divider);
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.inner-step-sector.is-done .inner-step-wedge {
  fill: var(--wheel-step-done);
}

.inner-step-sector.is-done:hover .inner-step-wedge,
.inner-step-sector.is-done:focus-visible .inner-step-wedge {
  fill: var(--wheel-wedge-hover);
}

.inner-step-sector.is-active-step .inner-step-wedge {
  fill: var(--wheel-step-active);
}

.inner-step-accent {
  pointer-events: none;
  opacity: 0.9;
}

.inner-step-accent-primary {
  fill: var(--primary);
  pointer-events: none;
}

.inner-step-label {
  fill: var(--text-muted);
  pointer-events: none;
}

.inner-step-sector.is-done .inner-step-label {
  fill: var(--text);
}

.inner-step-sector.is-active-step .inner-step-label {
  fill: var(--primary-text);
}

/* Centro del círculo / Hub (Corona 1) */
.radial-hub {
  cursor: pointer;
  outline: none;
}

.radial-hub .hub-circle {
  fill: var(--wheel-hub-bg);
  stroke: var(--border);
  transition: stroke 0.25s ease, stroke-width 0.25s ease, fill 0.25s ease, transform 0.25s ease;
}

.radial-hub:hover .hub-circle,
.radial-hub:focus-visible .hub-circle {
  fill: var(--wheel-wedge-hover);
  stroke: var(--primary);
}

.radial-hub .hub-step-label {
  fill: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: fill 0.25s ease;
}

.radial-hub .hub-icon {
  stroke: var(--primary);
  transition: stroke 0.25s ease;
}

.radial-hub .hub-title {
  fill: var(--text);
}

.radial-hub .hub-sub {
  fill: var(--primary-text);
  transition: fill 0.25s ease;
}

.wheel-quick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: var(--space-2);
}

.btn-surprise {
  padding: 0.7rem 1.3rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 20px var(--primary-soft), var(--shadow-sm);
  transition: var(--ease);
}

.btn-surprise:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px var(--primary-soft), var(--shadow-md);
  filter: brightness(1.06);
}

.quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.quick-pill:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quick-pill-time {
  color: var(--primary-text);
  font-weight: 800;
}

.wheel-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: all 0.25s ease;
}

.legend-item:disabled {
  cursor: default;
}

.legend-item.is-active {
  color: var(--primary-text);
  background: var(--primary-soft);
  border-color: var(--primary-soft);
  font-weight: 700;
}

.legend-item.is-done {
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--legend-color, var(--border));
}

.legend-item.is-done:hover {
  background: var(--hover);
  transform: translateY(-1px);
}

.legend-sep {
  opacity: 0.5;
}

/* ---------- 5. Tarjetas y modales ---------- */
.results-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-right: 2.75rem;
  margin-bottom: var(--space-3);
}

.results-modal-header h2 {
  font-family: var(--font-editorial);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
  font-weight: 700;
}

.results-subtitle {
  margin: 0.15rem 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.results-pill {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  white-space: nowrap;
  color: var(--primary-text);
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.recipe-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.card-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.55rem 0.85rem;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--banner-color, var(--primary)),
    color-mix(in srgb, var(--banner-color, var(--primary)) 65%, #0f172a)
  );
}

.card-banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.card-banner-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.card-banner-method {
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
}

.card-title,
.recipe-card h3 {
  font-family: var(--font-editorial);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.38;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow: hidden;
}

.tag {
  padding: 0.16rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.card-meta-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-view-link {
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  color: var(--primary-text);
  text-decoration: none;
  transition: var(--ease);
}

.recipe-card:hover .card-view-link {
  letter-spacing: 0.01em;
  text-decoration: underline;
}

.results-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.results-pagination[hidden] {
  display: none;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn,
.page-num {
  padding: 0.38rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.page-num {
  min-width: 34px;
  padding: 0.38rem 0.6rem;
  text-align: center;
}

.page-btn:hover:not(:disabled),
.page-num:hover:not(.is-active) {
  background: var(--hover);
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-num.is-active {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

.card-fav-btn {
  padding: 0.2rem 0.45rem;
  font-size: 1.05rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.card-fav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.card-fav-btn.is-fav {
  color: var(--danger);
  background: #ffffff;
}

.method-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.7rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #ffffff;
  background: var(--pill-color, var(--primary));
  border-radius: var(--radius-pill);
}

.empty-state {
  padding: var(--space-6) var(--space-5);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.empty-icon {
  margin-bottom: var(--space-2);
  font-size: 2.5rem;
}

.btn-primary {
  margin-top: var(--space-3);
  padding: 0.7rem 1.3rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.btn-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  overflow: hidden;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-card-list {
  max-width: 1020px;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: var(--ease);
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
  transform: rotate(90deg);
}

.btn-back-results {
  padding: 0.32rem 0.78rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-back-results:hover {
  background: var(--hover);
  transform: translateX(-2px);
}

/* ---------- 6. Receta ---------- */
.modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-header-compact {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: var(--space-3);
}

.modal-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-right: 2.75rem;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.modal-mini-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.mini-stat {
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.modal-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.modal-title-row h2 {
  font-family: var(--font-editorial);
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
}

.btn-fav-modal {
  padding: 0.32rem 0.8rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-fav-modal:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-fav-modal.is-fav {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
  border-color: var(--danger);
}

.modal-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 78ch;
}

.modal-desc-compact {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0.3rem;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.recipe-tab-btn {
  padding: 0.55rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.recipe-tab-btn:hover:not(.is-active) {
  color: var(--text);
  background: var(--hover);
}

.recipe-tab-btn.is-active {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.recipe-tab-body {
  min-height: 0;
}

.recipe-tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tab-helper {
  margin: 0.15rem 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.tab-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.btn-tab-nav {
  padding: 0.48rem 1rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-tab-nav:hover {
  background: var(--hover);
  border-color: var(--primary);
}

.btn-tab-nav.is-accent {
  color: var(--primary-text);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.btn-tab-nav.is-accent:hover {
  color: var(--on-primary);
  background: var(--primary);
}

.section-head,
.steps-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.section-head h3,
.steps-head h3,
.modal-steps h3 {
  font-size: var(--fs-md);
  font-weight: 800;
}

.servings-calc {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.2rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.calc-btn {
  width: 26px;
  height: 26px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.calc-btn:hover {
  color: var(--on-primary);
  background: var(--primary);
  transform: scale(1.1);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  height: 100%;
  padding: 0.55rem 0.75rem;
  font-size: var(--fs-sm);
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.check-item:hover {
  border-color: var(--primary);
}

.check-item input {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
}

.check-item input:checked + span {
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-step-mode {
  padding: 0.4rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-step-mode:hover {
  color: var(--on-primary);
  background: var(--primary);
}

.steps-list-compact {
  gap: var(--space-2);
}

.steps-list-compact .step-item {
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.step-num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: 50%;
}

.step-content p {
  margin: 0;
  font-size: var(--fs-sm);
}

.btn-step-timer {
  margin-top: var(--space-2);
  padding: 0.38rem 0.8rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.btn-step-timer:hover {
  color: var(--on-primary);
  background: var(--primary);
}

.btn-step-timer.btn-step-timer-lg {
  padding: 0.65rem 1.3rem;
  font-size: var(--fs-md);
}

.step-focus-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-focus-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.step-focus-counter {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--primary-text);
}

.btn-exit-step-mode {
  padding: 0.38rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-exit-step-mode:hover {
  background: var(--hover);
}

.step-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: var(--border);
  border-radius: var(--radius-pill);
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.step-focus-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.step-focus-badge {
  padding: 0.3rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.step-focus-text {
  max-width: 34ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.4;
}

.step-focus-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.btn-step-nav {
  flex: 1;
  max-width: 240px;
  padding: 0.75rem 1rem;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--ease);
}

.btn-step-nav:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-step-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-step-nav.is-primary {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

.btn-step-nav.is-primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

/* ---------- 7. Comparador de supermercados ---------- */
.market-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.market-controls,
.market-breakdown {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.market-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.market-controls-compact {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.market-location-bar,
.market-sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.market-sort-row {
  justify-content: space-between;
}

.market-label {
  font-size: var(--fs-xs);
  font-weight: 700;
}

.market-select {
  max-width: 100%;
  padding: 0.38rem 0.65rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.market-select:hover,
.market-select:focus {
  border-color: var(--primary);
}

.btn-gps {
  padding: 0.38rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-gps:hover {
  background: var(--hover);
}

.btn-gps.is-active {
  color: var(--success);
  background: rgba(22, 163, 74, 0.14);
  border-color: var(--success);
}

.gps-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.market-sort-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sort-pill {
  padding: 0.36rem 0.72rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.sort-pill:hover {
  background: var(--hover);
}

.sort-pill.is-active {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

.market-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: var(--space-3);
  align-items: start;
}

.market-chains-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.market-chain-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-left: 4px solid var(--chain-color, var(--primary));
  border-radius: var(--radius-md);
  transition: var(--ease);
}

.market-chain-card:hover {
  transform: translateX(2px);
  border-color: var(--chain-color, var(--primary));
}

.market-chain-card.is-selected {
  background: var(--surface);
  border-color: var(--chain-color, var(--primary));
  box-shadow: var(--shadow-sm);
}

.chain-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.chain-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.chain-rank {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--text-muted);
}

.chain-badge {
  padding: 0.12rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--chain-color, var(--primary));
  border-radius: var(--radius-pill);
}

.chain-name {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
}

.chain-price {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 800;
  white-space: nowrap;
}

.chain-price small {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.chain-branch-compact {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chain-branch-compact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-map-link {
  font-weight: 700;
  color: var(--primary-text);
  text-decoration: none;
  white-space: nowrap;
}

.chain-map-link:hover {
  text-decoration: underline;
}

.market-breakdown {
  padding: var(--space-3);
}

.market-breakdown-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.market-breakdown-head h4 {
  font-size: var(--fs-sm);
  font-weight: 800;
}

.market-note {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.breakdown-total {
  padding: 0.32rem 0.75rem;
  font-size: var(--fs-xs);
  white-space: nowrap;
  color: var(--primary-text);
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
}

.market-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.market-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.42rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.market-item-row:hover {
  border-color: var(--primary);
}

.market-item-row.is-owned {
  opacity: 0.65;
}

.market-item-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.market-item-check input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.market-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.market-item-price {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.market-item-price s {
  margin-right: var(--space-1);
  font-weight: 500;
  color: var(--text-muted);
}

.btn-gondola {
  padding: 0.25rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--primary-text);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.btn-gondola:hover {
  color: var(--on-primary);
  background: var(--primary);
}

/* ---------- 8. Temporizador flotante ---------- */
.floating-timer {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  color: #ffffff;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: var(--ease);
}

.floating-timer.is-finished {
  background: #15803d;
  animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
  }
}

.timer-info {
  display: flex;
  flex-direction: column;
}

.timer-label {
  max-width: 170px;
  overflow: hidden;
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.timer-display {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timer-actions {
  display: flex;
  gap: var(--space-1);
}

.timer-btn {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.timer-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------- 8B. Estudio de Receta (receta.html) ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.studio-topbar-inner {
  max-width: 1440px;
}

.studio-nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.btn-back-menu {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-back-menu:hover {
  background: var(--hover);
  border-color: var(--primary);
  transform: translateX(-2px);
}

.brand-compact {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-compact strong {
  font-family: var(--font-display);
  font-size: var(--fs-md);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.studio-topbar-controls {
  gap: var(--space-2);
}

.btn-fav-header {
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-fav-header:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-fav-header.is-fav {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
  border-color: var(--danger);
}

.recipe-studio {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-6);
}

.studio-loading {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.recipe-studio-grid {
  display: grid;
  grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
  gap: var(--space-4);
  align-items: stretch;
}

.studio-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.studio-visual-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.visual-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.visual-key-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.fact-pill {
  padding: 0.22rem 0.6rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Media Studio */
.media-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.28rem;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.media-tab-btn {
  padding: 0.45rem 0.6rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.media-tab-btn:hover:not(.is-active) {
  color: var(--text);
  background: var(--hover);
}

.media-tab-btn.is-active {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.media-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.media-main-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  font-size: 1.35rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.58);
  border: 0;
  border-radius: 50%;
  transition: var(--ease);
}

.media-arrow:hover {
  background: rgba(15, 23, 42, 0.85);
}

.media-arrow.is-prev {
  left: 0.65rem;
}

.media-arrow.is-next {
  right: 0.65rem;
}

.media-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.55rem 0.8rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.media-counter {
  font-weight: 700;
  color: var(--primary-text);
  white-space: nowrap;
}

.media-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.thumb-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  transition: var(--ease);
}

.thumb-wrap.is-active {
  border-color: var(--primary);
}

.media-thumb-btn {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.media-thumb-btn img {
  display: block;
  width: 74px;
  height: 48px;
  object-fit: cover;
}

.thumb-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(220, 38, 38, 0.88);
  border: 0;
  border-radius: 50%;
}

/* Video Studio */
.video-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.video-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #0f172a;
}

.video-frame-wrap iframe,
.video-native-player {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

.video-native-player {
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.video-guide-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 230px;
  padding: var(--space-4);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.video-guide-badge {
  padding: 0.25rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--primary-text);
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
}

.video-guide-step {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text-muted);
}

.video-guide-text {
  margin: 0;
  max-width: 42ch;
  font-size: var(--fs-md);
  font-weight: 600;
}

.video-guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.video-chapters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chapter-pill {
  padding: 0.32rem 0.7rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.chapter-pill.is-active {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

/* Custom media upload/URL panel */
.custom-media-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.custom-media-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.custom-media-block h4 {
  font-size: var(--fs-sm);
  font-weight: 800;
}

.custom-media-hint {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.custom-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.studio-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  font-size: var(--fs-xs);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.btn-studio-primary {
  padding: 0.45rem 0.9rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.btn-studio-primary:hover {
  background: var(--primary-strong);
}

.custom-video-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  padding: 0.4rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  color: var(--primary-text);
  background: var(--surface);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.file-upload-btn:hover {
  background: var(--primary-soft);
}

.btn-studio-ghost {
  padding: 0.4rem 0.8rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.btn-studio-ghost:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.media-feedback {
  padding: 0.5rem 0.8rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
  border-radius: var(--radius-sm);
}

/* Cabecera visual integrada */
.studio-visual-card .media-tabs-bar {
  margin-bottom: 0;
}

.tech-sheet-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.studio-recipe-title {
  font-size: clamp(1.3rem, 1.05rem + 0.85vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
}

.studio-recipe-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Panel derecho único con 4 pestañas */
.studio-tabbed-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.studio-main-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.32rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.studio-main-tab-btn {
  padding: 0.55rem 0.65rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}

.studio-main-tab-btn:hover:not(.is-active) {
  color: var(--text);
  background: var(--hover);
}

.studio-main-tab-btn.is-active {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.studio-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Control de Calorías y Dietas */
.nutrition-diet-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nutrition-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.nutrition-head h2 {
  font-size: var(--fs-lg);
  font-weight: 800;
}

.nutrition-sub {
  margin: 0.15rem 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.diet-select-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.diet-select-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
}

.macros-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.macro-box {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.macro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
}

.macro-box strong {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
}

.macro-box strong small {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
}

.macro-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.macro-bar {
  width: 100%;
  height: 6px;
  margin-top: auto;
  overflow: hidden;
  background: var(--border);
  border-radius: var(--radius-pill);
}

.macro-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.macro-box.is-kcal .macro-bar span {
  background: #f97316;
}

.macro-box.is-protein .macro-bar span {
  background: #10b981;
}

.macro-box.is-carbs .macro-bar span {
  background: #3b82f6;
}

.macro-box.is-fat .macro-bar span {
  background: #eab308;
}

.diet-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.diet-tag-pill {
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
}

.diet-compatibility-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 0.65rem 0.9rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.diet-compatibility-banner.is-optimal {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.1);
}

.diet-compatibility-banner.is-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.diet-compat-badge {
  padding: 0.18rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.diet-compatibility-banner.is-optimal .diet-compat-badge {
  background: var(--success);
}

.diet-compatibility-banner.is-warning .diet-compat-badge {
  background: #d97706;
}

.light-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.light-switch-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.light-switch-label input {
  accent-color: var(--success);
  width: 17px;
  height: 17px;
}

.light-tip-text {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 1080px) {
  .recipe-studio-grid {
    grid-template-columns: 1fr;
  }

  .macros-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .modal-card {
    overflow-y: auto;
  }

  .recipes-grid,
  .studio-main-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-split-layout,
  .checklist-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .recipe-studio {
    padding: var(--space-3);
  }

  .media-tabs-bar {
    grid-template-columns: 1fr;
  }

  .studio-main-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .macros-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    padding: var(--space-3);
  }

  .topbar-controls {
    justify-content: stretch;
  }

  .search-box {
    flex-basis: 100%;
    max-width: none;
    order: 3;
  }

  .theme-switcher {
    flex: 1;
    justify-content: space-between;
  }

  .main-stage {
    padding: var(--space-3) var(--space-3) var(--space-5);
  }

  .wheel-section {
    padding: var(--space-3);
  }

  .radial-menu-container {
    height: min(94vw, 66vh);
    min-height: 310px;
  }

  .legend-tip {
    flex-basis: 100%;
    text-align: center;
  }

  .modal-overlay {
    padding: var(--space-2);
  }

  .modal-card {
    max-height: 95vh;
    padding: var(--space-4);
  }

  .recipes-grid,
  .recipe-tabs {
    grid-template-columns: 1fr;
  }

  .modal-mini-stats {
    margin-left: 0;
  }

  .results-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .market-sort-row {
    flex-direction: column;
    align-items: stretch;
  }

  .market-item-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .step-focus-view {
    padding: var(--space-3);
  }

  .step-focus-card {
    padding: var(--space-5) var(--space-3);
  }

  .floating-timer {
    right: var(--space-2);
    left: var(--space-2);
    bottom: var(--space-2);
    justify-content: space-between;
  }
}

/* Barra de Adaptación de Ingredientes por Dieta (Estudio de Receta) */
.diet-adapt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.diet-adapt-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.diet-adapt-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.diet-adapt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.diet-adapt-toggle input {
  accent-color: var(--primary);
}

.diet-ok-pill {
  padding: 0.25rem 0.65rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
  border-radius: var(--radius-pill);
}

.cb-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #065f46;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: var(--radius-pill);
}

.check-item.is-adapted {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.07);
}

.ing-adapt-meta {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ing-adapt-badge {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  margin-right: 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #065f46;
  background: rgba(16, 185, 129, 0.18);
  border-radius: var(--radius-pill);
}

/* ---------- 10. Rediseño Móvil / APK, Chips Rápidos, Ideas para Ahora y Modo Cocina ---------- */
.visual-header h1,
.studio-visual-card h1 {
  font-family: var(--font-editorial);
  font-size: clamp(1.35rem, 1.05rem + 1vw, 1.85rem);
  font-weight: 700;
  line-height: 1.18;
}

.theme-cycle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.15rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.theme-cycle-btn:hover {
  background: var(--hover);
  transform: scale(1.04);
}

.quick-filter-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin-top: var(--space-3);
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
}

.quick-chip:hover {
  border-color: var(--primary);
  color: var(--primary-text);
  transform: translateY(-1px);
}

.quick-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.tag-gf {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  font-weight: 700;
}

[data-theme="dark"] .tag-gf {
  color: #86efac;
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
}

.tag-video {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  font-weight: 700;
}

[data-theme="dark"] .tag-video {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.35);
}

.media-tab-btn.has-video:not(.is-active) {
  color: var(--primary-text);
  background: var(--primary-soft);
}

.video-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.video-meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}

.video-meta-info strong {
  font-size: var(--fs-xs);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-meta-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-yt-external {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary-text);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--ease);
}

.btn-yt-external:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.video-active-step-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
}

.video-active-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.video-active-step-label {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--primary-text);
}

.video-active-step-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-mark-time,
.btn-reset-times {
  min-height: 32px;
  padding: 0.22rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: var(--ease);
}

.btn-mark-time:hover,
.btn-reset-times:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}

.video-active-step-text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text);
}

.video-active-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chapter-time {
  font-size: 0.7rem;
  opacity: 0.82;
}

/* Sección Ideas para ahora */
.now-ideas-section {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.now-ideas-section:empty {
  display: none;
}

.now-ideas-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.now-ideas-header h2 {
  font-family: var(--font-editorial);
  font-size: clamp(1.2rem, 1rem + 0.65vw, 1.5rem);
  font-weight: 700;
}

.now-ideas-sub {
  margin: 0.15rem 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.now-ideas-more-btn {
  min-height: 40px;
  padding: 0.42rem 0.9rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.now-ideas-more-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
}

.now-ideas-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: start;
}

.now-ideas-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.68rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.now-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
}

.now-col-count {
  padding: 0.14rem 0.52rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--primary-text);
  border: 1px solid var(--border);
}

.now-ideas-col-fast .now-col-header {
  color: var(--accent);
}

.now-ideas-col-medium .now-col-header {
  color: var(--primary-text);
}

.now-col-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.now-col-empty {
  margin: 0.5rem 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
}

.now-idea-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
  overflow: hidden;
  padding: 0.72rem 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.now-idea-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.now-idea-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.now-idea-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-text);
}

.now-idea-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.now-idea-fav.is-fav {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}

.now-idea-title {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  min-height: 2.5em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.now-idea-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.55rem;
}

.now-idea-tags .tag {
  display: inline-flex;
  align-items: center;
  height: auto;
  padding: 0.14rem 0.46rem;
  font-size: 0.68rem;
  line-height: 1.2;
}

.now-idea-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  margin-top: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Botón Screen Wake Lock (Modo Cocina) */
.btn-wake-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.34rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-wake-lock:hover {
  border-color: var(--primary);
}

.btn-wake-lock.is-active {
  color: #15803d;
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.55);
}

[data-theme="dark"] .btn-wake-lock.is-active {
  color: #86efac;
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.5);
}

/* Barra inferior móvil nativa */
.mobile-bottom-nav {
  display: none;
}

.mobile-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

/* Evitar selección accidental al tocar controles */
.radial-menu-container,
.quick-chip,
.legend-item,
.mobile-bottom-nav button,
.btn-surprise {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@keyframes slideUpSheet {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding-top: env(safe-area-inset-top);
  }

  .topbar-inner {
    padding: 0.65rem 0.9rem;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .brand,
  .studio-nav-left {
    order: 1;
    margin-right: auto;
  }

  .brand-sub {
    display: none;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .topbar-controls {
    display: contents;
  }

  .theme-switcher,
  #favorites-toggle {
    display: none;
  }

  .theme-cycle-btn {
    display: inline-flex;
    order: 2;
  }

  .cb-auth-btn,
  .btn-fav-header {
    order: 2;
    min-height: 44px;
    padding: 0 12px;
  }

  .topbar-controls .search-box {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
    height: 44px;
    order: 3;
  }

  .cb-guest-inline {
    display: none;
  }

  .quick-filter-chips {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .quick-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .now-ideas-section {
    padding: var(--space-3);
    margin-top: var(--space-4);
  }

  .now-ideas-columns {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .now-idea-card {
    flex: none;
    max-width: none;
  }

  /* Bottom Sheet para Resultados en móvil */
  #results-modal.modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #results-modal .modal-card-list {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
    padding: 1.5rem 1rem calc(1rem + env(safe-area-inset-bottom));
    animation: slideUpSheet 0.22s ease-out;
  }

  #results-modal .modal-card-list::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
  }

  .modal-close,
  .btn-wake-lock,
  .btn-fav-modal,
  .btn-back-results,
  .btn-surprise,
  .legend-item {
    min-height: 44px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface-glass);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }

  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease;
  }

  .mobile-bottom-nav button .mobile-nav-icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .mobile-bottom-nav button.is-active {
    color: var(--primary-text);
    background: var(--primary-soft);
  }

  .floating-timer {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

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

/* ---------- 11. Filtros inteligentes: Horario, Estación y Calorías ---------- */
.smart-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0;
}

.smart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 34px;
  padding: 0.34rem 0.78rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.smart-toggle:hover {
  border-color: var(--primary);
}

.smart-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.45;
  flex-shrink: 0;
  transition: background-color 0.16s ease, opacity 0.16s ease;
}

.smart-toggle.is-active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.22);
}

.smart-toggle.is-active .smart-toggle-dot {
  background: #bef264;
  opacity: 1;
}

.smart-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.2rem 0.45rem 0.2rem 0.72rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.smart-select-wrap.is-filtered {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.smart-select {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.15rem 0.25rem 0.15rem 0.1rem;
  cursor: pointer;
  outline: none;
}

@media (max-width: 768px) {
  .wheel-header-right,
  .smart-filters-bar {
    width: 100%;
    justify-content: center;
  }
  .smart-toggle,
  .smart-select-wrap {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.brand-logo-sm {
  width: 36px;
  height: 36px;
}

/* ---------- 12. Layout 2 columnas: Panel lateral izquierdo + Menú circular ---------- */
.wheel-workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.wheel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sidebar-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sidebar-toggle {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
}

.sidebar-select-wrap {
  width: 100%;
  min-height: 40px;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.sidebar-select-wrap .smart-select {
  width: 100%;
  font-size: var(--fs-sm);
  padding: 0.25rem 0.2rem;
}

.sidebar-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0;
  justify-content: stretch;
}

.sidebar-chips .quick-chip {
  width: 100%;
  justify-content: center;
  padding: 0.42rem 0.45rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

.sidebar-surprise {
  width: 100%;
  margin-top: 0.2rem;
  justify-content: center;
}

.wheel-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 920px) {
  .wheel-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .wheel-main {
    order: -1;
  }
  .sidebar-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sidebar-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 13. Splash Screen de bienvenida (5 segundos) ---------- */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, #ffffff 45%, #fbf7f1 100%);
  opacity: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-splash.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: min(560px, 92vw);
  animation: splashFadeIn 0.5s ease-out both;
}

.app-splash-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 18px;
}

.app-splash-progress {
  width: min(320px, 80%);
  height: 6px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.16);
  overflow: hidden;
}

.app-splash-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #d97706);
  animation: splashProgress 5s linear forwards;
}

.app-splash-skip {
  padding: 0.42rem 1rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b5d4d;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(107, 93, 77, 0.22);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.app-splash-skip:hover {
  color: #1f2937;
  border-color: #d97706;
  background: #fffbeb;
}

@keyframes splashFadeIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splashProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ---------- 14. Pestañas de vista principal (Menú Circular / Ideas por tiempo) ---------- */
.home-view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.3rem;
  margin-bottom: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

.home-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.home-tab-btn:hover {
  color: var(--text);
}

.home-tab-btn.is-active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.24);
}

.wheel-main .now-ideas-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

@media (max-width: 640px) {
  .home-view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .home-tab-btn {
    justify-content: center;
    padding: 0.5rem 0.6rem;
    font-size: var(--fs-xs);
  }
}
