/* SVD Prayer App
   Layout: sticky header + persistent nav (bottom bar on phones, top row on desktop),
   a reading column of ~38rem, and a prayer index sidebar from 1000px up.
   Pattern tiles are small geometric motifs after Sepik and bilum weaving, used only as mask shapes. */

:root {
  --bg: #F3F8FC;
  --bg-2: #E7F0F8;
  --surface: #FFFFFF;
  --line: #D3E3F0;
  --ink: #1B2F46;
  --ink-2: #4A627A;
  --brand: #2B5E8E;
  --on-brand: #FFFFFF;
  --sky: #C4DEF2;
  --lagoon: #C3E6DF;
  --peach: #F9D9C8;
  --sun: #F8E7B5;
  --coral: #E58D70;
  --tag-lead: #CFE4F5;
  --tag-all: #F9D8C6;
  --pat: rgba(43, 94, 142, .30);
  --shadow: 0 1px 2px rgba(27, 47, 70, .06), 0 10px 26px -14px rgba(27, 47, 70, .28);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-read: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif", Georgia, serif;
  --scale: 1;
  --gutter: 16px;
  --nav-h: 64px;
  --top-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101C29;
    --bg-2: #162636;
    --surface: #1A2B3D;
    --line: #2B435B;
    --ink: #E6EFF7;
    --ink-2: #A3B9CC;
    --brand: #8EC5F0;
    --on-brand: #0E2033;
    --sky: #2A4763;
    --lagoon: #234A4C;
    --peach: #4D3B38;
    --sun: #4B4530;
    --coral: #F0A58B;
    --tag-lead: #2C4D6D;
    --tag-all: #5B4139;
    --pat: rgba(142, 197, 240, .30);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101C29;
  --bg-2: #162636;
  --surface: #1A2B3D;
  --line: #2B435B;
  --ink: #E6EFF7;
  --ink-2: #A3B9CC;
  --brand: #8EC5F0;
  --on-brand: #0E2033;
  --sky: #2A4763;
  --lagoon: #234A4C;
  --peach: #4D3B38;
  --sun: #4B4530;
  --coral: #F0A58B;
  --tag-lead: #2C4D6D;
  --tag-all: #5B4139;
  --pat: rgba(142, 197, 240, .30);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-display);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

img, svg { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 8px; }

/* ---------- pattern tiles (mask shapes) ---------- */

