/* web-tai — achromatic ledger (taste-skill app sheet, seed 151227068)
   Chrome sin color; el único tono (--hue) va sobre el dato principal: lo dominado del temario.
   Rejilla: lienzo centrado de 1120px; 12 columnas, un solo gap (12px).
   Suma que cierra: 12 columnas = 3 x 4 columnas; 4 x (1fr) + 3 x 12 = 1120 con --pad de lienzo igual a ambos lados. */

@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap;
  src: url(fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap;
  src: url(fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ground: #f2f4f7;       /* azul grisáceo de libro de cuentas */
  --surface: #ffffff;
  --raised: #eceef2;
  --active: #e4e7ec;
  --border: #e1e4e9;
  --rule: #eceef1;
  --control: #cdd1d8;
  --text: #0a0a0a;
  --muted: #5f636b;
  --faint: #6b6f77;
  --primary: #141414; --primary-ink: #ffffff;
  --hue: #1d5fbf;          /* el único tono: lo dominado */
  --positive: #247b50; --negative: #c4242a;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --chart-1: #141414; --chart-2: #8a8e96; --chart-3: var(--hue); --chart-muted: #c9ccd2;
  --chart-mark: var(--text); --chart-span: .06;
  --grid: #e1e4e9; --axis-ink: var(--muted); --ink: var(--text); --rule-c: var(--rule);

  --radius-card: 8px; --radius-control: 6px; --radius-chip: 4px;
  --gap: 12px; --pad: 24px; --card-pad: 20px;
  --control-height: 36px; --row-height: 44px; --sidebar-width: 240px;
  --fs-title: 24px; --fs-section: 14px; --fs-kpi: 24px; --fs-lead: 36px; --fs-body: 14px; --fs-small: 12px;
  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000; --surface: #111111; --raised: #1c1c1c; --active: #222222;
    --border: #2a2a2a; --rule: #1c1c1c; --control: #444444;
    --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
    --primary: #ffffff; --primary-ink: #0a0a0a;
    --hue: #6ea8fe;
    --positive: #3fc07a; --negative: #e5566f;
    --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
    --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
    --chart-1: #ffffff; --chart-2: #8a8a8a; --chart-muted: #3a3a3a; --chart-span: .12;
    --grid: #2b2b2b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 var(--fs-body)/20px var(--font); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell: open plane ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 16px 12px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.switcher { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; text-decoration: none; }
.switcher b { display: block; font-weight: 500; font-size: 14px; line-height: 18px; }
.switcher span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.mark { flex: none; width: 28px; height: 28px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { background: var(--active); color: var(--text); }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.side .grow { flex: 1; }
.side .out { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border: 0; background: none; border-radius: 8px; color: var(--muted); text-align: left; }
.side .out:hover { color: var(--text); }

.canvas { min-width: 0; padding: 36px 40px 72px; }
.col { max-width: 1120px; margin: 0 auto; }
.col.narrow { max-width: 720px; }

.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h1 { margin: 0; font-size: var(--fs-title); line-height: 32px; font-weight: 500; letter-spacing: -.01em; }
.lede { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; max-width: 64ch; }
.lede b { font-weight: 500; color: var(--text); }
.title-row .actions { display: flex; gap: 8px; flex: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 500; }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; padding: 0 8px; }
.btn.ghost:hover { background: var(--active); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.seg { display: inline-flex; padding: 2px; background: var(--raised); border-radius: var(--radius-control); }
.seg button { height: 32px; min-width: 52px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }
.field { display: grid; gap: 8px; margin-bottom: 16px; max-width: 320px; }
.field label { font-weight: 500; }
input[type=password] { height: 40px; padding: 0 12px; width: 100%; border: 1px solid var(--control); background: var(--surface); border-radius: 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 28px; height: 16px; border-radius: 8px; background: var(--control); position: relative; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked { background: var(--positive); }
.switch input:checked::after { transform: translateX(12px); }

/* ---------- panels, strip ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.grid > * { min-width: 0; }
.s12 { grid-column: span 12; } .s6 { grid-column: span 6; } .s4 { grid-column: span 4; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.panel header .meta { color: var(--muted); font-size: 12px; }
.panel header a.more { color: var(--muted); font-size: 13px; text-decoration: none; }
.panel header a.more:hover { color: var(--text); }

.strip { display: grid; grid-template-columns: 1.7fr repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: var(--gap); }
.strip > div { padding: 18px 20px; border-left: 1px solid var(--border); }
.strip > div:first-child { border-left: 0; }
.strip .l { color: var(--muted); font-size: 13px; line-height: 18px; }
.strip .n { font-size: var(--fs-kpi); line-height: 32px; margin-top: 6px; font-weight: 400; letter-spacing: -.01em; }
.strip .lead .n { font-size: var(--fs-lead); line-height: 40px; }
.strip .c { color: var(--faint); font-size: 12px; line-height: 16px; margin-top: 2px; }
.u { color: var(--muted); font-size: 14px; letter-spacing: 0; }
.z { color: var(--faint); }

/* ---------- mapa del temario (el elemento propio) ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border: 1px solid var(--control); border-radius: 3px; position: relative; background: var(--surface); display: inline-block; }
.sw.on { border-color: var(--text); }
.sw.on::after { content: ""; position: absolute; left: 0; width: 55%; bottom: 0; height: 4px; background: var(--hue); }
.sw.off { border-style: dashed; border-color: var(--control); }
.map-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; padding: 8px 0; }
.map-row + .map-row { border-top: 1px solid var(--rule); }
.map-row .b { line-height: 18px; font-weight: 500; }
.map-row .t { display: block; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; margin-top: 2px; }
.cells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.cell { position: relative; height: 44px; padding: 7px 9px; border: 1px solid var(--text); border-radius: var(--radius-control); background: var(--surface); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: border-color .15s; }
a.cell:hover { border-color: var(--text); }
.cell b { font-weight: 500; font-size: 13px; line-height: 16px; }
.cell small { font-size: 11px; line-height: 12px; color: var(--muted); }
.cell .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--hue); }
.cell::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--raised); z-index: 0; }
.cell .bar { z-index: 1; }
.cell.off { border-style: dashed; border-color: var(--control); background: transparent; color: var(--faint); }
.cell.off::after { display: none; }
.cell.off b { font-weight: 400; color: var(--faint); }

/* ---------- listas, tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; font-size: 12px; line-height: 16px; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0 12px 0 0; height: 56px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
tr.grp th { padding: 28px 0 8px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text); }
tbody tr.grp:first-child th { padding-top: 12px; }
tr.grp th { border-bottom: 1px solid var(--border); }
tr.off td { height: 44px; }
tr.off .id b { display: inline-block; color: var(--muted); font-weight: 400; min-width: 64px; }
tr.off .id span { display: inline; color: var(--faint); font-size: 13px; }
th:last-child, td:last-child { padding-right: 0; }
.id b { font-weight: 500; display: block; line-height: 18px; }
.id span { color: var(--muted); font-size: 12px; line-height: 16px; display: block; }
.m-only { display: none !important; }
.track { height: 4px; background: var(--raised); border-radius: 2px; min-width: 80px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--hue); }
.dom { display: flex; align-items: center; gap: 10px; }
.dom .track { flex: 1; }
.dom span { min-width: 4ch; text-align: right; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 0; }
.rows .tx { min-width: 0; }
.rows .tx b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-weight: 400; overflow: hidden; }
.rows .tx span { display: block; color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .v { text-align: right; white-space: nowrap; flex: none; }
.rows .v span { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.panel.col-f { display: flex; flex-direction: column; }
.panel .body { flex: 1; }
.panel footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; line-height: 16px; }
.panel footer b { font-weight: 500; color: var(--text); }
.empty { border: 1px dashed var(--control); border-radius: var(--radius-card); padding: 10px 14px; color: var(--muted); min-height: 38px; display: flex; align-items: center; }
.skel { background: var(--raised); border-radius: 4px; }

/* ---------- sesiones (tarjetas y test) ---------- */
.crumb { display: flex; align-items: baseline; color: var(--muted); font-size: 13px; margin-bottom: 12px; gap: 12px; }
.crumb h1 { font-size: 16px; line-height: 24px; flex: none; color: var(--text); }
.crumb .l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb .cnt { flex: none; }
.prog { height: 3px; background: var(--raised); border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--text); transition: width .2s var(--ease); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 36px 28px; min-height: 160px; display: flex; flex-direction: column; justify-content: center; }
.card .front { font-size: 22px; line-height: 30px; font-weight: 500; letter-spacing: -.01em; }
.card .back { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 16px; line-height: 24px; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.grades .btn { height: 48px; flex-direction: column; gap: 0; }
.grades .btn small { font-size: 11px; color: var(--muted); line-height: 14px; }
.wide { width: 100%; height: 44px; margin-top: 12px; }

.q { font-size: 20px; line-height: 28px; font-weight: 500; margin: 0 0 18px; letter-spacing: -.01em; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; min-height: 48px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control); }
.opt kbd { font: 500 12px/20px var(--font); color: var(--muted); min-width: 14px; }
.opt:hover:not([disabled]) { border-color: var(--text); }
.opt[disabled] { cursor: default; }
.opt.good { background: var(--pill-positive-bg); border-color: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.opt.good kbd { color: var(--pill-positive-ink); }
.opt.bad { background: var(--pill-negative-bg); border-color: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.opt.bad kbd { color: var(--pill-negative-ink); }
.explain { margin-top: 16px; padding: 14px 16px; background: var(--raised); border-radius: var(--radius-card); }
.explain b { font-weight: 500; }

.res { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 4px 0 4px; }
.res .n { font-size: 36px; line-height: 40px; letter-spacing: -.01em; }
.res .p { color: var(--muted); }
.review h2 { font-size: 14px; font-weight: 500; margin: 28px 0 4px; }
.mark-ko { color: var(--negative); font-weight: 500; margin-right: 6px; }

/* ---------- acceso ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 360px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.login .field { max-width: none; }
.login .switcher { padding-left: 0; padding-bottom: 28px; }
.err { color: var(--negative); font-size: 13px; margin-top: 8px; }
.err:empty { display: none; }
.blockerr { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; background: var(--surface); }
.blockerr span { color: var(--muted); }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--ground); padding: 9px 14px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); /* taste-skill-ignore: toast flotante */ }
#toast.on { opacity: 1; }

@media (max-width: 1100px) { .s4 { grid-column: span 6; } .s4:last-child { grid-column: span 12; } }

/* ---------- móvil: la barra lateral se pliega ---------- */
.top, .sheet { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .top { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--ground); z-index: 5; }
  .top .who { display: flex; align-items: center; gap: 10px; font-weight: 500; }
  .top .who span { font-size: 14px; }
  .top .mark { width: 24px; height: 24px; }
  .menu { width: 44px; height: 44px; margin-right: -12px; border: 0; background: none; display: grid; place-items: center; }
  .sheet { position: fixed; inset: 0; z-index: 10; background: var(--ground); padding: 16px 16px 24px; flex-direction: column; }
  .sheet.on { display: flex; }
  .sheet .head { display: flex; justify-content: space-between; align-items: center; height: 40px; margin-bottom: 12px; }
  .sheet .nav a { height: 48px; font-size: 16px; }
  .sheet .out { height: 48px; font-size: 16px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--muted); }
  .canvas { padding: 20px 16px 56px; }
  h1 { font-size: 22px; line-height: 28px; }
  .title-row { flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .title-row .actions { width: 100%; }
  .title-row .actions .btn { flex: 1; height: 44px; }
  .s6, .s4 { grid-column: span 12; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div { border-left: 0; border-top: 1px solid var(--border); padding: 14px 16px; }
  .strip > div:nth-child(2n) { border-left: 1px solid var(--border); }
  .strip .lead { grid-column: 1 / -1; border-top: 0; }
  .strip > div:nth-child(2) { border-left: 0; }
  .strip > div:nth-child(3) { border-left: 1px solid var(--border); }
  .strip > div:nth-child(4) { border-left: 0; }
  .strip > div:nth-child(5) { border-left: 1px solid var(--border); }
  .panel { padding: 16px; }
  .panel > header { flex-wrap: wrap; }
  .legend { gap: 6px 14px; }
  .legend .meta { flex-basis: 100%; }
  .map-row { grid-template-columns: 1fr; gap: 8px; }
  .map-row .t { display: inline; margin-left: 6px; }
  .cell { height: 40px; padding: 6px 7px; }
  .cell small { display: none; }
  .cells { gap: 4px; }
  .card { padding: 24px 18px; min-height: 200px; }
  .card .front { font-size: 20px; line-height: 28px; }
  .grades .btn { height: 52px; }
  .opt { min-height: 52px; }
  .btn { height: 44px; }
  .btn.sm { height: 36px; }
  .seg button { height: 40px; }
  td.hide-m, th.hide-m { display: none; }
  /* tablas -> filas de dos líneas: identidad a la izquierda, acción a la derecha */
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; height: auto; border: 0; padding: 0; }
  table.stack td.hide-m, table.stack th.hide-m { display: none; }
  table.stack td.id { flex: 1; min-width: 0; }
  table.stack td.r { flex: none; width: auto !important; }
  table.stack tr.grp { display: block; padding: 0; }
  table.stack tr.grp th { display: block; padding: 24px 0 8px; }
  table.stack tbody tr.grp:first-child th { padding-top: 12px; }
  table.stack tr.off { padding: 8px 0; }
  .m-only { display: block !important; }
  tr.off .id b { display: block; min-width: 0; }
  tr.off .id span { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
