/* ============================================================
   Portal IES La Roca — Amanecer v3
   Structure from the approved flow prototype:
   Home (companion) · Programa (month timeline) · Mensajes (Q&A)
   · Perfil (info/prefs/password/help) · Admin — new bottom nav.
   Themes: html[data-theme="light" | "dark" | "auto"]
   ============================================================ */

:root {
  --sky: linear-gradient(185deg, #5d4a86 0%, #8a5f9e 34%, #e0797f 62%, #f9b06a 88%, #ffd36e 100%);
  --violet-700: #5d4a86;
  --violet-500: #8a5f9e;
  --plum:       #a15fa0;
  --coral:      #e0797f;
  --sun-500:    #f4a04a;
  --sun-300:    #ffd36e;
  --sun-soft:   #fff1dd;

  --bg:      #fff7ef;
  --card:    #ffffff;
  --card-2:  #fdf9f4;
  --line:    #f0e6f2;
  --ink:     #3c2d45;
  --ink-soft:#5c4f68;
  --ink-mute:#a99cb5;
  --on-sky:  #ffffff;
  --on-sky-dim: #ffe0c2;
  --gold-eyebrow: #ffe9bd;

  --ok-bg: #e6f5ec;  --ok-ink: #1e6b45;
  --err-bg: #fdeae8; --err-ink: #a63a2e;
  --info-bg: #efe9f7;--info-ink: #5d4a86;

  --shadow:    0 8px 24px rgba(93, 74, 134, .12);
  --shadow-lg: 0 14px 34px rgba(93, 74, 134, .18);
  --r-card: 18px;
  --r-in:   13px;
  --r-pill: 999px;

  --f-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --f-body:    "Nunito", system-ui, -apple-system, sans-serif;

  --col: 560px;
}
@media (min-width: 900px) { :root { --col: 640px; } }

html[data-theme="dark"] {
  --sky: linear-gradient(185deg, #241a44 0%, #3c2a60 36%, #6d3f58 66%, #9a5c3c 92%, #b47a3a 100%);
  --bg:      #1a1226;
  --card:    #261b3a;
  --card-2:  #2e2244;
  --line:    #3a2c52;
  --ink:     #efe9f6;
  --ink-soft:#c9bdd9;
  --ink-mute:#8b7fa3;
  --sun-soft:#3a2b48;
  --ok-bg:  #1e3a2c; --ok-ink:  #8fd8ae;
  --err-bg: #45231f; --err-ink: #f2a99d;
  --info-bg:#2c2348; --info-ink:#cabcf0;
  --shadow:    0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --sky: linear-gradient(185deg, #241a44 0%, #3c2a60 36%, #6d3f58 66%, #9a5c3c 92%, #b47a3a 100%);
    --bg:      #1a1226;
    --card:    #261b3a;
    --card-2:  #2e2244;
    --line:    #3a2c52;
    --ink:     #efe9f6;
    --ink-soft:#c9bdd9;
    --ink-mute:#8b7fa3;
    --sun-soft:#3a2b48;
    --ok-bg:  #1e3a2c; --ok-ink:  #8fd8ae;
    --err-bg: #45231f; --err-ink: #f2a99d;
    --info-bg:#2c2348; --info-ink:#cabcf0;
    --shadow:    0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 14px 34px rgba(0, 0, 0, .45);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
}
body.app { min-height: 100vh; }
/* content clears the fixed nav */
body.app > main { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }

h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p  { margin: 0 0 1em; }
a  { color: var(--plum); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
.hidden { display: none !important; }
.muted  { color: var(--ink-mute); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.stack-8 > * + * { margin-top: 8px; }
.help { font-size: 12.5px; color: var(--ink-mute); margin: 6px 0 0; }
.text-lg { font-size: 1.1rem; }
.prewrap { white-space: pre-wrap; margin: .6rem 0; }
.grow { flex: 1; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.msgform { margin: 0; }

:focus-visible { outline: 3px solid var(--sun-500); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

.page {
  max-width: var(--col); margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 26px;
}

/* ---------- Page headers ---------- */
.pgh { padding: 10px 4px 8px; }
.pgh h1 { margin: 0; }
.pgh small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 3px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--plum); margin: 4px 4px 0; }
.sectionhead { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 4px 10px; }
.sectionhead h2 { margin: 0; }
.sectionhead a, .sectionhead small { font-size: 12px; font-weight: 800; color: var(--ink-mute); }
.sectionhead a { color: var(--plum); }

/* ---------- New bottom nav ---------- */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  width: 100%; max-width: var(--col);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
}
.nav__item {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--ink-mute);
  font-size: 10px; font-weight: 800;
}
.nav__item:hover { text-decoration: none; }
.nav__ico {
  display: grid; place-items: center;
  width: 44px; height: 28px; margin: 0 auto 3px;
  border-radius: var(--r-pill);
  transition: background .2s;
}
.nav__ico svg { stroke: currentColor; }
.nav__item.is-on { color: var(--violet-700); }
.nav__item.is-on .nav__ico { background: var(--info-bg); }
html[data-theme="dark"] .nav__item.is-on { color: #cabcf0; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .nav__item.is-on { color: #cabcf0; } }

/* Desktop: the same nav becomes a fixed left rail */
@media (min-width: 900px) {
  body.app { padding-left: 224px; }
  body.app > main { padding-bottom: 26px; }
  .nav {
    left: 0; right: auto; top: 0; bottom: 0;
    width: 224px; max-width: none;
    height: auto;
    overflow-y: auto;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 22px 12px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav__item {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 12px;
    text-align: left;
    padding: 10px 12px; border-radius: 14px;
    font-size: 13.5px;
  }
  .nav__ico { width: 28px; height: 28px; margin: 0; }
  .nav__item:hover { background: var(--card-2); }
  .nav__item.is-on { background: var(--info-bg); }
  .nav__item.is-on .nav__ico { background: transparent; }
}

/* ---------- Avatars ---------- */
.av {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--sun-300), var(--coral));
  color: #5a3a10; font-weight: 800; font-size: 12.5px;
  display: inline-grid; place-items: center;
  flex: 0 0 auto; overflow: hidden;
}
.av--photo { background: var(--line); }
.av--photo img { width: 100%; height: 100%; object-fit: cover; }
.av--big { width: 56px; height: 56px; font-size: 19px; }
.avwrap { position: relative; display: inline-block; }
.avwrap .cam {
  position: absolute; right: -3px; bottom: -3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--violet-700); color: #fff;
  display: grid; place-items: center;
  border: 2px solid var(--card);
}
.avwrap .cam svg { width: 11px; height: 11px; }

/* ---------- Home ---------- */
.homehead { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 12px; }
.homehead .brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 600; font-size: 15.5px; color: var(--ink); text-decoration: none; }
.homehead .brand:hover { text-decoration: none; }
.homehead .brand img { width: 24px; height: 24px; border-radius: 7px; }
.hero {
  background: var(--sky); color: var(--on-sky);
  border-radius: 26px; padding: 20px 18px 22px; text-align: center;
}
.hero .eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-eyebrow); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--plum); }
.hero__when { font-family: var(--f-display); font-weight: 500; font-size: 19px; margin: 5px 0 0; }
.countdown { display: flex; justify-content: center; gap: 20px; margin-top: 12px; }
.countdown__unit { min-width: 48px; }
.countdown__num { font-family: var(--f-display); font-weight: 600; font-size: 30px; line-height: 1; color: var(--on-sky); }
.countdown__lbl { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--on-sky-dim); margin-top: 3px; }
.hero__live { font-family: var(--f-display); font-size: 18px; margin: 12px 0 0; }
.hero--live .countdown { display: none; }
.hero__badge {
  margin: -16px 12px 0; position: relative;
  background: var(--card); color: var(--ink);
  border-radius: 18px; padding: 13px 16px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--sun-500);
  font-size: 12.5px; text-align: left;
}
.hero__badge .medal {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 13px;
  background: linear-gradient(140deg, var(--sun-300), var(--sun-500));
  display: grid; place-items: center; font-size: 17px;
}
.hero__badge b { font-size: 13px; font-weight: 800; display: block; }
.hero__badge i { font-style: normal; font-weight: 700; color: var(--plum); }