.pat { display: block; background: var(--pat); -webkit-mask-repeat: repeat; mask-repeat: repeat; }
.pat-spirit { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28' viewBox='0 0 32 28'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M16 2 30 26H2z'/%3E%3C/g%3E%3Cpath d='M16 10l5.5 11h-11z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28' viewBox='0 0 32 28'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M16 2 30 26H2z'/%3E%3C/g%3E%3Cpath d='M16 10l5.5 11h-11z'/%3E%3C/svg%3E"); -webkit-mask-size: 32px 28px; mask-size: 32px 28px; }
.pat-daily { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M16 2 30 16 16 30 2 16z'/%3E%3Cpath d='M16 9l7 7-7 7-7-7z'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M16 2 30 16 16 30 2 16z'/%3E%3Cpath d='M16 9l7 7-7 7-7-7z'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='2'/%3E%3C/svg%3E"); -webkit-mask-size: 32px 32px; mask-size: 32px 32px; }
.pat-mary { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 12 12 0l12 12-12 12z' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='24' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='24' r='1.6'/%3E%3Ccircle cx='24' cy='24' r='1.6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 12 12 0l12 12-12 12z' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='24' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='24' r='1.6'/%3E%3Ccircle cx='24' cy='24' r='1.6'/%3E%3C/svg%3E"); -webkit-mask-size: 24px 24px; mask-size: 24px 24px; }
.pat-saints { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16'%3E%3Cpath d='M0 6 12 0l12 6M0 14l12-6 12 6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16'%3E%3Cpath d='M0 6 12 0l12 6M0 14l12-6 12 6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); -webkit-mask-size: 24px 16px; mask-size: 24px 16px; }
.pat-mission { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='18' viewBox='0 0 32 18'%3E%3Cpath d='M0 7q8-9 16 0t16 0' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='15' r='1.6'/%3E%3Ccircle cx='24' cy='15' r='1.6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='18' viewBox='0 0 32 18'%3E%3Cpath d='M0 7q8-9 16 0t16 0' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='15' r='1.6'/%3E%3Ccircle cx='24' cy='15' r='1.6'/%3E%3C/svg%3E"); -webkit-mask-size: 32px 18px; mask-size: 32px 18px; }
.pat-eucharist { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='9' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Ccircle cx='13' cy='13' r='3.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='9' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Ccircle cx='13' cy='13' r='3.2'/%3E%3C/svg%3E"); -webkit-mask-size: 26px 26px; mask-size: 26px 26px; }
.pat-confreres { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 6v12M6 12h12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 6v12M6 12h12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); -webkit-mask-size: 24px 24px; mask-size: 24px 24px; }
.pat-mine { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 3l3 8 8 3-8 3-3 8-3-8-8-3 8-3z' stroke='%23000' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 3l3 8 8 3-8 3-3 8-3-8-8-3 8-3z' stroke='%23000' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E"); -webkit-mask-size: 28px 28px; mask-size: 28px 28px; }
.pat-band { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'%3E%3Cpath d='M0 8 6 2l6 6 6-6 6 6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='2' r='1.2'/%3E%3Ccircle cx='0' cy='2' r='1.2'/%3E%3Ccircle cx='24' cy='2' r='1.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'%3E%3Cpath d='M0 8 6 2l6 6 6-6 6 6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='2' r='1.2'/%3E%3Ccircle cx='0' cy='2' r='1.2'/%3E%3Ccircle cx='24' cy='2' r='1.2'/%3E%3C/svg%3E"); -webkit-mask-size: 24px 10px; mask-size: 24px 10px; }

.band { height: 10px; width: 100%; opacity: .9; }

/* ---------- header ---------- */

#top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.top-row {
  height: var(--top-h);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 1280px;
  margin-inline: auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 12px; }
.brand img { width: 38px; height: 36px; flex: none; }
.brand span { font-weight: 650; font-size: 1.06rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 2px; flex: none; }
.tools .icon-btn { width: auto; min-width: 44px; padding-inline: 10px; gap: 6px; }
.tools .lbl { display: none; font-size: .9rem; font-weight: 550; }
@media (min-width: 520px) { .tools .lbl { display: inline; } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: transparent; border: 0; border-radius: 14px;
  color: var(--ink);
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] svg.heart { fill: var(--coral); stroke: var(--coral); }
.icon-btn[aria-pressed="true"] { color: var(--coral); }

/* nav */
#nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
#nav a, #nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border: 0; background: transparent; border-radius: 16px;
  font-size: .72rem; font-weight: 550; color: var(--ink-2);
}
#nav svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav .on { color: var(--brand); background: var(--sky); }
#nav .on svg { stroke-width: 2.1; }

/* ---------- shell ---------- */

.shell { max-width: 1280px; margin-inline: auto; }
#side { display: none; }
#main { padding: 18px var(--gutter) 40px; outline: 0; min-width: 0; }
.col { max-width: 40rem; margin-inline: auto; display: grid; gap: 22px; }

@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  #nav {
    position: fixed; top: env(safe-area-inset-top, 0px); bottom: auto; left: 50%; right: auto;
    transform: translateX(-50%);
    height: var(--top-h); align-items: center; z-index: 35;
    display: flex; gap: 4px; padding: 0; border: 0; background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  #nav a, #nav button { flex-direction: row; gap: 8px; min-height: 42px; padding: 0 14px; font-size: .94rem; }
  #nav .nav-prayers { display: none; }
  .top-row { display: grid; grid-template-columns: 1fr auto 1fr; }
  .tools { grid-column: 3; justify-self: end; }
  .shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 8px; }
  #side {
    display: block;
    position: sticky; top: calc(var(--top-h) + 10px + env(safe-area-inset-top, 0px));
    align-self: start;
    max-height: calc(100vh - var(--top-h) - 24px);
    overflow: auto;
    margin: 12px 0 12px var(--gutter);
    padding: 14px 8px 14px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
  }
  #main { padding-top: 28px; padding-inline: 32px; }
}

