﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --red:    #E8001D;
  --rdk:    #B5001A;
  --red-lt: rgba(232,0,29,.07);
  --red-bd: rgba(232,0,29,.20);

  --bg:     #FFFFFF;
  --bg2:    #F7F8FA;
  --bg3:    #EDEEF1;
  --brd:    #D8DBE2;
  --brd2:   #BFC4CE;

  --tx:     #111111;
  --tx2:    #374151;
  --mu:     #6B7280;

  --gr:     #15803D;
  --gr-lt:  rgba(21,128,61,.08);
  --gr-bd:  rgba(21,128,61,.25);

  --or:     #B45309;
  --or-lt:  rgba(180,83,9,.08);
  --or-bd:  rgba(180,83,9,.25);

  --bl:     #1D4ED8;
  --bl-lt:  rgba(29,78,216,.07);
  --bl-bd:  rgba(29,78,216,.22);

  --dg:    #0C8B5E;
  --dg-lt: rgba(12,139,94,.07);
  --dg-bd: rgba(12,139,94,.22);

  --sh1: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --sh2: 0 4px 12px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.05);
  --sh3: 0 20px 50px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);

  --r:  10px;
  --rs: 7px;
  --rx: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Reset native button styles for our styled-as-button components */
button.ti, button.mt, button.hd-back, button.srch-btn, button.hbg-btn, .fc-card[role="button"] {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
button.ti  { width: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--tx);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
}

