/* update-684 — Signage Studio: theme v2, free grid layouts, 12 transitions, new slide styles, new widgets,
   overlays (notice / chime), custom emergency screen. Loaded after signage.css on every page that renders
   the stage (display, previews). Everything keys off the same --sg-* variables. */

/* ---------------------------------------------------------------- theme v2 variables */
.sg-stage {
  --sg-radius: 30px;
  --sg-zone-opacity: 1;
  --sg-overlay: 0.35;
}
.sg-stage.font-cairo,
.sg-stage.font-cairo .sg-text {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
.sg-stage.font-zain,
.sg-stage.font-zain .sg-text {
  font-family: 'Zain', 'Cairo', sans-serif;
}
.sg-stage.font-amiri,
.sg-stage.font-amiri .sg-text {
  font-family: 'Amiri', 'Cairo', serif;
}
.sg-stage.font-system,
.sg-stage.font-system .sg-text {
  font-family: system-ui, 'Segoe UI', Tahoma, sans-serif;
}
.sg-stage.hfont-cairo .sg-h-title,
.sg-stage.hfont-cairo .sg-text-heading,
.sg-stage.hfont-cairo .sg-w-head h3 {
  font-family: 'Cairo', sans-serif;
}
.sg-stage.hfont-zain .sg-h-title,
.sg-stage.hfont-zain .sg-text-heading,
.sg-stage.hfont-zain .sg-w-head h3 {
  font-family: 'Zain', 'Cairo', sans-serif;
}
.sg-stage.hfont-amiri .sg-h-title,
.sg-stage.hfont-amiri .sg-text-heading,
.sg-stage.hfont-amiri .sg-w-head h3 {
  font-family: 'Amiri', serif;
}
.sg-text.font-cairo {
  font-family: 'Cairo', sans-serif;
}
.sg-text.font-zain {
  font-family: 'Zain', sans-serif;
}
.sg-text.font-amiri {
  font-family: 'Amiri', serif;
}
.sg-text.font-system {
  font-family: system-ui, sans-serif;
}
.sg-zone {
  border-radius: var(--sg-radius);
  opacity: var(--sg-zone-opacity);
}
.sg-stage.no-shadow .sg-zone,
.sg-stage.no-shadow .sg-header,
.sg-stage.no-shadow .sg-ticker {
  box-shadow: none;
}
.sg-stage.no-blur .sg-zone {
  backdrop-filter: none;
}
.sg-bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--sg-overlay));
  opacity: 0;
}
.sg-stage.bg-image .sg-bg-overlay,
.sg-stage.bg-video .sg-bg-overlay {
  opacity: 1;
}
.sg-stage.bg-image .sg-bg::after {
  display: none;
}
.sg-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* background patterns */
.sg-stage.pattern-none .sg-bg-pattern {
  background: none;
}
.sg-stage.pattern-grid .sg-bg-pattern {
  background: linear-gradient(color-mix(in srgb, var(--sg-accent) 10%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--sg-accent) 10%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.6;
}
.sg-stage.pattern-waves .sg-bg-pattern {
  background: radial-gradient(
      circle at 50% 120%,
      color-mix(in srgb, var(--sg-primary) 70%, transparent),
      transparent 55%
    ),
    repeating-radial-gradient(
      circle at 50% 140%,
      transparent 0 56px,
      color-mix(in srgb, var(--sg-accent) 9%, transparent) 56px 58px
    );
}
.sg-stage.pattern-diagonal .sg-bg-pattern {
  background: repeating-linear-gradient(
    135deg,
    transparent 0 44px,
    color-mix(in srgb, var(--sg-accent) 8%, transparent) 44px 46px
  );
}
.sg-stage.pattern-circles .sg-bg-pattern {
  background: radial-gradient(
      circle at 15% 30%,
      color-mix(in srgb, var(--sg-accent) 18%, transparent) 0 140px,
      transparent 141px
    ),
    radial-gradient(
      circle at 85% 75%,
      color-mix(in srgb, var(--sg-primary) 55%, transparent) 0 260px,
      transparent 261px
    ),
    radial-gradient(circle at 70% 15%, color-mix(in srgb, var(--sg-accent) 10%, transparent) 0 90px, transparent 91px);
}
/* background animations */
@keyframes sgFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-2%, 1.5%, 0) scale(1.04);
  }
}
@keyframes sgGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes sgAurora {
  0%,
  100% {
    filter: hue-rotate(0deg);
    opacity: 0.55;
  }
  50% {
    filter: hue-rotate(28deg);
    opacity: 0.85;
  }
}
.sg-stage.anim-float .sg-bg-pattern {
  animation: sgFloat 26s ease-in-out infinite;
}
.sg-stage.anim-gradient.bg-gradient .sg-bg {
  background: linear-gradient(
    135deg,
    var(--sg-bg),
    var(--sg-bg2),
    color-mix(in srgb, var(--sg-primary) 60%, var(--sg-bg))
  );
  background-size: 300% 300%;
  animation: sgGradientShift 40s ease infinite;
}
.sg-stage.anim-aurora .sg-bg-pattern {
  animation: sgAurora 18s ease-in-out infinite;
}
/* header positions / clock / logo */
.sg-header.pos-bottom {
  border-bottom: 0;
  border-top: 4px solid var(--sg-accent);
}
.sg-header.clock-start {
  flex-direction: row-reverse;
}
.sg-header.clock-center {
  justify-content: center;
  position: relative;
}
.sg-header.clock-center .sg-h-brand {
  position: absolute;
  inset-inline-start: 48px;
}
.sg-header.logo-sm .sg-h-logo,
.sg-header.logo-sm .sg-h-glyph {
  width: 64px;
  height: 64px;
}
.sg-header.logo-lg .sg-h-logo,
.sg-header.logo-lg .sg-h-glyph {
  width: 108px;
  height: 108px;
}
.sg-header.logo-xl .sg-h-logo,
.sg-header.logo-xl .sg-h-glyph {
  width: 120px;
  height: 120px;
}
.sg-h-time.minimal {
  font-weight: 400;
  letter-spacing: 0.04em;
}
.sg-h-badge {
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--sg-accent);
  color: #1f2937;
  font-weight: 800;
  font-size: 26px;
}
.sg-analog {
  width: 96px;
  height: 96px;
  margin-inline-end: 12px;
}
.sg-analog-face {
  fill: rgba(255, 255, 255, 0.12);
  stroke: var(--sg-accent);
  stroke-width: 2;
}
.sg-analog-tick {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2;
}
.sg-analog-hour,
.sg-analog-minute {
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
}
.sg-analog-minute {
  stroke-width: 3;
  stroke: var(--sg-accent);
}
.sg-analog-center {
  fill: var(--sg-accent);
}
/* ticker position & styles */
.sg-stage.ticker-top .sg-ticker {
  border-top: 0;
  border-bottom: 3px solid var(--sg-accent);
}
.sg-stage.ticker-style-pill .sg-ticker {
  margin: 0 40px 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 0;
  background: color-mix(in srgb, var(--sg-primary) 85%, #000);
}
.sg-stage.ticker-style-minimal .sg-ticker {
  background: transparent;
  border: 0;
}
.sg-ticker.in-grid {
  height: auto;
  min-height: 0;
  border: 1px solid var(--sg-card-line);
}
.sg-footer {
  flex: none;
  padding: 10px 48px;
  text-align: center;
  font-size: 24px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.35);
}
.sg-stage.night .sg-bg-pattern {
  opacity: 0.25;
}

