:root {
  --navy: #062a5d;
  --navy-deep: #031b3d;
  --blue: #125392;
  --gold: #c99c45;
  --gold-soft: #e5c983;
  --ink: #061c46;
  --muted: #536178;
  --line: rgba(6, 28, 70, .16);
  --panel: rgba(255, 255, 255, .90);
}

.signage-credit { align-self:center; min-width:0; color:#fff; font-size:clamp(8px,.55vw,12px); font-weight:700; text-align:center; white-space:nowrap; }
.signage-credit strong { display:block; color:var(--gold-soft); letter-spacing:.08em; }

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #eeeae1;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

.tv-fixed-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #eeeae1;
}

.tv-fixed-stage {
  position: absolute;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  transform: none !important;
  transform-origin: top left;
}

.screen {
  --outer-pad: clamp(12px, 1.25vw, 28px);
  --shell-pad-x: clamp(22px, 1.7vw, 42px);
  --shell-pad-top: clamp(22px, 1.8vh, 38px);
  --gap: clamp(10px, 1.05vh, 16px);
  --header-h: clamp(112px, 12.6vh, 152px);
  --footer-h: clamp(50px, 5.8vh, 68px);
  --radius: 14px;
  --logo-size: clamp(62px, 4.7vw, 92px);
  --brand-size: clamp(34px, 3vw, 58px);
  --clock-size: clamp(34px, 2.7vw, 52px);
  --meta-size: clamp(13px, .92vw, 18px);
  --panel-title: clamp(13px, .84vw, 17px);
  --row-size: clamp(12px, .82vw, 16px);
  --row-min: clamp(22px, 2.18vh, 28px);
  --parasha-size: clamp(30px, 2.4vw, 48px);
  --summary-size: clamp(12px, .84vw, 16px);
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: var(--outer-pad);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(114deg, transparent 0 36%, rgba(17, 74, 132, .13) 36% 39%, transparent 39% 100%),
    linear-gradient(116deg, transparent 0 43%, rgba(6, 42, 93, .34) 43% 46%, transparent 46% 100%),
    linear-gradient(116deg, transparent 0 48%, rgba(6, 42, 93, .15) 48% 52%, transparent 52% 100%),
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .98), transparent 38%),
    #f6f3eb;
}

.hidden { display: none !important; }

.alert-ribbon {
  position: absolute;
  z-index: 30;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  padding: 16px 34px;
  background: #981e23;
  color: #fff;
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.alert-body { display: grid; gap: 4px; }
.alert-kicker { font-size: 14px; text-transform: uppercase; letter-spacing: 3px; }
.alert-text { font-size: 24px; font-weight: 800; }

.amud-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h);
  gap: var(--gap);
  width: 100%;
  height: 100%;
  padding: var(--shell-pad-top) var(--shell-pad-x) 0;
  overflow: hidden;
  border: clamp(4px, .42vw, 7px) solid #111922;
  border-radius: 8px;
  background: rgba(255, 255, 255, .91);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 1.4vw, 32px);
  min-width: 0;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.35vw, 28px);
  min-width: 0;
}

.brand-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 14px;
}

.brand-divider {
  width: 2px;
  height: calc(var(--logo-size) * .82);
  flex: 0 0 auto;
  background: linear-gradient(transparent, rgba(201, 156, 69, .72), transparent);
}

.brand-text { min-width: 0; }

.brand h1 {
  margin: 0;
  overflow: hidden;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--brand-size);
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rabbi-name {
  margin: .5em 0 0;
  overflow: hidden;
  color: var(--blue);
  font-size: clamp(11px, .78vw, 15px);
  font-weight: 800;
  letter-spacing: clamp(3px, .38vw, 7px);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rabbi-message {
  margin: .3em 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(11px, .8vw, 15px);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-meta {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, .78vw, 16px);
  max-width: 62%;
  min-width: 0;
  padding: clamp(8px, .7vw, 14px) clamp(10px, .9vw, 18px);
  overflow: hidden;
  border: 1px solid rgba(229, 201, 131, .42);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(90deg, rgba(3, 27, 61, .92), rgba(6, 42, 93, .82));
  box-shadow: 0 8px 18px rgba(3, 27, 61, .24);
  white-space: normal;
}

.clock {
  display: inline-flex;
  align-items: baseline;
  gap: .15em;
  flex: 0 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--clock-size);
  line-height: 1;
}

