:root {
  --night: #02142f;
  --night-2: #052b54;
  --panel: rgba(3, 27, 59, .84);
  --blue: #58c7ff;
  --blue-soft: rgba(88, 199, 255, .5);
  --gold: #e5bd72;
  --white: #fbfdff;
  --pale: #acdfff;
  --muted: #8cb9d9;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--night); color: var(--white); font-family: "Segoe UI", Arial, sans-serif; }
.hidden { display: none !important; }
.tv-fixed-viewport { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
.tv-fixed-stage { position: absolute; inset: 0; width: 100vw !important; height: 100vh !important; transform: none !important; }
.screen { position: relative; width: 100vw; height: 100vh; padding: clamp(14px, 1.5vw, 34px); overflow: hidden; }
.screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(1,12,34,.28), rgba(1,14,38,.08) 58%, rgba(1,12,30,.18)), url("snir-background-v1.png") center / cover no-repeat; }
.screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(1,10,28,.08), transparent 45%, rgba(1,9,25,.2)); }

.alert-ribbon { position: absolute; z-index: 20; inset: 0 0 auto; display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 14px 28px; color: #fff; background: #8a2028; box-shadow: 0 5px 20px rgba(0,0,0,.4); }
.alert-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid currentColor; border-radius: 50%; font-weight: 900; }
.alert-body { display: grid; gap: 3px; }
.alert-kicker { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.alert-text { font-size: 22px; font-weight: 800; }

.snir-dashboard { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, 1.42fr) minmax(0, .9fr); grid-template-rows: minmax(0, 15%) minmax(0, 24%) minmax(0, 19%) minmax(0, 17%) minmax(0, 25%); grid-template-areas: "identity parasha zmanim" "time parasha zmanim" "prayer shabbat zmanim" "prayer weather zmanim" "events events events"; gap: clamp(10px, .85vw, 18px); width: 100%; height: 100%; min-width: 0; min-height: 0; }
.snir-dashboard.has-info-strip { padding-bottom: clamp(38px, 4.3vh, 58px); }