/* week chips (CSS-only switching via radios) */
.days { display: flex; gap: 8px; padding: 0 2px; overflow-x: auto; scrollbar-width: none; align-items: stretch; }
.days::-webkit-scrollbar { display: none; }
.days label, .mesbtn {
  flex: 0 0 auto; text-align: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 15px; padding: 9px 13px 7px;
  cursor: pointer; font-family: var(--f-display);
  text-decoration: none; color: var(--ink);
}
.days label b { display: block; font-size: 18px; font-weight: 600; line-height: 1.05; }
.days label span, .mesbtn span { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; color: var(--ink-mute); }
.mesbtn { background: var(--violet-700); border-color: var(--violet-700); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.mesbtn:hover { text-decoration: none; color: #fff; }
.mesbtn b { font-size: 16px; font-weight: 600; line-height: 1.1; }
.mesbtn span { color: #e6ddf5; }
input.wkr { position: absolute; opacity: 0; pointer-events: none; }
.wk-panel { display: none; margin-top: 12px; }
#wk1:checked ~ .wkb label[for="wk1"], #wk2:checked ~ .wkb label[for="wk2"],
#wk3:checked ~ .wkb label[for="wk3"], #wk4:checked ~ .wkb label[for="wk4"],
#wk5:checked ~ .wkb label[for="wk5"] { background: var(--violet-700); border-color: var(--violet-700); color: #fff; }
#wk1:checked ~ .wkb label[for="wk1"] span, #wk2:checked ~ .wkb label[for="wk2"] span,
#wk3:checked ~ .wkb label[for="wk3"] span, #wk4:checked ~ .wkb label[for="wk4"] span,
#wk5:checked ~ .wkb label[for="wk5"] span { color: #e6ddf5; }
#wk1:checked ~ .wkb .wkp1, #wk2:checked ~ .wkb .wkp2, #wk3:checked ~ .wkb .wkp3,
#wk4:checked ~ .wkb .wkp4, #wk5:checked ~ .wkb .wkp5 { display: block; }

/* ---------- Cards & lists ---------- */
.card { background: var(--card); border-radius: var(--r-card); padding: 16px 17px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.card h3 { font-size: 15.5px; }
.list-sep > li { padding: 10px 0; border-bottom: 1px solid var(--line); list-style: none; }
.list-sep > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-sep > li:first-child { padding-top: 0; }
.list-sep { margin: 0; padding: 0; }

.svlist { margin: 0; padding: 0; }
.svlist li { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.svlist li:last-child { border-bottom: 0; }
.svlist .r { font-weight: 800; color: var(--violet-700); flex: 0 0 auto; }
html[data-theme="dark"] .svlist .r { color: #cabcf0; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .svlist .r { color: #cabcf0; } }
.svlist .w { margin-left: auto; text-align: right; }
.svlist .w.is-you { color: var(--plum); font-weight: 800; }
.svlist .s { flex: 1 0 100%; font-size: 12px; color: var(--ink-mute); }
.svc__title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.svc__title b { font-family: var(--f-display); font-weight: 500; font-size: 15.5px; }
.svc__title span { font-size: 12px; font-weight: 800; color: var(--ink-mute); }

/* ---------- Announcements ---------- */
.ann { position: relative; }
.ann__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ann__title { font-family: var(--f-display); font-weight: 500; font-size: 15.5px; margin: 0; }
.ann__meta { font-size: 11px; font-weight: 700; color: var(--ink-mute); margin-top: 2px; }
.ann__body { margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); }
.ann__body p { margin: 0 0 .6em; }
.ann__body p:last-child { margin-bottom: 0; }
.ann__media { margin-top: 12px; border-radius: var(--r-in); overflow: hidden; }
.ann__media img, .ann__media video { display: block; width: 100%; }
.ann__media audio { width: 100%; display: block; }
.ann__edit { flex: 0 0 auto; }

/* ---------- Programa: month timeline ---------- */
.mh { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 10px; }
.mh h1 { margin: 0; font-size: 21px; }
.mh h1 small { font-size: 10.5px; font-weight: 800; color: var(--ink-mute); display: block; letter-spacing: .16em; text-transform: uppercase; }
.mnav { display: flex; gap: 6px; }
.mnav a {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center;
  font-weight: 800; color: var(--violet-700); text-decoration: none;
}
.mnav a:hover { text-decoration: none; }
.tl { margin: 4px 0 12px; position: relative; padding-left: 56px; }
.tl::before { content: ""; position: absolute; left: 22px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl__day { position: relative; margin-bottom: 6px; }
.tl__dot { position: absolute; left: -56px; top: 2px; width: 44px; text-align: center; font-family: var(--f-display); }
.tl__dot b { display: block; background: var(--card); border: 1.5px solid var(--line); border-radius: 13px; padding: 7px 0 5px; font-size: 17px; font-weight: 600; line-height: 1; }
.tl__dot b em { display: block; font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .1em; color: var(--ink-mute); margin-top: 2px; }
.tl__day.is-today .tl__dot b { background: var(--sun-500); border-color: var(--sun-500); color: #fff; }
.tl__day.is-today .tl__dot b em { color: #fff3dd; }
.todaytag { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--sun-500); margin: 2px 0 6px; }
.tl details { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.tl summary { list-style: none; cursor: pointer; padding: 13px 15px; display: flex; align-items: center; gap: 10px; }
.tl summary::-webkit-details-marker { display: none; }
.tl summary::marker { content: ""; }
.tl summary .tic { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; flex: 0 0 32px; }
.tl .is-svc summary .tic { background: var(--info-bg); }
.tl .is-ann summary .tic { background: var(--sun-soft); }
.tl summary b { font-family: var(--f-display); font-weight: 500; font-size: 14.5px; display: block; }
.tl summary span { font-size: 11.5px; font-weight: 700; color: var(--ink-mute); }
.tl summary .arr { margin-left: auto; color: var(--ink-mute); transition: .2s; }
.tl details[open] summary .arr { transform: rotate(90deg); }
.tl .in { padding: 2px 15px 13px 57px; }
.tl .in p { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); padding-top: 4px; margin: 0; }
.tl .in .svlist li { font-size: 12.5px; }

/* ---------- Mensajes & Q&A ---------- */
.anonrow { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 13px; cursor: pointer; font-size: 12.5px; line-height: 1.4; font-weight: 700; }
.anonrow small { display: block; color: var(--ink-mute); font-weight: 600; }
.anonrow input { position: absolute; opacity: 0; }
.anonbox {
  width: 20px; height: 20px; flex: 0 0 20px;
  border: 2px solid var(--plum); border-radius: 6px;
  margin-top: 1px; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 800;
}
.anonrow input:checked + .anonbox { background: var(--plum); }
.anonrow input:checked + .anonbox::after { content: "✓"; }
.anonrow input:focus-visible + .anonbox { outline: 3px solid var(--sun-500); outline-offset: 2px; }
.qa { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.qa summary { list-style: none; cursor: pointer; padding: 13px 15px; display: flex; align-items: center; gap: 10px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::marker { content: ""; }
.qa summary b { font-family: var(--f-display); font-weight: 500; font-size: 13.5px; display: block; line-height: 1.3; }
.qa summary span { font-size: 11px; font-weight: 700; color: var(--ink-mute); }
.qa summary .arr { margin-left: auto; color: var(--ink-mute); transition: .2s; }
.qa[open] summary .arr { transform: rotate(90deg); }
.qic { width: 30px; height: 30px; border-radius: 10px; background: var(--info-bg); color: var(--violet-700); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: 0 0 30px; }
.qic--warm { background: var(--sun-soft); color: #b0761c; }
.qa__a { display: flex; gap: 10px; padding: 0 15px 14px; }
.qa__a p { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); margin: 0; white-space: pre-wrap; }

/* ---------- Row lists (perfil, admin) ---------- */
.rowlist { margin: 0; padding: 0; }
.rowlist > li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.rowlist > li:last-child { border-bottom: 0; }
.rowlist a { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--ink); text-decoration: none; }
.rowlist a:hover { text-decoration: none; }
.rowlist .ric { width: 34px; height: 34px; border-radius: 11px; background: var(--info-bg); color: var(--violet-700); display: grid; place-items: center; flex: 0 0 34px; }
.rowlist .ric svg { width: 17px; height: 17px; }
.rowlist .chev { margin-left: auto; color: var(--ink-mute); }
.rowlist small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); }
.gh { margin: 18px 6px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); }
.who { display: flex; gap: 14px; align-items: center; }
.who b { font-family: var(--f-display); font-weight: 500; font-size: 17px; display: block; }
.who span { font-size: 12px; color: var(--ink-mute); }

/* ---------- Segmented control ---------- */
.seg { display: flex; background: var(--info-bg); border-radius: var(--r-pill); padding: 3px; }
.seg a, .seg button {
  flex: 1; text-align: center; font: inherit; font-size: 12px; font-weight: 800;
  padding: 7px 0; border-radius: var(--r-pill);
  color: var(--info-ink); cursor: pointer; border: 0; background: transparent; text-decoration: none;
}
.seg a:hover { text-decoration: none; }
.seg .is-on { background: var(--card); box-shadow: var(--shadow); }

/* ---------- Badges & pills ---------- */
.badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-pill); background: linear-gradient(120deg, var(--sun-300), var(--sun-500)); color: #5a3a10; }
.badge--soft { background: var(--info-bg); color: var(--info-ink); }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info-ink); }
.pill--gold { background: linear-gradient(120deg, var(--sun-300), var(--sun-500)); color: #5a3a10; }
.pill--off  { background: var(--line); color: var(--ink-mute); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 800; margin-bottom: 5px; color: var(--ink-soft); }
.input { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-in); padding: 11px 13px; }
.input:focus { border-color: var(--plum); outline: none; box-shadow: 0 0 0 3px rgba(161, 95, 160, .18); }
textarea.input { resize: vertical; min-height: 74px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%), linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .formrow { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; margin-bottom: 12px; }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--plum); }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar .input { flex: 1; }
.inlineform { display: inline; }
.uplo { border: 2px dashed var(--line); border-radius: 16px; padding: 16px; text-align: center; color: var(--ink-mute); font-size: 12.5px; font-weight: 700; margin-bottom: 13px; cursor: pointer; display: block; }
.uplo svg { display: block; margin: 0 auto 6px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; cursor: pointer; border: 0;
  font-family: var(--f-body); font-weight: 800; font-size: 13.5px;
  color: #fff; background: var(--violet-700);
  border-radius: var(--r-pill); padding: 11px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(93, 74, 134, .28);
}
.btn:hover { background: #4e3d73; text-decoration: none; }
.btn--block { display: flex; width: 100%; }
.btn--gold { background: linear-gradient(120deg, var(--sun-500), var(--coral)); box-shadow: 0 6px 16px rgba(224, 121, 127, .35); }
.btn--gold:hover { filter: brightness(1.06); background: linear-gradient(120deg, var(--sun-500), var(--coral)); }
.btn--danger { background: #c0392b; box-shadow: 0 6px 16px rgba(192, 57, 43, .28); }
.btn--danger:hover { background: #a93226; }
.btn--ghost { background: transparent; color: var(--plum); border: 1.5px solid var(--plum); box-shadow: none; }
.btn--ghost:hover { background: rgba(161, 95, 160, .10); }
.btn--sm { padding: 7px 14px; font-size: 12.5px; }
.btn svg { stroke: currentColor; width: 16px; height: 16px; }

/* ---------- Admin hub ---------- */
.hubgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hubcard {
  position: relative; overflow: hidden; display: block;
  border-radius: var(--r-card); padding: 15px 14px 14px;
  box-shadow: var(--shadow-lg); text-decoration: none; color: #fff;
  background: linear-gradient(140deg, var(--violet-500), var(--violet-700));
}
.hubcard:hover { text-decoration: none; box-shadow: 0 18px 40px rgba(93, 74, 134, .28); }
.hubcard:active { transform: translateY(1px); }
.hubcard::after {
  content: ''; position: absolute; top: -46px; right: -34px;
  width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 255, 255, .15);
}
.hubcard .hic { display: block; font-size: 36px; line-height: 1; margin: 2px 0 9px; position: relative; z-index: 1; }
.hubcard .hic svg { width: 32px; height: 32px; color: #fff; }
.hubcard b {
  display: block; position: relative; z-index: 1;
  font-family: var(--f-display); font-weight: 500; font-size: 16.5px; line-height: 1.2;
}
.hubcard span {
  display: block; position: relative; z-index: 1;
  font-size: 11.5px; line-height: 1.35; margin-top: 3px; color: rgba(255, 255, 255, .9);
}
.hubcard .hubcard__count {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  min-width: 23px; height: 23px; padding: 0 6px; margin: 0;
  border-radius: var(--r-pill); background: #fff; color: var(--violet-700);
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

/* one tone per card, keyed to its glyph */
.hubcard--sun    { background: linear-gradient(140deg, #f5943c 0%, #dd6531 100%); }
.hubcard--sky    { background: linear-gradient(140deg, #5b8ad4 0%, #33559f 100%); }
.hubcard--teal   { background: linear-gradient(140deg, #3fae9a 0%, #21776b 100%); }
.hubcard--indigo { background: linear-gradient(140deg, #7b7fd4 0%, #474894 100%); }
.hubcard--green  { background: linear-gradient(140deg, #4fb877 0%, #2c8350 100%); }
.hubcard--plum   { background: linear-gradient(140deg, #a95faa 0%, #6c4180 100%); }
.hubcard--gold   { background: linear-gradient(140deg, #eda32c 0%, #c37118 100%); }

/* ---------- Flash & toast ---------- */
.flash { border-radius: var(--r-in); padding: 12px 15px; font-size: 13.5px; font-weight: 700; margin: 0 0 14px; }
.flash--ok    { background: var(--ok-bg);   color: var(--ok-ink); }
.flash--error { background: var(--err-bg);  color: var(--err-ink); }
.flash--info  { background: var(--info-bg); color: var(--info-ink); }
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-lg);
  z-index: 60; max-width: 88vw;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
html[data-theme="dark"] .toast { background: #efe9f6; color: #1a1226; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .toast { background: #efe9f6; color: #1a1226; } }

/* ---------- Auth pages: log in under the dawn ---------- */
.authpage {
  min-height: 100vh; min-height: 100dvh;
  background: var(--sky);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(26px + env(safe-area-inset-top, 0px)) 18px 40px;
}
.authwrap { width: 100%; max-width: 420px; }
.authhead { text-align: center; color: var(--on-sky); margin-bottom: 20px; }
.authhead img { width: 74px; height: auto; border-radius: 18px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.authhead__name { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin-top: 12px; }
.authhead__sub { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-eyebrow); margin-top: 3px; }
.authcard {
  background: var(--card);
  border-radius: 24px;
  padding: 24px 22px;
  box-shadow: var(--shadow-lg);
}
.authlinks { text-align: center; margin-top: 16px; font-size: 13.5px; }
.authlinks a { color: var(--plum); }
.authpage .authlinks--sky a { color: #fff; }
.langswitch--auth { background: rgba(255, 255, 255, .22); margin: 0 auto 16px; width: fit-content; }

/* ---------- iOS install banner ---------- */
.iosbanner {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
.iosbanner__card {
  max-width: 540px; margin: 0 auto;
  background: var(--card); border-radius: 20px 20px 24px 24px;
  box-shadow: 0 -8px 40px rgba(60, 45, 69, .3);
  padding: 16px 18px;
}
.iosbanner__title { font-family: var(--f-display); font-weight: 500; font-size: 16px; margin: 0 0 6px; }
.iosbanner__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }


/* row-list button (logout) */
.rowbtn { all: unset; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; font: inherit; color: inherit; font-weight: 700; }
.rowbtn:focus-visible { outline: 3px solid var(--sun-500); outline-offset: 2px; border-radius: 8px; }

/* small utilities used by pages (keeps the CSP inline-free) */
.tba { color: var(--ink-mute); font-size: 13px; margin: 0; }
.help--lead { margin: 0 0 12px; }
.help--under { margin: -2px 6px 10px; }
.editlink { margin: 0 4px 10px; }
.pgh--gap { padding-top: 14px; }
.h-sm { font-size: 19px; }
.formrow--3 { grid-template-columns: 1.2fr 1fr .9fr; }
@media (max-width: 420px) { .formrow--3 { grid-template-columns: 1fr; } }

/* password visibility toggle */
.pwwrap { position: relative; display: block; }
.pwwrap .pwinput { padding-right: 44px; }
.pwtoggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-mute); cursor: pointer;
  display: grid; place-items: center;
}
.pwtoggle:hover { background: var(--info-bg); color: var(--violet-700); }
.pwtoggle svg { pointer-events: none; }
.pwtoggle .ic + .ic { display: none; }
.pwwrap.is-show .pwtoggle .ic { display: none; }
.pwwrap.is-show .pwtoggle .ic + .ic { display: block; }

/* collapsed compose rows on Mensajes */
.qa--compose .qa__form { padding: 2px 15px 15px; }

/* warm glyph sizing inside the soft icon boxes */
.ric { font-size: 16px; }

/* ---------- Live stream ---------- */
.livebadge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #e74c3c; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--r-pill);
  box-shadow: 0 4px 16px rgba(231, 76, 60, .45);
  margin: 0 0 10px;
}
.livebadge__dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: livepulse 1.5s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
.livecard {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border-left: 5px solid #e74c3c;
  border-radius: var(--r-card); box-shadow: var(--shadow-lg);
  padding: 14px 16px; margin-bottom: 14px;
  color: var(--ink); text-decoration: none;
}
.livecard:hover { text-decoration: none; }
.livecard .livebadge { margin: 0; }
.livecard b { font-family: var(--f-display); font-weight: 500; font-size: 15px; }
.livecard__go { margin-left: auto; color: var(--plum); font-weight: 800; font-size: 13px; }
.video16 { position: relative; width: 100%; padding-bottom: 56.25%; background: #000; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-lg); }
.video16 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chat16 { height: 380px; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); margin-top: 12px; background: var(--card); }
.chat16 iframe { width: 100%; height: 100%; border: 0; }
.countdown--ink { margin: 8px 0 4px; }
.countdown--ink .countdown__num { color: var(--violet-700); }
.countdown--ink .countdown__lbl { color: var(--ink-mute); }
.nav__live {
  position: absolute; top: 2px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #e74c3c; border: 2px solid var(--card);
  animation: livepulse 1.5s infinite;
}
.nav__ico { position: relative; }

/* ---------- Resource viewer ---------- */
.resplayer { width: 100%; border-radius: var(--r-card); background: #000; box-shadow: var(--shadow-lg); display: block; }
.resaudio { width: 100%; display: block; }
.resimg { width: 100%; border-radius: var(--r-card); box-shadow: var(--shadow); display: block; }
.respdf { width: 100%; height: 72vh; border: 0; border-radius: var(--r-card); box-shadow: var(--shadow); background: var(--card); }

/* ---------- Upload progress bar ---------- */
.upwrap { margin: 0 0 12px; }
.upbar {
  height: 9px; border-radius: var(--r-pill);
  background: var(--line); overflow: hidden;
}
.upbar__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--sun-500), var(--coral));
  border-radius: var(--r-pill);
  transition: width .25s ease;
}
.upbar__label { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--ink-mute); }

/* ---------- Link resource preview ---------- */
.linkcard {
  display: block; background: var(--card);
  border-radius: var(--r-card); box-shadow: var(--shadow);
  overflow: hidden; color: var(--ink); text-decoration: none;
}
.linkcard:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.linkcard__img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.linkcard__body { padding: 14px 16px; display: grid; gap: 5px; }
.linkcard__site { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.linkcard b { font-family: var(--f-display); font-weight: 500; font-size: 16px; line-height: 1.35; }
.linkcard__desc { font-size: 13.5px; line-height: 1.5; color: var(--ink-mute); }


/* ---------- Home shortcut tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 18px; }
.tile {
  position: relative; overflow: hidden; display: block;
  min-height: 116px; padding: 15px 14px 14px;
  border-radius: var(--r-card); color: #fff; text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.tile:hover { text-decoration: none; box-shadow: 0 18px 40px rgba(93, 74, 134, .28); }
.tile:active { transform: translateY(1px); }
.tile::after {
  content: ''; position: absolute; top: -46px; right: -34px;
  width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.tile__glyph { display: block; font-size: 28px; line-height: 1; margin-bottom: 9px; position: relative; z-index: 1; }
.tile b {
  display: block; position: relative; z-index: 1;
  font-family: var(--f-display); font-weight: 500; font-size: 15px; line-height: 1.22;
}
.tile__sub {
  display: block; position: relative; z-index: 1;
  margin-top: 3px; font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, .88);
}
.tile--pray { background: linear-gradient(140deg, #f4a04a 0%, #e0797f 100%); }
.tile--qa   { background: linear-gradient(140deg, #8a5f9e 0%, #5d4a86 100%); }

/* ---------- Q & A typographic glyph ---------- */
.ric--qa { font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: 1px; }
.tile__glyph--qa { font-family: var(--f-display); font-weight: 600; font-size: 30px; letter-spacing: 4px; }

/* ---------- Image lightbox ---------- */
.zoomable { cursor: zoom-in; }
body.noscroll { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  display: none; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 46px) 16px calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: rgba(28, 18, 38, .94);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.lightbox__close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 14px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .2); color: #fff;
  font-size: 25px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}

/* ---------- Profile / guest menu rows ---------- */
.prowform { margin: 0; }
.prow {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 15px 16px 15px 20px; margin: 0 0 10px;
  border: 0; border-radius: var(--r-card);
  background: var(--card); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; text-align: left;
  font-family: inherit; cursor: pointer;
}
.prow:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.prow:active { transform: translateY(1px); }
.prow::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--prow-bar, var(--line));
}
.prow::after {
  content: ''; position: absolute; top: -56px; right: -34px;
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--prow-glow, transparent);
}
.prow__ic { flex: 0 0 auto; font-size: 30px; line-height: 1; position: relative; z-index: 1; }
.prow__ic svg { width: 26px; height: 26px; }
.prow__txt { flex: 1; position: relative; z-index: 1; }
.prow__txt b {
  display: block; font-family: var(--f-display); font-weight: 500;
  font-size: 15.5px; line-height: 1.25;
}
.prow__txt small {
  display: block; margin-top: 2px;
  font-size: 11.5px; font-weight: 600; line-height: 1.35; color: var(--ink-mute);
}
.prow__chev { margin-left: auto; color: var(--ink-mute); position: relative; z-index: 1; display: grid; }

.prow--violet { --prow-bar: linear-gradient(180deg, #a074bb, #5d4a86); --prow-glow: rgba(138, 95, 158, .15); }
.prow--sky    { --prow-bar: linear-gradient(180deg, #6d9fe0, #33559f); --prow-glow: rgba(91, 138, 212, .15); }
.prow--gold   { --prow-bar: linear-gradient(180deg, #f6c04a, #d1791a); --prow-glow: rgba(237, 163, 44, .16); }
.prow--coral  { --prow-bar: linear-gradient(180deg, #f08a8a, #d0524f); --prow-glow: rgba(224, 121, 127, .16); }
.prow--dusk   { --prow-bar: linear-gradient(180deg, #b0a3bd, #7d6f8b); --prow-glow: rgba(169, 156, 181, .13); }

/* ---------- Two-step login screen ---------- */
.lsr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.lpanel { display: none; }
#lm-pick:checked   ~ .lpanel--pick,
#lm-member:checked ~ .lpanel--member,
#lm-guest:checked  ~ .lpanel--guest { display: block; }

.lpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lcard {
  position: relative; overflow: hidden; display: block;
  padding: 18px 14px 16px; border-radius: var(--r-card);
  color: #fff; cursor: pointer; box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent;
}
.lcard:active { transform: translateY(1px); }
.lcard::after {
  content: ''; position: absolute; top: -46px; right: -34px;
  width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.lcard__ic { display: block; font-size: 30px; line-height: 1; margin-bottom: 10px; position: relative; z-index: 1; }
.lcard b {
  display: block; position: relative; z-index: 1;
  font-family: var(--f-display); font-weight: 500; font-size: 16.5px; line-height: 1.2;
}
.lcard__sub {
  display: block; margin-top: 4px; position: relative; z-index: 1;
  font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, .9);
}
.lcard--member { background: linear-gradient(140deg, #8a5f9e 0%, #5d4a86 100%); }
.lcard--guest  { background: linear-gradient(140deg, #f5943c 0%, #dd6531 100%); }

#lm-member:focus-visible ~ .lpanel--pick .lcard--member,
#lm-guest:focus-visible  ~ .lpanel--pick .lcard--guest { outline: 3px solid var(--sun-300); outline-offset: 3px; }

.lback {
  display: inline-block; margin: 0 0 6px;
  color: var(--plum); font-weight: 800; font-size: 13.5px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lback:hover { color: var(--violet-700); }

/* ---------- Native date/time controls: never overflow their card ---------- */
.input[type="date"], .input[type="time"], .input[type="month"], .input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-width: 0; display: block;
  min-height: 46px;
}
::-webkit-date-and-time-value { text-align: left; }
.field { min-width: 0; }

/* ---------- Program editor: spreadsheet layout on wide screens ---------- */
.proghead { display: none; }
.rm-x { display: none; }

@media (min-width: 980px) {
  .proghead {
    display: grid;
    grid-template-columns: 180px 1.2fr 1.2fr 1fr 1.1fr 44px;
    gap: 0 14px;
    padding: 0 16px 8px 16px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: var(--ink-mute);
  }
  .progrow {
    display: grid;
    grid-template-columns: 180px 1.2fr 1.2fr 1fr 1.1fr 44px;
    gap: 0 14px;
    align-items: start;
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .progrow > .svc-c { min-width: 0; }
  .progrow .field { margin-bottom: 8px; }
  .progrow .field:last-child { margin-bottom: 0; }
  /* the header row carries the labels; hide the per-field ones */
  .progrow .field > label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .svc-c--x { justify-self: end; }
  .svc-c--x .btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
  .rm-x { display: block; font-size: 19px; line-height: 1; }
  .rm-txt { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* The program editor breaks out of the phone column on big screens.
   (:has is supported by all current browsers; older ones just keep
   the centered layout, which still works.) */
@media (min-width: 980px) {
  .page:has(#progRows) {
    max-width: 1500px;
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* ---------- Program export bar ---------- */
.expbar { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.expbar__grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.expbar__lbl { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.input--sm { min-height: 36px; padding: 6px 10px; width: auto; font-size: 13.5px; }

/* ---------- Language switch (login / auth screens) ---------- */
.langswitch { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); }
.langswitch a {
  display: block; padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 800; letter-spacing: .08em; line-height: 1;
  color: rgba(255, 255, 255, .85); text-decoration: none;
}
.langswitch a:hover { color: #fff; text-decoration: none; }
.langswitch a.is-on { background: #fff; color: var(--violet-700); }

/* ---------- Logo: white mark in dark mode ---------- */
.logo-dk { display: none; }
html[data-theme="dark"] .logo-lt { display: none; }
html[data-theme="dark"] .logo-dk { display: inline-block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .logo-lt { display: none; }
  html[data-theme="auto"] .logo-dk { display: inline-block; }
}
.homehead .brand img.logo-dk { width: auto; height: 21px; border-radius: 0; }
.authhead img.logo-dk { width: 84px; height: auto; border-radius: 0; box-shadow: none; }

/* ---------- Document card (resource viewer) ---------- */
.doccard { text-align: center; padding: 28px 18px 20px; }
.doccard__ic { margin: 0 0 10px; font-size: 46px; line-height: 1; }
.doccard__name {
  display: block; font-family: var(--f-display); font-weight: 500;
  font-size: 15.5px; line-height: 1.3; word-break: break-word;
}
.doccard__hint { margin: 6px 0 16px; }
.doccard__btns { display: grid; gap: 10px; max-width: 340px; margin: 0 auto; }
.doccard__ios { margin: 12px auto 0; max-width: 340px; }

/* ---------- Avatar menu (home header) ---------- */
.avwrap { position: relative; }
.avbtn { display: block; text-decoration: none; }
.avbtn:hover { text-decoration: none; }
.avmenu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 90;
  width: min(288px, calc(100vw - 28px));
  background: var(--card); border-radius: var(--r-card);
  box-shadow: var(--shadow-lg); padding: 8px;
}
.avmenu__who {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.avmenu__who:hover { text-decoration: none; }
.avmenu__who b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 15px; line-height: 1.2; }
.avmenu__who small { display: block; font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; }
.avmenu__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px; border: 0; background: none;
  border-radius: 12px; color: var(--ink); text-decoration: none;
  font-family: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.avmenu__item:hover { background: var(--card-2); text-decoration: none; }
.avmenu__ic { width: 24px; font-size: 19px; line-height: 1; text-align: center; flex: 0 0 24px; }
.avmenu__ic--power { display: grid; place-items: center; color: var(--coral); }
.avmenu__item--out { color: var(--coral); }
.avmenu__form { margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }

/* Power tint for the profile/guest logout rows */
.prow__ic--power { color: var(--coral); }

/* ---------- Inline PDF viewer ---------- */
.pdfview__status {
  text-align: center; padding: 20px 0; font-size: 13px; font-weight: 700;
  color: var(--ink-mute); animation: pdfpulse 1.2s ease-in-out infinite;
}
@keyframes pdfpulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.pdfview__pages { display: grid; gap: 12px; }
.pdfpage { background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; min-height: 60px; }
.pdfpage canvas { display: block; width: 100%; height: auto; }

/* Once the document is inline, the card shrinks to a download bar */
.doccard.is-inline { margin-top: 14px; padding: 14px 16px 12px; }
.doccard.is-inline .doccard__ic,
.doccard.is-inline .doccard__name,
.doccard.is-inline .doccard__hint,
.doccard.is-inline .js-ext { display: none; }

/* ============================================================
   Blog pastoral (list, post, admin editor) + user dashboard
   ============================================================ */

/* ---------- Blog list ---------- */
.bcard { display: block; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; }
.bcard:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.bcard__img { display: block; aspect-ratio: 16 / 9; background: var(--info-bg); }
.bcard__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bcard__body { display: block; padding: 14px 17px 16px; }
.bcard__date { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--plum); }
.bcard__title { display: block; font-family: var(--f-display); font-weight: 500; font-size: 17px; line-height: 1.25; margin: 4px 0 6px; }
.bcard__exc { display: block; font-size: 13.5px; color: var(--ink-soft); }
.bcard__more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--plum); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 0; }
.pager__pos { font-size: 12.5px; font-weight: 800; color: var(--ink-mute); }
.rowlist .ric--img { overflow: hidden; background: var(--line); }
.rowlist .ric--img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Blog post ---------- */
.bpost { padding: 0 0 16px; overflow: hidden; }
.bpost__cover { aspect-ratio: 16 / 9; background: var(--info-bg); }
.bpost__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bpost .pgh { padding: 14px 17px 4px; }
.bpost__body { padding: 0 17px; font-size: 15px; line-height: 1.7; color: var(--ink); }
.bpost__body p { margin: 0 0 1em; }
.bpost__body h2, .bpost__body h3 { font-family: var(--f-display); font-weight: 500; color: var(--violet-700); margin: 1.2em 0 .5em; }
.bpost__body h2 { font-size: 19px; }
.bpost__body h3 { font-size: 16.5px; }
html[data-theme="dark"] .bpost__body h2, html[data-theme="dark"] .bpost__body h3 { color: var(--info-ink); }
.bpost__body blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 4px solid var(--plum); background: var(--card-2); border-radius: 0 var(--r-in) var(--r-in) 0; font-style: italic; color: var(--ink-soft); }
.bpost__body ul, .bpost__body ol { margin: 0 0 1em 22px; padding: 0; }
.bpost__body a { text-decoration: underline; }
.bpost__body img { display: block; max-width: 100%; height: auto; border-radius: var(--r-in); margin: 0 0 1em; }
.bpost__body hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.bpost__body .post-video { position: relative; padding-bottom: 56.25%; height: 0; margin: 0 0 1em; border-radius: var(--r-in); overflow: hidden; background: #000; }
.bpost__body .post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bpost__actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 17px 0; }

/* ---------- Rich-text editor (admin) ---------- */
.rte { border: 1.5px solid var(--line); border-radius: var(--r-in); background: var(--card); overflow: hidden; }
.rte:focus-within { border-color: var(--plum); box-shadow: 0 0 0 3px rgba(161, 95, 160, .18); }
.rte__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.rte__btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; background: transparent; border-radius: 9px;
  padding: 7px 8px; font: inherit; font-size: 12px; font-weight: 800; color: var(--ink-soft); cursor: pointer; line-height: 1;
}
.rte__btn:hover { background: var(--info-bg); color: var(--info-ink); }
.rte__btn.is-on { background: var(--violet-700); border-color: var(--violet-700); color: #fff; }
.rte__btn[data-cmd="clear"] { margin-left: auto; }
.rte__btn[data-cmd="clear"] .rte__lbl { display: none; }
.rte__glyph { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; font-size: 14px; }
.rte__area { min-height: 220px; max-height: 60vh; overflow: auto; padding: 14px 15px; outline: none; font-size: 15px; line-height: 1.65; color: var(--ink); position: relative; }
.rte__area.is-empty::before { content: attr(data-placeholder); position: absolute; top: 14px; left: 15px; color: var(--ink-mute); pointer-events: none; }
.rte__area p { margin: 0 0 .9em; }
.rte__area h2, .rte__area h3 { font-family: var(--f-display); font-weight: 500; color: var(--violet-700); margin: 1em 0 .4em; }
html[data-theme="dark"] .rte__area h2, html[data-theme="dark"] .rte__area h3 { color: var(--info-ink); }
.rte__area h2 { font-size: 19px; }
.rte__area h3 { font-size: 16.5px; }
.rte__area blockquote { margin: 0 0 .9em; padding: 8px 12px; border-left: 4px solid var(--plum); background: var(--card-2); border-radius: 0 var(--r-in) var(--r-in) 0; font-style: italic; color: var(--ink-soft); }
.rte__area ul, .rte__area ol { margin: 0 0 .9em 22px; padding: 0; }
.rte__area a { text-decoration: underline; }
.rte__area img { max-width: 100%; height: auto; border-radius: var(--r-in); }
.rte__area .post-video { position: relative; padding-bottom: 56.25%; height: 0; margin: 4px 0 .9em; border-radius: var(--r-in); overflow: hidden; background: #000; outline: 3px solid transparent; }
.rte__area .post-video:hover { outline-color: var(--plum); }
.rte__area .post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
@media (max-width: 480px) { .rte__lbl { display: none; } .rte__btn { padding: 9px 10px; } }
.cover-preview { margin-top: 10px; border-radius: var(--r-in); overflow: hidden; background: var(--card-2); }
.cover-preview img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.hubcard--coral { background: linear-gradient(140deg, #e0797f 0%, #b24a5c 100%); }

/* ---------- User dashboard ---------- */
.alertcard {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 12px 14px; border-radius: var(--r-card); color: #fff; text-decoration: none;
  background: linear-gradient(120deg, var(--sun-500), var(--coral)); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 700;
}
.alertcard:hover { text-decoration: none; }
.alertcard__n { min-width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-family: var(--f-display); font-size: 17px; }
.alertcard__go { font-weight: 800; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat {
  position: relative; overflow: hidden; padding: 13px 14px 12px;
  border-radius: var(--r-card); color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(140deg, var(--violet-500), var(--violet-700));
}
.stat::after { content: ''; position: absolute; top: -40px; right: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.stat b { display: block; position: relative; z-index: 1; font-family: var(--f-display); font-weight: 500; font-size: 30px; line-height: 1; }
.stat span { display: block; position: relative; z-index: 1; margin-top: 5px; font-size: 12px; font-weight: 800; line-height: 1.25; }
.stat small { display: block; position: relative; z-index: 1; margin-top: 3px; font-size: 11px; font-weight: 700; opacity: .85; }
.stat--sun   { background: linear-gradient(140deg, #f5943c 0%, #dd6531 100%); }
.stat--teal  { background: linear-gradient(140deg, #3fae9a 0%, #21776b 100%); }
.stat--sky   { background: linear-gradient(140deg, #5b8ad4 0%, #33559f 100%); }
.stat--muted { background: var(--card); color: var(--ink); box-shadow: none; border: 1.5px solid var(--line); }
.stat--muted::after { display: none; }
.stat--muted span { color: var(--ink-mute); }
.sectionhead--in { margin: 0 0 6px; }
.sectionhead--in h3 { margin: 0; }
.bars { display: block; width: 100%; height: 150px; }
.bars__bar { fill: var(--plum); }
.bars__bar--zero { fill: var(--line); }
.bars__val { font-family: var(--f-body); font-weight: 800; font-size: 24px; fill: var(--ink-soft); }
.bars__lbl { font-family: var(--f-body); font-weight: 700; font-size: 21px; fill: var(--ink-mute); }
.rowlist .pill { flex: 0 0 auto; white-space: nowrap; }
.gh--in { margin: 4px 0 6px; }
.gh--in + .chips { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info-ink); font-size: 12px; font-weight: 700; }
.chip b { font-weight: 800; background: var(--card); color: var(--violet-700); border-radius: var(--r-pill); padding: 1px 7px; }
html[data-theme="dark"] .chip b { color: var(--info-ink); }
.changelog > li { font-size: 13px; line-height: 1.5; }
.changelog small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); }
.changelog s { text-decoration: line-through; }

/* ============================================================
   Ministries + Grupo de Alabanza + Atril admin (appended)
   ============================================================ */
.av--sm { width: 30px; height: 30px; font-size: 11.5px; }
h1 > small.eyebrow { display: block; margin-bottom: 4px; }
.checkset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.checkset legend { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
.checkset .check { margin-bottom: 8px; }

/* accordion card (ministries) */
.acc { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.acc > summary { list-style: none; cursor: pointer; padding: 13px 15px; display: flex; align-items: center; gap: 12px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::marker { content: ""; }
.acc__ic { width: 36px; height: 36px; border-radius: 12px; background: var(--info-bg); display: grid; place-items: center; font-size: 17px; flex: 0 0 36px; }
.acc__txt { flex: 1; min-width: 0; }
.acc__txt b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 15.5px; }
.acc__txt small { font-size: 11.5px; font-weight: 700; color: var(--ink-mute); }
.acc__arr { color: var(--ink-mute); transition: .2s; }
.acc[open] > summary .acc__arr { transform: rotate(90deg); }
.acc__in { padding: 2px 15px 15px; }
.rowlist li > .grow { min-width: 0; }
.rowlist li > .grow a { display: inline; color: var(--ink); }
.rowlist li > .grow a.btn { display: inline-flex; color: #fff; margin-top: 7px; }
.rowlist li > .grow a.btn--ghost { color: var(--plum); }

/* home entry */
.wtile {
  display: flex; align-items: center; gap: 13px; margin: -6px 0 18px; padding: 13px 15px;
  border-radius: var(--r-card); color: #fff; text-decoration: none; box-shadow: var(--shadow-lg);
  background: linear-gradient(120deg, #5d4a86 0%, #a15fa0 55%, #e0797f 100%);
}
.wtile:hover { text-decoration: none; filter: brightness(1.04); }
.wtile__glyph { font-size: 25px; line-height: 1; }
.wtile__txt { flex: 1; min-width: 0; }
.wtile__txt b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 15.5px; }
.wtile__txt span { display: block; font-size: 12px; color: rgba(255, 255, 255, .9); }
.wtile__chev { opacity: .85; display: grid; }

/* month grid */
.wcal { padding: 13px 13px 10px; }
.wcal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.wcal__dow { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--ink-mute); padding-bottom: 3px; }
.wcal__day { display: grid; place-items: center; height: 34px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-mute); text-decoration: none; }
.wcal__day.has { background: var(--info-bg); color: var(--info-ink); font-weight: 800; }
.wcal__day.mine { background: linear-gradient(140deg, var(--sun-300), var(--sun-500)); color: #5a3a10; }
.wcal__day.today { box-shadow: inset 0 0 0 2px var(--plum); }
a.wcal__day:hover { text-decoration: none; filter: brightness(.97); }
.wcal__key { margin: 9px 2px 0; font-size: 11px; font-weight: 700; color: var(--ink-mute); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wcal__dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.wcal__dot--has { background: var(--info-bg); border: 1px solid var(--line); }
.wcal__dot--mine { background: var(--sun-500); margin-left: 10px; }

/* calendar timeline */
.tl .is-wsh summary .tic { background: var(--sun-soft); }
.wnote { font-style: italic; }
.wsg { padding: 9px 0; border-bottom: 1px solid var(--line); }
.wsg:last-of-type { border-bottom: 0; }
.wsg__who { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 800; color: var(--ink); text-decoration: none; }
.wsg__who.is-you { color: var(--plum); }
.wsg__who:hover { text-decoration: none; }
.wsg__edit { font-size: 11.5px; font-weight: 800; color: var(--plum); white-space: nowrap; }
.wsg__none { font-size: 12px; color: var(--ink-mute); margin: 3px 0 0; }
.wsg__btn { margin-top: 9px; }
.wsongs { margin: 5px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.wkey { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 7px; border-radius: var(--r-pill); background: var(--sun-soft); color: var(--ink-soft); white-space: nowrap; vertical-align: 1px; }
.wkey--lg { font-size: 14px; padding: 5px 13px; }
.wmore { margin: 10px 0 0; font-size: 12.5px; font-weight: 800; text-align: right; }

/* a date in full */
.wday__head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.wday__head b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 15.5px; }
.wday__head small { font-size: 11.5px; font-weight: 700; color: var(--ink-mute); }
.wsong { border-top: 1px solid var(--line); }
.wsong > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.wsong > summary::-webkit-details-marker { display: none; }
.wsong > summary::marker { content: ""; }
.wsong__n { width: 24px; height: 24px; border-radius: 50%; background: var(--info-bg); color: var(--info-ink); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex: 0 0 24px; }
.wsong__t { flex: 1; min-width: 0; }
.wsong__t b { display: block; font-size: 14px; font-weight: 800; }
.wsong__t small { font-size: 11.5px; color: var(--ink-mute); font-weight: 600; }
.wsong__yt { font-size: 11px; color: var(--coral); }
.wsong .arr { color: var(--ink-mute); transition: .2s; display: grid; }
.wsong[open] > summary .arr { transform: rotate(90deg); }
.wsong__in { padding: 0 0 14px 34px; }
.wlyrics { font-size: 14px; line-height: 1.6; color: var(--ink-soft); margin: 0; }

/* list editor */
.wedit { list-style: none; margin: 0; padding: 0; }
.wedit > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.wedit > li:last-child { border-bottom: 0; }
.wedit__n { width: 26px; height: 26px; border-radius: 50%; background: var(--violet-700); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: 0 0 26px; }
.wedit__t { flex: 1 1 150px; min-width: 0; }
.wedit__t a { font-weight: 800; font-size: 14px; color: var(--ink); }
.wedit__t small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); }
.wedit__warn { color: var(--coral) !important; }
.wedit__f { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.wedit__key { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--ink-mute); }
.wedit__key .input--sm { padding-right: 28px; }
.wbtn { all: unset; box-sizing: border-box; width: 34px; height: 34px; border-radius: 11px; background: var(--info-bg); color: var(--info-ink); font-size: 12px; display: grid; place-items: center; cursor: pointer; }
.wbtn:hover { filter: brightness(.96); }
.wbtn:focus-visible { outline: 3px solid var(--sun-500); outline-offset: 2px; }
.wbtn[disabled] { opacity: .35; cursor: default; }
.wbtn--x { background: var(--err-bg); color: var(--err-ink); font-weight: 800; }
.wdup { border: 2px solid var(--sun-500); }
.wpick li { font-weight: 700; }
.wnew > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: var(--plum); }
.wnew > summary::-webkit-details-marker { display: none; }
.wnew > summary::marker { content: ""; }
.wnew > summary svg { width: 16px; height: 16px; }

/* a song */
.wsonghead { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; }
.wsonghead h1 { margin-bottom: 2px; }
.wsonghead__by { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-mute); }

/* calendar editor */
.wadm__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.wadm__head b { font-family: var(--f-display); font-weight: 500; font-size: 16px; }
/* its month: every day can be chosen; the chosen one is filled */
.wpick { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 10px); }
.wcal--pick .wcal__grid { gap: 5px; }
.wcal--pick .wcal__day { height: 42px; font-size: 14.5px; color: var(--ink); }
.wcal--pick .wcal__day.past { color: var(--ink-mute); }
.wcal--pick .wcal__day.has { color: var(--info-ink); }
.wcal--pick .wcal__day.sel { background: var(--violet-700); color: #fff; box-shadow: 0 5px 12px rgba(93, 74, 134, .3); }
/* dark theme: on this calendar the days that have a date stand out more (the default tint is close to the card) */
html[data-theme="dark"] .wcal--pick .wcal__day.has:not(.sel) { background: #42356b; color: #fff; box-shadow: inset 0 0 0 1px #8672c2; }
html[data-theme="dark"] .wcal--pick .wcal__day.has.today:not(.sel) { box-shadow: inset 0 0 0 2px var(--plum); }
html[data-theme="dark"] .wcal--pick .wcal__dot--has { background: #42356b; border-color: #8672c2; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .wcal--pick .wcal__day.has:not(.sel) { background: #42356b; color: #fff; box-shadow: inset 0 0 0 1px #8672c2; }
  html[data-theme="auto"] .wcal--pick .wcal__day.has.today:not(.sel) { box-shadow: inset 0 0 0 2px var(--plum); }
  html[data-theme="auto"] .wcal--pick .wcal__dot--has { background: #42356b; border-color: #8672c2; }
}
.wcal__hint { margin: 7px 2px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.wday .sectionhead { margin-top: 16px; }

/* Atril admin */
.wtoken { border: 2px solid var(--sun-500); }
.wtoken__val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.wsteps { margin: 12px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }