:root {
  color-scheme: light;
  --ink: #10294f;
  --muted: #5d6f8d;
  --line: #d8e4f5;
  --paper: #eef5ff;
  --surface: #ffffff;
  --deep: #0047ab;
  --deep-2: #002b69;
  --blue: #0a58ca;
  --blue-soft: #dbeafe;
  --blue-pale: #f6faff;
  --silver: #e8eef8;
  --accent: #24a0ed;
  --danger: #b42318;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.side-nav {
  background: var(--deep-2);
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: clamp(58px, 4.5vw, 74px);
  height: clamp(58px, 4.5vw, 74px);
  border: 2px solid rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  padding: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: #9ed0ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand h1,
.page-heading h2,
.screen-toolbar h2 {
  margin: 0;
}

.nav-buttons {
  display: grid;
  gap: 10px;
}

.nav-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border-radius: 8px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-button.active {
  background: white;
  border-color: white;
  color: var(--deep);
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.pilot-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 5px;
}

.pilot-card p,
.pilot-card span {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

main {
  padding: 24px;
  overflow: auto;
}

body.display-mode {
  overflow: hidden;
}

body.display-mode .app-shell {
  display: block;
}

body.display-mode .side-nav,
body.display-mode .screen-toolbar {
  display: none;
}

body.display-mode main {
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

body.display-mode .board-view.active {
  height: 100vh;
}

body.display-mode .signage-frame {
  height: 100vh;
  min-height: 0;
  border-radius: 0;
  grid-template-rows: clamp(86px, 12vh, 132px) auto minmax(0, 1fr) clamp(18px, 2.3vh, 26px);
  gap: clamp(5px, .8vh, 9px);
  padding: clamp(8px, 1.2vh, 14px) clamp(14px, 1.8vw, 22px);
}

.signage-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  border-radius: 0;
  grid-template-rows: clamp(110px, 16vh, 152px) auto minmax(0, 1fr) clamp(24px, 3vh, 34px);
  gap: 0;
  padding: 0;
}

.signage-frame:fullscreen .signage-header {
  border-radius: 0;
  border-inline: 0;
  border-top: 0;
  gap: clamp(28px, 4vw, 82px);
  padding-inline: clamp(24px, 2.6vw, 52px);
}

.signage-frame:fullscreen .signage-header h3 {
  font-size: clamp(46px, 5.2vw, 86px);
}

.signage-frame:fullscreen .date-badge,
.signage-frame:fullscreen .clock {
  min-height: clamp(74px, 10.5vh, 112px);
}

.signage-frame:fullscreen .clock strong {
  font-size: clamp(54px, 6vw, 96px);
}

body.display-mode .signage-header h3 {
  font-size: clamp(34px, 4vw, 62px);
}

body.display-mode .date-badge,
body.display-mode .clock {
  min-height: clamp(62px, 10vh, 94px);
  padding: clamp(5px, 1vh, 10px) clamp(14px, 2vw, 24px);
}

body.display-mode .clock strong {
  font-size: clamp(40px, 6vw, 80px);
}

body.display-mode .next-prayer {
  padding: 5px 14px;
}

body.display-mode .next-prayer h4 {
  font-size: clamp(28px, 3.2vw, 48px);
}

body.display-mode .next-prayer strong {
  font-size: clamp(26px, 3.2vw, 44px);
}

body.display-mode .seasonal-constant {
  padding: 5px 16px;
}

body.display-mode .rotation-stage {
  gap: clamp(5px, .8vh, 9px);
  padding: clamp(6px, 1vh, 10px) clamp(12px, 1.6vw, 18px) clamp(8px, 1.1vh, 12px);
}

body.display-mode .rotation-stage,
.signage-frame:fullscreen .rotation-stage {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(18px, 2.4vh, 28px) clamp(22px, 2.4vw, 44px);
}

body.display-mode .rotation-heading {
  padding-bottom: clamp(4px, .7vh, 7px);
}

.signage-frame:fullscreen .rotation-heading {
  padding-bottom: clamp(12px, 1.7vh, 18px);
}

body.display-mode .rotation-heading h3 {
  font-size: clamp(34px, 4vw, 64px);
}

body.display-mode .ticker {
  min-height: 0;
  padding: 1px 10px;
  border-radius: 4px;
  font-size: clamp(12px, 1vw, 17px);
  line-height: 1.1;
}

.signage-frame:fullscreen .ticker {
  min-height: 0;
  height: 100%;
  padding: 0 clamp(16px, 2vw, 34px);
  border-radius: 0;
  font-size: clamp(18px, 1.55vw, 30px);
  line-height: 1;
}

body.display-mode .display-row span,
body.display-mode .time-row span {
  font-size: clamp(28px, 3.1vw, 48px);
  line-height: 1.05;
}

body.display-mode .prayer-section h4,
body.display-mode .list-title {
  font-size: clamp(34px, 4vw, 64px);
}

body.display-mode .rich-display,
body.display-mode .custom-screen p,
body.display-mode .big-notice p,
body.display-mode .big-event .event-body {
  font-size: clamp(34px, 3.8vw, 62px);
  line-height: 1.16;
}

body.display-mode .custom-screen h4,
body.display-mode .big-notice h4,
body.display-mode .big-event h4 {
  font-size: clamp(38px, 4.4vw, 72px);
}

body.display-mode .holiday-screen {
  padding: clamp(6px, 1vh, 12px) clamp(12px, 1.6vw, 22px);
}

body.display-mode .holiday-main {
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, auto);
  align-items: start;
  align-content: stretch;
  gap: clamp(5px, .75vh, 10px);
}

body.display-mode .holiday-time-grid {
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-content: start;
}

body.display-mode .holiday-prayers {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 100%;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

body.display-mode .holiday-note {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.display-mode .holiday-time-card {
  padding: clamp(5px, .8vh, 10px);
}

body.display-mode .holiday-time-card strong {
  font-size: clamp(28px, 3.8vw, 48px);
}

body.display-mode .holiday-screen .holiday-time-grid {
  gap: clamp(4px, .5vh, 7px);
}

body.display-mode .holiday-screen .holiday-time-card {
  min-height: 0;
  padding: clamp(2px, .35vh, 5px);
}

body.display-mode .holiday-screen .holiday-time-card span {
  font-size: clamp(15px, 1.35vw, 21px);
  line-height: 1;
}

body.display-mode .holiday-screen .holiday-time-card strong {
  margin-top: 1px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: .95;
}

body.display-mode .holiday-prayers h4 {
  margin-bottom: calc(6px * var(--holiday-time-scale, 1));
  font-size: calc(28px * var(--holiday-time-scale, 1));
  line-height: 1;
}

body.display-mode .holiday-prayer-list {
  gap: clamp(2px, .4vh, 5px);
}

body.display-mode .holiday-prayer-columns {
  max-width: min(1120px, 84vw);
  gap: calc(72px * var(--holiday-time-scale, 1));
}

body.display-mode .holiday-prayer-list .display-row {
  min-height: calc(42px * var(--holiday-time-scale, 1));
  gap: calc(14px * var(--holiday-time-scale, 1));
  padding: 0;
}

body.display-mode .holiday-prayer-list .display-row strong {
  font-size: calc(36px * var(--holiday-time-scale, 1));
  line-height: 1;
}

body.display-mode .holiday-prayer-list .display-row span {
  font-size: calc(24px * var(--holiday-time-scale, 1));
  line-height: 1;
}

html.member-app-route body,
body.member-app-mode {
  background: var(--deep-2);
}

html.member-app-route .app-shell,
body.member-app-mode .app-shell {
  display: block;
  min-height: 100vh;
}

html.member-app-route .side-nav,
html.member-app-route .page-heading,
body.member-app-mode .side-nav,
body.member-app-mode .page-heading {
  display: none;
}

html.member-app-route main,
body.member-app-mode main {
  padding: 0;
  min-height: 100vh;
  overflow: visible;
  background: var(--deep-2);
}

html.member-app-route .members-view.active,
body.member-app-mode .members-view.active {
  display: block;
}

html.member-app-route .member-phone,
body.member-app-mode .member-phone {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 24px 16px 28px;
  text-align: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.board-view.active {
  min-height: 0;
}

.screen-toolbar,
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  background: var(--deep);
  color: white;
}

.ghost-button {
  color: var(--deep);
  background: var(--surface);
  border-color: var(--line);
}

.signage-frame {
  height: calc(100vh - 112px);
  min-height: 620px;
  border-radius: 6px;
  color: white;
  background:
    linear-gradient(135deg, rgba(0, 43, 105, .98), rgba(0, 71, 171, .92)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 2px, transparent 2px 74px);
  padding: 16px 22px;
  display: grid;
  grid-template-rows: 132px auto minmax(0, 1fr) 32px;
  gap: 10px;
  box-shadow: 0 26px 80px rgba(0, 43, 105, 0.32);
  position: relative;
  overflow: hidden;
}

.signage-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.signage-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 236, 176, .36), transparent 28%),
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 24%, transparent 76%, rgba(255,255,255,.08));
  pointer-events: none;
}