/* ---------------------------------------------------------------- free grid layout */
.sg-body.tpl-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-template-rows: repeat(24, minmax(0, 1fr));
  gap: 18px;
  padding: 24px 36px;
}
.sg-body.tpl-grid .sg-zone {
  position: relative;
}
.sg-body.tpl-grid .sg-zone.pad-none .sg-w {
  padding: 0;
}
.sg-body.tpl-grid .sg-zone.pad-sm .sg-w {
  padding: 14px 18px;
}
.sg-body.tpl-grid .sg-zone.pad-lg .sg-w {
  padding: 36px 44px;
}

/* ---------------------------------------------------------------- transitions (12) */
.sg-slide.speed-slow {
  transition-duration: 1.6s;
}
.sg-slide.speed-fast {
  transition-duration: 0.45s;
}
.sg-slide.t-slide-up {
  transform: translateY(6%);
}
.sg-slide.t-slide-up.out {
  transform: translateY(-6%);
}
.sg-slide.t-slide-down {
  transform: translateY(-6%);
}
.sg-slide.t-slide-down.out {
  transform: translateY(6%);
}
.sg-slide.t-flip {
  transform: perspective(1600px) rotateY(-70deg);
  transform-origin: center;
}
.sg-slide.t-flip.out {
  transform: perspective(1600px) rotateY(60deg);
}
.sg-slide.t-cube {
  transform: perspective(1800px) rotateY(-90deg) translateZ(300px);
  transform-origin: center right;
}
.sg-slide.t-cube.out {
  transform: perspective(1800px) rotateY(90deg) translateZ(300px);
  transform-origin: center left;
}
.sg-slide.t-blur {
  filter: blur(18px);
  transition:
    opacity 0.9s ease,
    filter 0.9s ease,
    transform 0.9s ease;
}
.sg-slide.t-blur.in {
  filter: blur(0);
}
.sg-slide.t-blur.out {
  filter: blur(14px);
}
.sg-slide.t-wipe {
  clip-path: inset(0 100% 0 0);
  opacity: 1;
  transition: clip-path 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sg-slide.t-wipe.in {
  clip-path: inset(0 0 0 0);
}
.sg-slide.t-wipe.out {
  clip-path: inset(0 0 0 100%);
}
.sg-slide.t-rotate {
  transform: rotate(-4deg) scale(1.08);
}
.sg-slide.t-rotate.out {
  transform: rotate(3deg) scale(0.96);
}
.sg-slide.t-bounce {
  transform: translateY(10%) scale(0.96);
  transition:
    opacity 0.7s ease,
    transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sg-slide.t-bounce.out {
  transform: translateY(-4%) scale(0.98);
}
.sg-stage.in-zone,
.sg-zone {
  perspective: 1800px;
}

/* ---------------------------------------------------------------- new text slide styles */
.sg-text-poster {
  background: linear-gradient(180deg, var(--t-bg) 0%, var(--t-bg2) 100%);
}
.sg-text-poster::before {
  content: '';
  position: absolute;
  inset: 28px;
  border: 6px double var(--t-accent);
  border-radius: 18px;
  pointer-events: none;
}
.sg-text-split {
  background: linear-gradient(100deg, var(--t-bg) 0 58%, var(--t-bg2) 58% 100%);
}
.sg-text-split::after {
  content: '';
  position: absolute;
  inset-inline-end: 8%;
  top: 14%;
  width: 26%;
  height: 72%;
  border-radius: 30px;
  background: color-mix(in srgb, var(--t-accent) 30%, transparent);
  border: 3px solid var(--t-accent);
}
.sg-text-ribbon {
  background: var(--t-bg);
}
.sg-text-ribbon::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: 0;
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--t-accent) 0 40px, var(--t-bg2) 40px 80px);
}
.sg-text-ribbon::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: 0;
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--t-accent) 0 40px, var(--t-bg2) 40px 80px);
}
.sg-text-minimal {
  background: var(--t-bg);
}
.sg-text-minimal .sg-text-heading {
  font-weight: 300;
  letter-spacing: 0.02em;
}
.sg-text-minimal .sg-text-heading::after {
  content: '';
  display: block;
  width: 120px;
  height: 6px;
  margin: 24px auto 0;
  background: var(--t-accent);
  border-radius: 3px;
}
.sg-text-celebration {
  background: radial-gradient(circle at 30% 30%, var(--t-bg2), var(--t-bg) 70%);
}
.sg-text-celebration::before,
.sg-text-celebration::after {
  content: '✦ ✦ ✦';
  position: absolute;
  font-size: 54px;
  color: var(--t-accent);
  opacity: 0.8;
  letter-spacing: 0.6em;
}
.sg-text-celebration::before {
  top: 48px;
  inset-inline-start: 60px;
}
.sg-text-celebration::after {
  bottom: 48px;
  inset-inline-end: 60px;
}
.sg-text-notice {
  background: var(--t-bg);
}
.sg-text-notice::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 60px,
    color-mix(in srgb, var(--t-accent) 12%, transparent) 60px 90px
  );
}
.sg-text-notice .sg-text-eyebrow {
  background: var(--t-accent);
  color: #1f2937;
  padding: 6px 20px;
  border-radius: 999px;
  display: inline-block;
}
.sg-text-glass {
  background: linear-gradient(145deg, var(--t-bg), var(--t-bg2));
}
.sg-text-glass > * {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border-radius: 34px;
  padding: 54px 70px;
}
.sg-text-neon {
  background: var(--t-bg);
}
.sg-text-neon .sg-text-heading {
  color: var(--t-accent);
  text-shadow:
    0 0 12px var(--t-accent),
    0 0 48px color-mix(in srgb, var(--t-accent) 60%, transparent);
}
.sg-text-neon::before {
  content: '';
  position: absolute;
  inset: 36px;
  border: 4px solid var(--t-accent);
  border-radius: 24px;
  box-shadow:
    0 0 24px var(--t-accent),
    inset 0 0 24px color-mix(in srgb, var(--t-accent) 50%, transparent);
  opacity: 0.8;
}
.sg-text-paper {
  background: var(--t-bg);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 58px,
    color-mix(in srgb, var(--t-accent) 20%, transparent) 58px 60px
  );
}
.sg-text-paper::before {
  content: '';
  position: absolute;
  inset-inline-start: 90px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: color-mix(in srgb, var(--t-accent) 60%, transparent);
}
/* text animations */
@keyframes sgTextFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes sgTextRise {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes sgTextPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}
@keyframes sgTypewriter {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.sg-text.anim-fade-in > * {
  animation: sgTextFadeIn 1.6s ease both;
}
.sg-text.anim-rise > * > * {
  animation: sgTextRise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sg-text.anim-rise > * > *:nth-child(2) {
  animation-delay: 0.25s;
}
.sg-text.anim-rise > * > *:nth-child(3) {
  animation-delay: 0.5s;
}
.sg-text.anim-rise > * > *:nth-child(4) {
  animation-delay: 0.75s;
}
.sg-text.anim-pulse .sg-text-heading {
  animation: sgTextPulse 3s ease-in-out infinite;
}
.sg-text.anim-typewriter .sg-text-heading {
  animation: sgTypewriter 2.4s steps(40) both;
}

/* ---------------------------------------------------------------- per-slide QR */
.sg-slide-qr {
  position: absolute;
  inset-inline-end: 34px;
  bottom: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 3;
}
.sg-slide-qr-img {
  width: 150px;
  height: 150px;
  image-rendering: pixelated;
}
.sg-slide-qr span {
  font-size: 20px;
  font-weight: 700;
  max-width: 170px;
  text-align: center;
}

/* ---------------------------------------------------------------- embeds */
.sg-embed {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}
.sg-embed-frame {
  width: 100%;
  height: 100%;
  border: 0;
  transform-origin: top right;
  background: #000;
}

/* ---------------------------------------------------------------- overlays: notice / chime */
.sg-overlay-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 150px;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.sg-overlay-note.in {
  opacity: 1;
}
.sg-overlay-note-box {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 46px;
  border-radius: 30px;
  background: rgba(17, 24, 39, 0.92);
  border: 2px solid var(--sg-accent);
  color: #fff;
  font-size: 40px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  max-width: 80%;
}
.sg-overlay-note-icon {
  font-size: 56px;
}
@keyframes sgChimePulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-accent) 70%, transparent);
  }
  100% {
    box-shadow: 0 0 0 60px transparent;
  }
}
@keyframes sgChimeRing {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-18deg);
  }
  40% {
    transform: rotate(16deg);
  }
  60% {
    transform: rotate(-10deg);
  }
  80% {
    transform: rotate(8deg);
  }
}
.sg-chime .sg-overlay-note-box {
  animation: sgChimePulse 1.2s ease-out infinite;
}
.sg-chime.style-ring .sg-overlay-note-icon {
  animation: sgChimeRing 1s ease-in-out infinite;
  transform-origin: top center;
}

