/* Itaca University — sistema visual (marca Ítaca, estándar de la categoría) */
:root {
  /* Superficies */
  --bg: #f3f4f4;
  --surface: #ffffff;
  --surface-sunk: #f7f8f8;
  --line: #e4e6e8;
  --line-strong: #c9d0cf;
  --line-control: #7f8b8a;

  /* Tinta */
  --ink: #102624;
  --ink-2: #3b4b49;
  --muted: #5c6a68;
  --on-dark: #ffffff;

  /* Marca Ítaca */
  /* Manual de marca 2026: turquesa principal y agua claro rellenan; el profundo oscurecido lleva texto y botones */
  --brand: #16c8c2;
  --brand-2: #0fafa9;
  --brand-soft: #8de8e4;
  --brand-strong: #00796f;
  --brand-deep: #005d55;
  --brand-tint: #e3f9f8;
  /* Paleta del logo (intro animada, css/itaca-intro.css) */
  --itaca-teal: #09918d;
  --itaca-teal-light: #2bb2aa;
  --itaca-gray: #404242;
  --itaca-paper: #f4f6f7;

  /* Estados */
  --danger: #c62828;
  --danger-tint: #fdecea;
  --warn: #a15c00;
  --warn-tint: #fff4e0;
  --socio-ink: #6b3a12;
  --socio-tint: #fdeee2;
  --scrim: rgba(16, 38, 36, .55);
  --track: #e6eaea;

  /* Forma */
  --radius: 12px;
  --radius-s: 8px;
  --radius-xs: 6px;
  --shadow-pop: 0 16px 40px -12px rgba(16, 38, 36, .28);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-text: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  caret-color: var(--brand-strong);
}
/* Manual de marca: Montserrat para títulos y controles, Lato para el cuerpo */
h1, h2, h3, h4, strong, b, th, label, button, .btn, .nav, .tabbar, .subtabs, .crumbs,
[class*="badge"], [class*="pill-"], .chip, .status, .role-tag, .count { font-family: var(--font); }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); color: var(--ink); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; text-wrap: balance; }
h1 { font-size: 30px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: 14px; font-weight: 700; letter-spacing: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; border-radius: var(--radius-xs); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.ico { flex: none; vertical-align: -0.15em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--brand-strong); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.row { display: flex; align-items: center; }
.gap-xs { gap: 4px; } .gap-s { gap: 10px; }
.wrap { flex-wrap: wrap; } .nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mt-xs { margin-top: 4px; } .mt-l { margin: 40px 0 16px; }
.label-narrow { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack-tight { gap: 4px; }
.mt-m { margin-top: 14px; }
.crumbs-top { margin-bottom: 16px; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 16px; border-radius: var(--radius-s); background: var(--ink); color: var(--on-dark); font-weight: 700; }
.skip-link:focus { top: 12px; }
#main:focus { outline: none; }
.link { color: var(--brand-strong); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; text-underline-offset: 3px; }
.link:hover { text-decoration: underline; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ---------- Estructura ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 96px; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; height: var(--topbar-h); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { height: 52px; width: auto; }
.login-side .brand-logo { height: 96px; }
.nav { display: flex; align-self: stretch; gap: 4px; flex: 1; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .15s; }
.nav a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); transform: scaleX(0); transition: transform .25s var(--ease-out); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] .ico { color: var(--brand-strong); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.account-btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: transparent; }
.account-btn:hover { background: var(--surface-sunk); border-color: var(--line); }
.user-name { font-weight: 600; font-size: 14px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { margin-top: 6px; max-width: 70ch; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.section-head .link { white-space: nowrap; }
.section-head p { margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border-radius: var(--radius-s); border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; background: var(--surface); transition: background .15s, border-color .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brand-strong); color: var(--on-dark); }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-sunk); border-color: var(--line-control); }
.btn-outline { border-color: var(--brand-strong); color: var(--brand-strong); }
.btn-outline:hover:not(:disabled) { background: var(--brand-tint); }
.btn-danger { background: var(--danger); color: var(--on-dark); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 85%, black); }
.btn-danger-ghost { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 15px; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-s); border: 1px solid transparent; background: transparent; color: var(--muted); }
.btn-icon:hover:not(:disabled) { background: var(--surface-sunk); color: var(--ink); border-color: var(--line); }
.btn-icon.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-tint); border-color: transparent; }
.btn-icon:disabled { opacity: .3; cursor: default; }
.btn-icon.glow { color: var(--on-dark); background: var(--brand-strong); }

