/* ============================================================
   BONOSNE · Guía interactiva del mercado de Treasuries
   Estética: terminal financiera oscura (ámbar sobre negro)
   ============================================================ */
:root {
  --bg: #0b0e13;
  --panel: #121722;
  --panel2: #0e121b;
  --line: #232b3a;
  --line-soft: #1a212e;
  --amber: #ffb000;
  --amber-soft: rgba(255, 176, 0, 0.12);
  --amber-dim: #9a7410;
  --text: #dde4f0;
  --muted: #8d99ad;
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --cyan: #38bdf8;
  --pink: #f472b6;
  --kid: #34d399;
  --pro: #ffb000;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* motion tokens (I1 §7.3): botones/chrome 150ms, paneles 250ms, ease-out-quint */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --t-fast: 0.15s;
  --t-med: 0.25s;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.92em; color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* ---------- ticker ---------- */
.tickerbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: #05070b; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; height: 34px;
  display: flex; align-items: center; overflow: hidden;
}
.ticker-track { display: flex; width: max-content; white-space: nowrap; animation: tick2 60s linear infinite; }
.tk { padding-right: 34px; }
.tickerbar:hover .ticker-track { animation-play-state: paused; }
@keyframes tick2 { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.tk { color: var(--muted); }
.tk b { color: var(--text); font-weight: 600; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ---------- nav ---------- */
nav.topnav {
  position: fixed; top: 34px; left: 0; right: 0; z-index: 50;
  background: rgba(11, 14, 19, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; row-gap: 6px;
  align-items: center; gap: 6px;
  padding: 8px 16px;
}
nav.topnav a {
  color: var(--muted); font-size: 13px; padding: 5px 10px; border-radius: 8px;
  white-space: nowrap; font-family: var(--mono);
}
nav.topnav a:hover { color: var(--amber); background: var(--amber-soft); text-decoration: none; }
nav.topnav a.brand { color: var(--amber); font-weight: 700; margin-right: 8px; }

/* modo de lectura */
.mode-switch { display: flex; gap: 6px; align-items: center; }
.mode-switch button {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.mode-switch button.active { background: var(--amber); color: #14100a; border-color: var(--amber); font-weight: 700; }
@media (max-width: 900px) { .mode-switch { position: static; margin-left: 0; } }

/* bloques kid/pro */
.blk { border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; border: 1px solid var(--line); position: relative; }
.blk-kid { background: linear-gradient(180deg, rgba(52, 211, 153, 0.07), rgba(52, 211, 153, 0.02)); border-color: rgba(52, 211, 153, 0.35); }
.blk-pro { background: linear-gradient(180deg, rgba(255, 176, 0, 0.06), rgba(255, 176, 0, 0.015)); border-color: rgba(255, 176, 0, 0.3); }
.blk-tag {
  position: absolute; top: -11px; left: 14px; font-size: 11.5px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; letter-spacing: 0.4px;
}
.blk-kid .blk-tag { background: #0f2a20; color: var(--kid); border: 1px solid rgba(52, 211, 153, 0.5); }
.blk-pro .blk-tag { background: #2a2107; color: var(--pro); border: 1px solid rgba(255, 176, 0, 0.5); }
body.mode-kid .blk-pro { display: none; }
body.mode-pro .blk-kid { display: none; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 150px 20px 60px; }
header.hero { padding: 40px 0 10px; }
h1.title { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 10px; color: #fff; }
h1.title .amp { color: var(--amber); }
.subtitle { color: var(--muted); font-size: 1.05rem; max-width: 860px; }
section { margin-top: 58px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 12px; margin-bottom: 6px; position: relative; }
.sec-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--amber-dim), rgba(154, 116, 16, 0.28) 55%, transparent); }
.sec-num { font-family: var(--mono); color: var(--amber); font-size: 0.95rem; }
h2 { color: #fff; font-size: clamp(1.25rem, 2.6vw, 1.7rem); margin: 0; }
h3 { color: var(--amber); font-size: 1.08rem; margin: 26px 0 8px; }
h4, .card h3, .quad .q h3, .tl-item h3 { color: #cbd5e1; margin: 18px 0 6px; font-size: 1rem; }
.card h3, .quad .q h3, .tl-item h3, .voice-card h3 { margin: 0 0 4px; }
h4 { color: #cbd5e1; margin: 18px 0 6px; }
p { margin: 10px 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* COR-H: el min-content de tablas dentro de cards inflaba el track 1fr (card de 363px a 390) y generaba overflow X. min-width:0 lo anula. */
.grid2 > *, .grid3 > * { min-width: 0; }
@media (max-width: 880px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; }
.kpi .v { font-family: var(--mono); font-size: 1.55rem; color: var(--amber); margin-top: 3px; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* tablas */
table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 0.92rem; }
@media (max-width: 760px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wrap { padding-top: 150px; }
  nav.topnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav.topnav::-webkit-scrollbar { display: none; }
  .mode-switch { flex-shrink: 0; }
}
th { text-align: left; color: var(--amber); font-family: var(--mono); font-weight: 600; font-size: 0.85rem; border-bottom: 1px solid var(--amber-dim); padding: 8px 10px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
tr:hover td { background: rgba(255, 176, 0, 0.04); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* alerta / nota */
.note { border-left: 3px solid var(--cyan); background: rgba(56, 189, 248, 0.06); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; font-size: 0.95rem; }
.warn { border-left: 3px solid var(--red); background: rgba(248, 113, 113, 0.06); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; font-size: 0.95rem; }
.src { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }

/* ---------- sliders / simuladores ---------- */
.sim { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 18px 0; }
.sim-title { font-family: var(--mono); color: var(--amber); font-size: 0.95rem; margin-bottom: 14px; letter-spacing: 0.5px; }
.ctl { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; margin: 10px 0; }
@media (max-width: 700px) { .ctl { grid-template-columns: 1fr 90px; } .ctl label { grid-column: 1 / -1; } }
.ctl label { font-size: 0.9rem; color: var(--muted); }
.ctl output { font-family: var(--mono); color: var(--amber); text-align: right; font-size: 0.98rem; }
input[type="range"] { width: 100%; accent-color: var(--amber); cursor: pointer; }
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.readout .cell { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.readout .cell .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.readout .cell .v { font-family: var(--mono); font-size: 1.25rem; margin-top: 2px; }
.v-green { color: var(--green); } .v-red { color: var(--red); } .v-amber { color: var(--amber); } .v-blue { color: var(--blue); } .v-purple { color: var(--purple); }

/* seesaw (sube-y-baja) */
.seesaw-stage { position: relative; height: 230px; margin: 10px 0 4px; }
.seesaw-plank {
  position: absolute; left: 50%; top: 44%; width: 76%; height: 14px; margin-left: -38%;
  background: linear-gradient(90deg, #3a4356, #55617c, #3a4356); border-radius: 7px;
  transform-origin: 50% 50%; transform: rotate(var(--tilt, 0deg)); transition: transform 0.45s cubic-bezier(.34,1.4,.64,1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
.seesaw-seat { position: absolute; top: -46px; width: 130px; text-align: center; font-size: 0.8rem; }
.seesaw-seat .emoji { font-size: 1.6rem; display: block; }
.seesaw-seat.left { left: -14px; } .seesaw-seat.right { right: -14px; }
.seesaw-seat .val { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; }
.seesaw-pivot {
  position: absolute; left: 50%; top: calc(44% + 5px); width: 0; height: 0; margin-left: -24px;
  border-left: 24px solid transparent; border-right: 24px solid transparent; border-bottom: 74px solid #2b3245;
}
.seesaw-base { position: absolute; left: 50%; top: calc(44% + 78px); width: 130px; height: 10px; margin-left: -65px; background: #232b3a; border-radius: 5px; }

/* gráficos SVG */
.chartbox { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0; position: relative; }
.chartbox svg { width: 100%; height: auto; display: block; }
.chart-title { font-family: var(--mono); color: var(--amber); font-size: 0.9rem; margin: 0 0 4px 4px; }
.chart-sub { color: var(--muted); font-size: 0.8rem; margin: 0 0 8px 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 4px 0; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); cursor: pointer; border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; background: var(--panel); user-select: none; min-height: 24px; }
.legend .lg.off { opacity: 0.62; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip {
  position: fixed; pointer-events: none; z-index: 90; background: #05070b; border: 1px solid var(--amber-dim);
  border-radius: 8px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; color: var(--text);
  display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.6); max-width: 260px;
}
.tip .t-date { color: var(--amber); font-weight: 700; }
.axis { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.gridline { stroke: var(--line-soft); stroke-width: 1; }
.evflag { cursor: pointer; }
.evflag text { font-family: var(--mono); font-size: 10px; fill: var(--cyan); }
.evflag circle { fill: var(--cyan); }
.evflag.warn circle { fill: var(--red); } .evflag.warn text { fill: var(--red); }

/* timeline */
.tl { position: relative; margin: 20px 0; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--amber), var(--line)); }
.tl-item { position: relative; margin: 0 0 22px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--amber); }
.tl-item.hawk::before { border-color: var(--red); }
.tl-item.dove::before { border-color: var(--green); }
.tl-item.war::before { border-color: var(--purple); }
.tl-date { font-family: var(--mono); color: var(--amber); font-size: 0.82rem; }
.tl-item h4 { margin: 2px 0 4px; color: #fff; }
.tl-item p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.tl-badge { font-size: 0.7rem; font-family: var(--mono); border: 1px solid var(--line); color: var(--muted); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }

/* escenarios */
.scn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 16px 0; }
.scn-btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; color: var(--text); font-family: inherit; text-align: left; transition: border-color 0.15s, transform 0.15s; }
.scn-btn:hover { border-color: var(--amber); transform: translateY(-2px); }
.scn-btn.sel { border-color: var(--amber); background: var(--amber-soft); }
.scn-btn .ico { font-size: 1.5rem; }
.scn-btn .nm { font-weight: 700; margin-top: 6px; color: #fff; }
.scn-btn .yr { font-family: var(--mono); color: var(--amber); font-size: 0.8rem; }
.scn-detail { background: var(--panel2); border: 1px solid var(--amber-dim); border-radius: var(--radius); padding: 20px; margin-top: 6px; }
.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 14px 0; }
.chain .step { flex: 1 1 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.86rem; position: relative; }
.chain .step b { display: block; color: var(--amber); font-size: 0.78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.chain .arrow { align-self: center; color: var(--amber); font-size: 1.2rem; font-weight: 700; }
.arrows-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.arrows-out .ao { border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); }
.arrows-out .ao .dir { font-size: 1.3rem; }
.arrows-out .ao .lbl { font-size: 0.8rem; color: var(--muted); }
.arrows-out .ao .why { font-size: 0.78rem; color: var(--muted); }

/* cuadrantes curva */
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
@media (max-width: 760px) { .quad { grid-template-columns: 1fr; } }
.quad .q { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--panel); }
.quad .q h4 { margin: 0 0 4px; }
.quad .q .tagline { font-family: var(--mono); font-size: 0.78rem; color: var(--amber); }

/* quiz */
.quiz-q { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.quiz-q .qq { font-weight: 600; color: #fff; margin-bottom: 10px; }
.quiz-opt { display: block; width: 100%; text-align: left; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 6px 0; cursor: pointer; font-family: inherit; font-size: 0.93rem; }
.quiz-opt:hover { border-color: var(--amber); }
.quiz-opt.ok { border-color: var(--green); background: rgba(52, 211, 153, 0.12); }
.quiz-opt.bad { border-color: var(--red); background: rgba(248, 113, 113, 0.12); }
.quiz-fb { margin-top: 10px; font-size: 0.9rem; border-radius: 8px; padding: 10px 12px; display: none; }
.quiz-fb.show { display: block; }
.quiz-fb.good { background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.4); }
.quiz-fb.badfb { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.4); }
.quiz-score { font-family: var(--mono); color: var(--amber); font-size: 1.2rem; }

/* glosario */
.gloss-search { width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 1rem; padding: 11px 14px; border-radius: 10px; margin: 10px 0; font-family: var(--mono); }
.gloss-search:focus { outline: none; border-color: var(--amber); }
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.gloss-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.gloss-item .gt { color: var(--amber); font-weight: 700; font-size: 0.9rem; }
.gloss-item .gd { font-size: 0.86rem; color: var(--muted); margin-top: 3px; }
.gloss-item .gk { font-size: 0.75rem; color: var(--green); font-family: var(--mono); }

/* descomposición apilada */
.decomp { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: end; margin: 10px 0; }
@media (max-width: 760px) { .decomp { grid-template-columns: 1fr; } }
.stackbar { display: flex; flex-direction: column-reverse; height: 300px; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.stackbar .seg { display: flex; align-items: center; justify-content: center; color: #0b0e13; font-family: var(--mono); font-weight: 700; font-size: 0.95rem; }
.decomp-total { font-family: var(--mono); color: var(--amber); text-align: center; font-size: 1.05rem; margin-top: 6px; }

/* pills de fuente */
.pill { display: inline-block; font-family: var(--mono); font-size: 0.7rem; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
.pill.verified { color: var(--green); border-color: rgba(52, 211, 153, 0.45); }
.pill.grok { color: var(--purple); border-color: rgba(167, 139, 250, 0.45); }

footer { margin-top: 70px; border-top: 1px solid var(--line); padding: 26px 0 10px; color: var(--muted); font-size: 0.85rem; }
.selftest { font-family: var(--mono); font-size: 0.8rem; color: var(--green); }

details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
details summary { cursor: pointer; color: var(--amber); font-weight: 600; }
details[open] summary { margin-bottom: 8px; }

.fomc-table td { font-family: var(--mono); font-size: 0.85rem; }

/* barra de sección de preguntas frecuentes del precio */
.pq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.pq { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--panel); cursor: pointer; transition: border-color .15s; }
.pq:hover { border-color: var(--cyan); }
.pq .pq-t { font-weight: 700; color: #fff; font-size: 0.95rem; }
.pq .pq-e { font-size: 1.5rem; }
.pq-body { grid-column: 1 / -1; background: var(--panel2); border: 1px solid var(--cyan); border-radius: 10px; padding: 16px 18px; margin-top: 4px; display: none; }
.pq-body.show { display: block; }

/* ============================================================
   META-APRENDIZAJE (learn.js): siglo, stepper, flashcards,
   checkpoints, modo guía y fluidez
   ============================================================ */

/* barra de progreso de lectura */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; background: transparent; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb000, #fb923c); transition: width 0.1s linear; }

/* botón siguiente sección */
.sec-next { margin-top: 26px; display: flex; justify-content: flex-end; }
.sec-next button { background: var(--panel); color: var(--amber); border: 1px solid var(--amber-dim); border-radius: 999px; padding: 9px 18px; font-family: inherit; font-size: 0.9rem; cursor: pointer; transition: all 0.15s; }
.sec-next button:hover { background: var(--amber); color: #14100a; border-color: var(--amber); }

/* gráfico del siglo */
#century-chart { margin-top: 8px; }
.zero-line { stroke: #8d99ad; stroke-width: 1.4; }
.zero-txt { fill: #cbd5e1; font-weight: 700; }
.rec-band { fill: rgba(148, 163, 184, 0.16); }
.src-boundary { stroke: #475569; stroke-width: 1; stroke-dasharray: 5,4; }
.ep-num { font-family: var(--mono); font-size: 9.5px; fill: #0b0e13; font-weight: 700; }
.ep-lab { font-family: var(--mono); font-size: 10px; fill: #cbd5e1; }
.ep-mark:hover circle:first-child { stroke: #fff; stroke-width: 1.5; }
.zoom-btn { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 0.82rem; cursor: pointer; font-family: inherit; }
.zoom-btn.active { background: var(--amber); color: #14100a; border-color: var(--amber); font-weight: 700; }
.zoom-btn:hover { color: var(--amber); border-color: var(--amber); }
.fc-deck-btn:hover { color: var(--amber); border-color: var(--amber); }
.dx-chip:hover { color: var(--amber); border-color: var(--amber); }
#century-zoom { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 2px 6px; }

/* navegador de episodios */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 14px 0; }
.ep-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; color: var(--text); font-family: inherit; }
.ep-chip:hover { border-color: var(--amber); }
.ep-chip.sel { border-color: var(--amber); background: var(--amber-soft); }
.ep-year { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; color: #fff; }
.ep-bd { font-size: 0.72rem; font-family: var(--mono); border-radius: 4px; padding: 1px 7px; }
.ep-bd.ok { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.5); }
.ep-bd.bad { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.5); }
.ep-bd.mid { color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.5); }
.ep-t { font-size: 0.78rem; color: var(--muted); }
.ep-detail { background: var(--panel2); border: 1px solid var(--amber-dim); border-radius: var(--radius); padding: 20px; margin-top: 10px; }
.ep-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ep-head h3 { margin: 0; color: #fff; }
.ep-sub { color: var(--amber); font-family: var(--mono); font-size: 0.85rem; }
.ep-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.ep-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ep-stat .k { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ep-stat .v { font-family: var(--mono); font-size: 0.98rem; color: var(--amber); }
.ep-extra { display: grid; gap: 6px; margin-top: 12px; font-size: 0.88rem; color: var(--muted); }

/* stepper del mecanismo */
.stepper { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.st-curvebox { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.st-curvelab { position: absolute; top: 14px; right: 16px; font-family: var(--mono); font-size: 0.8rem; }
.st-curvelab .inv { color: var(--red); }
.st-curvelab .nrm { color: var(--green); }
.st-body { margin-top: 14px; }
.st-top { display: flex; align-items: baseline; gap: 12px; }
.st-count { font-family: var(--mono); color: var(--amber); font-size: 0.82rem; }
.st-body h4 { margin: 0; color: #fff; font-size: 1.05rem; }
.st-real { background: var(--amber-soft); border: 1px solid var(--amber-dim); border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; margin: 10px 0; }
.st-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.btn-step { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; cursor: pointer; font-family: inherit; font-size: 0.9rem; }
.btn-step:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.btn-step:disabled { opacity: 0.4; cursor: default; }
.btn-step.go { background: var(--amber); color: #14100a; border-color: var(--amber); font-weight: 700; }
.btn-step.go:hover { color: #14100a; filter: brightness(1.08); }
.st-dots { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.st-dots .dot { width: 14px; height: 26px; border-radius: 7px; min-width: 14px; border-radius: 50%; background: var(--line); cursor: pointer; transition: all 0.15s; }
.st-dots .dot.on { background: var(--amber); transform: scale(1.25); }

/* flashcards */
.fc-decks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.fc-deck-btn { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 0.84rem; cursor: pointer; font-family: inherit; }
.fc-deck-btn.active { background: var(--amber); color: #14100a; border-color: var(--amber); font-weight: 700; }
.fc-stage { max-width: 720px; margin: 0 auto; }
.fc-progress { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.fc-card { position: relative; min-height: 260px; border-radius: 14px; cursor: pointer; outline: none; perspective: 1200px; }
.fc-card:focus-visible { box-shadow: 0 0 0 2px var(--amber); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; padding: 28px; text-align: center; }
.fc-front { background: linear-gradient(160deg, #151b28, #0f141e); border: 1px solid var(--line); }
.fc-back { background: linear-gradient(160deg, #1d1505, #14100a); border: 1px solid var(--amber-dim); transform: rotateY(180deg); }
.fc-card.flipped { animation: none; }
.fc-card.flipped .fc-front { transform: rotateY(-180deg); }
.fc-card .fc-front, .fc-card .fc-back { transition: transform 0.45s cubic-bezier(.4,.1,.3,1); }
.fc-card.flipped .fc-back { transform: rotateY(0deg); }
.fc-q { font-size: 1.15rem; font-weight: 600; color: #fff; max-width: 560px; }
.small-q { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.fc-a { font-size: 1rem; color: var(--amber); max-width: 560px; }
.fc-hint { font-size: 0.78rem; color: var(--muted); }
.fc-controls { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; }
.fc-know, .fc-review { border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-family: inherit; font-size: 0.9rem; font-weight: 600; }
.fc-know { background: rgba(52, 211, 153, 0.15); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.5); }
.fc-know:hover { background: rgba(52, 211, 153, 0.28); }
.fc-review { background: rgba(167, 139, 250, 0.13); color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.5); }
.fc-review:hover { background: rgba(167, 139, 250, 0.25); }
.fc-done { text-align: center; padding: 40px 20px; }
.fc-emoji { font-size: 3rem; }

/* checkpoints */
.checkpoint { background: var(--panel2); border: 1px solid #2b6a8f; border-radius: var(--radius); padding: 16px 18px; margin-top: 26px; }
.cp-head { font-family: var(--mono); color: #38bdf8; font-size: 0.8rem; letter-spacing: 0.8px; margin-bottom: 8px; }
.cp-q { font-weight: 600; color: #fff; margin-bottom: 10px; }
.cp-opt { display: block; width: 100%; text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; margin: 6px 0; cursor: pointer; font-family: inherit; font-size: 0.9rem; }
.cp-opt:hover { border-color: #38bdf8; }
.cp-opt.ok { border-color: var(--green); background: rgba(52, 211, 153, 0.14); }
.cp-opt.bad { border-color: var(--red); background: rgba(248, 113, 113, 0.14); }
.cp-fb { display: none; margin-top: 8px; font-size: 0.88rem; border-radius: 8px; padding: 9px 12px; }
.cp-fb.show { display: block; }
.cp-fb.good { background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.4); }
.cp-fb.badfb { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.4); }

/* modo guía · bottom 52px: deja hueco a la statusbar (28px + margen) para que no solapen (COR-H) */
.tour-panel { position: fixed; right: 18px; bottom: 52px; width: min(360px, calc(100vw - 36px)); background: #0d1420; border: 1px solid var(--amber-dim); border-radius: 14px; z-index: 70; box-shadow: 0 12px 40px rgba(0,0,0,0.6); overflow: hidden; }
.tour-panel.min { width: auto; }
.tour-panel.min .tour-body { display: none; }
.tour-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: linear-gradient(90deg, rgba(255,176,0,0.12), transparent); }
.tour-title { color: var(--amber); font-family: var(--mono); font-size: 0.85rem; font-weight: 700; }
.tour-min { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; line-height: 1; }
.tour-body { padding: 12px 16px 16px; }
.tour-prog { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.tour-bar { height: 6px; background: var(--line); border-radius: 3px; margin: 6px 0 10px; overflow: hidden; }
.tour-bar span { display: block; height: 100%; background: var(--amber); border-radius: 3px; transition: width 0.4s; }
.tour-sec { color: #fff; font-weight: 700; font-size: 0.95rem; }
.tour-task { color: var(--muted); font-size: 0.86rem; margin: 6px 0 10px; }
.tour-ok { color: var(--green); font-size: 0.86rem; margin: 8px 0; }
.tour-wait { color: #fbbf24; font-size: 0.86rem; margin: 8px 0; }
.tour-skip { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; text-decoration: underline; padding: 8px 0 0; font-family: inherit; }
.tour-done { text-align: center; padding: 12px 4px; }
.tour-emoji { font-size: 2.6rem; }
.btn-tour-start { background: var(--amber); color: #14100a; border: none; border-radius: 999px; padding: 10px 20px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.95rem; }
.btn-tour-start:hover { filter: brightness(1.08); }

/* ============================================================
   FASE 3 · PREMIUM: accesibilidad, fedsim, descomposición,
   maestría, ticker-pausa, focus, tabular-nums, reduced-motion
   ============================================================ */

/* accesibilidad base */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--amber); color: #14100a; padding: 10px 18px; border-radius: 0 0 10px 0; font-weight: 700; }
.skip-link:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
button { font-family: inherit; }
button.lg, button.pq, button.ep-chip, button.scn-btn, button.zoom-btn, button.fc-deck-btn, button.dot { cursor: pointer; }
button.lg, .lg { background: var(--panel); }
input[type="range"] { min-height: 24px; }
.lg:focus-visible, .dot:focus-visible, .pq:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.kpi .v, .readout .cell .v, td.num, .axis, .ep-stat .v, .ms-pct, .fs-outs .v { font-variant-numeric: tabular-nums lining-nums; }

/* ticker pausa */
.tick-pause { position: absolute; right: 8px; top: 4px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; z-index: 5; font-size: 11px; }
.tick-pause:hover { color: var(--amber); border-color: var(--amber); }
/* tickerbar ya es position:fixed (línea ~50); no re-declarar position aquí */

/* jerarquía dato ≠ cromo */
.kpi .v { color: #f4f7fd; }
.chart-src { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); margin: 8px 4px 0; opacity: 0.9; }

/* flash de readouts (anti change-blindness) */
@keyframes cellflash { 0% { background: rgba(255, 176, 0, 0.25); } 100% { background: var(--panel); } }
.readout .cell.flash { animation: cellflash 400ms ease-out; }

/* etiquetas directas al final de línea (con halo) */
.line-lab { font-family: var(--mono); font-size: 11px; paint-order: stroke; stroke: #0b0e13; stroke-width: 3.5px; }

/* simulador Fed */
.fs-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.fs-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 880px) { .fs-grid { grid-template-columns: 1fr; } }
.fs-controls .ctl { grid-template-columns: 190px 1fr 84px; }
@media (max-width: 760px) { .fs-controls .ctl { grid-template-columns: 1fr 84px; } .fs-controls .ctl label { grid-column: 1 / -1; } }
/* Ejes legibles en móvil: el CSS pisa los atributos SVG, así que el bump se hace aquí.
   ViewBoxes 1080/1280 escalan ~0.27-0.32 a 390px: 38 unidades ≈ 10-12px reales.
   Los viewboxes pequeños (640: stepper, fs-curve) usan 24 para no dispararse. */
@media (max-width: 560px) {
  .axis { font-size: 38px; }
  .line-lab { font-size: 34px; stroke-width: 7px; }
  .ep-lab { font-size: 30px; }
  .evflag text { font-size: 30px; }
  .ep-num { font-size: 26px; }
  .stepper .axis, .fs-curvebox .axis { font-size: 24px; }
  /* el siglo usa viewBox 1280 (escala ~0.25 a 390px): necesita unidades mayores */
  #century-chart .axis { font-size: 46px; }
  #century-chart .ep-lab { font-size: 40px; }
  #century-chart .ep-num { font-size: 36px; }
  .evflag text { font-size: 34px; }
  #century-chart .ep-mark circle:first-of-type { r: 15; }
  .ydi-hint { font-size: 30px; }
  #century-chart .ep-mark circle:first-of-type { r: 11; }
}
.fs-curvebox { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.fs-outs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; grid-column: 1 / -1; }
.fs-outs .cell { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fs-outs .cell .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.fs-outs .cell .v { font-family: var(--mono); font-size: 1.3rem; margin-top: 2px; }
.fs-prob .fs-bar { height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.fs-prob .fs-bar span { display: block; height: 100%; }
.fs-verdict-bad, .fs-verdict-ok { border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 0.95rem; }
.fs-verdict-bad { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.45); }
.fs-verdict-ok { background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.45); }
.fs-volcker { margin-top: 10px; font-size: 0.88rem; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.fs-calib { margin-top: 12px; }
.fs-calib summary { color: var(--amber); font-weight: 600; cursor: pointer; }
.fs-calib-body table { max-width: 420px; }

/* descomposición explorable */
.dx-modes { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.dx-stage { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.dx-stack { display: flex; flex-direction: column-reverse; height: 240px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.dx-seg { display: flex; align-items: center; justify-content: center; color: #0b0e13; font-family: var(--mono); font-weight: 700; font-size: 0.85rem; transition: height 180ms ease-out; }
.dx-total { font-family: var(--mono); color: var(--amber); text-align: center; margin-top: 8px; font-size: 1.02rem; }
.dx-ranges { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 0.75rem; color: var(--muted); font-family: var(--mono); }

/* panel de maestría */
.mastery { background: linear-gradient(160deg, rgba(255,176,0,0.08), rgba(255,176,0,0.02)); border: 1px solid rgba(255, 176, 0, 0.4); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0 0; }
.ms-head { display: flex; align-items: center; gap: 14px; }
.ms-emoji { font-size: 2.1rem; }
.ms-nivel { color: #fff; font-size: 1.02rem; }
.ms-pct { font-family: var(--mono); color: var(--amber); font-size: 1.15rem; }
.ms-bar { height: 9px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 10px 0; }
.ms-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), #fb923c); transition: width 0.5s; }
.ms-rows { display: grid; gap: 7px; }
.ms-row { display: grid; grid-template-columns: 1fr auto 90px; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.ms-row b { font-family: var(--mono); color: var(--text); }
.ms-mini { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ms-mini i { display: block; height: 100%; background: var(--amber); }
.ms-note { margin: 10px 0 0; }

/* ============================================================
   PULIDO PREMIUM (COR-C · brief I1 §7.1/§7.3): hairline de
   elevación en reposo, sombra sutil solo en hover (150ms),
   borde ligeramente más luminoso. Sombras drop NUNCA en reposo.
   ============================================================ */
.card, .kpi, .sim, .chartbox, .blk { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.card, .kpi { transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.card:hover, .kpi:hover {
  border-color: #313d55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; transform: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .fc-card .fc-front, .fc-card .fc-back { transition: none; }
  .seesaw-plank { transition: none; }
  /* capa élite (COR-H): barras y revelados sin animación */
  .own-bar i, .ms-bar span, .ms-mini i, .tour-bar span, .dx-seg, .read-progress span, .fs-prob .fs-bar span { transition: none !important; }
  #ydi polyline { transition: none !important; } /* el revelado instantáneo lo decide JS vía REDUCE(); esto es red de seguridad */
  dialog.cmdk[open] { animation: none; }
}

/* ============================================================
   FASE 4 · CAPA ÉLITE: paleta, atajos, ydi, owners, voces, statusbar
   ============================================================ */

/* paleta y ayuda · COR-H: centrado robusto, max-height con scroll interno */
dialog.cmdk { border: none; border-radius: 16px; background: #0d1420; color: var(--text); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); box-shadow: 0 24px 80px rgba(0,0,0,0.7); overflow: auto; }
dialog.cmdk[open] { animation: cmdk-in 0.18s var(--ease); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
dialog.cmdk::backdrop { background: rgba(5, 7, 11, 0.74); backdrop-filter: blur(3px); }
.cmdk-box { padding: 0; }
.cmdk-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-head input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 1.05rem; font-family: inherit; min-width: 0; }
.cmdk-head input::placeholder { color: var(--muted); }
.cmdk-head kbd, .help-list kbd { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); box-shadow: inset 0 -1.5px 0 rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.05); }
#cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.cmdk-opt { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.cmdk-opt.on, .cmdk-opt:hover { background: var(--amber-soft); }
.cmdk-opt.on { box-shadow: inset 2px 0 0 var(--amber); }
.cmdk-opt:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; background: var(--amber-soft); }
.cmdk-opt.on .cmdk-l { color: #fff; }
.cmdk-g { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.cmdk-l { font-size: 0.92rem; min-width: 0; overflow-wrap: break-word; }
.cmdk-l mark { background: none; color: var(--amber); font-weight: 700; }
.cmdk-h { font-size: 0.75rem; color: var(--muted); max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); }
.cmdk-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
dialog.help .help-list { list-style: none; margin: 0; padding: 10px 16px; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
dialog.help .help-list li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; }
.help-toggle { display: flex; gap: 10px; align-items: center; padding: 12px 16px; font-size: 0.88rem; color: var(--muted); border-top: 1px solid var(--line); }
.nav-cmdk { background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 0.78rem; border-radius: 7px; padding: 5px 9px; cursor: pointer; white-space: nowrap; }
.nav-cmdk:hover { color: var(--amber); border-color: var(--amber); }

/* you draw it */
.ydi-stage { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; touch-action: none; cursor: crosshair; }
.ydi-stage svg { width: 100%; height: auto; }
.ydi-hint { fill: var(--muted); font-family: var(--mono); font-size: 22px; }
.ydi-controls { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.ydi-verdict { margin-top: 12px; font-size: 0.95rem; background: var(--panel); border: 1px solid var(--amber-dim); border-radius: 10px; padding: 12px 16px; min-height: 24px; }

/* owners */
.own-grid { display: grid; gap: 7px; margin: 10px 0; }
.own-row { display: grid; grid-template-columns: 230px 1fr 70px; gap: 12px; align-items: center; padding: 5px 8px; border-radius: 8px; }
.own-row:hover, .own-row:focus { background: var(--amber-soft); outline: none; }
.own-name { font-size: 0.88rem; color: var(--text); }
.own-bar { height: 18px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.own-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-dim), var(--amber)); border-radius: 4px; transition: width 0.6s; }
.own-val { text-align: right; color: var(--amber); font-size: 0.92rem; }
.own-evo { margin-top: 14px; }
.own-evo-t { color: var(--muted); font-size: 0.85rem; }
.own-evo-rows { display: grid; gap: 6px; margin-top: 6px; }
.own-evo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.own-yr { color: var(--amber); width: 40px; }
.own-evo-seg { display: inline-flex; align-items: center; gap: 6px; }
.own-evo-seg i { height: 10px; border-radius: 3px; display: inline-block; }
.own-evo-seg i.a { background: #56b4e9; } .own-evo-seg i.b { background: #cfd6e0; } .own-evo-seg i.c { background: var(--amber); }
@media (max-width: 760px) { .own-row { grid-template-columns: 1fr 60px; } .own-name { grid-column: 1 / -1; } }

/* voces */
.voices { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 14px 0; }
.voice-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.15s; }
.voice-card:hover, .voice-card:focus { border-color: var(--amber-dim); outline: none; }
.voice-tag { font-family: var(--mono); font-size: 0.72rem; color: var(--amber); text-transform: uppercase; letter-spacing: 0.5px; }
.voice-card blockquote { margin: 0; font-size: 0.98rem; color: #e8edf6; font-style: italic; border-left: 3px solid var(--amber-dim); padding-left: 12px; }
.voice-meta { font-size: 0.84rem; color: var(--muted); }

/* statusbar */
.statusbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; display: flex; justify-content: space-between; align-items: center; padding: 4px 14px; background: rgba(5,7,11,0.92); border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.statusbar #sb-path { color: var(--amber); }
body { padding-bottom: 30px; }

/* paleta en pantallas estrechas: columna de grupo más corta (COR-H) */
@media (max-width: 430px) {
  .cmdk-opt { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 8px; }
  .cmdk-head { padding: 12px 12px; }
  #cmdk-list { max-height: 44vh; }
}

/* foco visible (WCAG 2.4.7/2.4.11) en piezas enfocables de la capa élite (CORE) */
.own-row:focus-visible, .voice-card:focus-visible, .ydi-stage:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

/* ============================================================
   IMPRESIÓN (COR-H): hoja de resumen + gráficos legibles.
   Pantalla: .print-only no existe; impresión: se muestra primero.
   ============================================================ */
.print-only { display: none; }

@media print {
  /* (a) ocultar cromo e interactivos */
  .tickerbar, nav.topnav, .statusbar, .tour-panel, .read-progress, .skip-link,
  .nav-cmdk, .mode-switch, .btn-tour-start, .sec-next, .checkpoint,
  #s14, #s15, dialog.cmdk, .tip, .legend, #century-zoom, .zoom-btn,
  .gloss-search, .scn-grid, #scn-detail, .ep-grid, #ep-detail,
  .ydi-controls, .dx-modes, #mastery, .pq-body { display: none !important; }

  /* (b) hoja blanca, texto negro, contraste de gráficos */
  html, body { background: #fff !important; color: #000 !important; }
  body { padding: 0 !important; font-size: 12px; line-height: 1.45; }
  .wrap { max-width: none; padding: 0 10mm !important; }
  .card, .kpi, .sim, .chartbox, .blk, .stepper, .note, .warn, details,
  .readout .cell, .fs-outs .cell, .gloss-item, .own-row, .voice-card,
  .ep-chip, .ep-stat, .quad .q, .pq { background: #fff !important; border-color: #999 !important; box-shadow: none !important; }
  h1, h2, h3, h4, .kpi .v, .readout .cell .v, th, code, .mono, .subtitle,
  .tl-item h4, .kpi .k, .kpi .s, .chart-title, .chart-src, .src { color: #000 !important; }
  .muted, .chart-sub, .small { color: #333 !important; }
  a { color: #000 !important; text-decoration: none; }
  th { border-bottom-color: #666 !important; }
  td { border-bottom-color: #ccc !important; }
  .sec-head::after { background: #999 !important; }
  .pill { border-color: #999 !important; color: #333 !important; }
  /* SVG: sin filtros y textos en negro; retícula gris, halo blanco en etiquetas */
  svg { filter: none !important; }
  .axis, .ep-lab, .zero-txt, .ydi-hint, .evflag text, .cmdk-l { fill: #000 !important; color: #000 !important; }
  .line-lab { fill: #000 !important; stroke: #fff !important; }
  .gridline { stroke: #bbb !important; }
  .zero-line { stroke: #555 !important; }
  .rec-band { fill: #e4e4e4 !important; }
  .src-boundary { stroke: #999 !important; }
  .zero-txt, .ep-num { fill: #000 !important; }
  .stackbar, .dx-stack { border-color: #999 !important; }
  .stackbar .seg, .dx-seg { color: #000 !important; }

  /* (c) hoja de resumen: primera página impresa */
  .print-only { display: block !important; }
  #cheatsheet { margin-top: 0 !important; }
  #cheatsheet .cs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  #cheatsheet .cs-t { width: 100%; margin: 4px 0; font-size: 10.5px; }
  #cheatsheet .cs-t caption { caption-side: top; text-align: left; font-family: var(--mono); font-weight: 700; font-size: 10.5px; padding: 2px 0 3px; color: #000; }
  #cheatsheet .cs-t th, #cheatsheet .cs-t td { padding: 1.5px 6px; border-bottom: 0.5pt solid #ccc; font-size: 10.5px; }
  #cheatsheet .cs-t td.num { white-space: nowrap; }
  #cheatsheet .cs-full { grid-column: 1 / -1; }
  #cheatsheet .src { font-size: 9px; }

  /* higiene de saltos de página */
  .card, .kpi, .chartbox, .blk, table, .tl-item, .note, .warn, .own-row, .voice-card { break-inside: avoid; }
  h2, h3, h4, .sec-head { break-after: avoid; }
}
.voice-after { font-size: 0.84rem; color: var(--cyan); border-top: 1px dashed var(--line); padding-top: 8px; }

/* tablas scrollables accesibles por teclado en móvil */
@media (max-width: 760px) {
  table[role="scrollable"], .tbl-scroll { outline: none; }
}

/* anotaciones legibles a 390px: specificity >= base */
@media (max-width: 560px) {
  .chartbox .ydi-hint { font-size: 44px; }
  #century-chart .ep-num { font-size: 42px; }
  #century-chart .ep-mark circle:first-of-type { r: 17; }
}

@media (max-width: 360px) {
  .gloss-grid { grid-template-columns: 1fr; }
}