/* ---------- generic UI ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1.5px solid transparent;
  background: var(--brand); color: var(--on-brand);
  font-weight: 600; font-size: 1rem; text-align: center;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-2); filter: none; }
.btn.soft { background: var(--sky); color: var(--ink); }
.btn.danger { background: transparent; color: #B4452B; border-color: color-mix(in srgb, #B4452B 40%, transparent); }
:root[data-theme="dark"] .btn.danger { color: #F0A58B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #F0A58B; } }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.h-page { font-size: clamp(1.6rem, 5.4vw, 2.2rem); line-height: 1.12; }
.h-sec { font-size: 1.2rem; line-height: 1.2; }
.lede { color: var(--ink-2); font-size: 1rem; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.crumb { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 6px; margin-left: -6px; border-radius: 999px; color: var(--brand); font-weight: 600; font-size: .95rem; }
.crumb svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.crumb:hover { background: var(--bg-2); }

.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--sky); color: var(--ink); font-size: .82rem; font-weight: 550; }
.chip.warm { background: var(--peach); }
.chip.green { background: var(--lagoon); }

/* ---------- home ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: 28px;
  padding: 26px 20px 0;
  background:
    radial-gradient(90% 120% at 100% 100%, var(--peach) 0%, transparent 60%),
    linear-gradient(170deg, var(--sky) 0%, color-mix(in srgb, var(--lagoon) 70%, var(--sky)) 100%);
}
.hero-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.hero-badge {
  width: 84px; height: 84px; border-radius: 50%;
  background: #FFFFFF; display: grid; place-items: center;
  box-shadow: 0 8px 22px -10px rgba(27, 47, 70, .45);
}
.hero-badge img { width: 58px; height: 55px; }
.hero h1 { font-size: clamp(1.7rem, 6.4vw, 2.5rem); line-height: 1.04; letter-spacing: -.02em; }
.hero p { color: var(--ink); opacity: .78; margin-top: 6px; font-size: .98rem; }
.search {
  margin-top: 20px; position: relative; display: block;
}
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; stroke: var(--ink-2); fill: none; stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; min-height: 52px; padding: 0 18px 0 48px;
  border-radius: 999px; border: 1.5px solid transparent;
  background: var(--surface); color: var(--ink); font-size: 1rem;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--ink-2); opacity: .85; }
.hero .band { margin-top: 22px; margin-inline: -20px; width: calc(100% + 40px); --pat: rgba(43, 94, 142, .34); background: var(--pat); }
:root[data-theme="dark"] .hero .band { --pat: rgba(142, 197, 240, .3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .band { --pat: rgba(142, 197, 240, .3); } }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  padding: 12px 14px; min-height: 64px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
}
.quick a:hover { border-color: var(--sky); box-shadow: var(--shadow); }
.quick .qi { grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--peach); }
.quick .qi svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick a:nth-child(2) .qi { background: var(--sky); }
.quick a:nth-child(3) .qi { background: var(--lagoon); }
.quick a:nth-child(4) .qi { background: var(--sun); }
.quick b { font-weight: 600; font-size: .96rem; line-height: 1.2; }
.quick small { color: var(--ink-2); font-size: .8rem; line-height: 1.2; }
.quick .wide { grid-column: 1 / -1; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.cat {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px; min-height: 164px; background: var(--c, var(--sky));
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.cat:hover { box-shadow: var(--shadow); }
.cat .pat { height: 64px; flex: none; --pat: color-mix(in srgb, var(--ink) 22%, transparent); }
.cat-body { padding: 12px 16px 16px; display: grid; gap: 4px; align-content: start; }
.cat h3 { font-size: 1.04rem; line-height: 1.18; }
.cat p { font-size: .84rem; line-height: 1.35; color: var(--ink); opacity: .78; }
.cat .n { margin-top: 6px; font-size: .78rem; font-weight: 600; opacity: .8; }

/* ---------- prayer rows ---------- */

.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding-right: 4px;
}
.item:hover { border-color: var(--sky); }
.item .lnk { flex: 1; min-width: 0; padding: 12px 8px 12px 16px; display: grid; gap: 2px; border-radius: 20px; }
.item .t { font-weight: 600; font-size: 1rem; line-height: 1.25; }
.item .m { font-size: .82rem; color: var(--ink-2); }
.item.cur { border-color: var(--brand); background: color-mix(in srgb, var(--sky) 45%, var(--surface)); }

