:root {
  --bg: #f6f5f1; --paper: #ffffff; --ink: #1f2a2a; --muted: #5b6b6b; --line: #d9dedb;
  --brand: #336666; --brand-ink: #ffffff; --accent: #d9661f;
  --card-1: #fff8d2; --card-2: #dcf7d9; --card-3: #d8f6f6;
  --diagram-box: #ffffff; --diagram-ink: #12127a; --diagram-flow: #1f2a2a; --diagram-soft: #ccffcc; --diagram-trace: #e01818;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a1a; --paper: #1c2424; --ink: #e6ecea; --muted: #9fb0ad; --line: #2f3b3a;
    --brand: #2b5555; --brand-ink: #f2f6f5; --accent: #f08a45;
    --card-1: #3a3418; --card-2: #1f3a22; --card-3: #173a3a;
    --diagram-box: #243030; --diagram-ink: #c9d4ff; --diagram-flow: #e6ecea; --diagram-soft: #2e5a33; --diagram-trace: #ff5c5c;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 "Tahoma", "Verdana", system-ui, sans-serif; }
.site { background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; font-size: .9rem; }
.site a { color: inherit; }
.crumbs { max-width: 46rem; margin: 0 auto; }
header.chapter { max-width: 46rem; margin: 2rem auto .5rem; padding: 0 1rem; }
.kicker { color: var(--muted); font-weight: bold; margin: 0; }
h1 { margin: .2rem 0 0; font-size: 2rem; line-height: 1.2; color: var(--brand); }
nav.lessons { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); }
nav.lessons ul { max-width: 46rem; margin: 0 auto; padding: .5rem 1rem; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
nav.lessons a { display: block; padding: .25rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--brand); text-decoration: none; font-weight: bold; font-size: .9rem; background: var(--paper); }
nav.lessons a:hover { border-color: var(--accent); }
main { max-width: 46rem; margin: 0 auto; padding: 0 1rem 4rem; }
section { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem; margin: 1.5rem 0; scroll-margin-top: 4rem; }
h2 { color: var(--brand); font-size: 1.35rem; margin: 0 0 .6rem; }
h2 small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
p { margin: .6rem 0; }
p.note { font-style: italic; }
p.lead { font-size: 1.05rem; }
strong { font-weight: bold; }
.cards p { padding: .6rem .8rem; border-radius: 8px; font-style: italic; }
.cards p:nth-child(1) { background: var(--card-1); }
.cards p:nth-child(2) { background: var(--card-2); }
.cards p:nth-child(3) { background: var(--card-3); }
ol { padding-left: 1.4rem; }
li { margin: .35rem 0; }
blockquote { margin: 1rem 0; padding: .4rem 1rem; border-left: 4px solid var(--accent); font-weight: bold; }
details { border: 1px solid var(--line); border-radius: 10px; padding: .5rem 1rem; margin: 1rem 0; }
summary { cursor: pointer; font-weight: bold; color: var(--brand); }
.exercises { border-top: 3px solid var(--brand); margin-top: 1.4rem; padding-top: .4rem; }
figure { margin: 1.2rem 0; }
figure svg { width: 100%; height: auto; display: block; }
figure.diagram svg { max-width: 30rem; margin: 0 auto; }
figure.scheme svg { max-width: 36rem; margin: 0 auto; }
figure.cartoon svg { max-width: 18rem; margin: 0 auto; }
figcaption { color: var(--muted); font-size: .9rem; text-align: center; margin-top: .3rem; }
svg text { font-family: "Tahoma", "Verdana", sans-serif; font-weight: bold; font-size: 15px; fill: var(--ink); }
svg .small { font-size: 12px; font-weight: normal; fill: var(--diagram-ink); }
svg .box { fill: var(--diagram-box); stroke: var(--diagram-flow); stroke-width: 2.5; }
svg .boxlabel { fill: var(--diagram-ink); font-size: 16px; }
svg .boxbig { fill: var(--diagram-flow); font-size: 24px; }
svg .flowlabel { fill: var(--diagram-ink); font-size: 14px; }
svg .flow { fill: none; stroke: var(--diagram-flow); stroke-width: 4; }
svg .head { fill: var(--diagram-flow); }
svg .node { fill: var(--diagram-box); stroke: var(--muted); stroke-width: 3; }
svg .fill-soft { fill: var(--diagram-soft); stroke: var(--diagram-flow); stroke-width: 1.5; }
svg .rule { stroke: var(--muted); stroke-width: 2; }
svg .trace { fill: none; stroke: var(--diagram-trace); stroke-width: 5; stroke-linejoin: round; }
footer { max-width: 46rem; margin: 0 auto; padding: 0 1rem 3rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 34rem) { section { padding: 1rem; } h1 { font-size: 1.6rem; } }

