:root {
  --ink: #f4f7f2;
  --mute: rgba(244,247,242,.72);
  --accent: #e8c47a;
  --sky1: #1a3a4a;
  --sky2: #0a141c;
  --rail-w: clamp(200px, 20vw, 280px);
  --rail-h: clamp(120px, 18vh, 180px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-h: 100dvh;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: Sora, system-ui, sans-serif;
  background: #0a1218;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.boot, .locked {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: linear-gradient(160deg, #122430, #0a141c);
}
.lang-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  margin: 0 auto;
}
.home-link {
  color: rgba(248, 244, 236, 0.65);
  font: 600 .78rem/1 Sora, system-ui, sans-serif;
  text-decoration: none;
  letter-spacing: .02em;
  padding: 8px 2px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}
.home-link:hover,
.home-link:focus-visible {
  color: var(--accent, #e8c47a);
  outline: none;
}
.lang-toggle {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font: 700 .7rem/1 Sora, system-ui, sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
}
.lang-toggle.is-es { color: var(--accent); border-color: rgba(232,196,122,.45); }
.rail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rail-lang { flex-shrink: 0; }
.menu-top .lang-toggle { margin-left: 10px; }
.app-badge {
  display: inline-block;
  width: fit-content;
  margin: 0 auto 2px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(232,196,122,.18);
  border: 1px solid rgba(232,196,122,.4);
  color: var(--accent, #e8c47a);
  font: 700 .72rem/1 Sora, system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.boot-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin: 0 auto 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.kicker, .rail-kicker {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
h1, h2 { font-family: Fraunces, Georgia, serif; }
.boot h1, .locked h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.boot label {
  display: grid;
  gap: 8px;
  color: var(--mute);
}
.boot input {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  padding: 0 14px;
  font: 700 1.2rem/1 Sora, system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.btn {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(160deg, #e8c47a, #c4a050);
  color: #1a140c;
  font: 700 1rem/1 Sora, system-ui, sans-serif;
  cursor: pointer;
}
.status { color: var(--accent); min-height: 1.2em; }
.help { color: var(--mute); font-size: .85rem; line-height: 1.4; }
[hidden] { display: none !important; }

/* Signage stage: split media panes; rail floats as slim chrome over community only */
.stage {
  position: relative;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-h, 100dvh);
  min-height: var(--app-h, 100dvh);
  overflow: hidden;
  background: var(--sky1);
}

/* Soft offline / poor-network strip — never covers media center */
.net-banner {
  position: absolute;
  z-index: 8;
  top: calc(10px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(12, 18, 24, .78);
  border: 1px solid rgba(232, 196, 122, .35);
  color: var(--accent);
  font: 600 .78rem/1.3 Sora, system-ui, sans-serif;
  letter-spacing: .02em;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
body.is-offline .net-banner { animation: netPulse 2.4s ease-in-out infinite; }
@keyframes netPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}
.stage-main {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: var(--app-h, 100dvh);
  background: var(--sky2);
  touch-action: pan-y;
}

/*
 * —— Signage fill principle (ALL displayModes · Principal + screens 1–50) ——
 * Equal stable panes · gap 0 · absolute fill · stage min-height: var(--app-h).
 * Ads: object-fit: contain + center — full creative always visible (never cover-crop).
 * Aspect mismatch → subtle solid letterbox #0c1014 (honest empty space, no blur wash).
 * Export creatives at the cell aspect ratio to avoid bars — see README / Admin help.
 */
/* Landscape: community LEFT · ads RIGHT. Portrait: ads TOP · community BOTTOM. */
.split-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "community ads";
  gap: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: var(--app-h, 100dvh);
  align-content: stretch;
  justify-content: stretch;
  box-sizing: border-box;
}
.community-pane,
.ads,
.ads-multi,
.static-menu {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
  box-sizing: border-box;
}
.community-pane {
  grid-area: community;
  background: rgba(8, 14, 20, .55);
  border-right: 1px solid rgba(255, 255, 255, .1);
}
.ads {
  grid-area: ads;
  /* Opaque letterbox — subtle dark, not harsh #000 */
  background: #0c1014;
  border: 0;
}

/* —— Per-screen displayMode hosts (Basic+) —— */
.ads-multi,
.static-menu {
  display: none;
  background: #0c1014;
}
/*
 * Multi-pane host (adsSplit2 / adsQuad).
 * CRITICAL: must NOT rely on % height inside a collapsing grid track —
 * that left a full-stage #111 black void after the v40 cover pass.
 * When active, absolute inset:0 fills the stage with real cell sizes.
 */
.ads-multi {
  grid-area: multi;
  display: none;
  margin: 0;
  padding: 0;
  gap: 0;
  background: #0c1014;
  align-content: stretch;
  justify-content: stretch;
}
.ads-multi.is-quad {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.ads-multi .ad-pane {
  position: relative !important;
  overflow: hidden !important;
  min-width: 0 !important;
  /* Real floor so cells never paint as 0×0 black voids */
  min-height: clamp(120px, 25dvh, 50vh) !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #0c1014;
  align-self: stretch;
  justify-self: stretch;
}
.ads-multi.is-quad .ad-pane {
  min-height: clamp(120px, 50%, 50dvh) !important;
}
/* Shared absolute fill for every Signage ad surface (single + multi) */
.ads > .ad-fx,
.ads-multi .ad-pane .ad-fx {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0c1014;
  z-index: 1;
}
/* Full creative — contain + center (never fill, never cover-crop, no blur wash) */
.ads > .ad-fx .ad-media,
.ads-multi .ad-pane .ad-fx .ad-media,
.ads-multi .ad-pane .ad-media {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: var(--gb-object-fit, contain) !important;
  object-position: center !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent;
  z-index: 1;
}
/* staticMenu poster still fills the drift plane */
.static-menu .ad-media {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent;
  z-index: 1;
}
/* Cinematic letterbox bars look like black gaps in split/quad — kill them */
.ads-multi .ad-fx.fx-cinematic::before,
.ads-multi .ad-fx.fx-cinematic::after {
  content: none !important;
  display: none !important;
  height: 0 !important;
}
.ads-multi .ads-empty-pane {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  color: rgba(244, 241, 234, 0.82);
  background: #0c1014;
}
.ads-multi .ads-empty-pane .ads-empty-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 600;
}
.ads-multi .ads-empty-pane .ads-empty-sub {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.72;
  max-width: 14rem;
}
.static-menu {
  grid-area: menu;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(165deg, #1a242c, #0c1218 60%, #080c10);
}
.static-menu-drift {
  position: absolute;
  inset: -4% -6%;
  width: auto;
  height: auto;
  will-change: transform;
  animation: menuDrift 56s ease-in-out infinite alternate;
  transform: translateZ(0);
}
.static-menu-drift.is-drifting {
  animation-name: menuDrift;
}
.static-menu-drift > .static-menu-poster.ad-media {
  z-index: 1;
}
.static-menu-board {
  position: absolute;
  inset: 6% 8%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(10px, 1.6vw, 22px);
  align-content: center;
  color: #f4f1ea;
  font-family: "Sora", sans-serif;
}
.static-menu-board .smb-title {
  grid-column: 1 / -1;
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.4rem;
  text-align: center;
}
.static-menu-board .smb-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 16, 0.35);
}
.static-menu-board .smb-item strong {
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
}
.static-menu-board .smb-item span {
  font-size: 0.82rem;
  opacity: 0.78;
}
.static-menu-board .smb-item em {
  font-style: normal;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent, #c4a35a) 80%, #fff);
}
.wx-chip-float {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
}
@keyframes menuDrift {
  0% { transform: translate3d(-2.4%, -0.5%, 0) scale(1.06); }
  33% { transform: translate3d(2.2%, 0.6%, 0) scale(1.07); }
  66% { transform: translate3d(1.4%, -0.7%, 0) scale(1.065); }
  100% { transform: translate3d(-1.8%, 0.4%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .static-menu-drift { animation-duration: 140s; }
}

/* Discreet screen name + code — bottom-right, never covers creatives center */
.screen-id-chip {
  position: absolute;
  z-index: 12;
  right: 10px;
  bottom: 10px;
  margin: 0;
  max-width: min(46vw, 16rem);
  padding: 3px 8px;
  font-family: "Sora", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(4, 8, 12, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boot-screen-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--accent, #c4a35a) 70%, #fff);
}

/* —— Mode shells: which surface owns the stage (shared absolute-fill host) —— */
.split-stage[data-layout="adsOnly"],
.split-stage[data-layout="adsSplit2"],
.split-stage[data-layout="adsQuad"],
.split-stage[data-layout="staticMenu"] {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
  min-height: var(--app-h, 100dvh) !important;
  gap: 0 !important;
}

/* adsOnly: full ads, no community */
.split-stage[data-layout="adsOnly"] {
  grid-template-areas: "ads";
}
.split-stage[data-layout="adsOnly"] .community-pane,
.split-stage[data-layout="adsOnly"] .ads-multi,
.split-stage[data-layout="adsOnly"] .static-menu {
  display: none !important;
}
.split-stage[data-layout="adsOnly"] .ads {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: var(--app-h, 100dvh);
  z-index: 2;
}
body[data-display-mode="adsOnly"] .sky-atmosphere {
  width: 100%;
  opacity: 0.22;
}

/* adsSplit2 / adsQuad: shared multi host — absolute fill, equal minmax cells */
.split-stage[data-layout="adsSplit2"],
.split-stage[data-layout="adsQuad"] {
  grid-template-areas: "multi" !important;
}
.split-stage[data-layout="adsSplit2"] .community-pane,
.split-stage[data-layout="adsSplit2"] .ads,
.split-stage[data-layout="adsSplit2"] .static-menu,
.split-stage[data-layout="adsQuad"] .community-pane,
.split-stage[data-layout="adsQuad"] .ads,
.split-stage[data-layout="adsQuad"] .static-menu {
  display: none !important;
}
.split-stage[data-layout="adsSplit2"] .ads-multi,
.split-stage[data-layout="adsQuad"] .ads-multi,
.split-stage[data-layout="adsQuad"] .ads-multi.is-quad {
  display: grid !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: var(--app-h, 100dvh) !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #0c1014 !important;
  align-content: stretch !important;
  justify-content: stretch !important;
  grid-auto-rows: minmax(0, 1fr) !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  z-index: 2;
}
.split-stage[data-layout="adsSplit2"] .ads-multi {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
.split-stage[data-layout="adsQuad"] .ads-multi,
.split-stage[data-layout="adsQuad"] .ads-multi.is-quad {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
}
body[data-display-mode="adsSplit2"] .sky-atmosphere,
body[data-display-mode="adsQuad"] .sky-atmosphere {
  display: none !important;
}

/* staticMenu: full-stage board + drift — same absolute fill as adsOnly */
.split-stage[data-layout="staticMenu"] {
  grid-template-areas: "menu";
}
.split-stage[data-layout="staticMenu"] .community-pane,
.split-stage[data-layout="staticMenu"] .ads,
.split-stage[data-layout="staticMenu"] .ads-multi {
  display: none !important;
}
.split-stage[data-layout="staticMenu"] .static-menu {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: var(--app-h, 100dvh);
  z-index: 2;
}
body[data-display-mode="staticMenu"] .sky-atmosphere {
  width: 100%;
  opacity: 0.35;
}

/* Pane labels: WG community feed ≠ this business's Admin ads (isolation UX) */
.community-badge,
.ads-badge {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  pointer-events: none;
  max-width: min(90%, 14rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ads-badge {
  display: none !important; /* never overlay ads creatives */
}

/* Atmosphere by weather mood — clipped to community half only (never under/over ads) */
.sky-atmosphere {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transition: background 1.4s ease, opacity 1.4s ease;
  /* Landscape default: left half only */
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  right: auto;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    linear-gradient(165deg, var(--sky1), var(--sky2));
}
body[data-mood="sunny"] .sky-atmosphere {
  background:
    radial-gradient(ellipse 70% 50% at 70% 10%, rgba(255, 210, 120, .45), transparent 50%),
    linear-gradient(165deg, #3a6a8a, #1a3040 60%, #0e1a22);
}
body[data-mood="cloudy"] .sky-atmosphere {
  background:
    radial-gradient(ellipse 80% 55% at 40% 0%, rgba(160, 180, 200, .28), transparent 55%),
    linear-gradient(165deg, #2a3c4a, #121c24);
}
body[data-mood="fog"] .sky-atmosphere {
  background: linear-gradient(180deg, #5a6870, #2a3238 55%, #14181c);
}
body[data-mood="rain"] .sky-atmosphere {
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(80, 120, 160, .35), transparent),
    linear-gradient(165deg, #1a2838, #0a1018);
}
body[data-mood="thunder"] .sky-atmosphere {
  background:
    radial-gradient(ellipse 50% 40% at 60% 15%, rgba(120, 100, 200, .25), transparent),
    linear-gradient(165deg, #12182a, #06080e);
}
body[data-mood="snow"] .sky-atmosphere {
  background: linear-gradient(165deg, #6a7a8a, #2a343c 50%, #121820);
}
body[data-mood="hot"] .sky-atmosphere,
body[data-mood="heat"] .sky-atmosphere {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 140, 60, .4), transparent 50%),
    linear-gradient(165deg, #8a4a28, #2a1810);
}

.community-pane img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.02);
  opacity: 0;
  transition: opacity .9s ease;
}
.community-pane.has-photo img {
  opacity: 1;
}
.community-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: #f4f7f2;
  font-size: .95rem;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    linear-gradient(165deg, rgba(20, 36, 48, .55), rgba(8, 14, 20, .75));
  transition: opacity .6s ease;
}
.community-empty-mark {
  font-size: 1.6rem;
  color: var(--accent);
  opacity: .85;
  letter-spacing: 0;
}
.community-empty p {
  max-width: 16rem;
  margin: 0;
  line-height: 1.35;
  font: 600 .92rem/1.4 Sora, system-ui, sans-serif;
}
.community-pane.has-photo .community-empty {
  opacity: 0;
  pointer-events: none;
}
.community-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 14px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .58));
  color: #fff;
  opacity: 0;
  transition: opacity .6s ease, padding .35s ease, bottom .35s ease;
}
.community-pane.has-photo .community-meta {
  opacity: 1;
}
.community-meta p {
  margin: 0 0 4px;
  font: 600 .88rem/1.35 Sora, system-ui, sans-serif;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.community-meta span {
  font-size: .68rem;
  opacity: .85;
}

/* Isolation/paint for FX overlays — geometry + fit live in Signage fill principle above */
.ads > .ad-fx,
.ad-fx {
  /* Keep tornado/holo/curtain overlays inside the ads pane only — never wash rail text */
  isolation: isolate;
  contain: paint;
  transform: translateZ(0);
}
.ads > .ad-fx .ad-media {
  transform-origin: center center;
  will-change: transform, opacity, filter;
}
.ads > .ad-fx video.ad-media {
  background: transparent;
}
.ads > .ad-fx video.ad-media:not([src]),
.ads > .ad-fx video.ad-media[src=""] {
  display: none;
}
.ad-fx.is-video img.ad-media { visibility: hidden; }
.ad-fx:not(.is-video) video.ad-media { display: none; }
.ads-multi .ad-fx.is-video img.ad-media { visibility: hidden; opacity: 0; }
.ads-multi .ad-fx:not(.is-video) video.ad-media { display: none; }
.ad-split-mask {
  display: none;
  pointer-events: none;
}
.ad-title-chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  max-width: min(calc(100% - 28px), 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 12, 16, .55);
  border: 1px solid rgba(255,255,255,.12);
  font: 700 .95rem/1.25 Sora, system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease, left .35s ease, bottom .35s ease, max-width .35s ease;
}
.ad-title-chip.is-on {
  opacity: 1;
  transform: translateY(0);
}
.ads-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 12px;
  padding: 28px 24px;
  text-align: center;
  color: #f4f7f2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(165deg, #1a3040, #0a141c);
}
.ads-empty-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
  opacity: .95;
}
.ads-empty-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
}
.ads-empty-sub {
  margin: 0;
  max-width: 22rem;
  font: 600 .88rem/1.4 Sora, system-ui, sans-serif;
  color: var(--mute);
  text-shadow: none;
}

/* Motion presets live in /shared/effects.css */

.pause-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .85rem;
  font-weight: 600;
  pointer-events: none;
  transition: bottom .35s ease, left .35s ease, transform .35s ease;
}

/* Tiny weather text in community corner — no glass / no sky blue bar */
.wx-chip {
  position: absolute;
  z-index: 3;
  top: 40px;
  left: 10px;
  max-width: min(92%, 14rem);
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  pointer-events: none;
  color: #f4f7f2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .75);
  background: none;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.wx-chip strong {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.wx-chip span {
  font: 600 .68rem/1.2 Sora, system-ui, sans-serif;
  color: rgba(244, 247, 242, .82);
  letter-spacing: .02em;
}
.wx-chip-clock {
  opacity: .7;
}

/* Blue translucent weather rail — HARD OFF (was covering ads on live TVs) */
.rail,
#rail {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  inset: auto !important;
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.rail-app {
  margin: 6px 0 0;
  font: 700 .68rem/1 Sora, system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(244, 247, 242, .55);
}
.rail h2 {
  font-size: clamp(1.35rem, 2.2vw, 2.15rem);
  margin: 6px 0 8px;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
}
.tagline {
  color: var(--mute);
  margin-bottom: 18px;
  font-size: .88rem;
  line-height: 1.35;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.weather {
  display: grid;
  gap: 4px;
  margin-top: auto;
}
.weather strong {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  line-height: .95;
  color: var(--accent);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.weather span { color: var(--mute); }
.clock {
  margin-top: 18px;
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  letter-spacing: .04em;
  color: var(--ink);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.touch-hint {
  margin-top: 14px;
  font-size: .68rem;
  letter-spacing: .04em;
  color: rgba(244, 247, 242, .45);
}

/* Portrait / vertical: ads TOP · community BOTTOM — only communityAds split */
@media (orientation: portrait), (max-width: 900px) {
  .split-stage[data-layout="communityAds"],
  .split-stage:not([data-layout]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "ads"
      "community";
  }
  body[data-display-mode="communityAds"] .sky-atmosphere,
  body:not([data-display-mode]) .sky-atmosphere {
    top: 50%;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
  }
  .split-stage[data-layout="communityAds"] .community-pane,
  .split-stage:not([data-layout]) .community-pane {
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
  }
  .net-banner {
    top: calc(8px + var(--safe-top));
    max-width: min(94vw, 360px);
    font-size: .72rem;
  }
  .ad-title-chip {
    bottom: 12px;
    max-width: min(78%, 360px);
  }
  .community-meta {
    bottom: 0;
    padding-bottom: 14px;
  }
  .pause-hint {
    bottom: calc(18px + var(--safe-bottom));
    left: 50%;
  }
  .wx-chip {
    top: 36px;
  }
}

body.v-restaurant { --accent: #e07a4a; --sky1: #3a1e14; --sky2: #140c08; }
body.v-dentist { --accent: #5aa8c4; --sky1: #14303a; --sky2: #0a161c; }
body.v-candy { --accent: #d4a0c0; --sky1: #2a1824; --sky2: #140c12; }
body.v-retail { --accent: #7ab89a; --sky1: #142820; --sky2: #0a1410; }
body.v-general { --accent: #e8c47a; --sky1: #1a3a4a; --sky2: #0a141c; }

body.is-paused .ads,
body.is-paused .community-pane {
  filter: brightness(.88);
}

@media (prefers-reduced-motion: reduce) {
  .community-pane img,
  .community-empty,
  .community-meta,
  .ad-title-chip,
  .net-banner {
    transition: none !important;
    animation: none !important;
  }
  body.is-offline .net-banner { animation: none !important; opacity: 1; }
}

/* —— Interactive menu / kiosk POS (dynamic from Admin catalog) —— */
.menu-stage {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    linear-gradient(165deg, var(--sky1) 0%, #0a1218 42%, #070e14 100%);
  padding:
    var(--safe-top)
    var(--safe-right)
    var(--safe-bottom)
    var(--safe-left);
}
.menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sky1) 85%, #000), rgba(10,18,24,.92));
}
.menu-top h1 { font-size: clamp(1.35rem, 2.8vw, 2rem); letter-spacing: -.02em; }
.menu-weather strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.7rem;
  color: var(--accent);
  display: block;
}
.menu-weather span { color: var(--mute); font-size: .78rem; }

.menu-body {
  display: grid;
  grid-template-columns: min(210px, 20vw) minmax(0, 1fr) min(380px, 34vw);
  min-height: 0;
  overflow: hidden;
}

/* Category rail — built from unique item.category values */
.menu-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  overflow: auto;
  border-right: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.22);
  -webkit-overflow-scrolling: touch;
}
.menu-cat {
  appearance: none;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  border-radius: 14px;
  min-height: 52px;
  padding: 12px 14px;
  font: 700 .95rem/1.2 Sora, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.menu-cat:active { transform: scale(.98); }
.menu-cat.is-on {
  background: color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,.06));
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.menu-cat-count {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--mute);
}
.menu-cat.is-on .menu-cat-count { color: rgba(255,255,255,.72); }

.menu-main {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.menu-grid {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.menu-empty {
  grid-column: 1 / -1;
  margin: 8vh auto 0;
  max-width: 28rem;
  text-align: center;
  padding: 28px 20px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--mute);
  font: 600 1.05rem/1.45 Sora, system-ui, sans-serif;
}
.menu-item {
  text-align: left;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: var(--ink);
  cursor: pointer;
  font: 600 .9rem/1.3 Sora, system-ui, sans-serif;
  min-height: 148px;
  display: grid;
  grid-template-rows: 96px 1fr;
  overflow: hidden;
  touch-action: manipulation;
  transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.menu-item:active {
  transform: scale(.985);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.menu-item-media {
  position: relative;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 22%, #1a2a34), #12202a);
  overflow: hidden;
}
.menu-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.menu-item-initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Fraunces, Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 85%, #fff);
  letter-spacing: -.03em;
  user-select: none;
}
.menu-item-body {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
  align-content: start;
}
.menu-item strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.menu-item-desc {
  color: var(--mute);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.1em;
}
.menu-item .price {
  margin-top: 4px;
  color: var(--accent);
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.cart {
  border-left: 1px solid rgba(255,255,255,.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,.32);
  overflow: auto;
  min-height: 0;
}
.cart h2 { font-size: 1.35rem; }
.table-label { display: grid; gap: 6px; color: var(--mute); font-size: .82rem; }
.table-label input {
  min-height: 48px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: var(--ink); padding: 0 12px;
  font: 600 1rem/1 Sora, system-ui, sans-serif;
}
.cart-lines { flex: 1; display: grid; gap: 8px; align-content: start; min-height: 0; }
.cart-line {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .95rem;
}
.cart-line-name { flex: 1; min-width: 0; line-height: 1.25; }
.cart-line-qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cart-line button {
  border: 0; background: rgba(255,255,255,.1); color: var(--ink);
  width: 44px; height: 44px; border-radius: 12px; font-size: 1.25rem; cursor: pointer;
  touch-action: manipulation;
}
.cart-line .qty-num {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 700;
}
.cart-total {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.1rem;
  color: var(--accent);
  line-height: 1;
}
.cart .btn {
  min-height: 54px;
  font-size: 1.05rem;
}
.pay-note { font-size: .78rem; color: var(--mute); }
.pay-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(0,0,0,.55);
  padding: 20px;
}
.pay-panel {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: #122430;
  border: 1px solid rgba(255,255,255,.14);
  display: grid; gap: 10px;
}
.pay-panel .btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--ink);
}

@media (orientation: landscape) {
  .menu-body {
    grid-template-columns: min(210px, 20vw) minmax(0, 1fr) min(380px, 34vw);
  }
}

@media (max-width: 900px), (orientation: portrait) {
  .menu-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .menu-top {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .menu-top h1 { font-size: clamp(1.2rem, 5vw, 1.7rem); }
  .menu-cats {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .menu-cat {
    flex: 0 0 auto;
    min-height: 48px;
    min-width: 7.5rem;
    white-space: nowrap;
  }
  .menu-cat-count { display: inline; margin-top: 0; margin-left: 6px; }
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding: 12px;
    gap: 10px;
  }
  .menu-item {
    min-height: 132px;
    grid-template-rows: 84px 1fr;
  }
  .menu-item strong { font-size: 1.05rem; }
  .menu-item .price { font-size: 1.15rem; }
  .cart {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    max-height: min(40vh, 340px);
  }
  .cart-total { font-size: 1.65rem; }
  .pay-sheet { padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); }
}


