/*
 * Веб-версия «Богослужебных указаний» — оформление как в Android-приложении:
 * цвета из res/values/colors.xml, фон im_background, карточки CardView (радиус 16–20dp,
 * полупрозрачные), кнопки button_background (радиус 24dp), нижняя навигация BottomNavigationView.
 * Текст указаний оформляется стилями приложения: content/web/text.css (= style.css внутри .u-text).
 */

:root {
	--primary: #567a8c;          /* colorPrimary */
	--primary-dark: #44626f;
	--accent: #4caf50;           /* colorAccent — FAB */
	--holiday: #f63d2b;          /* colorHolidayText */
	--selection: #009688;        /* selectionColor — выбранный день календаря */
	--fast: rgba(106, 141, 151, .84);  /* colorWidgetBackground — постные дни */
	--link: #3f51b5;             /* ссылки чтений на карточке */
	--card: rgba(255, 255, 255, .8);   /* cardBackgroundColorDay #CCFFFFFF */
	--card-solid: #ffffff;
	--screen: #ebf0f2;           /* scheduleScreenBackground */
	--ink: #1b1b1b;              /* colorDarkText */
	--muted: #757575;
	--line: rgba(0, 0, 0, .12);
	--tint: rgba(86, 122, 140, .08);
	--surface: #f5f6f8;          /* subscriptionDialogBackground — диалоги */
	--bg: #ffffff;               /* фон текста указаний (style.css) */
	--cinnabar: #a6322a;
	--green: #2e7d32;
	--bar: #567a8c;
	--bar-ink: #ffffff;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--appbar-h: 56px;
	--nav-h: 56px;
	--top: calc(var(--appbar-h) + var(--safe-top));
	color-scheme: light;
}

:root[data-theme="night"] {
	--card: rgba(0, 0, 0, .8);         /* cardBackgroundColorNight */
	--card-solid: #1e2326;
	--screen: #121212;
	--ink: #e7e7e7;                    /* colorLightText */
	--muted: #a2a8ab;
	--line: rgba(255, 255, 255, .14);
	--tint: rgba(143, 165, 174, .14);
	--surface: #1c2124;
	--bg: #121212;
	--link: #8fa8ff;
	--holiday: #de5959;                /* text_red_night */
	--bar: #2f4550;
	color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Фон — только у html: фон body рисовался бы поверх картины .bg (z-index: -1) */
html { background: var(--screen); }
html.on-text { background: var(--bg); }
body {
	margin: 0;
	min-height: 100%;
	background: transparent;
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-text-size-adjust: 100%;
}

button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { fill: currentColor; }

@font-face {
	font-family: "Triod";
	src: url("content/web/triod.ttf");
	font-display: swap;
}

/* ---------- Фон (MainFragment: im_background, centerCrop) ---------- */
.bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	/* Покров на Нерли в хорошем разрешении; на широком экране — обрезка сверху и снизу, храм в центре */
	background: #8fa5ae url("img/bg.jpg") center 42% / cover no-repeat;
}
.bg.is-christmas { background-image: url("img/im_bg_christmas.webp"); background-position: center; }
@media (orientation: landscape) {
	.bg.is-christmas { background-image: url("img/im_bg_christmas_land.webp"); }
}
body.on-text .bg, body.on-panel .bg { display: none; }

/* ---------- Верхняя панель ---------- */
.appbar {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 2px;
	height: var(--top);
	padding: var(--safe-top) 4px 0 4px;
	background: var(--bar);
	color: var(--bar-ink);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.appbar__title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 8px; }