/* added for the full conversion */
:root[data-theme="dark"] { color-scheme: dark; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 0; }
.pager a { color: var(--brand); font-weight: bold; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
figure.drawing svg, figure.drawing img { max-width: 22rem; height: auto; margin: 0 auto; display: block; }
figure.photo img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }
.toc ol { padding-left: 1.4rem; }
.toc li { margin: .5rem 0; font-size: 1.05rem; }
.toc a { color: var(--brand); font-weight: bold; }
dl.glossary dt { font-weight: bold; color: var(--brand); margin-top: 1rem; }
dl.glossary dd { margin: .2rem 0 0 0; }
.letters { display: flex; flex-wrap: wrap; gap: .3rem; }
.letters a { padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--brand); background: var(--paper); }
table.plain { border-collapse: collapse; width: 100%; margin: 1rem 0; }
table.plain th, table.plain td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; vertical-align: top; }

/* vocabulario, autor, creditos */
.ch-vocabulario .letters { position: sticky; top: 0; z-index: 1; background: var(--paper); padding: .5rem 0; margin-bottom: .5rem; }
.ch-vocabulario dl.glossary dt { scroll-margin-top: 3.5rem; letter-spacing: .02em; }
.ch-vocabulario .letter-mark { display: block; position: relative; top: -3.5rem; visibility: hidden; }
.ch-vocabulario dl.glossary dd p { margin: .3rem 0; }
.ch-autor figure.portrait img { max-width: 14rem; border-radius: 8px; }
.ch-autor figure.portrait { float: right; margin: 0 0 1rem 1.5rem; }
@media (max-width: 34rem) { .ch-autor figure.portrait { float: none; margin: 0 0 1rem; } }
.ch-creditos table.credits th { width: 50%; font-weight: normal; color: var(--muted); }

