/* Tipografías incluidas en el sitio (SIL Open Font License, ver fonts/OFL-*.txt) */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-700.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/source-serif-4.woff2) format('woff2'); }

:root {
  --paper: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --ink: #1d232b;
  --ink-2: #4b5560;
  --muted: #6b7580;
  --line: #d9dde0;
  --asphalt: #2a3038;
  --yellow: #f2b600;
  --yellow-soft: #fff3c4;
  --blue: #1f4e9c;
  --blue-soft: #e4ecf8;
  --red: #c8211e;
  --red-soft: #fbe6e5;
  --green: #2e7d4f;
  --green-soft: #e2f2e8;
  --mark: #ffe58a;
  --shadow: 0 1px 2px rgba(20, 28, 38, .06), 0 4px 16px rgba(20, 28, 38, .06);
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-ui: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-law: "Source Serif 4", Georgia, "Times New Roman", serif;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121519; --surface: #1a1f25; --surface-2: #222830; --ink: #e7eaed; --ink-2: #c3c9cf;
    --muted: #97a1ab; --line: #2e353e; --asphalt: #0c0f12; --yellow: #f5c542; --yellow-soft: #3a3113;
    --blue: #86aef0; --blue-soft: #1c2a42; --red: #f07a73; --red-soft: #3b1f1f; --green: #6fcf97;
    --green-soft: #183325; --mark: #6b5a17; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121519; --surface: #1a1f25; --surface-2: #222830; --ink: #e7eaed; --ink-2: #c3c9cf;
  --muted: #97a1ab; --line: #2e353e; --asphalt: #0c0f12; --yellow: #f5c542; --yellow-soft: #3a3113;
  --blue: #86aef0; --blue-soft: #1c2a42; --red: #f07a73; --red-soft: #3b1f1f; --green: #6fcf97;
  --green-soft: #183325; --mark: #6b5a17; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }
.eyebrow { font: 600 .75rem/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--asphalt); color: #e9ecef; position: sticky; top: env(safe-area-inset-top, 0px);
  height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 0 6px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand b { font: 700 1.35rem/1 var(--f-display); display: block; letter-spacing: .02em; }
.brand small { font-size: .72rem; color: #aab3bc; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .mas {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: #cfd5db; text-decoration: none; font-weight: 500;
}
.nav a svg, .nav .mas svg { width: 20px; height: 20px; flex: none; }
.nav .mas { display: none; background: none; border: 0; font: inherit; cursor: pointer; }
.mas-panel[hidden] { display: none; }
@media (hover: hover) { .nav a:hover { background: rgba(255,255,255,.06); color: #fff; } }
.nav a.on, .nav .mas.on { background: var(--yellow); color: #1d232b; }
.side-foot { margin-top: auto; font-size: .75rem; color: #8e98a2; padding: 0 6px; line-height: 1.4; }
.side-foot button { background: none; border: 1px solid #47505a; color: #cfd5db; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: .75rem; margin-top: 8px; }

.main { min-width: 0; padding-inline: 32px; padding-block: 28px 64px; }
.wrap { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head p { margin: 0; color: var(--ink-2); max-width: 68ch; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 0;
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; }
  .nav a, .nav .mas { flex: 1; flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 4px; min-width: 0; }
  .nav a.extra { display: none; }
  .nav .mas { display: flex; }
  .mas-panel {
    position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); display: grid;
    grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px; border-radius: 14px;
    background: var(--asphalt); border: 1px solid #2e353e; box-shadow: 0 -8px 28px rgba(0,0,0,.35);
  }
  .mas-panel a {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px;
    border-radius: 10px; color: #cfd5db; text-decoration: none; font-size: .8rem; font-weight: 500;
  }
  .mas-panel a svg { width: 24px; height: 24px; }
  .mas-panel a.on { background: var(--yellow); color: #1d232b; }
  .main { padding-inline: 16px; padding-block: 18px calc(var(--nav-h) + 40px); }
  .mob-head { display: flex !important; }
}
.mob-head { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.mob-head a { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; font: 700 1.2rem var(--f-display); }

/* ---------- common components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0e1622; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e1622; } }
.btn.warn { background: var(--yellow); border-color: var(--yellow); color: #1d232b; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem; font-weight: 500;
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge { display: inline-block; font: 600 .7rem/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.badge.desc { background: var(--green-soft); color: var(--green); }
.badge.orient { background: var(--yellow-soft); color: #7a5b00; }
:root[data-theme="dark"] .badge.orient { color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.orient { color: var(--yellow); } }
.badge.ej { background: var(--blue-soft); color: var(--blue); }
.badge.trap { background: var(--red-soft); color: var(--red); }
.ref {
  display: inline-flex; align-items: center; gap: 4px; font: 600 .8rem/1 var(--f-ui); color: var(--blue);
  background: var(--blue-soft); border: 0; border-radius: 4px; padding: 4px 7px; cursor: pointer; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ref:hover { text-decoration: underline; }
.input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: 1rem var(--f-ui);
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.note { border-left: 4px solid var(--yellow); background: var(--yellow-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: .92rem; }
.note b { font-weight: 600; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .75rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
td.val { font: 700 1.05rem/1.25 var(--f-display); letter-spacing: .01em; white-space: normal; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-main { padding: 24px 20px; } .hero-main .lane { display: none; } }
.hero-main { background: var(--asphalt); color: #eef1f3; border-radius: 14px; padding: 28px 150px 28px 28px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.hero-main h1 { color: #fff; }
.hero-main p { margin: 0; color: #c9d0d6; max-width: 56ch; }
.hero-main .lane { position: absolute; right: -10px; top: 0; bottom: 0; width: 120px; opacity: .9; }
.hero-main .eyebrow { color: var(--yellow); }
.hero-main .btn { border-color: #4a535d; background: transparent; color: #fff; }
.hero-main .btn.warn { background: var(--yellow); color: #1d232b; border-color: var(--yellow); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font: 700 2.2rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }
.tile { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.tile:hover { border-color: var(--muted); }
.tile h3 { display: flex; align-items: center; gap: 10px; }
.tile p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.tile .tile-ico { width: 40px; height: 40px; flex: none; }

/* ---------- law reader ---------- */
.reader { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .reader { grid-template-columns: minmax(0, 1fr); } .toc { position: static !important; max-height: 50vh !important; } }
.toc { position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: .88rem; }
.toc details { margin: 2px 0; }
.toc summary { cursor: pointer; padding: 5px 6px; border-radius: 6px; font-weight: 600; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.toc details[open] > summary::before { transform: rotate(90deg); }
.toc summary:hover { background: var(--surface-2); }
.toc .lvl { padding-left: 12px; border-left: 1px solid var(--line); margin-left: 8px; }
.toc a { display: block; padding: 4px 6px; text-decoration: none; color: var(--ink-2); border-radius: 6px; }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.toc .arts { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 6px 8px 18px; }
.toc .arts a { padding: 2px 6px; font-size: .78rem; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.law { font-family: var(--f-law); font-size: 1.06rem; line-height: 1.65; max-width: 72ch; }
.law .h-libro, .law .h-titulo, .law .h-capitulo, .law .h-seccion, .law .h-disp { font-family: var(--f-display); text-align: left; margin: 36px 0 10px; scroll-margin-top: 16px; }
.law .h-libro { font-size: 1.9rem; border-top: 4px solid var(--ink); padding-top: 12px; }
.law .h-titulo { font-size: 1.45rem; }
.law .h-capitulo { font-size: 1.2rem; color: var(--ink-2); }
.law .h-seccion { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.law .h-libro small, .law .h-titulo small, .law .h-capitulo small, .law .h-seccion small { display: block; font: 600 .72rem var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.art { margin: 18px 0; padding: 4px 0 4px; scroll-margin-top: 16px; border-radius: 6px; }
.art-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.art-h a.art-n { font: 700 1.05rem var(--f-display); letter-spacing: .03em; color: var(--ink); text-decoration: none; }
.art-h .pg { font: .72rem var(--f-ui); color: var(--muted); }
.art p { margin: 4px 0; }
.art .it { display: grid; grid-template-columns: 2.4em 1fr; gap: 2px; margin: 3px 0; scroll-margin-top: 16px; border-radius: 4px; }
.art .it.l2 { margin-left: 2.4em; }
.art .it .lb { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.art .nota { font-size: .9rem; color: var(--muted); font-style: italic; }
.art .flag { font: 600 .7rem var(--f-ui); color: var(--blue); background: var(--blue-soft); padding: 2px 6px; border-radius: 4px; }
.hl { background: var(--yellow-soft); box-shadow: -8px 0 0 var(--yellow-soft), 8px 0 0 var(--yellow-soft); animation: pulse 1.6s ease-out 1; }
@keyframes pulse { from { background: var(--mark); } to { background: var(--yellow-soft); } }
@media (prefers-reduced-motion: reduce) { .hl { animation: none; } }
.law table { font-family: var(--f-ui); font-size: .9rem; margin: 8px 0; }
.findbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); padding: 8px 0; display: flex; gap: 8px; align-items: center; }
.findbar .input { padding: 9px 12px; }
.findbar .cnt { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- glossary ---------- */
.glos-list { display: grid; gap: 10px; }
.glos-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; scroll-margin-top: 16px; }
.glos-item h3 { font-size: 1.15rem; display: flex; gap: 8px; align-items: baseline; }
.glos-item h3 span { font: 600 .75rem var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.glos-item p { margin: 6px 0 0; font-family: var(--f-law); }
.flash { perspective: 1000px; min-height: 260px; }
.flash-inner { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; min-height: 260px; display: flex; flex-direction: column; justify-content: center; gap: 12px; box-shadow: var(--shadow); }
.flash-inner h2 { font-size: 2.2rem; }
.flash-inner p { font-family: var(--f-law); font-size: 1.08rem; margin: 0; }

/* ---------- signs ---------- */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sign-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; }
.sign-card:hover { border-color: var(--muted); }
.sign-card .pic { aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; padding: 12px; }
.sign-card .pic svg { width: 100%; height: 100%; }
.sign-card .nm { font-size: .88rem; font-weight: 500; line-height: 1.3; }
.sign-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.grp-head { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.grp-head p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.sign-big { width: min(260px, 70vw); margin: 0 auto; background: var(--surface-2); border-radius: 12px; padding: 18px; }
.sign-big svg { width: 100%; height: auto; display: block; }
.quiz-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 520px) { .quiz-opts { grid-template-columns: 1fr; } .quiz-opts.pics { grid-template-columns: repeat(2, 1fr); } }
.opt {
  text-align: left; padding: 14px 16px; border: 2px solid var(--line); background: var(--surface); border-radius: 10px;
  cursor: pointer; font-weight: 500; display: flex; gap: 12px; align-items: flex-start; line-height: 1.35;
}
.opt:hover:not([disabled]) { border-color: var(--blue); }
.opt .k { font: 700 .95rem var(--f-display); width: 1.6em; height: 1.6em; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); flex: none; }
.opt.ok { border-color: var(--green); background: var(--green-soft); }
.opt.bad { border-color: var(--red); background: var(--red-soft); }
.opt[disabled] { cursor: default; }
.opt.pic { justify-content: center; padding: 10px; }
.opt.pic svg { width: 100%; max-width: 130px; height: auto; }
.count-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.count-opts .opt { min-width: 64px; justify-content: center; font: 700 1.5rem var(--f-display); }

/* ---------- exam ---------- */
.exam-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; flex: 1; min-width: 120px; }
.progress > i { display: block; height: 100%; background: var(--yellow); transition: width .25s; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.q-stem { font-size: 1.12rem; line-height: 1.55; margin: 0; max-width: 72ch; }
.feedback { border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.feedback.ok { background: var(--green-soft); }
.feedback.bad { background: var(--red-soft); }
.feedback h3 { font-size: 1.2rem; }
.feedback p { margin: 0; }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acts li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: var(--surface); border-radius: 8px; padding: 10px 12px; }
.acts .mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .8rem; }
.acts .mk.inf { background: var(--red); }
.acts .mk.leg { background: var(--green); }
.acts small { color: var(--ink-2); display: block; margin-top: 2px; }
.cita { font-family: var(--f-law); font-size: .95rem; background: var(--surface); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: baseline; }
.cita q { quotes: "«" "»"; }
.setup-sec { display: flex; flex-direction: column; gap: 10px; }
.setup-sec h3 { font-size: 1.1rem; }
.opt-radio { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.opt-radio label { border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.opt-radio label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.opt-radio input { position: absolute; opacity: 0; pointer-events: none; }
.opt-radio b { font-weight: 600; }
.opt-radio span { font-size: .85rem; color: var(--ink-2); }
.score { font: 700 4rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 64px; gap: 10px; align-items: center; font-size: .9rem; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.bar-row .num { text-align: right; color: var(--ink-2); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr 56px; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- search ---------- */
.results { display: grid; gap: 10px; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.res .res-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.res p { margin: 0; font-family: var(--f-law); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(12, 15, 18, .55); }
.modal-box { background: var(--paper); border-radius: 14px; width: min(760px, 100%); max-height: min(86vh, 900px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.modal-head { position: sticky; top: 0; background: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); z-index: 1; }
.modal-body { padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.x { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1.2rem; line-height: 1; flex: none; }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- ilustraciones oficiales ---------- */
.ilus { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.ilu { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px; cursor: zoom-in; line-height: 0; }
.ilu img { max-height: 120px; width: auto; max-width: 100%; height: auto; }
.art > .ilus .ilu img { max-height: 180px; }
.ilus.big { justify-content: center; }
.ilus.big .ilu img { max-height: 220px; }
.ilu-big { background: #fff; border-radius: 10px; padding: 10px; text-align: center; }
.ilu-big img { max-width: 100%; max-height: 60vh; width: auto; height: auto; }
.sign-card .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.opt.pic img { max-width: 130px; max-height: 130px; }
.sign-big img { width: 100%; height: auto; display: block; }
.sign-card .pic { background: #fff; }

/* ---------- multas (Decreto 287) ---------- */
.fine { display: inline-flex; align-items: center; gap: 4px; font: 600 .72rem/1.2 var(--f-ui); border: 0; border-radius: 4px; padding: 3px 7px; cursor: pointer; vertical-align: middle; white-space: nowrap; }
.fine.g1 { background: var(--red-soft); color: var(--red); }
.fine.g2 { background: var(--yellow-soft); color: #7a5b00; }
.fine.g3 { background: var(--blue-soft); color: var(--blue); }
:root[data-theme="dark"] .fine.g2 { color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fine.g2 { color: var(--yellow); } }
.fine-card.g1 { border-top: 4px solid var(--red); }
.fine-card.g2 { border-top: 4px solid var(--yellow); }
.fine-card.g3 { border-top: 4px solid var(--blue); }
.ref.comp { background: var(--green-soft); color: var(--green); }

/* ---------- notas de edición ---------- */
.ed-note { font: .9rem/1.5 var(--f-ui); background: var(--surface-2); border-left: 4px solid var(--muted); border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 8px 0; }
.ed-note.errata { border-left-color: var(--yellow); }
.ed-note.modificacion { border-left-color: var(--red); }
.ed-note details summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
.ed-note details p { font-family: var(--f-law); margin: 6px 0 0; }

/* ---------- curso ---------- */
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.c-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.c-item:hover { border-color: var(--muted); }
.c-item small { display: block; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.c-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 1.1rem var(--f-display); background: var(--surface-2); }
.c-item.done .c-num { background: var(--green); color: #fff; }
.c-lesson { max-width: 820px; }
.c-obj { background: var(--blue-soft); border-radius: 12px; padding: 14px 18px; }
.c-obj ul, .c-rec ul { margin: 6px 0 0; padding-left: 1.2em; }
.c-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.c-toc a { font-size: .85rem; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.c-sec { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.c-sec h2 { font-size: 1.6rem; margin-top: 12px; }
.c-text { margin: 0; font-size: 1.04rem; line-height: 1.65; max-width: 70ch; }
.c-refs { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.c-cita { margin: 0; font-family: var(--f-law); font-size: 1.02rem; border-left: 4px solid var(--blue); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.c-cita q { quotes: "«" "»"; }
.c-ej { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.c-ej h4 { margin: 0; font: 700 1.15rem var(--f-display); }
.c-ej p { margin: 0; line-height: 1.6; }
.c-ej details summary { list-style: none; display: inline-flex; margin-top: 4px; }
.c-ej details summary::-webkit-details-marker { display: none; }
.c-ej details[open] summary { display: none; }
.c-an { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.c-trap { background: var(--red-soft); border-radius: 10px; padding: 12px 16px; line-height: 1.55; }
.c-trap b { color: var(--red); }
.c-rec { background: var(--yellow-soft); border-radius: 10px; padding: 14px 18px; }
.c-signs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.c-end { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

@media (max-width: 860px) { .hero .hero-main { padding: 24px 20px; } .hero .hero-main .lane { display: none; } }
.gl { border-bottom: 1px dotted var(--blue); cursor: help; color: inherit; background: none; padding: 0; font: inherit; }
.gl:hover { background: var(--blue-soft); }
.fc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; min-height: 240px; display: flex; flex-direction: column; justify-content: center; gap: 14px; box-shadow: var(--shadow); }
.fc-card h2 { font-size: 1.7rem; }
.fc-val { font: 700 2rem/1.15 var(--f-display); color: var(--blue); }

/* ---------- aviso legal y fuentes ---------- */
.pie { max-width: 1080px; margin: 40px auto 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); line-height: 1.5; }
.side-foot a { color: #e9ecef; }
.pie .version, .side-foot .version { display: block; margin-top: 8px; }
.pie .reportar { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.aviso-legal { border: 1px solid var(--line); border-left: 4px solid var(--red); background: var(--surface); border-radius: 0 10px 10px 0; padding: 14px 18px; font-size: .93rem; line-height: 1.6; }
.aviso-legal h2 { font-size: 1.3rem; margin-bottom: 6px; }
.aviso-legal p { margin: 0 0 8px; }
.fuente { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.fuente p { margin: 4px 0 0; font-size: .9rem; color: var(--ink-2); }
.sel { user-select: all; font-weight: 600; }
