/* Identidad: pergamino (marfil), verde bosque, oro envejecido y tinta antigua.
   Rojo carmesí = palabras de Jesús. Azul zafiro = Unicidad.
   El oro solo se usa en bordes y detalles (no cumple contraste para texto). */
:root {
  --ivory: #F4EFE3;
  --ivory2: #EAE3D2;
  --line: #DDD3BA;
  --ink: #302D29;
  --ink2: #5A554D;
  --forest: #263B32;
  --forest-ink: #F4EFE3;
  --gold: #B08A4A;
  --red: #9B1C1C;
  --uni: #1D4E89;
  --uni-tint: #DCE6F2;
  --uni-tint2: #ECF1F8;
  --card: #FBF8F0;
  --field: #FFFFFF;
  --warnbg: #EADFC4;
  --warnfg: #4A3C14;
  --muted: #6B665D;
  --okbg: #D6E6D8;
  --okfg: #1E4A2A;
  --nobg: #F0D6D6;
  --nofg: #7A1616;
  --sea: #BFD7E6;
  --land: #EFE8D4;
  --coast: #5C7C92;
  --river: #4F86A8;
  --des: #E6D6A4; --llan: #D3E0B6; --mes: #E2D7B8; --mt-l: #F6F0DE; --mt-d: #A58C64; --mt-b: #B79F77;
  --grat: #5A6E7B;
  --muralla: #8C7B5A;
  --tl: 66%;
  --r1: #B4600F;
  --r2: #1F7A4F;
  --r3: #7A3E9D;
  --r4: #0E6E8F;
  --hl1: #EBDDB8;
  --hl2: #CFE0D2;
  --hl3: #E2D8EC;
  --fs: 20px;
  --read: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ivory2); color: var(--ink); font-family: var(--ui); font-size: 16px; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--uni); outline-offset: 2px; }

.shell { max-width: 760px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; background: var(--ivory); box-shadow: 0 0 0 1px var(--line); }
main#view { flex: 1; overflow-y: auto; padding: 16px 20px 28px; outline: none; -webkit-overflow-scrolling: touch; }

