/* Прототип таблицы расписания — Неусыпная Псалтирь */

.np-schedule {
	--np-primary: #2c5282;
	--np-primary-light: #ebf4ff;
	--np-today: #fef3c7;
	--np-today-border: #f59e0b;
	--np-mine: #f0fdf4;
	--np-mine-border: #22c55e;
	--np-quiet: #f3f4f6;
	--np-pre-pascha: #ede9fe;
	--np-pre-pascha-border: #c4b5fd;
	--np-bright: #dc2626;
	--np-bright-border: #b91c1c;
	--np-bright-text: #ffffff;
	--np-read: #dcfce7;
	--np-read-border: #16a34a;
	--np-border: #e5e7eb;
	--np-text: #1f2937;
	--np-text-muted: #6b7280;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--np-text);
	max-width: 100%;
	margin: 0 auto;
	padding: 1rem;
	box-sizing: border-box;
}

.np-schedule *,
.np-schedule *::before,
.np-schedule *::after {
	box-sizing: border-box;
}

.np-schedule__title {
	margin: 0 0 1rem;
	font-size: 1.35rem;
	font-weight: 600;
}

.np-schedule__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: flex-end;
	margin-bottom: 1rem;
}

.np-schedule__control {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
	color: var(--np-text-muted);
}

.np-schedule__select {
	min-height: 44px;
	padding: 0.4rem 0.6rem;
	font-size: 1rem;
	border: 1px solid var(--np-border);
	border-radius: 6px;
	background: #fff;
}

.np-schedule__btn {
	min-height: 44px;
	padding: 0.5rem 1rem;
	font-size: 0.95rem;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.np-schedule__btn--primary {
	background: var(--np-primary);
	color: #fff;
}

.np-schedule__btn--secondary {
	background: #fff;
	color: var(--np-primary);
	border-color: var(--np-border);
}

.np-schedule__alert {
	padding: 1rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	margin-bottom: 1rem;
}

.np-schedule__today {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	padding: 0.85rem 1rem;
	background: var(--np-primary-light);
	border-radius: 8px;
	margin-bottom: 1rem;
}

.np-schedule__today--quiet {
	background: var(--np-quiet);
}

.np-schedule__today-text {
	margin: 0;
	font-size: 1rem;
}

.np-schedule__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--np-border);
	border-radius: 8px;
	margin-bottom: 1.5rem;
}

.np-schedule__table {
	width: max-content;
	min-width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.np-schedule__th,
.np-schedule__td {
	border: 1px solid var(--np-border);
	padding: 0.45rem 0.5rem;
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
}

.np-schedule__th--sticky,
.np-schedule__td--sticky {
	position: sticky;
	left: 0;
	z-index: 2;
	background: #fff;
	text-align: left;
	min-width: 140px;
	max-width: 200px;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.np-schedule__td--names {
	white-space: normal;
}

.np-schedule__name {
	display: block;
	line-height: 1.35;
}

.np-schedule__name + .np-schedule__name {
	margin-top: 0.2rem;
	color: var(--np-text-muted);
	font-size: 0.82rem;
}

.np-schedule__th--day,
.np-schedule__td--kathisma {
	min-width: 2.1rem;
}

.np-schedule__th--today,
.np-schedule__td--today-col {
	background: var(--np-today);
}

.np-schedule__th--today {
	box-shadow: inset 0 -3px 0 var(--np-today-border);
}

.np-schedule__row:hover .np-schedule__td:not(.np-schedule__td--pre-pascha):not(.np-schedule__td--bright):not(.np-schedule__td--quiet),
.np-schedule__row:focus-within .np-schedule__td:not(.np-schedule__td--pre-pascha):not(.np-schedule__td--bright):not(.np-schedule__td--quiet),
.np-schedule__row--hover .np-schedule__td:not(.np-schedule__td--pre-pascha):not(.np-schedule__td--bright):not(.np-schedule__td--quiet) {
	background: #f8fafc;
}

.np-schedule__row:hover .np-schedule__td--pre-pascha,
.np-schedule__row--hover .np-schedule__td--pre-pascha {
	background: var(--np-pre-pascha) !important;
}

.np-schedule__row:hover .np-schedule__td--bright,
.np-schedule__row--hover .np-schedule__td--bright {
	background: var(--np-bright) !important;
}

.np-schedule__row--mine .np-schedule__td--sticky {
	background: var(--np-mine);
	border-left: 3px solid var(--np-mine-border);
}

.np-schedule__row--mine:hover .np-schedule__td--sticky,
.np-schedule__row--mine.np-schedule__row--hover .np-schedule__td--sticky {
	background: #dcfce7;
}

.np-schedule__td--quiet {
	color: var(--np-text-muted);
	background: var(--np-quiet);
	border: 1px solid transparent !important;
	box-shadow: none !important;
}

.np-schedule__th--pre-pascha,
.np-schedule__td--pre-pascha {
	background: var(--np-pre-pascha) !important;
	border: 1px solid transparent !important;
	box-shadow: none !important;
}

.np-schedule__th--bright,
.np-schedule__td--bright {
	background: var(--np-bright) !important;
	color: var(--np-bright-text) !important;
	border: 1px solid transparent !important;
	box-shadow: none !important;
}

.np-schedule__th--bright {
	box-shadow: none !important;
}

.np-schedule__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: var(--np-text-muted);
}

.np-schedule__legend li {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.np-schedule__legend-swatch {
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 3px;
	border: 1px solid var(--np-border);
}

.np-schedule__legend-swatch--pre-pascha {
	background: var(--np-pre-pascha);
	border-color: var(--np-pre-pascha-border);
}

.np-schedule__legend-swatch--bright {
	background: var(--np-bright);
	border-color: var(--np-bright-border);
}

.np-schedule__td--read {
	background: var(--np-read) !important;
	box-shadow: inset 0 0 0 2px var(--np-read-border);
	font-weight: 600;
}

.np-schedule__td[data-np-markable] {
	cursor: pointer;
}

.np-schedule__th--hidden,
.np-schedule__td--hidden {
	display: none;
}

.np-schedule--show-contacts .np-schedule__th--contact,
.np-schedule--show-contacts .np-schedule__td--contact {
	display: table-cell;
}

.np-schedule__prayer-list {
	padding: 1rem;
	background: #fafafa;
	border: 1px solid var(--np-border);
	border-radius: 8px;
}

.np-schedule__prayer-title {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
}

.np-schedule__prayer-hint {
	margin: 0 0 0.75rem;
	color: var(--np-text-muted);
	font-size: 0.9rem;
}

.np-schedule__prayer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.np-schedule__prayer-names {
	margin: 0;
	padding-left: 1.25rem;
	columns: 2;
	column-gap: 2rem;
}

@media (max-width: 600px) {
	.np-schedule__prayer-names {
		columns: 1;
	}

	.np-schedule__th--sticky,
	.np-schedule__td--sticky {
		min-width: 110px;
		max-width: 130px;
		font-size: 0.8rem;
	}
}

.np-schedule__meta {
	margin-top: 1rem;
	font-size: 0.8rem;
	color: var(--np-text-muted);
}

.np-schedule__login {
	max-width: 28rem;
}

.np-schedule__login-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1rem;
}

.np-schedule__input {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	border: 1px solid var(--np-border);
	border-radius: 6px;
}

.np-schedule__alert--ok {
	background: var(--np-read);
	border: 1px solid var(--np-read-border);
	padding: 0.75rem 1rem;
	border-radius: 6px;
}

.np-schedule__today--sub {
	background: #eff6ff;
	border: 1px solid #93c5fd;
}

.np-schedule__btn--hidden {
	display: none !important;
}

/* —— Фаза C: мобильный вид, темы —— */

.np-schedule__compact {
	display: none;
	margin: 1rem 0;
	padding: 1rem;
	border: 1px solid var(--np-border);
	border-radius: 8px;
	background: #fafafa;
}

.np-schedule__compact-title {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
}

.np-schedule__compact-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.np-schedule__compact-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--np-border);
}