.input { width: 100%; font-weight: 500; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-control); border-radius: var(--radius-s); padding: 9px 12px; min-height: 40px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--ink-2); }
.input:focus, .input:focus-visible { border-color: var(--brand-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.input:disabled { background: var(--surface-sunk); color: var(--muted); }
textarea.input { resize: vertical; line-height: 1.55; }
.input-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; width: auto; }
.input-title { font-weight: 700; font-size: 16px; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; }
select.input { cursor: pointer; padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b4b49' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.form-error:empty { display: none; }
.check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; color: var(--ink) !important; font-weight: 500 !important; font-size: 14px !important; cursor: pointer; padding: 2px 0; }
.check input { accent-color: var(--brand-strong); width: 18px; height: 18px; margin-top: 2px; flex: none; }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-control); border-radius: var(--radius-s); padding: 0 12px; color: var(--muted); min-width: 320px; min-height: 40px; }
.search:focus-within { border-color: var(--brand-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.search input { background: transparent; border: 0; outline: none; padding: 8px 0; width: 100%; color: var(--ink); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.catalog { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.cat-list { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cat { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; text-align: left; transition: background .15s, color .15s; }
.cat i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--area); }
.cat-name { flex: 1; min-width: 0; }
.cat:hover { background: var(--surface-sunk); color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
.cat .count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; }
.catalog-main { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.search-lg { min-width: 0; min-height: 48px; background: var(--brand-tint); border-color: var(--line); }
.search-lg:focus-within { background: var(--surface); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); font-weight: 600; font-size: 13px; color: var(--ink-2); transition: background .15s, border-color .15s; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--area); }
.chip:hover { border-color: var(--line-control); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.chip .count { font-variant-numeric: tabular-nums; color: inherit; opacity: .7; }

/* ---------- Distintivos ---------- */
.avatar { width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .38); background: hsl(var(--hue) 40% 90%); color: hsl(var(--hue) 45% 26%); }
.badge-level { --lv-ink: color-mix(in srgb, var(--lvl, #5c6a68) 55%, var(--ink)); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--lv-ink); background: color-mix(in srgb, var(--lvl, #5c6a68) 14%, var(--surface)); white-space: nowrap; vertical-align: middle; }
.badge-level i { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl, #5c6a68); }
.area-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.area-tag i { width: 8px; height: 8px; border-radius: 2px; background: var(--area); flex: none; }
.role-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.role-admin { color: var(--brand-deep); background: var(--brand-tint); border-color: transparent; }
.role-socio { color: var(--socio-ink); background: var(--socio-tint); border-color: transparent; }
.mark { flex: none; width: 36px; height: 36px; border-radius: var(--radius-xs); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--on-dark); background: var(--area); }
.thumb-img { flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: var(--radius-xs); object-fit: cover; background: var(--track); }

.progress { display: flex; align-items: center; gap: 10px; }
.progress-track { flex: 1; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; width: 100%; background: var(--brand); border-radius: 99px; transform-origin: left; transform: scaleX(var(--p, 0)); }
.progress-fill.is-done { background: var(--brand-strong); }
.progress span { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.callout { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-s); font-size: 14px; font-weight: 500; }
.callout.ok { background: var(--brand-tint); color: var(--brand-deep); }
.callout.attn { background: var(--warn-tint); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.callout.attn .ico:first-child { color: var(--warn); }
a.callout.attn:hover .link { text-decoration: underline; }
.mb-m { margin-bottom: 16px; }
.callout.locked { background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- Riel de niveles (firma) ---------- */

/* ---------- Ingreso ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface); }
.login-media { position: relative; overflow: hidden; margin: 0; background: var(--ink); }
.login-media img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.login-media figcaption { position: absolute; left: 40px; right: 40px; bottom: 40px; color: var(--on-dark); font-size: 20px; font-weight: 700; line-height: 1.35; max-width: 34ch; text-shadow: 0 1px 12px var(--scrim); }
.login-side { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 36px; padding: 48px clamp(24px, 6vw, 88px); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 28px; margin-bottom: 4px; }
.login-card .btn-lg { width: 100%; }

/* ---------- Inicio ---------- */
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px 36px 36px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.home-hero-text { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.home-hero-text h1 { font-size: 40px; }
.home-hero-text > p { color: var(--ink-2); font-size: 17px; }
.hero-search { width: 100%; max-width: 440px; }
.hero-search .search { min-width: 0; min-height: 48px; background: var(--brand-tint); border-color: var(--line); }
.hero-search .search:focus-within { background: var(--surface); }
.home-hero-media { position: relative; min-width: 0; padding: 0 0 28px 28px; isolation: isolate; }
.home-hero-media::before { content: ''; position: absolute; z-index: -2; right: -90px; top: -60px; width: 320px; height: 320px; border-radius: 50%; background: var(--brand-soft); opacity: .35; }
.hero-orbit { position: absolute; z-index: -1; left: -34px; top: -26px; width: calc(100% + 40px); height: auto; color: var(--brand); pointer-events: none; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius); background: var(--track); }
.hero-float { position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column; gap: 6px; width: min(300px, 82%); padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.hero-float-kicker { font: 700 12px/1.3 var(--font); color: var(--brand-deep); }
.hero-float-title { font-size: 15px; line-height: 1.35; }
.journey { margin-top: 24px; padding: 24px; }
.journey-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.journey-stats { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.journey-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.journey .callout { margin-top: 16px; }

/* ---------- Tarjetas y filas de curso ---------- */
.grid-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 20px; }
.course-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.course-card:hover { border-color: var(--brand-soft); }
.cover { position: relative; aspect-ratio: 16 / 9; border-radius: 0; overflow: hidden; background: var(--track); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.course-card:hover .cover img { transform: scale(1.04); }
.cover-school { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--area); }
.pill-lock, .pill-draft, .pill-done { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-lock { background: rgba(16, 38, 36, .86); color: var(--on-dark); }
.pill-draft { background: var(--warn-tint); color: var(--warn); }
.pill-draft.static { position: static; }
.pill-done { background: var(--surface); color: var(--brand-deep); }
.course-card.is-locked .cover img { filter: grayscale(.85) brightness(.9); }
.cc-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.course-card h3 { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card:hover h3 { color: var(--brand-strong); }
.cc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-meta .area-tag { font-size: 13px; }
.course-card.is-locked h3 { color: var(--ink-2); }

.course-rows { display: flex; flex-direction: column; container-type: inline-size; }
.course-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.course-row:first-child { border-top: 0; }
.course-row:hover .cr-title strong { color: var(--brand-strong); }
.cr-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-title strong { font-size: 14px; font-weight: 700; }
.cr-status { width: 160px; display: flex; justify-content: flex-end; font-size: 13px; }
.cr-status .progress { width: 100%; }
.course-row.is-locked .thumb-img { filter: grayscale(.85); }
.course-row.is-locked .cr-title strong { color: var(--ink-2); }
@container (max-width: 520px) {
  .course-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; }
  .course-row .thumb-img { width: 88px; grid-row: span 2; }
  .cr-status { width: auto; grid-column: 2; justify-content: flex-start; }
}
.lock-note { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }

.continue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.continue-item { display: flex; gap: 14px; align-items: center; padding: 14px; }
.continue-item .thumb-img { width: 140px; }
.continue-item:hover { border-color: var(--line-control); }
.continue-item:hover strong { color: var(--brand-strong); }

/* ---------- Ruta ---------- */
.route-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.route { display: flex; flex-direction: column; }
.route-level { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; }
.route-rail { position: relative; display: flex; justify-content: center; }
.route-rail::after { content: ''; position: absolute; top: 40px; bottom: -8px; width: 2px; background: var(--line-strong); }
.route-level.done .route-rail::after { background: var(--brand); }
.route-level:last-child .route-rail::after { display: none; }
.route-dot { position: relative; z-index: 1; margin-top: 22px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.route-level.done .route-dot { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-dark); }
.route-level.current .route-dot { background: var(--lvl); border-color: var(--lvl); color: var(--on-dark); box-shadow: 0 0 0 5px color-mix(in srgb, var(--lvl) 22%, transparent); }
.route-body { padding: 20px 22px; margin-bottom: 16px; }
.route-level.current .route-body { border-color: color-mix(in srgb, var(--lvl) 55%, var(--line)); }
.route-body { container-type: inline-size; }
.route-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; margin-bottom: 12px; }
@container (max-width: 560px) {
  .route-head { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .route-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
}
.route-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.route-head p { margin-top: 6px; max-width: 56ch; color: var(--ink-2); font-size: 14px; }
.route-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line); letter-spacing: 0; }
.route-level.current .route-status { background: color-mix(in srgb, var(--lvl) 14%, var(--surface)); color: color-mix(in srgb, var(--lvl) 55%, var(--ink)); border-color: transparent; }
.route-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.route-meta span { display: inline-flex; align-items: center; gap: 6px; }
.route-level > .route-body > .progress { margin-bottom: 4px; }
.aside-block { padding: 20px; }
.aside-block h3 { margin-bottom: 4px; }
.aside-block > p { margin-bottom: 8px; }

/* ---------- Catálogo ---------- */
.school-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 24px; }
.school-head .mark { width: 44px; height: 44px; font-size: 14px; }
.school-head strong { font-size: 16px; }

/* ---------- Curso ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--brand-strong); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.course-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 28px; margin-bottom: 36px; }
.course-hero-main { display: flex; flex-direction: column; gap: 14px; }
.course-hero h1 { font-size: 34px; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 60ch; }
.course-facts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.course-facts span { display: inline-flex; align-items: center; gap: 6px; }
.course-facts > span:not(.area-tag, .pill-draft) { padding: 6px 12px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-deep); }
.course-facts .ico { color: var(--brand-strong); }
.course-progress { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.course-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-s); overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--brand-strong); box-shadow: var(--shadow-pop); transition: transform .2s var(--ease-out); }
.cover-play .ico { margin-left: 3px; }
.cover-play:hover { transform: scale(1.06); }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.module { overflow: hidden; }
.module-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--surface-sunk); border-bottom: 1px solid var(--line); }
.module-num { flex: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-xs); display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface); border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.module-head .module-num { min-width: 32px; padding: 0; border-radius: 50%; border: 2px solid var(--brand-strong); color: var(--brand-strong); }
.module-head h3 { font-size: 15px; }
.lessons { list-style: none; margin: 0; padding: 6px 8px; }
.lesson-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s); min-height: 44px; }
a.lesson-link:hover { background: var(--surface-sunk); }
a.lesson-link:hover .l-title { color: var(--brand-strong); }
.lesson-link.disabled { cursor: not-allowed; }
.lesson-link.disabled .l-title { color: var(--ink-2); }
.l-title { flex: 1; font-size: 14px; font-weight: 600; }
/* Puntos de estado (manual de marca): pendiente = aro, actual = aro con punto, completado = check, bloqueado = candado */
.l-ic { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--brand-strong); border: 2px solid var(--brand-strong); }
.l-ic:not(.done, .quiz, .locked, .cur) svg, .l-ic.cur svg { display: none; }
.l-ic.cur::before { content: ''; width: 46%; height: 46%; border-radius: 50%; background: var(--brand); }
.l-ic.done { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-dark); }
.l-ic.locked { background: var(--surface-sunk); border-color: var(--line-strong); color: var(--muted); }
.aside-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.aside-card h3 { font-size: 14px; }

/* ---------- Reproductor de clase ---------- */
.player { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.player-side { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; }
.outline-details > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 700; list-style: none; }
.outline-details > summary::-webkit-details-marker { display: none; }
.outline-details > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s var(--ease-out); }
.outline-details[open] > summary::after { transform: rotate(-135deg); }
.outline-details[open] > summary { margin-bottom: 6px; }
.summary-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary-text .small { font-weight: 600; white-space: nowrap; }
.outline { display: flex; flex-direction: column; gap: 14px; }
.outline-mod { border-top: 1px solid var(--line); padding-top: 8px; }
.outline-mod:first-child { border-top: 0; padding-top: 0; }
.outline-mod > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: var(--radius-xs); cursor: pointer; list-style: none; font-size: 13px; line-height: 1.35; }
.outline-mod > summary::-webkit-details-marker { display: none; }
.outline-mod > summary::after { content: ''; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s var(--ease-out); }
.outline-mod[open] > summary::after { transform: rotate(-135deg); }
.outline-mod > summary:hover { background: var(--surface-sunk); }
.mod-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--brand-strong); color: var(--brand-strong); font: 700 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.mod-num.done { background: var(--brand-strong); color: var(--on-dark); }
.outline-rows { display: flex; flex-direction: column; margin-top: 2px; }
.outline-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 500; min-height: 40px; }
.outline-item > span:nth-child(2) { flex: 1; }
.outline-item .l-ic { width: 20px; height: 20px; }
a.outline-item:hover { background: var(--surface-sunk); }
.outline-item.active { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
.outline-item.disabled { color: var(--muted); }
.player-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.player-main h1 { font-size: 30px; }
[role="tabpanel"][hidden] { display: none; }
.tabs-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow: auto hidden; }
.tabs-bar [role="tab"] { position: relative; padding: 10px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs-bar [role="tab"]:hover { color: var(--ink); }
.tabs-bar [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs-bar [role="tab"][aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); }
.next-hint { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.next-hint strong { color: var(--ink); }
.lesson-meta { font-size: 13px; font-weight: 600; color: var(--muted); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0b1413; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0b1413; }
.prose { font-size: 16px; line-height: 1.75; padding: 28px 32px; }
.prose > * { max-width: 62ch; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; } .prose h2:first-child { margin-top: 0; }
.prose h3, .prose h4 { margin: 20px 0 6px; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--brand-strong); }
.prose blockquote { margin: 20px 0 0; padding: 14px 18px; background: var(--brand-tint); border-radius: var(--radius-s); color: var(--brand-deep); font-size: 15px; }
.media-section h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.player-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }

