/* ============================================================
   .campus · Academia de Baristas — hoja de estilos única
   1. Variables (colores, tipografía, medidas)
   2. Base
   3. Estructura: encabezado, navegación, migas, pie
   4. Componentes compartidos
   5. Portada
   6. Academia: menú, estaciones, recursos
   7. Módulos: fruto, poscosecha, verde, tueste, preparación, sensorial
   8. Laboratorio
   9. Desafíos y Capacitarse
   10. Animaciones y movimiento reducido
   ============================================================ */

/* ---------- 1. Variables ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff;          /* fondo de página */
  --surface: #fff;        /* tarjetas y paneles */
  --surface-2: #f0f0ed;   /* áreas de ilustración claras */
  --soft: #f4f4f2;        /* fondos suaves dentro de tarjetas */
  --ink: #000000;         /* texto principal */
  --muted: #575a55;       /* texto secundario */
  --line: #e1e1dd;        /* bordes */
  --line-strong: #c6c8c2;
  --primary: #263b2a;     /* verde de acción */
  --primary-ink: #fff;
  --sage: #596b55;        /* acento verde secundario */
  --terra: #6e4a33;       /* acento: marrón de tueste */
  --hl: #5c3a24;          /* texto destacado sobre fondo claro */
  --accent: #c9a96a;      /* relleno dorado (barras, marcadores) */
  --dark: #1f221e;        /* paneles oscuros (instrumentos) */
  --on-dark: #f1eee6;
  --on-dark-muted: #c9c5b9;
  --gold-on-dark: #e5cb87;
  --ok-bg: #e8efe5; --ok-line: #66815e;
  --no-bg: #f8e9e3; --no-line: #b66c50;

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1180px;
  --gutter: 30px;
  --header-h: 76px;
  --nb-h: 64px;
  --shadow: none;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); letter-spacing: .005em;
  -webkit-tap-highlight-color: transparent;
}
a, button, input, select, summary { touch-action: manipulation }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; text-transform: uppercase; margin: 0 0 .4em; color: var(--ink) }
h3 { text-transform: none; font-weight: 500; letter-spacing: 0 }
h1 { font-size: 2.8rem }
h2 { font-size: 1.9rem }
h3 { font-size: 1.2rem }
h4 { font-size: 1rem; margin: 1em 0 .3em }
p { margin: .4em 0 }
a { color: inherit }
img { max-width: 100% }
button { font: inherit; color: inherit; cursor: pointer }
svg { display: block; width: 100%; height: auto }
table { width: 100%; border-collapse: collapse; font-size: .88rem }
td, th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
th { color: var(--hl); font-weight: 600; letter-spacing: .02em }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px }
[hidden] { display: none !important }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

#v { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter) 40px; overflow-x: hidden }

/* Utilidades de texto heredadas de la maqueta */
.k { font-size: .85rem; color: var(--muted); font-weight: 600 }
.m, .muted { color: var(--muted) }
.hl { color: var(--hl) }
.eyebrow { font-size: .85rem; color: var(--muted); font-weight: 600 }
.num { font: 600 1.6rem var(--display); color: var(--line-strong) }

/* ---------- 3. Estructura ---------- */
#hd {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  min-height: var(--header-h); padding: 10px max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); flex: none }
.brand img { height: 54px; width: auto; filter: brightness(0) }
.brand-caption { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 1px solid var(--line-strong); line-height: 1.2 }
.brand-caption span { font-size: .8rem; color: var(--muted) }
.brand-caption b { font: 600 1.15rem var(--display); letter-spacing: .02em }
.main-nav { margin-left: auto; display: flex; gap: 4px }
.main-nav a, #nb a {
  text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--muted);
}
.main-nav a { padding: 10px 14px; border-radius: var(--radius-sm); border-bottom: 2px solid transparent }
.main-nav a:hover { color: var(--ink); background: rgba(38, 59, 42, .06) }
.main-nav a[aria-current=page] { color: var(--primary); border-bottom-color: var(--primary); border-radius: var(--radius-sm) var(--radius-sm) 0 0 }

#nb { display: none }

.crumbs { margin: 10px 0 18px; font-size: .82rem; color: var(--muted) }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center }
.crumbs li + li::before { content: '/'; margin: 0 9px; color: var(--line-strong) }
.crumbs a { display: inline-block; padding: 8px 0; color: var(--sage); font-weight: 600; text-decoration: none }
.crumbs a:hover { text-decoration: underline }
.crumbs [aria-current=page] { color: var(--ink) }

.site-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding: 20px 0 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .75rem; font-weight: 700;
}
.site-foot img { height: 56px; width: auto; filter: brightness(0) }
.site-foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 3px }

/* ---------- 4. Componentes compartidos ---------- */
/* Botones (.b) — también funcionan como enlaces <a class="b"> */
.b {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--sage); background: transparent; color: #283126;
  font-weight: 600; text-decoration: none; text-align: center; line-height: 1.25;
  transition: background .2s, transform .15s;
}
.b:hover:not(:disabled) { background: rgba(89, 107, 85, .09) }
.b:active:not(:disabled) { transform: scale(.97) }
.b.p { background: var(--primary); border-color: var(--primary); color: var(--primary-ink) }
.b.p:hover:not(:disabled) { background: #1b2b1e }
.b:disabled { opacity: .45; cursor: default }
.bar { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap }
.bar .b { flex: 1 1 180px }

.chip {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; margin: 0 6px 8px 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: #343b32;
  font-size: .9rem;
}
.chip:hover { border-color: var(--sage) }
.chip[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: #fff }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 12px; box-shadow: var(--shadow) }
.panel > h3:first-child { margin-top: 0 }
.panel p { line-height: 1.65 }
.panel > svg { max-width: 560px }

.dato { border-left: 3px solid var(--terra); padding-left: 12px; margin: 12px 0 }
.tech { display: none; margin-top: 10px; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px }
.tech.show { display: block }

/* Área de ilustración. .dark: gráficos pensados para fondo oscuro (curvas, instrumentos). */
.stage { width: min(100%, 460px); margin: 12px auto; padding: 12px; border-radius: 16px; background: var(--surface-2); overflow: hidden }
.stage.dark { background: var(--dark); color: var(--on-dark) }
.stage svg { width: 100%; max-height: 420px; margin: 0 auto }
.stage:has(.roast-curve-visual), .stage:has(#mc) { width: min(100%, 560px) }

.dots { display: flex; gap: 8px; justify-content: center; margin: 10px 0 }
/* Anatomía del fruto: los controles van dentro del visualizado, así el gráfico se ve mientras se usan */
.cherry-stage { display: flex; flex-direction: column; gap: 8px }
.cherry-top { display: flex; justify-content: center }
.cherry-top .b, .cherry-nav .b { min-height: 44px; padding: 8px 16px }
.cherry-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px }
.cherry-nav .b { background: var(--surface) }
.cherry-arrow { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0 !important; border-radius: 50% }
.cherry-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round }
.cherry-now { text-align: center; font-weight: 600; font-size: .9rem; line-height: 1.2 }
.cherry-now .dots { margin: 6px 0 0 }
@media (max-width: 650px) {
  .cherry-stage svg { max-height: 40vh }
}
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong) }
.dots i.s { background: var(--sage) }
.dots i.c { background: var(--terra); transform: scale(1.5) }