.clock small {
  font-size: .42em;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.clock-seconds { display: none !important; }

.meta-date {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: clamp(10px, .9vw, 18px);
  min-width: 0;
  padding-left: clamp(10px, .9vw, 18px);
  border-left: 1px solid rgba(229, 201, 131, .48);
  font-size: var(--meta-size);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hebrew-date {
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(var(--meta-size) * 1.08);
  letter-spacing: 0;
  text-transform: none;
}

.english-date {
  overflow: hidden;
  text-overflow: ellipsis;
}

.shabbat-times {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .28em .65em;
  width: 100%;
  min-width: 0;
  padding-left: clamp(10px, .9vw, 18px);
  border-left: 1px solid rgba(229, 201, 131, .48);
  color: var(--gold);
  font-size: clamp(10px, .72vw, 14px);
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.shabbat-times span,
.shabbat-times strong {
  white-space: nowrap;
}

.top-meta .shabbat-times { overflow: hidden; }

.shabbat-times strong {
  color: #ffdb87;
  font-size: clamp(15px, 1.05vw, 20px);
  letter-spacing: 0;
  text-transform: none;
}

.clock-status {
  color: #ffdb87;
  font-size: 14px;
  font-weight: 800;
}

.main-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: var(--gap);
}

.panel,
.weather-panel,
.parasha-card,
.photo-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  height: clamp(38px, 4vh, 48px);
  margin: 0 clamp(14px, 1.05vw, 22px);
  border-bottom: 1px solid rgba(201, 156, 69, .45);
  color: var(--blue);
  font-size: var(--panel-title);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.icon { color: var(--blue); font-size: 1.24em; }

.row-list {
  display: grid;
  align-content: start;
  gap: 0 clamp(14px, 1vw, 26px);
  height: calc(100% - clamp(38px, 4vh, 48px));
  padding: clamp(10px, 1vh, 14px) clamp(14px, 1.05vw, 22px);
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  min-height: var(--row-min);
  border-bottom: 1px dotted rgba(6, 28, 70, .17);
  font-size: var(--row-size);
  font-weight: 650;
}

.row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row strong {
  color: var(--navy-deep);
  font-weight: 900;
  white-space: nowrap;
}

.parasha-card {
  padding: clamp(8px, 1vh, 16px) clamp(16px, 1.35vw, 30px);
  border-color: transparent;
  background: transparent;
}

.parasha-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(12px, 1vw, 24px);
}

.parasha-card h2 {
  margin: 0 0 .08em;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--parasha-size);
  font-weight: 500;
  line-height: 1.02;
}

.parasha-hebrew {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--parasha-size);
  line-height: 1.02;
}

.parasha-card p {
  max-height: calc(var(--summary-size) * 5.2);
  margin: .3em 0 0;
  overflow: auto;
  color: var(--ink);
  font-size: var(--summary-size);
  font-weight: 650;
  line-height: 1.3;
}

.parasha-summary-heading {
  margin-top: .85em;
  color: #967138;
  font-size: clamp(10px, .7vw, 13px);
  font-weight: 800;
}

.weather-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: clamp(10px, .9vw, 16px);
  padding: clamp(12px, 1.1vh, 18px);
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #073978);
}

.weather-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.weather-place {
  color: var(--gold-soft);
  font-size: clamp(11px, .76vw, 14px);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.weather-now {
  display: flex;
  align-items: center;
  gap: .38em;
  min-width: 0;
}

.weather-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 1.35vw, 26px);
  line-height: 1;
}

.weather-icon svg {
  width: clamp(28px, 2vw, 42px);
  height: clamp(28px, 2vw, 42px);
}

.weather-now strong {
  min-width: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.6vw, 30px);
  font-weight: 400;
  line-height: 1.08;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-sub {
  margin-top: .15em;
  font-size: clamp(10px, .68vw, 13px);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.weather-days {
  display: flex;
  flex-wrap: wrap;
  gap: .38em .72em;
  margin-top: .75em;
  overflow: hidden;
  font-size: clamp(10px, .7vw, 13px);
  font-weight: 800;
}

.weather-day-item {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  white-space: nowrap;
}

.weather-day-icon {
  display: inline-flex;
  align-items: center;
}

.weather-day-icon svg {
  width: 1.35em;
  height: 1.35em;
}

.weather-days .weather-day-item:nth-child(n+5) { display: none; }

.donation-qr {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-width: clamp(82px, 6vw, 118px);
}

.donation-qr span {
  color: var(--gold-soft);
  font-size: clamp(10px, .7vw, 13px);
  font-weight: 900;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}

.donation-qr img {
  width: clamp(72px, 5.2vw, 104px);
  height: clamp(72px, 5.2vw, 104px);
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, .92);
  border-radius: 10px;
  background: #fff;
}

.calendar-body,
.upcoming-body {
  height: calc(100% - clamp(38px, 4vh, 48px));
  padding: clamp(10px, 1vh, 14px) clamp(14px, 1.05vw, 22px);
  overflow: hidden;
}

.calendar-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.calendar-facts div,
.next-holiday,
.event-item {
  min-width: 0;
  padding-left: 10px;
  border-left: 2px solid rgba(201, 156, 69, .48);
}