.identity { grid-area: identity; display: flex; align-items: center; gap: clamp(13px, 1vw, 22px); min-width: 0; padding: 0 clamp(4px, .5vw, 10px); }
.identity-logo { width: clamp(56px, 4.7vw, 100px); height: clamp(56px, 4.7vw, 100px); object-fit: contain; border: 1px solid rgba(229,189,114,.45); border-radius: 4px; box-shadow: 0 0 14px rgba(88,199,255,.22); }
.identity-copy { min-width: 0; }
.identity h1 { margin: 0; overflow: hidden; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 2.3vw, 50px); font-weight: 500; line-height: 1.05; text-shadow: 0 0 12px rgba(172,223,255,.32); text-overflow: ellipsis; white-space: nowrap; }
.rabbi-name { margin: .35em 0 0; color: var(--gold); font-size: clamp(9px, .68vw, 14px); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rabbi-message { margin: .22em 0 0; overflow: hidden; color: var(--pale); font-size: clamp(9px, .62vw, 13px); text-overflow: ellipsis; white-space: nowrap; }

.display-panel, .time-area { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid rgba(88,199,255,.62); border-radius: 7px; background: linear-gradient(145deg, rgba(5,42,80,.72), rgba(1,17,43,.8)); box-shadow: 0 0 15px rgba(45,166,235,.2), inset 0 1px rgba(255,255,255,.12); }
.ornament-title { display: flex; align-items: center; justify-content: center; gap: 10px; height: clamp(36px, 3.8vh, 52px); margin: 0 16px; color: var(--gold); font-size: clamp(11px, .82vw, 18px); font-weight: 650; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.ornament-title::before, .ornament-title::after { content: ""; width: clamp(22px, 2.2vw, 48px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament-title::after { transform: rotate(180deg); }

.time-area { grid-area: time; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 8px; padding: clamp(10px, 1vw, 18px); border-color: rgba(88,199,255,.55); background: linear-gradient(145deg, rgba(2,31,67,.58), rgba(1,14,37,.66)); }
.clock { display: flex; align-items: center; gap: .12em; font-family: Georgia, "Times New Roman", serif; font-size: clamp(64px, 6.1vw, 128px); line-height: .9; text-shadow: 0 0 15px rgba(190,231,255,.43); white-space: nowrap; }
.clock small { color: var(--pale); font-family: "Segoe UI", Arial, sans-serif; font-size: .27em; font-weight: 600; }
.clock-seconds { display: none !important; }
.date-card { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 12px; min-height: clamp(48px, 5.3vh, 72px); padding: 8px 12px; border: 1px solid rgba(88,199,255,.48); border-radius: 5px; background: rgba(2,24,54,.46); font-size: clamp(11px, .78vw, 16px); font-weight: 550; }
.date-divider { width: 1px; height: 70%; background: rgba(172,223,255,.4); }
.hebrew-date { color: var(--pale); font-family: Georgia, "Times New Roman", serif; text-align: right; }
.calendar-line { display: flex; gap: 12px; min-width: 0; overflow: hidden; color: var(--muted); font-size: clamp(7px, .5vw, 10px); white-space: nowrap; }
.calendar-line span { overflow: hidden; text-overflow: ellipsis; }
.calendar-line b { color: var(--gold); text-transform: uppercase; }
.calendar-line strong { color: #fff; font-weight: 600; }
.calendar-line i { color: var(--pale); font-style: normal; }
.clock-status { color: #ffe0a0; font-weight: 800; }

.parasha-panel { grid-area: parasha; display: grid; align-content: center; justify-items: center; padding: clamp(10px, 1.2vw, 24px); text-align: center; background: linear-gradient(150deg, rgba(4,43,88,.72), rgba(1,18,46,.8)); }
.parasha-panel .ornament-title { height: auto; margin-bottom: 4px; color: var(--pale); }
.parasha-hebrew { color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 5vw, 104px); line-height: 1; text-shadow: 0 0 14px rgba(88,199,255,.35); }
.parasha-rule { display: flex; align-items: center; width: 48%; margin: 5px 0; }
.parasha-rule::before, .parasha-rule::after { content: ""; flex: 1; height: 1px; background: var(--gold); }
.parasha-rule span { width: 8px; height: 8px; margin: 0 9px; border: 1px solid var(--gold); transform: rotate(45deg); }
.parasha-english { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 62px); line-height: 1; }
.parasha-summary-heading { margin-top: .65em; color: var(--gold); font-size: clamp(7px, .5vw, 10px); font-weight: 800; text-transform: uppercase; }
.parasha-summary { max-width: 92%; max-height: 2.5em; margin: .34em 0 0; overflow: hidden; color: #b9d9ed; font-size: clamp(8px, .57vw, 12px); line-height: 1.24; }

.prayer-panel { grid-area: prayer; }
.prayer-list { display: grid; grid-template-columns: 1fr; align-content: space-evenly; gap: 0; height: calc(100% - clamp(36px, 3.8vh, 52px)); padding: 8px 24px 14px; overflow: hidden; }
.prayer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: clamp(42px, 4.6vh, 66px); border-bottom: 1px solid rgba(140,185,217,.22); font-size: clamp(14px, 1.08vw, 23px); }
.prayer-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prayer-row strong { color: #8bd5ff; font-size: 1.12em; text-shadow: 0 0 8px rgba(88,199,255,.22); white-space: nowrap; }

.shabbat-panel { grid-area: shabbat; display: grid; grid-template-columns: clamp(72px, 7vw, 145px) minmax(0, 1fr); align-items: center; padding: 8px clamp(16px, 1.3vw, 28px); }
.candle-emblem { display: grid; place-items: center; width: clamp(62px, 5.8vw, 120px); aspect-ratio: 1; border: 2px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: clamp(28px, 2.5vw, 52px); text-shadow: 0 0 10px rgba(229,189,114,.45); box-shadow: 0 0 18px rgba(229,189,114,.3), inset 0 0 18px rgba(229,189,114,.15); }
.shabbat-copy h2 { margin: 0 0 5px; color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-size: clamp(14px, 1.25vw, 26px); font-weight: 500; text-align: center; text-transform: uppercase; }
.shabbat-copy div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.shabbat-copy span { color: var(--pale); font-size: clamp(8px, .57vw, 12px); text-transform: uppercase; }
.shabbat-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 2vw, 42px); font-weight: 500; white-space: nowrap; }

.weather-panel { grid-area: weather; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 15px; }
.weather-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 12px; min-width: 0; }
.weather-copy .ornament-title { grid-column: 1 / -1; height: clamp(27px, 2.8vh, 40px); margin: 0; }
.weather-main { display: flex; align-items: center; gap: 8px; }
.weather-icon svg { width: clamp(34px, 3vw, 62px); height: clamp(34px, 3vw, 62px); }
.weather-main strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 2.25vw, 47px); font-weight: 500; text-shadow: 0 0 8px rgba(172,223,255,.2); white-space: nowrap; }
.weather-place { color: var(--pale); font-size: clamp(9px, .62vw, 13px); }
.weather-days { grid-column: 1 / -1; display: flex; gap: 9px; overflow: hidden; color: var(--muted); font-size: clamp(7px, .48vw, 10px); white-space: nowrap; }
.weather-day-icon svg { width: 1.15em; height: 1.15em; vertical-align: middle; }
.donation-qr { display: grid; justify-items: center; gap: 3px; color: var(--gold); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.donation-qr img { width: clamp(42px, 3.5vw, 72px); height: clamp(42px, 3.5vw, 72px); border: 3px solid #fff; background: #fff; }

.zmanim-panel { grid-area: zmanim; }
.zmanim-list { height: calc(100% - clamp(34px, 3.6vh, 50px)); padding: 7px clamp(16px, 1.3vw, 26px); overflow: hidden; }
.zman-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: clamp(25px, 2.65vh, 38px); border-bottom: 1px solid rgba(140,185,217,.18); font-size: clamp(10px, .74vw, 15px); }
.zman-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zman-row strong { font-weight: 700; white-space: nowrap; }

.events-panel { grid-area: events; }
.events-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: stretch; height: calc(100% - clamp(36px, 3.8vh, 52px)); padding: 8px 16px 12px; overflow: hidden; }
.event-item { display: grid; align-content: center; min-width: 0; padding: 0 clamp(18px, 1.5vw, 32px); border-left: 1px solid rgba(88,199,255,.28); }
.event-item:first-child { border-left: 0; }
.event-item span { color: var(--gold); font-size: clamp(8px, .56vw, 12px); font-weight: 800; text-transform: uppercase; }
.event-item strong { overflow: hidden; color: var(--pale); font-size: clamp(13px, .95vw, 20px); text-overflow: ellipsis; white-space: nowrap; }
.event-item p { max-height: 2.4em; margin: 5px 0 0; overflow: hidden; color: #a8cbe2; font-size: clamp(9px, .63vw, 13px); line-height: 1.2; }
.event-item:nth-child(n+6) { display: none; }

.sse-info-strip { position: absolute; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: .8fr .9fr 1.25fr 1.3fr 1fr 1.25fr; align-items: center; gap: 8px; height: clamp(32px, 3.8vh, 52px); padding: 4px 12px; overflow: hidden; border-top: 1px solid rgba(88,199,255,.55); color: #d8efff; background: rgba(1,12,31,.96); box-shadow: 0 -3px 12px rgba(45,166,235,.13); font-size: clamp(7px, .48vw, 10px); }
.sse-info-strip div { min-width: 0; overflow: hidden; }
.sse-info-strip span { display: block; color: var(--gold); font-size: .9em; font-weight: 800; text-transform: uppercase; }
.sse-info-strip strong, .sse-info-strip small { display: block; overflow: hidden; color: #fff; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sse-info-strip small { color: var(--muted); font-size: .88em; }
.sse-info-strip .connected { color: #7fe0bd; }
.sse-info-strip .reconnecting { color: #ffd27b; }
.sse-info-strip .disconnected { color: #ff8f98; }

.profile-small .snir-dashboard { gap: 7px; }
.profile-small .identity h1 { font-size: clamp(25px, 2.6vw, 46px); }
.profile-small .zmanim-list { padding-inline: 10px; }
.sse-info-strip { grid-template-columns:.8fr .9fr 1.15fr 1.15fr minmax(180px,1.55fr) .9fr 1.1fr; }
.sse-info-strip .signage-credit { align-self:center; color:#fff; font-size:clamp(8px,.55vw,12px); font-weight:700; text-align:center; white-space:nowrap; }
.sse-info-strip .signage-credit strong { display:block; color:var(--gold); letter-spacing:.08em; }
