/* ==========================================================================
   Харе Кришна · Батуми — единая дизайн-система
   1. Токены   2. База   3. Каркас и навигация   4. Компоненты   5. Экраны
   6. Шторка и тост   7. Широкий экран
   ========================================================================== */

/* 1. Токены ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #efebe2;
  --ink: #1e2420;
  --muted: #5b645d;
  --line: #e4dfd4;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2ede5;
  --warm: #b4561b;
  --warm-soft: #fbeadb;

  --st-confirmed: #2f6b4f;  --st-confirmed-bg: #e2ede5;
  --st-regular: #4c5750;    --st-regular-bg: #ebe8e0;
  --st-tentative: #85570a;  --st-tentative-bg: #f8eccd;
  --st-moved: #2c5a8a;      --st-moved-bg: #e1ebf6;
  --st-cancelled: #a1372b;  --st-cancelled-bg: #f8e2dd;
  --st-completed: #6a6f6b;  --st-completed-bg: #ebebe8;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, monospace;
  --fs-xs: 13px; --fs-sm: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 30px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px;
  --shadow: 0 1px 2px rgb(30 36 32 / .05), 0 4px 16px rgb(30 36 32 / .04);
  --shadow-lg: 0 -8px 40px rgb(30 36 32 / .18);

  --gutter: 16px;
  --tabbar-h: 62px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --content-max: 760px;
}

/* 2. База ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.has-sheet { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip-link:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 3. Каркас и навигация ------------------------------------------------------ */
.sidebar { display: none; }
.page { min-height: var(--app-h, 100vh); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  max-width: var(--content-max); margin: 0 auto;
  padding: calc(var(--space-3) + var(--tg-content-safe-area-inset-top, 0px)) var(--gutter) var(--space-2);
}
.brand { display: flex; align-items: center; gap: var(--space-3); font-weight: 800; letter-spacing: .02em; line-height: 1.15; }
.brand-mark {
  width: 54px; height: 34px; flex: none;
  background: var(--warm);
  -webkit-mask: url('../img/iskcon-lotus.svg') center / contain no-repeat;
  mask: url('../img/iskcon-lotus.svg') center / contain no-repeat;
}
.brand-text { font-size: var(--fs-sm); text-transform: uppercase; }
.brand-text small { display: block; font-size: var(--fs-xs); font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }

main {
  max-width: var(--content-max); margin: 0 auto;
  padding: var(--space-2) var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + var(--space-8));
  display: flex; flex-direction: column; gap: var(--space-5);
}
main:focus { outline: none; }
/* Логотип и название — только на главной. На остальных страницах заголовок раздела
   и так говорит, где человек, а Telegram показывает название бота в своей шапке. */
body:not([data-page='home']) .topbar { display: none; }
body:not([data-page='home']) main { padding-top: calc(var(--space-4) + var(--tg-content-safe-area-inset-top, 0px)); }

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 max(var(--space-1), env(safe-area-inset-left)) var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--tabbar-h); padding: 6px 2px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15;
}
.nav-item[aria-current='page'] { color: var(--accent); }
.nav-item[aria-current='page'] .icon { stroke-width: 2.1; }
.nav-item:nth-child(3) .icon { color: var(--warm); }