.media-video { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.media-video figcaption { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.thumb { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb button { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface-sunk); aspect-ratio: 4 / 3; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.thumb button:hover img { transform: scale(1.04); }
.thumb figcaption { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs { display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:first-child { border-top: 0; padding-top: 0; }
.doc-row strong { font-size: 14px; overflow-wrap: anywhere; }
.doc-row .grow { flex: 1 1 180px; }
.doc-ic { width: 40px; height: 40px; flex: none; border-radius: var(--radius-s); display: grid; place-items: center; }
.doc-video { color: var(--danger); background: var(--danger-tint); }
.doc-image { color: #005a8c; background: #e3f1fa; }
.doc-document { color: var(--warn); background: var(--warn-tint); }
.doc-link { color: var(--brand-deep); background: var(--brand-tint); }
[data-media].is-missing { position: relative; }
[data-media].is-missing::after { content: 'Archivo no disponible'; position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface-sunk); color: var(--muted); font-size: 13px; border-radius: var(--radius-s); text-align: center; padding: 8px; }
.res-badges { display: inline-flex; gap: 8px; color: var(--muted); }
.res-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.center-page { min-height: 50vh; display: grid; place-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--ink-2); }
.empty .ico { color: var(--muted); }

/* ---------- Administración ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.kpi { padding: 18px 20px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi-value { white-space: nowrap; font-size: clamp(20px, 5.2vw, 26px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kpi-hint { font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-2 > .panel { padding: 22px; }
.grid-2 .section-head { margin-bottom: 14px; align-items: center; }
.dist-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--track); gap: 2px; margin-bottom: 16px; }
.dist-bar span { background: var(--lvl); }
.dist-legend { display: flex; flex-direction: column; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dist-row:first-child { border-top: 0; }
.dist-row i { width: 10px; height: 10px; border-radius: 2px; background: var(--lvl); flex: none; }
.dist-row strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.table td:first-child { min-width: 300px; }
.course-cell:hover strong { color: var(--brand-strong); }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 12px 16px; background: var(--surface-sunk); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-sunk) 70%, transparent); }
.table td .thumb-img { width: 56px; }
.t-actions { white-space: nowrap; text-align: right; position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16, 38, 36, .18); }
.table tbody tr:hover .t-actions { background: #fafbfb; }
.w-progress { min-width: 160px; }
.status { min-height: 28px; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.status.on { background: var(--brand-tint); color: var(--brand-deep); }
.status.off { background: var(--warn-tint); color: var(--warn); }
.status:hover { border-color: currentColor; }

/* Escalonamiento */
.ladder-editor { display: flex; flex-direction: column; gap: 16px; }
.ladder-row { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; padding: 22px; }
.ladder-row.special { background: var(--surface-sunk); }
.ladder-meta { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ladder-meta .input-title { min-width: 0; }
.ladder-step { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--lvl); color: var(--on-dark); font-variant-numeric: tabular-nums; }
.color { width: 40px; height: 40px; flex: none; padding: 3px; border: 1px solid var(--line-control); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
.ladder-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.ladder-facts span { display: inline-flex; align-items: center; gap: 5px; }
.ladder-courses { display: flex; flex-direction: column; gap: 8px; min-width: 0; container-type: inline-size; }
@container (max-width: 520px) {
  .ladder-course { flex-wrap: wrap; }
  .ladder-course a { flex: 1 1 160px; }
  .ladder-course select { width: 100%; }
  .add-select { width: 100%; align-self: stretch; }
}
.ladder-courses h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.ladder-course { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); }
.ladder-course .thumb-img { width: 64px; }
.ladder-course a { display: flex; flex-direction: column; }
.ladder-course a strong { font-size: 14px; }
.ladder-course a:hover strong { color: var(--brand-strong); }
.add-select { align-self: flex-start; border-style: dashed; color: var(--ink-2); }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.editor-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.big-number { font-size: 30px; font-weight: 800; color: var(--brand-deep); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ed-module { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ed-module-head { display: flex; align-items: center; gap: 8px; }
.ed-lessons { display: flex; flex-direction: column; gap: 8px; }
.ed-lesson { background: var(--surface-sunk); border-radius: var(--radius-s); border: 1px solid var(--line); }
.ed-lesson.open { background: var(--surface); border-color: var(--line-strong); }
.ed-lesson-row { display: flex; align-items: center; gap: 8px; padding: 8px; }
.minutes { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.minutes input { width: 76px; }
.ed-lesson-body { display: none; padding: 6px 14px 16px; flex-direction: column; gap: 14px; }
.ed-lesson.open .ed-lesson-body { display: flex; }
.ed-lesson-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ed-module > .btn { align-self: flex-start; }
.ed-res { display: flex; flex-direction: column; gap: 10px; }
.ed-res-title { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.res-list { display: flex; flex-direction: column; gap: 6px; }
.res-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-s); background: var(--surface-sunk); border: 1px solid var(--line); }
.res-row .doc-ic { width: 32px; height: 32px; }
.res-meta { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.res-type { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.dropzone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border: 1.5px dashed var(--line-control); border-radius: var(--radius-s); background: var(--surface-sunk); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--brand-strong); background: var(--brand-tint); }
.ed-lesson-body .dropzone label.btn { flex-direction: row; cursor: pointer; color: var(--ink); font-size: 13px; }
.url-add { display: flex; gap: 8px; }

/* Pestañas de contenido (Cursos · Recomendados) */
.subtabs { display: flex; gap: 4px; margin: -8px 0 20px; border-bottom: 1px solid var(--line); overflow: auto hidden; }
.subtabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--ink); }
.subtabs a[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); }
.subtabs .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--track); color: var(--ink-2); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* Recomendados */
.rec-art { width: 64px; aspect-ratio: 1; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-s); background: var(--brand-tint); color: var(--brand-deep); }
.rec-art img { width: 100%; height: 100%; object-fit: cover; }
.rec-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rec-text strong { font-size: 15px; line-height: 1.35; }
.rec-kind { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rec-note { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-by { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); transition: border-color .15s; }
.rec-row:hover { border-color: var(--line-strong); }
.rec-row:hover strong, .rec-feature:hover .rec-title, .rec-manage-main:hover strong { color: var(--brand-strong); }
.rec-feature { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 22px; align-items: center; width: 100%; padding: 20px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.rec-feature:hover { border-color: var(--line-strong); }
.rec-feature .rec-art { width: 136px; }
.rec-feature .rec-text { gap: 8px; }
.rec-title { font-size: 18px !important; letter-spacing: -.01em; }
.rec-quote { padding-left: 14px; border-left: 3px solid var(--brand); color: var(--ink); line-height: 1.6; }
.route-recs { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.route-recs h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.aside-block .rec-list { margin-top: 12px; }
.aside-block .rec-art { width: 48px; }
.aside-block .rec-note { display: none; }
.modal-rec .modal-body { gap: 18px; }
.rec-detail-head { display: flex; align-items: center; gap: 16px; }
.rec-detail-head .rec-art { width: 88px; }
.rec-quote-block { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-sunk); border-left: 3px solid var(--brand); border-radius: var(--radius-xs); }
.rec-quote-block blockquote { margin: 0; font-size: 15px; line-height: 1.65; white-space: pre-line; }
.rec-embed iframe { display: block; width: 100%; border: 0; border-radius: var(--radius-s); }
.modal-rec .rec-row .rec-art { width: 48px; }
.rec-groups { display: flex; flex-direction: column; gap: 16px; }
.rec-group { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.rec-group .section-head { margin-bottom: 4px; align-items: center; }
.rec-group.is-empty { padding: 14px 22px; }
.rec-group.is-empty .section-head { margin: 0; }
.rec-group.is-empty h2 { font-size: 16px; }
.rec-lvl { display: inline-flex; align-items: center; gap: 8px; }
.rec-lvl i { width: 12px; height: 12px; border-radius: 3px; background: var(--lvl); }
.rec-manage-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rec-group > .rec-manage:first-of-type > .rec-manage-row { border-top: 0; }
.rec-manage-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 0; text-align: left; background: none; border: 0; }
.rec-manage-main .rec-art { width: 52px; }
.rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; }
.rec-children { margin-left: 26px; padding-left: 24px; border-left: 2px solid var(--line); }
.rec-children .rec-manage-main .rec-art { width: 40px; }
.rec-form-head { display: flex; align-items: flex-end; gap: 14px; }
.rec-form-head .rec-art { width: 56px; }
.rec-url-status { margin-top: -6px; }
button.link { padding: 0; background: none; border: 0; }

/* Me sirvió */
.rec-helped { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-deep); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.rec-meta .rec-helped { margin-left: 0; }
.rec-helpful { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.helpful-btn[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand-strong); color: var(--brand-deep); }
.helpful-btn[aria-pressed="true"] .ico { fill: currentColor; fill-opacity: .2; }

/* Para profundizar */
.deepen .deepen-sub { margin: -8px 0 12px; }
.deepen-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.deepen-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 2px 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.deepen-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deepen-chip .btn-icon { width: 26px; height: 26px; }
.ed-deepen { padding-top: 12px; border-top: 1px dashed var(--line); }
.ed-deepen select { max-width: 100%; text-overflow: ellipsis; }

/* Sugerencias de líderes */
.count.attn { background: var(--warn-tint); color: var(--warn); }
.subtabs .count.attn { margin-left: -2px; }
.sugg-queue { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); margin-bottom: 16px; }
.sugg-queue h2 { display: flex; align-items: center; gap: 8px; }
.sugg-queue h2 .count { padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sugg-item { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.sugg-queue .section-head + .sugg-item { border-top: 0; padding-top: 4px; }
.sugg-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.sugg-main .rec-art { width: 56px; }
.sugg-main .rec-text { gap: 6px; }
.sugg-actions { flex: none; align-items: center; }
.sugg-mine { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.sugg-mine-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.sugg-mine-item:first-child { border-top: 0; }
.sugg-mine-item strong { font-size: 14px; }
.sugg-status { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--track); color: var(--ink-2); }
.sugg-status.pending { background: var(--warn-tint); color: var(--warn); }
.sugg-status.ok { background: var(--brand-tint); color: var(--brand-deep); }
.sugg-status.off { background: var(--surface-sunk); color: var(--muted); border: 1px solid var(--line); }
.suggest-invite { display: flex; align-items: center; gap: 18px; padding: 20px; }
.suggest-invite .rec-art { width: 72px; }
.suggest-invite .stack { flex: 1; }

/* Editor: estado de guardado y recuperación */
.ed-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ed-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.ed-status.dirty { color: var(--warn); }
.ed-status.dirty::before { background: var(--warn); }
.ed-recovery { margin-bottom: 20px; flex-wrap: wrap; }
.ed-recovery .grow { flex: 1 1 240px; }
.up-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand-deep); }

/* Bandeja de subidas */
.upload-tray { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(380px, calc(100% - 32px)); max-height: min(60vh, 460px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); animation: rise .3s var(--ease-out); }
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.up-list { list-style: none; margin: 0; padding: 4px 0; overflow: auto; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; }
.up-item .doc-ic { width: 32px; height: 32px; flex: none; }
.up-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up-item.is-error .up-status { color: var(--danger); font-weight: 600; }
.up-item.is-canceled { opacity: .6; }
.up-bar { height: 4px; border-radius: 99px; background: var(--track); overflow: hidden; }
.up-bar span { display: block; height: 100%; background: var(--brand); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .2s linear; }
.up-ok { display: grid; place-items: center; width: 36px; color: var(--brand-strong); }

/* Contraseña: mostrar, generar y copiar */
.pwd-field { display: flex; flex-direction: column; gap: 6px; }
.pwd-field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pwd-row { display: flex; align-items: center; gap: 4px; }
.pwd-row .input { flex: 1; font-variant-ligatures: none; letter-spacing: .02em; }
.pwd-row .input[type="text"] { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.pwd-row .btn-icon[aria-pressed="true"] { color: var(--brand-strong); }
.pwd-gen { align-self: flex-start; }
.cred-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; padding: 14px 16px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-s); }
.cred-box dt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cred-box dd { margin: 0; overflow-wrap: anywhere; user-select: all; }
.cred-pwd { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 16px; font-weight: 600; letter-spacing: .04em; }