.template-parchment {
  background:
    linear-gradient(rgba(255, 244, 202, .82), rgba(255, 244, 202, .9)),
    url("https://images.unsplash.com/photo-1548013146-72479768bada?auto=format&fit=crop&w=1600&q=70") center/cover,
    radial-gradient(circle at 18% 34%, rgba(111,73,27,.2), transparent 22%),
    radial-gradient(circle at 78% 18%, rgba(111,73,27,.13), transparent 20%),
    linear-gradient(135deg, #fff1c9, #f2dca4 52%, #fff7dc);
  color: #071f68;
}

.template-parochet {
  background:
    linear-gradient(90deg, rgba(9, 39, 82, .9) 0 9%, rgba(18, 115, 145, .74) 9% 13%, rgba(147, 184, 190, .68) 13% 18%, transparent 18%),
    radial-gradient(ellipse at 13% 18%, rgba(22, 142, 175, .42), transparent 20%),
    radial-gradient(ellipse at 12% 49%, rgba(8, 50, 102, .48), transparent 22%),
    radial-gradient(ellipse at 14% 82%, rgba(111, 158, 169, .4), transparent 20%),
    linear-gradient(90deg, rgba(255,255,255,.78), rgba(235, 246, 246, .88) 56%, rgba(255,255,255,.92)),
    repeating-linear-gradient(90deg, rgba(5, 43, 89, .1) 0 2px, transparent 2px 96px);
  color: #082a67;
}

.template-parochet::after {
  background:
    linear-gradient(104deg, transparent 0 7%, rgba(15, 68, 130, .42) 7.3% 7.8%, transparent 8.1% 100%),
    linear-gradient(78deg, transparent 0 10%, rgba(10, 119, 150, .34) 10.4% 10.9%, transparent 11.2% 100%),
    radial-gradient(circle at 64% 12%, rgba(255,255,255,.36), transparent 24%),
    linear-gradient(90deg, rgba(255,255,255,.2), transparent 32%);
}

.template-parochet .signage-header,
.template-parochet .next-prayer {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(219, 238, 239, .94));
  border-color: rgba(12, 75, 126, .22);
  box-shadow: 0 10px 24px rgba(8, 42, 103, .16);
}