.opt {
  display: block; width: 100%; min-height: 50px; margin: 8px 0; padding: 10px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.opt:hover:not(:disabled) { border-color: var(--sage) }
.opt:disabled { cursor: default }
.opt.ok { background: var(--ok-bg); border-color: var(--ok-line); animation: pp .35s }
.opt.no { background: var(--no-bg); border-color: var(--no-line) }

.big { font: 600 2.6rem/1.1 var(--display); color: var(--primary) }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px }
.stat b { display: block; font: 600 1.5rem var(--display); color: var(--primary) }

label { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: .9rem; font-weight: 500; color: var(--muted) }
label span { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums }

/* Controles deslizantes */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; accent-color: var(--primary) }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--line-strong); border-radius: 2px }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; border: 0; background: var(--primary); box-shadow: 0 0 0 6px rgba(38, 59, 42, .12) }
input[type=range]::-moz-range-track { height: 4px; background: var(--line-strong); border-radius: 2px }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--primary) }

/* Campos de formulario */
.ti { width: 100%; min-height: 46px; margin: 2px 0 10px; padding: 0 12px; background: var(--surface); color: var(--ink); border: 1px solid #d2d5cc; border-radius: var(--radius-sm); font: 16px var(--font) }
textarea.ti { min-height: 96px; padding: 10px 12px }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px }
.form-grid .wide { grid-column: 1 / -1 }
.field-hint { font-size: .78rem; color: var(--muted); margin: -4px 0 10px }
.form-error { color: #a34f36; font-weight: 600; min-height: 1em }
.field-error { display: block; margin: -6px 0 10px; font-size: .8rem; font-weight: 600; color: #a34f36 }
.field-error:empty { display: none }
.ti[aria-invalid] { border-color: #b66c50; box-shadow: 0 0 0 2px rgba(182, 108, 80, .18) }
.more-fields { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft) }
.more-fields > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; min-height: 46px }
.more-fields > .form-grid { padding: 4px 14px 4px }

.workspace-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px }
.workspace-tabs button {
  flex: 1 1 160px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  min-height: 60px; padding: 10px 16px; text-align: left; border: 1px solid #d2d5cc; border-radius: 12px; background: var(--surface); color: #374033;
}
.workspace-tabs button b { font-size: .88rem }
.workspace-tabs button small { font-size: .75rem; opacity: .78 }
.workspace-tabs button[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: #fff }

/* Aviso breve */
#tt {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translate(-50%, 12px);
  padding: 9px 18px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600; font-size: .88rem;
  opacity: 0; pointer-events: none; transition: .3s; white-space: nowrap;
}
#tt.show { opacity: 1; transform: translate(-50%, 0) }
#tt.has-action { pointer-events: auto; display: flex; align-items: center; gap: 12px; white-space: normal; max-width: calc(100% - 32px) }
#tt button { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px; background: transparent; color: #fff; font-weight: 700 }

/* ---------- 5. Portada ---------- */
.home-hero {
  display: grid; grid-template-columns: 1.05fr .95fr; grid-template-rows: 1fr auto;
  margin-top: 18px; background: #f2f2ef; border: 1px solid #e1e1dd; overflow: hidden;
}
.hero-copy { padding: 56px clamp(28px, 5vw, 80px) 40px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center }
.hero-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; font-size: .75rem; font-weight: 700; color: var(--sage) }
.hero-eyebrow i { width: 28px; height: 1px; background: var(--line-strong) }
.home-hero h1 { font-size: clamp(3.2rem, 6.4vw, 6.4rem); line-height: .92; letter-spacing: -.04em; margin: 18px 0 22px }
.home-hero p { max-width: 520px; font-size: 1.05rem; line-height: 1.75; color: #555b53 }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 30px }
.hero-signature { font-size: .75rem; font-weight: 700; color: var(--muted) }
.hero-signature span { padding: 0 7px; color: var(--terra) }
.hero-photo-wrap { position: relative; margin: 0; min-height: 480px; overflow: hidden; background: #e6e6e2 }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.08) }
.hero-photo-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .78), transparent 58%) }
.photo-note { position: absolute; z-index: 2; left: 28px; right: 28px; bottom: 32px; display: flex; flex-direction: column; gap: 5px; color: #fff }
.photo-note b { font-size: .75rem; }
.photo-note span { font-size: .85rem; color: #ddd }
.photo-index { position: absolute; z-index: 2; top: 22px; right: 22px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .7); color: #fff; font-size: .75rem; }
.hero-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding: 14px 26px; border-top: 1px solid #dcdcd8; color: var(--muted); font-size: .75rem; font-weight: 700; }

.section-intro { display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 48px; margin: 72px 0 28px }
.section-intro h2 { font-size: clamp(2.5rem, 4.5vw, 4.3rem); line-height: .96; margin: 14px 0 0 }
.section-intro p { max-width: 470px; margin: 0 0 6px; font-size: .95rem; line-height: 1.8 }
.section-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 56px }
.section-card {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 230px; padding: 22px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s;
}
.section-card:hover { border-color: var(--sage); transform: translateY(-2px) }
.card-top { display: flex; align-items: center; justify-content: space-between }
.section-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--sage) }
.card-number { font-size: .75rem; font-weight: 700; color: var(--sage) }
.section-card strong { display: block; margin: 26px 0 8px; font: 600 1.45rem var(--display); text-transform: uppercase; letter-spacing: -.02em }
.section-card small { display: block; min-height: 52px; color: var(--muted); font-size: .8rem; line-height: 1.6 }
.card-link { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .75rem; font-weight: 800; color: var(--muted) }
.card-link b { font-size: 1.1rem; color: var(--ink) }

.learning-banner { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 30px; padding: 36px 42px; background: #000000; color: #fff }
.learning-mark { font: 700 5rem/.8 var(--display); letter-spacing: -.1em; color: #4a4d47 }
.learning-mark span { color: #fff }
.learning-banner .k { color: #aab3a6 }
.learning-banner h3 { margin: 10px 0; color: #fff; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1; font-weight: 500 }
.learning-banner p { margin: 0; max-width: 590px; color: #b9bcb4; font-size: .88rem; line-height: 1.7 }
.learning-banner .b { border-color: #8c9488; color: #fff; white-space: nowrap }
.learning-banner .b:hover { background: #fff; color: var(--ink) }

/* ---------- 6. Academia ---------- */
.academy-menu { display: grid; gap: 22px; margin: 6px 0 30px }
.academy-menu-head { padding: 10px 0 14px; border-bottom: 1px solid var(--line) }
.academy-menu-head h2 { margin: 8px 0; font-size: clamp(1.9rem, 3.2vw, 2.5rem) }
.academy-menu-head p { max-width: 640px }
.academy-group h3 { font-size: 1rem; margin: 0 0 10px }
.academy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.academy-module {
  display: flex; flex-direction: column; justify-content: space-between; gap: 9px;
  min-height: 128px; padding: 15px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.academy-module.active { border-color: rgba(110, 74, 51, .4) }
.academy-module.active:hover { border-color: var(--terra); transform: translateY(-1px) }
.academy-module:disabled { background: #f5f5f2; color: #7a7e76; cursor: default }
.academy-module .mod-no { font-size: .75rem; color: var(--hl); font-weight: 600 }
.academy-module:disabled .mod-no { color: #9a9d95 }
.academy-module strong { display: block; font-size: .96rem; line-height: 1.2 }
.academy-module small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.4 }
.academy-module .mod-foot { font-size: .75rem; font-weight: 600; color: var(--muted) }
.academy-module.active .mod-foot { color: var(--hl) }
.academy-resources { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line) }

/* Próximo paso (portada) */
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--terra); border-radius: var(--radius) }
.next-step h2 { font-size: 1.5rem; margin: 6px 0 4px }
.next-step .b { flex: none }

/* Portada personal (cuando ya empezaste el recorrido) */
.me-head { margin: 36px 0 20px }
.me-head h2 { margin: 8px 0 6px; font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1 }
.me-head .menu-progress { margin-top: 12px }
.me-stack { display: grid; gap: 26px; min-width: 0 }
.me-h { margin: 0 0 10px; font-size: 1.05rem }
.home-resume { padding: 24px 26px }
.home-resume h2 { margin: 6px 0 4px; color: #fff; font-size: 1.6rem }
.mini-steps { display: flex; gap: 6px; margin-top: 14px }
.mini-steps i { width: 28px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25) }
.mini-steps i.d { background: var(--gold-on-dark) }
.mini-steps i.c { background: #fff }
.suggest-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px }
.suggest-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s }
.suggest-card:hover { border-color: var(--terra) }
.suggest-card > span:nth-child(2) { flex: 1; min-width: 0 }
.suggest-card b { display: block; font-size: .95rem; line-height: 1.25 }
.suggest-card small { display: block; color: var(--muted); font-size: .8rem }
.suggest-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f2f2ef; color: var(--terra) }
.me-empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: .9rem }
/* Tu última prueba en el Laboratorio: una fila compacta, del mismo peso que las sugerencias */
.lab-last { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
.lab-last-body { flex: 1; min-width: 180px }
.lab-last .k { font-size: .68rem }
.lab-last h2 { margin: 2px 0 0; font: 600 1rem/1.3 var(--font); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere }
.lab-last h2 a { color: inherit; text-decoration: none }
.lab-last h2 a:hover { text-decoration: underline }
.lab-last h2 .m { font-weight: 400 }
.lab-last-line { margin: 2px 0 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums }
.lab-last-actions { display: flex; gap: 8px; flex: none }
.b.sm { min-height: 40px; padding: 0 14px; font-size: .88rem }
@media (max-width: 650px) {
  .lab-last-actions { flex: 1 1 100% }
  .lab-last-actions .b { flex: 1 }
}
.course-teaser { padding: 16px 18px; border-left: 3px solid var(--terra); border-radius: 0 12px 12px 0; background: var(--surface) }
.course-teaser p { margin: 6px 0 0; color: #3d423b }
.course-teaser a { display: block; margin-top: 8px; color: var(--hl); font-weight: 600; text-decoration: none }
.course-teaser a:hover { text-decoration: underline }
.course-teaser.is-strong { border-left-width: 4px }
.spaces-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 44px }
.spaces-row a { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .86rem; transition: border-color .2s }
.spaces-row a:hover { border-color: var(--sage) }
.spaces-row a > span:first-child { color: var(--sage) }
.spaces-row b { display: block }
.spaces-row small { color: var(--muted) }
@media (max-width: 899px) {
  .spaces-row { display: none }
}
@media (max-width: 650px) {
  .me-head { margin-top: 14px }
  .home-resume { padding: 20px }
  .home-resume h2 { font-size: 1.35rem }
}

/* Menú de Academia: progreso, estados y próximos módulos */
.menu-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: .85rem; color: var(--muted) }
.menu-progress .progress { flex: 1; max-width: 320px; margin: 0 }
.academy-module.is-done { border-color: var(--ok-line); background: var(--ok-bg) }
.academy-module.is-done .mod-foot { color: var(--sage) }
.academy-soon { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #f5f5f2 }
.academy-soon summary { cursor: pointer; font-weight: 600; color: var(--muted); min-height: 32px; display: flex; align-items: center }
.academy-soon h4 { margin: 14px 0 6px; font-size: .9rem; color: var(--ink) }
.academy-soon ul { margin: 0; padding-left: 18px }
.academy-soon li { margin: 4px 0; font-size: .9rem }

/* Tira de estaciones */
.strip { display: flex; gap: 6px; margin: 0 0 18px }
.strip a {
  display: flex; align-items: flex-start; justify-content: center; text-align: center; text-decoration: none;
  flex: 1; min-height: 46px; padding: 8px 2px 0; background: none; border: 0; border-top: 3px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.strip a:hover { color: var(--ink) }
.strip .d { border-color: var(--sage); color: var(--sage) }
.strip .d::after { content: '✓'; margin-left: .3em }
.strip .c { border-color: var(--terra); color: var(--ink) }

/* Navegación entre estaciones (al final de cada estación) */

.quiz h3 { text-transform: none; font-family: var(--font); font-weight: 600; font-size: 1.05rem; letter-spacing: 0 }

/* Recorrido guiado: cabecera de estación, pasos, consigna y pie con el próximo paso */
.station-head { margin: 4px 0 0 }
.station-head h2 { margin: .25em 0 .3em }
.station-goal { max-width: 720px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6 }

/* Línea de pasos de la estación: completo en verde con ✓, actual con aro marrón, pendiente en gris */
.stepper { --dot: 30px; list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); scroll-margin-top: calc(var(--header-h) + 12px) }
.stepper li { position: relative }
.stepper li + li::before { content: ''; position: absolute; top: calc(var(--dot) / 2 - 1px); right: calc(50% + var(--dot) / 2 + 6px); left: calc(-50% + var(--dot) / 2 + 6px); height: 2px; background: var(--line) }
.stepper li.is-linked::before { background: var(--sage) }
.step-pill { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; text-decoration: none; text-align: center; color: var(--muted); font-size: .88rem; font-weight: 500; line-height: 1.25 }
.step-pill:hover { color: var(--ink) }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: var(--dot); height: var(--dot); border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums }
.step-pill.is-done { color: var(--sage) }
.step-pill.is-done .step-n { background: var(--sage); border-color: var(--sage); color: #fff }
.step-pill.is-current { color: var(--ink); font-weight: 700 }
.step-pill.is-current .step-n { outline: 2px solid var(--terra); outline-offset: 2px }
.step-pill.is-current:not(.is-done) .step-n { border-color: var(--terra); color: var(--terra) }

.step-head { margin: 22px 0 6px }
.step-head h3 { margin: 2px 0 0; font-size: 1.35rem }
/* Qué hacer: la instrucción va pegada al control que hay que usar */
.do-it { margin: 16px 0 10px; color: var(--primary); font-weight: 600; line-height: 1.45 }
.do-it-n { color: var(--muted); font-weight: 500; white-space: nowrap }

.step-foot { margin: 28px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft) }
.step-status b { display: block }
.step-status.is-done b { color: var(--sage) }
.step-status ul { margin: 6px 0 0; padding-left: 20px; color: #3d423b }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px }
.step-actions .b.p { min-width: min(100%, 320px) }
.station-done-note { margin: 12px 0 0; font-size: .92rem; color: var(--sage); font-weight: 600 }
.station-done-note.is-pending { color: var(--muted); font-weight: 400 }
.link-btn { min-height: 24px; padding: 0; border: 0; background: none; color: var(--hl); font-weight: 600; text-decoration: underline; text-underline-offset: 3px }
.link-btn:hover { color: var(--terra) }

/* Desafío del paso: ventana que se abre al tocar el botón para avanzar */
#quiz-dlg { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink) }
#quiz-dlg::backdrop { background: rgba(0, 0, 0, .45) }
#quiz-dlg h3 { margin: 6px 0 14px; font: 600 1.15rem/1.35 var(--font); text-transform: none }
#quiz-dlg .opt { width: 100% }
.quiz-dlg-fb { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--soft); line-height: 1.5 }
.quiz-dlg-fb:focus { outline: none }
#quiz-dlg .bar { margin-top: 18px }
@media (max-width: 650px) {
  #quiz-dlg { width: 100%; max-width: none; margin: auto 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0 }
  #quiz-dlg .bar { flex-direction: column }
  #quiz-dlg .bar .b { flex: none; width: 100% }
}
.hint-btn { margin-top: 10px; min-height: 40px; font-size: .88rem }

/* Profundizá: lo que no hace falta para cumplir la consigna queda plegado */
.deeper { margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.deeper > summary { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 12px 16px; list-style: none; cursor: pointer; font-weight: 600 }
.deeper > summary::-webkit-details-marker { display: none }
.deeper > summary span { flex: 1 }
.deeper > summary b { color: var(--hl) }
.deeper > summary::after { content: '+'; margin-left: auto; padding-left: 12px; color: var(--hl); font-size: 1.2rem; line-height: 1 }
.deeper[open] > summary::after { content: '−' }
.deeper > summary:hover { color: var(--hl) }
.deeper-body { padding: 14px 16px 16px; border-top: 1px solid var(--line) }
.deeper-body > :first-child { margin-top: 0 }
.deeper-body .panel:last-child, .deeper-body .post-card:last-child { margin-bottom: 0 }

/* Palabras del glosario dentro del paso: se tocan y muestran la definición ahí mismo */
.term { display: inline; min-height: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline dotted var(--terra); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer }
.term:hover, .term[aria-expanded="true"] { color: var(--hl); text-decoration-style: solid }
.term-def { display: block; margin: 8px 0; padding: 10px 12px; border-left: 3px solid var(--terra); border-radius: 0 8px 8px 0; background: var(--soft); color: var(--ink); font-size: .92rem; line-height: 1.5 }
.term-def b { color: var(--hl) }

/* Grados de tueste: ordenar los granos */
.grade-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 6px }
.grade-bean { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .9rem }
.grade-bean svg { width: 72px; height: 72px }
.grade-bean:hover:not(:disabled) { border-color: var(--sage) }
.grade-bean:disabled { cursor: default; border-color: var(--sage); background: var(--ok-bg); color: var(--sage) }

/* Menú: próximo paso sugerido y recorrido en orden */
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-radius: var(--radius); background: var(--primary); color: #fff }
.resume-card .k { color: #c9d4c3 }
.resume-card h3 { margin: 6px 0 4px; color: #fff; font-size: 1.3rem }
.resume-card .m { margin: 0; color: #d6ddd2 }
.resume-card .b.p { flex: none; background: var(--gold-on-dark); border-color: var(--gold-on-dark); color: var(--ink) }
.resume-card .b.p:hover { background: #f0dca3 }
.academy-path { list-style: none; margin: 0; padding: 0 }
.academy-path > li { display: flex }
.academy-path > li > .academy-module { flex: 1; text-decoration: none }
.academy-module.is-next { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary) }
.academy-module.is-next .mod-no { color: var(--primary) }

@media (max-width: 650px) {
  /* En el celu el encabezado de la estación se achica para que la consigna entre en la primera pantalla:
     el mapa de estaciones queda en Academia (migas), y el avance se ve en los pasos. */
  .station-head h2 { font-size: 1.4rem; margin: .15em 0 .2em }
  .station-goal { font-size: .92rem; line-height: 1.5 }
  .station-goal.is-later { display: none }
  .stepper { --dot: 26px; margin-top: 14px }
  .step-pill { gap: 6px; font-size: .75rem }
  .step-n { font-size: .78rem }
  .step-head { margin: 16px 0 4px }
  .step-head .k { display: none }
  .step-head h3 { margin-top: 0; font-size: 1.2rem }
  .step-foot { padding: 14px }
  .step-actions { flex-direction: column-reverse; align-items: stretch }
  .step-actions > span:empty { display: none }
  .resume-card { flex-direction: column; align-items: stretch }
}

/* Glosario y apuntes */
.resource-head { margin-bottom: 18px }
.resource-head h2 { margin: 7px 0 }
.resource-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; max-width: 760px }
.resource-tools input { flex: 1; min-width: 200px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 16px var(--font) }
.resource-count { margin-bottom: 12px; font-size: .8rem; color: var(--muted) }
.glossary-list, .theory-list { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start }
.glossary-entry, .theory-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
.glossary-entry { padding: 14px 16px }
.glossary-entry summary { display: flex; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; font-weight: 600 }
.glossary-entry summary::-webkit-details-marker { display: none }
.glossary-entry summary::after { content: '+'; color: var(--hl) }
.glossary-entry[open] { border-color: rgba(110, 74, 51, .5) }
.glossary-entry[open] summary::after { content: '−' }
.glossary-entry summary .term-cat { margin-left: auto }
.glossary-entry p { margin: 10px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6 }
.term-cat { font-size: .8rem; color: var(--muted); align-self: center }
.glossary-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px }
.theory-list { grid-template-columns: 1fr }
.theory-card { overflow: hidden; scroll-margin-top: calc(var(--header-h) + 12px) }
.theory-card.open { border-color: rgba(110, 74, 51, .5) }
.theory-card > button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 16px 18px; background: none; border: 0; text-align: left; color: var(--ink) }
.theory-card > button small { display: block; margin-top: 5px; color: var(--muted) }
.theory-card > button > span:last-child { font-size: 1.3rem; color: var(--hl) }
.theory-body { padding: 0 18px 18px; color: #3d423b; font-size: .94rem; line-height: 1.7; max-width: 820px }
.theory-body h4 { color: var(--ink); font-size: .98rem; margin: 18px 0 6px }

/* Pantalla de cierre de estación (#/academia/<estación>/repaso) */
.station-recap { margin: 20px 0 0; padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--sage); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface) }
.recap-actions { margin-top: 20px; max-width: 720px }
.station-recap dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 24px; margin: 0 0 14px }
.station-recap dt { font-weight: 600; color: var(--hl) }
.station-recap dd { margin: 2px 0 0; color: #3d423b; font-size: .92rem; line-height: 1.5 }
.related-note { border: 1px solid var(--line); border-radius: 20px; padding: 7px 12px; background: transparent; color: var(--ink); font-size: .84rem }
.related-note:hover { border-color: var(--terra) }
.related-note { display: block; width: 100%; margin: 7px 0; border-radius: var(--radius-sm); text-align: left }
.glossary-meta .related-note { width: auto; display: inline-block; margin: 0 }

/* ---------- 7. Módulos ---------- */
/* Fruto: cereza por capas */
.ly { cursor: pointer; transition: transform .8s cubic-bezier(.5, 0, .2, 1), opacity .4s; transform-origin: 150px 200px; transform-box: view-box }
.split .ly { transform: translateY(var(--dy)) scale(var(--sc)) }
.ly.on { filter: drop-shadow(0 0 8px rgba(23, 25, 22, .35)) }
.dim .ly:not(.on) { opacity: .25 }
.lbl { font: 600 13px var(--font); fill: var(--ink); opacity: 0; transition: opacity .6s .3s; pointer-events: none }
.split .lbl { opacity: 1 }
#cs:not(.dim):not(.split) .ly:nth-child(1) { animation: gl 2.4s ease-in-out infinite }

/* Poscosecha */
.post-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 22px }
.post-tabs button { min-height: 64px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: .86rem; line-height: 1.25 }
.post-tabs button span { display: block; margin-bottom: 4px; font-size: .75rem; letter-spacing: .1em; color: var(--terra) }
.post-tabs button[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: #fff }
.post-tabs button[aria-pressed=true] span { color: var(--gold-on-dark) }
.post-section-intro { max-width: 820px; margin: 0 0 18px }
.post-section-intro h3 { margin: 0 0 7px; font-size: 1.4rem }
.post-section-intro p { margin: 0; color: var(--muted); line-height: 1.7 }
.post-steps-wrap { margin: 14px 0; padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto }
.post-steps-wrap .steps { min-width: 520px }
.steps { display: flex; align-items: center; gap: 8px; padding: 6px 0 }
.st { flex: 1 1 110px; max-width: 180px; min-height: 96px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: .76rem; text-align: center; color: var(--ink) }
.st svg { max-width: 90px; margin: 0 auto 6px }
.st.pl { animation: in .5s both }
.st[aria-pressed=true] { border-color: var(--terra); box-shadow: inset 0 0 0 1px var(--terra); background: #f5f5f2 }
.ar { flex: 0 0 auto; color: var(--sage); font-size: 1.3rem }
.post-card-list { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 }
.post-card { padding: 22px; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.post-card-list .post-card { margin: 0 }
.post-card h3 { margin: 0 0 8px; font-size: 1.2rem }
.post-card p { margin: 8px 0; font-size: .92rem; line-height: 1.7 }
.post-label { display: block; margin: 14px 0 4px; font-size: .75rem; font-weight: 700; color: var(--hl) }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px }
.post-tags span { padding: 5px 10px; border: 1px solid rgba(110, 74, 51, .3); border-radius: 20px; font-size: .76rem; color: var(--hl) }
.post-card details { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line) }
.post-card details summary, .post-variants summary { cursor: pointer; font-weight: 600 }
.post-variants { display: grid; gap: 8px; margin-top: 10px }
.post-variants details { padding: 12px; border: 1px solid var(--line); border-radius: 10px }
.post-variants p { color: var(--muted); font-size: .88rem }
.post-note { margin: 18px 0; padding: 16px 18px; border-left: 3px solid var(--terra); border-radius: 0 12px 12px 0; background: #f2f2ef }
.post-note strong { display: block; margin-bottom: 5px; color: var(--ink) }
.post-note p { margin: 0; color: #4d4a44; font-size: .9rem; line-height: 1.65 }
.post-compare-table { margin: 18px 0; overflow-x: auto }
.post-compare-table table { min-width: 580px }
.post-compare-table th, .post-compare-table td { padding: 12px; line-height: 1.55 }
.post-guide { margin-top: 18px }
.post-visual-picker { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 }
.post-visual-choice { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .86rem }
.post-visual-choice span { font-size: .75rem; color: var(--muted) }
.post-visual-choice.active { background: var(--primary); border-color: var(--primary); color: #fff }
.post-visual-choice.active span { color: inherit; opacity: .7 }
.post-visual { max-width: 560px; margin: 14px auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface) }
.post-visual svg { max-height: 240px; margin: 6px auto; --line: #c9cec4; --muted: #6b7068 }
.post-visual-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .84rem }
.post-visual-caption span { font-size: .75rem; letter-spacing: .1em; color: var(--muted) }
.post-flow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted) }
.post-flow i { font-style: normal; font-weight: 700; color: var(--ink) }
.post-visual-note { margin: 9px 0 0 !important; text-align: center; font-size: .75rem !important; line-height: 1.4; color: var(--muted) }
.post-visual-detail { max-width: 820px; margin: 14px auto; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.post-visual-detail h3 { margin: 5px 0 8px; font-size: 1.15rem }
.post-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px }
.post-detail-grid section { padding: 12px; border-radius: 10px; background: var(--soft) }
.post-detail-grid section b { display: block; margin-bottom: 7px; font-size: .8rem }
.post-detail-grid section p { margin: 6px 0 0; font-size: .84rem; line-height: 1.5 }

/* Café verde: catálogo de defectos */
.defect-catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; align-items: start }
.defect-catalog-grid button { min-width: 0; min-height: 80px !important; line-height: 1.2; overflow-wrap: anywhere }
.defect-catalog-grid button svg { width: 100%; max-width: 48px; height: 42px; margin: 0 auto 4px }

/* Tueste: grano ilustrado junto a su descripción */
.bean-panel { display: flex; align-items: center; gap: 14px }
.bean-panel > svg { flex: 0 0 84px; width: 84px; height: 84px }
.roast-curve-visual { width: 100%; max-width: 540px; margin: 0 auto }
.roast-curve-visual svg { max-height: none }

/* Preparación y laboratorio: lectura en vivo, grupos de variables, molienda */
.lab-result { margin-bottom: 16px; padding: 18px 22px; border-radius: var(--radius); background: var(--dark); color: var(--on-dark) }
.lab-result .k { color: var(--on-dark-muted) }
.lab-result .big { color: var(--gold-on-dark) }
.lab-result .hl { color: var(--gold-on-dark) }
.lab-result p { margin: 6px 0 0 }
.variable-group { margin: 14px 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.variable-group-head { margin-bottom: 14px }
.variable-group-head p { margin: 6px 0 0; color: var(--muted); font-size: .9rem }
.variable-control { padding: 12px 0; border-top: 1px solid var(--line) }
.variable-control label { margin-top: 0; color: var(--ink); font-weight: 600 }
.variable-control p { margin: 0 0 5px; font-size: .8rem; color: var(--muted) }
.clicks-input { max-width: 180px; font-size: 1.2rem; font-weight: 600 }
.lab-note { margin: 16px 0; padding: 16px 18px; border-left: 3px solid var(--terra); background: var(--surface) }
.lab-note p { margin: 5px 0 0; color: var(--muted) }
.grind-intro { display: grid; grid-template-columns: 1fr 140px; align-items: center; gap: 18px; margin: 12px 0 16px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line) }
.grind-intro h3 { margin: 7px 0; font-size: 1.35rem }
.grind-intro p { margin: 0; color: var(--muted) }
.grind-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 110px; border: 1px solid var(--line); border-radius: var(--radius) }
.grind-stat b { font: 600 2.2rem var(--display); color: var(--terra) }
.grind-stat span { padding: 0 10px; font-size: .75rem; text-align: center; color: var(--muted) }
.grind-explorer, .grind-diagnostic { margin: 16px 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.grind-diagnostic { border-left: 3px solid var(--terra) }
.grind-section-title h3 { margin: 6px 0 }
.grind-section-title p { margin: 4px 0 14px; color: var(--muted) }
.grind-reading { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: var(--dark); color: var(--on-dark) }
.grind-reading p { margin: 5px 0 0; font-size: .82rem; color: var(--on-dark-muted) }
.grind-concepts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 }
.grind-concept { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
.grind-concept h3 { margin: 7px 0 12px }
.grind-concept p, .grind-concept li { font-size: .9rem; line-height: 1.55; color: var(--muted) }
.grind-concept ul { padding-left: 19px }
.particle-visual { display: flex; align-items: center; justify-content: space-around; height: 80px; margin: 4px 0 10px; border-radius: 10px; background: var(--soft) }
.particle { display: block; border-radius: 50%; background: #987451 }
.particle.fine { width: 9px; height: 9px; box-shadow: 0 0 0 5px #98745122 }
.particle.medium { width: 22px; height: 22px }
.particle.coarse { width: 39px; height: 39px }
.grind-factor-grid, .grind-diagnostic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px }
.grind-diagnostic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.grind-factor-grid > div, .grind-diagnostic-grid > div { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--soft) }
.grind-factor-grid p, .grind-diagnostic-grid p { margin: 6px 0 0; font-size: .84rem; line-height: 1.5; color: var(--muted) }
.grind-protocol { padding-left: 22px }
.grind-protocol li { padding: 7px 0; line-height: 1.5; color: var(--muted) }
.grind-protocol b { color: var(--ink) }

/* Sensorial: rueda de sabores y cronómetro de cata */
.flavor-wheel-wrap { max-width: 560px; margin: 14px auto 8px; padding: 8px; border-radius: var(--radius); background: #f0f0ed; overflow: hidden }
.flavor-wheel { width: 100% }
.wheel-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0 12px; font-size: .75rem; color: var(--muted) }
.wheel-family-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px }
.wheel-descriptor { border: 1px solid var(--line) }
.cup-timer { margin: 14px 0; padding: 20px; border-radius: var(--radius); background: linear-gradient(145deg, #20251f, #30382e); color: var(--on-dark); text-align: center }
.cup-timer .k { color: var(--on-dark-muted) }
.cup-timer .m { color: var(--on-dark-muted) }
.cup-clock { margin: 8px 0; font-size: clamp(2.8rem, 10vw, 4.6rem); font-weight: 650; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--gold-on-dark) }
.cup-timer-caption { margin-bottom: 14px; font-size: .84rem; color: var(--on-dark-muted) }
.cup-timer .b { border-color: rgba(241, 238, 230, .45); color: var(--on-dark) }
.cup-timer .b.p { background: var(--gold-on-dark); border-color: var(--gold-on-dark); color: #000000 }
.cup-timer-actions, .cup-nav { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap }
.cup-step-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 }
.cup-step-list .chip { margin: 0 }

/* ---------- 8. Laboratorio ---------- */
.lab-intro-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin: 18px 0 28px }
.lab-purpose, .lab-method { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface) }
.lab-purpose h3 { margin: 8px 0; font-size: 1.35rem }
.lab-method ol { margin: 8px 0; padding-left: 20px }
.lab-method li { padding: 3px 0; color: var(--muted) }
.lab-tool-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 28px 0 12px }
.lab-tool-head h3 { margin: 5px 0 }
.lab-tool-head p { max-width: 400px }
.lab-tool-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px }
.lab-tool { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 140px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink) }
.lab-tool:hover { border-color: var(--terra) }
.lab-tool > span { font-size: .75rem; color: var(--terra) }
.lab-tool b { font-size: 1rem }
.lab-tool small { font-size: .76rem; line-height: 1.4; color: var(--muted) }
.lab-tool i { margin-top: auto; font-size: .75rem; font-style: normal; color: var(--sage) }
.lab-tool.active { border-color: var(--terra); box-shadow: inset 0 0 0 1px var(--terra); background: #f5f5f2 }
.lab-variable-panel { display: grid; grid-template-columns: minmax(220px, .32fr) minmax(0, 1fr); align-items: start; gap: 24px; margin: 14px 0 }
.lab-current { position: sticky; top: calc(var(--header-h) + 16px); padding: 20px; border-left: 3px solid var(--terra); background: var(--surface) }
.lab-current h3 { margin: 8px 0 }
.lab-controls { min-width: 0 }
.record-card { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap }
.record-actions .b { min-height: 42px; font-size: .88rem }
.challenge-meta { display: flex; gap: 8px; flex-wrap: wrap }
.challenge-meta span { padding: 5px 10px; border-radius: 99px; background: #eeefe9; color: #4e5b49; font-size: .76rem }

/* ---------- 9. Desafíos y Capacitarse ---------- */
.level-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 }
.challenge-progress, .progress { height: 6px; margin: 10px 0 6px; border-radius: 9px; background: #e5e6df; overflow: hidden }
.challenge-progress i, .progress i { display: block; height: 100%; background: var(--sage) }

.course-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px }
.course-card { display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow) }
.course-card:hover { border-color: var(--sage) }
.course-mode { font-size: .85rem; font-weight: 600; color: var(--muted) }
.course-card strong { font: 600 1.3rem/1.15 var(--display); text-transform: uppercase; letter-spacing: -.01em }
.course-meta { color: var(--muted); font-size: .86rem }
.course-card .card-link { margin-top: auto }
.program-list { display: grid; gap: 6px; margin-top: 8px }
.program-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); text-align: left; color: var(--ink) }
.program-item:hover { border-color: var(--sage) }
.program-item b { flex: 1; font-weight: 600 }
.program-item .num { font-size: 1.2rem }
.feature-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px }
.feature-list li { display: flex; align-items: center; gap: 10px }
.feature-list li::before { content: '✓'; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ok-bg); color: var(--sage); font-size: .8rem; font-weight: 700 }
.feature-list li.soon { color: var(--muted) }
.feature-list li.soon::before { content: ''; background: transparent; border: 1px dashed var(--line-strong) }
.feature-list li.soon span { font-size: .8rem; color: #7d807a }

/* ---------- Pantallas medianas y chicas ---------- */
@media (max-width: 1100px) {
  .academy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .lab-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .learning-banner { grid-template-columns: 90px 1fr }
  .learning-banner .b { grid-column: 2; justify-self: start }
}
@media (max-width: 899px) {
  /* En celular los cuatro espacios ya están en la barra inferior: la portada no los repite. */
  .home-spaces { display: none }
  .home-spaces + .learning-banner { margin-top: 28px }
  :root { --gutter: 18px; --header-h: 64px }
  .main-nav { display: none }
  #nb {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  #nb a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: var(--nb-h); font-size: .75rem; letter-spacing: .02em; text-transform: none }
  #nb .nb-ico { font-size: 1.05rem; line-height: 1 }
  #nb a[aria-current=page] { color: var(--primary); box-shadow: inset 0 3px 0 var(--sage) }
  body { padding-bottom: calc(var(--nb-h) + env(safe-area-inset-bottom, 0px)) }
  #tt { bottom: calc(var(--nb-h) + 16px + env(safe-area-inset-bottom, 0px)) }
  .brand img { height: 44px }
  .home-hero { grid-template-columns: 1fr }
  .hero-photo-wrap { min-height: 320px }
  .lab-intro-grid, .lab-variable-panel { grid-template-columns: 1fr }
  .lab-variable-panel { gap: 8px }
  .lab-current { position: static }
  .lab-tool-head { display: block }
  .glossary-list { grid-template-columns: 1fr }
  .post-card-list, .post-detail-grid { grid-template-columns: 1fr }
  .grind-diagnostic-grid { grid-template-columns: 1fr }
  .course-list { grid-template-columns: 1fr }
  .section-intro { grid-template-columns: 1fr; gap: 12px; margin: 48px 0 22px }
}
@media (max-width: 650px) {
  h2 { font-size: 1.6rem }
  #v { padding-bottom: 28px }
  .brand-caption span { display: none }
  .brand-caption { padding-left: 10px }
  .crumbs { margin: 6px 0 12px }
  .hero-copy { padding: 32px 22px 26px }
  .hero-eyebrow { flex-wrap: wrap; margin-bottom: 26px; font-size: .7rem; }
  .home-hero h1 { font-size: clamp(3rem, 14vw, 4.4rem) }
  .home-hero p { font-size: .95rem }
  .action-row { flex-direction: column; align-items: stretch; width: 100% }
  .hero-photo-wrap { min-height: 270px }
  .hero-footer { flex-wrap: wrap; padding: 12px; font-size: .7rem; }
  .section-intro h2 { font-size: 2.7rem }
  .section-grid { gap: 8px }
  .next-step { flex-direction: column; align-items: stretch; padding: 18px }
  .next-step h2 { font-size: 1.3rem }
  .section-card { min-height: 200px; padding: 15px 13px }
  .section-card strong { font-size: 1.15rem; margin: 18px 0 6px }
  .section-card small { font-size: .75rem; min-height: 70px }
  .learning-banner { grid-template-columns: 1fr; gap: 16px; padding: 26px 22px }
  .learning-mark { font-size: 3.8rem }
  .learning-banner .b { grid-column: 1; white-space: normal }
  .academy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
  .academy-module { min-height: 116px; padding: 12px }
  .academy-module strong { font-size: .9rem }
  .academy-module small { font-size: .75rem }
  .lab-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .lab-tool:last-child { grid-column: 1 / -1; min-height: 0 }
  .strip { display: none }
  .post-tabs { gap: 6px }
  .post-tabs button { padding: 8px 5px; font-size: .75rem }
  .post-card { padding: 16px }
  .post-visual-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .form-grid { grid-template-columns: 1fr }
  .form-grid .wide { grid-column: auto }
  .grind-intro, .grind-concepts, .grind-factor-grid { grid-template-columns: 1fr }
  .grind-stat { min-height: 75px }
  .defect-catalog-grid { gap: 5px !important }
  .defect-catalog-grid button { padding: 4px 2px !important; font-size: .68rem !important; letter-spacing: 0 !important }
  .panel { padding: 15px }
  .variable-group { padding: 16px }
  .flavor-wheel-wrap { margin-left: -5px; margin-right: -5px; padding: 2px }
  .cup-timer { padding: 14px 10px }
  .site-foot img { height: 46px }
}

/* ---------- 10. Animaciones ---------- */
@keyframes in { from { opacity: 0; transform: translateX(16px) } }
@keyframes up { from { opacity: 0; transform: translateY(12px) } }
@keyframes pp { from { transform: scale(.97) } }
@keyframes pop { from { transform: scale(.6); opacity: 0 } }
@keyframes sk { 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }
@keyframes gl { 50% { filter: drop-shadow(0 0 10px rgba(110, 74, 51, .9)) } }
@keyframes rd { 50% { box-shadow: 0 0 0 8px rgba(38, 59, 42, .18) } }
.sh { animation: sk .4s }
.pop { animation: pop .4s }
.b.p.rdy { animation: rd 1.6s ease-in-out 3 }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important }
}