/* ---------- Evaluaciones: rendir ---------- */
.l-ic.quiz { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-deep); }
.quiz-row .lesson-link { border-top: 1px dashed var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); }
.quiz-row .l-title { font-weight: 700; }
.quiz-page { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.quiz-head { display: flex; flex-direction: column; gap: 6px; }
.quiz-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.quiz-head .callout { margin-top: 6px; }
.quiz-form { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { margin: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.quiz-q legend { float: left; width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 0; font-size: 16px; font-weight: 700; line-height: 1.45; }
.quiz-q legend + * { clear: both; }
.quiz-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunk); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.quiz-hint { margin-left: 40px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; margin-left: 40px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); cursor: pointer; transition: border-color .15s, background .15s; }
.quiz-opt:hover { border-color: var(--brand-strong); }
.quiz-opt:has(input:checked) { border-color: var(--brand-strong); background: var(--brand-tint); }
.quiz-opt:has(input:focus-visible) { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
.quiz-opt input { width: 18px; height: 18px; flex: none; accent-color: var(--brand-strong); margin: 0; }
.quiz-opt-text { flex: 1; }
.quiz-opt:has(input:disabled) { cursor: default; }
.quiz-opt.is-right { border-color: var(--brand-strong); background: var(--brand-tint); }
.quiz-opt.is-wrong { border-color: var(--danger); background: var(--danger-tint); }
.quiz-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--brand-deep); white-space: nowrap; }
.quiz-q.is-missing { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.quiz-q.is-correct { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.quiz-q.is-incorrect { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.quiz-feedback { display: flex; gap: 10px; align-items: flex-start; margin-left: 40px; padding: 10px 14px; border-radius: var(--radius-s); font-size: 14px; }
.quiz-feedback .ico { flex: none; margin-top: 3px; }
.quiz-feedback p { margin-top: 2px; color: var(--ink-2); }
.quiz-feedback.ok { background: var(--brand-tint); color: var(--brand-deep); }
.quiz-feedback.bad { background: var(--danger-tint); color: var(--danger); }
.quiz-feedback.bad p { color: var(--ink); }
.quiz-submit { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 16px; padding: 4px 0 8px; }
.quiz-result { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.quiz-result.ok { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: var(--brand-tint); }
.quiz-result.retry { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-tint); }
.quiz-result-title { font-size: 18px; }
.quiz-score { --c: var(--brand-strong); width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 360deg), var(--track) 0); }
.quiz-result.retry .quiz-score { --c: var(--warn); }
.quiz-result.wait { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-tint); }
.quiz-result.wait .quiz-score { --c: var(--warn); }
.quiz-feedback.wait { background: var(--warn-tint); color: var(--warn); }
.quiz-feedback.wait p { color: var(--ink); }
.quiz-text { margin-left: 40px; width: calc(100% - 40px); resize: vertical; }
.quiz-text[readonly] { background: var(--surface-sunk); }
.review-answer { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-strong); background: var(--surface-sunk); border-radius: 0 var(--radius-s) var(--radius-s) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-fb-list, .rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.review-fb { display: flex; flex-direction: column; gap: 8px; }
.review-fb.is-ok > .row .ico { color: var(--brand-deep); }
.review-fb.is-bad > .row .ico { color: var(--danger); }
.review-fb > .row .ico { flex: none; margin-top: 3px; }
.review-fb > .row { align-items: flex-start; }