/* ── HEADER ── */
.hd {
  background: #111827;
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.logo {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--tx);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.logo-svg { flex-shrink: 0; display: block; }
.logo-brand { color: #fff; white-space: nowrap; flex-shrink: 0; }
.logo-sep   { color: rgba(255,255,255,.35); flex-shrink: 0; }
.logo-title { color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbg {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hr { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.spill {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  padding: 5px 13px;
  border-radius: var(--rs);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
}
.spill strong { color: #4ade80; font-weight: 700; }

/* ── LAYOUT ── */
.ly { display: flex; flex: 1; overflow: hidden; }
.mn { flex: 1; overflow-y: auto; background: var(--bg2); }

/* ── SIDEBAR ── */
.sb {
  width: 220px;
  background: var(--bg);
  border-right: 1px solid var(--brd);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}
.ss {
  min-height: 49px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--mu);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--brd);
}
#topicList { padding: 0 6px; }
.ti {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  cursor: pointer;
  transition: all .13s;
  border-radius: var(--rs);
  border: 1px solid transparent;
}
.ti:hover { background: var(--bg3); border-color: var(--brd); }
.ti.ac {
  background: var(--dg-lt);
  border-color: var(--dg-bd);
  border-left: 3px solid var(--dg);
  box-shadow: none;
}
.ti.ac .tnm { color: var(--dg); font-weight: 700; font-size: 12.5px; }
.tic {
  font-size: 14px;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--rx);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tin { flex: 1; min-width: 0; }
.tnm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx2); }
.tmt { font-size: 10px; color: var(--mu); margin-top: 1px; }
.tpc {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  background: var(--bg3);
  color: var(--mu);
  border: 1px solid var(--brd);
}
.ti.ac .tpc { background: var(--dg); color: #fff; border-color: var(--dg); }
.simbtn {
  margin: 10px 8px 10px;
  padding: 11px 14px;
  border-radius: var(--rs);
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: all .15s;
  width: calc(100% - 16px);
  letter-spacing: 0.3px;
  box-shadow: 0 2px 10px rgba(232,0,29,.35);
  text-transform: uppercase;
}
.simbtn:hover {
  background: var(--rdk);
  box-shadow: 0 4px 16px rgba(232,0,29,.50);
  transform: translateY(-1px);
}
.sb-sep {
  height: 1px;
  background: var(--brd);
  margin: 4px 12px;
}

/* ── MAIN ── */
/* Tabs bar — full width sticky */
.mts {
  background: var(--bg);
  border-bottom: 1px solid var(--brd);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
/* Centered inner — aligns with content below */
.mts-in {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px;
}
.mt {
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mu);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .13s;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mt:hover { color: var(--tx2); }
.mt.ac { color: var(--dg); border-bottom-color: var(--dg); }
/* Centered content body */
.mn-body {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 48px;
  box-sizing: border-box;
}
.cnt { padding: 36px 0 60px; }

/* ── BUTTONS ── */
.btn {
  padding: 9px 20px;
  border-radius: var(--rs);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
}
.bp { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(232,0,29,.35); }
.bp:hover { background: var(--rdk); box-shadow: 0 3px 14px rgba(232,0,29,.50); transform: translateY(-1px); }
.bp:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.bs { background: var(--bg3); color: var(--tx2); border: 1px solid var(--brd2); }
.bs:hover { background: var(--brd); border-color: var(--brd2); color: var(--tx); }

/* ── THEORY ── */
.thh {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--brd);
}
.thic {
  font-size: 26px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.thtl { font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 800; margin-bottom: 6px; color: var(--tx); line-height: 1.2; letter-spacing: -0.6px; }
.thsb { color: var(--mu); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.thgr { display: flex; flex-direction: column; gap: 0; margin-bottom: 18px; }
.thc {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}
/* Summary intro card (outside .thgr) */
.thc.fl {
  padding: 14px 20px;
  background: var(--bg2);
  border-radius: 0 var(--rs) var(--rs) 0;
  margin-bottom: 24px;
}
/* Sections inside .thgr — comes after .thc.fl so wins for same specificity */
.thgr .thc { border-top: 1px solid var(--brd); padding: 28px 0 20px; }
.thgr .thc:first-child { border-top: none; padding-top: 4px; }
.ctit {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
  text-transform: none;
  letter-spacing: -0.3px;
  line-height: 1.3;
  padding-left: 14px;
  border-left: 3px solid currentColor;
}
.cb { font-size: 14px; line-height: 1.82; color: var(--tx2); }
.cb strong { color: var(--tx); font-weight: 600; }
.cb a { color: var(--dg); text-decoration: none; }
.cb a:hover { text-decoration: underline; }
.cb ul { padding-left: 18px; margin: 8px 0; }
.cb li { margin-bottom: 6px; }
.cb ol { padding-left: 18px; margin: 8px 0; }
.cb p { margin-bottom: 10px; }
.cb code { background: #F3F4F6; border: 1px solid var(--brd2); border-radius: 4px; padding: 2px 6px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #DC2626; }

/* callout boxes */
.kr {
  background: var(--red-lt);
  border: 1px solid var(--red-bd);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--rs) var(--rs) 0;
  padding: 11px 15px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--tx2);
}
.kr strong { color: var(--red); }
.tb {
  background: var(--bl-lt);
  border: 1px solid var(--bl-bd);
  border-left: 3px solid var(--bl);
  border-radius: 0 var(--rs) var(--rs) 0;
  padding: 11px 15px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--tx2);
}
.tb strong { color: var(--bl); }
.tg {
  background: var(--gr-lt);
  border: 1px solid var(--gr-bd);
  border-left: 3px solid var(--gr);
  border-radius: 0 var(--rs) var(--rs) 0;
  padding: 11px 15px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--tx2);
}
.tg strong { color: var(--gr); }

/* key rules section */
.krls { background: rgba(12,139,94,.04); border: 1px solid var(--dg-bd); border-left: 3px solid var(--dg); border-radius: 0 var(--rs) var(--rs) 0; padding: 16px 20px; margin-bottom: 24px; }
.krls-t { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--dg); margin-bottom: 10px; }
.krls-i { font-size: 13px; color: var(--tx2); line-height: 1.65; padding: 5px 0; border-bottom: 1px solid var(--dg-bd); display: flex; gap: 8px; align-items: flex-start; }
.krls-i:last-child { border-bottom: none; }
.krls-i::before { content: '›'; color: var(--dg); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── DOCS REFERENCES ── */
.doc-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--brd);
  align-items: center;
}
.doc-refs-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mu);
  white-space: nowrap;
  margin-right: 2px;
}
.doc-link {
  font-size: 11px;
  color: var(--dg);
  text-decoration: none;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid var(--dg-bd);
  background: var(--dg-lt);
  transition: all .13s;
  line-height: 1.6;
}
.doc-link:hover { background: var(--dg); color: #fff; border-color: var(--dg); }

/* ── PRACTICE ── */
.pst { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.st {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 10px 16px;
  text-align: center;
  min-width: 75px;
  box-shadow: var(--sh1);
}
.stv { font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--tx); }
.stl { font-size: 9px; color: var(--mu); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px; font-weight: 600; }
.pct { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.dfl { display: flex; gap: 4px; flex-wrap: wrap; }
.dfb {
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--brd2);
  background: var(--bg2);
  color: var(--mu);
  transition: all .13s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  line-height: 1.4;
}
.dfb:hover { background: var(--bg3); border-color: var(--brd2); color: var(--tx); }
.qc {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--sh2);
}
.qm { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.qb {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg3);
  color: var(--mu);
  border: 1px solid var(--brd);
  font-family: 'Inter', sans-serif;
}
.qt { font-size: 15px; font-weight: 400; line-height: 1.7; margin-bottom: 16px; color: var(--tx); font-family: 'Inter', sans-serif; }
.qx {
  background: var(--bl-lt);
  border: 1px solid var(--bl-bd);
  border-radius: var(--rs);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--tx2);
  line-height: 1.6;
}
.qx::before { content: 'Escenario: '; font-weight: 700; color: var(--bl); }
.ops { display: flex; flex-direction: column; gap: 7px; }
.op {
  background: var(--bg3);
  border: 1.5px solid var(--brd);
  border-radius: var(--rs);
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  transition: all .13s;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tx2);
}
.op:hover:not(.di) { background: var(--red-lt); border-color: var(--red-bd); color: var(--red); transform: translateX(2px); }
.op.ok  { background: var(--gr-lt); border-color: var(--gr-bd); color: var(--tx); }
.op.bad { background: var(--red-lt); border-color: var(--red-bd); color: var(--tx); }
.op.sok { background: var(--gr-lt); border-color: var(--gr-bd); color: var(--tx); }
.op.di  { cursor: default; }
.ol {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px solid var(--brd2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  color: var(--mu);
}
.op:hover:not(.di) .ol { border-color: var(--red); color: var(--red); background: rgba(232,0,29,.15); }
.op.ok  .ol { background: var(--gr); border-color: var(--gr); color: #fff; }
.op.bad .ol { background: var(--red); border-color: var(--red); color: #fff; }
.op.sok .ol { background: var(--gr); border-color: var(--gr); color: #fff; }
.ex {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--brd);
  border-left: 3px solid var(--bl);
  border-radius: 0 var(--rs) var(--rs) 0;
  padding: 14px 18px;
}
.ext { font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; font-family: 'Inter', sans-serif; color: var(--bl); }
.exb { font-size: 13px; line-height: 1.75; color: var(--tx2); }
.exb strong { font-weight: 600; color: var(--tx); }
.nxt { margin-top: 14px; display: flex; gap: 8px; }
.lb {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 44px;
  text-align: center;
  color: var(--mu);
  box-shadow: var(--sh1);
}
.sp { width: 26px; height: 26px; border: 2.5px solid var(--brd2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.erb { background: var(--red-lt); border: 1px solid var(--red-bd); border-radius: var(--rs); padding: 12px 14px; font-size: 12px; color: var(--red); margin-bottom: 12px; }

/* ── SIMULACRO START ── */
.sst { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; max-width: 560px; margin: 0 auto; }
.sstit { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--tx); letter-spacing: -0.5px; }
.ssdsc { color: var(--mu); font-size: 13px; line-height: 1.7; margin-bottom: 24px; }
.ssrl { background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r); padding: 0; width: 100%; margin-bottom: 20px; text-align: left; overflow: hidden; box-shadow: var(--sh1); }
.srrw { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--brd); font-size: 13px; }
.srrw:last-child { border-bottom: none; }
.srrl { color: var(--mu); } .srrv { font-weight: 700; color: var(--tx); }
.tdist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-bottom: 22px; }
.dsti { background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--rs); padding: 10px 12px; text-align: left; display: flex; align-items: center; gap: 9px; box-shadow: var(--sh1); }
.dsic { font-size: 15px; } .dsnm { font-size: 11px; font-weight: 700; color: var(--tx); } .dsqs { font-size: 10px; color: var(--mu); }
.dsbw { height: 3px; background: var(--bg3); border-radius: 99px; margin-top: 5px; }
.dsb  { height: 3px; border-radius: 99px; }

