/* World Broadcasting Meeting · Lima 2027
   Layout: mobile-first. Cabecera blanca con logos, banda azul del evento (solo páginas 2–6)
   y una "pantalla" por sección. Colores y tipografías del Manual de Marca Lima 2027. */

:root {
  /* Paleta oficial Lima 2027 */
  --navy: #253880;
  --blue: #0377d8;
  --sky: #00b5de;
  --mist: #c6d9dc;
  --steel: #80adbb;
  --yellow: #ffd301;
  --orange: #f5a01a;
  --orange-d: #e85212;
  --fuchsia: #e73088;
  --purple: #863d8e;
  --purple-d: #532582;
  --green: #47b285;
  --green-d: #36872b;
  --lime: #cfd71f;
  --turq: #00c4a2;

  /* Neutros con sesgo azul */
  --ink: #18214d;
  --muted: #56628a;
  --line: #dde6ee;
  --bg: #f5f8fb;
  --surface: #ffffff;

  /* Tipografía del manual: Baloo 2 (principal) + Inter (secundaria) */
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-lg: 22px;
  --r-md: 14px;
  --shadow: 0 10px 30px -14px rgba(37, 56, 128, .35);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

[data-icon] { display: inline-flex; flex: none; }
[data-icon] svg, .item-ico svg, .day-chev svg, .btn > svg { width: 1em; height: 1em; flex: none; }

/* ---------- HEAD ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 10px; }
/* Emblemas juntos según el manual de marca (pág. 21): Panam Sports sólido azul, a 0,83 de la altura
   del logo de Lima 2027 y separado unos 2/3 de esa altura, sin línea divisoria. */
/* La altura de los logos sigue al ancho de pantalla para que cabecera y botones quepan desde 320 px. */
.brand { --h: clamp(27px, 9.4vw, 38px); flex: none; display: flex; align-items: center; gap: calc(var(--h) * .6); text-decoration: none; }
.brand-lima { height: var(--h); width: auto; flex: none; }
.brand-panam { height: calc(var(--h) * .83); width: auto; flex: none; }
.top-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.lang { display: flex; align-items: center; gap: 2px; color: var(--steel); font-weight: 600; font-size: 14px; }
.lang-btn {
  background: none; border: 0; padding: 8px 6px; min-width: 36px;
  font-weight: 700; letter-spacing: .04em; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.lang-btn[aria-pressed="true"] { color: var(--navy); border-bottom-color: var(--fuchsia); }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--navy); font-size: 18px;
}
.icon-btn:hover { background: var(--bg); }

/* ---------- HEADER 1 (banner del evento, todas las pantallas) ----------
   Arte tomado de PODIO DIGITAL: pliegues grises de fondo y cintas de color colgando arriba. */