/* Revisión de respuestas escritas */
.rv-item { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.rv-prompt { display: flex; align-items: flex-start; gap: 10px; }
.rv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.rv-cols .label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rv-ai { display: flex; align-items: flex-start; gap: 6px; padding: 8px 12px; border-radius: var(--radius-s); font-size: 14px; }
.rv-ai .ico { flex: none; margin-top: 3px; }
.rv-ai.is-ok { background: var(--brand-tint); }
.rv-ai.is-bad { background: var(--danger-tint); }
.rv-ai.is-ok .ico { color: var(--brand-deep); }
.rv-ai.is-bad .ico { color: var(--danger); }
.rv-item label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--ink-2); }
.rv-foot { padding-top: 14px; border-top: 1px solid var(--line); }
.qe-answer { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.quiz-score span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 800; font-size: 16px; }

/* ---------- Evaluaciones: editor ---------- */
.ol-quiz .ol-num { display: grid; place-items: center; color: var(--brand-deep); }
.ol-adds { display: flex; flex-wrap: wrap; }
.ol-adds .ol-add + .ol-add { margin-left: 0; }
.quiz-pane-title { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.quiz-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 18px; padding: 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-sunk); }
.quiz-empty .rec-art { width: 64px; }
.quiz-empty > .stack { flex: 1 1 260px; }
.qe-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: none; }
.qe { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.qe.is-ai { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn-tint) 45%, var(--surface)); }
.qe-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qe-head select { width: auto; }
.qe-ai { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 999px; background: var(--warn-tint); color: var(--warn); font-size: 12px; font-weight: 700; }
.qe-ai-link { text-decoration: underline; text-underline-offset: 2px; }
.qe-ai:hover { border-color: var(--warn); }
.qe-prompt { font-weight: 600; resize: vertical; }
.qe-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qe-opt { display: flex; align-items: center; gap: 8px; }
.qe-opt .input { flex: 1; min-width: 0; }
.qe-opt.is-correct .input { border-color: var(--brand-strong); background: var(--brand-tint); }
.qe-mark { width: 26px; height: 26px; flex: none; display: grid; place-items: center; padding: 0; border: 2px solid var(--line-control); background: var(--surface); color: var(--on-dark); }
.qe-mark.is-radio { border-radius: 50%; }
.qe-mark.is-check { border-radius: 6px; }
.qe-mark:hover { border-color: var(--brand-strong); }
.qe-mark[aria-pressed="true"] { background: var(--brand-strong); border-color: var(--brand-strong); }
.qe-warn { font-size: 13px; font-weight: 600; color: var(--danger); }
.qe-add-opt { align-self: flex-start; }
.qe-expl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ai-mode { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-status.error { color: var(--danger); font-weight: 600; }
.quiz-pane .callout { flex-wrap: wrap; }
.quiz-pane .callout .grow { flex: 1 1 220px; }

/* Modal y avisos */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 38, 36, .5); display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease-out); }
.modal { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-pop); animation: rise .3s var(--ease-out); }
.modal.modal-wide { width: min(1000px, 100%); }
.modal.modal-wide .modal-body { padding: 0; background: #0b1413; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.doc-frame { width: 100%; height: 72vh; border: 0; display: block; background: #fff; }
.lightbox-img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; object-fit: contain; }
.assign-group { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px 14px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.assign-group legend { padding: 0 6px; }
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; justify-content: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--on-dark); padding: 12px 20px; border-radius: var(--radius-s); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-pop); animation: rise .3s var(--ease-out); transition: opacity .3s; text-align: center; }
.toast.out { opacity: 0; }
.toast:has(.toast-action) { display: flex; align-items: center; gap: 16px; text-align: left; pointer-events: auto; }
.toast-action { flex: none; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--radius-xs); background: transparent; color: var(--on-dark); font-weight: 700; font-size: 13px; }
.toast-action:hover { background: rgba(255, 255, 255, .12); }
.modal.modal-dialog { width: min(460px, 100%); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.dialog-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.dialog-note { padding: 10px 12px; border-radius: var(--radius-s); font-size: 14px; }
.dialog-note.warn { background: var(--warn-tint); color: var(--ink); }
.dialog-note.ok { background: var(--brand-tint); color: var(--brand-deep); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Navegación inferior (móvil) ---------- */
.tabbar { display: none; }

@media (max-width: 1020px) {
  .home-hero, .route-layout, .course-layout, .player, .editor, .grid-2, .ladder-row, .course-hero { grid-template-columns: minmax(0, 1fr); }
  .player-side, .editor-side { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .course-hero { padding: 20px; }
  .course-cover { order: -1; }
}

@media (max-width: 1180px) {
  .topbar-inner { gap: 18px; }
  .nav a { padding: 0 9px; }
  .nav a::after { left: 9px; right: 9px; }
  .topbar-inner:has(.nav a:nth-child(5)) :is(.user-name, .user-chip .role-tag) { display: none; }
}
@media (max-width: 960px) {
  .topbar-inner:has(.nav a:nth-child(5)) .nav .ico { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  .container { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .nav, .user-name, .user-chip .badge-level, .user-chip .role-tag { display: none; }
  .user-chip { margin-left: auto; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .tabbar a[aria-current="page"] { color: var(--brand-strong); }
  .home-hero-text h1, .course-hero h1 { font-size: 28px; }
  .home-hero { padding: 24px 20px; gap: 28px; }
  .home-hero-media { padding: 0 0 0 0; }
  .home-hero-media::before, .hero-orbit { display: none; }
  .hero-photo { aspect-ratio: 16 / 9; }
  .hero-float { position: relative; width: auto; margin: -12px 12px 0; }
  .continue-list { grid-template-columns: minmax(0, 1fr); }
  .continue-item .thumb-img { width: 104px; }
  .grid-courses { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .journey { padding: 18px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search { min-width: 0; width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cat-list { position: static; flex-direction: row; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; background: transparent; border: 0; border-radius: 0; }
  .cat { flex: none; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
  .cat[aria-pressed="true"] { border-color: var(--brand-strong); }
  .chip { flex: none; }
  .cr-status { width: 96px; }
  .course-row .thumb-img { width: 88px; }
  .prose { padding: 20px; }
  .route-level { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
  .route-dot { width: 24px; height: 24px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .ed-lesson-row, .res-row { flex-wrap: wrap; }
  .ed-lesson-row .grow { flex-basis: calc(100% - 40px); }
  .res-meta { display: none; }
  .url-add { flex-direction: column; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-media { height: 220px; }
  .login-media figcaption { left: 20px; right: 20px; bottom: 18px; font-size: 16px; }
  .login-side { padding: 28px 20px 40px; }
  .toast-region { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .upload-tray { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .page-actions .ed-status { width: 100%; }
  .rec-feature { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 16px; align-items: start; }
  .rec-feature .rec-art { width: 88px; }
  .rec-manage-row { flex-wrap: wrap; row-gap: 6px; }
  .rec-manage-main { flex-basis: 100%; }
  .rec-manage-row > .row { margin-left: auto; }
  .quiz-opts, .quiz-feedback, .quiz-hint { margin-left: 0; }
  .quiz-text { margin-left: 0; width: 100%; }
  .quiz-q { padding: 16px; }
  .quiz-submit .btn { width: 100%; }
  .qe { padding: 12px; }
  .sugg-item { flex-direction: column; gap: 10px; }
  .sugg-actions { align-self: flex-end; }
  .suggest-invite { flex-wrap: wrap; }
  .rec-children { margin-left: 8px; padding-left: 14px; }
}

@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0; border: 0; min-width: 0; }
  .table td:first-child { min-width: 0; }
  .table td[data-label]::before { content: attr(data-label); flex: none; width: 92px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
  .table td > .progress { flex: 1; }
  .t-actions { position: static; box-shadow: none; background: none; justify-content: flex-start; border-top: 1px solid var(--line) !important; padding-top: 8px !important; }
  .table tbody tr:hover { background: none; }
  .ed-module-head { flex-wrap: wrap; }
  .ed-module-head .grow { flex: 1 1 calc(100% - 48px); }
  .ed-module-head [data-mod-total] { margin-right: auto; }
  .player-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .player-nav > div { display: contents; }
  .player-nav > span:empty { display: none; }
  .player-nav .btn { width: 100%; min-width: 0; white-space: nowrap; }
  .player-nav .btn-ghost { font-size: 13px; padding: 8px 10px; gap: 6px; }
  .player-nav .label-wide { display: none; }
  .player-nav .label-narrow { display: inline; }
  .player-nav .btn-primary { grid-column: 1 / -1; order: -1; min-height: 48px; }
}

/* ---------- Estudio de curso ---------- */
:root { --studio-head-h: 84px; }
/* Al desplazarse a un elemento, que no quede debajo de la barra superior ni de la cabecera fija del estudio. */
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
html:has(.studio-head) { scroll-padding-top: calc(var(--topbar-h) + var(--studio-head-h) + 12px); }
.studio-head { position: sticky; top: var(--topbar-h); z-index: 20; margin: -12px 0 12px; padding: 12px 0 0; background: var(--bg); }
.studio-head .page-head { margin-bottom: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.studio-head h1 { font-size: 24px; }
.studio { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-map > summary { display: none; }
/* El sticky va en el <details> (hijo directo de la grilla): dentro de un details el contenido no puede fijarse. */
.studio-map { position: sticky; top: calc(var(--topbar-h) + var(--studio-head-h) + 12px); }
/* Alto máximo: pantalla menos barra, cabecera, separación y el margen inferior de la página (96px). */
.studio-outline { max-height: calc(100vh - var(--topbar-h) - var(--studio-head-h) - 124px); overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px;
  background:
    linear-gradient(var(--surface) 30%, rgba(255, 255, 255, 0)) top / 100% 36px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), var(--surface) 70%) bottom / 100% 36px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(16, 38, 36, .26), rgba(16, 38, 36, 0)) top / 100% 14px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(16, 38, 36, .26), rgba(16, 38, 36, 0)) bottom / 100% 14px no-repeat scroll,
    var(--surface); }
.ol-course { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; text-align: left; }
.ol-course > span { display: flex; flex-direction: column; }
.ol-course:hover { background: var(--surface-sunk); }
.ol-course.active { background: var(--brand-tint); color: var(--brand-deep); }
.ol-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ol-summary strong { font-size: 16px; }
.ol-modules, .ol-lessons { list-style: none; margin: 0; padding: 0; }
.ol-modules { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ol-module { border-radius: var(--radius-s); }
.ol-module-head { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 2px; }
.ol-module-head .module-num { min-width: 26px; height: 26px; font-size: 12px; }
.ol-module-title { flex: 1; min-width: 0; font-weight: 700; border-color: transparent; background: transparent; text-overflow: ellipsis; }
.ol-module-title:hover { border-color: var(--line-strong); }
.ol-grip { flex: none; display: grid; place-items: center; width: 18px; color: var(--line-control); cursor: grab; }
.ol-lesson { position: relative; display: flex; align-items: center; gap: 2px; border-radius: var(--radius-xs); }
.ol-lesson.active { background: var(--brand-tint); }
.ol-lesson .ol-grip { opacity: 0; transition: opacity .15s; }
.ol-lesson:hover .ol-grip, .ol-lesson:focus-within .ol-grip { opacity: 1; }
.ol-pick { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 7px 8px; border: 0; border-radius: var(--radius-xs); background: transparent; text-align: left; }
.ol-pick:hover { background: var(--surface-sunk); }
.ol-lesson.active .ol-pick { background: transparent; }
.ol-lesson.active .ol-title { color: var(--brand-deep); font-weight: 700; }
.ol-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.ol-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-meta { grid-column: 2; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ol-kinds { display: inline-flex; gap: 4px; color: var(--ink-2); }
.ol-empty { color: var(--warn); font-weight: 600; }
.ol-tools { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: inline-flex; padding-left: 6px; border-radius: var(--radius-xs); background: var(--surface); box-shadow: -10px 0 10px -2px var(--surface); opacity: 0; pointer-events: none; transition: opacity .15s; }
.ol-tools .btn-icon { width: 28px; height: 28px; }
.ol-lesson:hover .ol-tools, .ol-lesson:focus-within .ol-tools, .ol-module-head:hover .ol-tools, .ol-module-head:focus-within .ol-tools { opacity: 1; pointer-events: auto; }
.ol-lesson.active .ol-tools { background: var(--brand-tint); box-shadow: -10px 0 10px -2px var(--brand-tint); }
.ol-add { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0 28px; padding: 6px 8px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.ol-add:hover { background: var(--brand-tint); }
.ol-add-module { align-self: flex-start; margin-top: 6px; }
.ol-hint { padding: 0 10px 6px; }
.is-dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 2px 0 var(--brand-strong); }
.drop-after { box-shadow: inset 0 -2px 0 var(--brand-strong); }
.drop-into { background: var(--brand-tint); }

.studio-pane { padding: 0; overflow: hidden; }
.pane-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pane-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; min-height: 48px; border-color: transparent; padding-left: 8px; margin-left: -8px; }
.pane-title:hover { border-color: var(--line-strong); }
.pane-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.pane-spacer { flex: 1; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-s); background: var(--surface-sunk); border: 1px solid var(--line); }
.segmented button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 38, 36, .12); }
.pane-form { padding: 20px 24px; }
.pane-summary { padding: 0 24px 24px; }

.ed-block { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.ed-block:last-child { border-bottom: 0; }
.ed-block-head { display: flex; flex-direction: column; gap: 2px; }
.ed-block-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ed-block-head h3 .ico { color: var(--brand-strong); }

.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.media-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.media-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-sunk); display: grid; place-items: center; overflow: hidden; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-ext { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; height: 100%; justify-content: center; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.media-play { position: absolute; left: 8px; bottom: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--ink); }
.media-body { padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.media-body .input { width: 100%; }
.media-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.media-meta .muted { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-type { width: 100%; }
.media-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; justify-content: flex-end; gap: 2px; padding: 2px 6px 6px; }
.media-card.is-uploading .media-thumb { opacity: .7; }
.media-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.media-drop { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 14px; min-height: 92px; padding: 16px 18px; cursor: pointer; color: var(--brand-strong); }
.media-drop > span { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.media-drop:hover { border-color: var(--brand-strong); background: var(--brand-tint); }
.media-drop:focus-within { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
.media-link { display: flex; flex-direction: column; gap: 6px; }
.url-kind:empty { display: none; }
.studio-pane.over { box-shadow: inset 0 0 0 2px var(--brand-strong); }

.rte-shell { border: 1px solid var(--line-control); border-radius: var(--radius-s); background: var(--surface); }
.rte-shell:focus-within { border-color: var(--brand-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.rte-toolbar { position: sticky; top: calc(var(--topbar-h) + var(--studio-head-h)); z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-sunk); border-radius: var(--radius-s) var(--radius-s) 0 0; }
.rte-group { display: inline-flex; gap: 2px; }
.rte-group + .rte-group { padding-left: 10px; border-left: 1px solid var(--line-strong); }
.rte-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.rte-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.rte-btn[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand-deep); }
.rte-btn b, .rte-btn i { font-size: 15px; }
.rte-linkbar { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.rte-linkbar[hidden] { display: none; }
.rte { min-height: 280px; padding: 20px 24px; outline: none; cursor: text; }
.rte.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.prose ol { margin: 0 0 14px; padding-left: 24px; color: var(--ink-2); }
.prose ol li::marker { color: var(--brand-strong); font-weight: 700; }
.prose a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }

.ed-preview { padding: 24px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); }
.ed-preview h1 { font-size: 30px; }
.ed-preview-note { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }

@media (max-width: 1020px) {
  .studio { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  :root { --studio-head-h: 0px; }
  .studio-head { position: static; margin: 0 0 12px; padding: 0; }
  .studio-map { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .studio-map > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 16px; cursor: pointer; font-weight: 700; list-style: none; }
  .studio-map > summary::-webkit-details-marker { display: none; }
  .studio-map > summary::after { content: ''; margin-left: auto; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b4b49' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s var(--ease-out); }
  .studio-map[open] > summary::after { transform: rotate(180deg); }
  .studio-map { position: static; }
  .studio-outline { max-height: none; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .ol-tools { position: static; transform: none; box-shadow: none; background: none; opacity: 1; pointer-events: auto; }
  .ol-lesson .ol-grip { opacity: 1; }
  .media-add { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .pane-head, .ed-block, .pane-form { padding-left: 16px; padding-right: 16px; }
  .pane-title { font-size: 20px; }
  .rte { padding: 16px; }
  .rte-toolbar { top: 0; }
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .media-thumb { aspect-ratio: 16 / 7; }
  .pane-spacer { flex-basis: 100%; height: 0; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; justify-content: center; }
}
@media (pointer: coarse) {
  .ol-tools { position: static; transform: none; box-shadow: none; background: none; opacity: 1; pointer-events: auto; }
  .ol-lesson .ol-grip { opacity: 1; }
  .rte-btn { min-width: 44px; height: 44px; }
  .ol-tools .btn-icon { width: 40px; height: 40px; }
}

/* Áreas táctiles cómodas en pantallas táctiles */
@media (pointer: coarse) {
  .btn-icon { width: 44px; height: 44px; }
  .btn-sm, .chip, .input-sm { min-height: 44px; }
}

/* Movimiento reducido: sin escalas ni desplazamientos; los cambios de estado se mantienen con fundidos. */
@media (prefers-reduced-motion: reduce) {
  .course-card:hover .cover img, .thumb button:hover img { transform: none; }
  .modal, .toast { animation-name: fade; }
  .btn:active:not(:disabled) { transform: none; }
}

/* Ecosistema: fichas de las empresas del hub */
.eco-mono { display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: var(--radius-s); background: var(--eco); color: var(--on-dark); font-weight: 800; font-size: calc(var(--s) * .36); letter-spacing: .02em; }
.eco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.eco-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-top: 4px solid var(--eco); transition: border-color .15s, box-shadow .15s; }
.eco-card:hover { box-shadow: 0 6px 20px -10px rgba(16, 38, 36, .25); }
.eco-card-main { display: flex; align-items: center; gap: 14px; }
.eco-card-main::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.eco-card-name { font-size: 16px; line-height: 1.3; }
.eco-card-secs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.eco-card-secs li { padding: 2px 10px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.eco-card-tools { position: relative; z-index: 1; display: flex; gap: 4px; justify-content: flex-end; margin-top: auto; }

.eco-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px 28px; margin-bottom: 28px; border-left: 6px solid var(--eco); }
.eco-hero h1 { font-size: 30px; }
.eco-hero-actions { flex-wrap: wrap; }
.eco-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.eco-body.no-toc { grid-template-columns: minmax(0, 1fr); }
.eco-toc { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 16px 18px; }
.eco-toc ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.eco-toc li::marker { color: var(--muted); font-size: 13px; }
.eco-toc .link { text-align: left; font-size: 14px; }
.eco-secs { display: flex; flex-direction: column; gap: 16px; }
.eco-sec { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.eco-sec:focus { outline: none; }

.eco-editor { --studio-head-h: 0px; max-width: 920px; }
.eco-ed-bar { position: sticky; top: var(--topbar-h); z-index: 5; margin: 0 -4px 20px; padding: 12px 4px; background: var(--bg); }
.eco-ed-data { border-top: 4px solid var(--eco); }
.eco-ed-name { grid-template-columns: minmax(0, 1fr) auto; }
.eco-ed-help { margin: -8px 0 16px; max-width: 70ch; }
.eco-ed-secs { display: flex; flex-direction: column; gap: 16px; }
.eco-ed-sec { padding: 16px; }
.eco-ed-sec-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.eco-ed-num { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; margin-right: 4px; border-radius: 50%; background: var(--eco); color: var(--on-dark); font-size: 13px; font-weight: 800; }
.eco-ed-sec .rte { min-height: 140px; }
.eco-ed-sec .rte-toolbar { top: calc(var(--topbar-h) + 76px); }
.eco-ed-add { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; border-style: dashed; }
.eco-ed-danger { display: flex; justify-content: flex-end; margin-top: 28px; }

/* Ecosistema: logo, portada, contacto y galería */
.eco-logo { display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.eco-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.eco-card.has-cover { padding-top: 0; overflow: hidden; }
.eco-card-cover { display: block; width: calc(100% + 40px); margin: 0 -20px; aspect-ratio: 16 / 7; object-fit: cover; background: var(--surface-sunk); }
.eco-cover { display: block; width: 100%; aspect-ratio: 21 / 6; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-sunk); }
.eco-hero.has-cover { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.eco-contact { margin: -12px 0 28px; padding: 16px 20px; }
.eco-contact ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.eco-contact-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; font-size: 14px; }
.eco-contact-item .ico { flex: none; margin-top: 2px; color: var(--eco, var(--brand-strong)); }
.eco-contact-item .label { font-size: 12px; color: var(--muted); }
a.eco-contact-item:hover { background: var(--surface-sunk); }
.eco-gallery { margin-top: 32px; }
.eco-gallery h2 { margin-bottom: 14px; }
.eco-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.eco-photo { position: relative; display: block; padding: 0; border: 0; border-radius: var(--radius-s); overflow: hidden; cursor: zoom-in; background: var(--surface-sunk); aspect-ratio: 4 / 3; }
.eco-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease-out); }
.eco-photo:hover img { transform: scale(1.03); }
.eco-photo span { position: absolute; inset: auto 0 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(16, 38, 36, .75)); color: var(--on-dark); font-size: 13px; font-weight: 600; text-align: left; }
.eco-photo-full { display: block; width: 100%; max-height: 80vh; object-fit: contain; }
.eco-ed-images, .eco-ed-contact { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.eco-ed-images h2, .eco-ed-contact h2 { font-size: 18px; }
.eco-ed-slots { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.eco-ed-slot { display: flex; flex-direction: column; gap: 8px; }
.eco-ed-preview { display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); background: var(--surface-sunk); overflow: hidden; text-align: center; }
.eco-ed-preview > span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; }
.is-logo .eco-ed-preview { aspect-ratio: 1; }
.is-logo .eco-ed-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: var(--surface); }
.is-cover .eco-ed-preview { aspect-ratio: 21 / 9; }
.is-cover .eco-ed-preview img { width: 100%; height: 100%; object-fit: cover; }
.eco-ed-gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.eco-ed-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.eco-ed-photo { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.eco-ed-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-sunk); }
.eco-ed-photo .btn-icon { position: absolute; top: 6px; right: 6px; background: var(--surface); box-shadow: 0 1px 4px rgba(16, 38, 36, .2); }
.eco-ed-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

@media (max-width: 760px) {
  .eco-body { grid-template-columns: minmax(0, 1fr); }
  .eco-toc { position: static; }
  .eco-hero { padding: 20px; }
  .eco-hero h1 { font-size: 24px; }
  .eco-ed-slots, .eco-ed-contact-grid { grid-template-columns: minmax(0, 1fr); }
  .is-logo { max-width: 180px; }
  .eco-cover { aspect-ratio: 16 / 7; }
  .eco-ed-name { grid-template-columns: minmax(0, 1fr) auto; }
  .eco-ed-sec-head { flex-wrap: wrap; }
  .eco-ed-sec-head .input-title { flex-basis: calc(100% - 40px); }
  .eco-ed-sec .rte { padding: 16px; }
  .eco-ed-bar { position: static; padding: 0; margin: 0 0 20px; }
  .eco-ed-sec .rte-toolbar { top: var(--topbar-h); }
}

/* ---------- Subtítulos de los videos ---------- */
.subs-btn { width: 100%; justify-content: flex-start; margin-top: 2px; }
.subs-btn.has-subs { color: var(--brand-deep); border-color: var(--brand-strong); }
.subs-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong, var(--line)); border-top-color: var(--brand-strong); animation: subs-spin .8s linear infinite; flex: none; display: inline-block; }
@keyframes subs-spin { to { transform: rotate(360deg); } }
.modal.subs-modal { width: min(680px, 100%); }
.subs-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.subs-track { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.subs-track.is-busy { background: var(--brand-tint); }
.subs-track.is-failed { border-color: var(--warn); background: var(--warn-tint); }
.subs-empty { margin: 14px 0 0; padding: 18px; text-align: center; color: var(--ink-soft, inherit); border: 1px dashed var(--line); border-radius: var(--radius-s); }
.subs-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.subs-add-box { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.subs-add-box h4 { margin: 0 0 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.subs-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre; overflow: auto; min-height: 280px; }
@media (max-width: 600px) { .subs-add { grid-template-columns: minmax(0, 1fr); } }