.template-parochet .rotation-stage {
  background: rgba(255, 255, 255, .82);
  border-color: rgba(13, 82, 139, .3);
}

.template-parochet .ticker {
  background: rgba(231, 245, 246, .88);
  color: #082a67;
  border: 1px solid rgba(12, 75, 126, .2);
}

.signage-header,
.next-prayer,
.board-panel,
.rotation-stage,
.seasonal-constant,
.ticker {
  position: relative;
  z-index: 1;
}

.signage-header {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.5fr) minmax(260px, .85fr);
  justify-content: center;
  align-items: center;
  gap: 20px;
  background: linear-gradient(180deg, rgba(255,250,220,.94), rgba(230,201,130,.96));
  color: #082a67;
  border: 2px solid rgba(112,78,24,.36);
  border-radius: 0 0 28px 28px;
  padding: clamp(8px, 1.1vh, 14px) 28px;
  box-shadow: 0 10px 22px rgba(30,18,0,.16);
}

.signage-header {
  grid-row: 1;
}

.signage-header p,
.next-prayer p {
  margin: 0;
  color: #d7ecff;
  font-weight: 700;
}

.next-prayer p {
  color: var(--blue);
}

.signage-header h3 {
  margin: 0;
  font-size: clamp(42px, 4.4vw, 72px);
  line-height: 1;
  color: #082a67;
  text-shadow: 0 2px 0 rgba(255,255,255,.8);
  text-align: center;
  grid-column: 2;
  align-self: center;
  justify-self: center;
  white-space: nowrap;
}

.signage-header h3.name-font-frank {
  font-family: "Frank Ruhl Libre", "David", Georgia, serif;
}

.signage-header h3.name-font-david {
  font-family: "David", "Times New Roman", serif;
}

.signage-header h3.name-font-arial {
  font-family: Arial, "Segoe UI", sans-serif;
}

.signage-header h3.name-font-serif {
  font-family: Georgia, "Times New Roman", serif;
}

.signage-header h3.name-shape-rainbow {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: .02em;
  min-height: 1.35em;
  width: 100%;
  justify-self: center;
  text-align: center;
  overflow: visible;
}

.signage-header h3.name-shape-rainbow span {
  display: inline-block;
  transform-origin: bottom center;
}

