/* ProductCasa — sistema visual.
   La identidad (crema, amarillo del logo, negro, botones con sombra dura) está aprobada: aquí solo se unifican medidas. */

:root {
  color-scheme: light;

  /* color */
  --paper: #f7e49f;
  --paper-soft: #fff8de;
  --surface: #fffef9;
  --surface-warm: #fffdf4;
  --tint: #fff9df;
  --app-bg: #fffaf0;
  --side-bg: #fff4cf;
  --ink: #0a0b0b;
  --text: #342e20;
  --text-strong: #1d1b16;
  --muted: #5e5544;
  --subtle: #74694c;
  --line: #d8c98e;
  --line-soft: #eadfb7;
  --line-strong: #c9bb83;
  --green: #1d7a55;
  --red: #b54131;

  /* espacio (base 4) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --gutter: clamp(16px, 4.5vw, 64px);

  /* tipo */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.75rem, 2.6vw, 2.25rem);
  --fs-3xl: clamp(2rem, 3.6vw, 3rem);
  --fs-hero: clamp(3rem, 6.6vw, 5.8rem);
  --fs-display: clamp(2rem, 4vw, 3.75rem);

  /* forma */
  --radius: 8px;
  --radius-sm: 6px;
  --hard-shadow: 2px 2px 0 var(--ink);
  --header-h: 72px;
  --side-w: 216px;
  --side-w-collapsed: 64px;
  --outline-w: 240px;
  --measure: 720px;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

[tabindex="-1"]:focus {
  outline: none;
}

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

.noscript {
  max-width: 640px;
  margin: var(--s16) auto;
  padding: 0 var(--s4);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--fs-sm);
}

/* ---------- botones (momento de marca: borde + sombra dura) ---------- */

.top-nav a,
.pill,
.outline-button,
.solid-button,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 40px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.2;
  box-shadow: var(--hard-shadow);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.solid-button {
  background: var(--ink);
  color: var(--paper);
}

.top-nav a:hover,
.outline-button:hover,
.solid-button:hover,
.menu-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.top-nav a:active,
.outline-button:active,
.solid-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.outline-button.is-done {
  background: var(--paper);
}

.pill {
  min-height: 34px;
  cursor: default;
}

.pill:hover {
  transform: none;
}

.ghost-button,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  min-height: 34px;
  padding: var(--s1) var(--s2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.ghost-button:hover {
  background: var(--tint);
}

.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-warm);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--ink);
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

/* ---------- cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s5);
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: rgba(255, 248, 222, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
}

.brand img {
  width: 164px;
  height: auto;
}

.top-nav {
  display: flex;
  gap: var(--s2);
  margin-left: auto;
}

.top-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.header-cta {
  flex: none;
}

.menu-button {
  display: none;
  margin-left: auto;
}

.mobile-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 29;
  display: grid;
  gap: var(--s3);
  padding: var(--s4) var(--gutter) var(--s5);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  padding: var(--s2) 0;
  font-size: var(--fs-lg);
  font-weight: 800;
}

.mobile-nav .solid-button {
  justify-self: start;
  margin-top: var(--s2);
  padding: var(--s2) var(--s4);
  font-size: var(--fs-base);
}

/* ---------- web pública ---------- */

.public-page {
  min-height: calc(100vh - var(--header-h));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: clamp(40px, 6vw, 72px) var(--gutter) var(--s12);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-soft) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  justify-items: start;
}

.hero h1 {
  margin-top: var(--s3);
  font-size: var(--fs-hero);
  line-height: 0.96;
  letter-spacing: -0.01em;
}

.hero p {
  max-width: 620px;
  margin-top: var(--s6);
  color: #26231d;
  font-size: clamp(1.125rem, 2vw, 1.4rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s8);
}

.brand-board {
  margin: 0;
  padding: clamp(32px, 7vw, 88px) clamp(24px, 5vw, 56px);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(-1deg);
}