#side h3 { font-size: .92rem; margin: 14px 0 4px 8px; color: var(--ink-2); font-weight: 600; letter-spacing: 0; }
#side h3:first-child { margin-top: 0; }
#side .side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sidelink { display: block; padding: 8px 10px; border-radius: 12px; font-size: .95rem; line-height: 1.3; }
.sidelink:hover { background: var(--bg-2); }
.sidelink.cur { background: var(--sky); font-weight: 600; }

/* ---------- reader ---------- */

.reader { display: grid; gap: 18px; }
.reader-head { display: grid; gap: 10px; }
.reader h1 { font-size: clamp(1.65rem, 5.6vw, 2.3rem); line-height: 1.08; letter-spacing: -.015em; }
.reader-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-inline: -8px; }
.progress { display: grid; gap: 8px; }
.progress .bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.progress .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .35s ease; }
.progress small { color: var(--ink-2); font-size: .85rem; }

.prayer {
  font-family: var(--font-read);
  font-size: calc(1.1875rem * var(--scale));
  line-height: 1.68;
  max-width: 36em;
  display: grid; gap: .95em;
  padding: 4px 0 8px;
  overflow-wrap: break-word;
}
.prayer p { margin: 0; }
.prayer h3 { font-family: var(--font-display); font-size: .9em; font-weight: 650; color: var(--brand); margin-top: .4em; letter-spacing: 0; }
.prayer .note { font-style: italic; color: var(--ink-2); font-size: .92em; line-height: 1.5; }
.prayer .lines { white-space: pre-line; }
.prayer strong { font-weight: 650; }
.dialog { display: grid; gap: .4em; }
.dialog .r { display: grid; grid-template-columns: 1.9em minmax(0, 1fr); gap: .35em; align-items: baseline; }
.dialog .r.lead { font-weight: 600; }
.tag {
  display: inline-grid; place-items: center; width: 1.45em; height: 1.45em;
  border-radius: 50%; font: 700 .64em/1 var(--font-display);
  background: var(--tag-lead); color: var(--ink); transform: translateY(-.12em);
}
.r.all .tag { background: var(--tag-all); }
.legend { display: flex; gap: 14px; align-items: center; font-size: .84rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .tag { font-size: 1rem; width: 1.5em; height: 1.5em; transform: none; }
.legend .tag.all { background: var(--tag-all); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager a { display: grid; gap: 2px; padding: 12px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.pager a:hover { border-color: var(--sky); }
.pager a.next { text-align: right; }
.pager small { color: var(--ink-2); font-size: .78rem; }
.pager b { font-size: .95rem; line-height: 1.25; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.runbar {
  position: sticky; z-index: 25;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 10px; border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (min-width: 1000px) { .runbar { bottom: 16px; } }

.done { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 28px 8px; }
.done .amen { font-family: var(--font-read); font-size: 2.6rem; font-weight: 500; letter-spacing: -.01em; }
.done .pat { width: 180px; height: 28px; }

.empty { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 28px 12px; border: 1.5px dashed var(--line); border-radius: 24px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty .pat { width: 120px; height: 22px; }
.empty h2 { font-size: 1.15rem; }
.empty p { color: var(--ink-2); max-width: 28rem; }

/* ---------- lists ---------- */

.listcard { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 4px 6px 4px 0; }
.listcard a.lnk { padding: 12px 8px 12px 16px; display: grid; gap: 2px; border-radius: 20px; min-width: 0; }
.listcard .t { font-weight: 600; }
.listcard .m { font-size: .82rem; color: var(--ink-2); }
.listcard:hover { border-color: var(--sky); }

.ord { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 2px 4px 2px 0; }
.ord .lnk { flex: 1; min-width: 0; padding: 10px 8px 10px 16px; display: grid; gap: 2px; border-radius: 18px; }
.ord .t { font-weight: 600; line-height: 1.25; }
.ord .m { font-size: .8rem; color: var(--ink-2); }
.ord .icon-btn { width: 40px; height: 40px; }
.ord .icon-btn svg { width: 20px; height: 20px; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }

/* ---------- forms ---------- */

.field { display: grid; gap: 6px; }
.field > label, .field > .lab { font-weight: 600; font-size: .94rem; }
.field input[type="text"], .field input[type="password"], .field input[type="file"], .field select, .field textarea, .inline-form input, .pick-search {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.field textarea { min-height: 220px; resize: vertical; font-family: var(--font-read); font-size: 1.05rem; line-height: 1.55; }
.field input[type="file"] { padding: 10px 12px; font-size: .95rem; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus, .pick-search:focus, .search input:focus { outline: 3px solid color-mix(in srgb, var(--coral) 70%, transparent); outline-offset: 0; border-color: var(--coral); }
.hint { font-size: .85rem; color: var(--ink-2); }
.help { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.help summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: .94rem; }
.help div { padding: 0 16px 14px; display: grid; gap: 6px; font-size: .9rem; color: var(--ink-2); }
.help code { background: var(--bg-2); border-radius: 6px; padding: 1px 6px; font-size: .9em; color: var(--ink); }
.preview { border: 1.5px dashed var(--line); border-radius: 22px; padding: 14px 16px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.preview .prayer { font-size: 1.05rem; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: grid; gap: 14px; }
.panel h2 { font-size: 1.1rem; }

.size-ctl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.size-ctl button { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-family: var(--font-read); font-weight: 600; color: var(--ink); }
.size-ctl button:hover { background: var(--bg-2); }
.size-ctl .s { font-size: .95rem; }
.size-ctl .l { font-size: 1.5rem; }
input[type="range"] { width: 100%; accent-color: var(--brand); height: 32px; }
.size-sample { font-family: var(--font-read); font-size: calc(1.1875rem * var(--scale)); line-height: 1.6; padding: 12px 14px; border-radius: 16px; background: var(--bg-2); }

/* ---------- about ---------- */

.about-hero { display: grid; gap: 14px; justify-items: start; padding: 22px 20px 0; border-radius: 28px; overflow: hidden; background: radial-gradient(90% 120% at 0 100%, var(--sun) 0%, transparent 60%), linear-gradient(170deg, var(--sky), color-mix(in srgb, var(--lagoon) 60%, var(--sky))); }
.about-hero .hero-badge { width: 76px; height: 76px; }
.about-hero .hero-badge img { width: 52px; height: 50px; }
.about-hero .band { margin-inline: -20px; width: calc(100% + 40px); }
.about-hero p { max-width: 34rem; opacity: .85; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.fact b { font-size: 1.15rem; line-height: 1.15; font-weight: 650; }
.fact span { font-size: .84rem; color: var(--ink-2); line-height: 1.3; }
.sec { display: grid; gap: 10px; }
.sec p, .sec li { font-size: 1.02rem; line-height: 1.62; max-width: 38rem; }
.sec ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.links { display: grid; gap: 8px; }
.links a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.address { font-style: normal; padding: 14px 16px; border-radius: 18px; background: var(--peach); color: var(--ink); line-height: 1.5; width: fit-content; max-width: 100%; }

/* ---------- sheets & toast ---------- */

#sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
#sheet .back { position: absolute; inset: 0; background: rgba(12, 24, 38, .5); }
#sheet .box {
  position: relative; width: min(100%, 600px); max-height: 88vh; overflow: auto;
  background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5);
  animation: rise .22s ease-out;
}
#sheet .box.top-right { align-self: flex-start; margin-top: calc(var(--top-h) + 8px); border-radius: 24px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 1.2rem; }
@media (min-width: 700px) {
  #sheet { align-items: center; }
  #sheet .box { border-radius: 28px; padding-inline: 22px; }
}
@keyframes rise { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.pick { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 14px; min-height: 48px; }
.pick:hover { background: var(--bg-2); }
.pick input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.pick span { min-width: 0; line-height: 1.3; }
.pick small { display: block; color: var(--ink-2); font-size: .8rem; }
.pick-head { font-size: .84rem; font-weight: 600; color: var(--ink-2); margin: 12px 6px 2px; }

#toast {
  position: fixed; left: 50%; z-index: 80; transform: translate(-50%, 20px);
  bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; font-weight: 550; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px); text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1000px) { #toast { bottom: 28px; } }

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

.noscript { padding: 24px; text-align: center; }