.clock,
.date-badge {
  text-align: center;
  min-width: clamp(250px, 18vw, 350px);
  min-height: clamp(96px, 10vh, 128px);
  background: radial-gradient(circle, #0d76bc, #052e68 70%);
  color: white;
  border: 6px solid rgba(255,255,255,.7);
  border-radius: 999px;
  padding: clamp(8px, 1vh, 12px) 22px;
  box-shadow: 0 8px 0 rgba(4,22,64,.22), inset 0 0 20px rgba(255,255,255,.2);
  grid-row: 1;
  align-self: center;
}

.clock {
  grid-column: 1;
  justify-self: start;
}

.date-badge {
  grid-column: 3;
  justify-self: end;
  display: grid;
  align-content: center;
}

.clock strong {
  display: block;
  font-size: clamp(44px, 5.2vw, 80px);
  line-height: .95;
  text-align: center;
}

.date-badge span {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  display: block;
  text-align: center;
  font-size: clamp(15px, 1.18vw, 20px);
  line-height: 1.22;
  text-shadow: 0 1px 2px rgba(0,0,0,.38);
}

.date-badge span:first-child {
  font-size: clamp(20px, 1.8vw, 32px);
  font-weight: 900;
}

.next-prayer {
  background: linear-gradient(180deg, #fff7d7, #ecd08a);
  color: var(--deep-2);
  border-radius: 10px;
  padding: 8px 18px;
  display: none;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: clamp(18px, 2.6vw, 42px);
  width: fit-content;
  min-width: min(520px, 82%);
  max-width: 92%;
  box-shadow: 0 6px 16px rgba(0,0,0,.14);
}

.next-prayer > div {
  display: contents;
}

.next-prayer p {
  display: grid;
  line-height: 1;
  text-align: center;
  align-self: center;
}

.next-prayer h4 {
  margin: 0;
  font-size: clamp(32px, 3.6vw, 54px);
  line-height: 1;
}

.next-prayer strong {
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1;
  align-self: center;
}

.seasonal-constant {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.seasonal-constant {
  grid-row: 2;
}

.seasonal-constant.empty {
  display: none;
}

.seasonal-pill {
  background: rgba(5, 47, 98, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  direction: rtl;
  unicode-bidi: isolate;
}

.seasonal-pill span {
  color: white;
  font-weight: 800;
  font-size: clamp(15px, 1.2vw, 20px);
}

.seasonal-pill strong {
  color: white;
  font-size: clamp(20px, 1.8vw, 30px);
  direction: rtl;
  unicode-bidi: isolate;
}

.holiday-elements {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 14px);
  flex-wrap: wrap;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(0, 42, 130, .22);
  border-radius: 999px;
  padding: 7px 14px;
  color: #001d69;
  box-shadow: 0 8px 18px rgba(0, 29, 105, .1);
}

.holiday-elements strong,
.holiday-elements span {
  font-weight: 900;
  font-size: clamp(15px, 1.2vw, 22px);
}

.holiday-elements span {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(218, 237, 240, .86));
  border: 1px solid rgba(0, 42, 130, .18);
  border-radius: 999px;
  padding: 5px 10px;
}

.omer-pill strong {
  white-space: nowrap;
}

.menorah {
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 42px;
}

.candle {
  width: 10px;
  height: 28px;
  border-radius: 999px 999px 2px 2px;
  background: rgba(255,255,255,.45);
  position: relative;
}

.candle.lit::before {
  content: "";
  position: absolute;
  inset-inline-start: 1px;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 50% 50% 45% 45%;
  background: #ffd166;
  box-shadow: 0 0 12px #ffd166;
}

.rotation-stage {
  background: rgba(255, 247, 210, 0.82);
  border: 2px solid rgba(0, 36, 122, 0.48);
  border-radius: 28px 28px 54px 54px;
  padding: 10px 18px 14px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
  color: #061c57;
  box-shadow: inset 0 0 38px rgba(255,255,255,.7), 0 12px 26px rgba(0,0,0,.16);
}

.rotation-stage {
  grid-row: 3;
}

.rotation-heading {
  display: grid;
  place-items: center;
  gap: 16px;
  border-bottom: 2px solid rgba(0, 42, 130, 0.16);
  padding-bottom: 8px;
  text-align: center;
}

.rotation-heading h3 {
  margin: 0;
  font-size: clamp(34px, 4vw, 64px);
  line-height: 1;
  color: #001d69;
  text-shadow: 0 2px 0 rgba(255,255,255,.8);
}

.rotation-heading span,
.rotation-heading small {
  color: #0a58ca;
  font-weight: 800;
}

.rotation-heading span {
  display: none;
}

.rotating-content {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.board-panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 18px;
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: #d7ecff;
  font-weight: 800;
  font-size: 22px;
}

.panel-title small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.prayer-list,
.zmanim-list,
.display-list {
  display: grid;
  gap: clamp(6px, 1vh, 14px);
  align-content: stretch;
  height: 100%;
  width: min(760px, 100%);
  margin: 0 auto;
}

.display-list.two-column-list {
  width: min(1280px, 100%);
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  column-gap: clamp(28px, 5vw, 80px);
}

.prayer-column-set {
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(34px, 4vw, 72px);
  width: min(100%, 1320px);
  margin: 0 auto;
  align-items: start;
}

.prayer-column-set .display-list,
.prayer-row-list {
  width: 100%;
}

.time-row,
.display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 56px);
  border-bottom: 2px solid rgba(0, 42, 130, 0.14);
  padding: clamp(4px, .8vh, 10px) 0;
  direction: ltr;
  width: 100%;
}

.two-column-list .display-row {
  grid-template-columns: minmax(95px, max-content) minmax(0, 1fr);
}

.time-row span,
.display-row span {
  color: #001d69;
  flex: 1 1 auto;
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.time-row strong,
.display-row strong {
  font-size: clamp(28px, 4.1vw, 58px);
  color: #001d69;
  flex: 0 0 auto;
  direction: ltr;
}

.display-row span {
  font-size: clamp(24px, 2.9vw, 44px);
  font-weight: 800;
}

.signage-frame .display-list[data-fit-list] {
  display: grid;
  grid-template-columns: repeat(var(--list-columns, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--list-rows, 1), min-content);
  grid-auto-flow: column;
  align-content: center;
  height: 100%;
  min-height: 0;
  min-width: 0;
  width: 100%;
  padding: 4px;
  column-gap: calc(40px * var(--time-scale, 1));
  row-gap: calc(10px * var(--time-scale, 1));
}

.signage-frame .display-list[data-fit-list] .display-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  min-height: 0;
  gap: calc(24px * var(--time-scale, 1));
  padding: calc(10px * var(--time-scale, 1)) 0;
}

.signage-frame .display-list[data-fit-list] .display-row strong {
  font-size: calc(78px * var(--time-scale, 1));
  line-height: 1.08;
}

.signage-frame .display-list[data-fit-list] .display-row span {
  font-size: calc(52px * var(--time-scale, 1));
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.signage-frame .prayer-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 4px;
}

.signage-frame .prayer-columns .prayer-section[style] h4 {
  font-size: calc(52px * var(--time-scale, 1));
  line-height: 1.12;
  padding-top: 8px;
  margin: 0 0 calc(12px * var(--time-scale, 1));
}

.signage-frame .prayer-columns .prayer-section .shabbat-mevarchim-note {
  font-size: calc(40px * var(--time-scale, 1));
  margin-bottom: calc(12px * var(--time-scale, 1));
}

.signage-frame .prayer-section .display-list[data-fit-list] { flex: 1; }

.expiry-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-block: 12px;
}