.brand-board img {
  width: 100%;
  height: auto;
}

.section {
  padding: clamp(40px, 6vw, 72px) var(--gutter);
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s6);
  margin-bottom: var(--s6);
}

.section h1,
.section h2 {
  font-size: var(--fs-display);
  line-height: 1;
  letter-spacing: -0.01em;
}

.section-copy {
  max-width: 560px;
  color: var(--muted);
  font-size: var(--fs-md);
}

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

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-height: 168px;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card strong {
  font-size: var(--fs-lg);
  line-height: 1.25;
}

.card p {
  color: var(--muted);
}

.card .eyebrow {
  margin-bottom: 0;
}

.clickable-card {
  transition: border-color 120ms ease, transform 120ms ease;
}

.clickable-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
}

.signal {
  padding: var(--s5);
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font-weight: 900;
  box-shadow: var(--hard-shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.signal:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.price {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
  max-width: 960px;
}

.price-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s3);
}

.price-panel h2 {
  font-size: var(--fs-2xl);
}

.price-panel .solid-button,
.price-panel .outline-button {
  margin-top: auto;
}

.price-panel-main {
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.price-number {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
}

.check-list {
  display: grid;
  gap: var(--s2);
  margin: var(--s2) 0 var(--s4);
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: var(--s6);
}

.check-list li::before {
  position: absolute;
  top: 0.45em;
  left: 2px;
  width: 10px;
  height: 6px;
  border-bottom: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  transform: rotate(-45deg);
  content: "";
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s6);
  align-items: center;
  padding: var(--s8) var(--gutter);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}

.footer-brand {
  display: grid;
  gap: 2px;
}

.footer-brand span,
.site-footer small {
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2) var(--s5);
  font-weight: 700;
}

.site-footer nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal .legal-reader {
  margin: 0 auto;
}

.not-found {
  display: grid;
  justify-items: start;
  gap: var(--s4);
  max-width: var(--measure);
  padding-top: var(--s12);
}

.not-found h1 {
  font-size: var(--fs-3xl);
}

.not-found .hero-actions {
  margin-top: var(--s2);
}

/* ---------- app: estructura ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  background: var(--app-bg);
}

.app-shell.nav-collapsed {
  grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr);
}

.app-shell.study-mode {
  grid-template-columns: minmax(0, 1fr);
}

.study-mode .side,
.study-mode .sidebar-backdrop {
  display: none;
}

.app-main {
  min-width: 0;
  padding: var(--s8) clamp(16px, 3.5vw, 48px) var(--s16);
}

.side {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  align-self: start;
  height: calc(100vh - var(--header-h));
  padding: var(--s4) var(--s3);
  overflow-y: auto;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
}

.side-top {
  display: flex;
  gap: var(--s2);
  align-items: center;
}

.side-search {
  display: flex;
  flex: 1;
  gap: var(--s2);
  align-items: center;
  min-width: 0;
  height: 36px;
  padding: 0 var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  cursor: text;
}

.side-search:focus-within {
  border-color: var(--ink);
}

.side-search .icon {
  width: 16px;
  height: 16px;
  color: var(--subtle);
}

.side-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--fs-sm);
}

.side-search input::-webkit-search-cancel-button {
  display: none;
}

.side-search kbd {
  color: var(--subtle);
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.search-results {
  display: grid;
  gap: 2px;
  margin-top: calc(var(--s2) * -1);
  padding: var(--s1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-warm);
}

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

.search-results a {
  display: grid;
  gap: 1px;
  padding: var(--s2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.search-results a:hover,
.search-results a:focus-visible {
  background: var(--paper);
}

.search-results small,
.search-results p {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.search-results p {
  padding: var(--s2);
}

.side-nav {
  display: grid;
  gap: var(--s4);
}

.side-nav section {
  display: grid;
  gap: 2px;
}

.side-nav h3 {
  margin-bottom: var(--s1);
  padding: 0 var(--s2);
  color: var(--subtle);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-nav a {
  position: relative;
  display: flex;
  gap: var(--s3);
  align-items: center;
  min-height: 34px;
  padding: var(--s1) var(--s2);
  border-radius: 7px;
  color: var(--text-strong);
  font-size: 0.9375rem;
  font-weight: 700;
}

.side-nav a:hover {
  background: rgba(247, 228, 159, 0.55);
}

.side-nav a[aria-current="page"] {
  background: var(--paper);
  font-weight: 850;
}

.side-nav a[aria-current="page"]::before {
  position: absolute;
  left: -12px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  content: "";
}

.side-foot {
  display: grid;
  gap: var(--s2);
  margin-top: auto;
  padding: var(--s3) var(--s2) 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.side-foot p,
.side-foot a {
  display: flex;
  gap: var(--s2);
  align-items: center;
}

.side-foot .icon {
  width: 14px;
  height: 14px;
}

.side-foot a {
  color: var(--text-strong);
}

.side-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-backdrop {
  display: none;
}

/* colapsado */
.nav-collapsed .side {
  padding-inline: var(--s2);
}

.nav-collapsed .side-top {
  flex-direction: column-reverse;
}

.nav-collapsed .side-search {
  justify-content: center;
  width: 36px;
  padding: 0;
}

.nav-collapsed .side-search input,
.nav-collapsed .side-search kbd,
.nav-collapsed .side-nav h3,
.nav-collapsed .side-nav span,
.nav-collapsed .side-foot span,
.nav-collapsed .search-results {
  display: none;
}

.nav-collapsed .side-nav a,
.nav-collapsed .side-foot p,
.nav-collapsed .side-foot a {
  justify-content: center;
}

.nav-collapsed .side-nav a[aria-current="page"]::before {
  left: -8px;
}

/* ---------- app: cabecera de sección ---------- */

.workspace-header {
  display: grid;
  gap: var(--s2);
  max-width: 980px;
  margin-bottom: var(--s8);
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--line);
}

.workspace-header h1 {
  font-size: var(--fs-3xl);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.workspace-header p {
  max-width: 680px;
  color: var(--muted);
  font-size: var(--fs-md);
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s2);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead {
  color: #28241b;
  font-size: var(--fs-lg);
  line-height: 1.55;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px var(--s2);
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--fs-xs);
  font-weight: 850;
}

.meta-row,
.related-strip,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ---------- app: paneles, listas ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: var(--s5);
  max-width: 1180px;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel .eyebrow {
  margin-bottom: 0;
}

.panel h3 {
  font-size: var(--fs-lg);
}

.panel p {
  color: var(--muted);
}

.panel .outline-button,
.panel .text-link {
  margin-top: auto;
}

