:root {
  color-scheme: light dark;
  --page: light-dark(#f5f5f7, #000);
  --tile: light-dark(#fff, #1d1d1f);
  --tile-2: light-dark(#f5f5f7, #2c2c2e);
  --ink: light-dark(#1d1d1f, #f5f5f7);
  --muted: light-dark(#6e6e73, #a1a1a6);
  --line: light-dark(#d2d2d7, #424245);
  --hairline: light-dark(rgb(0 0 0 / .1), rgb(255 255 255 / .14));
  --accent: light-dark(#0071e3, #2997ff);
  --accent-fill: #0071e3;
  --red: light-dark(#d70015, #ff453a);
  --green: #34c759;
  --bar: light-dark(rgb(245 245 247 / .78), rgb(22 22 23 / .78));
  --warn-bg: light-dark(#fff4d6, #3a2f12);
  --warn-ink: light-dark(#6b4a00, #ffd98a);
  --shadow: light-dark(0 4px 24px rgb(0 0 0 / .08), 0 4px 24px rgb(0 0 0 / .5));

  /* Category colours, checked for colour-blind separation in both themes. */
  --cat-0: light-dark(#d62d3a, #de4450);
  --cat-1: light-dark(#0e9aa7, #1a9cac);
  --cat-2: light-dark(#b8860b, #b58a1c);
  --cat-3: light-dark(#6e4bd8, #8a6ae6);
  --cat-4: light-dark(#1a9e5c, #23a566);
  --cat-5: light-dark(#e8590c, #e0682a);
  --cat-6: light-dark(#0071e3, #2f8fef);
  --cat-7: light-dark(#c2308a, #c94a9a);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --nav-h: 52px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.47 var(--font);
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1 { font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; line-height: 1.12; letter-spacing: -.022em; }
h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.2; letter-spacing: -.018em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { font: .88em ui-monospace, SFMono-Regular, Consolas, monospace; }
kbd { padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.spacer { flex: 1; }
.eyebrow { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--muted); }
.wordmark { font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.alert { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 16px; border-radius: 14px; font-size: .95rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.count { margin-left: 4px; font-size: .85em; font-weight: 400; opacity: .6; }

/* Buttons and links */
button, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px;
  font-size: 1.0625rem; font-weight: 400; white-space: nowrap;
  color: var(--ink); background: var(--tile-2);
  border: 0; border-radius: 980px;
  transition: background .2s, transform .2s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent-fill); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #0077ed; }
.btn.wide { width: 100%; }
.btn.compact { min-height: 34px; padding: 0 14px; font-size: .875rem; }
.btn.compact[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.more { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0; background: none; border: 0; color: var(--accent); font-size: 1.0625rem; }
.more .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.more:hover { text-decoration: underline; }
.text-btn { min-height: 34px; padding: 0; background: none; border: 0; color: var(--accent); font-size: 1rem; }
.text-btn.strong { font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--muted); }
.icon-btn:hover { color: var(--ink); }

/* Loading */
.loading { display: grid; place-items: center; min-height: 100dvh; }
.loading i { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--muted); animation: turn .9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

/* Global navigation */
.globalnav { position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
.globalnav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline); }
.globalnav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; max-width: 1040px; height: var(--nav-h); margin: 0 auto; padding: 0 22px; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { display: flex; align-items: center; color: var(--muted); font-size: .875rem; transition: color .2s; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav .icon { display: none; }
.nav-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.nav-add { min-height: 30px; padding: 0 12px 0 8px; font-size: .82rem; gap: 2px; }
.nav-add .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync[data-state="saving"] i { background: #ff9f0a; animation: pulse 1s infinite; }
.sync[data-state="failed"] i { background: var(--red); }
.sync[data-state="failed"] { color: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.notice { max-width: 996px; margin: 14px auto 0; width: calc(100% - 44px); }

/* Page */
.view { max-width: 1040px; margin: 0 auto; padding: 0 22px 96px; display: flex; flex-direction: column; }
.entering > * { animation: rise .7s var(--ease) backwards; }
.entering > *:nth-child(2) { animation-delay: 90ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 72px 0 56px; text-align: center; }
.hero.tall { padding: 96px 22px 64px; }
.subhead { max-width: 38rem; font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; color: var(--muted); }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 16px; }
.page-head { padding: 56px 0 24px; }
.page-head.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Bento tiles */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 32px; background: var(--tile); border-radius: 22px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.tile.center { align-items: center; justify-content: center; text-align: center; }
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tile-head .more { font-size: .95rem; }

@supports (animation-timeline: view()) {
  .bento > .tile { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  @keyframes reveal { from { opacity: .2; transform: translateY(28px) scale(.985); } }
}

.stat { justify-content: center; gap: 2px; }
.stat strong { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.stat span { color: var(--muted); }

.feature { align-items: center; gap: 12px; padding: clamp(48px, 8vw, 88px) clamp(24px, 6vw, 72px); text-align: center; color: #f5f5f7; background: #000; }
:root[data-theme="dark"] .feature { background: #1d1d1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feature { background: #1d1d1f; } }
.feature .eyebrow { color: #a1a1a6; }
.feature-text {
  max-width: 46rem; font-size: clamp(1.75rem, 4.4vw, 3rem); font-weight: 600; line-height: 1.12; letter-spacing: -.028em; overflow-wrap: anywhere; white-space: pre-wrap;
  color: transparent; background: linear-gradient(100deg, #5ac8fa, #a78bfa 55%, #ff7eb6); -webkit-background-clip: text; background-clip: text;
}
.feature-ref { font-size: 1.15rem; font-weight: 600; }
.feature-note { color: #a1a1a6; font-size: .95rem; overflow-wrap: anywhere; }

.ring-box { position: relative; width: min(200px, 70%); }
.ring { display: block; width: 100%; }
.ring-track, .ring-value { fill: none; stroke-width: 11; }
.ring-track { stroke: var(--tile-2); }
.ring-value { stroke: var(--accent-fill); stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label strong { font-size: 2.75rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.ring-label span { font-size: .9rem; color: var(--muted); }

.checklist li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.checklist li:last-child { border-bottom: 0; }
.tick { position: relative; display: grid; place-items: center; width: 26px; height: 26px; flex: none; padding: 0; color: transparent; background: none; border: 1.5px solid var(--line); border-radius: 50%; transition: background .2s, border-color .2s; }
.tick::after { content: ""; position: absolute; inset: -9px; }
.tick .icon { width: 15px; height: 15px; stroke-width: 2.8; }
.tick[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.checklist-title { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; flex: 1; min-width: 0; padding: 0; text-align: left; background: none; border: 0; }
.checklist-title > span:first-child { overflow-wrap: anywhere; }
.checklist-title .done { color: var(--muted); }
.rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.rows li:last-child { border-bottom: 0; }
.rows span { min-width: 0; overflow-wrap: anywhere; }
.rows small { flex: none; font-size: .875rem; color: var(--muted); }

.cat { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c); }

/* Prayers */
.toolbar { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--tile); border-radius: 14px; color: var(--muted); }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-box input { flex: 1; min-width: 0; padding: 13px 0; font: inherit; color: var(--ink); background: none; border: 0; outline: none; }
.segmented { display: inline-flex; gap: 2px; padding: 2px; max-width: 100%; background: light-dark(#e8e8ed, #2c2c2e); border-radius: 10px; }
.segmented.full { display: flex; }
.segmented.full button { flex: 1; }
.segmented button { min-height: 32px; padding: 0 14px; font-size: .875rem; background: none; border: 0; border-radius: 8px; transition: background .2s; }
.segmented button[aria-pressed="true"] { font-weight: 500; background: light-dark(#fff, #636366); box-shadow: 0 1px 3px rgb(0 0 0 / .14); }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
.sort select { padding: 6px 8px; font-size: .875rem; color: var(--ink); background: var(--tile); border: 0; border-radius: 8px; }

.chips { display: flex; gap: 8px; margin: 0 -22px; padding: 2px 22px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips:empty { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 32px; padding: 0 13px; font-size: .85rem; background: var(--tile); border: 0; border-radius: 980px; transition: background .2s; }
.chip[aria-pressed="true"] { color: var(--page); background: var(--ink); }
.chip-input { width: 9rem; min-height: 32px; padding: 0 13px; font: inherit; font-size: .85rem; color: var(--ink); background: var(--tile); border: 0; border-radius: 980px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 24px; background: var(--tile); border-radius: 18px; transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h3, .testimony h3 { overflow-wrap: anywhere; }
.card-details { font-size: .95rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.verse { overflow-wrap: anywhere; }
.verse p { font-size: .95rem; white-space: pre-wrap; }
.verse cite { font-size: .8rem; font-style: normal; font-weight: 600; color: var(--muted); }
.answer { padding: 12px 14px; font-size: .95rem; background: var(--tile-2); border-radius: 12px; overflow-wrap: anywhere; }
.answer strong { font-size: .85rem; font-weight: 600; }
.answer p { white-space: pre-wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.tag { padding: 2px 0; font-size: .85rem; color: var(--muted); background: none; border: 0; }
.tag:hover { color: var(--ink); }
.tag[aria-pressed="true"] { color: var(--accent); font-weight: 500; }
.card-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.card-actions .text-btn { font-size: .9rem; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 72px 16px; text-align: center; grid-column: 1 / -1; }

/* Answered */
.timeline { display: flex; flex-direction: column; gap: 44px; width: 100%; max-width: 46rem; margin: 0 auto; }
.timeline h2 { padding-bottom: 8px; }
.testimony { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-top: 1px solid var(--hairline); }
.testimony-date { display: flex; flex-direction: column; line-height: 1.1; }
.testimony-date strong { font-size: 1.9rem; font-weight: 600; letter-spacing: -.03em; }
.testimony-date span { font-size: .8rem; color: var(--muted); }
.testimony-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.testimony-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.testimony-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.testimony-foot .text-btn { font-size: .9rem; }

/* Insights */
.legend { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend.end { justify-content: flex-end; gap: 4px; }
.key { width: 14px; height: 8px; border-radius: 4px; background: var(--muted); }
.key-open { opacity: .35; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) 2ch; align-items: center; gap: 14px; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; gap: 2px; height: 10px; }
.bar-seg { width: var(--w); min-width: 4px; background: var(--c); }
.bar-seg:first-child { border-radius: 5px 0 0 5px; }
.bar-seg:last-child { border-radius: 0 5px 5px 0; }
.bar-seg:only-child { border-radius: 5px; }
.bar-seg.open { opacity: .3; }
.bar-value { text-align: right; font-weight: 600; }
.table-view summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.table-view table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .9rem; }
.table-view th, .table-view td { padding: 6px 0; text-align: left; border-bottom: 1px solid var(--hairline); }
.heat-scroll { overflow-x: auto; }
.heat { display: flex; gap: 5px; width: max-content; }
.heat-week { display: flex; flex-direction: column; gap: 5px; }
.heat-cell { display: block; width: 16px; height: 16px; border-radius: 5px; background: var(--tile-2); }
.heat-cell.future { background: none; }
.level-1 { background: color-mix(in srgb, var(--accent-fill) 28%, var(--tile-2)); }
.level-2 { background: color-mix(in srgb, var(--accent-fill) 52%, var(--tile-2)); }
.level-3 { background: color-mix(in srgb, var(--accent-fill) 76%, var(--tile-2)); }
.level-4 { background: var(--accent-fill); }

/* Grouped form rows */
.group { overflow: hidden; background: var(--tile); border-radius: 12px; }
.group > * + * { border-top: 1px solid var(--hairline); }
.group textarea, .fold textarea { display: block; width: 100%; padding: 12px 16px; font: inherit; color: var(--ink); background: none; border: 0; outline: none; resize: none; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 0 16px; }
.row input:not([type="checkbox"]) { flex: 1; min-width: 0; padding: 11px 0; font: inherit; text-align: right; color: var(--muted); background: none; border: 0; outline: none; }
.row input:focus { color: var(--ink); }
.plain-row { padding: 12px 16px; color: var(--muted); overflow-wrap: anywhere; }
.row-btn { display: block; width: 100%; min-height: 46px; padding: 0 16px; text-align: left; color: var(--accent); background: none; border: 0; }
.group-btn { width: 100%; min-height: 46px; background: var(--tile); border: 0; border-radius: 12px; }
.danger { color: var(--red); }
.hint { padding: 0 16px; font-size: .82rem; color: var(--muted); }
.hint:empty { display: none; }
.caption { padding: 0 16px 6px; font-size: .82rem; color: var(--muted); }
.title-input { font-size: 1.3rem !important; font-weight: 600; letter-spacing: -.02em; }
.tag-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 7px 12px; background: var(--tile); border-radius: 12px; cursor: text; }
.tag-box input { flex: 1; min-width: 9rem; padding: 4px; font: inherit; color: var(--ink); background: none; border: 0; outline: none; }
.tag-box input::-webkit-calendar-picker-indicator { display: none !important; }
.tag-pill { display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px 1px 11px; font-size: .88rem; background: var(--tile-2); border-radius: 980px; }
.tag-pill button { width: 24px; height: 24px; padding: 0; color: var(--muted); font-size: 1rem; line-height: 1; background: none; border: 0; }
.fold { background: var(--tile); border-radius: 12px; }
.fold summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 16px; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "›"; font-size: 1.3rem; color: var(--muted); transition: transform .2s; }
.fold[open] summary::after { transform: rotate(90deg); }
.fold-body { border-top: 1px solid var(--hairline); }
.fold-body > * + * { border-top: 1px solid var(--hairline); }
.fold .hint { padding: 8px 16px; }
.verse-row { display: flex; align-items: center; gap: 12px; padding-right: 16px; }
.verse-row input { flex: 1; min-width: 0; padding: 12px 16px; font: inherit; color: var(--ink); background: none; border: 0; outline: none; }

.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 51px; height: 31px; margin: 0; right: 16px; }
.switch { position: relative; }
.switch i { position: relative; width: 51px; height: 31px; flex: none; background: light-dark(#e9e9ea, #39393d); border-radius: 980px; transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sheets */
dialog { color: var(--ink); }
.sheet { width: min(33rem, calc(100vw - 24px)); max-height: min(46rem, calc(100dvh - 40px)); padding: 0; overflow: hidden auto; background: light-dark(#f2f2f7, #1c1c1e); border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgb(0 0 0 / .35); --tile: light-dark(#fff, #2c2c2e); --tile-2: light-dark(#f2f2f7, #3a3a3c); }
.sheet[open] { animation: sheet-in .35s var(--ease); }
.sheet::backdrop, .alert-sheet::backdrop { background: rgb(0 0 0 / .4); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 54px; padding: 0 16px; background: light-dark(rgb(242 242 247 / .85), rgb(28 28 30 / .85)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--hairline); }
.sheet-bar h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.012em; }
.sheet-bar > :first-child { justify-self: start; }
.sheet-bar > :last-child { justify-self: end; }
.sheet-body { display: flex; flex-direction: column; gap: 22px; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }

.alert-sheet { width: min(19rem, calc(100vw - 48px)); padding: 0; overflow: hidden; text-align: center; background: light-dark(rgb(242 242 247 / .95), rgb(44 44 46 / .95)); border: 0; border-radius: 16px; }
.alert-sheet p { padding: 20px 16px; font-size: .95rem; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hairline); }
.alert-actions button { min-height: 44px; background: none; border: 0; color: var(--accent); }
.alert-actions button + button { font-weight: 600; border-left: 1px solid var(--hairline); }
.alert-actions button.danger { color: var(--red); }

/* Prayer time: always dark, whichever theme is on */
.pray { color-scheme: dark; --accent: #2997ff; --muted: #a1a1a6; position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; color: #f5f5f7; background: #000; border: 0; overflow: hidden auto; }
.pray[open] { display: flex; flex-direction: column; animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; } }
.pray::backdrop { background: #000; }
.pray-head { display: flex; align-items: center; gap: 18px; padding: 14px 22px; padding-top: max(14px, env(safe-area-inset-top)); }
.segments { display: flex; flex: 1; gap: 4px; }
.segment { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .2); transition: background .3s; }
.segment.past, .segment.current { background: #f5f5f7; }
.pray-stage { flex: 1; display: grid; place-items: center; padding: 16px 22px 40px; }
.pray-card { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(46rem, 100%); text-align: center; animation: rise .6s var(--ease); }
.pray-card h2 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 700; line-height: 1.06; letter-spacing: -.03em; overflow-wrap: anywhere; }
.pray-details { max-width: 34rem; color: #a1a1a6; white-space: pre-wrap; overflow-wrap: anywhere; }
.pray-verse { max-width: 36rem; overflow-wrap: anywhere; }
.pray-verse p { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 500; line-height: 1.25; letter-spacing: -.02em; color: #a1a1a6; white-space: pre-wrap; }
.pray-verse cite { display: block; margin-top: 8px; font-size: .95rem; font-style: normal; font-weight: 600; }
.pray-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.pray .btn.primary { min-width: 8.5rem; }
.round { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: #f5f5f7; background: rgb(255 255 255 / .12); border: 0; border-radius: 50%; }

/* Toast and confirmation */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; font-size: .95rem; color: #f5f5f7; background: rgb(40 40 42 / .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 16px; box-shadow: 0 8px 32px rgb(0 0 0 / .3); transform: translateX(-50%); animation: toast-in .35s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.toast button { min-height: 30px; padding: 0; color: #2997ff; font-weight: 500; background: none; border: 0; }

.hud { position: fixed; left: 50%; top: 50%; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 150px; height: 150px; font-weight: 600; color: var(--ink); background: light-dark(rgb(255 255 255 / .82), rgb(44 44 46 / .82)); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 22px; box-shadow: 0 10px 40px rgb(0 0 0 / .2); pointer-events: none; transform: translate(-50%, -50%); animation: hud 1.4s var(--ease) forwards; }
.hud i { display: grid; place-items: center; width: 58px; height: 58px; color: #fff; background: var(--green); border-radius: 50%; }
.hud .icon { width: 32px; height: 32px; stroke-width: 2.6; }
@keyframes hud { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); } 15%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.96); } }

/* First-run page */
.connect h1 { font-size: clamp(3rem, 9vw, 6rem); }
.connect-features { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.connect-panel { display: flex; flex-direction: column; gap: 12px; max-width: 38rem; margin: 0 auto; padding: 88px 22px 96px; text-align: center; }
.section-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }

/* Phones and small tablets */
@media (max-width: 760px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .connect { margin-bottom: calc(-62px - env(safe-area-inset-bottom)); }
  .globalnav-inner { grid-template-columns: 1fr auto; height: 48px; padding: 0 16px; }
  .nav { position: fixed; inset: auto 0 0; z-index: 5; justify-content: space-around; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--hairline); }
  .nav a { flex: 1; flex-direction: column; gap: 2px; font-size: .68rem; letter-spacing: 0; }
  .nav a[aria-current="page"] { color: var(--accent); }
  .nav .icon { display: block; width: 24px; height: 24px; }
  .nav-add { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; }
  .nav-add span { display: none; }
  .notice { width: calc(100% - 32px); }
  .view { padding: 0 16px 40px; }
  .hero { padding: 44px 0 36px; }
  .hero.tall { padding: 64px 16px 44px; }
  .page-head { padding: 32px 0 18px; }
  .chips { margin: 0 -16px; padding: 2px 16px; }
  .bento { gap: 12px; }
  .connect-features { padding: 0 16px; }
  .connect-panel { padding: 64px 16px 72px; }
  .tile { grid-column: span 12; padding: 24px; }
  .tile.span-3 { grid-column: span 6; }
  .tile.span-3 strong { font-size: 1.75rem; }
  .toast { bottom: calc(74px + env(safe-area-inset-bottom)); }

  .sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .sheet[open] { animation: sheet-up .4s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}

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

/* Adding several at once */
@media (min-width: 761px) { .sheet.wide { width: min(44rem, calc(100vw - 24px)); } }
.bulk-text { min-height: 16rem; overflow: auto !important; }
.bulk-tools { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; background: var(--tile); border-radius: 12px; }
.bulk-tools .hint { padding: 0; }
.bulk-tools-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; font-size: .92rem; }
.bulk-tools .chip { background: var(--tile-2); }
.bulk-tools .chip[aria-pressed="true"] { background: var(--ink); }
.bulk-list { display: flex; flex-direction: column; gap: 10px; }
.bulk-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--tile); border-radius: 12px; transition: opacity .2s; }
.bulk-row[data-off] .bulk-fields { opacity: .5; }
.bulk-row .tick { flex: none; }
.bulk-fields { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.bulk-point { display: block; width: 100%; padding: 2px 0; font: inherit; font-weight: 500; color: var(--ink); background: none; border: 0; outline: none; resize: none; overflow: hidden; }
.bulk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bulk-category-box { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; background: var(--tile-2); border-radius: 980px; }
.bulk-category { field-sizing: content; max-width: 11rem; font: inherit; font-size: .85rem; color: var(--ink); background: none; border: 0; outline: none; }
.bulk-tag-tools { display: inline-flex; align-items: center; gap: 12px; }
.bulk-tools select { min-height: 32px; padding: 0 8px; font: inherit; color: var(--ink); background: var(--tile-2); border: 0; border-radius: 8px; }
.bulk-keyword { flex: 1; min-width: 6rem; min-height: 28px; padding: 0 6px; font: inherit; font-size: .85rem; color: var(--ink); background: none; border: 0; outline: none; }
.share-line { font-size: .8rem; color: var(--muted); }
.share-line.warn { color: var(--warn-ink); }

/* Sharing */
.share-section { display: flex; flex-direction: column; gap: 8px; }
.share-section .caption { padding-bottom: 0; }
.page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.public-bar { grid-template-columns: 1fr auto; }
.back-link { font-size: .95rem; }
.group-name { font-size: clamp(2.4rem, 6vw, 4rem); overflow-wrap: anywhere; }
.group-card { color: var(--ink); }
.group-card:hover { text-decoration: none; }
.group-members { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.group-members li .text-btn { margin-left: auto; }
.group-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.text-btn.danger { color: var(--red); }
.text-form { display: flex; flex-direction: column; gap: 12px; }
.text-form input { width: calc(100% - 32px); margin: 0 16px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--tile-2); border: 0; border-radius: 10px; }
.text-form p { padding: 16px 16px 0; text-align: center; }

/* Category and tags on a card */
.cat-picker select { field-sizing: content; max-width: 13rem; padding: 2px 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.cat-picker select:hover { color: var(--ink); }
.tag-item { display: inline-flex; align-items: center; }
.tag-remove { position: relative; width: 18px; height: 18px; padding: 0; font-size: .95rem; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: 50%; }
.tag-remove::after { content: ""; position: absolute; inset: -6px -3px; }
.tag-remove:hover { color: var(--red); }
.tag-add { color: var(--accent); }
.tag-add:hover { color: var(--accent); }

/* Choosing several prayers */
.selectable { cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; }
.selectable[data-chosen] { outline-color: var(--accent); }
.select-bar { position: sticky; bottom: 16px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 20px; padding: 10px 16px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: var(--shadow); }
.select-bar select { min-height: 32px; max-width: 10rem; padding: 0 8px; font: inherit; font-size: .9rem; color: var(--ink); background: var(--tile); border: 0; border-radius: 8px; }
.select-bar .text-btn { font-size: .95rem; }
.select-bar .text-btn:disabled, .bulk-tools .text-btn:disabled { color: var(--muted); }
@media (max-width: 760px) {
  .select-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Account */
.avatar { display: inline-grid; place-items: center; width: 100%; height: 100%; object-fit: cover; font-weight: 600; color: #fff; background: var(--accent-fill); border-radius: 50%; }
.avatar-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; overflow: hidden; font-size: .85rem; background: none; border: 0; border-radius: 50%; }
.account-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.account-card .avatar { width: 52px; height: 52px; flex: none; font-size: 1.3rem; }
.account-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.account-text span { font-size: .85rem; color: var(--muted); }

/* The site owner's page */
.text-btn.danger:disabled { color: var(--muted); }
.group-members .more { align-self: flex-start; }