.expiry-editor label { flex: 1 1 180px; }
.expiry-editor output { color: #344865; padding-block: 10px; }

.prayer-section {
  margin-bottom: 0;
  min-width: 0;
  text-align: center;
}

.prayer-columns {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: clamp(14px, 2vw, 28px);
  height: 100%;
  align-items: start;
  justify-items: center;
}

body.display-mode .prayer-column-set,
.signage-frame:fullscreen .prayer-column-set {
  width: min(1480px, 84vw);
  column-gap: clamp(96px, 10vw, 190px);
}

body.display-mode .display-row strong,
.signage-frame:fullscreen .display-row strong {
  font-size: clamp(56px, 4.9vw, 88px);
}

body.display-mode .display-row span,
.signage-frame:fullscreen .display-row span {
  font-size: clamp(44px, 3.7vw, 72px);
  line-height: 1.08;
}

.signage-frame:fullscreen .prayer-section h4 {
  font-size: clamp(44px, 3.8vw, 72px);
  color: #0060d2;
}

.shabbat-mevarchim-note {
  width: min(100%, 1100px);
  margin: 0 auto clamp(10px, 1.2vw, 18px);
  color: #001f69;
  font-size: clamp(24px, 2.7vw, 48px);
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
}

body.display-mode .shabbat-mevarchim-note,
.signage-frame:fullscreen .shabbat-mevarchim-note {
  font-size: clamp(36px, 3.2vw, 62px);
}

.prayer-columns.group-count-2 {
  grid-template-columns: minmax(420px, 1.1fr) minmax(520px, 1.25fr);
}

.prayer-columns.group-count-2 .display-list.two-column-list {
  grid-template-columns: 1fr;
  width: 100%;
}

.prayer-columns.group-count-1 .prayer-section {
  max-width: min(1100px, 100%);
}

.prayer-columns .prayer-section {
  width: 100%;
  max-width: 680px;
}

.prayer-section .display-list {
  width: 100%;
}

.prayer-section .display-row {
  gap: clamp(8px, 1vw, 16px);
}

.prayer-section .display-row span {
  max-width: none;
  line-height: 1.08;
}

.prayer-section .display-list.two-column-list {
  column-gap: clamp(42px, 6vw, 92px);
}

.holiday-screen {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  padding: clamp(8px, 1.3vw, 18px);
}

.holiday-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  font-weight: 900;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.holiday-watermark span {
  color: rgba(0, 29, 105, .045);
  font-size: clamp(34px, 5vw, 82px);
  white-space: nowrap;
  transform: rotate(-9deg);
}

.holiday-watermark span:nth-child(2n) {
  transform: rotate(7deg);
}

.holiday-watermark span:nth-child(3n) {
  opacity: .76;
}

.holiday-decoration-strip {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.holiday-decoration {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(0, 29, 105, .15));
  opacity: .34;
}

.holiday-decoration-1 {
  width: clamp(110px, 12vw, 180px);
  top: clamp(0px, 1vh, 12px);
  left: clamp(-10px, 1vw, 18px);
}

.holiday-decoration-2 {
  width: clamp(140px, 15vw, 220px);
  bottom: clamp(10px, 3vh, 34px);
  left: clamp(2px, 2vw, 34px);
}

.holiday-decoration-3 {
  width: clamp(110px, 12vw, 180px);
  top: clamp(0px, 1vh, 12px);
  right: clamp(-10px, 1vw, 18px);
}

.holiday-decoration-4 {
  width: clamp(140px, 15vw, 220px);
  bottom: clamp(10px, 3vh, 34px);
  right: clamp(2px, 2vw, 34px);
}

.holiday-main {
  position: relative;
  z-index: 2;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.2vh, 14px);
  align-content: start;
}

.holiday-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(8px, 1.3vw, 16px);
}

.holiday-time-card,
.holiday-note {
  border: 2px solid rgba(0, 42, 130, .18);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  text-align: center;
  padding: clamp(8px, 1.2vw, 14px);
  box-shadow: inset 0 0 24px rgba(255,255,255,.48);
}

.holiday-time-card span,
.holiday-prayers h4 {
  color: #0a58ca;
  font-weight: 900;
}

.holiday-time-card strong {
  display: block;
  margin-top: 3px;
  color: #001d69;
  font-size: clamp(32px, 4.6vw, 62px);
  direction: ltr;
}

.holiday-prayers {
  min-height: 0;
  overflow: hidden;
  text-align: center;
}

.holiday-prayers h4 {
  margin: 0 0 clamp(4px, .8vh, 8px);
  font-size: clamp(22px, 2.2vw, 32px);
}

.holiday-prayer-list {
  width: min(920px, 100%);
  height: auto;
  max-height: 100%;
  gap: clamp(3px, .6vh, 7px);
  align-content: start;
}

.holiday-prayer-columns {
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(54px, 7vw, 118px);
  width: min(1180px, 100%);
  margin: 0 auto;
  align-items: start;
}

.holiday-prayer-columns .holiday-prayer-list {
  width: 100%;
}

.holiday-prayer-list .display-row {
  grid-template-columns: minmax(104px, max-content) minmax(0, 1fr);
  justify-content: flex-start;
  gap: clamp(8px, 1.2vw, 18px);
  min-height: clamp(44px, 6.6vh, 66px);
  padding: clamp(2px, .45vh, 5px) 0;
}

.holiday-prayer-list .display-row strong {
  font-size: clamp(30px, 4.2vw, 54px);
}

.holiday-prayer-list .display-row span {
  font-size: clamp(20px, 2.4vw, 32px);
  max-width: min(36ch, 48vw);
  line-height: 1.05;
}

.holiday-note strong {
  display: block;
  color: #001d69;
  font-size: clamp(24px, 3vw, 44px);
}

.holiday-note p {
  margin: 8px 0 0;
  color: #06306e;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 800;
}