/* ── EXAM SCREEN ── */
.exhd { background: var(--bg2); border-bottom: 1px solid var(--brd); padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.exprg { flex: 1; }
.expl { font-size: 11px; color: var(--mu); margin-bottom: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.pbw { height: 4px; background: var(--bg3); border-radius: 99px; }
.pb  { height: 4px; border-radius: 99px; background: var(--red); transition: width .4s ease; box-shadow: 0 0 8px rgba(232,0,29,.5); }
.etm { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 20px; font-weight: 500; min-width: 70px; text-align: right; color: var(--tx); letter-spacing: -0.5px; }
.etm.wn { color: var(--or); }
.etm.dn { color: var(--red); animation: pu .6s infinite; }
@keyframes pu { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.exc { flex: 1; overflow-y: auto; padding: 22px 28px; max-width: 780px; }
.exnv { background: var(--bg2); border-top: 1px solid var(--brd); padding: 10px 20px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qdts { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.qd { width: 22px; height: 22px; border-radius: var(--rx); background: var(--bg3); border: 1.5px solid var(--brd); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--mu); cursor: pointer; transition: all .12s; flex-shrink: 0; font-family: 'Inter', sans-serif; }
.qd:hover { border-color: var(--red); color: var(--red); }
.qd.an { background: var(--gr-lt); border-color: var(--gr-bd); color: var(--gr); }
.qd.cu { background: var(--red-lt); border-color: var(--red-bd); color: var(--red); }

/* ── RESULTS ── */
.rw  { max-width: 560px; margin: 0 auto; padding: 20px; }
.rh  { text-align: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--brd); }
.rsc { font-family: 'Inter', sans-serif; font-size: 72px; font-weight: 800; line-height: 1; color: var(--tx); }
.rla { font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 800; margin-top: 10px; color: var(--tx); }
.rsb { color: var(--mu); font-size: 13px; margin-top: 6px; }
.rvd { display: inline-block; padding: 6px 18px; border-radius: 99px; font-weight: 700; font-size: 11px; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.5px; font-family: 'Inter', sans-serif; }
.rgr { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 22px; }
.rs  { background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r); padding: 14px; text-align: center; box-shadow: var(--sh1); }
.rsv { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 800; color: var(--tx); }
.rsl { font-size: 10px; color: var(--mu); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.rtp { background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r); padding: 0; margin-bottom: 18px; overflow: hidden; box-shadow: var(--sh1); }
.rtp-hd { padding: 10px 18px; border-bottom: 1px solid var(--brd); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--mu); background: var(--bg3); }
.rtr { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--brd); }
.rtr:last-child { border-bottom: none; }
.rti { font-size: 15px; width: 24px; text-align: center; }
.rtn { flex: 1; font-size: 13px; font-weight: 500; color: var(--tx2); }
.rts { font-size: 12px; font-weight: 700; min-width: 44px; text-align: right; font-family: 'JetBrains Mono', monospace; color: var(--tx); }
.rtbw { width: 80px; height: 4px; background: var(--bg3); border-radius: 99px; }
.rtb  { height: 4px; border-radius: 99px; }

