/**
 * Standalone Mosque TV Display Styles.
 */

/* ==========================================================================
   1. RESET & VARIABLE DEFINITIONS
   ========================================================================== */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--tv-font-sans: 'Plus Jakarta Sans', 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--tv-font-arabic: 'Readex Pro', 'Cairo', sans-serif;
	--tv-font-quran: 'Amiri', 'Cairo', serif;
}

/* Theme: Dark Mode (Default) */
.itmms-tv--theme-dark {
	--tv-bg: radial-gradient(circle at 50% 50%, #171b26 0%, #0d0f16 100%);
	--tv-surface: rgba(26, 32, 46, 0.7);
	--tv-surface-hover: rgba(34, 42, 60, 0.85);
	--tv-primary: #176654;
	--tv-accent: #d8b248;
	--tv-text: #ffffff;
	--tv-muted: #9ba3b0;
	--tv-border: rgba(255, 255, 255, 0.08);
	--tv-current-bg: linear-gradient(135deg, rgba(23, 102, 84, 0.28) 0%, rgba(216, 178, 72, 0.1) 100%);
	--tv-current-border: rgba(216, 178, 72, 0.45);
	--tv-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Theme: Light Mode */
.itmms-tv--theme-light {
	--tv-bg: radial-gradient(circle at 50% 50%, #f4f6fa 0%, #e2e7f0 100%);
	--tv-surface: rgba(255, 255, 255, 0.85);
	--tv-surface-hover: rgba(255, 255, 255, 0.95);
	--tv-primary: #176654;
	--tv-accent: #c09b35;
	--tv-text: #0f172a;
	--tv-muted: #64748b;
	--tv-border: rgba(15, 23, 42, 0.08);
	--tv-current-bg: linear-gradient(135deg, rgba(23, 102, 84, 0.12) 0%, rgba(192, 155, 53, 0.08) 100%);
	--tv-current-border: rgba(23, 102, 84, 0.4);
	--tv-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* Theme: Green Mode */
.itmms-tv--theme-green {
	--tv-bg: radial-gradient(circle at 50% 50%, #0d382d 0%, #051a14 100%);
	--tv-surface: rgba(14, 48, 39, 0.7);
	--tv-surface-hover: rgba(20, 68, 56, 0.85);
	--tv-primary: #176654;
	--tv-accent: #e5be53;
	--tv-text: #ffffff;
	--tv-muted: #a3b8b3;
	--tv-border: rgba(255, 255, 255, 0.08);
	--tv-current-bg: linear-gradient(135deg, rgba(23, 102, 84, 0.3) 0%, rgba(229, 190, 83, 0.1) 100%);
	--tv-current-border: rgba(229, 190, 83, 0.5);
	--tv-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Royal blue and purple TV palettes. */
.itmms-tv--theme-blue {
 --tv-bg: radial-gradient(circle at 50% 40%, #142b50 0%, #061326 100%);
 --tv-surface: rgba(18, 43, 78, .82); --tv-surface-hover: rgba(28, 61, 105, .92);
 --tv-primary: #2876c7; --tv-accent: #d7e8ff; --tv-text: #fff; --tv-muted: #b3c5df;
 --tv-border: rgba(215,232,255,.16); --tv-current-bg: linear-gradient(135deg,rgba(40,118,199,.34),rgba(215,232,255,.12));
 --tv-current-border: rgba(215,232,255,.55); --tv-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.itmms-tv--theme-purple {
 --tv-bg: radial-gradient(circle at 50% 40%, #35204f 0%, #140d24 100%);
 --tv-surface: rgba(54, 34, 78, .82); --tv-surface-hover: rgba(76, 48, 108, .92);
 --tv-primary: #8052b8; --tv-accent: #f0ce72; --tv-text: #fff; --tv-muted: #c5b5d8;
 --tv-border: rgba(240,206,114,.18); --tv-current-bg: linear-gradient(135deg,rgba(128,82,184,.34),rgba(240,206,114,.12));
 --tv-current-border: rgba(240,206,114,.55); --tv-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.itmms-tv__weather { display:flex; align-items:center; gap:clamp(8px,1vw,18px); padding:clamp(10px,1.2vw,18px) clamp(14px,1.5vw,24px); border:1px solid var(--tv-border); border-radius:18px; background:var(--tv-surface); color:var(--tv-text); min-width:180px; }
.itmms-tv__weather-icon { font-size:clamp(26px,3vw,48px); }
.itmms-tv__weather-temp { font-size:clamp(25px,3vw,48px); font-weight:800; }
.itmms-tv__weather-details { display:flex; flex-direction:column; gap:4px; font-size:clamp(12px,1vw,17px); }
.itmms-tv__weather-details small { color:var(--tv-muted); }
@media (max-width: 900px) { .itmms-tv__weather { min-width:0; } }

/* ==========================================================================
   2. FONT SIZING SCALES
   ========================================================================== */
.itmms-tv--size-small {
	--tv-scale: 0.85;
}
.itmms-tv--size-normal {
	--tv-scale: 1;
}
.itmms-tv--size-large {
	--tv-scale: 1.15;
}
.itmms-tv--size-xlarge {
	--tv-scale: 1.3;
}

/* ==========================================================================
   3. BASE LAYOUT & WRAPPER
   ========================================================================== */
body.itmms-tv {
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	background: var(--tv-bg);
	color: var(--tv-text);
	font-family: var(--tv-font-sans);
	position: relative;
	display: flex;
	flex-direction: column;
}

/* Language fonts (body has class; html has lang) */
.itmms-tv--lang-ar,
html[lang^="ar"] body.itmms-tv {
	font-family: var(--tv-font-arabic);
}

.itmms-tv--lang-ar .itmms-tv__table-header,
.itmms-tv--lang-ar .itmms-tv__countdown-label,
.itmms-tv--lang-ar .itmms-tv__alert-badge,
.itmms-tv--lang-ar .itmms-tv__quiet-eyebrow,
.itmms-tv--lang-ar .itmms-tv__ticker-label,
.itmms-tv--lang-ar .itmms-tv__notices-head {
	letter-spacing: 0.04em;
	text-transform: none;
}

/* Geometric Islamic Background Pattern Overlay */
.itmms-tv__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	opacity: 0.055;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.5'%3E%3Cpath d='M50 0 L55 18 L71 7 L65 25 L83 20 L72 35 L89 41 L74 50 L89 59 L72 65 L83 80 L65 75 L71 93 L55 82 L50 100 L45 82 L29 93 L35 75 L17 80 L28 65 L11 59 L26 50 L11 41 L28 35 L17 20 L35 25 L29 7 L45 18 Z'/%3E%3Ccircle cx='50' cy='50' r='10'/%3E%3Ccircle cx='50' cy='50' r='30'/%3E%3Cpath d='M0 0 L10 10 M100 0 L90 10 M0 100 L10 90 M100 100 L90 90'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 100px 100px;
}

.itmms-tv--theme-light .itmms-tv__bg {
	opacity: 0.05;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23000000' stroke-width='0.5'%3E%3Cpath d='M50 0 L55 18 L71 7 L65 25 L83 20 L72 35 L89 41 L74 50 L89 59 L72 65 L83 80 L65 75 L71 93 L55 82 L50 100 L45 82 L29 93 L35 75 L17 80 L28 65 L11 59 L26 50 L11 41 L28 35 L17 20 L35 25 L29 7 L45 18 Z'/%3E%3Ccircle cx='50' cy='50' r='10'/%3E%3Ccircle cx='50' cy='50' r='30'/%3E%3Cpath d='M0 0 L10 10 M100 0 L90 10 M0 100 L10 90 M100 100 L90 90'/%3E%3C/g%3E%3C/svg%3E");
}

.itmms-tv__wrapper {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	padding: calc(20px * var(--tv-scale)) calc(24px * var(--tv-scale));
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: calc(20px * var(--tv-scale));
}

/* ==========================================================================
   4. HEADER SECTION
   ========================================================================== */
.itmms-tv__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 2px solid var(--tv-border);
	padding-bottom: calc(16px * var(--tv-scale));
}

.itmms-tv__logo-area {
	display: flex;
	align-items: center;
	gap: calc(16px * var(--tv-scale));
}

.itmms-tv__logo {
	height: calc(64px * var(--tv-scale));
	width: auto;
	object-fit: contain;
}

.itmms-tv__header h1 {
	font-size: calc(28px * var(--tv-scale));
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.itmms-tv__subtitle {
	font-size: calc(14px * var(--tv-scale));
	color: var(--tv-muted);
	font-weight: 500;
	margin-top: calc(2px * var(--tv-scale));
}

.itmms-tv__date-time {
	text-align: right;
}

.itmms-tv__time {
	font-size: calc(36px * var(--tv-scale));
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
	line-height: 1;
}

.itmms-tv__date {
	font-size: calc(22px * var(--tv-scale));
	color: var(--tv-text);
	font-weight: 600;
	margin-top: calc(6px * var(--tv-scale));
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: calc(8px * var(--tv-scale));
}

.itmms-tv__hijri-dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--tv-accent);
}

/* ==========================================================================
   5. MAIN GRID & TABLE
   ========================================================================== */
.itmms-tv__main {
	flex: 1;
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: calc(24px * var(--tv-scale));
	min-height: 0; /* Important to keep nested items within layout height limits */
}

.itmms-tv__table-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
}

.itmms-tv__table {
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: calc(12px * var(--tv-scale));
	box-shadow: var(--tv-shadow);
	backdrop-filter: blur(10px);
	padding: calc(10px * var(--tv-scale));
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	height: 100%;
}

.itmms-tv__table-header {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	padding: calc(10px * var(--tv-scale)) calc(24px * var(--tv-scale));
	font-size: calc(22px * var(--tv-scale));
	font-weight: 900;
	text-transform: uppercase;
	color: var(--tv-text);
	letter-spacing: 0.05em;
	border-bottom: 1px dashed var(--tv-border);
}

.itmms-tv__table-row {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr 1fr;
	align-items: center;
	padding: calc(12px * var(--tv-scale)) calc(24px * var(--tv-scale));
	border-radius: calc(8px * var(--tv-scale));
	transition: all 0.3s ease;
	border: 1px solid transparent;
}

.itmms-tv__table-row:not(:last-child) {
	margin-bottom: calc(4px * var(--tv-scale));
}

.itmms-tv__prayer-name {
	font-size: calc(23px * var(--tv-scale));
	font-weight: 700;
}

.itmms-tv__time-azan {
	font-size: calc(21px * var(--tv-scale));
	font-weight: 600;
	color: var(--tv-muted);
}

.itmms-tv__time-iqamah {
	font-size: calc(24px * var(--tv-scale));
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

/* Sunrise / Ishraq / Zawal helper rows */
.itmms-tv__table-row.is-sunrise,
.itmms-tv__table-row.is-extra {
	opacity: 0.78;
}

.itmms-tv__table-row.is-sunrise .itmms-tv__prayer-name,
.itmms-tv__table-row.is-extra .itmms-tv__prayer-name {
	font-size: calc(20px * var(--tv-scale));
	font-weight: 600;
}

.itmms-tv__table-row.is-sunrise .itmms-tv__time-iqamah,
.itmms-tv__table-row.is-extra .itmms-tv__time-iqamah {
	color: var(--tv-muted);
	font-weight: 500;
	font-size: calc(18px * var(--tv-scale));
}

.itmms-tv__table-row.is-ishraq,
.itmms-tv__table-row.is-zawal {
	border-style: dashed;
}

.itmms-tv__table-row.is-zawal .itmms-tv__prayer-name {
	color: var(--tv-accent);
}

/* Current Highlighted Row */
.itmms-tv__table-row.is-current {
	background: var(--tv-current-bg);
	border-color: var(--tv-current-border);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	position: relative;
}

.itmms-tv__table-row.is-current .itmms-tv__prayer-name {
	color: var(--tv-accent);
}

.itmms-tv__table-row.is-current .itmms-tv__time-azan {
	color: var(--tv-text);
}

.itmms-tv__table-row.is-current::before {
	content: "";
	position: absolute;
	left: calc(10px * var(--tv-scale));
	top: 50%;
	transform: translateY(-50%);
	width: calc(6px * var(--tv-scale));
	height: calc(6px * var(--tv-scale));
	border-radius: 50%;
	background: var(--tv-accent);
	box-shadow: 0 0 10px var(--tv-accent);
	animation: itmms-pulse 1.8s infinite;
}

/* Next Iqamah / next Azan emphasis */
.itmms-tv__table-row.is-next-iqamah {
	border-color: rgba(216, 178, 72, 0.55);
	background: linear-gradient(135deg, rgba(216, 178, 72, 0.12) 0%, rgba(30, 133, 113, 0.08) 100%);
	box-shadow: 0 0 0 1px rgba(216, 178, 72, 0.2);
}

.itmms-tv__table-row.is-next-iqamah .itmms-tv__time-iqamah {
	color: var(--tv-accent);
	text-shadow: 0 0 18px rgba(216, 178, 72, 0.35);
}

.itmms-tv__table-row.is-next-azan:not(.is-current) {
	border-color: rgba(30, 133, 113, 0.35);
}

.itmms-tv__table-row.is-next-azan:not(.is-current) .itmms-tv__time-azan {
	color: var(--tv-primary);
	font-weight: 700;
}

.itmms-tv--theme-light .itmms-tv__table-row.is-next-iqamah {
	background: linear-gradient(135deg, rgba(192, 155, 53, 0.12) 0%, rgba(23, 102, 84, 0.06) 100%);
}

/* ==========================================================================
   6. SIDEBAR PANELS
   ========================================================================== */
.itmms-tv__sidebar {
	display: flex;
	flex-direction: column;
	gap: calc(20px * var(--tv-scale));
	height: 100%;
}

/* Countdown Widget */
.itmms-tv__countdown-box {
	flex: 1.2;
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: calc(12px * var(--tv-scale));
	box-shadow: var(--tv-shadow);
	backdrop-filter: blur(10px);
	padding: calc(20px * var(--tv-scale));
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	border-top: 4px solid var(--tv-accent);
}

.itmms-tv__countdown-label {
	font-size: calc(13px * var(--tv-scale));
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--tv-accent);
	margin-bottom: calc(4px * var(--tv-scale));
}

.itmms-tv__next-name {
	font-size: calc(34px * var(--tv-scale));
	font-weight: 800;
	letter-spacing: -0.01em;
	margin-bottom: calc(10px * var(--tv-scale));
	line-height: 1.1;
}

.itmms-tv__countdown-timer {
	font-size: calc(60px * var(--tv-scale));
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1;
	color: var(--tv-text);
	text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.itmms-tv__alert-badge {
	margin-top: calc(14px * var(--tv-scale));
	padding: calc(6px * var(--tv-scale)) calc(14px * var(--tv-scale));
	border-radius: 999px;
	font-size: calc(12px * var(--tv-scale));
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #111;
	background: var(--tv-accent);
	box-shadow: 0 0 20px rgba(216, 178, 72, 0.45);
}

.itmms-tv__countdown-box.is-alert {
	border-color: rgba(216, 178, 72, 0.55);
	box-shadow: 0 0 0 1px rgba(216, 178, 72, 0.25), 0 12px 40px rgba(0, 0, 0, 0.35);
	animation: itmms-tv-alert-pulse 1.6s ease-in-out infinite;
}

.itmms-tv__countdown-box.is-alert-critical {
	border-color: rgba(239, 68, 68, 0.7);
	animation: itmms-tv-alert-critical 0.9s ease-in-out infinite;
}

.itmms-tv__countdown-box.is-alert-critical .itmms-tv__alert-badge {
	background: #ef4444;
	color: #fff;
	box-shadow: 0 0 24px rgba(239, 68, 68, 0.55);
}

.itmms-tv__countdown-box.is-target-jamaat {
	border-top-color: var(--tv-accent);
}

.itmms-tv__countdown-box.is-target-azan {
	border-top-color: var(--tv-primary);
}

@keyframes itmms-tv-alert-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.015); }
}

@keyframes itmms-tv-alert-critical {
	0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
	50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.itmms-tv--theme-light .itmms-tv__countdown-timer {
	text-shadow: none;
}

/* Jumuah Schedule Card */
.itmms-tv__jumuah-box {
	flex: 0.8;
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: calc(12px * var(--tv-scale));
	box-shadow: var(--tv-shadow);
	backdrop-filter: blur(10px);
	padding: calc(16px * var(--tv-scale)) calc(20px * var(--tv-scale));
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.itmms-tv__jumuah-header {
	font-size: calc(22px * var(--tv-scale));
	font-weight: 900;
	text-transform: uppercase;
	color: var(--tv-text);
	letter-spacing: 0.06em;
	margin-bottom: calc(8px * var(--tv-scale));
	border-bottom: 1px dashed var(--tv-border);
	padding-bottom: calc(6px * var(--tv-scale));
}

.itmms-tv__jumuah-sessions {
	display: flex;
	flex-direction: column;
	gap: calc(8px * var(--tv-scale));
	flex: 1;
	justify-content: center;
}

.itmms-tv__jumuah-session {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.itmms-tv__jumuah-label {
	font-size: calc(23px * var(--tv-scale));
	font-weight: 900;
}

.itmms-tv__jumuah-times {
	text-align: right;
	font-size: calc(22px * var(--tv-scale));
	font-weight: 800;
	color: var(--tv-text);
}

.itmms-tv__jumuah-times span {
	margin-left: calc(10px * var(--tv-scale));
}

.itmms-tv__jumuah-times b {
	color: var(--tv-text);
	font-weight: 900;
	font-size: 1.12em;
}

/* ==========================================================================
   7. FOOTER & TICKER BANNER (continuous horizontal scroll)
   ========================================================================== */
.itmms-tv__footer {
	height: calc(56px * var(--tv-scale));
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: calc(8px * var(--tv-scale));
	box-shadow: var(--tv-shadow);
	overflow: hidden;
	display: flex;
	align-items: center;
}

.itmms-tv__ticker-label {
	background: var(--tv-primary);
	color: #ffffff;
	font-weight: 800;
	font-size: calc(13px * var(--tv-scale));
	text-transform: uppercase;
	letter-spacing: 0.05em;
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 calc(20px * var(--tv-scale));
	border-right: 1px solid var(--tv-border);
	white-space: nowrap;
	z-index: 10;
	flex-shrink: 0;
}

.itmms-tv__ticker-content {
	flex: 1;
	height: 100%;
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
	mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.itmms-tv__ticker-track {
	display: flex;
	flex-direction: row;
	align-items: center;
	width: max-content;
	height: 100%;
	will-change: transform;
}

.itmms-tv__ticker-item {
	display: inline-flex;
	align-items: center;
	height: 100%;
	padding: 0 calc(28px * var(--tv-scale));
	font-size: calc(17px * var(--tv-scale));
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

.itmms-tv__ticker-item strong {
	font-weight: 800;
}

.itmms-tv__ticker-sep {
	margin: 0 calc(10px * var(--tv-scale));
	color: var(--tv-muted);
	font-weight: 500;
}

.itmms-tv__ticker-body {
	color: var(--tv-muted);
	font-weight: 500;
}

.itmms-tv__ticker-bullet {
	width: calc(8px * var(--tv-scale));
	height: calc(8px * var(--tv-scale));
	border-radius: 50%;
	background: var(--tv-accent);
	display: inline-block;
	margin-right: calc(12px * var(--tv-scale));
	flex-shrink: 0;
}

@keyframes itmms-tv-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

.itmms-tv__ticker-track.is-scrolling {
	animation: itmms-tv-marquee linear infinite;
}

[dir="rtl"] .itmms-tv__ticker-content {
	mask-image: linear-gradient(270deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

[dir="rtl"] .itmms-tv__ticker-track.is-scrolling {
	animation-name: itmms-tv-marquee-rtl;
}

@keyframes itmms-tv-marquee-rtl {
	from { transform: translateX(0); }
	to { transform: translateX(50%); }
}

/* RTL layout fixes */
[dir="rtl"] .itmms-tv__ticker-bullet {
	margin-right: 0;
	margin-left: calc(12px * var(--tv-scale));
}
[dir="rtl"] .itmms-tv__ticker-label {
	border-right: 0;
	border-left: 1px solid var(--tv-border);
}
[dir="rtl"] .itmms-tv__logo-area {
	text-align: right;
}
[dir="rtl"] .itmms-tv__date-time {
	text-align: left;
}
[dir="rtl"] .itmms-tv__date {
	justify-content: flex-start;
}
[dir="rtl"] .itmms-tv__jumuah-times {
	text-align: left;
}
[dir="rtl"] .itmms-tv__jumuah-times span {
	margin-left: 0;
	margin-right: calc(10px * var(--tv-scale));
}
[dir="rtl"] .itmms-tv__table-row.is-current::before {
	left: auto;
	right: calc(10px * var(--tv-scale));
}

/* ==========================================================================
   8. KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes itmms-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(216, 178, 72, 0.7);
	}
	70% {
		box-shadow: 0 0 0 10px rgba(216, 178, 72, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(216, 178, 72, 0);
	}
}

/* Helper align classes */
.text-center {
	text-align: center;
}
.text-right {
	text-align: right;
}
[dir="rtl"] .text-right {
	text-align: left;
}

/* ==========================================================================
   9. LAYOUT TEMPLATES
   ========================================================================== */
.itmms-tv__stage {
	flex: 1;
	min-height: 0;
	position: relative;
	display: flex;
	flex-direction: column;
}

.itmms-tv__slide {
	flex: 1;
	min-height: 0;
	display: none;
	opacity: 0;
	animation: none;
}

.itmms-tv__slide.is-active {
	display: flex;
	flex-direction: column;
	opacity: 1;
	animation: itmms-tv-fade 0.55s ease;
}

@keyframes itmms-tv-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Split: countdown dominates left, table right */
.itmms-tv--layout-split .itmms-tv__main {
	grid-template-columns: 0.9fr 1.1fr;
}

.itmms-tv--layout-split .itmms-tv__sidebar {
	order: -1;
}

.itmms-tv--layout-split .itmms-tv__countdown-box {
	min-height: calc(280px * var(--tv-scale));
	justify-content: center;
}

.itmms-tv--layout-split .itmms-tv__countdown-timer {
	font-size: calc(64px * var(--tv-scale));
}

.itmms-tv--layout-split .itmms-tv__next-name {
	font-size: calc(34px * var(--tv-scale));
}

/* Focus: hero countdown on top, compact prayer strip below */
.itmms-tv--layout-focus .itmms-tv__main {
	grid-template-columns: 1fr;
	grid-template-rows: auto 1fr;
	gap: calc(16px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__sidebar {
	order: -1;
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: calc(16px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__countdown-box {
	min-height: calc(220px * var(--tv-scale));
	padding: calc(28px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__countdown-timer {
	font-size: calc(72px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__next-name {
	font-size: calc(36px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__table-header {
	display: none;
}

.itmms-tv--layout-focus .itmms-tv__table {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: calc(10px * var(--tv-scale));
	height: auto;
	justify-content: stretch;
}

.itmms-tv--layout-focus .itmms-tv__table-row {
	flex-direction: column;
	align-items: flex-start;
	gap: calc(6px * var(--tv-scale));
	padding: calc(14px * var(--tv-scale));
	border-radius: 14px;
	display: flex;
	margin-bottom: 0;
}

.itmms-tv--layout-focus .itmms-tv__time-azan,
.itmms-tv--layout-focus .itmms-tv__time-iqamah {
	text-align: left !important;
	width: 100%;
}

.itmms-tv--layout-focus .itmms-tv__time-iqamah {
	color: var(--tv-accent);
	font-size: calc(14px * var(--tv-scale));
}

.itmms-tv--layout-focus .itmms-tv__jumuah-box {
	min-height: 100%;
}

/* ==========================================================================
   10. NOTICE / JUMUAH SLIDES
   ========================================================================== */
.itmms-tv__notices-slide,
.itmms-tv__jumuah-slide {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 0;
	padding: calc(8px * var(--tv-scale)) 0;
}

.itmms-tv__slide-panel {
	width: 100%;
	max-width: 920px;
	display: flex;
	flex-direction: column;
	gap: calc(14px * var(--tv-scale));
}

.itmms-tv__slide-panel--jumuah {
	max-width: 900px;
}

.itmms-tv__notices-head {
	font-size: calc(18px * var(--tv-scale));
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tv-accent);
	margin: 0;
}

.itmms-tv__notices-grid,
.itmms-tv__jumuah-slide-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: calc(16px * var(--tv-scale));
	width: 100%;
	margin: 0;
}

.itmms-tv__jumuah-slide-grid {
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.itmms-tv__notices-grid:has(> :nth-child(2)) {
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.itmms-tv__notice-card,
.itmms-tv__jumuah-slide-card {
	background: var(--tv-surface);
	border: 1px solid var(--tv-border);
	border-radius: 18px;
	padding: calc(28px * var(--tv-scale)) calc(26px * var(--tv-scale));
	box-shadow: var(--tv-shadow);
	min-height: calc(160px * var(--tv-scale));
}

.itmms-tv__jumuah-slide-card {
	text-align: center;
}

.itmms-tv__notice-card strong,
.itmms-tv__jumuah-slide-card strong {
	display: block;
	font-size: calc(26px * var(--tv-scale));
	font-weight: 800;
	margin-bottom: calc(12px * var(--tv-scale));
}

.itmms-tv__notice-card p,
.itmms-tv__jumuah-slide-card p {
	font-size: calc(18px * var(--tv-scale));
	color: var(--tv-muted);
	line-height: 1.55;
}

.itmms-tv__jumuah-slide-card p {
	font-size: calc(20px * var(--tv-scale));
	color: var(--tv-text);
}

.itmms-tv__notice-card--welcome {
	grid-column: 1 / -1;
	text-align: center;
	padding: calc(48px * var(--tv-scale));
}

.itmms-tv__slide-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding-top: 4px;
}

.itmms-tv__slide-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tv-border);
	opacity: 0.8;
}

.itmms-tv__slide-dot.is-active {
	background: var(--tv-accent);
	transform: scale(1.2);
}

/* ==========================================================================
   11. OVERNIGHT DIM
   ========================================================================== */
.itmms-tv__dim {
	position: absolute;
	inset: 0;
	z-index: 50;
	pointer-events: none;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 1.2s ease;
}

.itmms-tv--dimmed .itmms-tv__dim {
	opacity: 1;
}

.itmms-tv--dimmed .itmms-tv__wrapper {
	filter: brightness(0.72) saturate(0.85);
}

.itmms-tv--dimmed .itmms-tv__countdown-box,
.itmms-tv--dimmed .itmms-tv__table-row.is-current {
	filter: brightness(1.15);
}

.itmms-tv__countdown-box.is-quiet {
	box-shadow: none;
	animation: none;
	border-color: rgba(255, 255, 255, 0.18);
}

.itmms-tv--theme-light .itmms-tv__countdown-box.is-quiet {
	border-color: rgba(26, 107, 90, 0.25);
}

/* ==========================================================================
   12. QUIET / SALAH MODE
   ========================================================================== */
.itmms-tv__quiet {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 4vw;
	background:
		radial-gradient(ellipse at center, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.72) 100%);
	backdrop-filter: blur(2px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.6s ease;
}

.itmms-tv__quiet:not([hidden]) {
	opacity: 1;
}

.itmms-tv__quiet[hidden] {
	display: none !important;
}

.itmms-tv__quiet-panel {
	max-width: min(820px, 92vw);
	text-align: center;
	color: #f8fafc;
	padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 56px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(8, 14, 18, 0.55);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.itmms-tv--theme-light .itmms-tv__quiet {
	background:
		radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35) 0%, rgba(15, 40, 34, 0.55) 100%);
}

.itmms-tv--theme-light .itmms-tv__quiet-panel {
	background: rgba(255, 255, 255, 0.88);
	color: #0f2922;
	border-color: rgba(23, 102, 84, 0.2);
}

.itmms-tv__quiet-eyebrow {
	display: inline-block;
	margin-bottom: 12px;
	font-size: clamp(0.75rem, 1.4vw, 0.95rem);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	opacity: 0.75;
}

.itmms-tv__quiet-title {
	display: block;
	font-size: clamp(2rem, 5.5vw, 4rem);
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 10px;
}

.itmms-tv__quiet-name {
	margin: 0 0 8px;
	font-size: clamp(1.4rem, 3.2vw, 2.2rem);
	font-weight: 600;
	color: var(--tv-accent, #d4a017);
}

.itmms-tv--theme-light .itmms-tv__quiet-name {
	color: #134e42;
}

.itmms-tv__quiet-message {
	margin: 0;
	font-size: clamp(1rem, 2vw, 1.35rem);
	opacity: 0.85;
}

.itmms-tv--quiet .itmms-tv__ticker {
	opacity: 0.15;
	pointer-events: none;
}

.itmms-tv--quiet .itmms-tv__ticker-track.is-scrolling {
	animation-play-state: paused;
}

.itmms-tv--quiet .itmms-tv__slide-dots {
	opacity: 0.25;
}

.itmms-tv--quiet .itmms-tv__wrapper {
	filter: saturate(0.9) brightness(0.92);
}

@media (max-width: 1100px) {
	.itmms-tv--layout-focus .itmms-tv__table {
		grid-template-columns: repeat(3, 1fr);
	}

	.itmms-tv--layout-focus .itmms-tv__sidebar,
	.itmms-tv--layout-split .itmms-tv__main {
		grid-template-columns: 1fr;
	}
}


/* New Masjid TV refresh — high-contrast emerald / midnight palette.
   Kept as an override so existing layout and display controls remain compatible. */
.itmms-tv--theme-dark {
	--tv-bg: radial-gradient(ellipse at 50% -15%, #164b42 0%, #071b1a 48%, #050d12 100%);
	--tv-surface: rgba(10, 32, 34, .88);
	--tv-surface-hover: rgba(17, 53, 53, .96);
	--tv-primary: #16a085;
	--tv-accent: #e6c36a;
	--tv-text: #f7fbfa;
	--tv-muted: #b3c8c5;
	--tv-border: rgba(196, 231, 220, .16);
	--tv-current-bg: linear-gradient(120deg, rgba(22,160,133,.28), rgba(230,195,106,.13));
	--tv-current-border: rgba(230,195,106,.72);
	--tv-shadow: 0 16px 48px rgba(0,0,0,.42);
}
.itmms-tv--theme-green {
	--tv-bg: radial-gradient(ellipse at 50% -10%, #176b55 0%, #082c25 52%, #041713 100%);
	--tv-surface: rgba(5, 40, 32, .9);
	--tv-surface-hover: rgba(10, 58, 46, .96);
	--tv-primary: #26b893;
	--tv-accent: #f0cf78;
	--tv-text: #ffffff;
	--tv-muted: #c0d9d0;
	--tv-border: rgba(255,255,255,.15);
	--tv-current-bg: linear-gradient(120deg, rgba(38,184,147,.3), rgba(240,207,120,.14));
	--tv-current-border: rgba(240,207,120,.8);
}
body.itmms-tv { min-height: 100dvh; }
.itmms-tv .itmms-tv__header,
.itmms-tv .itmms-tv__countdown {
	border-radius: 18px;
}
@media (max-width: 900px), (max-height: 600px) {
	body.itmms-tv { overflow: auto; height: auto; min-height: 100vh; }
	.itmms-tv .itmms-tv__main { min-height: 0; }
}


/* Prayer-time and overnight sleep notifications */
.itmms-tv__event-popup { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 4vw; background: rgba(2, 10, 22, .82); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease, visibility .35s ease; }
.itmms-tv__event-popup.is-visible { opacity: 1; visibility: visible; }
.itmms-tv__event-card { width: min(900px, 90vw); padding: clamp(30px, 5vw, 70px); text-align: center; color: #fff; border: 2px solid #d7b64b; border-radius: 28px; background: linear-gradient(145deg, rgba(0,75,55,.98), rgba(4,20,43,.98)); box-shadow: 0 24px 90px rgba(0,0,0,.5), inset 0 0 35px rgba(27,190,125,.12); }
.itmms-tv__event-kicker { display: block; color: #e6c75e; font-size: clamp(16px, 2vw, 28px); font-weight: 800; letter-spacing: .2em; margin-bottom: 18px; }
.itmms-tv__event-name { display: block; color: #fff; font-size: clamp(48px, 9vw, 112px); line-height: 1.05; font-weight: 900; }
.itmms-tv__event-caption { display: block; margin-top: 22px; color: rgba(255,255,255,.88); font-size: clamp(18px, 2.5vw, 32px); }
.itmms-tv__event-popup--sleep { z-index: 65; background: rgba(0,0,0,.94); }
.itmms-tv__event-popup--sleep .itmms-tv__event-card { border-color: rgba(180,190,205,.28); background: linear-gradient(145deg,#101827,#05080e); }
.itmms-tv__event-popup--sleep .itmms-tv__event-kicker { color: #aab5c5; }
.itmms-tv__event-popup--sleep .itmms-tv__event-name { font-size: clamp(38px, 6vw, 76px); color: #d7deea; }




/* Eid slide: time only, centred on screen. */
.itmms-tv__eid-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	width: 100%;
}
.itmms-tv__eid-time {
	font-size: clamp(4rem, 12vw, 12rem);
	font-weight: 800;
	color: #fbbf24;
	line-height: 1;
}


/* SIC requested TV refinements */
.itmms-tv__hijri-dot,
.itmms-tv__slide-dots,
.itmms-tv__slide-dot { display: none !important; }
.itmms-tv__eid-date { display:block; font-size:clamp(2rem,4vw,4.5rem); font-weight:800; margin-bottom:1.2rem; }
.itmms-tv__eid-time { display:block; font-size:clamp(3rem,7vw,8rem); font-weight:900; }
.itmms-tv__eid-message { font-size:clamp(1.3rem,2.2vw,2.6rem); margin-top:1.5rem; text-align:center; }
.itmms-tv__jumuah-times { display:flex; flex-wrap:wrap; justify-content:center; gap:1rem 2rem; }
.itmms-tv__jumuah-times span { white-space:nowrap; }



/* New Masjid 1.7.7: balanced Eid typography and TV-safe donation QR layout. */
.itmms-tv__eid-slide {
    flex-direction: column;
    gap: clamp(0.5rem, 1.5vh, 1.25rem);
    min-height: 58vh;
    padding: 3vh 4vw;
    text-align: center;
}
.itmms-tv__eid-date {
    display: block;
    max-width: 90%;
    font-size: clamp(1.5rem, 3.2vw, 3.4rem);
    line-height: 1.15;
    margin: 0 auto;
}
.itmms-tv__eid-time {
    display: block;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1;
    margin: 0;
}
.itmms-tv__eid-message {
    width: min(86%, 1100px);
    font-size: clamp(1.1rem, 2vw, 2rem);
    line-height: 1.35;
    margin: 0.5rem auto 0;
    overflow-wrap: anywhere;
}


/* New Masjid 1.7.8: keep Zelle and the PayPal QR together on one TV slide. */
.itmms-tv__notice-card--paypal-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(0.35rem, 1vh, 0.9rem);
}
.itmms-tv__notice-card--paypal-qr img {
    display: block;
    width: clamp(150px, 24vh, 280px);
    height: clamp(150px, 24vh, 280px);
    max-width: 100%;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    image-rendering: pixelated;
}
.itmms-tv__notice-card--paypal-qr p {
    margin: 0;
    font-size: clamp(1rem, 1.6vw, 1.6rem);
    font-weight: 800;
    color: var(--tv-text);
}
.itmms-tv__notice-card--zelle {
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* ==========================================================================
   New Masjid 1.7.13 — TV polish
   - Next-prayer dot no longer becomes an extra grid cell (fixed the Fajr / Isha
     rows where Azan dropped under the name and Iqamah landed in the wrong column).
   - Colours follow the selected theme (light theme no longer forced to white text).
   ========================================================================== */
.itmms-tv {
	--tv-row-bg: rgba(255, 255, 255, 0.04);
	--tv-row-border: rgba(255, 255, 255, 0.12);
	--tv-dot-gutter: calc(40px * var(--tv-scale, 1));
}
.itmms-tv--theme-light {
	--tv-row-bg: rgba(15, 23, 42, 0.05);
	--tv-row-border: rgba(15, 23, 42, 0.16);
}

.itmms-tv__table-header,
.itmms-tv__table-row {
	padding-inline-start: var(--tv-dot-gutter);
	padding-inline-end: calc(24px * var(--tv-scale, 1));
}

.itmms-tv__table-row,
.itmms-tv__table-row.is-current,
.itmms-tv__table-row.is-next-azan,
.itmms-tv__table-row.is-next-azan:not(.is-current),
.itmms-tv__table-row.is-next-iqamah,
.itmms-tv__table-row[data-prayer-row="fajr"] {
	position: relative;
	background: var(--tv-row-bg) !important;
	border-color: var(--tv-row-border) !important;
	box-shadow: none;
}

.itmms-tv__table-row .itmms-tv__prayer-name,
.itmms-tv__table-row .itmms-tv__time-azan,
.itmms-tv__table-row .itmms-tv__time-iqamah {
	color: var(--tv-text) !important;
	font-variant-numeric: tabular-nums;
}
.itmms-tv__table-row.is-sunrise .itmms-tv__prayer-name,
.itmms-tv__table-row.is-extra .itmms-tv__prayer-name,
.itmms-tv__table-row.is-sunrise .itmms-tv__time-iqamah,
.itmms-tv__table-row.is-extra .itmms-tv__time-iqamah {
	color: var(--tv-muted) !important;
}

/* Current prayer: accent name + accent edge. */
.itmms-tv__table-row.is-current {
	border-color: var(--tv-current-border) !important;
	box-shadow: inset 4px 0 0 var(--tv-accent);
}
.itmms-tv__table-row.is-current .itmms-tv__prayer-name {
	color: var(--tv-accent) !important;
}
[dir="rtl"] .itmms-tv__table-row.is-current {
	box-shadow: inset -4px 0 0 var(--tv-accent);
}

/* Next event: one pulsing dot, always absolutely placed inside the gutter. */
.itmms-tv__table-row::before {
	content: none;
}
.itmms-tv__table-row.is-current:not(.is-next-iqamah)::before {
	content: none;
	animation: none;
}
.itmms-tv__table-row.is-next-azan:not(.is-current)::before,
.itmms-tv__table-row.is-next-iqamah::before {
	content: "";
	display: block !important;
	position: absolute;
	inset-inline-start: calc(16px * var(--tv-scale, 1));
	inset-block-start: 50%;
	transform: translateY(-50%);
	width: calc(10px * var(--tv-scale, 1));
	height: calc(10px * var(--tv-scale, 1));
	margin: 0;
	border-radius: 50%;
	background: var(--tv-accent) !important;
	box-shadow: 0 0 10px var(--tv-accent);
	animation: itmms-pulse 1.8s infinite;
}
.itmms-tv__table-row.is-next-iqamah .itmms-tv__time-iqamah {
	color: var(--tv-accent) !important;
}
.itmms-tv__table-row.is-next-azan:not(.is-current) .itmms-tv__time-azan {
	color: var(--tv-accent) !important;
}

/* Keep Azan centred and Iqamah on the end edge, matching the header. */
.itmms-tv__table-header .text-center,
.itmms-tv__time-azan.text-center { text-align: center; }
.itmms-tv__table-header .text-right,
.itmms-tv__time-iqamah.text-right { text-align: end; }
.itmms-tv__table-header,
.itmms-tv__table-row { grid-template-columns: 1.1fr 0.9fr 1fr; }

/* Friday card: stacked, centred, both times visible. */
.itmms-tv__jumuah-sessions { align-items: stretch; gap: calc(14px * var(--tv-scale, 1)); }
.itmms-tv__jumuah-session {
	flex-direction: column;
	align-items: center;
	gap: calc(6px * var(--tv-scale, 1));
}
.itmms-tv__jumuah-label {
	color: var(--tv-accent);
	font-size: calc(20px * var(--tv-scale, 1));
}
.itmms-tv__jumuah-times {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: calc(12px * var(--tv-scale, 1)) calc(28px * var(--tv-scale, 1));
	text-align: center;
}
.itmms-tv__jumuah-times .itmms-tv__jumuah-time {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	gap: 2px;
	white-space: nowrap;
}
.itmms-tv__jumuah-time-label {
	font-size: calc(15px * var(--tv-scale, 1));
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tv-muted);
}
.itmms-tv__jumuah-times b {
	font-size: calc(30px * var(--tv-scale, 1));
	color: var(--tv-text);
	font-variant-numeric: tabular-nums;
}
.itmms-tv__jumuah-header { text-align: start; color: var(--tv-accent); }

/* Slides: centred headings, bold times. */
.itmms-tv__notices-head { text-align: center; font-size: calc(22px * var(--tv-scale, 1)); }
.itmms-tv__jumuah-slide-card p b { color: var(--tv-accent); font-weight: 900; }

/* Ticker + weather: theme-aware colours. */
.itmms-tv__ticker-bullet { background: var(--tv-accent); }
.itmms-tv__ticker-item strong { color: var(--tv-text); }
.itmms-tv__ticker-sep { color: var(--tv-muted); }
.itmms-tv__weather { background: var(--tv-surface); border-color: var(--tv-border); }
[dir="rtl"] .itmms-tv__table-row.is-next-iqamah::before,
[dir="rtl"] .itmms-tv__table-row.is-next-azan:not(.is-current)::before {
	left: auto;
	right: calc(16px * var(--tv-scale, 1));
}

/* ==========================================================================
   New Masjid 1.7.13 — Donation slide: readable on a TV from across the room
   ========================================================================== */
.itmms-tv__slide-panel--donate {
	max-width: min(1100px, 92vw);
	align-items: center;
	gap: calc(22px * var(--tv-scale, 1));
}
.itmms-tv__slide-panel--donate .itmms-tv__notices-head {
	font-size: calc(40px * var(--tv-scale, 1));
	font-weight: 900;
	letter-spacing: 0.04em;
	color: var(--tv-accent);
	text-align: center;
}
.itmms-tv__donate-grid {
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	align-items: stretch;
	justify-items: stretch;
}
.itmms-tv__donate-grid > .itmms-tv__notice-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: calc(14px * var(--tv-scale, 1));
	min-height: calc(300px * var(--tv-scale, 1));
	padding: calc(28px * var(--tv-scale, 1));
	border-color: color-mix(in srgb, var(--tv-accent) 45%, var(--tv-border));
}
.itmms-tv__donate-grid > .itmms-tv__notice-card strong {
	margin: 0;
	font-size: calc(26px * var(--tv-scale, 1));
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tv-accent);
}
.itmms-tv__notice-card--zelle .itmms-tv__donate-value {
	font-size: calc(64px * var(--tv-scale, 1));
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: 0.02em;
	color: var(--tv-text);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.itmms-tv__notice-card--paypal-qr img {
	width: clamp(190px, 30vh, 320px);
	height: clamp(190px, 30vh, 320px);
	padding: 12px;
	border-radius: 16px;
	background: #ffffff;
}
.itmms-tv__notice-card--paypal-qr p {
	font-size: calc(26px * var(--tv-scale, 1));
	font-weight: 800;
	color: var(--tv-text);
}
.itmms-tv__donate-thanks {
	font-size: calc(24px * var(--tv-scale, 1));
	font-weight: 700;
	color: var(--tv-muted);
	text-align: center;
}

/* ==========================================================================
   New Masjid 1.7.13 — Hadith slide: large, high-contrast, readable from afar
   ========================================================================== */
.itmms-tv__slide-panel--hadith {
	max-width: min(1200px, 92vw);
	align-items: center;
	gap: calc(22px * var(--tv-scale, 1));
}
.itmms-tv__slide-panel--hadith .itmms-tv__notices-head {
	font-size: calc(36px * var(--tv-scale, 1));
	font-weight: 900;
	letter-spacing: 0.06em;
	color: var(--tv-accent);
	text-align: center;
}
.itmms-tv__hadith-card {
	position: relative;
	width: 100%;
	margin: 0;
	padding: calc(46px * var(--tv-scale, 1)) calc(56px * var(--tv-scale, 1));
	text-align: center;
	background: var(--tv-surface);
	border: 1px solid color-mix(in srgb, var(--tv-accent) 45%, var(--tv-border));
	border-radius: 22px;
	box-shadow: var(--tv-shadow);
	animation: itmms-hadith-in 0.7s ease both;
}
.itmms-tv__hadith-card::before {
	content: "\201C";
	position: absolute;
	inset-block-start: calc(2px * var(--tv-scale, 1));
	inset-inline-start: calc(24px * var(--tv-scale, 1));
	font-family: Georgia, 'Times New Roman', serif;
	font-size: calc(120px * var(--tv-scale, 1));
	line-height: 1;
	color: var(--tv-accent);
	opacity: 0.55;
	pointer-events: none;
}
.itmms-tv__hadith-text {
	margin: 0;
	font-weight: 700;
	line-height: 1.4;
	color: var(--tv-text);
	text-wrap: balance;
	overflow-wrap: anywhere;
}
.itmms-tv__hadith-text--short  { font-size: calc(54px * var(--tv-scale, 1)); }
.itmms-tv__hadith-text--medium { font-size: calc(44px * var(--tv-scale, 1)); }
.itmms-tv__hadith-text--long   { font-size: calc(34px * var(--tv-scale, 1)); line-height: 1.45; }
.itmms-tv__hadith-text.is-arabic {
	font-family: var(--tv-font-quran);
	font-weight: 700;
	line-height: 1.75;
}
.itmms-tv__hadith-text.is-arabic.itmms-tv__hadith-text--short  { font-size: calc(64px * var(--tv-scale, 1)); }
.itmms-tv__hadith-text.is-arabic.itmms-tv__hadith-text--medium { font-size: calc(52px * var(--tv-scale, 1)); }
.itmms-tv__hadith-text.is-arabic.itmms-tv__hadith-text--long   { font-size: calc(40px * var(--tv-scale, 1)); }
.itmms-tv__hadith-source {
	margin-top: calc(22px * var(--tv-scale, 1));
	font-size: calc(28px * var(--tv-scale, 1));
	font-weight: 800;
	letter-spacing: 0.03em;
	color: var(--tv-accent);
}
.itmms-tv__hadith-source[hidden] { display: none; }
.itmms-tv__hadith-source::before { content: "— "; }
@keyframes itmms-hadith-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}


/* ==========================================================================
   New Masjid 1.7.17 - clean prayer boxes, Zelle fit, centred Friday heading
   ========================================================================== */
/* No dots, glows or accent edges on any prayer box: every box looks the same. */
.itmms-tv__table-row::before,
.itmms-tv__table-row.is-current::before,
.itmms-tv__table-row.is-current:not(.is-next-iqamah)::before,
.itmms-tv__table-row.is-next-azan:not(.is-current)::before,
.itmms-tv__table-row.is-next-iqamah::before {
	content: none !important;
	display: none !important;
	animation: none !important;
}
.itmms-tv__table-row,
.itmms-tv__table-row.is-current,
[dir="rtl"] .itmms-tv__table-row.is-current {
	box-shadow: none !important;
}
.itmms-tv__table-row.is-current .itmms-tv__prayer-name,
.itmms-tv__table-row.is-next-iqamah .itmms-tv__time-iqamah,
.itmms-tv__table-row.is-next-azan:not(.is-current) .itmms-tv__time-azan {
	color: var(--tv-text) !important;
}
.itmms-tv__table-header,
.itmms-tv__table-row {
	padding-inline-start: calc(24px * var(--tv-scale, 1));
}

/* Zelle number always fits inside its card. */
.itmms-tv__notice-card--zelle .itmms-tv__donate-value {
	font-size: min(calc(64px * var(--tv-scale, 1)), 4.2vw);
	max-width: 100%;
}

/* Friday heading centred. */
.itmms-tv__jumuah-header {
	text-align: center;
}


/* New Masjid 1.7.18 — responsive Zelle donation number fit.
   Keep the Zelle card and its value inside the available grid width on phones
   and smart TVs, even when older rules set a large fixed font size. */
.itmms-tv .itmms-tv__donate-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.itmms-tv .itmms-tv__donate-grid > .itmms-tv__notice-card,
.itmms-tv .itmms-tv__notice-card--zelle {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}
.itmms-tv .itmms-tv__notice-card--zelle .itmms-tv__donate-value {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding-inline: 0;
    font-size: clamp(18px, 2.6vw, 46px) !important;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
    .itmms-tv .itmms-tv__donate-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .itmms-tv .itmms-tv__notice-card--zelle .itmms-tv__donate-value {
        font-size: clamp(16px, 5vw, 26px) !important;
    }
}

/* ==========================================================================
   NEXT PRAYER HIGHLIGHT (solid color, same in every theme)
   ========================================================================== */
.itmms-tv__table-row.is-next-prayer {
	position: relative;
	background: #1e9e82;
	border-color: #5fe0c2;
	box-shadow: 0 0 0 2px rgba(95, 224, 194, 0.45), 0 8px 28px rgba(30, 158, 130, 0.45);
}

.itmms-tv__table-row.is-next-prayer .itmms-tv__prayer-name,
.itmms-tv__table-row.is-next-prayer .itmms-tv__time-azan,
.itmms-tv__table-row.is-next-prayer .itmms-tv__time-iqamah {
	color: #ffffff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.itmms-tv__table-row.is-next-prayer::before {
	background: #ffffff;
	box-shadow: 0 0 10px #ffffff;
	animation: itmms-pulse 1.8s infinite;
}

.itmms-tv__table-row.is-next-prayer::after {
	content: "NEXT";
	position: absolute;
	top: calc(-9px * var(--tv-scale, 1));
	right: calc(10px * var(--tv-scale, 1));
	padding: calc(2px * var(--tv-scale, 1)) calc(8px * var(--tv-scale, 1));
	border-radius: 999px;
	background: #ffffff;
	color: #176654;
	font-size: calc(12px * var(--tv-scale, 1));
	font-weight: 800;
	letter-spacing: 0.08em;
}

[dir="rtl"] .itmms-tv__table-row.is-next-prayer::after {
	right: auto;
	left: calc(10px * var(--tv-scale, 1));
}


/* ==========================================================================
   GAP FIX — fill the TV screen instead of leaving empty bands
   - Prayer rows grow to share the table height (no space-around gaps).
   - Focus layout: the prayer strip stretches to the bottom of the board
     instead of floating in the middle of a tall empty row.
   ========================================================================== */
.itmms-tv__table > .itmms-tv__table-row {
	flex: 1 1 auto;
}

.itmms-tv .itmms-tv__table {
	justify-content: stretch;
}

.itmms-tv--layout-focus .itmms-tv__main {
	grid-template-rows: auto minmax(0, 1fr);
}

.itmms-tv--layout-focus .itmms-tv__table-container {
	justify-content: stretch;
}

.itmms-tv--layout-focus .itmms-tv__table {
	height: 100%;
	align-content: stretch;
	grid-auto-rows: 1fr;
}

.itmms-tv--layout-focus .itmms-tv__table-row {
	justify-content: center;
}

/* ==========================================================================
   FULL SCREEN BUTTON
   ========================================================================== */
.itmms-tv__fs-btn {
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 100;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font: 600 14px/1 var(--tv-font-sans, sans-serif);
	cursor: pointer;
	opacity: 1;
	transition: opacity 0.4s ease;
}
.itmms-tv__fs-btn:focus-visible {
	outline: 3px solid #5fe0c2;
	outline-offset: 2px;
}
.itmms-tv__fs-btn.is-idle {
	opacity: 0;
	pointer-events: none;
}
.itmms-tv--fullscreen .itmms-tv__fs-btn:not(.is-idle) {
	opacity: 0.85;
}

/* ==========================================================================
   NEXT PRAYER: override the !important row colours used by the 1.7.13 rules
   ========================================================================== */
.itmms-tv .itmms-tv__table-row.is-next-prayer {
	background: #1e9e82 !important;
	border-color: #5fe0c2 !important;
}
.itmms-tv .itmms-tv__table-row.is-next-prayer .itmms-tv__prayer-name,
.itmms-tv .itmms-tv__table-row.is-next-prayer .itmms-tv__time-azan,
.itmms-tv .itmms-tv__table-row.is-next-prayer .itmms-tv__time-iqamah {
	color: #ffffff !important;
}


/* Donation slide note (text box set in TV Slides) */
.itmms-tv__donate-note{margin:0 0 14px;padding:12px 16px;border-radius:14px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);color:inherit;font-size:clamp(16px,1.6vw,26px);line-height:1.4;text-align:center}

/* TV Slides message boxes: full width, centered, easy to read */
.itmms-tv__notice-card--note,
.itmms-tv__jumuah-slide-card--note {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: calc(110px * var(--tv-scale, 1));
	box-sizing: border-box;
}
.itmms-tv__notice-card--note p,
.itmms-tv__jumuah-slide-card--note p {
	margin: 0;
	font-size: calc(30px * var(--tv-scale, 1));
	font-weight: 700;
	line-height: 1.4;
	color: var(--tv-text, #fff);
	overflow-wrap: anywhere;
}
.itmms-tv__donate-grid > .itmms-tv__notice-card--note {
	min-height: calc(110px * var(--tv-scale, 1));
}

/* ==========================================================================
   New Masjid 1.7.33 — modern Friday and Donation slides
   Glass cards, accent headings, big readable times, full-width message box.
   ========================================================================== */
.itmms-tv .itmms-tv__slide-panel--jumuah,
.itmms-tv .itmms-tv__slide-panel--donate {
	max-width: min(1180px, 92vw);
	width: 100%;
	gap: calc(26px * var(--tv-scale, 1));
	align-items: stretch;
}
.itmms-tv .itmms-tv__slide-panel--jumuah .itmms-tv__notices-head,
.itmms-tv .itmms-tv__slide-panel--donate .itmms-tv__notices-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(14px * var(--tv-scale, 1));
	font-size: calc(38px * var(--tv-scale, 1));
	font-weight: 900;
	letter-spacing: 0.14em;
	text-align: center;
	color: var(--tv-accent);
}
.itmms-tv .itmms-tv__slide-panel--jumuah .itmms-tv__notices-head::after,
.itmms-tv .itmms-tv__slide-panel--donate .itmms-tv__notices-head::after {
	content: "";
	width: calc(90px * var(--tv-scale, 1));
	height: 4px;
	border-radius: 4px;
	background: var(--tv-accent);
	opacity: 0.85;
}
.itmms-tv .itmms-tv__jumuah-slide-grid,
.itmms-tv .itmms-tv__donate-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: calc(24px * var(--tv-scale, 1));
	width: 100%;
}
.itmms-tv .itmms-tv__jumuah-slide-card,
.itmms-tv .itmms-tv__donate-grid > .itmms-tv__notice-card {
	box-sizing: border-box;
	min-width: 0;
	background: linear-gradient(160deg, var(--tv-surface), rgba(255, 255, 255, 0.03));
	border: 1px solid var(--tv-border);
	border-top: 3px solid var(--tv-accent);
	border-radius: 24px;
	box-shadow: var(--tv-shadow);
	padding: calc(30px * var(--tv-scale, 1)) calc(28px * var(--tv-scale, 1));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: calc(200px * var(--tv-scale, 1));
}
.itmms-tv .itmms-tv__jumuah-slide-card strong {
	font-size: calc(28px * var(--tv-scale, 1));
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tv-accent);
	margin-bottom: calc(10px * var(--tv-scale, 1));
}
.itmms-tv .itmms-tv__jumuah-slide-card p {
	margin: 0.3em 0;
	font-size: calc(24px * var(--tv-scale, 1));
	color: var(--tv-muted);
}
.itmms-tv .itmms-tv__jumuah-slide-card p b {
	display: block;
	margin-top: 0.1em;
	font-size: calc(52px * var(--tv-scale, 1));
	line-height: 1.1;
	font-weight: 800;
	color: var(--tv-text);
}
/* Message box: wide highlighted banner above the cards */
.itmms-tv .itmms-tv__notice-card--note,
.itmms-tv .itmms-tv__jumuah-slide-card--note,
.itmms-tv .itmms-tv__donate-grid > .itmms-tv__notice-card--note {
	grid-column: 1 / -1;
	background: var(--tv-current-bg, rgba(255, 255, 255, 0.06));
	border: 1px solid var(--tv-current-border, var(--tv-border));
	border-inline-start: 8px solid var(--tv-accent);
	border-radius: 24px;
	padding: calc(24px * var(--tv-scale, 1)) calc(34px * var(--tv-scale, 1));
	min-height: calc(110px * var(--tv-scale, 1));
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}
.itmms-tv .itmms-tv__notice-card--note p,
.itmms-tv .itmms-tv__jumuah-slide-card--note p {
	margin: 0;
	font-size: calc(32px * var(--tv-scale, 1));
	font-weight: 700;
	line-height: 1.4;
	color: var(--tv-text);
	overflow-wrap: anywhere;
}

/* 1.7.33 — center the cards and keep the Zelle number on one line */
.itmms-tv .itmms-tv__jumuah-slide-grid,
.itmms-tv .itmms-tv__donate-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
}
.itmms-tv .itmms-tv__jumuah-slide-card,
.itmms-tv .itmms-tv__donate-grid > .itmms-tv__notice-card {
	flex: 1 1 300px;
	max-width: 440px;
}
.itmms-tv .itmms-tv__notice-card--note,
.itmms-tv .itmms-tv__jumuah-slide-card--note,
.itmms-tv .itmms-tv__donate-grid > .itmms-tv__notice-card--note {
	flex: 1 1 100%;
	max-width: 100%;
}
.itmms-tv .itmms-tv__notice-card--zelle .itmms-tv__donate-value {
	white-space: nowrap !important;
	font-size: clamp(18px, 2.2vw, 40px) !important;
}