.big-notice h4,
.big-event h4,
.custom-screen h4 {
  margin: 0 0 10px;
  color: #001d69;
  font-size: clamp(26px, 3.2vw, 50px);
  line-height: 1.08;
}

.prayer-section h4 {
  margin: 0 0 16px;
  color: #001d69;
  font-size: clamp(34px, 3.8vw, 64px);
  line-height: 1.05;
  text-align: center;
}

.notice-grid,
.event-grid,
.shabbat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: clamp(8px, 1vw, 14px);
  height: 100%;
  align-content: center;
  justify-items: stretch;
}

.big-notice,
.big-event,
.shabbat-card,
.custom-screen,
.empty-screen {
  background: rgba(255, 255, 255, 0.54);
  border: 2px solid rgba(0, 42, 130, 0.24);
  border-radius: 8px;
  padding: clamp(12px, 1.4vw, 18px);
  color: #001d69;
  text-align: center;
  display: grid;
  align-content: center;
}

.big-notice p,
.custom-screen p {
  margin: 0;
  color: #14366f;
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1.35;
}

.rich-display {
  color: #14366f;
  font-size: clamp(28px, 3.4vw, 54px);
  line-height: 1.25;
  font-weight: 700;
}

.big-event .rich-display,
.big-notice .rich-display {
  font-size: clamp(28px, 3vw, 50px);
  font-weight: 800;
}

.big-event .event-body {
  font-size: clamp(34px, 3.7vw, 62px);
  line-height: 1.18;
}

.custom-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  text-align: center;
  min-height: 100%;
}

.custom-screen.with-image {
  grid-template-columns: minmax(240px, .45fr) minmax(0, 1fr);
  gap: 18px;
  direction: ltr;
}

.custom-copy {
  direction: rtl;
}

.custom-image,
.notice-thumb {
  width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid rgba(255,255,255,.8);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.notice-thumb {
  max-height: 150px;
  margin-bottom: 8px;
}

.custom-template-image.with-image {
  grid-template-columns: 1fr;
}

body.display-mode .custom-screen,
.signage-frame:fullscreen .custom-screen {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body.display-mode .custom-screen.with-image,
.signage-frame:fullscreen .custom-screen.with-image {
  width: min(1380px, 82vw);
  margin: 0 auto;
  grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr);
  gap: clamp(60px, 8vw, 150px);
  align-content: center;
  align-items: center;
}

body.display-mode .custom-screen .rich-display,
.signage-frame:fullscreen .custom-screen .rich-display {
  font-size: clamp(52px, 4.5vw, 86px);
  line-height: 1.14;
  color: #001d69;
  font-weight: 900;
}

body.display-mode .custom-screen.with-image .custom-image,
.signage-frame:fullscreen .custom-screen.with-image .custom-image {
  max-height: 58vh;
  object-fit: contain;
}

body.display-mode .event-grid,
.signage-frame:fullscreen .event-grid {
  align-content: center;
  align-items: center;
}

.custom-template-image .custom-image {
  max-height: 42vh;
}

.big-event span {
  color: #0a58ca;
  font-weight: 800;
  font-size: clamp(26px, 2.2vw, 40px);
  text-align: center;
}

.big-event strong {
  color: #001d69;
  font-size: clamp(28px, 3.6vw, 56px);
}

.shabbat-card span {
  display: block;
  color: #0a58ca;
  font-weight: 900;
  font-size: clamp(20px, 2.4vw, 32px);
  margin-bottom: 8px;
  text-align: center;
}

.shabbat-card strong {
  display: block;
  color: #001d69;
  font-size: clamp(24px, 3.4vw, 50px);
  line-height: 1.08;
}

.shabbat-note {
  grid-column: 1 / -1;
}

.shabbat-note p {
  margin: 8px 0 0;
  color: #14366f;
  font-size: clamp(18px, 2.2vw, 30px);
}

.notice-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.notice-item strong {
  display: block;
  font-size: 22px;
}

.bilingual {
  display: grid;
  gap: 2px;
}

.bilingual small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.notice-item span,
.notice-item p {
  color: rgba(255, 255, 255, 0.76);
  margin: 4px 0 0;
}

.ticker {
  background: rgba(255, 247, 210, 0.82);
  color: #001d69;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: clamp(16px, 1.4vw, 24px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  border: 1px solid rgba(0, 42, 130, .18);
}

.ticker {
  grid-row: 4;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.admin-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.admin-tab {
  border: 1px solid var(--line);
  background: var(--blue-pale);
  color: var(--deep-2);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 800;
}

.admin-tab.active {
  background: var(--deep);
  color: white;
  border-color: var(--deep);
}

.admin-panel[data-admin-section] {
  display: none;
}

.admin-panel.active-admin-section {
  display: grid;
}

.admin-login {
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.admin-login h3 {
  margin: 0;
}

.admin-login.hidden {
  display: none;
}

.pairing-code-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
  display: grid;
  gap: 5px;
}

.pairing-code-box strong {
  color: var(--deep);
  font-size: 42px;
  letter-spacing: 4px;
  direction: ltr;
}

.display-device-tools {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.display-device-list {
  display: grid;
  gap: 8px;
}

.display-device-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
}

.display-device-card.revoked {
  opacity: .62;
}

.display-device-card strong,
.display-device-card span {
  display: block;
}

.display-device-card span {
  color: var(--muted);
  font-size: 13px;
}

.pairing-view.active {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
}

.pairing-screen {
  width: min(620px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 43, 105, 0.16);
}

.pairing-screen h2 {
  margin: 0 0 22px;
  font-size: clamp(34px, 6vw, 68px);
}

#pairingCodeInput {
  direction: ltr;
  text-align: center;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 10px;
  height: 86px;
  margin-bottom: 18px;
}

.admin-grid.locked {
  display: none;
}

.admin-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.admin-panel h3 {
  margin: 0 0 14px;
}

.admin-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
  color: var(--muted);
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 13px;
  min-width: 0;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfa;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 8px;
}