.feature-panel {
  grid-row: span 3;
  justify-content: center;
  gap: var(--s4);
  padding: clamp(24px, 4vw, 48px);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.feature-panel h2 {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.feature-panel p {
  max-width: 560px;
  color: var(--text);
  font-size: var(--fs-md);
}

.feature-panel .solid-button {
  margin-top: var(--s2);
}

.item-list {
  display: grid;
  gap: var(--s3);
  max-width: 980px;
}

.list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s5);
  align-items: center;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.list-card h2,
.list-card h3 {
  margin-bottom: var(--s1);
  font-size: var(--fs-lg);
}

.list-card h2 a:hover,
.list-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.list-card p {
  color: var(--muted);
}

.list-card .eyebrow {
  margin-bottom: var(--s1);
}

.list-card .progress {
  margin-top: var(--s3);
}

.gym-group,
.explore-group {
  display: grid;
  gap: var(--s3);
}

.gym-group + .gym-group {
  margin-top: var(--s5);
}

.explore-group {
  max-width: 1180px;
  gap: var(--s4);
}

.explore-group + .explore-group,
.grid + .explore-group {
  margin-top: var(--s10);
}

.gym-group h2,
.explore-group h2 {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-main > .grid {
  max-width: 1180px;
}

.progress {
  width: 100%;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #ece2ba;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: end;
  max-width: 980px;
  margin-bottom: var(--s3);
}

.filter {
  display: grid;
  gap: var(--s1);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter select {
  min-width: 150px;
  height: 36px;
  padding: 0 var(--s8) 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.result-count {
  margin-bottom: var(--s4);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.empty {
  padding: var(--s6);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- lectura ---------- */

.course-layout {
  display: grid;
  grid-template-columns: var(--outline-w) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

.course-layout.outline-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.course-outline {
  position: sticky;
  top: calc(var(--header-h) + var(--s6));
  display: grid;
  gap: var(--s3);
  max-height: calc(100vh - var(--header-h) - var(--s12));
  overflow-y: auto;
  font-size: var(--fs-sm);
}

.course-outline-head {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}

.outline-title {
  padding-top: 5px;
  font-size: var(--fs-sm);
  font-weight: 900;
  line-height: 1.3;
}

.outline-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.course-outline nav {
  display: grid;
  gap: 2px;
}

.course-outline nav a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--s2);
  align-items: start;
  padding: 6px var(--s2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.course-outline nav a:hover {
  background: var(--tint);
}

.course-outline nav a[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 850;
}

.lesson-state {
  display: grid;
  place-items: center;
  width: 22px;
  height: 19px;
  color: var(--subtle);
  font-size: var(--fs-xs);
  font-weight: 900;
}

.lesson-state .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
  stroke-width: 2.6;
}

.outline-others {
  padding-top: var(--s2);
  border-top: 1px solid var(--line-soft);
}

.outline-others summary {
  padding: var(--s1) var(--s2);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.outline-others a {
  display: block;
  padding: 6px var(--s2);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.outline-others a:hover {
  background: var(--tint);
}

.reader {
  width: 100%;
  max-width: 880px;
  min-width: 0;
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.narrow-reader {
  max-width: 820px;
}

.study-mode .reader {
  margin: 0 auto;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  margin: calc(var(--s2) * -1) 0 var(--s5);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line-soft);
}

.toolbar-progress {
  margin-right: auto;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.reader-toolbar [data-study-mode] {
  margin-left: auto;
}

.mobile-outline {
  display: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
  margin-bottom: var(--s5);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.breadcrumb a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.reader-header {
  display: grid;
  justify-items: start;
  gap: var(--s3);
  max-width: var(--measure);
  margin-bottom: var(--s8);
}

.reader-header .eyebrow {
  margin-bottom: 0;
}

.reader-header h1 {
  font-size: var(--fs-3xl);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.reader-header .meta-row {
  margin-top: var(--s1);
}

.article-body,
.reader > section,
.reader .article-body > section,
.practice-solution {
  max-width: var(--measure);
}

.reader section + section,
.article-body > section + section {
  margin-top: var(--s10);
}

.reader h2 {
  margin-bottom: var(--s3);
  font-size: var(--fs-xl);
  line-height: 1.25;
}

.reader h3 {
  margin: var(--s6) 0 var(--s2);
  font-size: var(--fs-lg);
  line-height: 1.3;
}

.reader h4 {
  margin-bottom: var(--s2);
  font-size: var(--fs-md);
}

.reader p,
.reader li {
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.72;
}

.reader p + p,
.reader p + ul,
.reader p + ol,
.reader ul + p,
.reader ol + p {
  margin-top: var(--s4);
}

.reader ul,
.reader ol {
  margin: var(--s4) 0 0;
  padding-left: var(--s6);
}

.reader li + li {
  margin-top: var(--s2);
}

.reader strong {
  color: var(--ink);
}

.reader .steps li::marker {
  font-weight: 900;
}

.reader > * + .table-wrap,
.reader p + .table-wrap,
.reader .table-wrap + p {
  margin-top: var(--s5);
}

.callout,
.example {
  margin-top: var(--s5);
  padding: var(--s4) var(--s5);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tint);
}

.callout + *,
.example + *,
.compare + *,
.table-wrap + * {
  margin-top: var(--s5);
}

.callout p,
.example p {
  font-size: var(--fs-base);
  line-height: 1.65;
}

.callout-label {
  display: block;
  margin-bottom: var(--s1);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.callout-warning {
  border-left-color: var(--red);
  background: #fff3ea;
}

.callout-senior {
  background: var(--paper);
}

.callout-interview {
  border-left-color: var(--line-strong);
  background: var(--surface-warm);
}

.example {
  border-left-color: var(--line-strong);
  background: var(--surface-warm);
}

.example h4 {
  font-size: var(--fs-md);
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  margin-top: var(--s5);
}

.compare-side {
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
}

.compare-right {
  border-color: var(--ink);
}

.compare-side h4 {
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compare-right h4 {
  color: var(--ink);
}

.compare-side ul {
  margin-top: var(--s2);
  padding-left: var(--s5);
}

.compare-side li {
  font-size: var(--fs-base);
  line-height: 1.55;
}

.table-wrap {
  max-width: 100%;
  margin-top: var(--s5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-warm);
  font-size: var(--fs-sm);
}

.data-table th,
.data-table td {
  padding: 10px var(--s3);
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  background: var(--paper);
  font-weight: 850;
}

.takeaways {
  padding-top: var(--s6);
  border-top: 1px solid var(--line-soft);
}

.practice-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s5);
  align-items: center;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
}

.practice-block .eyebrow {
  margin-bottom: var(--s1);
}

.practice-block h2 {
  margin-bottom: var(--s1);
  font-size: var(--fs-lg);
}

.practice-block p {
  font-size: var(--fs-base);
  line-height: 1.55;
}

.related-content h2 {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.related-strip a {
  display: grid;
  gap: 1px;
  min-width: 180px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--tint);
  font-weight: 800;
  line-height: 1.3;
}

.related-strip a:hover {
  border-color: var(--ink);
}

.related-strip small {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  max-width: var(--measure);
  margin-top: var(--s10);
  padding-top: var(--s5);
  border-top: 1px solid var(--line-soft);
}

.reader-actions > :last-child {
  margin-left: auto;
}

.reader-actions.single {
  justify-content: flex-start;
}

.reader-actions.single > :last-child {
  margin-left: 0;
}

.syllabus {
  display: grid;
  gap: var(--s2);
  margin: var(--s6) 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.syllabus li + li {
  margin-top: 0 !important;
}

.syllabus a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: var(--s3);
  align-items: start;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
}

.syllabus a:hover {
  border-color: var(--ink);
}

.syllabus-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--fs-sm);
  font-weight: 900;
}

.syllabus-num .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

.syllabus-copy {
  display: grid;
  gap: 2px;
}

.syllabus-copy strong {
  font-size: var(--fs-md);
}

.syllabus-copy small {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.syllabus-meta {
  padding-top: 3px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.reader .progress {
  max-width: var(--measure);
}

/* ---------- práctica ---------- */

.prompt {
  font-weight: 700;
}

.answer-box {
  display: block;
  width: 100%;
  min-height: 180px;
  margin: var(--s4) 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-warm);
  line-height: 1.6;
  resize: vertical;
}

.answer-box:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 2px var(--paper);
}

.choice-list {
  display: grid;
  gap: var(--s2);
  margin: var(--s4) 0;
  padding: 0;
  border: 0;
}

.choice-list label {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
}

.choice-list label:hover {
  border-color: var(--line-strong);
}

.choice-list label:has(input:checked) {
  border-color: var(--ink);
  background: var(--tint);
}

.choice-list label:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.choice-list input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-id {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 900;
}

.choice-list label:has(input:checked) .choice-id {
  background: var(--ink);
  color: var(--paper);
}

.choice-list label.is-answer {
  border-color: var(--green);
  background: #eef6ef;
}

.choice-list label.is-answer .choice-id {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.choice-list input:disabled + .choice-id {
  cursor: default;
}

.form-hint {
  margin-top: var(--s3);
  color: var(--red);
  font-size: var(--fs-sm) !important;
  font-weight: 700;
}

.form-hint[hidden],
.practice-solution[hidden] {
  display: none;
}

.practice-solution {
  padding-top: var(--s8);
  border-top: 2px solid var(--ink);
}

.verdict {
  display: grid;
  gap: var(--s1);
  margin-bottom: var(--s5);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
}

.verdict p + p {
  margin-top: 0 !important;
}

.verdict-match {
  border-color: var(--green);
  background: #eef6ef;
}

.option-notes {
  display: grid;
  gap: var(--s2);
  margin: 0 0 var(--s6);
}

.option-notes div {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.option-notes div.is-answer {
  border-color: var(--green);
}

.option-notes dt {
  font-weight: 800;
}

.option-notes dd {
  margin: var(--s1) 0 0;
  color: var(--text);
  line-height: 1.6;
}

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

.rubric-grid div {
  display: grid;
  gap: var(--s1);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--tint);
}

.rubric-grid span {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.template-doc {
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
}

.template-doc-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s2);
}

.template-doc-head h2 {
  margin: 0;
}

.template-section {
  padding: var(--s4) 0;
  border-top: 1px solid var(--line-soft);
}

.template-section:last-child {
  padding-bottom: 0;
}

.template-section h3 {
  margin: 0 0 var(--s1);
}

.template-section .muted {
  font-size: var(--fs-base);
}

.template-section ul {
  margin-top: var(--s2);
}

/* ---------- responsive ---------- */

@media (min-width: 1600px) {
  :root {
    --side-w: 232px;
    --outline-w: 256px;
  }
}

@media (max-width: 1180px) {
  .course-layout {
    grid-template-columns: 208px minmax(0, 1fr);
  }

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

@media (max-width: 980px) {
  :root {
    --header-h: 64px;
  }

  .brand img {
    width: 144px;
  }

  .top-nav,
  .header-cta {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .hero,
  .price,
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .app-shell,
  .app-shell.nav-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .side,
  .nav-collapsed .side {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    width: min(300px, 86vw);
    height: auto;
    padding: var(--s4) var(--s3);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 180ms ease, visibility 0s linear 180ms;
    box-shadow: 18px 0 50px rgba(20, 20, 20, 0.18);
  }

  .side.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 180ms ease;
  }

  /* en el cajón el menú siempre va expandido */
  .nav-collapsed .side-top {
    flex-direction: row;
  }

  .nav-collapsed .side-search {
    justify-content: flex-start;
    width: auto;
    padding: 0 var(--s2);
  }

  .nav-collapsed .side-search input,
  .nav-collapsed .side-search kbd,
  .nav-collapsed .side-nav span,
  .nav-collapsed .side-foot span {
    display: initial;
  }

  .nav-collapsed .side-nav h3 {
    display: block;
  }

  .nav-collapsed .side-nav a,
  .nav-collapsed .side-foot p,
  .nav-collapsed .side-foot a {
    justify-content: flex-start;
  }

  .sidebar-backdrop:not([hidden]) {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 19;
    display: block;
    background: rgba(10, 11, 11, 0.28);
  }

  .study-mode .side.open {
    display: flex;
  }

  .desktop-only {
    display: none;
  }

  .app-main {
    padding: var(--s6) var(--gutter) var(--s12);
  }

  .course-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-layout > .course-outline {
    display: none;
  }

  .reader-toolbar [data-toggle-outline] {
    display: none;
  }

  .mobile-outline {
    display: block;
    width: 100%;
    order: 3;
  }

  .mobile-outline summary {
    display: inline-flex;
    gap: var(--s2);
    align-items: center;
    min-height: 34px;
    padding: var(--s1) var(--s2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--tint);
    font-size: var(--fs-sm);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }

  .mobile-outline summary::-webkit-details-marker {
    display: none;
  }

  .mobile-outline[open] summary {
    border-color: var(--ink);
  }

  .course-outline-inline {
    position: static;
    max-height: none;
    margin-top: var(--s3);
    padding: var(--s3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-warm);
  }

  .course-outline-inline .course-outline-head .icon-button {
    display: none;
  }

  .toolbar-progress {
    display: none;
  }

  .reader-toolbar {
    justify-content: space-between;
  }

  .reader-toolbar [data-study-mode] {
    order: 2;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: var(--s4);
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .grid,
  .signal-row,
  .rubric-grid,
  .compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: var(--s10);
  }

  .hero h1 {
    font-size: clamp(2.75rem, 13vw, 3.25rem);
  }

  .brand-board {
    padding: var(--s10) var(--s6);
    box-shadow: 6px 6px 0 var(--ink);
  }

  .section-head {
    display: grid;
    gap: var(--s3);
  }

  .list-card,
  .practice-block {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }

  .list-card > a,
  .card-actions {
    justify-self: start;
  }

  .reader {
    padding: var(--s5) var(--s4);
    border-radius: var(--radius);
  }

  .app-main {
    padding-inline: var(--s3);
  }

  .reader-header h1 {
    font-size: 1.875rem;
  }

  .reader h2 {
    font-size: var(--fs-lg);
  }

  .lead {
    font-size: var(--fs-md);
  }

  .reader p,
  .reader li {
    font-size: var(--fs-base);
    line-height: 1.68;
  }

  .reader-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .reader-actions > * {
    width: 100%;
  }

  .reader-actions > span:empty {
    display: none;
  }

  .reader-actions > :last-child {
    margin-left: 0;
  }

  .syllabus a {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .syllabus-meta {
    display: none;
  }

  .filter {
    flex: 1 1 140px;
  }

  .filter select {
    width: 100%;
    min-width: 0;
  }

  .workspace-header {
    margin-bottom: var(--s6);
    padding-bottom: var(--s5);
  }

  .feature-panel {
    box-shadow: 4px 4px 0 var(--ink);
  }
}

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

/* ---------- ajustes de alineación (QA visual) ---------- */

/* En la app el logo se alinea con el contenido de la barra lateral. */
.site-header.in-app {
  padding-left: calc(var(--s3) + 2px);
}

.skip-link:focus {
  position: fixed !important;
  top: var(--s3);
  left: var(--s3);
  z-index: 100;
  width: auto;
  height: auto;
  padding: var(--s2) var(--s3);
  clip: auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 800;
}

.workspace-header,
.home-grid,
.item-list,
.filter-row,
.explore-group,
.app-main > .grid {
  max-width: 1120px;
}

.feature-panel {
  justify-content: flex-start;
}

.feature-panel h2 {
  font-size: var(--fs-3xl);
  line-height: 1.06;
}

.price-panel .price-number {
  color: var(--ink);
}

@media (max-width: 980px) {
  .site-header.in-app {
    padding-left: var(--gutter);
  }

  .reader-toolbar [data-study-mode] {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding-inline: var(--gutter);
  }

  /* En móvil la lectura ocupa todo el ancho: sin caja alrededor. */
  .reader {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .reader-toolbar {
    margin-top: 0;
  }
}

/* Inicio: la lección destacada arriba a lo ancho, tres tarjetas debajo. */
.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-panel {
  grid-column: 1 / -1;
  grid-row: auto;
}

.feature-panel p {
  max-width: 680px;
}

.site-header.in-app {
  padding-right: clamp(16px, 3.5vw, 48px);
}

.filter select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0b0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px;
  cursor: pointer;
}

.filter select:focus-visible {
  border-color: var(--ink);
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header.in-app {
    padding-right: var(--gutter);
  }
}