/* ── HAMBURGER / SIDEBAR OVERLAY ── */
.hbg-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--rs);
  font-size: 17px;
  color: rgba(255,255,255,.8);
  flex-shrink: 0;
  line-height: 1;
  transition: all .13s;
  align-items: center;
  justify-content: center;
}
.hbg-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sb-overlay.open { display: block; }

/* ── SIMULACRO HEADER BUTTON ── */
.hd-sim {
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--rs);
  display: none;
  white-space: nowrap;
  transition: all .15s;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(232,0,29,.4);
  flex-shrink: 0;
}
.hd-sim:hover { background: var(--rdk); box-shadow: 0 3px 12px rgba(232,0,29,.55); }
.hd-back {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--rx);
  background: rgba(255,255,255,.07);
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.hd-back:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }

/* ── FLAG BUTTON (exam) ── */
.flg {
  background: none;
  border: 1.5px solid var(--brd2);
  border-radius: var(--rs);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mu);
  transition: all .13s;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}
.flg:hover { background: var(--or-lt); border-color: var(--or-bd); color: var(--or); }
.flg.on    { background: var(--or-lt); border-color: var(--or-bd); color: var(--or); }
.qd.fl     { background: var(--or-lt); border-color: var(--or-bd); color: var(--or); }

/* ── GLOBAL STATS header pills ── */
#gC, #gT, #gP { font-weight: 700; }
#gC { color: var(--gr); }
#gP { color: var(--tx2); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body { font-size: 13px; }
  .hbg-btn { display: flex; align-items: center; justify-content: center; }
  .hd-sim  { display: block; }
  .spill   { display: none; }
  .hbg     { display: none; }
  .logo    { gap: 7px; }
  .logo-svg { width: 24px; height: 24px; }
  .sb {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 250px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--sh3);
    border-right: 1px solid var(--brd2);
  }
  .sb.open { transform: translateX(0); }
  .mn { width: 100%; }
  .mn-body { padding: 0 16px; }
  .mts-in { padding: 0 16px; overflow-x: auto; }
  .cnt { padding: 24px 0 40px; }
  .mt  { padding: 11px 14px; font-size: 10px; white-space: nowrap; }
  .thh { gap: 12px; margin-bottom: 20px; padding-bottom: 18px; }
  .thtl { font-size: 20px; }
  .thic { width: 40px; height: 40px; font-size: 20px; }
  .thc.fl { padding: 10px 14px; }
  .thgr .thc { padding: 20px 0 16px; }
  .thgr .thc:first-child { padding-top: 0; }
  .thsb { font-size: 11px; }
  .exhd { flex-wrap: wrap; gap: 8px; }
  .exprg { min-width: 0; }
  .exc  { padding: 14px 14px; }
  .exnv { padding: 8px 10px; }
  .qdts { gap: 3px; }
  .qd   { width: 20px; height: 20px; font-size: 8px; }
  .rw   { padding: 12px; }
  .rsc  { font-size: 52px; }
  .rgr  { grid-template-columns: repeat(3,1fr); gap: 6px; }
  .tdist { grid-template-columns: 1fr; }
  .sst  { padding: 16px 12px; max-width: 100%; }
  .pst  { gap: 6px; }
  .pct  { flex-direction: column; align-items: stretch; gap: 6px; }
  .dfs  { width: 100%; }
  .qc   { padding: 14px 14px; }
  .qt   { font-size: 14px; }
  .op   { font-size: 12px; padding: 9px 10px; }
  .nxt  { flex-wrap: wrap; }
  .ssrl { width: 100%; }
  .srrw { padding: 8px 14px; font-size: 12px; }
  .cb   { font-size: 12.5px; }
  .kr, .tb, .tg { font-size: 12px; }
  .hd   { height: 50px; }
}

