:root {
  --navy: #06183d;
  --navy-2: #0b2a5d;
  --cream: #fff8e8;
  --cream-2: #f4ead0;
  --gold: #e2aa42;
  --gold-light: #ffe08a;
  --teal: #087581;
  --teal-dark: #07525f;
  --plum: #7a125b;
  --plum-dark: #4a0b43;
  --blue: #1165b7;
  --ink: #081a43;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--cream); background: var(--navy); font-family: "Segoe UI", Arial, sans-serif; }
.hidden { display: none !important; }
.tv-fixed-viewport { position: fixed; inset: 0; overflow: hidden; background: var(--navy); }
.tv-fixed-stage { position: absolute; inset: 0; width: 100vw !important; height: 100vh !important; transform: none !important; transform-origin: top left; }
.screen { position: relative; width: 100vw; height: 100vh; padding: clamp(11px, .9vw, 22px); overflow: hidden; }
.screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0 68%, rgba(130,20,96,.22) 68.2%, transparent 68.5%), linear-gradient(45deg, transparent 0 73%, rgba(9,130,143,.18) 73.2%, transparent 73.5%), var(--navy); }

.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: #a31235; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.alert-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid #fff; border-radius: 50%; font-weight: 900; }
.alert-body { display: grid; gap: 3px; }
.alert-kicker { color: #ffe08a; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.alert-text { font-size: 22px; font-weight: 800; }

.kziv-dashboard { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .78fr) minmax(0, .7fr); grid-template-rows: minmax(0, 17%) minmax(0, 37%) minmax(0, 27%) minmax(0, 19%); grid-template-areas: "time identity identity" "parasha zmanim prayer" "parasha zmanim prayer" "events events weather"; gap: clamp(8px, .72vw, 15px); width: 100%; height: 100%; padding: clamp(8px, .7vw, 15px); overflow: hidden; border: 2px solid var(--gold); border-radius: 10px; background: rgba(4,20,53,.95); box-shadow: inset 0 0 0 2px rgba(255,224,138,.18); }
.kziv-dashboard.has-info-strip { padding-bottom: clamp(38px, 4.3vh, 58px); }