/* Laboratorio · perfil sensorial del registro (versión simple del radar del módulo Sensorial) */
.rec-sens { margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line) }
.rec-sens .field-hint { margin: 2px 0 10px }
.rec-sens-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 24px; align-items: center }
.rec-sens-rows { display: grid; gap: 6px }
.sens-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 96px; align-items: center; gap: 14px; min-height: 40px }
.sens-name { font-size: .9rem; font-weight: 600 }
.sens-val { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums }
.rec-sens-chart { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center }
.rec-sens-chart .sens-radar { width: 100%; max-width: 360px; height: auto }
.rec-sens-chart .m { margin: 0; font-size: .78rem }
.rec-sens-mini { float: right; margin: -6px 0 6px 12px }
.rec-sens-mini .sens-radar { width: 140px; height: auto }
@media (max-width: 650px) {
  .rec-sens-grid { grid-template-columns: 1fr }
  .rec-sens-chart .sens-radar { max-width: 260px }
  .rec-sens-chart { order: -1 }
  .sens-row { grid-template-columns: 1fr auto; gap: 0 10px; min-height: 0 }
  input[type=range].sens-range { grid-column: 1 / -1; grid-row: 2 }
  .rec-sens-mini { float: none; margin: 8px 0 }
}

/* Deslizador minimalista: línea fina que se rellena hasta el valor y un punto chico */
input[type=range].sens-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --p: 0% }
input[type=range].sens-range:focus-visible { outline-offset: 2px }
input[type=range].sens-range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(to right, var(--primary) var(--p), var(--line-strong) var(--p)) }
input[type=range].sens-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface); box-shadow: none; transition: transform .15s }
input[type=range].sens-range:active::-webkit-slider-thumb { transform: scale(1.25) }
input[type=range].sens-range::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line-strong) }
input[type=range].sens-range::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--primary) }
input[type=range].sens-range::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface) }