/* 4. Компоненты ------------------------------------------------------------ */
.page-head { display: grid; gap: var(--space-2); padding-top: var(--space-2); }
h1 { font-size: var(--fs-2xl); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: var(--fs-md); max-width: 60ch; }
.section { display: grid; gap: var(--space-3); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.section-head h2, .disclosure > summary h2 { font-size: var(--fs-lg); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.overline { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.footnote { font-size: var(--fs-sm); color: var(--muted); }
.footnote a, .freshness a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); }
.card--flush { padding: 0; overflow: hidden; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 1px solid transparent;
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.2; text-align: center;
  transition: transform .12s ease, background-color .15s ease;
}
.button:active { transform: scale(.98); }
.button .icon { width: 20px; height: 20px; }
.button--primary { background: var(--accent); color: var(--accent-ink); }
.button--secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.card .button--secondary { background: var(--surface-2); border-color: transparent; }
.button--ghost { color: var(--accent); padding-inline: 12px; }
.button--block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.button-row--center { justify-content: center; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: var(--fs-sm); min-height: 32px; }
.text-link .icon { width: 18px; height: 18px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.35; white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; stroke-width: 2; }
.chip--confirmed { color: var(--st-confirmed); background: var(--st-confirmed-bg); }
.chip--regular { color: var(--st-regular); background: var(--st-regular-bg); }
.chip--tentative { color: var(--st-tentative); background: var(--st-tentative-bg); }
.chip--moved { color: var(--st-moved); background: var(--st-moved-bg); }
.chip--cancelled { color: var(--st-cancelled); background: var(--st-cancelled-bg); }
.chip--completed { color: var(--st-completed); background: var(--st-completed-bg); }
.chip--live { color: var(--accent-ink); background: var(--accent); }
.chip--guest { color: var(--warm); background: var(--warm-soft); white-space: normal; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Строка события */
.event-list { display: grid; }
.event {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: var(--space-3);
  width: 100%; padding: 14px var(--space-4); text-align: left;
  border-top: 1px solid var(--line); transition: background-color .15s ease;
}
.event:first-child { border-top: 0; }
.event:active { background: var(--surface-2); }
.event-time { font-weight: 800; font-size: var(--fs-md); font-variant-numeric: tabular-nums; padding-top: 1px; }
.event-date { display: grid; justify-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; line-height: 1.1; padding-top: 2px; }
.event-date b { font-size: 22px; color: var(--ink); font-weight: 800; }
.event-main { display: grid; gap: 3px; min-width: 0; }
.event-title { font-weight: 700; line-height: 1.3; }
.event-meta { font-size: var(--fs-sm); color: var(--muted); }
.event-note { font-size: var(--fs-sm); font-weight: 600; color: var(--st-cancelled); }
.event-note--moved { color: var(--st-moved); }
.event-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.event-more { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; color: var(--accent); font-size: var(--fs-sm); font-weight: 700; }
.event-more .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.event.is-off .event-title, .event.is-off .event-time { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }

/* Фильтры */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); scroll-padding-inline: var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.filter {
  flex: none; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600;
}
.filter[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Выноска */
.callout {
  display: grid; grid-template-columns: 24px 1fr; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius); background: var(--accent-soft);
}
.callout > .icon { color: var(--accent); margin-top: 1px; }
.callout b { display: block; line-height: 1.35; }
.callout p { font-size: var(--fs-sm); color: var(--muted); margin: 4px 0 6px; }

/* Раскрывающиеся блоки */
.disclosure > summary, .faq-item > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker, .faq-item > summary::-webkit-details-marker { display: none; }
.disclosure-icon { width: 20px; height: 20px; color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
details[open] > summary .disclosure-icon { transform: rotate(-90deg); }
.disclosure > summary { min-height: 44px; }

/* Ряды-ссылки */
.rows { display: grid; }
.row, .link-card {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; align-items: center; gap: var(--space-3);
  padding: 14px var(--space-4);
}
.row + .row { border-top: 1px solid var(--line); }
.row > .icon:first-child, .link-card > .icon:first-child { color: var(--accent); }
.row > .icon:last-child, .link-card > .icon:last-child { width: 18px; height: 18px; color: var(--muted); }
.row b, .link-card b { display: block; font-weight: 700; line-height: 1.3; }
.row small, .link-card small { display: block; font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; margin-top: 2px; }
.row:active, .link-card:active { background: var(--surface-2); }

.empty { display: grid; justify-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-5); }
.empty h2 { font-size: var(--fs-lg); }
.empty-icon { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.5; }
.loading { display: flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 50vh; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: var(--fs-sm); min-height: 36px; margin-bottom: calc(var(--space-3) * -1); }
.back-link .icon { width: 18px; height: 18px; transform: rotate(180deg); }
.is-telegram .back-link { display: none; } /* в Telegram — системная кнопка «Назад» */

/* 5. Экраны ---------------------------------------------------------------- */

/* Главная */
.alert-banner {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; gap: var(--space-3); align-items: center;
  width: 100%; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: var(--st-cancelled-bg); color: var(--ink);
}
.alert-banner > .icon:first-child { color: var(--st-cancelled); }
.alert-banner--moved { background: var(--st-moved-bg); }
.alert-banner--moved > .icon:first-child { color: var(--st-moved); }
.alert-banner > .icon:last-child { width: 18px; height: 18px; color: var(--muted); }
.alert-banner b { display: block; font-size: var(--fs-sm); line-height: 1.3; }
.alert-banner small { display: block; font-size: var(--fs-sm); color: var(--muted); }

.next { display: grid; gap: var(--space-2); }
.next-title { font-size: var(--fs-xl); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.next-when { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2); align-items: start; font-weight: 600; }
.next-when .icon { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.next .event-tags { margin-top: 2px; }
.next-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-2); }
.next .freshness { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.quick-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: var(--space-3) 4px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--fs-xs); font-weight: 700; text-align: center; line-height: 1.2;
}
.quick-item .icon { width: 26px; height: 26px; color: var(--accent); }
.quick-item--accent { background: var(--warm-soft); border-color: transparent; color: var(--ink); }
.quick-item--accent .icon { color: var(--warm); }
.quick-item:active { transform: scale(.97); }