.shabbat-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.rabbanut-import-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
}

.rabbanut-current-match {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.rabbanut-current-match strong {
  color: var(--deep);
}

.rabbanut-image-preview {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.rabbanut-image-preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.file-inline {
  width: auto;
  margin: 0;
}

.file-inline input {
  width: min(280px, 100%);
}

.empty-admin-list {
  color: var(--muted);
  font-weight: 800;
}

.reading-profile-box {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) repeat(2, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
}

.reading-profile-box strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.holiday-template-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.holiday-template-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 800;
}

.holiday-template-tab.active {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.holiday-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.holiday-auto-times {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 800;
}

.holiday-auto-times strong {
  color: var(--ink);
}

.holiday-decoration-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}

.holiday-template-editor h4 {
  margin: 12px 0 10px;
}

.check-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
  color: var(--ink);
}

.standalone-check {
  margin-top: 4px;
}

.check-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--deep);
}

input:disabled {
  color: var(--muted);
}

.editor-list {
  display: grid;
  gap: 10px;
}

.synagogue-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) minmax(110px, 150px);
  gap: 8px;
  align-items: end;
}

.custom-editor-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--blue-pale);
  display: grid;
  gap: 10px;
}

.custom-editor-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto 42px;
  gap: 8px;
  align-items: end;
}

.rich-toolbar {
  display: grid;
  grid-template-columns: repeat(4, max-content) minmax(110px, 150px) minmax(130px, 170px) minmax(130px, 170px);
  align-items: center;
  gap: 6px;
}

.rich-toolbar button,
.rich-toolbar select {
  min-height: 34px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  color: var(--deep);
  font-weight: 800;
  padding: 0 10px;
  width: auto;
}

.rich-editor {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px;
  outline: none;
  line-height: 1.45;
}

.remove-image {
  width: fit-content;
}

.custom-editor-row .check-row {
  height: 42px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 150px) 42px;
  gap: 8px;
  align-items: end;
}

.editor-row.three {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(100px, 140px) auto 42px;
}

.editor-row.rabbanut-row {
  grid-template-columns: minmax(150px, 180px) minmax(210px, clamp(260px, 28vw, 420px)) minmax(110px, 140px) minmax(110px, 140px) 42px;
  gap: 8px;
  align-items: end;
}

.rabbanut-row .rabbanut-note-field {
  min-width: 210px;
}

.rabbanut-row label {
  margin-bottom: 0;
}

.prayer-editor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  padding-inline-end: 50px;
  position: relative;
}

.prayer-editor-row > label {
  flex: 1 1 110px;
  max-width: 100%;
  margin-bottom: 0;
}

.prayer-editor-row > label:first-child {
  flex: 2 1 150px;
}

.prayer-editor-row > label:has(select[data-key="calcRounding"]),
.prayer-editor-row > label:has(select[data-key="calcBase"]) {
  flex-basis: 140px;
}

.prayer-editor-row > .delete-button {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
}

.delete-button {
  min-height: 42px;
  width: 42px;
  border: 1px solid #e7c7bd;
  color: var(--danger);
  background: #fff6f3;
  border-radius: 8px;
  font-weight: 800;
}

.add-row {
  margin-top: 12px;
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.event-card {
  border-radius: 8px;
  background: var(--blue-soft);
  padding: 12px;
  border: 1px solid #c7dcff;
}

.event-card strong,
.event-card span {
  display: block;
}

.member-phone {
  width: min(420px, 100%);
  margin: 0 auto;
  background: var(--deep-2);
  color: white;
  min-height: 760px;
  border-radius: 34px;
  padding: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
  position: relative;
}

.member-logo {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: rgba(255, 255, 255, .96);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.member-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 18px 0;
}

.member-tab {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: white;
  border-radius: 8px;
  padding: 10px 8px;
  font-weight: 800;
}

.member-tab.active {
  background: white;
  color: var(--deep-2);
}

.member-pane {
  display: none;
}

.member-pane.active {
  display: block;
}

.member-board-panel {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: 16px;
  margin-top: 16px;
}

.member-board-panel h4 {
  margin: 14px 0 12px;
  color: #d7ecff;
  font-size: 28px;
  text-align: center;
}

.member-screen-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.member-screen-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: white;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 900;
}

.member-screen-button.active {
  background: white;
  color: var(--deep-2);
  border-color: white;
}

.member-shabbat-summary {
  display: grid;
  gap: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(219,234,254,.94));
  color: var(--deep-2);
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
  justify-items: center;
}

.member-shabbat-summary strong {
  font-size: 21px;
  line-height: 1.15;
}

.member-shabbat-summary .member-candle-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
}

.member-shabbat-summary span {
  border-radius: 8px;
  background: rgba(0, 71, 171, .08);
  padding: 6px 10px;
  color: var(--deep-2);
  font-weight: 900;
  line-height: 1.25;
}