/* Encabezado */
.top { background: var(--forest); color: var(--forest-ink); border-bottom: 2px solid var(--gold); display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px; min-height: 64px; }
.top .ttl { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-family: var(--read); font-weight: 600; font-size: 24px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.top .acts { display: flex; gap: 2px; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border: 0; background: none; color: inherit; border-radius: 8px; cursor: pointer; text-decoration: none; }
.ibtn.txt { font-weight: 700; font-size: 15px; }
.ibtn.dark { color: var(--ink2); }
.ibtn:hover { background: rgba(255, 255, 255, .12); }
.ibtn.dark:hover { background: var(--ivory2); }
.top :focus-visible { outline-color: var(--forest-ink); }

/* Aviso de datos de prueba */
.banner { background: var(--warnbg); color: var(--warnfg); padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }

/* Botones y tarjetas */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 2px solid var(--forest); background: var(--forest); color: var(--forest-ink); border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .45; cursor: default; }
.card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--card); border-radius: 4px; text-decoration: none; }
.card strong { font-family: var(--read); font-size: 20px; }
.card.cont { border-left-color: var(--forest); }
.card.quiet { color: var(--ink2); }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.sec { font-family: var(--read); font-size: 20px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--gold); color: var(--forest); }
.note { font-size: 13px; color: var(--ink2); margin: 6px 0; }
.warn { background: var(--warnbg); color: var(--warnfg); padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.empty { color: var(--ink2); line-height: 1.5; padding: 8px 0; }
.badge { display: inline-block; background: var(--warnbg); color: var(--warnfg); font-size: 12px; font-weight: 700; padding: 3px 8px; }
.field { margin: 0 0 18px; }
.field p { margin: 4px 0 0; font-family: var(--read); font-size: 17px; line-height: 1.5; }
.field select, .field input[type=range] { width: 100%; margin-top: 6px; min-height: 40px; }
select { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.chk input { margin-top: 3px; width: 20px; height: 20px; }

/* Lista de libros y capítulos */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.book { display: flex; align-items: center; min-height: 44px; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-family: var(--read); font-size: 16px; }
.book:hover { border-color: var(--forest); }
.book.off, .chap.off { color: var(--muted); background: transparent; border-style: dashed; }
.chaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.chap { display: flex; align-items: center; justify-content: center; min-height: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 600; }
.chap:hover { border-color: var(--forest); }
.keyv { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); text-decoration: none; font-family: var(--read); font-size: 17px; }

/* Lectura */
.chapter { font-family: var(--read); font-size: var(--fs); line-height: 1.65; }
.v { margin: 0 0 10px; padding: 2px 0; scroll-margin: 120px 0; }
.v .n { font: 700 .62em var(--ui); color: var(--ink2); background: none; border: 0; padding: 4px 6px 4px 0; min-width: 28px; min-height: 28px; vertical-align: .35em; cursor: pointer; position: relative; }
.v .bm { position: absolute; left: 0; top: 2px; width: 8px; height: 8px; background: var(--gold); border-radius: 1px; }
.v .t { box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.v.jesus .t, .r { color: var(--red); }
.v.uni { background: var(--uni-tint); border-left: 4px solid var(--uni); padding: 8px 10px 8px 12px; margin-left: -14px; margin-right: -6px; border-radius: 0 4px 4px 0; }
.chip { display: inline-block; margin-left: 8px; padding: 1px 7px; background: var(--uni-tint); color: var(--uni); border-left: 3px solid var(--uni); font: 700 11px var(--ui); letter-spacing: .04em; vertical-align: middle; }
.v.uni .chip { background: var(--field); }
.hl1 { background: var(--hl1); }
.hl2 { background: var(--hl2); }
.hl3 { background: var(--hl3); }
.v.target { animation: dest 2.4s ease-out 1; }
@keyframes dest { 0%, 40% { outline: 2px solid var(--gold); outline-offset: 3px; } 100% { outline: 2px solid transparent; outline-offset: 3px; } }
.v.speaking .t { box-shadow: 0 0 0 3px var(--ivory), 0 0 0 5px var(--forest); border-radius: 3px; }
.legend { display: flex; gap: 12px; align-items: center; margin: 0 0 12px; font-size: 12px; font-weight: 700; }
.lg-r { color: var(--red); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pager .btn { flex: 0 1 auto; }

/* Barra de audio */
.audio { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--card); border-top: 1px solid var(--line); }
.audio .rate { margin-left: auto; font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.audio .ibtn { color: var(--forest); border: 2px solid var(--forest); }

/* Pestañas inferiores */
.tabs { display: flex; border-top: 2px solid var(--gold); background: var(--ivory); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--ink2); }
.tabs a.on { color: var(--forest); box-shadow: inset 0 3px 0 var(--forest); }

/* Búsqueda */
.sform { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.sform input[type=search] { min-height: 46px; padding: 0 12px; border: 1px solid var(--forest); border-radius: 8px; background: var(--field); font-size: 17px; width: 100%; }
.opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 14px; }
.opts label { display: flex; align-items: center; gap: 6px; }
.count { margin: 8px 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { padding: 5px 10px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; font-size: 13px; text-decoration: none; }
.pill.on { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.res { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-family: var(--read); font-size: 17px; line-height: 1.5; }
.res strong { font-family: var(--ui); font-size: 13px; color: var(--forest); display: block; }
mark { background: var(--hl1); color: inherit; padding: 0 1px; border-radius: 2px; }

/* Marcas */
.tabsub { display: flex; gap: 6px; margin-bottom: 10px; }
.tabsub a { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 600; background: var(--card); }
.tabsub a.on { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.mrow { display: flex; align-items: center; gap: 4px; }
.mrow .res { flex: 1; }
.swd { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sw1 { background: var(--hl1); } .sw2 { background: var(--hl2); } .sw3 { background: var(--hl3); }

/* Hoja de opciones */
#sheet[hidden] { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(48, 45, 41, .45); z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 760px; margin: 0 auto; z-index: 11; background: var(--ivory); border-top: 3px solid var(--gold); border-radius: 14px 14px 0 0; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-family: var(--read); font-size: 22px; color: var(--forest); }
.sheet .prev { margin: 0; font-family: var(--read); color: var(--ink2); line-height: 1.45; }
.sheet .row { display: flex; flex-wrap: wrap; gap: 8px; }
.hlrow { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hlrow span { margin-right: 4px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink2); cursor: pointer; }
.sw.on { outline: 3px solid var(--forest); outline-offset: 2px; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--ivory); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { .v.target { animation: none; } #toast { transition: none; } }
@media print { .tabs, .audio, .top .acts { display: none; } }

/* ---- Fase 3: revisión editorial ---- */
.v.uni.prop { background: transparent; border-left: 4px dashed var(--uni); }
.btn.sel { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.rvbox { border: 1px dashed var(--uni); padding: 8px 10px; margin: 10px 0; }
.rvitem { display: block; margin-bottom: 10px; }
.rvitem .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-aprobado { background: var(--okbg); color: var(--okfg); }
.st-rechazado { background: var(--nobg); color: var(--nofg); }
.st-en_revision { background: var(--warnbg); color: var(--warnfg); }
.st-propuesto { background: var(--uni-tint); color: var(--uni); }

/* ---- Fases 5-6: doctrina ---- */
a.ref { color: var(--uni); text-decoration: underline; text-underline-offset: 2px; }
.def { margin: 8px 0 16px; padding: 12px 14px; border-left: 4px solid var(--uni); background: var(--uni-tint); font-family: var(--read); font-size: 1.05em; }
.aclara { font-weight: 600; color: var(--forest); }
.cita { margin: 10px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,.1); }
.vtxt { font-family: var(--read); margin: 4px 0; }
.af { font-family: var(--read); }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 18px 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cmp { border-collapse: collapse; font-size: 13px; min-width: 760px; }
table.cmp th, table.cmp td { border: 1px solid rgba(0,0,0,.18); padding: 6px 8px; text-align: left; vertical-align: top; }
table.cmp thead th { background: var(--forest); color: var(--forest-ink); }
table.cmp tbody th { background: rgba(0,0,0,.05); }
.resp { border-left: 3px solid var(--gold); padding: 4px 0 4px 10px; margin: 12px 0; }

/* ---- Tema oscuro: automático (según el dispositivo) o elegido en Ajustes ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ivory: #17201C;
  --ivory2: #101613;
  --line: #33413A;
  --ink: #ECE6D8;
  --ink2: #B9B2A3;
  --forest: #8DBCA2;
  --forest-ink: #10231A;
  --gold: #C9A55F;
  --red: #FF9A90;
  --uni: #9CC1F2;
  --uni-tint: #1C2C44;
  --uni-tint2: #172435;
  --card: #1F2B25;
  --field: #0F1512;
  --warnbg: #3A3220;
  --warnfg: #F0E2B8;
  --muted: #9AA39C;
  --okbg: #1F3A27;
  --okfg: #BFE5C8;
  --nobg: #442424;
  --nofg: #F5C2C2;
  --hl1: #4A4126;
  --sea: #1B2D3A;
  --land: #26302A;
  --coast: #7FA3BA;
  --river: #6FA6C8;
  --des: #4A4630; --llan: #2F4A33; --mes: #3C3F2D; --mt-l: #6E7A66; --mt-d: #2C3A31; --mt-b: #394A3B;
  --grat: #B4C8D4;
  --muralla: #B5A27C;
  --tl: 34%;
  --r1: #F0A15A;
  --r2: #6CC79B;
  --r3: #C99BE6;
  --r4: #6CC4E0;

  --hl2: #27402F;
  --hl3: #3A2F4A;
  }
}
:root[data-theme="dark"] {
  --ivory: #17201C;
  --ivory2: #101613;
  --line: #33413A;
  --ink: #ECE6D8;
  --ink2: #B9B2A3;
  --forest: #8DBCA2;
  --forest-ink: #10231A;
  --gold: #C9A55F;
  --red: #FF9A90;
  --uni: #9CC1F2;
  --uni-tint: #1C2C44;
  --uni-tint2: #172435;
  --card: #1F2B25;
  --field: #0F1512;
  --warnbg: #3A3220;
  --warnfg: #F0E2B8;
  --muted: #9AA39C;
  --okbg: #1F3A27;
  --okfg: #BFE5C8;
  --nobg: #442424;
  --nofg: #F5C2C2;
  --hl1: #4A4126;
  --sea: #1B2D3A;
  --land: #26302A;
  --coast: #7FA3BA;
  --river: #6FA6C8;
  --des: #4A4630; --llan: #2F4A33; --mes: #3C3F2D; --mt-l: #6E7A66; --mt-d: #2C3A31; --mt-b: #394A3B;
  --grat: #B4C8D4;
  --tl: 34%;
  --r1: #F0A15A;
  --r2: #6CC79B;
  --r3: #C99BE6;
  --r4: #6CC4E0;

  --hl2: #27402F;
  --hl3: #3A2F4A;
}

/* ---- Tableta (Android/iPad): columna de lectura más amplia ---- */
@media (min-width: 820px) {
  .shell { max-width: 900px; }
  main#view { padding: 24px 40px 36px; }
  .chapter { max-width: 68ch; margin-inline: auto; }
  .tabs a { min-height: 64px; font-size: 13px; }
}

/* ---- Unicidad: explícito (banda fuerte) y fundamento apostólico (banda suave) ---- */
.v.uni.fund { background: var(--uni-tint2); border-left-width: 3px; }
.v.uni.prop.fund { background: transparent; }
.unibox { border-left: 3px solid var(--uni); background: var(--uni-tint2); padding: 8px 10px; margin: 10px 0; }
.unibox p { margin: 4px 0; }
.pill.on { background: var(--uni); color: var(--forest-ink); border-color: var(--uni); }
.vtxt sup { color: var(--uni); font-weight: 700; }

/* ---- Mapas esquemáticos ---- */
.mapbox { position: relative; border: 1px solid var(--line); background: var(--sea); border-radius: 6px; overflow: hidden; touch-action: none; margin-bottom: 12px; }
#mapsvg { display: block; width: 100%; height: min(62vh, 110vw); user-select: none; -webkit-user-select: none; cursor: grab; }
#mapsvg .tierra { fill: var(--land); }
#mapsvg.cp .tierra { fill: var(--sea); }
#mapsvg .pais { fill: var(--land); stroke: var(--coast); stroke-linejoin: round; }
#mapsvg .lab-pais { fill: var(--muted); font-family: var(--ui); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; paint-order: stroke; stroke: var(--land); stroke-width: 2px; pointer-events: none; opacity: .75; }
#mapsvg .mar { fill: var(--sea); stroke: var(--coast); }
#mapsvg .isla { fill: var(--land); stroke: var(--coast); }
#mapsvg .rio { stroke: var(--river); }
#mapsvg .tribu { fill: hsl(var(--h) 38% var(--tl) / .62); stroke: var(--coast); cursor: pointer; }
#mapsvg .tribu.sel { fill: hsl(var(--h) 55% var(--tl) / .9); }
#mapsvg .ruta { stroke-opacity: .95; pointer-events: none; }
#mapsvg .r1 { stroke: var(--r1); fill: var(--r1); } #mapsvg .r2 { stroke: var(--r2); fill: var(--r2); }
#mapsvg .r3 { stroke: var(--r3); fill: var(--r3); } #mapsvg .r4 { stroke: var(--r4); fill: var(--r4); }
#mapsvg .ruta { fill: none; }
#mapsvg .flecha { stroke: none; pointer-events: none; }
#mapsvg .lug { cursor: pointer; }
#mapsvg .pto { fill: var(--forest); stroke: var(--land); stroke-width: 1.5; }
#mapsvg .lug.sel .pto { fill: var(--red); r: 7; }
#mapsvg .lab { fill: var(--ink); font-family: var(--ui); font-weight: 600; paint-order: stroke; stroke: var(--land); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
#mapsvg .tl { font-weight: 700; opacity: .9; cursor: pointer; pointer-events: all; }
.mapctl { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.mapctl .btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.mapinfo { border-left: 4px solid var(--forest); background: var(--card); padding: 10px 14px; margin-bottom: 8px; }
.mapinfo h2 { margin: 0 0 4px; font-family: var(--read); }
.pill.r1.on { background: var(--r1); } .pill.r2.on { background: var(--r2); } .pill.r3.on { background: var(--r3); } .pill.r4.on { background: var(--r4); }
.pill.r1, .pill.r2, .pill.r3, .pill.r4 { border-width: 2px; }
.pill.r1 { border-color: var(--r1); } .pill.r2 { border-color: var(--r2); } .pill.r3 { border-color: var(--r3); } .pill.r4 { border-color: var(--r4); }
.chip.r1 { border-left-color: var(--r1); } .chip.r2 { border-left-color: var(--r2); } .chip.r3 { border-left-color: var(--r3); } .chip.r4 { border-left-color: var(--r4); }

#mapsvg #grat line { stroke: var(--grat); stroke-opacity: .55; stroke-dasharray: 4 4; }
#mapsvg #grat text { fill: var(--grat); font-family: var(--ui); font-weight: 600; paint-order: stroke; stroke: var(--land); stroke-width: 2.5px; stroke-linejoin: round; }
#mapsvg .muralla { fill: none; stroke: var(--muralla); stroke-width: 3px; stroke-dasharray: 8 3; vector-effect: non-scaling-stroke; }
#mapsvg .explanada { fill: var(--muralla); fill-opacity: .22; stroke: var(--muralla); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.brujula { position: absolute; right: 8px; top: 8px; width: 54px; height: auto; pointer-events: none; }
.brujula .bc { fill: var(--card); stroke: var(--coast); stroke-width: 1.5; fill-opacity: .9; }
.brujula .bn { fill: var(--red); } .brujula .bs { fill: var(--ink2); }
.brujula text { fill: var(--ink); font: 700 9px var(--ui); paint-order: stroke; stroke: var(--card); stroke-width: 2px; }
.escala { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; font: 700 11px var(--ui); color: var(--ink); background: var(--card); padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; opacity: .93; pointer-events: none; }
.escala .barra { height: 6px; border: 2px solid var(--ink); border-top: none; }

/* ---- Relieve ---- */
#mapsvg .z-desierto { fill: var(--des); } #mapsvg .z-llanura { fill: var(--llan); } #mapsvg .z-meseta { fill: var(--mes); }
#mapsvg .cord-base { fill: none; stroke: var(--mt-b); stroke-opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
#mapsvg .mt-l { fill: var(--mt-l); stroke: var(--mt-d); stroke-width: .2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#mapsvg .mt-d { fill: var(--mt-d); stroke: var(--mt-d); stroke-width: .2px; vector-effect: non-scaling-stroke; }
#mapsvg.norel #relieve, #mapsvg.norel #rellab { display: none; }
#mapsvg .lab-rel { fill: var(--ink2); font-family: var(--read); font-style: italic; font-weight: 600; paint-order: stroke; stroke: var(--land); stroke-linejoin: round; pointer-events: none; opacity: .9; }
#mapsvg .lab-rel.t-d, #mapsvg .lab-rel.t-m { letter-spacing: .04em; }
.relbtn { position: absolute; left: 8px; bottom: 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); min-height: 36px; }
.relbtn[aria-pressed="true"] { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.mapbox:has(.escala) .relbtn { bottom: 52px; }
.leyrel { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin: 0 0 10px; }
.leyrel i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; border: 1px solid var(--mt-d); vertical-align: -1px; }
.leyrel .sw-d { background: var(--des); } .leyrel .sw-l { background: var(--llan); } .leyrel .sw-m { background: linear-gradient(135deg, var(--mt-l) 50%, var(--mt-d) 50%); }

/* ---- Relieve real (imagen) ---- */
#mapsvg.ci #relieve, #mapsvg.ci #relimg ~ #relieve { display: none; }
#mapsvg.ci:not(.norel) .hand { display: none; }
#mapsvg.ci:not(.norel) .pais { fill: none; }
#mapsvg.ci.norel #relimg, #mapsvg.ci.norel .paisb { display: none; }
#mapsvg #relimg { image-rendering: auto; }
#mapsvg .paisb { stroke: var(--coast); stroke-opacity: .8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #mapsvg #relimg { filter: brightness(.58) saturate(.8); } }
:root[data-theme="dark"] #mapsvg #relimg { filter: brightness(.58) saturate(.8); }

table.cmp.pano { min-width: 640px; }
table.cmp.pano th a { color: var(--uni); }