@media (max-width: 480px) {
  .hd   { padding: 0 10px; gap: 8px; height: 48px; }
  .logo { gap: 6px; font-size: 11px; }
  .logo-svg { width: 22px; height: 22px; }
  .logo-brand { display: none; }
  .logo-sep   { display: none; }
  .hd-sim { font-size: 10px; padding: 5px 10px; }
  .cnt  { padding: 12px 10px; }
  .rgr  { grid-template-columns: 1fr 1fr; gap: 6px; }
  .btn  { padding: 8px 14px; font-size: 12px; }
  .qt   { font-size: 13px; }
  .exc  { padding: 12px 10px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brd2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--mu); }

/* ── PRINT STYLES ── */
@media print {
  .hd, .sb, .mts, .skip-link, .sb-overlay, .toc-nav,
  .pct, .pst, .nxt, footer, .srch-over { display: none !important; }
  body, html { height: auto; overflow: visible; background: #fff; color: #000; }
  .ly { display: block; }
  .mn, .mn-body { max-width: 100%; padding: 0; overflow: visible; }
  .cnt { padding: 0; }
  .th-layout { display: block; }
  .th-content { max-width: 100%; }
  .qc, .kr, .tb, .tg, .cb { break-inside: avoid; page-break-inside: avoid; }
  .thh { border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 16px; }
  .thh .thic { display: none; }
  .thh .thtl { font-size: 22pt; color: #000; }
  .sct { font-size: 14pt; color: #000; margin-top: 18pt; border-left: 3px solid #000; padding-left: 10pt; }
  h1, h2, h3, h4 { color: #000; }
  p, li { color: #000; font-size: 11pt; line-height: 1.55; }
  ul, ol { margin-left: 18pt; }
  code, .code { background: #eee; color: #000; padding: 1pt 3pt; font-size: 10pt; }
  .kr { border: 1px solid #000; padding: 8pt; margin: 6pt 0; background: none; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
  a[href^="#"]::after { content: ""; } /* dont show anchor links */
  @page { margin: 1.8cm; }
}

/* ── SR-ONLY (screen reader visible, visually hidden) ── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── REDUCED MOTION (respect user preference) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── FOCUS INDICATORS (a11y) ── */
:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--dg);
  outline-offset: 2px;
  border-radius: var(--rx);
}
/* Header elements need a lighter focus color on dark background */
.hd *:focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
}
/* Skip-to-content link for screen readers */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  background: var(--dg);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--rs) 0;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── FIX 320px OVERFLOW: hide text in buttons on very small screens ── */
@media (max-width: 479px) {
  .srch-btn .srch-lbl { display: none; }
  .hd-back .hd-back-lbl { display: none; }
  .srch-btn { padding: 4px 9px; }
}

/* ── PRACTICE SESSION BAR ── */
.ses-bar   { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--rs); padding: 8px 14px; margin-bottom: 10px; flex-wrap: wrap; }
.ses-stats { font-size: 12px; color: var(--tx2); }

/* ── SIDEBAR PROGRESS BAR ── */
.tpb  { height: 3px; background: var(--brd2); border-radius: 99px; margin-top: 5px; width: 100%; overflow: hidden; }
.tpbf { height: 3px; border-radius: 99px; transition: width .4s; }

/* ── THEORY — TOC LAYOUT ── */
.th-layout  { display: flex; gap: 40px; align-items: flex-start; }
.th-content { flex: 1; min-width: 0; }
.toc-nav    { width: 172px; flex-shrink: 0; position: sticky; top: 12px; }
.toc-lbl    { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--mu); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--brd); }
.toc-it     { display: block; padding: 5px 0 5px 12px; font-size: 12px; color: var(--tx2); border-left: 2px solid var(--brd); margin-bottom: 2px; transition: all .12s; line-height: 1.35; cursor: pointer; }
.toc-it:hover { color: var(--dg); border-left-color: var(--dg-bd); }
.toc-it.ac  { color: var(--dg); border-left-color: var(--dg); font-weight: 600; }
@media (max-width: 860px) { .toc-nav { display: none; } .th-layout { gap: 0; } }