.phone-top {
  width: 110px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  margin: 0 auto 28px;
}

.member-phone h3 {
  font-size: 34px;
  margin: 0;
  text-align: center;
}

.member-date {
  color: #d7ecff;
  margin: 6px auto 0;
  text-align: center;
  line-height: 1.45;
}

.member-install {
  display: grid;
  gap: 7px;
  justify-items: center;
  margin: 14px 0 4px;
  text-align: center;
}

.member-install-button {
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--deep-2);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
}

.member-install small {
  color: #d7ecff;
  line-height: 1.35;
}

.member-preference {
  background: white;
  color: var(--deep-2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
}

.member-preference input {
  width: 18px;
  height: 18px;
}

.member-section {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: 16px;
  margin-top: 16px;
}

.member-section h4 {
  margin: 0 0 10px;
  color: #d7ecff;
}

.member-card {
  display: grid;
  gap: 5px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  text-align: center;
  justify-items: center;
}

.member-card span,
.member-section small {
  color: rgba(255,255,255,.78);
}

.member-holiday-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.member-holiday-time-row.single {
  grid-template-columns: 1fr;
}

.member-holiday-time-row .member-card {
  margin-bottom: 0;
}

.member-shabbat-mevarchim {
  width: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  color: #d7ecff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.member-card.compact {
  grid-template-columns: 1fr;
  align-items: center;
}

.member-section input,
.member-section select {
  width: 100%;
  margin-bottom: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
  padding: 8px 10px;
}

.member-date-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  text-align: right;
}

.hebrew-converter {
  display: grid;
  gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  text-align: right;
}

.hebrew-converter strong {
  color: white;
}

#hebrewConverterResult {
  color: #d7ecff;
  font-weight: 800;
  text-align: center;
}

.use-converted-date:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.mini-check {
  display: flex;
  gap: 7px;
  align-items: center;
  color: white;
}

.mini-check input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.member-donate-link {
  display: block;
  text-align: center;
  background: white;
  color: var(--deep-2);
  border-radius: 8px;
  padding: 12px;
  font-weight: 900;
  text-decoration: none;
}

.member-admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.member-invite-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  margin-bottom: 12px;
}

.member-invite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.invite-link-output {
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--deep-2);
}

.member-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.analytics-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
  text-align: center;
  color: var(--deep-2);
  font-weight: 800;
}

.analytics-card strong {
  color: var(--deep);
  font-size: 34px;
  line-height: 1;
}

.analytics-card span {
  color: var(--muted);
}

.analytics-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.admin-member-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-pale);
}

.empty-admin {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.loading {
  color: rgba(255,255,255,.72);
}

.toast {
  position: fixed;
  inset-inline-start: 24px;
  bottom: 24px;
  background: var(--deep);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0,0,0,.2);
  z-index: 20;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    padding: 16px;
  }

  .nav-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .pilot-card {
    display: none;
  }

  .board-grid,
  .admin-grid,
  .event-strip,
  .notice-grid,
  .event-grid,
  .shabbat-grid,
  .check-list,
  .shabbat-admin-grid,
  .reading-profile-box {
    grid-template-columns: 1fr;
  }

  .signage-header,
  .rotation-heading,
  .screen-toolbar,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .clock {
    text-align: right;
  }

  .editor-row,
  .editor-row.three,
  .custom-editor-top,
  .synagogue-name-row,
  .rich-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (orientation: portrait) {
  .signage-frame {
    grid-template-rows: clamp(260px, 28vh, 330px) clamp(70px, 8vh, 92px) auto minmax(0, 1fr) 54px;
  }

  .signage-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .signage-header h3,
  .clock,
  .date-badge {
    grid-column: 1;
    justify-self: center;
  }

  .signage-header h3 {
    white-space: normal;
    font-size: clamp(42px, 7.2vw, 74px);
  }

  .clock {
    min-width: min(78vw, 460px);
    grid-row: 3;
  }

  .date-badge {
    min-width: min(78vw, 460px);
    grid-row: 2;
    min-height: clamp(96px, 10vh, 128px);
  }

  .clock strong {
    font-size: clamp(48px, 9vw, 86px);
  }

  .date-badge span {
    font-size: clamp(16px, 2.4vw, 23px);
  }

  .next-prayer {
    min-width: min(78vw, 620px);
    grid-template-columns: auto 1fr auto;
  }

  .notice-grid,
  .event-grid,
  .shabbat-grid {
    grid-template-columns: 1fr;
  }

  .custom-screen.with-image {
    grid-template-columns: 1fr;
  }

  .display-list {
    width: min(720px, 100%);
  }

  .display-list.two-column-list,
  .prayer-columns {
    grid-template-columns: 1fr;
  }

  .prayer-columns.group-count-2 {
    grid-template-columns: 1fr;
  }

  .display-row {
    grid-template-columns: 1fr;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 4px;
    padding: clamp(8px, 1.2vh, 14px) 0;
  }

  .display-row strong {
    text-align: center;
  }

  .display-row span {
    text-align: center;
  }

  .notice-grid,
  .event-grid,
  .shabbat-grid {
    align-content: stretch;
  }
}

@media (max-width: 620px) {
  main {
    padding: 14px;
  }

  .nav-buttons {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    flex-direction: column;
  }

  .signage-frame {
    padding: 16px;
  }

  .time-row strong {
    font-size: 24px;
  }
}