.appbar__title b { overflow: hidden; font-size: 19px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.appbar__title small { overflow: hidden; font-size: 13px; opacity: .85; white-space: nowrap; text-overflow: ellipsis; }
.appbar__actions { display: flex; align-items: center; gap: 0; flex: none; }
/* На экране текста в панели — только печать и настройки (как меню UkazaniyaActivity);
   стрелки дней — на широком экране, на телефоне дни листаются свайпом */
body.on-text #ab-search, body.on-text #btn-pro, body.on-panel #ab-search { display: none; }
@media (max-width: 599px) { #ab-prev, #ab-next { display: none !important; } }

.icon-btn {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.icon-btn:active { background: rgba(255, 255, 255, .18); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm svg { width: 18px; height: 18px; }

.pro-chip {
	height: 28px;
	margin: 0 4px;
	padding: 0 10px;
	border: 1.5px solid rgba(255, 226, 168, .85);
	border-radius: 14px;
	background: transparent;
	color: #ffe2a8;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .06em;
	cursor: pointer;
}
.pro-chip.is-active { background: rgba(255, 226, 168, .2); }
.pro-chip.is-active::before { content: "★ "; }

.notice {
	position: fixed;
	top: calc(var(--top) + 8px);
	left: 12px;
	right: 12px;
	z-index: 15;
	max-width: 560px;
	margin: 0 auto;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--card-solid);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	font-size: 14px;
}

/* ---------- Нижняя навигация ---------- */
.bottomnav {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 20;
	display: flex;
	height: calc(var(--nav-h) + var(--safe-bottom));
	padding-bottom: var(--safe-bottom);
	background: var(--bar);
	box-shadow: 0 -1px 4px rgba(0, 0, 0, .15);
}
.bottomnav a {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	color: #fff;
	opacity: .72;
	font-size: 12px;
	text-decoration: none;
}
.bottomnav a.is-active { opacity: 1; font-weight: 600; }
.bottomnav svg { width: 24px; height: 24px; }
body.on-text .bottomnav, body.on-panel .bottomnav { display: none; }

/* ---------- Экраны ---------- */
.screen { padding-top: var(--top); padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }

/* Главная: карусель в нижней половине экрана (ViewPager2, height 50%, vertical bias 0.85) */
.screen--home {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.screen--home::before { content: ""; flex: 85 1 0; }
.screen--home::after { content: ""; flex: 15 1 0; }
.carousel {
	flex: none;
	display: flex;
	gap: 12px;
	height: min(50vh, 460px);
	height: min(50dvh, 460px);
	padding: 8px max(40px, calc(50% - 210px));
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.daycard {
	flex: 0 0 min(calc(100vw - 80px), 420px);
	display: flex;
	flex-direction: column;
	padding: 20px;
	border-radius: 20px;
	background: var(--card);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
	scroll-snap-align: center;
	scroll-snap-stop: always;
	transform-origin: center;
	transition: transform .12s linear, opacity .12s linear;
	cursor: pointer;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}
.daycard__date { font-size: 19px; font-weight: 700; line-height: 1.25; }
.daycard__dow { margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.daycard.is-holiday .daycard__date, .daycard.is-holiday .daycard__dow, .daycard.is-holiday .daycard__saints { color: var(--holiday); }
.daycard hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid var(--line); }
.daycard__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.daycard__saints {
	display: -webkit-box;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.45;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}
.daycard__saints p { display: inline; margin: 0; }
.daycard__saints img, .sign { height: 1em; width: auto; vertical-align: -.12em; margin-right: .15em; }
.daycard__reads { margin-top: 14px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.daycard__reads p { margin: 0; }
.daycard__reads a { color: var(--link); text-decoration: none; }
.daycard__reads strong { font-weight: 700; }

/* Кнопка как button_background приложения */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid var(--primary);
	border-radius: 24px;
	background: var(--primary);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	cursor: pointer;
}
.btn:active { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--ghost:active { background: var(--tint); }
:root[data-theme="night"] .btn--ghost { color: #9fc0cf; border-color: #9fc0cf; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn--danger { color: var(--cinnabar) !important; border-color: var(--cinnabar) !important; }

/* Экраны с карточками: календарь, дополнения */
.screen--cards { min-height: 100vh; padding-left: 8px; padding-right: 8px; }
.screen--cards > * { max-width: 600px; margin-left: auto !important; margin-right: auto !important; }
.card {
	margin: 8px 0;
	padding: 16px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.screen--cards .card:last-of-type { margin-bottom: 88px; }

/* Календарь (MaterialCalendarView) */
.card--cal { padding: 8px 8px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head strong { font-size: 17px; text-transform: capitalize; }
.cal-head .icon-btn { color: var(--primary); }
:root[data-theme="night"] .cal-head .icon-btn { color: #9fc0cf; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__dow { padding: 6px 0; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.cal__cell {
	position: relative;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 15px;
	cursor: pointer;
}
.cal__cell:disabled { color: var(--muted); opacity: .45; cursor: default; }
/* Постные дни: заливка, соседние дни сливаются, внешние углы скруглены (AbstinenceDecorator) */
/* Отступ одинаковый у всех постных клеток; со стороны соседнего постного дня — без отступа, чтобы слиться */
.cal__cell.is-fast::before {
	content: "";
	position: absolute;
	inset: 2px 3px;
	background: var(--fast);
	border-radius: 0;
}
.cal__cell.is-fast { color: #fff; }
.cal__cell.n-l::before { left: 0; }
.cal__cell.n-r::before { right: 0; }
.cal__cell.n-t::before { top: 0; }
.cal__cell.n-b::before { bottom: 0; }
.cal__cell.r-tl::before { border-top-left-radius: 12px; }
.cal__cell.r-tr::before { border-top-right-radius: 12px; }
.cal__cell.r-br::before { border-bottom-right-radius: 12px; }
.cal__cell.r-bl::before { border-bottom-left-radius: 12px; }
.cal__cell span {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
}
.cal__cell.is-holiday { color: var(--holiday); font-weight: 800; }
.cal__cell.is-fast.is-holiday { color: #ffd8d3; }
.cal__cell.is-today span { box-shadow: inset 0 0 0 2px var(--primary); font-weight: 800; }
.cal__cell.is-selected span { background: var(--selection); color: #fff; }

.card--day { cursor: pointer; border-radius: 20px; touch-action: pan-y; }
.card--day .cal-day__date { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.card--day.is-holiday .cal-day__date { color: var(--holiday); }
.card--day .cal-day__title { font-size: 15px; line-height: 1.45; }
.card--day .cal-day__title p { margin: 0 0 4px; }
.card--day img { height: 1em; vertical-align: -.12em; }
.card--day .cal-day__hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.card--reads { border-radius: 20px; font-size: 14px; line-height: 1.5; }
.card--reads p { margin: 0; }
.card--reads a { color: var(--link); text-decoration: none; }

.fab {
	position: fixed;
	right: 20px;
	bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px);
	z-index: 10;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 16px;
	background: var(--accent);
	color: #fff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
	cursor: pointer;
}
.fab svg { width: 24px; height: 24px; }

/* Дополнения */
.constructor h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; }
.constructor .warn { margin: 0 0 14px; font-style: italic; line-height: 1.4; }
.constructor label { display: grid; gap: 4px; margin-bottom: 12px; font-size: 16px; }
.constructor select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--card-solid);
	font-size: 16px;
}
.radios { display: grid; gap: 6px; margin: 4px 0 14px; }
.radios label { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.radios input { width: 20px; height: 20px; accent-color: var(--primary); }
.radios input:disabled + * , .radios label:has(input:disabled) { opacity: .45; }
.constructor .btn { margin-top: 4px; }
.constructor .small { margin: 10px 0 0; }
.materials h3 { margin: 0 0 6px; font-size: 17px; }
.materials button {
	display: block;
	width: 100%;
	padding: 14px 4px;
	border: 0;
	border-top: 1px solid var(--line);
	background: none;
	font-size: 16px;
	text-align: left;
	cursor: pointer;
}
.materials button:first-of-type { border-top: 0; }

/* ---------- Текст указаний ---------- */
.screen--text { min-height: 100vh; background: var(--bg); }
.u-text {
	max-width: 900px;
	margin: 0 auto;
	padding: 8px 12px calc(32px + var(--safe-bottom));
	font-size: 19px;
	overflow-wrap: break-word;
	transition: transform .18s ease, opacity .18s ease;
}
/* Прокрутка к службе / сноске — не под закреплённую шапку */
.u-text * { scroll-margin-top: calc(var(--top) + 8px); }
.u-text.slide-left { transform: translateX(-24px); opacity: 0; }
.u-text.slide-right { transform: translateX(24px); opacity: 0; }
/* Кнопка «наверх» и окно сносок из style.css — над нижним краем и вырезом iPhone */
.u-text .btn-up { bottom: calc(20px + var(--safe-bottom)) !important; }
.u-text .ln-note-popup { z-index: 40 !important; }
.u-text .overlay { z-index: 39 !important; }
mark.bogo-find { background: #ffe066; color: #000; border-radius: 2px; }
mark.bogo-find.bogo-cur { background: #ff9632; }

/* Окно «Печать и Word»: строка — служба, две кнопки */
.out-list { display: grid; gap: 6px; margin: 10px 0; }
.out-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.out-row span { flex: 1; font-weight: 600; }
.out-row .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }

/* ---------- Панель (расписание) ---------- */
.screen--panel { min-height: 100vh; background: var(--screen); }

/* ---------- Диалоги ---------- */
.sheet {
	width: min(560px, calc(100% - 24px));
	max-height: calc(100% - 48px);
	padding: 0;
	border: 0;
	border-radius: 20px;
	background: var(--surface);
	color: var(--ink);
	box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet--tall { height: calc(100% - 48px); }
/* Прокручивается только содержимое; заголовок, вкладки и кнопки внизу не сжимаются */
.sheet > * { flex-shrink: 0; }
.sheet > .sheet__body, .sheet > .reading { flex: 1 1 auto; flex-shrink: 1; min-height: 0; }
.sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 10px 10px 18px;
	border-bottom: 1px solid var(--line);
}
.sheet__head strong { font-size: 17px; }
.sheet__head .icon-btn:active { background: var(--tint); }
.sheet__body { overflow-y: auto; padding: 14px 18px 20px; -webkit-overflow-scrolling: touch; }
.sheet__body > p:first-child { margin-top: 0; }
.sheet__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px 16px;
	border-top: 1px solid var(--line);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Чтения */
.tabs { display: flex; gap: 4px; padding: 6px 12px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab {
	flex: 1 0 auto;
	padding: 10px 8px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: transparent;
	color: var(--muted);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.tab.is-active { border-bottom-color: var(--primary); color: var(--ink); }
.reading { overflow-y: auto; padding: 16px 18px 32px; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.reading h4 { margin: 0 0 12px; font-size: 1.05em; }
.reading--csutf { font-family: "Triod", serif; }
.reading font[color="grey"] { color: var(--muted); font-size: .8em; }

/* Настройки */
.settings { padding-top: 6px; }
.setting {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
}
.setting input[type="checkbox"] { flex: none; width: 22px; height: 22px; accent-color: var(--primary); }
.setting--col { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 12px 0; cursor: default; border-bottom: 0; }
.setting--col p { margin: 0; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .btn { min-height: 36px; padding: 4px 12px; text-transform: none; }
.stepper output { min-width: 2ch; font-weight: 700; text-align: center; }

@media (min-width: 900px) {
	.appbar { padding-left: 12px; padding-right: 12px; }
}


/* ================= PRO ================= */
.tool--pro { border-color: #e7c27d; color: #ffe2a8; }
.tool--pro.is-active { background: rgba(231, 194, 125, .18); }
.tool--pro.is-active::before { content: "★ "; }

/* flex-basis auto + min-height 0: Safari иначе сжимает тело окна до нуля, если высота окна не задана */
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px 20px; -webkit-overflow-scrolling: touch; }
.sheet__body > p:first-child { margin-top: 0; }
.small { font-size: 13px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.row-btns a.btn { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn--danger { color: var(--cinnabar) !important; border-color: var(--cinnabar) !important; }
.btn--danger:hover { background: var(--cinnabar) !important; color: #fff !important; }
.link-btn { padding: 6px 2px; border: 0; background: none; color: var(--primary); font-size: 14px; font-weight: 700; cursor: pointer; }
:root[data-theme="night"] .link-btn { color: #9fc0cf; }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm svg { width: 18px; height: 18px; }

.toast {
	position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 100;
	max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
	background: #2c3a41; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Окно PRO */
.pro-locked { padding: 10px 12px; border-left: 4px solid var(--cinnabar); border-radius: 0 10px 10px 0; background: var(--tint); }
.pro-status { font-size: 16px; }
.pro-features { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.pro-features li { display: grid; gap: 2px; padding-left: 26px; position: relative; }
.pro-features li::before { content: "✦"; position: absolute; left: 4px; top: 0; color: var(--cinnabar); }
.pro-features span { color: var(--muted); font-size: 14px; }
.pro-form { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--tint); }
.pro-form label, .form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.pro-form input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.pro-form .btn { justify-self: start; }
.pro-msg { margin: 0; font-size: 14px; }
.pro-tools { display: grid; gap: 8px; margin: 12px 0; }
.pro-tool, .pick {
	display: grid; gap: 2px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
	background: var(--surface); text-align: left; cursor: pointer; line-height: 1.35;
}
.pro-tool:hover, .pick:hover { border-color: var(--primary); }
.pro-tool span { color: var(--muted); font-size: 13px; }
.pick-list { display: grid; gap: 8px; margin: 10px 0; }
.pick--saint { display: block; }
.sign { height: 1em; width: auto; vertical-align: -.12em; margin-right: .2em; }

.sheet input, .sheet select, .sheet textarea {
	padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}

/* Поиск */
.search-form { display: flex; gap: 8px; position: sticky; top: -14px; padding: 4px 0 10px; background: var(--surface); }
.search-form input { flex: 1; min-width: 0; }
.hit { display: grid; gap: 4px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.hit:hover .hit__date { color: var(--primary); }
.hit__date { font-weight: 700; font-size: 14px; }
.hit__date i { color: var(--muted); font-weight: 400; }
.hit__text { font-size: 14px; line-height: 1.45; color: var(--muted); }
.hit mark { background: #ffe9a8; color: #1f2427; border-radius: 3px; padding: 0 1px; }

/* Толкования */
.interp section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.interp h4 { margin: 0 0 8px; color: var(--cinnabar); font-size: 1em; }
.interp__text { white-space: pre-line; line-height: 1.6; }
.interp .verse { display: block; margin-top: .6em; color: var(--muted); font-size: .85em; }
.interp__src { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--primary); }

/* Панель (расписание) */
.panel { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); }
.sch { max-width: 900px; margin: 0 auto; padding: 12px 14px calc(40px + var(--safe-bottom)); }
.sch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; }
.sch-head h2 { margin: 0; font-size: 22px; }
.sch-head .muted { font-size: 13px; }
.sch-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 16px; }
.sch-actions .btn { padding: 8px 14px; font-size: 13px; }
.sch-days { display: grid; gap: 10px; }
.sch-day { padding: 12px 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sch-day.is-festive { background: var(--tint); }
.sch-day header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.sch-day__date { font-size: 17px; font-weight: 800; }
.sch-day.is-holiday .sch-day__date, .sch-day.is-holiday .sch-day__dow { color: var(--cinnabar); }
.sch-day__dow { font-weight: 600; }
.sch-day__old { color: var(--muted); font-size: 13px; }
.sch-day__today { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sch-day__designation { margin: 0 0 4px; font-weight: 700; }
.sch-day__saints { margin: 0 0 6px; font-size: 14px; line-height: 1.45; }
.sch-day__saints p { margin: 0 0 4px; }
.sch-day__saints img, .sch-saints img { height: 1em; vertical-align: -.12em; }
.sch-day__notes { font-size: 13px; color: var(--muted); }
.sch-day__notes p { margin: 0 0 4px; }
.sch-saints { list-style: none; margin: 0 0 6px; padding: 0; }
.sch-saints li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 1.4; }
.sch-services { list-style: none; margin: 4px 0; padding: 0; border-top: 1px dashed var(--line); }
.sch-services button { display: flex; gap: 14px; width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px dashed var(--line); background: none; text-align: left; cursor: pointer; }
.sch-services button:hover span { color: var(--primary); }
.sch-services time { color: var(--cinnabar); font-weight: 800; font-variant-numeric: tabular-nums; }
.sch-services i { color: var(--muted); font-size: .9em; }
.sch-services time { min-width: 3em; }
.sch-services time.muted { color: var(--muted); font-weight: 400; }
.sch-clergy { display: block; color: var(--muted); font-style: italic; font-size: .85em; margin-top: 2px; }
.edit-list li.is-editing { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.edit-list li .link-btn + .link-btn { margin-left: 10px; }
.type-editor { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.type-editor .add-row + .add-row { margin-top: 6px; }
.sch-day__none { margin: 4px 0; font-size: 14px; }
.sch-day footer { display: flex; gap: 16px; }
.sch-float { position: fixed; left: 50%; bottom: calc(16px + var(--safe-bottom)); z-index: 20; display: flex; gap: 8px;
  padding: 6px; border-radius: 999px; background: var(--card-solid); box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s ease; }
.sch-float.is-shown { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sch-float .btn { padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.sch { padding-bottom: calc(80px + var(--safe-bottom)); }
.sch-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.sch-locked { max-width: 520px; margin: 40px auto; padding: 0 18px; text-align: center; line-height: 1.5; }

/* Формы расписания */
.form { display: grid; gap: 12px; }
.form h3 { margin: 10px 0 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--cinnabar); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form p.small { margin: -6px 0 0; }
.form .check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.check small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.form .check--inline { align-items: center; font-size: 14px; }
.edit-list { list-style: none; margin: 0; padding: 0; }
.edit-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.35; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row input { flex: 1 1 160px; min-width: 0; }
.rule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rule-row select { flex: 1 1 140px; min-width: 0; font-size: 14px; }
.tpl-new { padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.tpl-new summary { color: var(--primary); font-weight: 700; cursor: pointer; }
.tpl-new label { margin-top: 10px; }