/* ---------------------------------------------------------------- custom emergency screen */
.sg-alert.custom {
  --sg-emergency-bg: #7f1d1d;
  --sg-emergency-fg: #ffffff;
  background: var(--sg-emergency-bg);
  color: var(--sg-emergency-fg);
}
.sg-alert.custom.no-siren {
  animation: none;
}
.sg-alert.full.custom .sg-alert-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
  width: 100%;
  padding: 0 80px;
}
.sg-alert-steps {
  margin: 30px 0 0;
  padding-inline-start: 40px;
  font-size: 40px;
  line-height: 1.5;
}
.sg-alert-steps li {
  margin-bottom: 10px;
}
.sg-alert-map {
  max-width: 640px;
  max-height: 700px;
  border-radius: 24px;
  border: 6px solid rgba(255, 255, 255, 0.85);
  object-fit: contain;
  background: #fff;
}
.sg-stage[data-orientation='portrait'] .sg-alert.full.custom .sg-alert-inner {
  grid-template-columns: 1fr;
}

/* ---------------------------------------------------------------- new widgets */
.sg-w-sub {
  margin-inline-start: auto;
  font-size: 26px;
  opacity: 0.8;
}
.sg-w-note {
  font-size: 22px;
  opacity: 0.6;
  text-align: center;
  margin-top: 8px;
}
/* weather */
.sg-w-weather {
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
}
.sg-weather-now {
  display: flex;
  align-items: center;
  gap: 30px;
}
.sg-weather-icon {
  font-size: 150px;
  line-height: 1;
}
.sg-w-weather.compact .sg-weather-icon {
  font-size: 90px;
}
.sg-weather-temp {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
}
.sg-w-weather.compact .sg-weather-temp {
  font-size: 72px;
}
.sg-weather-desc {
  font-size: 36px;
  opacity: 0.9;
}
.sg-weather-details {
  display: flex;
  gap: 36px;
  font-size: 28px;
  opacity: 0.85;
  flex-wrap: wrap;
}
.sg-weather-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.sg-weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 26px;
}
.sg-weather-day-icon {
  font-size: 54px;
}
.sg-weather-day-temp {
  font-weight: 700;
}
/* prayer */
.sg-prayer-list {
  display: grid;
  gap: 12px;
}
.sg-prayer-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 34px;
  transition: background 0.4s ease;
}
.sg-prayer-row.next {
  background: color-mix(in srgb, var(--sg-accent) 28%, transparent);
  outline: 3px solid var(--sg-accent);
}
.sg-prayer-icon {
  font-size: 40px;
}
.sg-prayer-time {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
}
.sg-w-prayer.compact .sg-prayer-row {
  font-size: 26px;
  padding: 8px 16px;
}
.sg-w-prayer.compact .sg-prayer-time {
  font-size: 30px;
}
.sg-prayer-next {
  margin-top: 18px;
  font-size: 28px;
  text-align: center;
  opacity: 0.9;
}
/* birthdays */
.sg-birthday-list {
  display: grid;
  gap: 14px;
}
.sg-birthday-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 30px;
}
.sg-birthday-card.today {
  background: linear-gradient(90deg, color-mix(in srgb, var(--sg-accent) 35%, transparent), transparent);
  border: 2px solid var(--sg-accent);
}
.sg-birthday-card span {
  display: block;
  font-size: 24px;
  opacity: 0.8;
}
.sg-birthday-emoji {
  font-size: 54px;
}
.sg-birthday-when {
  font-size: 28px;
  opacity: 0.8;
}
/* honor board */
.sg-honor-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(4, 1fr);
}
.sg-honor-grid.per-1 {
  grid-template-columns: 1fr;
}
.sg-honor-grid.per-2 {
  grid-template-columns: repeat(2, 1fr);
}
.sg-honor-grid.per-3 {
  grid-template-columns: repeat(3, 1fr);
}
.sg-honor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 2px solid color-mix(in srgb, var(--sg-accent) 55%, transparent);
}
.sg-honor-photo,
.sg-honor-avatar {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--sg-accent);
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 90px;
}
.sg-honor-name {
  font-size: 38px;
  font-weight: 800;
}
.sg-honor-title {
  font-size: 28px;
  color: var(--sg-accent);
}
.sg-honor-note {
  font-size: 24px;
  opacity: 0.85;
}
.sg-honor-cat {
  font-size: 22px;
  opacity: 0.75;
  margin-top: auto;
}
.sg-w-honor .sg-honor-grid.per-4 .sg-honor-photo,
.sg-w-honor .sg-honor-grid.per-4 .sg-honor-avatar {
  width: 150px;
  height: 150px;
}
/* greetings */
.sg-greet-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.sg-greet-cards {
  display: grid;
  gap: 16px;
}
.sg-greet-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-inline-start: 8px solid var(--sg-accent);
}
.sg-greet-card.kind-thanks {
  border-color: #86efac;
}
.sg-greet-card.kind-congrats {
  border-color: #fde68a;
}
.sg-greet-icon {
  font-size: 48px;
}
.sg-greet-text {
  font-size: 32px;
  line-height: 1.45;
}
.sg-greet-author {
  font-size: 24px;
  opacity: 0.8;
  margin-top: 6px;
  grid-column: 2;
}
.sg-greet-cta,
.sg-poll-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  max-width: 260px;
}
.sg-greet-qr,
.sg-poll-qr {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}
.sg-w.compact .sg-greet-body {
  grid-template-columns: 1fr;
}
.sg-w.compact .sg-greet-cta {
  display: none;
}
/* poll */
.sg-poll-bars {
  display: grid;
  gap: 18px;
  flex: 1;
}
.sg-poll-label {
  display: flex;
  justify-content: space-between;
  font-size: 32px;
  margin-bottom: 8px;
}
.sg-poll-track {
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.sg-poll-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sg-accent), color-mix(in srgb, var(--sg-accent) 55%, #fff));
  transition: width 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sg-poll-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
}
.sg-poll-foot {
  font-size: 26px;
  opacity: 0.85;
  display: flex;
  gap: 20px;
}
.sg-poll-closed {
  color: var(--sg-accent);
  font-weight: 800;
}
.sg-w.compact .sg-poll-cta {
  display: none;
}
/* announcements */
.sg-ann-list {
  display: grid;
  gap: 12px;
}
.sg-ann-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 30px;
}
.sg-ann-class {
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--sg-accent);
  color: #1f2937;
  font-size: 22px;
  font-weight: 800;
}
.sg-ann-date {
  font-size: 22px;
  opacity: 0.7;
}
/* stats */
.sg-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  height: 100%;
  align-content: center;
}
.sg-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--sg-card-line);
  text-align: center;
}
.sg-stat-icon {
  font-size: 54px;
}
.sg-stat-card b {
  font-size: 72px;
  line-height: 1;
  color: var(--sg-accent);
}
.sg-stat-card span {
  font-size: 24px;
  opacity: 0.85;
}
.sg-w-stats.compact .sg-stat-card b {
  font-size: 48px;
}
/* month calendar */
.sg-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.sg-month-head {
  text-align: center;
  font-size: 22px;
  opacity: 0.7;
  padding-bottom: 4px;
}
.sg-month-cell {
  min-height: 74px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  font-size: 26px;
  position: relative;
}
.sg-month-cell.empty {
  background: transparent;
}
.sg-month-cell.today {
  outline: 3px solid var(--sg-accent);
  background: color-mix(in srgb, var(--sg-accent) 25%, transparent);
}
.sg-month-cell.off {
  background: rgba(239, 68, 68, 0.22);
}
.sg-month-dots {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.sg-month-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sg-accent);
  display: block;
}
.sg-month-list {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
.sg-month-event {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 26px;
}
.sg-month-event.off {
  color: #fca5a5;
}
.sg-month-event-day {
  min-width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}
.sg-w-month.compact .sg-month-cell {
  min-height: 48px;
  font-size: 20px;
}
.sg-w-month.compact .sg-month-list {
  display: none;
}
/* light theme tweaks */
.sg-stage.light .sg-prayer-row,
.sg-stage.light .sg-birthday-card,
.sg-stage.light .sg-greet-card,
.sg-stage.light .sg-ann-row,
.sg-stage.light .sg-stat-card,
.sg-stage.light .sg-month-cell,
.sg-stage.light .sg-weather-day {
  background: rgba(0, 0, 0, 0.05);
}
.sg-stage.light .sg-footer,
.sg-stage.light .sg-overlay-note-box {
  color: #fff;
}

/* ================================================================ management page: signage-studio.html */
.sg-studio .m-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  grid-column: 1 / -1;
}
.sg-studio .m-row > .m-field {
  flex: 1 1 180px;
  min-width: 0;
}
.sg-studio .m-row.sg-studio-inline {
  align-items: center;
}
.sg-studio .m-two,
.sg-studio-grid3 {
  grid-column: 1 / -1;
}
.sg-studio-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sg-studio-grid3 > .m-panel {
  margin-bottom: 0;
}
@media (max-width: 1100px) {
  .sg-studio-grid3 {
    grid-template-columns: 1fr;
  }
}
.sg-studio-note {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}
.sg-studio-quote {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-inline-start: 4px solid var(--brand, #173f5f);
  background: var(--surface-2, #f4f6f9);
  border-radius: 8px;
}
.sg-studio-qrbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line, #e3e8ef);
  width: max-content;
  max-width: 100%;
}
.sg-studio-qr {
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}
.sg-studio-qrlink {
  font-size: 12px;
  direction: ltr;
  word-break: break-all;
  max-width: 260px;
  text-align: center;
}
.sg-studio-linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}
.sg-studio-emergency-preview {
  min-height: 320px;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.sg-studio-emergency-preview.siren {
  animation: sg-studio-siren 1.2s ease-in-out infinite;
}
@keyframes sg-studio-siren {
  0%,
  100% {
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.08);
  }
  50% {
    box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.45);
  }
}
.sg-studio-emergency-icon {
  font-size: 56px;
}
.sg-studio-emergency-title {
  font-size: 26px;
  font-weight: 800;
}
.sg-studio-emergency-steps {
  text-align: start;
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
  padding-inline-start: 24px;
}
.sg-studio-emergency-map {
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 18px 28px;
  opacity: 0.85;
}
.sg-studio-greet-text {
  max-width: 480px;
  line-height: 1.6;
}
.sg-studio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.sg-studio-card {
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sg-studio-card.live {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.sg-studio-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.sg-studio-card h3 {
  margin: 0;
  font-size: 16px;
}
.sg-studio-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sg-studio-bars {
  display: grid;
  gap: 8px;
}
.sg-studio-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.sg-studio-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2, #eef2f7);
  overflow: hidden;
}
.sg-studio-bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.sg-studio-bar-track i.warn {
  background: #f59e0b;
}
.sg-studio-bar-track i.bad {
  background: #dc2626;
}
.sg-studio-uptime {
  min-width: 120px;
}
.sg-studio-option {
  align-items: center;
}
.sg-studio-option input[name^='icon_'] {
  flex: 0 0 64px;
}
.sg-studio-option input[name^='label_'] {
  flex: 1 1 200px;
}
.sg-studio-alert-row td {
  background: rgba(220, 38, 38, 0.05);
}
.sg-studio-error {
  display: block;
  color: #b91c1c;
}
.sg-studio-url {
  display: block;
  direction: ltr;
  text-align: end;
  word-break: break-all;
}
.sg-studio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sg-studio-snaps {
  display: grid;
  gap: 14px;
}
.sg-studio-snaps figure {
  margin: 0;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px;
  overflow: hidden;
}
.sg-studio-snap img,
.sg-studio-snaps img {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
}
.sg-studio-snap {
  min-height: 120px;
  background: #111;
}
.sg-studio-snap-empty {
  padding: 24px;
  text-align: center;
  color: var(--slate, #64748b);
}
.sg-studio-snaps figcaption {
  padding: 8px 10px;
  font-size: 13px;
}
html[data-theme='dark'] .sg-studio-qrbox {
  background: #fff;
}

/* ================================================================ layout designer: free grid editor */
.sg-grid-board {
  position: relative;
  width: 100%;
  border-radius: 12px;
  background:
    linear-gradient(to right, rgba(23, 63, 95, 0.12) 1px, transparent 1px) 0 0 / calc(100% / 24) 100%,
    linear-gradient(to bottom, rgba(23, 63, 95, 0.12) 1px, transparent 1px) 0 0 / 100% calc(100% / 24),
    var(--surface-2, #f4f6f9);
  border: 1px solid var(--line, #d9dee6);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.sg-grid-zone {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(23, 63, 95, 0.55);
  background: rgba(23, 63, 95, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  outline: none;
}
.sg-grid-zone:active {
  cursor: grabbing;
}
.sg-grid-zone.selected,
.sg-grid-zone:focus-visible {
  border-color: var(--brand, #173f5f);
  background: rgba(23, 63, 95, 0.22);
  box-shadow: 0 0 0 3px rgba(23, 63, 95, 0.2);
}
.sg-grid-zone.is-ticker {
  border-style: dashed;
  background: rgba(184, 134, 47, 0.18);
  border-color: rgba(184, 134, 47, 0.8);
}
.sg-grid-zone b {
  font-size: 12px;
}
.sg-grid-zone small {
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-grid-handle {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--brand, #173f5f) 50%);
  border-start-start-radius: 6px;
  opacity: 0.8;
}
[dir='rtl'] .sg-grid-handle {
  cursor: nesw-resize;
  background: linear-gradient(225deg, transparent 50%, var(--brand, #173f5f) 50%);
}

.sg-studio-screen {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sg-studio-screen-text small {
  display: block;
}