/* autoconocimiento */
.ch-autoconocimiento svg .ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.ch-autoconocimiento svg .leader { fill: none; stroke: var(--diagram-ink); stroke-width: 1.5; }
.ch-autoconocimiento ul.steps { padding-left: 1.2rem; }
.ch-autoconocimiento ul.steps li { margin: .6rem 0; }
.ch-autoconocimiento table.plain th[scope="row"] { width: 9.5rem; color: var(--brand); }
.ch-autoconocimiento table.plain caption { caption-side: top; text-align: left; color: var(--muted); font-size: .9rem; padding-bottom: .4rem; }
.ch-autoconocimiento table.plain td em { font-style: italic; }
.ch-autoconocimiento table.compare { font-size: .85rem; table-layout: fixed; }
.ch-autoconocimiento table.compare th[scope="row"] { width: auto; }
.ch-autoconocimiento table.compare td { height: 2.2rem; }
.ch-autoconocimiento table.compare tr.synthesis td { height: 4rem; color: var(--muted); font-style: italic; }
.ch-autoconocimiento table.ficha th[scope="row"] { width: 60%; font-weight: normal; color: var(--ink); }
.ch-autoconocimiento .fichas { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.ch-autoconocimiento details table.compare { margin-top: .6rem; }
@media (max-width: 40rem) { .ch-autoconocimiento .fichas { grid-template-columns: 1fr; } .ch-autoconocimiento table.compare { font-size: .72rem; } }

/* sicofisica */
.ch-sicofisica .gallery { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 1rem 1.5rem; margin: 1rem 0; }
.ch-sicofisica .gallery figure.drawing:only-child { flex-basis: 22rem; }
.ch-sicofisica .gallery figure.drawing { margin: 0; flex: 0 1 10rem; }
.ch-sicofisica figure.drawing img { width: 100%; max-height: 14rem; object-fit: contain; background: #fff; border-radius: 8px; padding: .4rem; }
.ch-sicofisica .gallery figcaption { font-weight: bold; color: var(--brand); }
.ch-sicofisica p.important { border-left: 4px solid var(--accent); padding-left: .8rem; font-weight: bold; }
.ch-sicofisica table.centres caption { font-weight: bold; color: var(--brand); margin-bottom: .3rem; }
.ch-sicofisica table.centres td, .ch-sicofisica table.centres th { font-size: .9rem; }
.ch-sicofisica table.review td { height: 2.4rem; }
.ch-sicofisica table.chain th { width: 9rem; color: var(--brand); }
.ch-sicofisica .steps { display: flex; flex-wrap: wrap; gap: .5rem 2rem; background: var(--card-3); border-radius: 8px; padding: .4rem 1rem; font-weight: bold; }
.ch-sicofisica ul.qualities { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.ch-sicofisica ul.qualities li { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem; font-weight: bold; color: var(--brand); background: var(--paper); }
.ch-sicofisica figure.diagram svg text { font-size: 14px; }

/* prologo, epilogo */
.ch-prologo .source, .ch-epilogo .source { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }
.ch-prologo h3 { color: var(--brand); }
.ch-prologo .signature { text-align: right; font-weight: bold; color: var(--muted); margin-top: 1.4rem; }
.ch-epilogo h3[id] { scroll-margin-top: 4rem; color: var(--brand); border-top: 1px solid var(--line); padding-top: 1.2rem; }
.ch-epilogo h4 { margin: 1.4rem 0 .4rem; font-size: 1rem; }
.ch-epilogo table.notebook th[scope="row"] { font-weight: normal; width: 55%; }
.ch-epilogo table.notebook thead th { background: var(--bg); }
.ch-epilogo table.notebook td { min-width: 4rem; }
.ch-epilogo table.blank th { height: 1.8rem; width: auto; }
.ch-epilogo ul.steps { list-style: none; padding-left: 0; }
.ch-epilogo ul.steps > li { margin: .8rem 0; }
.ch-epilogo svg .bar { fill: var(--brand); stroke: none; }
.ch-epilogo svg .barlabel { fill: var(--brand-ink); font-size: 15px; }
.ch-epilogo svg .person { fill: var(--diagram-box); stroke: var(--diagram-flow); stroke-width: 2.5; }
.ch-epilogo svg .push { stroke: var(--accent); }
.ch-epilogo svg .leader { fill: none; stroke: var(--diagram-ink); stroke-width: 1.5; }
@media (max-width: 34rem) { .ch-epilogo table.notebook { font-size: .85rem; } }

/* transferencia */
.ch-transferencia h4 { font-size: 1rem; margin: 1.3rem 0 .3rem; color: var(--brand); }
.ch-transferencia h5 { font-size: .95rem; margin: 1rem 0 .2rem; }
.ch-transferencia p.keypoint { padding: .5rem .9rem; border-left: 4px solid var(--accent); background: var(--card-1); border-radius: 0 8px 8px 0; }
.ch-transferencia p.source { color: var(--muted); font-size: .85rem; }
.ch-transferencia p.signs { text-align: center; font-size: 1.6rem; font-weight: bold; color: var(--brand); letter-spacing: .1em; }
.ch-transferencia .callout { padding: .4rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card-3); }
.ch-transferencia ol.steps li, .ch-transferencia ul.defs li { margin: .5rem 0; }
.ch-transferencia ul.columns { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
.ch-transferencia ul.columns li { break-inside: avoid; margin: .2rem 0; }
.ch-transferencia table.plain { font-size: .95rem; }
.ch-transferencia table.plain thead th { background: var(--card-3); }
.ch-transferencia table.twocol th[scope="row"], .ch-transferencia table.twocol td { width: 50%; }
.ch-transferencia table.scale th[scope="row"] { width: 50%; color: var(--brand); }
.ch-transferencia table.levels th[scope="row"] { width: 9rem; color: var(--brand); }
.ch-transferencia table.threecol td { width: 33%; text-align: center; font-style: italic; }
.ch-transferencia table.threecol th { text-align: center; }
.ch-transferencia .side-by-side { display: grid; grid-template-columns: 15rem 1fr; gap: 1.2rem; align-items: start; }
.ch-transferencia figure.flow { margin: .5rem 0; }
.ch-transferencia figure.flow svg { max-width: 15rem; margin: 0 auto; }
.ch-transferencia figure.symbols svg { max-width: 30rem; max-height: 22rem; }
.ch-transferencia svg .thin { stroke: var(--diagram-flow); stroke-width: 2; fill: none; }
.ch-transferencia svg .orange { fill: var(--accent); }
.ch-transferencia svg .atom { fill: #9cc8f0; stroke: #3d6f9e; stroke-width: 1.5; }
.ch-transferencia svg .atom.hot { fill: #e04040; stroke: #8a1d1d; }
.ch-transferencia svg .cube { fill: var(--diagram-soft); stroke: var(--diagram-flow); stroke-width: 2; stroke-linejoin: round; }
.ch-transferencia svg .ring { fill: none; stroke: var(--accent); stroke-width: 2.5; opacity: .7; }
.ch-transferencia svg .field { fill: none; stroke: #1f9a2e; stroke-width: 4; }
.ch-transferencia svg .lake { fill: #39c3f0; stroke: #1f2a2a; stroke-width: 1.5; }
.ch-transferencia svg .dot { fill: var(--diagram-flow); }
.ch-transferencia svg .leader { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.ch-transferencia svg .thin-flow { stroke-width: 3; }
.ch-transferencia svg .box.soft { fill: var(--card-1); }
.ch-transferencia svg .sym { fill: none; stroke: var(--diagram-flow); stroke-width: 3; stroke-linecap: round; }
.ch-transferencia svg .symfill { fill: var(--diagram-box); stroke: var(--diagram-flow); stroke-width: 3; stroke-linejoin: round; }
.ch-transferencia svg .symfill.grey { fill: var(--line); stroke-width: 2; }
.ch-transferencia svg .dots { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2 3; }
.ch-transferencia figure.symbols svg { max-width: 24rem; max-height: none; }
.ch-transferencia li audio { width: 100%; max-width: 28rem; margin: .3rem 0 .4rem; }
@media (max-width: 40rem) { .ch-transferencia .side-by-side { grid-template-columns: 1fr; } .ch-transferencia ul.columns { columns: 1; } }

/* autotransferencia */
.ch-autotransferencia h4 { font-size: 1rem; margin: 1.3rem 0 .3rem; color: var(--brand); }
.ch-autotransferencia p.key { padding: .6rem .8rem; border-radius: 8px; background: var(--card-1); font-weight: bold; }
.ch-autotransferencia blockquote.passage { font-weight: normal; font-style: italic; }
.ch-autotransferencia blockquote.passage p { margin: .5rem 0; }
.ch-autotransferencia p.source { color: var(--muted); font-size: .9rem; text-align: right; margin-top: -.4rem; }
.ch-autotransferencia ul.steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ch-autotransferencia ul.steps li { margin: 0; padding: .2rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card-3); }
.ch-autotransferencia #revision ol { columns: 2; column-gap: 2rem; }
.ch-autotransferencia #revision ol li { break-inside: avoid; }
@media (max-width: 40rem) { .ch-autotransferencia #revision ol { columns: 1; } }

/* distension */
.ch-distension figure.guided { background: var(--card-3); border-radius: 10px; padding: .7rem 1rem; margin: 1.2rem 0; }
.ch-distension figure.guided figcaption { text-align: left; color: var(--ink); font-weight: bold; font-size: 1rem; margin: 0 0 .4rem; }
.ch-distension figure.guided audio { width: 100%; display: block; }
.ch-distension ol.route { display: flex; flex-wrap: wrap; gap: .3rem .2rem; list-style: none; padding: 0; margin: .6rem 0; }
.ch-distension ol.route li { margin: 0; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .92rem; }
.ch-distension ol.route li + li::before { content: "→ "; color: var(--muted); }
.ch-distension ul.questions { list-style: none; padding-left: 1rem; font-style: italic; }
.ch-distension ol.sequence li { font-weight: bold; }
.ch-distension figure.drawing svg { max-width: 18rem; }
.ch-distension figure.outlines svg { max-width: 12rem; }