.calendar-facts span,
.next-holiday span,
.event-item span {
  display: block;
  color: var(--gold);
  font-size: clamp(9px, .6vw, 11px);
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.calendar-facts strong,
.next-holiday strong,
.event-item strong {
  display: block;
  overflow: hidden;
  color: var(--navy-deep);
  font-size: clamp(11px, .76vw, 14px);
  font-weight: 900;
  line-height: 1.14;
  text-overflow: ellipsis;
}

.calendar-facts small,
.event-item em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(9px, .58vw, 11px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.12;
  text-overflow: ellipsis;
}

.next-holiday {
  margin-top: 10px;
}

.upcoming-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: 10px 14px;
  overflow: hidden;
}

.event-item {
  overflow: hidden;
}

.photo-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #08264f;
}

.photo-panel img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

.photo-panel::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(3, 27, 61, .16), transparent 35%, rgba(3, 27, 61, .08));
}

.footer-bar {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  margin: 0 calc(-1 * var(--shell-pad-x));
  padding: 0 calc(var(--shell-pad-x) + 10px);
  color: var(--gold-soft);
  background: var(--navy-deep);
  font-size: clamp(13px, 1vw, 20px);
  font-weight: 800;
  letter-spacing: clamp(3px, .52vw, 9px);
  text-transform: uppercase;
}

.footer-bar span:nth-child(2) {
  color: #fff;
  text-align: center;
}

.footer-bar span:last-child {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.6vw, 32px);
  text-align: right;
}

.operation-footer {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 calc(-1 * var(--shell-pad-x));
  padding: 8px 18px;
  overflow: hidden;
  color: #fff;
  background: rgba(3, 27, 61, .96);
  font-size: clamp(8px, .52vw, 11px);
}

.operation-item { min-width: 0; }

.operation-item span {
  display: block;
  color: var(--gold-soft);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.operation-item strong,
.operation-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-item small {
  opacity: .78;
  font-size: .88em;
  letter-spacing: 0;
}

.profile-large {
  --header-h: clamp(112px, 12.2vh, 148px);
  --footer-h: clamp(50px, 5.6vh, 66px);
  --brand-size: clamp(32px, 2.65vw, 54px);
  --clock-size: clamp(34px, 2.45vw, 50px);
}

.profile-large .main-grid,
.profile-medium .main-grid,
.profile-small .main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.62fr);
  grid-template-rows: minmax(0, 24%) minmax(0, 50%) minmax(0, 26%);
}

.profile-large .parasha-card,
.profile-medium .parasha-card,
.profile-small .parasha-card { grid-column: 1 / 3; grid-row: 1; }
.profile-large .prayer-panel,
.profile-medium .prayer-panel,
.profile-small .prayer-panel { grid-column: 1; grid-row: 2; }
.profile-large .zmanim-panel,
.profile-medium .zmanim-panel,
.profile-small .zmanim-panel { grid-column: 2; grid-row: 2; }
.profile-large .weather-panel,
.profile-medium .weather-panel,
.profile-small .weather-panel { grid-column: 1; grid-row: 3; }
.profile-large .calendar-panel,
.profile-medium .calendar-panel,
.profile-small .calendar-panel { grid-column: 2; grid-row: 3; }
.profile-large .upcoming-panel,
.profile-medium .upcoming-panel,
.profile-small .upcoming-panel { grid-column: 3; grid-row: 3; }
.profile-large .photo-panel,
.profile-medium .photo-panel,
.profile-small .photo-panel { grid-column: 3; grid-row: 1 / 3; }

.profile-large .prayer-panel .row-list,
.profile-large .zmanim-panel .row-list,
.profile-medium .prayer-panel .row-list,
.profile-medium .zmanim-panel .row-list,
.profile-small .prayer-panel .row-list,
.profile-small .zmanim-panel .row-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-large .calendar-body,
.profile-large .upcoming-body,
.profile-medium .calendar-body,
.profile-medium .upcoming-body,
.profile-small .calendar-body,
.profile-small .upcoming-body {
  overflow: hidden;
}

.profile-medium,
.profile-small {
  --header-h: clamp(128px, 15.2vh, 172px);
  --footer-h: clamp(48px, 6vh, 66px);
  --brand-size: clamp(34px, 3.6vw, 62px);
  --clock-size: clamp(34px, 3.2vw, 56px);
  --row-size: clamp(13px, 1.08vw, 18px);
  --row-min: clamp(23px, 2.35vh, 30px);
  --parasha-size: clamp(32px, 3vw, 50px);
}

.profile-medium .topbar,
.profile-small .topbar {
  justify-content: flex-start;
}

.profile-medium .top-meta,
.profile-small .top-meta {
  min-height: auto;
  gap: 8px;
  padding: 8px 10px;
}

.profile-medium .shabbat-times,
.profile-small .shabbat-times {
  font-size: clamp(9px, .8vw, 12px);
}

@media (max-width: 1500px) {
  .profile-large .top-meta {
    gap: 10px;
  }

  .profile-large .meta-date {
    gap: 8px;
  }
}

.operation-footer { grid-template-columns:repeat(3,minmax(0,1fr)) minmax(180px,1.55fr) repeat(3,minmax(0,1fr)); }