.donate-strip { display: grid; gap: var(--space-4); }
.donate-strip h2 { font-size: var(--fs-lg); line-height: 1.25; }
.donate-strip p { font-size: var(--fs-sm); margin-top: 6px; }
.donate-strip-methods { display: grid; gap: var(--space-2); }
.method-link {
  display: grid; grid-template-columns: 24px 1fr 18px; align-items: center; gap: var(--space-3);
  padding: 12px 14px; border-radius: 14px; background: var(--surface-2);
}
.method-link > .icon:first-child { color: var(--warm); }
.method-link > .icon:last-child { width: 18px; height: 18px; color: var(--muted); }
.method-link b { display: block; line-height: 1.25; }
.method-link small { color: var(--muted); font-size: var(--fs-sm); }
.link-card { border-radius: var(--radius); }
.freshness { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2); font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.freshness .icon { width: 18px; height: 18px; margin-top: 1px; }
.page-head .freshness { margin-top: var(--space-1); }

/* Расписание */
.day { display: grid; gap: var(--space-2); }
.day-title { font-size: var(--fs-md); font-weight: 800; }
.legend { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3); align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.legend li { display: contents; }
.legend .chip { justify-self: start; }
.week { padding: var(--space-2) var(--space-4); }
.week-row { display: grid; grid-template-columns: 52px 86px 1fr; gap: var(--space-3); padding: 10px 0; align-items: baseline; }
.week-row + .week-row { border-top: 1px solid var(--line); }
.week-days { font-weight: 700; }
.week-time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.week-title small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.disclosure > .card { margin-top: var(--space-2); }

/* Пожертвования */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.segment {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 8px 4px; border-radius: 12px; color: var(--muted); text-align: center; line-height: 1.2;
}
.segment b { font-size: var(--fs-sm); font-weight: 700; }
.segment small { font-size: 12px; font-weight: 600; }
.segment[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.segment[aria-selected='true'] small { color: var(--warm); }
.method { display: grid; gap: var(--space-4); }
.method-head { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); align-items: center; }
.method-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--warm-soft); color: var(--warm); }
.method-head h2 { font-size: var(--fs-xl); line-height: 1.2; font-weight: 800; }
.fields { display: grid; gap: var(--space-3); }
.field { display: grid; gap: 6px; }
.field-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field-value {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 56px; padding: 10px 10px 10px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--line); text-align: left; transition: border-color .15s ease, background-color .15s ease;
}
.field-value:active { border-color: var(--accent); }
.field-text { font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.field-value.is-mono .field-text { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.field-value.is-nowrap .field-text { white-space: nowrap; overflow-wrap: normal; }
.copy-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); color: var(--accent); font-size: var(--fs-xs); font-weight: 800; white-space: nowrap;
}
.copy-pill .icon { width: 16px; height: 16px; }
.copy-pill .check-icon, .copy-pill .copied-label { display: none; }
.field-value.is-copied { border-color: var(--accent); background: var(--accent-soft); }
.field-value.is-copied .copy-pill { background: var(--accent); color: var(--accent-ink); }
.field-value.is-copied .copy-icon, .field-value.is-copied .copy-label { display: none; }
.field-value.is-copied .check-icon, .field-value.is-copied .copied-label { display: inline; }
.disclosure--inline { border-top: 1px solid var(--line); padding-top: var(--space-2); }
.disclosure--inline > summary { font-weight: 700; font-size: var(--fs-sm); color: var(--accent); }
.disclosure--inline .fields { margin-top: var(--space-2); }
.warning {
  display: grid; grid-template-columns: 24px 1fr; gap: var(--space-3);
  padding: 14px; border-radius: 14px; background: var(--st-tentative-bg); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--st-tentative) 30%, transparent);
}
.warning > .icon { color: var(--st-tentative); }
.warning b { font-size: var(--fs-md); }
.warning p { font-size: var(--fs-sm); margin-top: 4px; }
.steps { counter-reset: step; display: grid; gap: var(--space-2); font-size: var(--fs-sm); color: var(--muted); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; gap: var(--space-2); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 800; }
.after { display: grid; gap: var(--space-3); background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.after h2 { font-size: var(--fs-lg); }
.after .muted { color: var(--ink); }
.after .button--secondary { background: var(--surface); }
.purposes li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 14px var(--space-4); }
.purposes li + li { border-top: 1px solid var(--line); }
.purposes b { display: block; line-height: 1.3; }
.purposes small { color: var(--muted); font-size: var(--fs-sm); }
.amount { font-weight: 800; white-space: nowrap; color: var(--warm); }