.band { position: relative; overflow: hidden; background: #f1f2f4 url(../assets/img/folds-bg.webp) center 30% / cover no-repeat; border-bottom: 1px solid var(--line); }
.band-art { position: absolute; top: 0; right: -18px; width: min(54%, 300px); height: auto; max-width: none; pointer-events: none; }
.band-in { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 206px; padding-block: 14px 18px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px -4px; padding: 6px 12px 6px 6px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--navy);
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 999px;
}
.back:hover { background: #fff; border-color: var(--steel); }
.band-title {
  margin: auto 0 0; font: 800 clamp(27px, 7.6vw, 54px)/.86 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
  transform: skewX(-9deg); transform-origin: left bottom;
}
.band-title span { display: block; }
.w1 { color: #7fa9b8; }
.w2 { color: #1f2760; }
.w3 { color: var(--blue); }
.band-tag { margin: 8px 0 0; font: 700 clamp(15px, 4.4vw, 19px)/1.15 var(--display); color: #1f2760; text-wrap: balance; }

/* ---------- STAGE ---------- */
.stage { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; overflow: hidden; background: #f1f2f4 url(../assets/img/folds-bg.webp) center top / cover no-repeat; }
main { position: relative; flex: 1; padding-block: 22px 40px; }
.view { animation: rise .35s ease both; }
@keyframes rise { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- HOME: 4 botones, 2 · 2 ---------- */
.view-home { padding-top: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  --c: var(--purple); --c2: var(--fuchsia); --tint: #f6eef8;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 168px; padding: 16px;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--c) 16%, #fff);
  border-radius: var(--r-lg);
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile::after { /* esquina de color, como en el mockup */
  content: ""; position: absolute; z-index: -1; right: -8%; bottom: -34%;
  width: 62%; aspect-ratio: 1.5; border-radius: 100% 0 0 0 / 100% 0 0 0;
  background: linear-gradient(120deg, var(--c2), var(--c));
  transform: rotate(-8deg); opacity: .9;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -16px rgba(37, 56, 128, .45); }
.tile-ico {
  display: grid; place-items: center; width: 48px; height: 48px; font-size: 26px;
  color: var(--c); background: #fff; border-radius: 14px;
  box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--c) 60%, transparent);
}
.tile-txt { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: space-between; }
.tile-title { font: 700 20px/1.08 var(--display); text-wrap: balance; }
.tile-cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px; background: var(--c); color: #fff;
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
}
.t-agenda   { --c: #863d8e; --c2: #e73088; --tint: #f7eefa; }
.t-calendar { --c: #2f7d32; --c2: #cfd71f; --tint: #eef8ee; }
.t-rate     { --c: #d9610f; --c2: #ffd301; --tint: #fff4e3; }
.t-pres     { --c: #0563b8; --c2: #00b5de; --tint: #e9f4fd; }
.t-gallery  { --c: #c81e6f; --c2: #f5a01a; --tint: #fdeef5; }

/* ---------- Cabecera de página (HEADER 2) ---------- */
.page-head { --c: var(--navy); display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-ico {
  display: grid; place-items: center; width: 52px; height: 52px; font-size: 28px; flex: none;
  color: #fff; background: var(--c); border-radius: 16px;
}
.page-head h2 { margin: 0; font: 800 clamp(26px, 5.5vw, 36px)/1.02 var(--display); color: var(--ink); text-wrap: balance; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; max-width: 60ch; }
.c-agenda { --c: #863d8e; --c2: #e73088; --tint: #f7eefa; }
.c-calendar { --c: #2f7d32; --c2: #cfd71f; --tint: #eef8ee; }
.c-rate { --c: #d9610f; --c2: #ffd301; --tint: #fff4e3; }
.c-pres { --c: #0563b8; --c2: #00b5de; --tint: #e9f4fd; }
.c-gallery { --c: #c81e6f; --c2: #f5a01a; --tint: #fdeef5; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2;
}
.btn [data-icon] { font-size: 18px; }
.btn-solid { background: var(--c, var(--navy)); color: #fff; }
.btn-solid:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--navy); }
.btn-ghost:hover { border-color: var(--steel); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--blue); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- AGENDA ---------- */
.facts {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.fact { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.fact-ico { font-size: 22px; color: var(--fuchsia); margin-top: 2px; }
.fact-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact-v { display: block; font-weight: 600; }
.fact-n { display: block; font-size: 13.5px; color: var(--muted); }

.days { display: flex; flex-direction: column; gap: 14px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.day-head {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 0; text-align: left; color: #fff;
  background: linear-gradient(110deg, var(--d1), var(--d2));
}
.day[data-day="1"] { --d1: #253880; --d2: #0377d8; }
.day[data-day="2"] { --d1: #532582; --d2: #c81e6f; }
.day-num { font: 800 46px/.8 var(--display); font-variant-numeric: tabular-nums; padding-top: 6px; }
.day-meta { flex: 1; min-width: 0; }
.day-name { display: block; font: 700 21px/1.1 var(--display); }
.day-count { display: block; font-size: 13px; opacity: .88; }
.day-chev { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 20px; transition: transform .25s ease; }
.day-head[aria-expanded="true"] .day-chev { transform: rotate(180deg); }
.day-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s ease; }
.day-head[aria-expanded="true"] + .day-body { grid-template-rows: 1fr; }
.day-body > div { overflow: hidden; min-height: 0; }
.items { list-style: none; margin: 0; padding: 6px 0; }

.item {
  --k: var(--blue); --kt: #eaf4fd;
  display: grid; grid-template-columns: 58px 40px minmax(0, 1fr); gap: 0 10px; align-items: start;
  padding: 12px 16px; position: relative;
}
.item + .item { border-top: 1px solid #eef2f7; }
.item:nth-child(even) { background: #fafcfe; }
.item-time { font: 700 17px/40px var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }
.item-time small { display: block; margin-top: -12px; font: 500 10.5px/1 var(--body); color: var(--muted); letter-spacing: .04em; }
.item-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--kt); color: var(--k); font-size: 20px; }
.item-main { min-width: 0; padding-top: 2px; }
.item-kind { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--k); }
.item-title { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.item-note { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.k-reg     { --k: #0a8fb3; --kt: #e3f6fb; }
.k-session { --k: #0563b8; --kt: #e7f2fd; }
.k-break   { --k: #c9730a; --kt: #fff3df; }
.k-meal    { --k: #2f7d32; --kt: #eaf6ea; }
.k-visit   { --k: #863d8e; --kt: #f5ebf7; }
.k-social  { --k: #c81e6f; --kt: #fdebf4; }
.k-meet    { --k: #253880; --kt: #e9ecf7; }

.photo { grid-column: 1 / -1; margin: 12px 0 2px; border-radius: var(--r-md); overflow: hidden; position: relative; aspect-ratio: 16 / 9; max-width: 520px; background: var(--mist); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption {
  position: absolute; inset: auto 0 0 0; padding: 22px 12px 8px; color: #fff; font-size: 11.5px; line-height: 1.3;
  background: linear-gradient(transparent, rgba(10, 18, 50, .78));
}
.photo figcaption b { display: block; font-size: 13.5px; }
.day-end { margin: 0; padding: 14px 16px; text-align: center; font: 700 15px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--navy); }

/* ---------- Documentos (calendario, rate card) ---------- */
.doc {
  display: grid; gap: 20px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.doc-cover {
  position: relative; overflow: hidden; width: 100%; max-width: 360px; margin-inline: auto;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 18px;
  border-radius: 10px; color: #fff;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 55%, var(--navy)));
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--c) 70%, #000);
}
.doc-cover.landscape { aspect-ratio: 297 / 210; }
.doc-cover.portrait { aspect-ratio: 210 / 297; max-width: 250px; }
.doc-cover::before { content: ""; position: absolute; right: -20%; top: -30%; width: 75%; aspect-ratio: 1; border-radius: 50%; background: var(--c2); opacity: .85; }
.cover-kicker { position: relative; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.cover-title { position: relative; font: 800 28px/1 var(--display); }
.cover-grid, .cover-lines { position: absolute; left: 18px; right: 18px; top: 18px; height: 42%; opacity: .32; }
.cover-grid { background: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 14.28%), repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 25%); border: 1px solid #fff; }
.cover-lines { background: repeating-linear-gradient(0deg, #fff 0 2px, transparent 2px 14px); width: 55%; }
.doc-info h3 { margin: 10px 0 6px; font: 700 23px/1.1 var(--display); }
.doc-info p { margin: 0 0 12px; color: var(--muted); max-width: 52ch; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--tint); color: var(--c); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 0 0 16px; padding: 0; font-size: 13px; color: var(--muted); }
.meta li { padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; }

/* ---------- Filtros y avisos ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.sample-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.sample-note [data-icon] { font-size: 16px; margin-top: 2px; color: var(--steel); }

/* ---------- Presentaciones ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.card-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; padding: 14px; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(135deg, var(--a), var(--b));
}
.card-thumb::before { content: ""; position: absolute; right: -14%; top: -40%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.card-thumb b { position: relative; font: 700 18px/1.05 var(--display); }
.card-thumb span { position: relative; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card-title { font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 12.5px; color: var(--muted); }
.card .btn { margin-top: auto; min-height: 40px; font-size: 14px; }
.card-body .card-meta { margin-bottom: 10px; }

/* ---------- Galería: cada foto con su proporción real ---------- */
.gal { columns: 2; column-gap: 8px; }
.gal .empty { column-span: all; }
.ph {
  position: relative; overflow: hidden; border: 0; padding: 0; border-radius: 10px; color: #fff;
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--a), var(--b));
}
.ph.tall { aspect-ratio: 9 / 16; }
.gal .ph { display: block; width: 100%; margin: 0 0 8px; break-inside: avoid; }
.ph.wide { grid-column: span 2; }
.ph::before { content: ""; position: absolute; left: -10%; bottom: -50%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.ph [data-icon] { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; font-size: 28px; opacity: .75; }
.ph-tag { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; opacity: .92; }
.ph:hover { filter: brightness(1.08); }

.lb { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 60px 12px 64px; background: rgba(10, 16, 44, .93); }
.lb-frame { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lb-frame .ph { max-width: 100%; max-height: 100%; pointer-events: none; border-radius: 6px; }
.lb-frame .ph.r169 { width: min(100%, 1100px); aspect-ratio: 16 / 9; }
.lb-frame .ph.r916 { height: 100%; aspect-ratio: 9 / 16; min-height: 0; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 22px; }
.lb-close { top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; }
.lb-prev { left: 8px; top: 50%; translate: 0 -50%; }
.lb-next { right: 8px; top: 50%; translate: 0 -50%; }
.lb-cap { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin: 0; text-align: center; color: #dbe6f5; font-size: 13px; }

/* ---------- LOGIN flotante ---------- */
.gate { position: absolute; inset: 0; z-index: 20; display: none; align-items: flex-start; justify-content: center; padding: clamp(18px, 6vw, 56px) var(--gutter) 32px; }
body[data-auth="out"] .gate { display: flex; }
body[data-auth="out"] main { filter: blur(7px) saturate(.9); opacity: .55; pointer-events: none; user-select: none; min-height: 600px; }
.gate-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 70px -24px rgba(24, 33, 77, .6), 0 0 0 1px rgba(37, 56, 128, .08); }
.gate-head { position: relative; overflow: hidden; padding: 20px 22px 14px; background: #f1f2f4 url(../assets/img/folds-bg.webp) center / cover no-repeat; border-bottom: 1px solid var(--line); }
.gate-art { position: absolute; top: 0; right: -10px; width: 150px; height: auto; max-width: none; }
.gate-title { position: relative; display: flex; align-items: center; gap: 10px; margin: 0; font: 800 26px/1 var(--display); color: #1f2760; }
.gate-title [data-icon] { font-size: 22px; color: var(--blue); }
.gate-date { position: relative; margin: 6px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.gate-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; --c: var(--navy); }
.gate-lead { margin: 0; color: var(--muted); font-size: 14.5px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.field input {
  min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fbfcfe;
  font: 500 16px/1.2 var(--body); color: var(--ink); letter-spacing: 0; text-transform: none;
}
.field input::placeholder { color: #9aa6c0; }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(3, 119, 216, .15); background: #fff; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: #a01919; font-size: 13.5px; }
.form-ok { margin: 0; padding: 10px 12px; border-radius: 10px; background: #e9f6ee; color: #1f6b33; font-size: 13.5px; }
.gate-form .link { align-self: center; text-align: center; }
.proto { margin: 0; text-align: center; font-size: 12px; color: #8a94b3; }

/* ---------- FOOTER: formas inferiores de PODIO DIGITAL ---------- */
.foot { position: relative; overflow: hidden; background: #f1f2f4 url(../assets/img/folds-bg.webp) center bottom / cover no-repeat; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-in { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 14px 66px; font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--navy); }
.foot-in a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 6px 2px; }
.foot-in a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-sep { width: 1px; height: 14px; background: var(--steel); }
/* Ilustración pequeña, anclada abajo a la derecha: el pie mide lo justo. */
.foot-art { position: absolute; right: 0; bottom: 0; display: block; height: 60px; width: auto; max-width: none; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); }

/* ---------- Contenido real: portadas, fotos y estados vacíos ---------- */
.empty { grid-column: 1 / -1; margin: 0; padding: 26px 18px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, .8); border: 1px dashed var(--mist); border-radius: var(--r-md); }
.form-hint { margin: 0; font-size: 13px; color: var(--muted); }
.doc-cover.has-img { padding: 0; aspect-ratio: auto; background: #fff; }
.doc-cover.has-img::before { display: none; }
.doc-cover.has-img img { width: 100%; height: auto; }
.card-thumb { text-decoration: none; }
.card-thumb.has-img { padding: 0; background: #eef1f5; }
.card-thumb.has-img::before { display: none; }
.card-thumb.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { background: var(--mist); }
.ph::before { display: none; }
.lb-frame img { display: block; max-width: 100%; max-height: 100%; max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
@media (min-width: 720px) { .lb { padding-inline: 72px; } }
.lb-frame { min-height: 0; overflow: hidden; }
.lb-cap { display: flex; align-items: center; justify-content: center; gap: 18px; }
.lb-cap a { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lb-cap svg { width: 16px; height: 16px; }
button:disabled { opacity: .55; cursor: progress; }
a.icon-btn { text-decoration: none; }

/* ---------- Páginas sueltas (nueva contraseña, instalación) ---------- */
.solo { display: flex; justify-content: center; align-items: flex-start; padding-block: clamp(22px, 6vw, 56px); }
.solo .gate-title { font-size: 24px; }

/* ---------- Panel de administración ---------- */
.admin .page-head p a { color: var(--blue); font-weight: 600; }
.box { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.box > * { max-width: 100%; }
.box h3 { margin: 0; font: 700 21px/1.1 var(--display); }
.box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.box-head input { min-height: 42px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: 500 15px var(--body); width: min(100%, 300px); }
.count { color: var(--muted); font-weight: 600; font-size: 16px; }
.grid2 { display: grid; gap: 14px; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.field select, .field input[type="text"], .field input[type="file"], .field textarea {
  min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fbfcfe;
  font: 500 15px/1.2 var(--body); color: var(--ink); letter-spacing: 0; text-transform: none; width: 100%;
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); }
.status { font-size: 14px; color: var(--muted); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: #a01919; border-color: #a01919; color: #fff; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.row-thumb { width: 96px; height: 60px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.row-thumb.none { display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.row-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.row-main span { font-size: 13px; color: var(--muted); }
.row-act { display: flex; gap: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumbs figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.thumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #eef1f5; }
.thumbs .tall img { aspect-ratio: 9 / 16; }
.thumbs figcaption { display: flex; flex-direction: column; gap: 6px; padding: 8px; font-size: 12px; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 8px 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table td span { display: block; font-size: 13px; color: var(--muted); }
.table .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.table .mini { min-height: 36px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: 500 14px var(--body); width: 190px; max-width: 100%; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 14px; }
.bulk:empty { display: none; }
.bulk select { min-height: 36px; padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: 500 14px var(--body); background: #fbfcfe; }
.bulk-count { color: var(--muted); }
.bulk-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.bulk-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; padding: 4px 0; }
.bulk-confirm p { margin: 0; flex: 1 1 260px; color: #a01919; }
.btn.danger-text { color: #a01919; border-color: #f0c9c9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pick { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--blue); cursor: pointer; }
.thumbs figure { position: relative; }
.thumbs .pick { position: absolute; top: 6px; left: 6px; z-index: 1; background: rgba(255, 255, 255, .92); border-radius: 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.thumbs figure.is-picked, .row.is-picked { outline: 3px solid var(--blue); outline-offset: -1px; }
.thumbs figure.is-hidden img, .row.is-hidden .row-thumb { opacity: .4; filter: grayscale(.6); }
.row-main .tag { margin-top: 4px; align-self: flex-start; }
.help { margin: 4px 0 16px; padding: 4px 18px; background: #f3f8fd; border: 1px solid #d5e6f6; border-radius: var(--r-md); font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.help summary { padding: 12px 0; font: 700 18px/1.2 var(--display); color: #1f2760; cursor: pointer; }
.help h4 { margin: 14px 0 4px; font: 700 15px/1.2 var(--body); color: #1f2760; }
.help p { margin: 0 0 10px; max-width: 78ch; }
.help ol, .help ul { margin: 0 0 12px; padding-left: 20px; max-width: 78ch; }
.help li { margin-bottom: 6px; }
.help li::marker { color: var(--blue); font-weight: 700; }
.tag { display: inline-block !important; padding: 2px 8px; border-radius: 999px; background: #fff3df; color: #8a5200 !important; font-size: 12px !important; font-weight: 600; }
.tag.off { background: #fdecec; color: #a01919 !important; }

/* ---------- Tablet y escritorio ---------- */
@media (min-width: 720px) {
  .top-in { padding-block: 14px; }
  .brand { --h: 56px; gap: calc(var(--h) * .68); }
  .band-in { padding-block: 20px 26px; min-height: 250px; }
  .band-art { width: min(52%, 600px); right: 0; }
  .band-tag { font-size: 24px; margin-top: 10px; }
  .foot-in { padding-block: 26px; font-size: 11px; }
  .foot-art { height: 76px; }
  main { padding-block: 34px 56px; }

  .tiles { gap: 20px; }
  .tile { flex-direction: row; align-items: center; gap: 20px; min-height: 150px; padding: 26px 28px; }
  .tile-ico { width: 64px; height: 64px; font-size: 34px; border-radius: 18px; }
  .tile-txt { gap: 12px; justify-content: center; padding-left: 20px; border-left: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
  .tile-title { font-size: 28px; }
  .tile-cta { font-size: 14.5px; padding: 9px 16px; }
  .tile::after { width: 40%; bottom: -52%; }

  .item { grid-template-columns: 74px 44px minmax(0, 1fr); padding: 14px 22px; gap: 0 14px; }
  .item-time { font-size: 19px; }
  .day-head { padding: 18px 22px; }
  .doc { grid-template-columns: auto 1fr; align-items: center; gap: 32px; padding: 28px; }
  .doc-cover { width: 320px; margin: 0; }
  .doc-cover.portrait { width: 230px; }
  .gal { columns: 4; column-gap: 12px; }
  .gal .ph { margin-bottom: 12px; }
}

/* ---------- Pantallas muy estrechas (menos de 400 px) ---------- */
@media (max-width: 399px) {
  .top-tools { gap: 4px; }
  .lang { font-size: 13px; gap: 0; }
  .lang-btn { min-width: 30px; padding: 8px 4px; }
  .icon-btn { width: 34px; height: 34px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Descripción de documentos y edición en el panel ---------- */
.doc-info > p { white-space: pre-line; }
.card-desc { font-size: 13.5px; line-height: 1.4; color: var(--muted); white-space: pre-line; }
.row-main .row-desc { color: var(--ink); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row.is-editing { display: block; }
.doc-edit { display: flex; flex-direction: column; gap: 12px; }
.doc-edit .btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
textarea { font: inherit; resize: vertical; }

/* ---------- Pie: enlace a la política, legible sobre las formas de color ---------- */
.foot-in a svg { width: 14px; height: 14px; flex: none; }
.foot-in > a { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 6px 18px -12px rgba(31, 39, 96, .45); text-align: center; }

/* ---------- Política de privacidad: mosaico de tarjetas con los colores de la home ---------- */
.pol { padding-block: clamp(20px, 5vw, 40px) clamp(28px, 6vw, 56px); }
.pol-head { align-items: flex-start; }
.pol-head h1 { margin: 0; font: 800 clamp(22px, 4.6vw, 32px)/1.08 var(--display); color: var(--ink); text-wrap: balance; }
.pol-note { font-style: italic; }
.pol-grid { display: grid; gap: 14px; }
.pol-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 18px 18px 34px; border-radius: var(--r-lg);
  background: var(--tint); border: 1px solid color-mix(in srgb, var(--c) 16%, #fff); box-shadow: var(--shadow);
  color: var(--ink); font-size: 14.5px; line-height: 1.62;
}
.pol-card::after {
  content: ""; position: absolute; z-index: -1; right: -6%; bottom: -46px;
  width: 150px; aspect-ratio: 1.5; border-radius: 100% 0 0 0 / 100% 0 0 0;
  background: linear-gradient(120deg, var(--c2), var(--c)); transform: rotate(-8deg); opacity: .9;
}
.pol-card h2 { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; font: 700 19px/1.2 var(--display); color: var(--ink); }
.pol-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--c); color: #fff; font-size: 15px; }
.pol-card p { margin: 0 0 10px; }
.pol-card ul { margin: 0 0 10px; padding-left: 20px; }
.pol-card li { margin-bottom: 6px; }
.pol-card li::marker { color: var(--c); }
.pol-card a { color: var(--c); font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 860px) {
  .pol-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .pol-card { padding: 24px 26px 40px; }
  .pol-card.wide { grid-column: 1 / -1; }
}