/* ── FLASHCARD ── */
.fc-wrap    { padding: 8px 0 48px; }
.fc-nav     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.fc-pg      { font-size: 13px; font-weight: 600; color: var(--tx2); text-align: center; }
.fc-card    { background: var(--bg); border: 1.5px solid var(--brd); border-radius: var(--r); padding: 32px 36px; min-height: 180px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; box-shadow: var(--sh2); display: flex; flex-direction: column; user-select: none; }
.fc-card:hover { box-shadow: var(--sh3); transform: translateY(-2px); border-color: var(--brd2); }
.fc-front   { font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -.3px; flex: 1; }
.fc-hint    { font-size: 12px; color: var(--mu); margin-top: 18px; display: flex; align-items: center; gap: 6px; }
.fc-back    { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--brd); }
.fc-actions { display: flex; gap: 10px; margin-top: 16px; }
.fc-status  { display: flex; gap: 16px; font-size: 11px; color: var(--mu); margin-top: 12px; justify-content: center; align-items: center; }
.fc-kbhint  { text-align: center; font-size: 11px; color: var(--mu); margin-top: 10px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── SEARCH OVERLAY ── */
.srch-over { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding-top: 72px; backdrop-filter: blur(4px); }
.srch-box  { background: var(--bg); border-radius: var(--r); box-shadow: 0 24px 80px rgba(0,0,0,.4); width: 640px; max-width: calc(100vw - 32px); max-height: 70vh; display: flex; flex-direction: column; border: 1px solid var(--brd2); overflow: hidden; }
.srch-iw   { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--brd); gap: 12px; flex-shrink: 0; }
.srch-inp  { flex: 1; border: none; outline: none; font-family: 'Inter', sans-serif; font-size: 15px; color: var(--tx); background: transparent; }
.srch-inp::placeholder { color: var(--mu); }
.srch-res  { overflow-y: auto; flex: 1; }
.srch-grp  { padding: 8px 18px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--mu); }
.srch-row  { display: flex; align-items: flex-start; gap: 12px; padding: 10px 18px; cursor: pointer; transition: background .1s; border-left: 3px solid transparent; }
.srch-row:hover { background: var(--bg2); }
.srch-row.sl   { background: var(--bg2); border-left-color: var(--dg); }
.srch-ric  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.srch-rit  { flex: 1; min-width: 0; }
.srch-rtl  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx); }
.srch-rsu  { font-size: 11px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.srch-rtg  { font-size: 10px; color: var(--mu); border: 1px solid var(--brd2); border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; background: var(--bg2); }
.srch-emp  { padding: 40px 18px; text-align: center; color: var(--mu); font-size: 13px; }
.srch-ft   { padding: 10px 18px; border-top: 1px solid var(--brd); display: flex; gap: 14px; font-size: 11px; color: var(--mu); flex-shrink: 0; flex-wrap: wrap; align-items: center; }
.kbd       { display: inline-flex; align-items: center; font-size: 10px; background: var(--bg2); border: 1px solid var(--brd2); border-radius: 4px; padding: 1px 5px; color: var(--tx2); }
.srch-btn  { display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,.5); font-size: 11px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--rs); padding: 5px 10px; cursor: pointer; transition: all .13s; background: rgba(255,255,255,.07); margin-left: auto; white-space: nowrap; }

/* ── SHORTCUT HELP OVERLAY ── */
.help-gr  { margin-bottom: 14px; }
.help-gr:last-child { margin-bottom: 4px; }
.help-ttl { font-size: 10px; font-weight: 700; color: var(--mu); text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 6px; }
.help-rw  { display: flex; align-items: center; gap: 4px; padding: 4px 0; font-size: 12.5px; color: var(--tx2); }
.help-rw span { margin-left: 8px; color: var(--tx2); }
.help-btn { background: none; border: none; color: var(--mu); font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.help-btn:hover { color: var(--tx2); }
.srch-btn:hover { background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
@media (max-width: 640px) { .srch-btn .kbd { display: none; } .srch-btn { padding: 4px 8px; } }
