/* Layout: banda negra con filo rojo (como el libro de grados) · agenda semanal en rejilla · hoja de clase con línea de tiempo por apartados */
:root {
  --red: #D7172F;
  --red-ink: #B0102A;
  --ink: #16181B;
  --bg: #F4F3F3;
  --surface: #FFFFFF;
  --surface-2: #F8F7F7;
  --line: #E2DEDE;
  --muted: #6A6465;
  --band: #16181B;
  --band-ink: #FFFFFF;
  --ok: #1E8A55;
  --ok-bg: #E3F3EA;
  --warn-bg: #FCEBEC;
  --focus: #2A6FD1;

  --s-calentamiento: #E8742C;
  --s-movilidad: #C2407E;
  --yt: #D21F1F;
  --s-juegos: #E2AE16;
  --s-kihon: #D7172F;
  --s-kyu: #7A4A2A;
  --s-ido_geiko: #2A6FD1;
  --s-kata: #6A4FC8;
  --s-kumite: #33363B;
  --s-wkf: #1E9E66;
  --s-calma: #2A9AA0;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #EE3A50; --red-ink: #FF5A6E; --ink: #F1EFEF; --bg: #111214; --surface: #1A1B1E; --surface-2: #202125;
    --line: #2E2D31; --muted: #A39D9E; --band: #0A0A0B; --band-ink: #FFFFFF; --ok: #4CC487; --ok-bg: #16301F; --warn-bg: #3A1A1F;
    --focus: #6FA3F0; --s-kumite: #8E939B; --s-kyu: #B07650; --s-movilidad: #E06AA3; --yt: #FF5A5A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #EE3A50; --red-ink: #FF5A6E; --ink: #F1EFEF; --bg: #111214; --surface: #1A1B1E; --surface-2: #202125;
  --line: #2E2D31; --muted: #A39D9E; --band: #0A0A0B; --band-ink: #FFFFFF; --ok: #4CC487; --ok-bg: #16301F; --warn-bg: #3A1A1F;
  --focus: #6FA3F0; --s-kumite: #8E939B; --s-kyu: #B07650; --s-movilidad: #E06AA3; --yt: #FF5A5A; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: .01em; line-height: 1.05; margin: 0; text-wrap: balance; text-transform: uppercase; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.eyebrow { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--red); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Banda superior ---------- */
.topbar { background: var(--band); color: var(--band-ink); border-bottom: 4px solid var(--red); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { flex: none; height: 56px; width: auto; margin-block: -6px; }
.brand-txt { border-left: 1px solid rgba(255,255,255,.18); padding-left: 12px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-txt b { font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.brand-txt small { font-size: 12px; color: #B9B3B4; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin-left: auto; min-width: 0; }
.nav a { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: 8px 12px; border-radius: var(--r); color: #D8D3D4; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav a.on { color: #fff; box-shadow: inset 0 -3px 0 var(--red); border-radius: 0; }
.userbtn { background: transparent; border: 1px solid rgba(255,255,255,.22); color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.userbtn i { font-style: normal; font-family: var(--f-display); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; background: var(--red); padding: 1px 6px; border-radius: 3px; }
@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; gap: 8px 12px; }
  .brand-txt small { display: none; }
  .userbtn { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
}

/* ---------- Estructura ---------- */
.app { max-width: 1320px; margin: 0 auto; padding-block: 24px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 3px solid var(--red); }
.pagehead > div { min-width: 0; }
.pagehead p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 14px; }
.btn.icon { padding: 6px 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 11px; min-width: 0; }
textarea.input { resize: vertical; min-height: 76px; }
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--ink); color: var(--bg); }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; }

/* ---------- Chips de apartado ---------- */
.sec { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.sec::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.pill { display: inline-block; font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.kyu { background: transparent; }
.belt { display: inline-block; width: 22px; height: 7px; border-radius: 2px; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ---------- Barra de tiempo ---------- */
.tbar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; background: var(--line); gap: 1px; }
.tbar span { background: var(--c); min-width: 3px; }
.tbar.big { height: 34px; border-radius: 4px; gap: 2px; }
.tbar.big span { display: flex; align-items: center; padding: 0 6px; color: #fff; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.tscale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Agenda ---------- */
.weekbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.weekbar .range { font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; min-width: 0; }
.weekbar .spacer { flex: 1; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; min-height: 200px; }
.day.today { border-color: var(--red); box-shadow: inset 0 3px 0 var(--red); }
.dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); }
.dayhead b { font-family: var(--f-display); font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.dayhead .dnum { font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.day.today .dnum { color: var(--red); }
.daybody { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dayadd { margin-top: auto; border: 1px dashed var(--line); background: transparent; border-radius: var(--r); padding: 6px; color: var(--muted); cursor: pointer; font-size: 14px; }
.dayadd:hover { border-color: var(--red); color: var(--red); }
.empty-day { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.card { display: block; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px 10px; transition: border-color .15s; }
.card:hover { border-color: var(--ink); }
.card .time { font-family: var(--f-display); font-weight: 800; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 6px; }
.card .time .pill { font-size: 11px; padding: 1px 6px; letter-spacing: .08em; }
.card .grp { font-weight: 600; font-size: 14px; margin-top: 4px; line-height: 1.25; }
.card .who { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.card .ttl { font-size: 13px; margin-bottom: 6px; line-height: 1.3; }
@media (max-width: 1000px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .dayhead { justify-content: flex-start; gap: 10px; }
  .daybody { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .dayadd { grid-column: 1 / -1; }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; color: var(--muted); }

/* ---------- Hoja de clase ---------- */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .sheet { grid-template-columns: 1fr; } }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.meta div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.meta small { display: block; font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.meta b { font-weight: 600; }
.objective { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--r); padding: 12px 14px; margin-bottom: 20px; white-space: pre-wrap; }
.blocks { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.block { --c: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; grid-template-columns: 92px minmax(0, 1fr); overflow: hidden; }
.block .clock { background: var(--c); color: #fff; padding: 12px 10px; font-family: var(--f-display); font-weight: 800; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; gap: 2px; }
.block .clock big { font-size: 22px; line-height: 1; }
.block .clock small { font-size: 14px; opacity: .85; font-weight: 600; }
.block .clock em { margin-top: auto; font-style: normal; font-size: 13px; letter-spacing: .08em; opacity: .9; }
.block .bbody { padding: 12px 16px 14px; min-width: 0; }
.block h3 { color: var(--c); }
.block .bnotes { margin: 6px 0 0; white-space: pre-wrap; }
.exlist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.exlist li { border-top: 1px solid var(--line); padding-top: 10px; }
.exlist .ex-t { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.exlist .ex-t span { font-weight: 500; color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exlist p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.exlist .ex-note { color: var(--ink); font-style: italic; }
@media (max-width: 560px) {
  .block { grid-template-columns: 1fr; }
  .block .clock { flex-direction: row; align-items: baseline; gap: 10px; padding: 8px 14px; }
  .block .clock em { margin: 0 0 0 auto; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.side .panel + .panel { margin-top: 16px; }
.side { position: sticky; top: 84px; }
@media (max-width: 960px) { .side { position: static; } }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .editor { grid-template-columns: 1fr; } }
.addrow { display: flex; flex-wrap: wrap; gap: 6px; }
.addrow button { --c: var(--muted); border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--surface); border-radius: var(--r); padding: 6px 10px; cursor: pointer; font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.addrow button:hover { border-color: var(--c); }
.eblock { --c: var(--muted); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.eblock-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eblock-h .sec { --c: inherit; font-size: 17px; color: var(--c); }
.eblock-h .mins { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14px; color: var(--muted); }
.eblock-h .mins input { width: 70px; }
.eitems { display: flex; flex-direction: column; gap: 6px; }
.eitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 8px 7px 10px; }
.eitem b { font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.eitem .input { grid-column: 1 / -1; padding: 5px 8px; font-size: 14px; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .big { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.meter .big.over { color: var(--red); }
.sumlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sumlist li { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Tablas / listas ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { flex: 1 1 160px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.off td { opacity: .5; }
td .desc { color: var(--muted); font-size: 14px; margin-top: 2px; max-width: 70ch; }
.count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

/* ---------- Programa ---------- */
.kyutabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.kyutabs button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 6px 12px 8px; cursor: pointer; font-family: var(--f-display); font-weight: 800; font-size: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 58px; }
.kyutabs button.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.kyutabs .belt { width: 30px; }
.prog { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.prog ul { margin: 0; padding-left: 18px; }
.prog li { margin: 2px 0; }
.bigkyu { font-family: var(--f-display); font-weight: 800; font-size: 72px; line-height: .9; color: var(--red); }
.exam { border-top: 6px solid var(--c, var(--line)); }
.terms { columns: 2 260px; column-gap: 24px; }
.terms div { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.terms b { font-family: var(--f-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; min-width: 120px; }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding-block: 6vh; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.login-top { background: var(--band); color: #fff; border-bottom: 4px solid var(--red); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.login-top img { width: 192px; height: auto; max-width: 100%; }
.login-top b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.05; }
.login-top small { color: #B9B3B4; }
.login-form { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { padding: 11px; font-size: 16px; }
.err { background: var(--warn-bg); color: var(--red); border-radius: var(--r); padding: 8px 12px; font-size: 14px; }
.maxim { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; max-width: 420px; font-style: italic; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 10px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(10,10,12,.55); }
.modal-in { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 3px solid var(--red); }
.modal-b { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pick { display: flex; flex-direction: column; gap: 6px; }
.pick label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--surface-2); }
.pick label:has(input:checked) { border-color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--surface)); }
.pick input { margin-top: 4px; accent-color: var(--red); }
.pick b { display: block; font-weight: 600; }
.pick small { color: var(--muted); display: block; font-size: 13px; line-height: 1.35; }
.pick .m { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.2); min-width: 210px; padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.menu button { text-align: left; background: transparent; border: 0; padding: 9px 10px; border-radius: 4px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .topbar, .actions, .side .noprint, .btn { display: none !important; }
  body { background: #fff; }
  .sheet { grid-template-columns: 1fr; }
}

/* ---------- Vídeos ---------- */
.yt { display: inline-flex; align-items: center; gap: 7px; margin-top: 6px; font-weight: 600; font-size: 14px; color: var(--yt); text-decoration: none; border: 1px solid color-mix(in srgb, var(--yt) 35%, transparent); border-radius: 999px; padding: 4px 12px 4px 5px; background: color-mix(in srgb, var(--yt) 6%, var(--surface)); }
.yt:hover { background: color-mix(in srgb, var(--yt) 14%, var(--surface)); }
.yt-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--yt); color: #fff; font-size: 10px; padding-left: 2px; }
.yt.sm { font-size: 13px; padding: 2px 10px 2px 4px; }
.yt.sm .yt-ic { width: 16px; height: 16px; font-size: 8px; }
.yt-tag { font-family: var(--f-display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--yt); white-space: nowrap; }
a.tech { text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.tech:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- Horario ---------- */
.card { --g: var(--line); border-left: 4px solid var(--g); width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card.mine { box-shadow: inset 0 0 0 1px var(--red); }
.card.slot { background: transparent; border-style: dashed; border-left-style: solid; }
.card.slot .grp { color: var(--muted); }
div.card.slot { cursor: default; }
.card.slot:hover { border-color: var(--ink); border-left-color: var(--g); }
.card .time small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.card .pending { font-size: 12px; font-family: var(--f-display); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card.slot:hover .pending { color: var(--red); }
.card .who { margin-bottom: 6px; }
.cupo { display: inline-block; font-family: var(--f-body); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.cupo.full { background: var(--warn-bg); color: var(--red); border-color: transparent; }
.dayhead .dcount { font-size: 12px; margin-left: auto; margin-right: 8px; }
select.input.fsel { width: auto; min-width: 170px; }
.gdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--g); margin-right: 8px; vertical-align: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.daytabs button { font-size: 17px; flex-direction: row; gap: 8px; }
.daytabs small { font-family: var(--f-body); font-size: 12px; font-weight: 600; opacity: .7; }
.input.mini { width: 76px; padding: 5px 8px; }
table.slots td { vertical-align: middle; }
@media (max-width: 1000px) { select.input.fsel { flex: 1 1 160px; } }

.card { padding: 7px 8px 8px; }
.card .time { font-size: 17px; }
.card .time small { font-size: 12px; }
.card .tags { display: inline-flex; gap: 4px; align-items: center; }
.tat { font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.card .grp { font-size: 14px; margin-top: 3px; }
.card .who { font-size: 12.5px; margin: 1px 0 5px; }
.card.slot .who { margin-bottom: 2px; }
.card .pending { font-size: 11px; }
.daybody { gap: 6px; }

/* ---------- Planificar ---------- */
.catpick { display: flex; flex-wrap: wrap; gap: 6px; }
.catchip { --g: var(--line); display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 8px; cursor: pointer; background: var(--surface); font-weight: 600; font-size: 14px; }
.catchip input { accent-color: var(--red); margin: 0 6px 0 0; }
.catchip:has(input:checked) { border-color: var(--g); background: color-mix(in srgb, var(--g) 10%, var(--surface)); }
.catchip small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.pprev { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.pbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--r); padding: 12px 14px; }
.pbar .num { font-family: var(--f-display); font-size: 26px; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.catcard { --g: var(--line); border-top: 4px solid var(--g); }
.cathead { display: flex; align-items: center; gap: 2px 4px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips .pill { text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 500; font-size: 12.5px; }
.cyc { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.cyc li.now b { color: var(--red); }
.cylist { display: flex; flex-direction: column; gap: 6px; }
.cyrow { display: grid; grid-template-columns: 32px minmax(0, 16rem) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.cyn { font-family: var(--f-display); font-weight: 800; color: var(--muted); }
@media (max-width: 560px) { .cyrow { grid-template-columns: 32px minmax(0, 1fr) auto; } .cyrow input { grid-column: 2 / 4; } }
.autofill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--r); padding: 10px 12px; }
.autofill > div { flex: 1 1 220px; min-width: 0; }
.autofill .muted { font-size: 13px; }
.autofill select.input { width: auto; flex: 0 1 15rem; }

@media (max-width: 1440px) { .nav a { letter-spacing: .06em; padding: 8px 8px; font-size: 14px; } }
.menu .ver { color: var(--muted); font-size: 12px; padding: 6px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- Ilustraciones del libro ---------- */
.figsec { margin-top: 22px; }
.figh { font-size: 17px; color: var(--red); margin-bottom: 10px; letter-spacing: .06em; }
.figgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fig { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: zoom-in; overflow: hidden; font: inherit; color: inherit; }
.fig:hover { border-color: var(--ink); }
.figimg { display: flex; align-items: center; justify-content: center; background: #fff; height: 150px; padding: 8px; border-bottom: 1px solid var(--line); }
.figimg img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.figname { padding: 8px 10px 10px; font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: .04em; line-height: 1.25; text-transform: uppercase; }
.fig.arma .figname { color: var(--red); }
.figbig { background: #fff; border-radius: var(--r); display: flex; justify-content: center; padding: 12px; }
.figbig img { max-height: min(60vh, 420px); width: auto; max-width: 100%; }
@media (max-width: 480px) { .figgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figimg { height: 130px; } }

.yt.search { color: var(--muted); border-color: var(--line); background: var(--surface); }
.yt.search .yt-ic { background: var(--muted); font-size: 12px; padding-left: 0; }

/* ---------- Programación importada ---------- */
.progbox { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--s-calentamiento); border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.progbox .ptitle { font-size: 15px; }
.progbox .pcode { font-size: 15px; }
.progbox .pcode .pill { margin-right: 6px; }
.progbox details { border-top: 1px solid var(--line); padding-top: 8px; }
.progbox summary { cursor: pointer; font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.ficha img { display: block; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); margin-top: 8px; background: #fff; }
.pintro h4 { margin: 12px 0 4px; font-size: 15px; }
.pintro p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; max-width: 75ch; }
.gname { font-weight: 700; margin-top: 8px; }
.guide { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.guide .gsum { margin: 0; font-weight: 500; }
.guide .grow { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.guide .grow span, .guide .gsay span { font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--muted)); }
.guide .grow p { margin: 0; font-size: 15px; }
.guide .gsay { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 18px; font-weight: 700; }
@media (max-width: 480px) { .guide .grow, .guide .gsay { grid-template-columns: 1fr; gap: 0; } }
.exlist.compact p { display: none; }
.exlist.compact .yt { display: inline-flex; }
.impsess { margin-top: 10px; }
.impsess summary { cursor: pointer; font-weight: 600; }
.imps { border-top: 1px solid var(--line); padding: 10px 0; }
.impblocks { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.wdmap { display: flex; flex-wrap: wrap; gap: 10px; }
.wdmap label { display: flex; flex-direction: column; gap: 4px; min-width: 140px; font-size: 14px; text-transform: capitalize; }

/* ---------- Alumnos ---------- */
.beltchip { display: inline-flex; align-items: center; gap: 6px; }
.beltchip .belt, .nextk .belt { box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.stugrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.beltcard { --b: #fff; }
.beltbig { display: flex; align-items: center; gap: 14px; }
.beltbig .beltbar { width: 64px; height: 18px; border-radius: 3px; background: var(--b); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.beltbig b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; text-transform: uppercase; }
.beltbig small { color: var(--muted); font-size: 14px; }
.nextk { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.nextk .belt { width: 36px; height: 10px; }
.progbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progbar span { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.stuweek { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stuslot { --g: var(--line); display: flex; flex-direction: column; border-left: 4px solid var(--g); padding: 4px 0 4px 10px; }
.stuslot b { font-family: var(--f-display); font-size: 20px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.daypick label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 5px 9px; cursor: pointer; font-size: 14px; background: var(--surface); }
.daypick label:has(input:checked) { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.daypick input { accent-color: var(--red); margin: 0; }