/* Связаться и служение */
.section-lead { font-size: var(--fs-sm); margin-top: -6px; }
.service-list { display: grid; gap: var(--space-3); }
.service { display: grid; gap: 6px; width: 100%; text-align: left; }
.service:active { background: var(--surface-2); }
.service-title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; }
.service-when { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); font-weight: 600; }
.service-when .icon { width: 18px; height: 18px; color: var(--accent); }
.service-text { color: var(--muted); }
.message { padding: 14px 16px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--surface-2); font-size: var(--fs-md); }
.flow { counter-reset: flow; display: grid; gap: var(--space-5); }
.flow > li { counter-increment: flow; display: grid; gap: var(--space-3); padding-left: 36px; position: relative; transition: opacity .2s ease; }
.flow > li::before {
  content: counter(flow); position: absolute; left: 0; top: -1px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800;
}
.flow > li.is-waiting { opacity: .45; }
.flow > li.is-waiting::before { background: var(--surface-2); color: var(--muted); }
.button--done { background: var(--accent-soft); color: var(--accent); }

/* Аватары ответственных */
.avatar { flex: none; display: block; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar--xs { width: 24px; height: 24px; }
.avatar--sm { width: 36px; height: 36px; }
.avatar--lg { width: 64px; height: 64px; }
.avatar--initials { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.avatar--xs.avatar--initials { font-size: 10px; }
.avatar--sm.avatar--initials { font-size: 13px; }
.avatar--lg.avatar--initials { font-size: 22px; }
.row--person { grid-template-columns: 36px minmax(0, 1fr) 20px; }
.service-person { display: flex; align-items: center; gap: var(--space-2); margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.person { display: grid; grid-template-columns: 64px 1fr; gap: var(--space-3); align-items: center; padding: var(--space-3); border-radius: 14px; background: var(--surface-2); }
.person small { display: block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.person b { display: block; font-size: var(--fs-lg); line-height: 1.25; }
.person--compact { grid-template-columns: 36px 1fr; padding: 0; background: none; }
.person--compact b { font-size: var(--fs-md); }
.person > div > span { display: block; font-size: var(--fs-sm); color: var(--muted); }

/* Новичкам */
.address { display: grid; gap: var(--space-3); }
.address-line { font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-item > summary { padding: 14px var(--space-4); font-weight: 700; min-height: 52px; }
.faq-item > p { padding: 0 var(--space-4) var(--space-4); color: var(--muted); }

/* Лекции */
.stack { display: grid; gap: var(--space-3); justify-items: start; }
.stack h2 { font-size: var(--fs-lg); line-height: 1.25; }
.records { display: grid; gap: var(--space-2); }
.record { display: grid; grid-template-columns: 24px 1fr 18px; gap: var(--space-3); align-items: center; }
.record b { display: block; }
.record small { color: var(--muted); font-size: var(--fs-sm); }

/* Вайшнавский календарь */
.ekadashi { display: grid; gap: var(--space-3); background: linear-gradient(160deg, var(--surface) 55%, var(--accent-soft)); }
.ekadashi-head { display: grid; grid-template-columns: 48px 1fr; gap: var(--space-3); align-items: center; }
.ekadashi-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.ekadashi-icon .icon { width: 24px; height: 24px; }
.ekadashi h2 { font-size: var(--fs-lg); line-height: 1.25; font-weight: 800; }
.ekadashi .overline { color: var(--accent); }
.ekadashi-parana { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2); font-size: var(--fs-sm); }
.ekadashi-parana .icon { width: 20px; height: 20px; color: var(--accent); }
.ekadashi .next-actions { margin-top: 0; }
.ekadashi-fest { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2); align-items: start; padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.ekadashi-fest .icon { width: 18px; height: 18px; color: var(--warm); margin-top: 1px; }
.callout--moon .button { margin-top: var(--space-2); }
.month-title { font-size: var(--fs-lg); font-weight: 800; }
.cal-list { display: grid; }
.cal-day { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); padding: 12px var(--space-4); }
.cal-day + .cal-day { border-top: 1px solid var(--line); }
.cal-day.is-today { background: var(--warm-soft); }
.cal-date { display: grid; justify-items: center; align-content: start; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); line-height: 1.1; padding-top: 2px; }
.cal-date b { font-size: 20px; color: var(--ink); font-weight: 800; }
.cal-items { display: grid; gap: var(--space-2); min-width: 0; }
.cal-item { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2); align-items: start; line-height: 1.35; }
.cal-item > .icon { width: 18px; height: 18px; margin-top: 2px; }
.cal-item small { display: block; font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.cal-item .cal-fast { color: var(--st-tentative); font-weight: 600; }
.cal-item--ekadashi > .icon { color: var(--accent); }
.cal-item--ekadashi b { color: var(--accent); }
.cal-item--ekadashi small:first-of-type { color: var(--ink); font-weight: 600; }
.cal-item--major > .icon { color: var(--warm); }
.cal-item--major span { font-weight: 800; }
.cal-item--festival > .icon { color: var(--muted); }
.cal-item--acharya { color: var(--muted); font-size: var(--fs-sm); }
.cal-item--acharya > .icon { color: var(--line); width: 16px; height: 16px; }

/* Молитвы */
.prayer-when { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.prayer-when .icon { width: 18px; height: 18px; }
.prayer-intro { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.reader-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  position: sticky; top: 0; z-index: 5; margin-inline: calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.reader-size { display: flex; gap: var(--space-2); margin-left: auto; }
.reader-tools .filter { min-width: 48px; font-weight: 700; }
.reader-tools .filter:disabled { opacity: .4; }
.prayer { display: grid; gap: var(--space-3); --verse: 18px; --tr: 16px; }
.prayer.size-0 { --verse: 16px; --tr: 15px; }
.prayer.size-2 { --verse: 22px; --tr: 18px; }
.verse { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.verse-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--warm-soft); color: var(--warm); font-size: 12px; font-weight: 800; }
.verse-head { display: flex; align-items: center; gap: var(--space-2); }
.verse-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--warm); }
.verse-text { font-size: var(--verse); line-height: 1.45; font-weight: 600; font-style: italic; color: var(--ink); }
.verse-line { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.verse-translation { margin-top: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: var(--tr); line-height: 1.6; color: var(--muted); }
.prayer.no-translation .verse-translation { display: none; }
.commentary-title { font-weight: 800; }
.prayer-note { padding-block: var(--space-3); }
.prayer-note + .prayer-note { margin-top: calc(var(--space-5) * -1 + var(--space-2)); }
.commentary { display: grid; gap: var(--space-3); margin-top: var(--space-3); color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }
.prayer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.prayer-nav-link { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); }
.prayer-nav-link small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.prayer-nav-link b { font-size: var(--fs-sm); line-height: 1.3; }
.prayer-nav-link--next { text-align: right; }

/* Шторки: ссылки и знакомство */
.sheet-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-6); }
.welcome { display: grid; gap: var(--space-4); }
.welcome li { display: grid; grid-template-columns: 40px 1fr; gap: var(--space-3); align-items: start; color: var(--muted); font-size: var(--fs-sm); }
.welcome .icon { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.welcome b { display: block; color: var(--ink); font-size: var(--fs-md); }
.welcome-note { padding: 12px 14px; border-radius: 12px; background: var(--warm-soft); }

/* 6. Шторка и тост ----------------------------------------------------------- */
.sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto; padding: 0; border: 0;
  width: 100%; max-width: 640px; max-height: none;
  background: transparent; color: var(--ink); overflow: visible;
}
.sheet-inner {
  position: relative; max-height: calc(var(--app-h, 100vh) * .88); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
}
.sheet::backdrop { background: rgb(10 14 12 / .45); }
.sheet-title:focus { outline: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto var(--space-3); }
.sheet-close { position: absolute; top: 12px; right: 12px; }
.sheet-close .icon { width: 20px; height: 20px; }
.sheet-body { display: grid; gap: var(--space-4); }
.sheet-body > .overline { padding-right: 48px; }
.sheet-title { font-size: var(--fs-xl); line-height: 1.2; font-weight: 800; padding-right: 44px; margin-top: -8px; }
.sheet-subtitle { font-size: var(--fs-md); font-weight: 800; margin-bottom: -6px; }
.status-box { display: grid; gap: var(--space-2); justify-items: start; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.status-box p { font-size: var(--fs-sm); }
.status-box--cancelled { background: var(--st-cancelled-bg); }
.status-box--moved { background: var(--st-moved-bg); }
.status-box--tentative { background: var(--st-tentative-bg); }
.facts { display: grid; gap: var(--space-3); }
.facts > div { display: grid; grid-template-columns: 22px 64px 1fr; gap: var(--space-3); align-items: start; }
.facts .icon { color: var(--accent); width: 22px; height: 22px; }
.facts dt { color: var(--muted); font-size: var(--fs-sm); padding-top: 1px; }
.facts dd { font-weight: 600; }
.facts .text-link { display: flex; }
.timeline { display: grid; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { display: grid; grid-template-columns: 52px 1fr; gap: var(--space-2); padding: 6px 0 6px 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline time { font-weight: 800; font-variant-numeric: tabular-nums; }
.sheet-actions { display: grid; gap: var(--space-2); }
.copy-area { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 16px; resize: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 700; text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.has-sheet .toast { bottom: calc(var(--safe-bottom) + 16px); }
.noscript { padding: 24px; }

/* Телефоны 360–420 px: у кнопки копирования остаётся только значок, чтобы номер не обрезался */
@media (min-width: 360px) and (max-width: 420px) {
  .field-value .copy-pill .copy-label,
  .field-value.is-copied .copy-pill .copied-label { display: none; }
}
/* Узкие экраны (320 px) */
@media (max-width: 359px) {
  :root { --gutter: 12px; --fs-2xl: 26px; --fs-xl: 23px; }
  .quick { gap: 6px; }
  .quick-item { min-height: 76px; font-size: 12px; }
  .nav-item { font-size: 10.5px; }
  .field-text { font-size: var(--fs-md); }
  .field-value { grid-template-columns: 1fr; gap: var(--space-2); }
  .copy-pill { justify-self: start; }
  .legend { grid-template-columns: 1fr; gap: 4px; }
  .legend .chip { margin-top: var(--space-2); }
  .week-row { grid-template-columns: 1fr; gap: 2px; }
  .facts > div { grid-template-columns: 22px 1fr; }
  .facts dt { display: none; }
}

/* 7. Широкий экран ------------------------------------------------------------ */
@media (min-width: 640px) {
  :root { --gutter: 24px; --fs-2xl: 34px; }
  .sheet { inset: 0; margin: auto; height: fit-content; }
  .sheet-inner { max-height: calc(var(--app-h, 100vh) * .86); }
  .sheet-inner { border-radius: var(--radius-lg); padding-bottom: var(--space-6); }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: var(--space-3); }
  .sheet-actions { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .donate-strip { grid-template-columns: 1fr 1fr; align-items: center; }
  .service-list { grid-template-columns: 1fr 1fr; }
  .quick-item { flex-direction: row; min-height: 60px; font-size: var(--fs-sm); }
}

@media (min-width: 960px) {
  :root { --content-max: 820px; }
  .tabbar, .brand--compact { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-8);
    position: fixed; inset: 0 auto 0 0; width: 248px; padding: var(--space-8) var(--space-5);
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .side-nav { display: grid; gap: 4px; }
  .side-nav .nav-item { flex-direction: row; justify-content: flex-start; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-3); border-radius: 12px; font-size: var(--fs-md); }
  .side-nav .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .side-nav .nav-item[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }
  .sidebar-foot { margin-top: auto; font-size: var(--fs-sm); color: var(--muted); font-style: italic; }
  .page { margin-left: 248px; }
  .topbar { justify-content: flex-end; padding-top: var(--space-6); }
  main { padding-bottom: var(--space-10); gap: var(--space-6); }
  body:not([data-page='home']) main { padding-top: var(--space-8); }
  .toast { bottom: 24px; }
  .event:hover, .row:hover, .link-card:hover, .method-link:hover { background: var(--surface-2); }
  .button--secondary:hover { border-color: var(--muted); }
  .button--primary:hover { filter: brightness(1.08); }
}