.identity { grid-area: identity; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; min-width: 0; padding: 8px 22px; border-bottom: 1px solid rgba(226,170,66,.55); text-align: right; }
.identity-logo { grid-column: 2; grid-row: 1; width: clamp(70px, 5.5vw, 116px); height: clamp(70px, 5.5vw, 116px); object-fit: contain; border: 2px solid var(--gold); border-radius: 50%; background: #0a2556; box-shadow: 0 0 16px rgba(226,170,66,.25); }
.identity-copy { grid-column: 1; grid-row: 1; min-width: 0; }
.identity h1 { margin: 0; overflow: hidden; color: var(--gold-light); font-family: Georgia, "Times New Roman", serif; font-size: clamp(31px, 3.1vw, 66px); font-weight: 600; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.rabbi-name { margin: .3em 0 0; color: #70e3e2; font-size: clamp(10px, .72vw, 15px); font-weight: 800; text-transform: uppercase; }
.rabbi-message { margin: .2em 0 0; overflow: hidden; color: #fff; font-size: clamp(10px, .68vw, 14px); text-overflow: ellipsis; white-space: nowrap; }

.time-area { grid-area: time; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; align-items: center; gap: 2px 14px; min-width: 0; min-height: 0; padding: 8px 18px; overflow: hidden; border-right: 1px solid rgba(226,170,66,.55); }
.clock { display: flex; align-items: baseline; gap: .1em; color: var(--gold-light); font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 4.7vw, 98px); line-height: .9; text-shadow: 0 2px 0 #8d5c16; white-space: nowrap; }
.clock small { color: #fff; font-family: "Segoe UI", Arial, sans-serif; font-size: .24em; font-weight: 700; }
.clock-seconds { display: none !important; }
.date-card { display: grid; gap: 6px; min-width: 0; font-size: clamp(10px, .76vw, 16px); font-weight: 700; }
.english-date { color: #76e5df; }
.date-divider { display: none; }
.hebrew-date { color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 1.15em; }
.calendar-line { grid-column: 1 / -1; display: flex; gap: 14px; overflow: hidden; color: #d8e8ff; font-size: clamp(7px, .5vw, 10px); white-space: nowrap; }
.calendar-line b { color: var(--gold); text-transform: uppercase; }
.calendar-line strong { color: #fff; }
.calendar-line i { color: #76e5df; font-style: normal; }
.clock-status { grid-column: 1 / -1; color: #ffe08a; }

.display-panel { min-width: 0; min-height: 0; overflow: hidden; border: 2px solid var(--gold); border-radius: 10px; background: var(--cream); box-shadow: inset 0 0 0 1px rgba(164,112,29,.2); }
.ornament-title { display: flex; align-items: center; justify-content: center; gap: 10px; height: clamp(39px, 4.2vh, 58px); margin: 0; color: var(--gold-light); background: var(--teal-dark); font-size: clamp(13px, 1vw, 21px); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ornament-title::before, .ornament-title::after { content: ""; width: 34px; height: 1px; background: var(--gold); }

.parasha-panel { grid-area: parasha; display: grid; align-content: start; justify-items: center; padding: 16px 16px 30%; color: var(--ink); text-align: center; background: linear-gradient(145deg, #fffdf5, var(--cream-2)); }
.parasha-panel .ornament-title { width: 100%; color: var(--ink); background: transparent; font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 1.7vw, 36px); text-transform: none; }
.parasha-hebrew { color: #102e75; font-family: Georgia, "Times New Roman", serif; font-size: clamp(58px, 6vw, 126px); font-weight: 700; line-height: 1; text-shadow: 2px 2px 0 #70c9d4; }
.parasha-rule { display: flex; align-items: center; width: 48%; margin: 9px 0; }
.parasha-rule::before, .parasha-rule::after { content: ""; flex: 1; height: 2px; background: var(--gold); }
.parasha-rule span { width: 10px; height: 10px; margin: 0 10px; border: 2px solid var(--plum); transform: rotate(45deg); }
.parasha-english { color: var(--plum); font-family: Georgia, "Times New Roman", serif; font-size: clamp(31px, 3vw, 64px); }
.parasha-summary-heading { margin-top: 12px; color: #9b6718; font-size: clamp(8px, .58vw, 12px); font-weight: 900; text-transform: uppercase; }
.parasha-summary { max-width: 92%; max-height: 3.6em; margin: 5px 0 0; overflow: hidden; color: #34344d; font-size: clamp(9px, .66vw, 14px); line-height: 1.2; }

.zmanim-panel { grid-area: zmanim; }
.zmanim-panel .ornament-title { background: linear-gradient(90deg, var(--teal-dark), var(--teal)); }
.zmanim-list { display: grid; grid-auto-rows: minmax(0, 1fr); height: calc(100% - clamp(39px, 4.2vh, 58px)); padding: 5px 10px; overflow: hidden; }
.zman-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 0; padding: 0 8px; border-bottom: 1px solid #ddcfb4; color: var(--ink); font-size: clamp(8px, .62vw, 13px); }
.zman-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zman-row strong { color: #08275d; font-family: Georgia, "Times New Roman", serif; font-size: 1.12em; white-space: nowrap; }

.prayer-panel { grid-area: prayer; }
.prayer-panel .ornament-title { background: linear-gradient(90deg, var(--plum-dark), var(--plum)); }
.prayer-list { display: grid; grid-auto-rows: minmax(0, 1fr); height: calc(100% - clamp(39px, 4.2vh, 58px)); padding: 7px 15px; overflow: hidden; }
.prayer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 0; border-bottom: 1px solid #ddcfb4; color: var(--ink); font-size: clamp(12px, .9vw, 19px); }
.prayer-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prayer-row strong { color: var(--plum); font-family: Georgia, "Times New Roman", serif; font-size: 1.18em; white-space: nowrap; }

.weather-panel { grid-area: weather; display: grid; grid-template-columns: minmax(0, 1fr) clamp(70px, 5.4vw, 108px); align-items: center; gap: 7px; padding: 0 9px 6px; }
.weather-copy { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 1px; min-width: 0; color: var(--ink); }
.weather-copy .ornament-title { grid-column: 1 / -1; width: calc(100% + 18px); height: clamp(28px, 3vh, 42px); margin: 0 -9px 3px; font-size: clamp(9px, .7vw, 14px); background: linear-gradient(90deg, #0b58a7, #157dc7); }
.weather-main { display: flex; align-items: center; gap: 8px; }
.weather-icon svg { width: clamp(28px, 2.3vw, 48px); height: clamp(28px, 2.3vw, 48px); }
.weather-main strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: clamp(16px, 1.35vw, 29px); text-overflow: ellipsis; white-space: nowrap; }
.weather-place { color: #126b78; font-weight: 700; }
.weather-days { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 7px; max-height: 3.4em; overflow: hidden; color: #294764; font-size: clamp(7px, .5vw, 11px); font-weight: 600; line-height: 1.1; }
.weather-day-item { white-space: nowrap; }
.weather-day-icon svg { width: 1.2em; height: 1.2em; vertical-align: middle; }
.donation-qr { display: grid; justify-items: center; gap: 4px; color: var(--plum); font-size: clamp(9px, .62vw, 13px); font-weight: 900; text-transform: uppercase; }
.donation-qr img { width: clamp(64px, 5vw, 102px); height: clamp(64px, 5vw, 102px); border: 3px solid var(--navy); background: #fff; }

.events-panel { grid-area: events; background: linear-gradient(90deg, #062d65, #083f73 55%, #5b0c58); }
.events-panel .ornament-title { height: clamp(31px, 3.2vh, 45px); background: transparent; }
.events-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); height: calc(100% - clamp(31px, 3.2vh, 45px)); padding: 5px 16px 10px; }
.event-item { display: grid; align-content: center; min-width: 0; padding: 0 22px; border-left: 1px solid rgba(255,224,138,.36); }
.event-item:first-child { border-left: 0; }
.event-item span { color: var(--gold-light); font-size: clamp(8px, .55vw, 11px); font-weight: 900; text-transform: uppercase; }
.event-item strong { overflow: hidden; color: #fff; font-size: clamp(12px, .9vw, 19px); text-overflow: ellipsis; white-space: nowrap; }
.event-item p { max-height: 2.4em; margin: 4px 0 0; overflow: hidden; color: #aee9ef; font-size: clamp(8px, .58vw, 12px); }
.event-item:nth-child(n+6) { display: none; }

.shabbat-panel { grid-area: parasha; z-index: 2; align-self: end; display: grid; grid-template-columns: clamp(58px, 4.8vw, 102px) minmax(0, 1fr); align-items: center; gap: 14px; height: 27%; margin: 0 14px 14px; padding: 8px 16px; border: 1px solid #d6b65e; border-radius: 7px; background: rgba(255,250,231,.94); box-shadow: 0 -4px 14px rgba(57,31,72,.1); }
.candle-emblem { display: flex; align-items: flex-end; justify-content: center; gap: 7px; width: clamp(50px, 4.2vw, 88px); aspect-ratio: 1; padding-bottom: 16%; border: 3px solid var(--teal); border-radius: 50%; background: linear-gradient(145deg, #fffdf5, #f2dfb2); box-shadow: inset 0 0 12px rgba(226,170,66,.22); }
.candle { position: relative; display: block; width: 17%; border-radius: 2px 2px 1px 1px; background: linear-gradient(90deg, #d79b2d, #ffe08a 48%, #b66b18); box-shadow: 0 0 5px rgba(226,170,66,.4); }
.candle-tall { height: 42%; }
.candle-short { height: 32%; }
.candle i { position: absolute; left: 50%; bottom: calc(100% + 2px); width: 70%; aspect-ratio: .68; border-radius: 70% 30% 65% 35%; background: linear-gradient(#fff4ac, #f0a51d 60%, #9d285b); box-shadow: 0 0 7px rgba(240,165,29,.75); transform: translateX(-50%) rotate(45deg); }
.shabbat-copy { min-width: 0; }
.shabbat-copy h2 { margin: 0 0 5px; color: var(--plum); font-family: Georgia, "Times New Roman", serif; font-size: clamp(14px, 1.25vw, 26px); 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(--teal-dark); font-size: clamp(8px, .56vw, 11px); font-weight: 800; text-transform: uppercase; }
.shabbat-copy strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(15px, 1.35vw, 28px); white-space: nowrap; }
.sse-info-strip { position: absolute; z-index: 5; right: 8px; bottom: 5px; left: 8px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; gap: 8px; height: clamp(30px, 3.4vh, 48px); padding: 3px 12px; overflow: hidden; border: 1px solid var(--gold); color: #fff; background: rgba(3,15,42,.98); font-size: clamp(7px, .46vw, 10px); }
.sse-info-strip div { min-width: 0; overflow: hidden; }
.sse-info-strip span { display: block; color: var(--gold-light); font-weight: 800; text-transform: uppercase; }
.sse-info-strip strong, .sse-info-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sse-info-strip small { color: #8fd9df; }
.sse-info-strip .connected { color: #6ff0b7; }
.sse-info-strip .reconnecting { color: #ffd86f; }
.sse-info-strip .disconnected { color: #ff8e9b; }

.profile-small .kziv-dashboard { gap: 7px; }
.profile-small .identity h1 { font-size: clamp(27px, 2.8vw, 48px); }
.profile-small .zmanim-list { padding-inline: 5px; }
.sse-info-strip { grid-template-columns:repeat(4,minmax(0,1fr)) minmax(180px,1.55fr) repeat(2,minmax(0,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-light); letter-spacing:.08em; }
