/* Independencia — estilo manual de supervivencia de los años 50 */
@font-face { font-family: 'Alfa Slab One'; src: url(fonts/alfa-slab-one.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Libre Baskerville'; src: url(fonts/libre-baskerville.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Libre Baskerville'; src: url(fonts/libre-baskerville-italic.woff2) format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  --paper: #f3e8cf; --paper2: #ead9b4; --card: #f8f0dc; --ink: #2b2018; --ink2: #5a4a3a; --line: rgba(74, 52, 30, .28);
  --burgundy: #7a1f24; --burgundy-d: #5c1519; --navy: #1f2f52; --olive: #4f6130; --gold: #c8a24a; --gold-d: #9d7a2c;
  --red: #b3141b; --warn-bg: #f6e2a6; --err-bg: #f3d9d2;
  --on-dark: #f6ecd4;
  --display: 'Alfa Slab One', 'Rockwell', 'Roboto Slab', 'Georgia', serif;
  --serif: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs: 16px; --r: 10px; --tabh: 64px; --hdrh: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #1c1712; --paper2: #2a221a; --card: #251e17; --ink: #efe3c8; --ink2: #c3b394; --line: rgba(232, 210, 170, .2);
  --burgundy: #a8383e; --burgundy-d: #7a1f24; --navy: #3a5288; --olive: #6f8546; --gold: #d4b25e; --gold-d: #d4b25e;
  --red: #d42a30; --warn-bg: #3b3018; --err-bg: #3a1d1b;
  color-scheme: dark;
}
:root[data-fs="large"] { --fs: 18.5px; }
:root[data-fs="xlarge"] { --fs: 21px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--serif); line-height: 1.55; background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255, 250, 235, .55), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 80, 30, .14), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  min-height: 100vh; padding-top: calc(var(--hdrh) + var(--safe-t)); padding-bottom: calc(var(--tabh) + var(--safe-b));
}
:root[data-theme="dark"] body { background-image: radial-gradient(ellipse at 20% 0%, rgba(120, 80, 40, .18), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .9 0 0 0 0 .8 0 0 0 0 .6 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
body.noscroll { overflow: hidden; }
body.full { padding: 0; }
body.full .hdr, body.full .tabbar { display: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--ink2); }
.small { font-size: .86rem; }
.center { text-align: center; }
p { margin: .4em 0; }

/* ---------- cabecera y pestañas ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: calc(var(--hdrh) + var(--safe-t)); padding: var(--safe-t) 6px 0;
  display: flex; align-items: center; gap: 4px; background: var(--burgundy); color: var(--on-dark);
  border-bottom: 3px solid var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
:root[data-theme="dark"] .hdr { background: #3a1013; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; min-height: 44px; }
.brand-mark svg { width: 34px; height: 34px; display: block; }
.brand-name { font-family: var(--display); font-size: 1.15rem; letter-spacing: .5px; text-transform: uppercase; }
.htitle { flex: 1; min-width: 0; font-family: var(--display); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px; }
.hbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: inherit; }
.hbtn:active { background: rgba(255, 255, 255, .15); }
.sos-mini svg { color: #fff; background: var(--red); border-radius: 6px; padding: 3px; width: 28px; height: 28px; fill: #fff; stroke: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; height: calc(var(--tabh) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--navy); border-top: 3px solid var(--gold);
}
:root[data-theme="dark"] .tabbar { background: #141c30; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: rgba(246, 236, 212, .62); font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .2px; }
.tabbar a.on { color: #fff; }
.tabbar a.on svg { color: var(--gold); }
.main { max-width: 640px; margin: 0 auto; }
.view { padding: 16px 16px 28px; animation: in .18s ease-out; }
@keyframes in { from { transform: translateY(6px); } to { transform: none; } }

/* ---------- tipografía ---------- */
.display { font-family: var(--display); font-weight: 400; color: var(--burgundy); text-transform: uppercase; letter-spacing: .4px; line-height: 1.05; margin: 0; font-size: 1.85rem; }
.page-head { text-align: center; margin: 4px 0 16px; }
.page-head .display { font-size: 1.7rem; }
.page-head p { margin: 4px 0 0; font-style: italic; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-family: var(--display); color: var(--navy); text-transform: uppercase; font-size: .95rem; letter-spacing: .6px; }
:root[data-theme="dark"] .sec-title { color: var(--gold); }
.sec-title::before, .sec-title::after { content: ''; flex: 1; height: 0; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding-top: 2px; }
.kicker { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: .72rem; color: var(--olive); margin: 0 0 6px; }
.empty { text-align: center; color: var(--ink2); font-style: italic; padding: 14px 8px; }

/* ---------- tarjetas y botones ---------- */
.card { display: block; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 2px 8px rgba(60, 35, 10, .1); margin-bottom: 12px; }
:root[data-theme="dark"] .card { box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.card.pad { padding: 14px 16px; }
.framed { border: 2px solid var(--burgundy); box-shadow: 0 0 0 4px var(--card) inset, 0 0 0 5.5px var(--gold) inset, 0 4px 14px rgba(60, 35, 10, .18); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 8px; border: 2px solid transparent;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; letter-spacing: .3px; text-align: center; line-height: 1.2;
}
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn.primary { background: var(--burgundy); color: #fff; border-color: var(--burgundy-d); box-shadow: 0 3px 0 var(--burgundy-d); }
.btn.navy { background: var(--navy); color: #fff; box-shadow: 0 3px 0 #111b33; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger-ghost { background: transparent; border-color: rgba(179, 20, 27, .4); color: var(--red); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .7; }
.bar { height: 8px; border-radius: 6px; background: rgba(74, 52, 30, .15); overflow: hidden; margin-top: 6px; }
:root[data-theme="dark"] .bar { background: rgba(255, 255, 255, .1); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--olive), #6c8540); border-radius: 6px; transition: width .3s; }
.bar.gold i { background: linear-gradient(90deg, var(--gold-d), var(--gold)); }

/* ---------- inicio ---------- */
.hero { text-align: center; padding: 6px 4px 14px; }
.hero .display { font-size: 1.9rem; }
.hero .tag { font-style: italic; color: var(--ink2); margin: 8px 0 0; }
.em-big {
  display: flex; align-items: center; gap: 14px; padding: 16px 16px; margin-bottom: 14px; border-radius: 12px; color: #fff;
  background: linear-gradient(180deg, #c91e25, #a01117); border: 2px solid #7e0b10; box-shadow: 0 4px 0 #6d090d, 0 6px 16px rgba(160, 17, 23, .35);
}
.em-big:active { transform: translateY(3px); box-shadow: 0 1px 0 #6d090d; }
.em-ico { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.em-ico svg { width: 30px; height: 30px; fill: #c01820; stroke: none; }
.em-big b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: .8px; line-height: 1.1; }
.em-big small { display: block; font-family: var(--sans); font-size: .82rem; opacity: .92; margin-top: 3px; }
.daily { overflow: hidden; }
.daily-art { height: 150px; background-size: cover; background-position: center 30%; position: relative; border-bottom: 2px solid var(--gold); }
.ribbon {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); background: var(--navy); color: #fff; font-family: var(--display); text-transform: uppercase;
  font-size: .82rem; letter-spacing: 1px; padding: 6px 16px; border: 2px solid var(--gold); border-radius: 4px; white-space: nowrap;
}
.daily-body { padding: 24px 16px 12px; }
.daily-head, .fhead-row { display: flex; gap: 12px; align-items: flex-start; }
.nbadge {
  flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--burgundy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 1.05rem; line-height: 1; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--gold);
}
.nbadge small { font-family: var(--sans); font-weight: 700; font-size: .58rem; letter-spacing: .5px; margin-bottom: 2px; }
.nbadge.big { width: 64px; height: 64px; font-size: 1.25rem; }
.ftitle { font-family: var(--display); font-weight: 400; color: var(--burgundy); text-transform: uppercase; font-size: 1.3rem; line-height: 1.1; margin: 2px 0 4px; letter-spacing: .3px; }
.fsub { font-style: italic; margin: 0; color: var(--ink2); font-size: .95rem; line-height: 1.4; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding: 12px 14px; text-align: left; margin: 0 0 12px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--navy); line-height: 1.2; }
:root[data-theme="dark"] .stat b { color: var(--ink); }
.stat small { font-family: var(--sans); font-size: .78rem; color: var(--ink2); display: block; line-height: 1.3; }
.stat-ico { float: right; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--olive); color: #fff; }
.stat-ico svg { width: 20px; height: 20px; }
.stat-ico.flame { background: #c8622a; }
.stat-ico.flame svg { fill: #fff; stroke: none; }
.resume { display: flex; flex-wrap: wrap; align-items: center; padding: 12px 14px; gap: 2px 8px; }
.resume small { width: 100%; font-family: var(--sans); font-weight: 700; text-transform: uppercase; font-size: .68rem; letter-spacing: 1.2px; color: var(--olive); }
.resume b { flex: 1; font-size: .95rem; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 86px; padding: 10px 6px; text-align: center; border-radius: var(--r);
  background: var(--card); border: 1.5px solid var(--line); font-family: var(--sans); font-weight: 600; font-size: .78rem; line-height: 1.2;
}
.qbtn svg { width: 28px; height: 28px; color: var(--burgundy); }
.qbtn:active { background: var(--paper2); }
.offline { margin-top: 18px; }
.off-head { display: flex; align-items: center; gap: 8px; font-family: var(--display); text-transform: uppercase; color: var(--navy); letter-spacing: .4px; }
:root[data-theme="dark"] .off-head { color: var(--gold); }

/* ---------- biblioteca ---------- */
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.capcard { display: block; border-radius: 8px; overflow: hidden; background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 3px 10px rgba(60, 35, 10, .16); }
.capcard img { display: block; width: 100%; height: auto; aspect-ratio: 600 / 904; object-fit: cover; background: var(--paper2); }
.capmeta { padding: 8px 10px 10px; }
.capmeta b { display: block; font-size: .82rem; line-height: 1.25; }
.capmeta small { display: block; font-family: var(--sans); font-size: .72rem; color: var(--ink2); margin-top: 3px; }
.capn { font-family: var(--sans); font-weight: 800; font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--olive); }
.cap-hero { margin: -16px -16px 14px; height: 210px; background-size: cover; background-position: center 35%; position: relative; border-bottom: 3px solid var(--gold); }
.cap-hero-txt { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(20, 12, 6, .85)); }
.cap-hero .display { color: #fff; font-size: 1.5rem; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.cap-hero .capn { color: var(--gold); }
.flist { display: flex; flex-direction: column; gap: 8px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 64px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); }
.frow:active { background: var(--paper2); }
.fnum { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-family: var(--display); font-size: .82rem; }
.frow.done .fnum { background: var(--olive); }
.ftxt { flex: 1; min-width: 0; }
.ftxt b { display: block; font-size: .98rem; line-height: 1.25; }
.ftxt small { display: block; font-style: italic; color: var(--ink2); font-size: .82rem; line-height: 1.3; margin-top: 2px; }
.ftxt .where { display: block; font-family: var(--sans); font-style: normal; font-size: .7rem; color: var(--olive); margin-top: 3px; }
.fflags { display: flex; gap: 2px; }
.fflags .fav { color: var(--gold-d); fill: var(--gold); }
.fflags .ok { color: var(--olive); }

/* ---------- ficha ---------- */
.ficha { padding-bottom: 96px; }
.fhead { background: var(--card); border: 2px solid var(--burgundy); border-radius: var(--r); padding: 14px 14px 12px; box-shadow: 0 0 0 4px var(--card) inset, 0 0 0 5.5px var(--gold) inset; }
.fcap { display: block; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; font-size: .68rem; color: var(--olive); margin: 2px 0 10px; }
.fhead .ftitle { font-size: 1.45rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 7px; border-radius: 30px; background: var(--navy); color: #fff; font-family: var(--sans); font-size: .76rem; }
.pill svg { width: 16px; height: 16px; color: var(--gold); }
.pill b { font-weight: 600; opacity: .8; }
.intro { font-size: 1.05rem; text-align: center; margin: 16px 4px; font-weight: 700; line-height: 1.5; }
.band {
  margin: 22px 0 10px; text-align: center; color: #fff; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; font-size: 1.05rem;
  padding: 7px 10px; border-radius: 4px; position: relative; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--gold);
}
.band.olive { background: var(--olive); }
.band.burgundy { background: var(--burgundy); }
.mats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mats li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; min-height: 56px;
}
.mats .box { width: 28px; height: 28px; flex: none; border: 2px solid var(--olive); border-radius: 6px; display: grid; place-items: center; color: transparent; background: var(--paper); }
.mats .box svg { width: 20px; height: 20px; stroke-width: 3; }
.mats li.on .box { background: var(--olive); color: #fff; }
.mats li.on b { text-decoration: line-through; text-decoration-color: var(--olive); opacity: .75; }
.mats b { display: block; line-height: 1.3; }
.mats small { display: block; color: var(--ink2); font-style: italic; font-size: .84rem; }
.mats.plain li { padding: 8px 2px; border-bottom: 1px dashed var(--line); }
.mats.plain small { display: inline; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px; }
.sn { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--burgundy); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 1.05rem; box-shadow: 0 0 0 2px var(--gold); }
.steps b { display: block; font-family: var(--sans); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; font-size: .9rem; color: var(--burgundy); margin-top: 6px; }
:root[data-theme="dark"] .steps b { color: #e58a8e; }
.steps p { margin: 4px 0 0; }
.callouts { display: grid; gap: 10px; margin-top: 18px; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 2px solid; }
.callout.err { background: var(--err-bg); border-color: var(--burgundy); }
.callout.imp { background: var(--warn-bg); border-color: var(--gold-d); }
.callout b { display: block; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .6px; font-size: .95rem; }
.callout.err b { color: var(--burgundy); }
:root[data-theme="dark"] .callout.err b { color: #e58a8e; }
.callout p { margin: 2px 0 0; }
.cico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-top: 2px; }
.callout.err .cico { background: var(--burgundy); }
.callout.imp .cico { background: var(--gold-d); }
.cico svg { width: 20px; height: 20px; stroke-width: 2.6; }
p.callout { display: block; }
.fnav { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 8px; }
.fnav .btn { min-width: 96px; }
.actbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--safe-b)); z-index: 15; display: flex; gap: 6px; padding: 8px 10px;
  background: var(--paper2); border-top: 1.5px solid var(--line); box-shadow: 0 -3px 12px rgba(60, 35, 10, .12);
}
.act {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 8px;
  background: var(--card); border: 1.5px solid var(--line); font-family: var(--sans); font-size: .72rem; font-weight: 700; line-height: 1.15; padding: 4px;
}
.act.on:first-child { background: var(--gold); border-color: var(--gold-d); color: #2b2018; }
.act.on:nth-child(2) { background: var(--olive); border-color: var(--olive); color: #fff; }
@media (min-width: 660px) { .actbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); } }

/* visor de página */
.pv { position: fixed; inset: 0; z-index: 50; background: #120d09; display: flex; flex-direction: column; color: #f3e8cf; }
.pv-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 6px 6px 14px; font-family: var(--sans); font-size: .85rem; }
.pv-top span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-stage { flex: 1; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center; }
.pv-img { max-width: 100%; max-height: 100%; transform-origin: center center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pv-hint, .pv-msg { text-align: center; font-family: var(--sans); font-size: .78rem; opacity: .7; margin: 6px 12px calc(8px + var(--safe-b)); }
.pv-msg:empty { display: none; }
.pv-msg { opacity: 1; color: var(--gold); }

/* ---------- buscar ---------- */
.search-box { position: relative; }
.sico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink2); }
.search-in, .sel, .tel-in {
  width: 100%; min-height: 52px; border-radius: var(--r); border: 2px solid var(--line); background: var(--card); color: var(--ink); font-family: var(--serif); font-size: 1.05rem; padding: 10px 14px;
}
.search-in { padding-left: 46px; }
.search-in:focus, .sel:focus, .tel-in:focus { outline: none; border-color: var(--navy); }
.filters { margin: 12px 0 6px; }
.sel { font-size: .95rem; min-height: 46px; -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(-45deg, transparent 50%, var(--ink2) 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.chip-l { font-family: var(--sans); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--ink2); width: 100%; }
.chip { min-height: 38px; padding: 6px 14px; border-radius: 30px; border: 1.5px solid var(--line); background: var(--card); font-family: var(--sans); font-size: .85rem; font-weight: 600; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- emergencia ---------- */
.em .em-h { font-family: var(--display); font-weight: 400; color: var(--red); text-transform: uppercase; text-align: center; font-size: 1.8rem; margin: 0 0 12px; letter-spacing: .5px; }
.em-call { background: #b3141b; color: #fff; border-radius: 12px; padding: 14px; margin-bottom: 14px; border: 2px solid #7e0b10; box-shadow: 0 4px 14px rgba(160, 17, 23, .3); }
.em-call-t b { display: block; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.35rem; letter-spacing: .6px; line-height: 1.1; }
.em-call-t small { display: block; font-family: var(--sans); font-size: .9rem; margin-top: 2px; }
.em-call-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; min-height: 64px; border-radius: 10px; background: #fff; color: #b3141b; font-family: var(--display); font-size: 1.45rem; letter-spacing: .5px; box-shadow: 0 4px 0 #7e0b10; }
.em-call-btn svg { width: 30px; height: 30px; fill: #b3141b; stroke: none; }
.em-call.compact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.em-call.compact .em-call-t { flex: 1; }
.em-call.compact .em-call-t b { font-size: 1rem; }
.em-call.compact .em-call-btn { margin: 0; min-height: 52px; font-size: 1.05rem; padding: 0 14px; }
.em-call.compact .em-call-btn svg { width: 22px; height: 22px; }
.em-nums { font-family: var(--sans); font-size: .76rem; opacity: .92; margin: 10px 0 0; line-height: 1.4; }
.em-sos { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: #111; color: #fff; border: 2px solid var(--gold); margin-bottom: 8px; }
.sos-dots { font-family: var(--sans); font-weight: 900; letter-spacing: 1px; font-size: 1.1rem; color: var(--gold); white-space: nowrap; }
.em-sos b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; text-transform: uppercase; letter-spacing: .6px; }
.em-sos small { font-family: var(--sans); font-size: .82rem; opacity: .85; }
.em-group { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 400; text-transform: uppercase; color: var(--navy); font-size: 1.1rem; margin: 22px 0 10px; letter-spacing: .5px; }
:root[data-theme="dark"] .em-group { color: var(--gold); }
.em-group svg { color: var(--red); }
.em-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.em-tile { display: flex; flex-direction: column; justify-content: center; min-height: 92px; padding: 12px; border-radius: 10px; background: var(--card); border: 2px solid var(--line); border-left: 6px solid var(--red); }
.em-tile:active { background: var(--paper2); }
.em-tile b { font-family: var(--sans); font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.em-tile small { font-size: .78rem; color: var(--ink2); line-height: 1.3; margin-top: 4px; font-style: italic; }
.em-disc { text-align: center; font-family: var(--sans); font-size: .8rem; color: var(--ink2); margin-top: 22px; }
.emf-title { font-family: var(--display); font-weight: 400; color: var(--red); text-transform: uppercase; font-size: 2rem; line-height: 1.05; margin: 6px 0 4px; }
.emf-sub { font-style: italic; color: var(--ink2); margin: 0 0 12px; font-size: 1.05rem; }
.steps.big li { padding: 14px; }
.steps.big .sn { width: 44px; height: 44px; font-size: 1.35rem; }
.steps.big b { font-size: 1.15rem; margin-top: 8px; }
.steps.big p { font-size: 1.22rem; line-height: 1.45; font-family: var(--sans); font-weight: 500; }
.callout.big p { font-size: 1.12rem; font-family: var(--sans); font-weight: 500; }
.mats.big b, .mats.big small { font-size: 1.05rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* SOS */
.sos-screen { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; }
.sos-screen.lit { background: #fff; color: #000; }
.sos-label { font-family: var(--display); font-size: 30vw; line-height: 1; opacity: .18; }
.sos-ctrl { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); background: rgba(20, 20, 20, .88); color: #fff; border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.sos-btn { min-height: 56px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .4); background: transparent; color: #fff; font-family: var(--sans); font-weight: 800; font-size: 1rem; }
.sos-btn.on { background: var(--gold); color: #111; border-color: var(--gold); }
.sos-btn.exit { background: #b3141b; border-color: #b3141b; }
.sos-hint, .sos-wake { grid-column: 1 / -1; margin: 0; font-family: var(--sans); font-size: .8rem; opacity: .85; }
.sos-wake:empty { display: none; }

/* ---------- herramientas ---------- */
.tool { display: flex; align-items: center; gap: 14px; padding: 14px; min-height: 76px; }
.tool b { display: block; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1rem; letter-spacing: .3px; line-height: 1.15; }
.tool small { display: block; font-size: .85rem; color: var(--ink2); font-style: italic; }
.tool > span:nth-child(2) { flex: 1; }
.tool > svg { color: var(--ink2); }
.tool-ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.tool-ico svg { width: 28px; height: 28px; }
.tool.navy .tool-ico { background: var(--navy); }
.tool.burgundy .tool-ico { background: var(--burgundy); }
.tool.olive .tool-ico { background: var(--olive); }
.tool.gold .tool-ico { background: var(--gold-d); }
.tool.red .tool-ico { background: var(--red); }
.tool.red .tool-ico svg { fill: #fff; stroke: none; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.stepper:last-child { border-bottom: 0; }
.st-l { font-weight: 700; }
.st-c { display: flex; align-items: center; gap: 6px; }
.st-c button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--navy); background: var(--card); color: var(--navy); display: grid; place-items: center; }
:root[data-theme="dark"] .st-c button { color: var(--ink); border-color: var(--ink2); }
.st-c button:active { background: var(--navy); color: #fff; }
.st-c output { min-width: 52px; text-align: center; font-family: var(--display); font-size: 1.5rem; color: var(--burgundy); }
.res { padding: 14px 16px; }
.res-h { display: flex; align-items: center; gap: 8px; font-family: var(--display); text-transform: uppercase; letter-spacing: .5px; color: var(--navy); }
:root[data-theme="dark"] .res-h { color: var(--gold); }
.res.water .res-h svg { color: #2f6db3; }
.res-big { font-family: var(--display); font-size: 1.6rem; color: var(--burgundy); margin: 6px 0 2px; line-height: 1.15; }
.res-min { font-weight: 700; color: var(--olive); margin: 0; }
.food-t { width: 100%; border-collapse: collapse; margin-top: 6px; }
.food-t td, .food-t th { padding: 9px 2px; border-bottom: 1px dashed var(--line); text-align: left; font-size: .95rem; }
.food-t th { text-align: right; font-family: var(--sans); font-weight: 800; white-space: nowrap; }
.mats.bag li button { min-height: 52px; }
.months { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.months::-webkit-scrollbar { display: none; }
.mchip { flex: none; min-width: 52px; min-height: 44px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font-family: var(--sans); font-weight: 700; text-transform: uppercase; font-size: .78rem; }
.mchip.on { background: var(--olive); border-color: var(--olive); color: #fff; }
.season .ftitle { font-size: 1.2rem; }
.crops { display: flex; flex-wrap: wrap; gap: 8px; }
.crop { padding: 8px 14px; border-radius: 30px; background: var(--olive); color: #fff; font-family: var(--sans); font-weight: 700; font-size: .92rem; }
.crop.alt { background: var(--navy); }
.season + .sec-title + .crops { margin-bottom: 14px; }
.crops + .callout, .crops + .sec-title { margin-top: 16px; }
.callout + .callout { margin-top: 10px; }
.light-screen { position: fixed; inset: 0; background: #fff; display: flex; align-items: flex-end; justify-content: center; }
.light-screen.warm { background: #ffe9b8; }
.light-ctrl { margin: 0 16px calc(20px + var(--safe-b)); padding: 12px 16px; text-align: center; color: #555; font-family: var(--sans); }
.light-ctrl .btn { color: #333; border-color: #ccc; min-width: 140px; }

/* ---------- progreso / ajustes ---------- */
.caprog { display: block; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.caprog:last-child { border-bottom: 0; }
.caprog-l { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.caprog-l b { font-family: var(--sans); }
.set label { display: flex; align-items: center; gap: 8px; font-family: var(--display); text-transform: uppercase; letter-spacing: .4px; color: var(--navy); margin-bottom: 10px; }
:root[data-theme="dark"] .set label { color: var(--gold); }
.seg { display: flex; border: 2px solid var(--navy); border-radius: 10px; overflow: hidden; }
:root[data-theme="dark"] .seg { border-color: var(--ink2); }
.seg button { flex: 1; min-height: 46px; border: 0; background: transparent; font-family: var(--sans); font-weight: 700; font-size: .88rem; padding: 6px 4px; }
.seg button + button { border-left: 2px solid var(--navy); }
:root[data-theme="dark"] .seg button + button { border-left-color: var(--ink2); }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- overlays ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 78px); transform: translate(-50%, 20px); z-index: 60; opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 30px; font-family: var(--sans); font-size: .88rem; font-weight: 600; transition: .25s; max-width: 90vw; text-align: center; border: 1.5px solid var(--gold);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog-bg { position: fixed; inset: 0; z-index: 70; background: rgba(15, 10, 5, .6); display: grid; place-items: center; padding: 20px; }
.dialog { background: var(--card); border: 2px solid var(--burgundy); border-radius: 12px; padding: 18px; max-width: 380px; width: 100%; }
.dialog-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.update-bar { position: fixed; left: 12px; right: 12px; top: calc(var(--hdrh) + var(--safe-t) + 8px); z-index: 40; min-height: 48px; border-radius: 10px; border: 2px solid var(--gold); background: var(--navy); color: #fff; font-family: var(--sans); font-weight: 700; }
.splash { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 12px; }
.splash-mark svg { width: 96px; height: 96px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } .bar i, .toast { transition: none; } }
@media (max-width: 359px) { .quick { grid-template-columns: 1fr 1fr; } .hero .display { font-size: 1.6rem; } }
.em-call.compact .em-call-btn { white-space: nowrap; }
.em-call.compact .em-call-t b { font-size: .92rem; }