.np-schedule__compact-item--today {
	background: var(--np-today);
	margin: 0 -0.5rem;
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	border-radius: 6px;
}

.np-schedule__compact-item--read .np-schedule__compact-k {
	color: #16a34a;
	font-weight: 600;
}

.np-schedule__compact-sub {
	font-size: 0.85rem;
	color: var(--np-text-muted);
	width: 100%;
}

.np-schedule__sub {
	font-size: 0.7rem;
	color: var(--np-text-muted);
}

.np-schedule__td--sub {
	background: #eff6ff;
}

.np-schedule--mine-only .np-schedule__row:not(.np-schedule__row--mine) {
	display: none;
}

.np-schedule--mine-only .np-schedule__table-wrap {
	overflow-x: auto;
}

.np-schedule--mine-only .np-schedule__compact {
	display: block;
}

.np-schedule--large {
	font-size: 1.12rem;
}

.np-schedule--large .np-schedule__table {
	font-size: 1rem;
}

.np-schedule--large .np-schedule__btn {
	min-height: 48px;
	font-size: 1.05rem;
}

.np-schedule--dark {
	--np-text: #f3f4f6;
	--np-text-muted: #9ca3af;
	--np-border: #374151;
	--np-primary-light: #1e3a5f;
	--np-today: #422006;
	--np-mine: #052e16;
	--np-quiet: #1f2937;
	--np-pre-pascha: #2e1065;
	--np-pre-pascha-border: #6d28d9;
	--np-bright: #b91c1c;
	--np-bright-border: #dc2626;
	--np-bright-text: #fef2f2;
	--np-read: #14532d;
	background: #111827;
	color: var(--np-text);
}

.np-schedule--dark .np-schedule__compact {
	background: #1f2937;
}

.np-schedule--dark .np-schedule__table {
	background: #1f2937;
}

.np-schedule--dark .np-schedule__th,
.np-schedule--dark .np-schedule__td {
	border-color: var(--np-border);
}

@media (max-width: 768px) {
	.np-schedule__compact {
		display: block;
	}

	.np-schedule__table-wrap {
		display: none;
	}

	.np-schedule--mine-only .np-schedule__table-wrap {
		display: block;
	}

	.np-schedule--mine-only .np-schedule__compact {
		display: block;
	}
}

@media (min-width: 769px) {
	.np-schedule--mine-only .np-schedule__compact {
		display: none;
	}
}
