:root {
  --sbs-brand: #5BA8DC;
  --sbs-brand-rgb: 91, 168, 220;
  --sbs-accent: #7BC8F0;
  --sbs-accent-rgb: 123, 200, 240;
  --sbs-brand-deep: #3A86C0;
  --sbs-brand-soft: #F5FBFF;
  --bs-primary: var(--sbs-brand);
  --bs-primary-rgb: var(--sbs-brand-rgb);
  --bs-link-color: var(--sbs-brand);
  --bs-link-hover-color: var(--sbs-brand-deep);
}

.btn {
  border-radius: 0.85rem;
  font-weight: 650;
}

.btn-sm {
  border-radius: 0.72rem;
}

.btn-primary {
  --bs-btn-bg: var(--sbs-brand);
  --bs-btn-border-color: var(--sbs-brand);
  --bs-btn-hover-bg: var(--sbs-brand-deep);
  --bs-btn-hover-border-color: var(--sbs-brand-deep);
  --bs-btn-active-bg: var(--sbs-brand-deep);
  --bs-btn-active-border-color: var(--sbs-brand-deep);
  --bs-btn-focus-shadow-rgb: var(--sbs-brand-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--sbs-brand);
  --bs-btn-border-color: var(--sbs-brand);
  --bs-btn-hover-bg: var(--sbs-brand);
  --bs-btn-hover-border-color: var(--sbs-brand);
  --bs-btn-active-bg: var(--sbs-brand-deep);
  --bs-btn-active-border-color: var(--sbs-brand-deep);
  --bs-btn-focus-shadow-rgb: var(--sbs-brand-rgb);
}

.btn-success {
  --bs-btn-bg: var(--sbs-accent);
  --bs-btn-border-color: var(--sbs-accent);
  --bs-btn-hover-bg: var(--sbs-brand);
  --bs-btn-hover-border-color: var(--sbs-brand);
  --bs-btn-active-bg: var(--sbs-brand-deep);
  --bs-btn-active-border-color: var(--sbs-brand-deep);
  --bs-btn-focus-shadow-rgb: var(--sbs-accent-rgb);
}

.text-primary,
.link-primary {
  color: var(--sbs-brand) !important;
}

a {
  color: var(--sbs-brand);
}

a:hover {
  color: var(--sbs-brand-deep);
}

.bg-primary {
  background-color: var(--sbs-brand) !important;
}

.border-primary {
  border-color: var(--sbs-brand) !important;
}

.text-bg-primary {
  color: #fff !important;
  background-color: rgba(var(--sbs-brand-rgb), 1) !important;
}

.list-group-item.active {
  background-color: var(--sbs-brand);
  border-color: var(--sbs-brand);
}

.form-check-input:checked {
  background-color: var(--sbs-brand);
  border-color: var(--sbs-brand);
}

.form-check-input:focus,
.btn:focus,
.btn:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--sbs-brand-rgb), 0.18) !important;
}

.page-link {
  color: var(--sbs-brand);
}

.page-link:hover,
.page-link:focus {
  color: var(--sbs-brand-deep);
}

.page-item.active .page-link {
  background-color: var(--sbs-brand);
  border-color: var(--sbs-brand);
}

.nav-pills {
  gap: 8px;
}

.nav-pills .nav-link {
  color: var(--sbs-brand);
  background: rgba(var(--sbs-brand-rgb), 0.05);
  border: 1px solid rgba(var(--sbs-brand-rgb), 0.08);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(10, 42, 64, 0.08);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease, box-shadow 140ms ease;
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus {
  color: var(--sbs-brand-deep);
  background: rgba(var(--sbs-brand-rgb), 0.07);
  border-color: rgba(var(--sbs-brand-rgb), 0.14);
  transform: translateY(-1px);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: #fff;
  background: var(--sbs-brand);
  border-color: var(--sbs-brand);
  box-shadow: 0 14px 30px rgba(91, 168, 220, 0.22);
}

.alert-primary {
  color: var(--sbs-brand-deep);
  background-color: rgba(var(--sbs-brand-rgb), 0.07);
  border-color: rgba(var(--sbs-brand-rgb), 0.24);
}

.app-brand {
  display: inline-flex;
  align-items: center;
}

.app-brand img,
.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.app-brand img {
  height: 34px;
  max-width: min(44vw, 180px);
}

.brand-logo-auth {
  height: 34px;
  max-width: min(46vw, 200px);
}

.brand-logo-pin {
  height: 26px;
  max-width: min(42vw, 156px);
}

.app-navbar {
  background: var(--sbs-brand);
}

html {
  overscroll-behavior-y: none;
}

html.app-busy:not(.app-preload-pending),
html.app-busy:not(.app-preload-pending) body {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none;
}

/* Splash must not lock scroll — user can move the page under the animation */
html.app-preload-pending,
html.app-preload-pending body {
  overflow: auto !important;
  height: auto !important;
  touch-action: manipulation;
}

.app-hide-nav nav.navbar {
  display: none !important;
}
.app-hide-nav main.container {
  padding-top: 12px !important;
}
.app-hide-nav.app-lock-scroll main.container {
  height: 100dvh;
}

.app-lock-scroll {
  overflow: hidden;
  height: 100dvh;
}
.app-lock-scroll main.container {
  height: calc(100dvh - 56px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-center-main main.container {
  display: grid;
  place-items: center;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

.qr-scan-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}
.qr-reader {
  width: 100%;
  height: 100%;
}
.qr-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.qr-square {
  width: 72%;
  height: 72%;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}
/* PWA/планшет: после выхода из фона getUserMedia часто требует жеста */
.qr-camera-resume {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  border: 0;
  border-radius: 18px;
  background: rgba(70, 86, 40, 0.66);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.qr-camera-resume:active {
  background: rgba(70, 86, 40, 0.82);
}

.qr-kiosk {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2.4vw, 44px);
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
}
.qr-kiosk-center {
  width: min(62vw, calc(100dvh - 130px), 640px);
  min-width: 300px;
}
.qr-kiosk-side {
  display: grid;
  place-items: center;
  min-width: 0;
}
.qr-kiosk-side img {
  display: block;
  width: min(15vw, 190px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px rgba(31, 45, 18, 0.3));
}
.qr-kiosk-side-left img {
  animation: kioskSideLogo 3.2s ease-in-out infinite;
}
.qr-kiosk-side-right img {
  animation: kioskSideLogo 3.2s 0.35s ease-in-out infinite;
}
.qr-kiosk-top {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(62vw, calc(100dvh - 130px), 640px);
  z-index: 40;
  margin-bottom: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(43, 59, 25, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.qr-kiosk-cam {
  padding-top: 76px;
}
.qr-kiosk-cam .qr-scan-wrap {
  width: 100%;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.76);
  background: rgba(34, 50, 20, 0.48);
  box-shadow: 0 24px 58px rgba(25, 38, 12, 0.34);
}
html:has(body.app-qr-kiosk) {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  margin: 0 !important;
  background: #1F6498 !important;
}
body.app-qr-kiosk {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  margin: 0 !important;
  background: #1F6498 !important;
}
body.app-qr-kiosk #appMain.container,
body.app-qr-kiosk main.container {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}
body.app-qr-kiosk #qrKioskState,
body.app-qr-kiosk .qr-kiosk,
body.app-qr-kiosk .qr-kiosk-center,
body.app-qr-kiosk .qr-kiosk-cam,
body.app-qr-kiosk .qr-scan-wrap,
body.app-qr-kiosk .qr-reader {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #1F6498;
  overflow: hidden;
}
body.app-qr-kiosk .qr-kiosk-top,
body.app-qr-kiosk .qr-kiosk-side,
body.app-qr-kiosk .qr-overlay,
body.app-qr-kiosk #qrAdminHint,
body.app-qr-kiosk #qrAdminError {
  display: none !important;
}
body.app-qr-kiosk .qr-kiosk {
  display: block !important;
}
body.app-qr-kiosk .qr-reader video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #000;
}
body.app-qr-kiosk .qr-attract {
  position: fixed !important;
  inset: 0 !important;
  padding: 4vh 5vw;
  background-color: #1F6498;
  background-image:
    radial-gradient(circle at 50% 38%, rgba(153, 207, 74, 0.28), transparent 46%),
    linear-gradient(145deg, #5BA8DC, #5BA8DC 52%, #2F78B0);
}
body.app-qr-kiosk .qr-attract-logo {
  width: min(82vw, 62vh) !important;
  max-height: 54vh !important;
  max-width: none !important;
}
body.app-qr-kiosk .qr-attract-phrase {
  max-width: min(92vw, 18ch);
  font-size: clamp(40px, 8.4vw, 108px);
}
body.app-qr-kiosk .qr-attract-tap {
  font-size: clamp(22px, 4.2vw, 44px);
  margin-top: 4vh;
}
body.app-qr-kiosk .qr-attract-line {
  width: min(640px, 70vw);
  margin: 3vh 0 2.4vh;
}
body.app-qr-kiosk .qr-attract-glow {
  width: min(92vw, 980px);
}
body.app-qr-kiosk .qr-kiosk-secret {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 72px;
  height: 72px;
  z-index: 50;
  border: 0;
  padding: 0;
  opacity: 0;
  background: transparent;
}
body.app-qr-kiosk .qr-scan-manual {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  transform: translateX(-50%);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 16px 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #2b3b19;
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 16px 40px rgba(19, 32, 12, 0.38);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}
body.app-qr-kiosk:not(.is-qr-attract):not(.app-kiosk-blocked) .qr-scan-manual {
  display: inline-flex;
}
body.app-qr-kiosk .qr-scan-manual:active {
  transform: translateX(-50%) scale(0.98);
  background: #fff;
}
.qr-cam-hint {
  display: none;
  position: fixed;
  left: max(10px, env(safe-area-inset-left, 0px));
  top: 50%;
  z-index: 55;
  width: clamp(72px, 11vw, 128px);
  height: auto;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transform: translateY(-50%);
  animation: qrCamHintBounce 1.05s ease-in-out infinite;
}
body.app-qr-kiosk:not(.is-qr-attract):not(.app-kiosk-blocked) .qr-cam-hint {
  display: block;
}
.qr-cam-hint svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: rgba(167, 214, 90, 0.52);
  filter: drop-shadow(0 8px 18px rgba(19, 32, 12, 0.28));
}
@keyframes qrCamHintBounce {
  0%, 100% { transform: translateY(-50%) translateX(10px); }
  50% { transform: translateY(-50%) translateX(0); }
}
body.app-qr-kiosk .qr-kiosk-top .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
body.app-qr-kiosk .qr-kiosk-top .btn:hover,
body.app-qr-kiosk .qr-kiosk-top .btn:focus {
  color: var(--sbs-brand-deep);
  background: #fff;
  border-color: #fff;
}

.qr-result.d-none {
  display: none !important;
}
.qr-kiosk-blocked {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: 7vh 7vw;
  color: white;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background-color: #5BA8DC;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(153, 207, 74, 0.5), transparent 34%),
    linear-gradient(145deg, #5BA8DC, #5BA8DC 50%, #2F78B0);
}

body.app-qr-kiosk .modal,
body.app-kiosk-blocked .modal {
  z-index: 3200 !important;
}
body.app-qr-kiosk .modal-backdrop,
body.app-kiosk-blocked .modal-backdrop {
  z-index: 3150 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(19, 32, 12, 0.72);
}
body.app-kiosk-blocked.modal-open .qr-kiosk-blocked {
  z-index: 1;
}
body.app-kiosk-blocked #qrOpenManualFromSettingsWrap {
  display: none !important;
}
#qrKioskUnblockWrap {
  display: none;
}
body.app-kiosk-blocked #qrKioskUnblockWrap {
  display: block;
}
.receipt-preview .rp-logo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  image-rendering: pixelated;
}

body.app-kiosk-blocked .pwa-install-banner {
  display: none !important;
}

body.app-qr-kiosk .pwa-install-banner {
  display: none !important;
}

.qr-kiosk-blocked::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle, black 10%, transparent 78%);
}

.qr-kiosk-blocked-glow {
  position: absolute;
  width: min(75vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 255, 201, 0.18), transparent 67%);
  animation: kioskBlockedGlow 3s ease-in-out infinite;
}

.qr-kiosk-blocked img {
  position: relative;
  width: min(68vw, 820px);
  max-height: 46vh;
  object-fit: contain;
  filter: drop-shadow(0 24px 55px rgba(30, 45, 16, 0.35));
  animation: kioskBlockedLogo 3.2s ease-in-out infinite;
}

.qr-kiosk-blocked-line {
  position: relative;
  width: min(520px, 58vw);
  height: 3px;
  margin: 4vh 0 2.5vh;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.qr-kiosk-blocked-text {
  position: relative;
  max-width: 94vw;
  color: white;
  font-family: var(--bs-body-font-family);
  font-size: clamp(40px, 5.6vw, 92px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 12px 34px rgba(30, 44, 16, 0.34);
}
.qr-kiosk-blocked-reason {
  position: relative;
  margin-top: 2.4vh;
  max-width: 94vw;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(22px, 3.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 8px 22px rgba(30, 44, 16, 0.3);
}

.printer-gateway-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--sbs-brand-rgb), 0.18);
  border-radius: 18px;
  background: rgba(var(--sbs-brand-rgb), 0.06);
}

.kiosk-control-card {
  border: 1px solid rgba(var(--sbs-accent-rgb), 0.24) !important;
  background: linear-gradient(135deg, #fff, rgba(var(--sbs-accent-rgb), 0.07));
}

.kiosk-control-card.is-blocked {
  border-color: rgba(220, 53, 69, 0.28) !important;
  background: linear-gradient(135deg, #fff, rgba(220, 53, 69, 0.06));
}

.kiosk-control-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--sbs-brand);
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 12px 25px rgba(var(--sbs-brand-rgb), 0.14);
}

@keyframes kioskBlockedLogo {
  50% { transform: scale(1.035); }
}

@keyframes kioskBlockedGlow {
  50% { transform: scale(1.12); opacity: 0.6; }
}

@keyframes kioskSideLogo {
  50% { transform: scale(1.04); filter: drop-shadow(0 22px 46px rgba(31, 45, 18, 0.4)); }
}

.qr-attract {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 6vw 7vh;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 50% 38%, rgba(153, 207, 74, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(113, 141, 59, 0.55), rgba(91, 168, 220, 0.62) 52%, rgba(70, 86, 40, 0.72));
}
.qr-attract.is-visible {
  display: flex;
}
.qr-attract-glow {
  position: absolute;
  width: min(70vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 255, 201, 0.22), transparent 68%);
  animation: kioskBlockedGlow 3s ease-in-out infinite;
}
.qr-attract-motes {
  position: absolute;
  inset: 12%;
  pointer-events: none;
}
.qr-attract-motes span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  animation: qrAttractMote 3.4s ease-in-out infinite;
}
.qr-attract-motes span:nth-child(1) { left: 12%; top: 22%; animation-delay: 0s; }
.qr-attract-motes span:nth-child(2) { left: 78%; top: 18%; animation-delay: 0.4s; width: 5px; height: 5px; }
.qr-attract-motes span:nth-child(3) { left: 18%; top: 72%; animation-delay: 0.8s; }
.qr-attract-motes span:nth-child(4) { left: 82%; top: 68%; animation-delay: 1.1s; width: 4px; height: 4px; }
.qr-attract-motes span:nth-child(5) { left: 48%; top: 8%; animation-delay: 0.2s; }
.qr-attract-motes span:nth-child(6) { left: 52%; top: 86%; animation-delay: 1.5s; }
.qr-attract-logo {
  position: relative;
  width: min(46vw, 280px);
  max-height: 28vh;
  object-fit: contain;
  filter: drop-shadow(0 22px 48px rgba(30, 45, 16, 0.38));
  animation: kioskBlockedLogo 3.2s ease-in-out infinite;
}
.qr-attract-line {
  position: relative;
  width: min(420px, 52vw);
  height: 3px;
  margin: 3.2vh 0 2.2vh;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}
.qr-attract-phrase {
  position: relative;
  max-width: 16ch;
  font-size: clamp(28px, 4.8vw, 54px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  text-shadow: 0 12px 34px rgba(30, 44, 16, 0.34);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.qr-attract-phrase.is-swap {
  opacity: 0;
  transform: translateY(12px);
}
.qr-attract-tap {
  position: relative;
  margin-top: 3.4vh;
  font-size: clamp(16px, 2.1vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  animation: qrAttractTap 1.7s ease-in-out infinite;
}
@keyframes qrAttractTap {
  50% { opacity: 0.45; transform: translateY(4px); }
}
@keyframes qrAttractMote {
  50% { transform: translateY(-10px) scale(1.25); opacity: 0.35; }
}

@media (max-width: 720px) {
  .qr-kiosk-top {
    width: min(94vw, calc(100dvh - 120px), 640px);
  }
}

@media (max-width: 720px) {
  .qr-kiosk {
    grid-template-columns: minmax(0, 1fr);
  }
  .qr-kiosk-center {
    width: min(94vw, calc(100dvh - 120px), 640px);
    min-width: 0;
    margin: 0 auto;
  }
  .qr-kiosk-side {
    display: none;
  }
}

/* QR manual 3-digit entry */
.qr-manual-slots {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.qr-manual-slot {
  flex: 1;
  min-height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--sbs-brand-deep);
  background: #ffffff;
  border: 2px solid rgba(91, 168, 220, 0.18);
  box-shadow: 0 12px 28px rgba(10, 42, 64, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.qr-manual-slot:empty::before {
  content: "·";
  font-size: 28px;
  font-weight: 300;
  color: rgba(70, 86, 40, 0.24);
}
.qr-manual-slot.is-filled {
  border-color: rgba(123, 200, 240, 0.48);
  box-shadow: 0 14px 32px rgba(70, 86, 40, 0.16), inset 0 0 0 1px rgba(123, 200, 240, 0.14);
}
.qr-manual-slot.is-typing {
  animation: qrManualPop 0.22s ease;
}
@keyframes qrManualPop {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.qr-result {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(70, 86, 40, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 18px;
}
.qr-result-card {
  width: min(980px, 100%);
  height: min(520px, calc(100dvh - 120px));
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 28px 80px rgba(10, 42, 64, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  animation: qrPop 240ms ease;
}
.qr-result-left {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.qr-result-fio {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--sbs-brand-deep);
  line-height: 1.15;
}
.qr-result-label {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(70, 86, 40, 0.68);
}
.qr-result-rad {
  font-size: 88px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--sbs-brand);
  margin-top: 4px;
}
.qr-result-rad.is-pop {
  animation: qrRadPop 520ms cubic-bezier(.2,.9,.2,1.2);
}
.qr-result-sub {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(70, 86, 40, 0.68);
}
.qr-result-count {
  margin-top: 18px;
  font-size: 14px;
  color: rgba(70, 86, 40, 0.58);
}
.qr-result-right {
  background: rgba(91, 168, 220, 0.10);
  display: grid;
  place-items: center;
  padding: 18px;
}
.qr-result-avatar {
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 22px 60px rgba(10, 42, 64, 0.16);
  display: grid;
  place-items: center;
}
.qr-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qr-result-avatar-fallback {
  font-size: 88px;
  font-weight: 900;
  color: rgba(70, 86, 40, 0.46);
}

.qr-result-card.is-dimmed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 280ms ease, transform 280ms ease;
}
.qr-verse-promo {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh 6vw;
  color: #fff;
  background:
    radial-gradient(circle at 50% 38%, rgba(153, 207, 74, 0.48), transparent 42%),
    linear-gradient(145deg, #5BA8DC, var(--sbs-brand) 50%, var(--sbs-brand-deep));
}
.qr-verse-promo.is-visible {
  display: flex;
  animation: qrVersePromoIn 520ms ease both;
}
.qr-verse-promo-glow {
  position: absolute;
  width: min(90vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 255, 201, 0.22), transparent 68%);
  animation: kioskBlockedGlow 3s ease-in-out infinite;
}
.qr-verse-promo-motes {
  position: absolute;
  inset: 10%;
  pointer-events: none;
}
.qr-verse-promo-motes span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: sqrFloat 6s ease-in-out infinite;
}
.qr-verse-promo-motes span:nth-child(1) { left: 12%; top: 18%; }
.qr-verse-promo-motes span:nth-child(2) { left: 78%; top: 22%; animation-delay: .6s; }
.qr-verse-promo-motes span:nth-child(3) { left: 22%; top: 72%; animation-delay: 1.1s; }
.qr-verse-promo-motes span:nth-child(4) { left: 84%; top: 68%; animation-delay: 1.8s; }
.qr-verse-promo-motes span:nth-child(5) { left: 48%; top: 12%; animation-delay: .3s; }
.qr-verse-promo-motes span:nth-child(6) { left: 58%; top: 82%; animation-delay: 1.4s; }
.qr-verse-promo-logo {
  position: relative;
  width: min(46vw, 260px);
  max-height: 18vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(24, 36, 12, 0.35));
  animation: kioskBlockedLogo 3s ease-in-out infinite;
}
.qr-verse-promo-kicker {
  position: relative;
  margin-top: 18px;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.86;
}
.qr-verse-promo-title {
  position: relative;
  margin-top: 10px;
  max-width: 16ch;
  font-size: clamp(36px, 7.4vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  text-shadow: 0 12px 32px rgba(24, 36, 12, 0.32);
}
.qr-verse-promo-title span {
  color: #f4ffc4;
}
.qr-verse-promo .js-promo-final {
  display: none;
}
.qr-verse-promo.is-final .js-promo-normal {
  display: none;
}
.qr-verse-promo.is-final .js-promo-final.qr-verse-promo-title,
.qr-verse-promo.is-final .js-promo-final.qr-verse-promo-sub {
  display: block;
}
.qr-verse-promo.is-final .qr-verse-promo-title {
  max-width: 22ch;
  font-size: clamp(28px, 5.4vw, 56px);
}
.qr-verse-promo-sub {
  position: relative;
  margin-top: 16px;
  font-size: clamp(22px, 4.2vw, 36px);
  font-weight: 800;
  opacity: 0.94;
}
@keyframes qrVersePromoIn {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: none; }
}
@keyframes sqrFloat {
  50% { transform: translateY(-16px); opacity: 0.45; }
}

@keyframes qrPop {
  from { transform: translateY(8px) scale(0.99); opacity: 0.6; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes qrRadPop {
  0% { transform: scale(0.92); filter: blur(0.6px); opacity: 0.85; }
  45% { transform: scale(1.06); filter: blur(0); opacity: 1; }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  .qr-result-card { grid-template-columns: 1fr; height: auto; }
  .qr-result-right { order: -1; }
  .qr-result-rad { font-size: 72px; }
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
  background: transparent;
}

html.app-preload-pending #appLoading,
.app-loading.is-visible {
  display: block !important;
  opacity: 1;
  visibility: visible;
  /* Never block the page under splash */
  pointer-events: none;
  transition: none;
}

.app-loading-hold .app-loading-backdrop {
  opacity: 1 !important;
  animation: none !important;
}

.app-loading-hold .app-loading-card,
.app-loading-hold .app-loading-glow,
.app-loading-hold .app-loading-rays,
.app-loading-hold .app-loading-motes,
.app-loading-hold .app-loading-halo {
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
}

/* Native file triggers — not display:none (Android ignores capture on d-none + .click()) */
.sbs-file-hit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.js-birth-file-field .btn {
  cursor: pointer;
  margin: 0;
}

/* Page stays visible under the green — it appears as the backdrop fades */
nav.navbar,
main.container,
#pwaInstallBanner {
  transition: opacity 120ms ease;
}

.app-loading-backdrop {
  position: absolute;
  inset: 0;
  background: var(--sbs-brand);
  opacity: 0;
}

.app-loading-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(120vw, 720px);
  height: min(120vw, 720px);
  transform: translate(-50%, -50%) scale(0.55);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 244, 214, 0.55) 0%,
    rgba(255, 220, 140, 0.22) 28%,
    rgba(91, 168, 220, 0) 68%
  );
  opacity: 0;
  pointer-events: none;
}

.app-loading-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(140vw, 900px);
  height: min(140vw, 900px);
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    rgba(255, 248, 220, 0.0) 0deg,
    rgba(255, 236, 170, 0.18) 12deg,
    rgba(255, 248, 220, 0.0) 24deg,
    rgba(255, 236, 170, 0.12) 48deg,
    rgba(255, 248, 220, 0.0) 64deg,
    rgba(255, 236, 170, 0.16) 110deg,
    rgba(255, 248, 220, 0.0) 130deg,
    rgba(255, 236, 170, 0.1) 180deg,
    rgba(255, 248, 220, 0.0) 200deg,
    rgba(255, 236, 170, 0.14) 250deg,
    rgba(255, 248, 220, 0.0) 270deg,
    rgba(255, 236, 170, 0.12) 320deg,
    rgba(255, 248, 220, 0.0) 360deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 62%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 62%);
}

.app-loading-motes {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(320px, 78vw);
  height: min(320px, 78vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

.app-loading-motes span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 248, 220, 0.85);
  box-shadow: 0 0 12px rgba(255, 236, 170, 0.8);
  opacity: 0;
  /* offsets from card center */
  left: 50%;
  top: 50%;
}

.app-loading-motes span:nth-child(1) { margin-left: -42%; margin-top: 8%; }
.app-loading-motes span:nth-child(2) { margin-left: 40%; margin-top: -6%; width: 4px; height: 4px; }
.app-loading-motes span:nth-child(3) { margin-left: -8%; margin-top: -38%; width: 5px; height: 5px; }
.app-loading-motes span:nth-child(4) { margin-left: 28%; margin-top: 32%; }
.app-loading-motes span:nth-child(5) { margin-left: -36%; margin-top: -28%; width: 4px; height: 4px; }
.app-loading-motes span:nth-child(6) { margin-left: 12%; margin-top: 40%; width: 5px; height: 5px; }

.app-loading-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 32px));
  padding: 0;
  text-align: center;
  opacity: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.app-loading-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(280px, 78vw);
  height: min(280px, 78vw);
  transform: translate(-50%, -50%) scale(0.7);
  border-radius: 50%;
  border: 1px solid rgba(255, 248, 220, 0.35);
  box-shadow:
    0 0 0 12px rgba(255, 236, 170, 0.08),
    0 0 40px rgba(255, 236, 170, 0.25);
  opacity: 0;
  pointer-events: none;
}

.app-loading-heartbeat {
  position: relative;
  z-index: 1;
  width: min(240px, 70vw);
  margin: 0;
  display: grid;
  place-items: center;
}

.app-loading-heartbeat img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transform-origin: center center;
  opacity: 0;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.22));
}

.app-loading-skip {
  margin-top: 24px;
  border-radius: 999px;
  padding-inline: 16px;
  color: var(--sbs-brand-deep);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}

/* —— «Свет» — warm light bloom, then logo flies and green dissolves —— */
.app-loading-intro .app-loading-backdrop {
  opacity: 1;
  animation: appBackdropDim 3000ms ease-out 1 forwards;
}

.app-loading-intro .app-loading-glow {
  animation: appLightGlow 3000ms cubic-bezier(0.2, 0.8, 0.2, 1) 1 forwards;
}

.app-loading-intro .app-loading-rays {
  animation: appLightRays 3000ms linear 1 forwards;
}

.app-loading-intro .app-loading-halo {
  animation: appLightHalo 3000ms cubic-bezier(0.2, 0.8, 0.2, 1) 1 forwards;
}

.app-loading-intro .app-loading-heartbeat img {
  opacity: 1;
  animation: appLogoFlyIn 3000ms cubic-bezier(0.18, 0.84, 0.22, 1) 1 forwards;
}

.app-loading-intro .app-loading-motes {
  opacity: 1;
}

.app-loading-intro .app-loading-motes span {
  animation: appLightMote 3000ms ease-out 1 forwards;
}
.app-loading-intro .app-loading-motes span:nth-child(2) { animation-delay: 80ms; }
.app-loading-intro .app-loading-motes span:nth-child(3) { animation-delay: 140ms; }
.app-loading-intro .app-loading-motes span:nth-child(4) { animation-delay: 40ms; }
.app-loading-intro .app-loading-motes span:nth-child(5) { animation-delay: 120ms; }
.app-loading-intro .app-loading-motes span:nth-child(6) { animation-delay: 180ms; }

@keyframes appLogoFlyIn {
  0% {
    transform: scale(0.82);
    opacity: 0;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.22)) brightness(1);
  }
  12% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.22)) brightness(1.05);
  }
  38% {
    transform: scale(1.1);
    opacity: 1;
    filter: drop-shadow(0 12px 36px rgba(255, 236, 170, 0.35)) brightness(1.08);
  }
  100% {
    transform: scale(1.62);
    opacity: 0;
    filter: drop-shadow(0 18px 48px rgba(255, 236, 170, 0.15)) brightness(1.2);
  }
}

@keyframes appBackdropDim {
  0% {
    opacity: 1;
  }
  32% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes appLightGlow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.85);
  }
  45% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

@keyframes appLightRays {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.7);
  }
  16% {
    opacity: 0.7;
    transform: translate(-50%, -50%) rotate(8deg) scale(0.85);
  }
  55% {
    opacity: 0.45;
    transform: translate(-50%, -50%) rotate(28deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(52deg) scale(1.35);
  }
}

@keyframes appLightHalo {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  14% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.85);
  }
  40% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.7);
  }
}

@keyframes appLightMote {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.6);
  }
  18% {
    opacity: 0.95;
    transform: translateY(0) scale(1);
  }
  55% {
    opacity: 0.7;
    transform: translateY(-28px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-70px) scale(0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-intro .app-loading-backdrop,
  .app-loading-intro .app-loading-glow,
  .app-loading-intro .app-loading-rays,
  .app-loading-intro .app-loading-halo,
  .app-loading-intro .app-loading-heartbeat img,
  .app-loading-intro .app-loading-motes span {
    animation-duration: 600ms !important;
  }
}

.app-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}
.app-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pin-input {
  letter-spacing: 0.6em;
  font-variant-numeric: tabular-nums;
}

.avatar,
.avatar-preview {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--sbs-brand-soft);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.avatar img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #5f6a4c;
  font-weight: 700;
}

.cropper-wrap {
  width: 100%;
  min-height: 280px;
  border-radius: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.65);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cropper-wrap img {
  max-width: 100%;
  display: block;
}

/* Bootstrap only constrains a scrollable modal when body/footer are direct
   children. Most SBS forms wrap them, so keep the footer visible explicitly. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-dialog-scrollable .modal-content > form > .modal-footer {
  flex: 0 0 auto;
  background: var(--bs-body-bg);
}

/* On phones, one-finger swipes scroll the modal/page until move mode is enabled. */
@media (pointer: coarse) {
  .cropper-scroll-mode .cropper-container,
  .cropper-scroll-mode .cropper-wrap-box,
  .cropper-scroll-mode .cropper-canvas,
  .cropper-scroll-mode .cropper-drag-box,
  .cropper-scroll-mode .cropper-crop-box,
  .cropper-scroll-mode .cropper-face {
    touch-action: pan-y !important;
  }
}

/* Compact cropper area inside "create student" modal (avoid accidental scroll grabs) */
.cropper-wrap-compact {
  max-width: 420px;
  margin: 0 auto;
  min-height: 220px;
}
@media (max-width: 576px) {
  .cropper-wrap-compact {
    max-width: 320px;
    min-height: 200px;
  }
}

/* Student card print preview (admin panel) */
.psc-preview-shell {
  overflow-x: hidden; /* never require horizontal scroll on mobile */
}
.psc-preview-row > div {
  flex: 1 1 260px;
  min-width: 0;
}
.psc-card-img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 360px;
  display: block;
  margin: 0 auto;
}
@media (max-width: 576px) {
  .psc-card-img {
    max-height: 240px;
  }
}
/* Vertical: always show 2 sides next to each other (shrink on mobile, no horizontal scroll) */
.psc-preview-row.psc-vertical {
  flex-wrap: nowrap !important;
}
.psc-preview-row.psc-vertical > div {
  flex: 1 1 0;
  max-width: 50%;
}

/* Blur underlying modal when stacking (card check over create) */
.modal.is-underlay .modal-dialog,
.modal.sbs-modal-underlay .modal-dialog {
  filter: blur(7px);
  opacity: 0.3;
  transform: scale(0.985);
  pointer-events: none;
}

.modal-backdrop.show {
  background-color: rgba(42, 57, 25, 0.72);
  opacity: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  overflow: hidden;
  border-radius: 1.25rem;
}

.modal-header,
.modal-footer {
  border-color: rgba(var(--sbs-brand-rgb), 0.07);
}

.sbs-confirm-modal {
  z-index: 2200;
}

body.sbs-confirm-open .modal-backdrop {
  z-index: 2190;
}

.sbs-confirm-delayed {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 132px;
  justify-content: center;
}

.sbs-confirm-countdown {
  --confirm-progress: 0deg;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(255, 255, 255, 0.95) var(--confirm-progress),
    rgba(255, 255, 255, 0.22) 0
  );
  color: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

.sbs-confirm-countdown::before {
  content: "";
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
}

.sbs-confirm-countdown > span {
  z-index: 1;
  grid-area: 1 / 1;
}

.modal.is-underlay *,
.modal.sbs-modal-underlay * {
  pointer-events: none !important;
}

.card-check-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 210px;
  color: var(--sbs-brand);
  font-weight: 750;
}

.registration-submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(164, 222, 83, 0.46), transparent 36%),
    linear-gradient(145deg, #5BA8DC, var(--sbs-brand) 52%, var(--sbs-brand-deep));
}
.registration-submit-glow {
  position: absolute;
  width: min(76vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 255, 211, 0.2), transparent 68%);
  animation: registrationSubmitGlow 2.4s ease-in-out infinite;
}
.registration-submit-logo {
  position: relative;
  width: min(54vw, 390px);
  max-height: 24vh;
  object-fit: contain;
  filter: drop-shadow(0 20px 42px rgba(29, 42, 15, 0.34));
  animation: registrationSubmitLogo 2.2s ease-in-out infinite;
}
.registration-submit-spinner {
  position: relative;
  width: 68px;
  height: 68px;
  margin-top: clamp(24px, 4vh, 42px);
  border: 7px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(31, 45, 18, 0.2);
  animation: registrationSubmitSpin 0.85s linear infinite;
}
.registration-submit-title {
  position: relative;
  margin-top: 22px;
  font-size: clamp(27px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.05;
}
.registration-submit-text {
  position: relative;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(15px, 2vw, 20px);
}
@keyframes registrationSubmitSpin {
  to { transform: rotate(360deg); }
}
@keyframes registrationSubmitLogo {
  50% { transform: scale(1.045); }
}
@keyframes registrationSubmitGlow {
  50% { transform: scale(1.12); opacity: 0.62; }
}

.pwa-install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 1080;
  pointer-events: none;
}

.pwa-install-banner .card {
  pointer-events: auto;
  border-radius: 18px;
}

.list-group-item.active .text-secondary,
.list-group-item.active .small,
.list-group-item.active .text-secondary.small {
  color: rgba(255, 255, 255, 0.85) !important;
}

.list-group-item.active .fw-semibold,
.list-group-item.active .form-check-label,
.list-group-item.active .form-check-label * {
  color: rgba(255, 255, 255, 0.98) !important;
}

.pwa-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(91, 168, 220, 0.10);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.pwa-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pin-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(91, 168, 220, 0.12);
  border: 1px solid rgba(91, 168, 220, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  transition: transform 120ms ease, background 120ms ease;
}
.pin-dot.is-filled {
  background: var(--sbs-brand);
  border-color: rgba(91, 168, 220, 0.28);
  box-shadow: 0 6px 18px rgba(91, 168, 220, 0.24);
  transform: scale(1.05);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pin-key {
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 18px;
  color: var(--sbs-brand-deep);
}
.pin-key:active {
  transform: translateY(1px);
}

/* New: bank-like PIN screen */
.pin-screen {
  min-height: calc(100dvh - 80px);
  display: grid;
  place-items: center;
  width: 100%;
  padding: 10px 0 24px;
}
.pin-card {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(10, 42, 64, 0.16);
  padding: 26px 24px 22px;
}
.pin-card-clean {
  background: #ffffff;
}

.pin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(91, 168, 220, 0.08);
  border: 1px solid rgba(91, 168, 220, 0.14);
}
.pin-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}
.pin-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pin-brand-text {
  font-weight: 800;
  color: var(--sbs-brand-deep);
}
.pin-header {
  text-align: center;
}
.pin-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sbs-brand-deep);
}
.pin-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(70, 86, 40, 0.68);
}

.pin-dots-lg {
  gap: 14px;
}
.pin-dots-lg .pin-dot {
  width: 16px;
  height: 16px;
}

.pin-pad-round {
  gap: 12px;
}
.pin-key-round {
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(70, 86, 40, 0.14);
  box-shadow: 0 10px 26px rgba(10, 42, 64, 0.10);
  transition: transform 90ms ease, box-shadow 140ms ease, background 140ms ease;
}
.pin-key-round:hover {
  background: #ffffff;
}
.pin-key-round:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 18px rgba(10, 42, 64, 0.10);
}
.pin-key-ghost {
  font-weight: 700;
  font-size: 16px;
  color: rgba(70, 86, 40, 0.76);
  background: rgba(91, 168, 220, 0.06);
}

/* Clean white PIN keypad */
.pin-pad-clean {
  gap: 14px;
}
.pin-key-clean {
  height: 72px;
  border-radius: 999px;
  background: rgba(91, 168, 220, 0.08);
  border: 1px solid rgba(70, 86, 40, 0.14);
  box-shadow: 0 18px 40px rgba(10, 42, 64, 0.10);
  color: var(--sbs-brand-deep);
  font-size: 28px;
  font-weight: 800;
  transition: transform 100ms ease, background 140ms ease, box-shadow 140ms ease;
}

.pin-key-clean:active {
  transform: translateY(1px) scale(0.99);
  background: rgba(123, 200, 240, 0.12);
  box-shadow: 0 12px 28px rgba(10, 42, 64, 0.10);
}
.pin-key-func {
  font-size: 20px;
  font-weight: 900;
  color: rgba(70, 86, 40, 0.72);
  background: rgba(91, 168, 220, 0.05);
}

@keyframes pinShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.pin-error {
  animation: pinShake 420ms ease;
}
.pin-dots.pin-error .pin-dot {
  background: rgba(220, 53, 69, 0.10);
  border-color: rgba(220, 53, 69, 0.40);
}
.pin-dots.pin-error .pin-dot.is-filled {
  background: #dc3545;
  border-color: rgba(220, 53, 69, 0.55);
  box-shadow: 0 10px 24px rgba(220, 53, 69, 0.22);
}
.pin-pad.pin-error .pin-key-clean {
  border-color: rgba(220, 53, 69, 0.20);
}

/* VK-like full screen PIN */
.pin-vk {
  min-height: calc(100dvh - 80px);
  margin: -1.5rem 0;
  padding: 38px 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--sbs-brand);
  border-radius: 24px;
  box-shadow: 0 16px 55px rgba(10, 42, 64, 0.18);
}

@media (max-width: 576px) {
  .pin-vk {
    border-radius: 0;
    box-shadow: none;
    margin: -1.5rem -0.75rem;
  }
}

.pin-vk-top {
  text-align: center;
}
.pin-vk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.92);
}
.pin-vk-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.pin-vk-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pin-vk-appname {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pin-vk-title {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 18px;
}

.pin-dots-vk {
  gap: 18px;
}
.pin-dot-hollow {
  width: 12px;
  height: 12px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.pin-dot-hollow.is-filled {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
  transform: scale(1.06);
}

.pin-pad-vk {
  width: min(420px, 100%);
  margin: 0 auto;
  gap: 18px;
}
.pin-key-vk {
  height: 74px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.96);
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 100ms ease, background 140ms ease;
}
.pin-key-vk:active {
  transform: translateY(1px) scale(0.99);
  background: rgba(255, 255, 255, 0.22);
}
.pin-key-vk-func {
  font-size: 20px;
  font-weight: 800;
}

.register-wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8px 0 28px;
}

.register-page-body {
  min-height: 100dvh;
  background: var(--sbs-brand);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.register-page-main {
  min-height: auto;
  overflow: visible;
}

.register-logo {
  width: min(220px, 70vw);
  height: auto;
  display: inline-block;
}

.register-title {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.register-sub {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.register-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.register-step {
  text-align: center;
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.register-step.is-active {
  color: var(--sbs-brand);
  background: #fff;
  border-color: #fff;
}

.register-card {
  background: #f3f6ea;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
  padding: 22px 18px;
}

.register-pane {
  display: none;
}

.register-pane.is-active {
  display: block;
}

.register-child.card {
  background: #e8efda !important;
}

.reg-search-results {
  max-height: min(420px, 55dvh);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.reg-search-item {
  width: 100%;
  border: 1px solid rgba(91, 168, 220, 0.16);
  border-radius: 15px;
  background: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: inherit;
}

.reg-search-item:not(:disabled):hover,
.reg-search-item:not(:disabled):focus-visible {
  border-color: var(--sbs-brand);
  background: var(--sbs-brand-soft);
}

.reg-search-item.is-imported {
  opacity: 0.65;
}

.reg-search-item-main {
  min-width: 0;
  display: grid;
}

.reg-search-item-main small {
  color: var(--bs-secondary-color);
}

.reg-search-item-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reg-child-card {
  border: 1px solid rgba(91, 168, 220, 0.14);
  border-radius: 16px;
  padding: 12px;
  background: #F2F9FE;
}

.reg-child-card + .reg-child-card {
  margin-top: 10px;
}

.register-page-body .form-control,
.register-page-body .form-select {
  background-color: #f7faef;
  border-color: rgba(91, 168, 220, 0.22);
}

.register-page-body .form-control:focus,
.register-page-body .form-select:focus {
  background-color: #fbfff4;
  border-color: var(--sbs-brand);
  box-shadow: 0 0 0 0.25rem rgba(var(--sbs-brand-rgb), 0.18);
}

.register-page-body .btn-outline-secondary {
  color: var(--sbs-brand-deep);
  border-color: rgba(91, 168, 220, 0.28);
  background: rgba(255, 255, 255, 0.45);
}

.register-page-body .btn-outline-secondary:hover {
  color: #fff;
  background: var(--sbs-brand);
  border-color: var(--sbs-brand);
}

.register-success {
  padding-top: 28px;
}

.register-success-title {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
}

.register-success-text,
.register-success-meta {
  color: rgba(255, 255, 255, 0.92);
}

.register-success-skip {
  margin: 0 auto;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  text-align: left;
}

.register-success .btn-light {
  color: var(--sbs-brand-deep);
  border: 0;
  font-weight: 700;
}

/* Staff panel */
.staff-panel-card {
  background: #fff;
}

.staff-actions {
  display: grid;
  gap: 12px;
}

.staff-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(91, 168, 220, 0.22);
  background: var(--sbs-brand-soft);
  color: var(--sbs-brand-deep);
  border-radius: 16px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.staff-action-btn i {
  font-size: 1.45rem;
  color: var(--sbs-brand);
  flex: 0 0 auto;
}

.staff-action-btn:hover,
.staff-action-btn:focus {
  background: #eaf0dc;
  border-color: var(--sbs-brand);
  color: var(--sbs-brand-deep);
}

.staff-action-award {
  background: rgba(91, 168, 220, 0.12);
}

.staff-action-withdraw {
  background: rgba(160, 60, 50, 0.08);
  border-color: rgba(160, 60, 50, 0.22);
}

.staff-action-withdraw i {
  color: #a03c32;
}

.staff-mass-log {
  max-height: 360px;
  overflow: auto;
}

.staff-troop-list,
#staffRadSearchResults {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.staff-pick-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(91, 168, 220, 0.18);
  border-radius: 14px;
  background: #fff;
}

.staff-pick-check {
  padding-top: 4px;
  margin: 0;
}

.staff-pick-body {
  flex: 1;
  min-width: 0;
}

.staff-rad-badge {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sbs-brand-deep);
  padding: 0.35em 0.65em;
}

.staff-batch-modal .modal-body {
  background: linear-gradient(180deg, #F7FCFF 0%, #fff 120px);
}

.staff-batch-controls {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(91, 168, 220, 0.16);
  box-shadow: 0 4px 18px rgba(70, 86, 40, 0.06);
}

.staff-batch-dir {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.staff-batch-dir-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(91, 168, 220, 0.2);
  background: var(--sbs-brand-soft);
  color: var(--sbs-brand-deep);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.staff-batch-dir-btn i {
  font-size: 1.25rem;
  color: var(--sbs-brand);
}

.staff-batch-dir-btn span {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
}

.staff-batch-dir-btn small {
  color: #636F86;
  font-size: 0.78rem;
}

.staff-batch-dir-withdraw {
  background: rgba(160, 60, 50, 0.06);
  border-color: rgba(160, 60, 50, 0.18);
  color: #7a322c;
}

.staff-batch-dir-withdraw i {
  color: #a03c32;
}

.staff-batch-dir-withdraw small {
  color: #9a6a64;
}

.btn-check:checked + .staff-batch-dir-award {
  border-color: var(--sbs-brand);
  background: rgba(91, 168, 220, 0.16);
  box-shadow: 0 0 0 3px rgba(91, 168, 220, 0.12);
}

.btn-check:checked + .staff-batch-dir-withdraw {
  border-color: #a03c32;
  background: rgba(160, 60, 50, 0.14);
  box-shadow: 0 0 0 3px rgba(160, 60, 50, 0.12);
}

.staff-batch-modal.is-withdraw .staff-batch-controls {
  border-color: rgba(160, 60, 50, 0.22);
}

.staff-batch-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 0 62px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6E7597;
}

.staff-batch-list-head span:last-child {
  flex: 0 0 76px;
  text-align: center;
}

.staff-batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.staff-batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(91, 168, 220, 0.14);
}

.staff-batch-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.staff-batch-row-main > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.staff-batch-amt {
  flex: 0 0 76px;
  width: 76px;
  max-width: 76px;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.staff-batch-modal.is-withdraw .staff-batch-amt:focus {
  border-color: #a03c32;
  box-shadow: 0 0 0 0.2rem rgba(160, 60, 50, 0.18);
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm .avatar-fallback {
  font-weight: 700;
  color: var(--sbs-brand-deep);
}

@media (max-width: 576px) {
  .staff-action-btn {
    padding: 14px 14px;
    font-size: 1rem;
  }
}

.staff-action-btn.staff-action-regs {
  text-decoration: none;
}

/* Toasts — full-width fly-in banner */
.sbs-toast-host {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  pointer-events: none;
}

.sbs-toast {
  pointer-events: auto;
  width: 100%;
  transform: translateY(-110%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sbs-toast-in {
  transform: translateY(0);
}

.sbs-toast-out {
  transform: translateY(-110%);
}

.sbs-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  color: #fff;
  font-weight: 700;
}

.sbs-toast i {
  font-size: 1.25rem;
  line-height: 1;
  flex: 0 0 auto;
}

.sbs-toast-text {
  flex: 1 1 auto;
  font-size: 1rem;
  line-height: 1.3;
}

.sbs-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.85;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
}

.sbs-toast-success { background: var(--sbs-brand, #5BA8DC); }
.sbs-toast-danger { background: #a03c32; }
.sbs-toast-warning { background: #9a6b12; }
.sbs-toast-info { background: #3b6ea5; }

form.is-ajax-busy {
  opacity: 0.72;
  pointer-events: none;
}

/* —— Quiz (Kahoot-style) —— */
.quiz-play-page,
.quiz-display-page {
  background: #5BA8DC;
  min-height: 100vh;
}

.quiz-play-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.quiz-play-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  color: #fff;
}

.quiz-play-logo {
  width: auto;
  height: 48px;
  max-width: 112px;
  object-fit: contain;
}

.quiz-play-title {
  font-weight: 800;
  font-size: 1.25rem;
}

.quiz-panel {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.quiz-panel-inner {
  padding: 20px;
}

.quiz-qr-wrap {
  max-height: 220px;
}

.quiz-team-box {
  background: var(--sbs-brand-soft);
  border-radius: 14px;
  padding: 14px;
}

.quiz-team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-member-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.quiz-q-text {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--sbs-brand-deep);
}

.quiz-answers {
  display: grid;
  gap: 10px;
}

.quiz-answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--qa-color, var(--sbs-brand));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 120ms ease, filter 120ms ease;
}

.quiz-answer-btn:active {
  transform: scale(0.98);
  filter: brightness(0.92);
}

.quiz-answer-shape {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.quiz-answered-banner {
  text-align: center;
  padding: 16px;
  background: var(--sbs-brand-soft);
  border-radius: 12px;
  color: var(--sbs-brand-deep);
  font-weight: 700;
}

.quiz-reveal-chip {
  display: inline-block;
  padding: 16px 24px;
  border-radius: 16px;
  background: var(--qa-color);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.quiz-leader-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: #f4f6ef;
}

.quiz-leader-row.is-me {
  background: var(--sbs-brand-soft);
  border: 2px solid var(--sbs-brand);
}

.quiz-leader-rank {
  font-weight: 800;
  color: var(--sbs-brand);
}

.quiz-leader-score {
  font-weight: 800;
}

.quiz-wait-icon {
  font-size: 3rem;
  color: var(--sbs-brand);
}

/* Display / host */
.quiz-display {
  --quiz-qr-size: 252px;
  --quiz-qr-gap: 2.75rem;
  display: grid;
  grid-template-columns: max-content 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "logo head"
    "qr stage"
    "dock dock";
  min-height: calc(100vh - 2rem);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.quiz-display-qr {
  grid-area: qr;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 12px 8px;
  gap: var(--quiz-qr-gap);
  background: #5BA8DC;
  color: #fff;
}

.quiz-display-logo {
  grid-area: logo;
  justify-self: center;
  align-self: center;
  width: var(--quiz-qr-size);
  height: auto;
  max-width: var(--quiz-qr-size);
  padding: 10px 8px 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
}

.quiz-display-dock {
  grid-area: dock;
}

.quiz-host-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 700;
}

.quiz-host-brand img {
  width: auto;
  height: 36px;
  max-width: 86px;
  object-fit: contain;
}

.quiz-display-stage {
  grid-area: stage;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #46178f 0%, #2d1065 50%, #1a0a3d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}

.quiz-stage-view {
  width: 100%;
  max-width: 960px;
  text-align: center;
  color: #fff;
}

.quiz-stage-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 24px;
}

.quiz-lobby-head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  align-self: stretch;
  padding: 12px 32px;
  color: #fff;
  background: #5BA8DC;
}

.quiz-lobby-stat {
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 750;
  letter-spacing: 0.01em;
}

.quiz-lobby-stat strong {
  font-weight: 900;
}

.quiz-lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  text-align: left;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.quiz-lobby-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(8px);
}

.quiz-lobby-team-name {
  font-weight: 800;
  margin-bottom: 10px;
}

.quiz-lobby-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-lobby-member {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.quiz-intro-logo-wrap {
  animation: quizLogoIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-intro-logo {
  width: min(280px, 60vw);
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.4));
}

@keyframes quizLogoIn {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.quiz-countdown {
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 24px;
  animation: quizPulse 1s ease-in-out infinite;
}

.quiz-countdown-sm {
  font-size: clamp(3rem, 10vw, 5rem);
}

@keyframes quizPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

.quiz-display-q {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 28px;
  line-height: 1.25;
}

.quiz-display-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}

@media (max-width: 640px) {
  .quiz-display-answers {
    grid-template-columns: 1fr;
  }
  .quiz-display {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "head"
      "qr"
      "stage"
      "dock";
  }
  .quiz-display-qr {
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px 12px 16px;
  }
}

.quiz-display-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--qa-color, #333);
  color: #fff;
  font-weight: 700;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  min-height: 72px;
}

.quiz-display-answer.is-correct {
  box-shadow: 0 0 0 4px #fff, 0 0 24px rgba(255, 255, 255, 0.4);
  transform: scale(1.02);
}

.quiz-answer-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.quiz-wait-bar {
  margin-top: 24px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  display: inline-block;
  font-weight: 600;
}

.quiz-leaderboard {
  max-width: 560px;
  margin: 0 auto;
}

.quiz-leaderboard .quiz-leader-row {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.quiz-leaderboard .quiz-leader-row.is-top {
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.05rem;
}

.quiz-podium {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.quiz-podium-place {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 20px 28px;
  min-width: 140px;
}

.quiz-podium-medal {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.quiz-podium-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--sbs-accent, #7BC8F0);
}

.quiz-pause-text {
  font-size: 1.5rem;
  font-weight: 600;
  opacity: 0.9;
}

.quiz-host-code {
  font-size: 0.92rem;
  font-weight: 750;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.quiz-host-code a {
  color: #EAF6FD;
}

/* Quiz polish — only SBS palette */
.quiz-play-page {
  background: #5BA8DC;
  height: 100dvh;
  overflow: hidden;
}

.quiz-display-page {
  background: #5BA8DC !important;
  background-color: #5BA8DC !important;
  height: 100dvh;
  overflow: hidden;
}

html:has(body.quiz-display-page) {
  height: 100%;
  overflow: hidden;
}

.quiz-play-page #pwaInstallBanner,
.quiz-display-page #pwaInstallBanner,
.quiz-play-page #lockModal,
.quiz-display-page #lockModal {
  display: none !important;
}

/* Authentication audit */
.auth-log-list {
  display: grid;
  gap: 10px;
}
.auth-log-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid #dc3545;
  border-radius: 16px;
  background: #fff;
}
.auth-log-item.is-success {
  border-left-color: var(--sbs-brand);
}
.auth-log-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #a61e2b;
  background: rgba(220, 53, 69, 0.1);
  font-size: 1.15rem;
}
.auth-log-item.is-success .auth-log-icon {
  color: var(--sbs-brand);
  background: var(--sbs-brand-soft);
}
.auth-log-main {
  min-width: 0;
  flex: 1 1 auto;
}
.auth-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--bs-secondary-color);
  font-size: 0.8rem;
}

/* Student rad ledger */
.student-info-rad-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--sbs-brand-soft), rgba(123, 200, 240, 0.12));
  color: var(--sbs-brand);
}
.student-info-rad-balance strong {
  font-size: 1.35rem;
}
.rad-history-list {
  display: grid;
  gap: 8px;
}
.rad-history-item {
  display: flex;
  align-items: stretch;
  gap: 11px;
  padding: 0 12px 0 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}
.rad-history-avatar {
  display: grid;
  place-items: center;
  align-self: stretch;
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 13px 0 0 13px;
  background: linear-gradient(145deg, var(--sbs-brand), var(--sbs-brand-deep));
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
}
.rad-history-avatar img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  object-fit: cover;
}
.rad-history-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  flex: 0 0 52px;
  padding: 11px 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--sbs-brand);
}
.rad-history-item.is-withdraw .rad-history-amount {
  color: #c6283d;
}
.rad-history-item.is-opening .rad-history-amount {
  color: var(--bs-secondary-color);
}
.rad-history-content {
  min-width: 0;
  flex: 1 1 auto;
  padding: 11px 0;
}
.rad-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}
.rad-history-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--bs-secondary-color);
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 14px;
}
@media (max-width: 576px) {
  .auth-log-item {
    padding: 12px;
  }
  .rad-history-item {
    align-items: stretch;
  }
}

.quiz-display-page #appMain {
  width: 100%;
  max-width: none;
  height: 100dvh;
  overflow: hidden;
  padding: 12px !important;
  background: #5BA8DC !important;
}

.quiz-play-page #appMain {
  padding-top: 18px !important;
}

.quiz-play-page #appMain,
#appMain:has(#quizPlayApp) {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: 18px 12px 12px !important;
  overflow: hidden;
  background: #5BA8DC !important;
}

#appMain:has(#quizPlayApp) .quiz-play-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
}

.quiz-play-wrap .quiz-play-head {
  flex: 0 0 auto;
}

.quiz-play-wrap > .quiz-panel:not(.d-none) {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.quiz-boot-panel {
  overflow: hidden;
}

.quiz-logo-green-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 330px);
  min-height: 164px;
  margin: 0 auto;
  padding: 26px 22px;
  border-radius: 22px;
  background: #5BA8DC;
}

.quiz-logo-green-stage img {
  display: block;
  width: min(100%, 270px);
  height: auto;
  object-fit: contain;
  animation: quizLogoRestore 1.4s ease-in-out infinite;
}

@keyframes quizLogoRestore {
  0%, 100% { opacity: 0.84; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.03); }
}

.quiz-play-head .text-secondary {
  color: rgba(255, 255, 255, 0.78) !important;
}

.quiz-panel {
  border: 1px solid rgba(70, 86, 40, 0.18);
  box-shadow: 0 14px 36px rgba(42, 53, 24, 0.28);
}

.quiz-join-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quiz-scan-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #F2F9FE;
  color: #3A86C0;
  font-size: 0.72rem;
  font-weight: 700;
}

.quiz-scan-live span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7BC8F0;
  box-shadow: 0 0 0 4px rgba(123, 200, 240, 0.15);
}

.quiz-qr-wrap {
  position: relative;
  width: min(100%, 380px);
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 1 / 1;
  margin-right: auto;
  margin-left: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #253016;
}

.quiz-qr-wrap .qr-reader,
.quiz-qr-wrap .qr-reader video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.quiz-scan-processing {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(70, 86, 40, 0.88);
  color: #fff;
  font-weight: 700;
  backdrop-filter: blur(3px);
}

.quiz-team-box {
  border: 1px solid #A79EF8;
  background: #F5FBFF;
}

.quiz-team-name {
  color: #3A86C0;
  font-size: 1.1rem;
  font-weight: 800;
}

.quiz-team-count {
  padding: 4px 8px;
  border-radius: 999px;
  background: #dfe9cb;
  color: #3A86C0;
  font-size: 0.72rem;
  font-weight: 800;
}

.quiz-add-more-hint {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  color: #5BA8DC;
  font-size: 0.84rem;
  font-weight: 700;
}

.quiz-wait-logo {
  position: relative;
  z-index: 2;
  width: min(260px, 78%);
  height: auto;
  max-height: 130px;
  object-fit: contain;
  animation: quizWaitBreath 1.8s ease-in-out infinite;
}

.quiz-wait-animation {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 340px);
  height: 190px;
  margin: 0 auto;
  border-radius: 24px;
  background: #5BA8DC;
}

.quiz-wait-ring {
  position: absolute;
  inset: 16px 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: quizRingTurn 5s linear infinite;
}

.quiz-wait-ring::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 36px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7BC8F0;
  box-shadow: 0 0 0 7px rgba(123, 200, 240, 0.13);
}

.quiz-wait-ring.ring-two {
  inset: 36px 34px;
  border-style: dashed;
  animation-direction: reverse;
  animation-duration: 7s;
}

.quiz-wait-ring.ring-two::after {
  top: auto;
  right: 22px;
  bottom: 4px;
  left: auto;
  width: 9px;
  height: 9px;
  background: #EAF6FD;
}

@keyframes quizRingTurn {
  to { transform: rotate(360deg); }
}

.quiz-wait-spark {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7BC8F0;
  animation: quizSpark 1.7s ease-in-out infinite;
}

.quiz-wait-spark.spark-one { top: 28px; right: 48px; }
.quiz-wait-spark.spark-two { bottom: 32px; left: 42px; animation-delay: -0.8s; }

@keyframes quizSpark {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.5); }
}

.quiz-ready-btn {
  min-height: 52px;
  border-radius: 14px;
  background: #5BA8DC;
  border-color: #5BA8DC;
  font-weight: 850;
}

@keyframes quizWaitBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.quiz-display {
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(70, 86, 40, 0.24);
}

.quiz-display-qr {
  background: #5BA8DC;
}

.quiz-join-qr-card {
  width: var(--quiz-qr-size);
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  cursor: zoom-in;
  flex: 0 0 auto;
}

.quiz-join-qr-copy {
  width: var(--quiz-qr-size);
  max-width: var(--quiz-qr-size);
  text-align: center;
  flex: 0 0 auto;
}

.quiz-join-qr-url {
  margin: 0;
  color: #F5FBFF;
  font-weight: 850;
  font-size: 1.42rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.quiz-join-qr-hint {
  margin: 6px 0 0;
  color: rgba(244, 247, 234, 0.82);
  font-size: 1.08rem;
  line-height: 1.25;
}

.quiz-join-qr-card img {
  display: block;
  width: var(--quiz-qr-size);
  max-width: var(--quiz-qr-size);
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.quiz-join-qr-fallback {
  display: grid;
  place-items: center;
  width: var(--quiz-qr-size);
  aspect-ratio: 1;
  font-weight: 800;
  color: #5BA8DC;
}

.quiz-qr-zoom {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100dvh;
  padding: 16px;
  overflow: hidden;
  background: #5BA8DC;
  cursor: zoom-out;
}

.quiz-qr-zoom.is-open {
  display: grid;
}

.quiz-qr-zoom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  width: min(92vmin, calc(100dvh - 9.5rem));
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  text-align: center;
}

.quiz-qr-zoom-inner .quiz-display-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(42%, 220px);
  max-height: 11vh;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.quiz-qr-zoom-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.quiz-qr-zoom-inner .quiz-join-qr-copy {
  width: 100%;
  max-width: 100%;
}

.quiz-qr-zoom-inner .quiz-join-qr-url {
  margin: 0;
  font-size: clamp(1.15rem, 4.6vmin, 2rem);
  white-space: nowrap;
}

.quiz-qr-zoom-inner .quiz-join-qr-hint {
  font-size: clamp(0.95rem, 3.2vmin, 1.35rem);
}

.quiz-qr-zoom-stack > img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(92vmin, calc(100dvh - 11.5rem));
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.quiz-display-dock {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 12px;
  background: #43584E;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 88px;
}

.quiz-pack-picker {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.quiz-pack-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 168px;
  max-width: 240px;
  padding: 8px 12px 8px 8px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #F5FBFF;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.quiz-pack-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.quiz-pack-card.is-selected {
  background: #fff;
  color: #39503E;
  border-color: #7BC8F0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.quiz-pack-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: rgba(123, 200, 240, 0.28);
  color: #EAF6FD;
  font-size: 1.2rem;
}

.quiz-pack-card.is-selected .quiz-pack-card-icon {
  background: #7BC8F0;
  color: #2269A0;
}

.quiz-pack-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.quiz-pack-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-pack-card-meta {
  font-size: 0.75rem;
  opacity: 0.78;
}

.quiz-pack-empty {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  padding: 0 8px;
}

.quiz-dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.quiz-display-stage > .screen-brand-interlude {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(160, 218, 76, 0.48), transparent 35%),
    linear-gradient(145deg, #6BB3E4, #5BA8DC 52%, #2F78B0);
}

.quiz-display-stage > .screen-brand-interlude.is-visible {
  visibility: visible;
  animation: brandInterludeScene 5s ease both;
}

.quiz-display-stage .brand-interlude-glow,
.quiz-display-stage .brand-interlude-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(90vw, 1120px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.quiz-display-stage .brand-interlude-glow {
  background: radial-gradient(circle, rgba(235, 255, 197, 0.46), rgba(193, 235, 120, 0.1) 42%, transparent 68%);
}

.quiz-display-stage .brand-interlude-rays {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.15) 0deg 8deg,
    transparent 8deg 21deg
  );
  mask-image: radial-gradient(circle, black 0 45%, transparent 72%);
}

.quiz-display-stage > .screen-brand-interlude.is-visible .brand-interlude-glow {
  animation: brandInterludeGlow 5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.quiz-display-stage > .screen-brand-interlude.is-visible .brand-interlude-rays {
  animation: brandInterludeRays 5s linear both;
}

.quiz-display-stage .brand-interlude-logo {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: min(48vw, 720px);
}

.quiz-display-stage .brand-interlude-logo-motion {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  transform-origin: 50% 50%;
}

.quiz-display-stage .brand-interlude-logo-motion::before {
  content: "";
  position: absolute;
  width: 76%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  box-shadow:
    0 0 0 26px rgba(255, 255, 255, 0.045),
    0 0 90px rgba(225, 255, 174, 0.3);
}

.quiz-display-stage .brand-interlude-logo-motion img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 52px rgba(25, 41, 12, 0.35));
}

.quiz-display-stage > .screen-brand-interlude.is-visible .brand-interlude-logo-motion {
  animation: brandInterludeLogo 5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.quiz-display-stage .brand-interlude-particles i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EAF7FE;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.95);
}

.quiz-display-stage .brand-interlude-particles i:nth-child(1) { left: 14%; top: 24%; }
.quiz-display-stage .brand-interlude-particles i:nth-child(2) { left: 24%; top: 77%; }
.quiz-display-stage .brand-interlude-particles i:nth-child(3) { left: 43%; top: 13%; }
.quiz-display-stage .brand-interlude-particles i:nth-child(4) { left: 72%; top: 19%; }
.quiz-display-stage .brand-interlude-particles i:nth-child(5) { left: 84%; top: 68%; }
.quiz-display-stage .brand-interlude-particles i:nth-child(6) { left: 56%; top: 86%; }

.quiz-display-stage > .screen-brand-interlude.is-visible .brand-interlude-particles i {
  animation: brandInterludeParticle 2.2s ease-in-out infinite alternate;
}

@keyframes brandInterludeScene {
  0% { opacity: 0; }
  9%, 88% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes brandInterludeLogo {
  0% { opacity: 0; transform: scale(0.35); filter: blur(12px); }
  18% { opacity: 1; transform: scale(1.04); filter: blur(0); }
  68% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

@keyframes brandInterludeGlow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  22%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes brandInterludeRays {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.65); }
  18%, 76% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(36deg) scale(1.2); }
}

@keyframes brandInterludeParticle {
  to { transform: translateY(-45px) scale(1.8); opacity: 0.18; }
}

.quiz-display-stage {
  overflow: hidden;
  background: #5BA8DC;
}

.quiz-display-stage::before,
.quiz-display-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.quiz-display-stage::before {
  width: 420px;
  height: 420px;
  right: -210px;
  top: -180px;
  border: 72px solid rgba(123, 200, 240, 0.17);
}

.quiz-display-stage::after {
  width: 280px;
  height: 280px;
  left: -150px;
  bottom: -140px;
  border: 54px solid rgba(255, 255, 255, 0.08);
}

.quiz-stage-view {
  position: relative;
  z-index: 1;
}

#viewLobby.quiz-stage-view {
  max-width: none;
  width: 100%;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.quiz-host-field .form-label {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.quiz-pack-select-wrap {
  display: grid;
  grid-template-columns: 30px 1fr 22px;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 14px;
  background: #fff;
  color: #5BA8DC;
  box-shadow: inset 0 0 0 1px rgba(91, 168, 220, 0.18);
}

.quiz-pack-select-wrap > i:first-child {
  font-size: 1.1rem;
}

.quiz-pack-select-wrap > i:last-child {
  pointer-events: none;
}

.quiz-pack-select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: #3079B1;
  font-weight: 750;
  line-height: 1.2;
  padding: 10px 4px;
  cursor: pointer;
}

.quiz-pack-select:focus {
  outline: none;
}

.quiz-display-dock .btn {
  min-height: 42px;
  border-radius: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.quiz-display-dock .btn-primary,
.quiz-display-dock .btn-success {
  background: #7BC8F0;
  border-color: #7BC8F0;
  color: #2269A0;
}

.quiz-display-dock .btn-primary:hover,
.quiz-display-dock .btn-success:hover {
  background: #8AD4F5;
  border-color: #8AD4F5;
}

.quiz-lobby-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.quiz-lobby-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 174px;
  padding: 22px 16px 16px;
  text-align: center;
  background: #F7FCFF;
  color: #3079B1;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(44, 57, 24, 0.2);
  animation: quizTeamArrive 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-ready-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9eddf;
  color: #758061;
  font-size: 0.68rem;
  font-weight: 800;
}

.quiz-ready-badge.is-ready {
  background: #B5AAFF;
  color: #3A86C0;
}

@keyframes quizTeamArrive {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quiz-lobby-team-name {
  margin: 12px 0 2px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.quiz-lobby-count {
  color: #6A7290;
  font-size: 0.78rem;
  font-weight: 650;
}

.quiz-avatar-stack {
  display: flex;
  justify-content: center;
  min-height: 52px;
  padding-left: 12px;
}

.quiz-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-left: -12px;
  overflow: hidden;
  border: 3px solid #F7FCFF;
  border-radius: 50%;
  background: #dce7c7;
  color: #3A86C0;
  font-weight: 900;
  box-shadow: 0 3px 9px rgba(70, 86, 40, 0.2);
}

.quiz-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quiz-avatar.is-large {
  width: 68px;
  height: 68px;
  border-width: 4px;
}

.quiz-avatar-stack.is-large {
  min-height: 68px;
}

.quiz-display-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border: 5px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: #3A86C0;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.quiz-display-timer.is-ending {
  background: #7BC8F0;
  color: #2269A0;
  animation: quizTimerBeat 700ms ease-in-out infinite;
}

@keyframes quizTimerBeat {
  50% { transform: scale(1.09); }
}

.quiz-display-answer {
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 14px rgba(43, 55, 23, 0.16);
}

.quiz-display-answer.is-correct {
  box-shadow: 0 0 0 5px #fff, 0 14px 38px rgba(34, 46, 17, 0.35);
  animation: quizCorrectReveal 540ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes quizCorrectReveal {
  from { opacity: 0; transform: scale(0.72) rotate(-2deg); }
  to { opacity: 1; transform: scale(1.04) rotate(0); }
}

.quiz-leaderboard .quiz-leader-row {
  background: #F7FCFF;
  color: #3079B1;
}

.quiz-leaderboard .quiz-leader-row.is-top {
  background: #e0ebcb;
  border: 1px solid #A09DF0;
}

.quiz-final-kicker {
  margin-bottom: 4px;
  color: #E8F6FD;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quiz-final-title {
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
}

.quiz-podium {
  align-items: flex-end;
  gap: 10px;
  min-height: 430px;
  margin: 0 auto;
  padding-top: 72px;
  flex-wrap: nowrap;
}

.quiz-podium-place {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  min-width: 0;
  max-width: 280px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  animation: quizPodiumRise 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.quiz-podium-place.place-1 { order: 2; animation-delay: 1500ms; }
.quiz-podium-place.place-2 { order: 1; animation-delay: 750ms; }
.quiz-podium-place.place-3 { order: 3; animation-delay: 0ms; }

@keyframes quizPodiumRise {
  from { opacity: 0; transform: translateY(150px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-podium-avatars {
  margin-bottom: 10px;
}

.quiz-podium-team {
  max-width: 100%;
  min-height: 28px;
  margin-bottom: 4px;
  overflow: hidden;
  color: #fff;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-podium-score {
  margin-bottom: 10px;
  color: #E8F6FD;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
}

.quiz-podium-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding-top: 18px;
  border-radius: 18px 18px 0 0;
  background: #f3f7eb;
  color: #3A86C0;
  box-shadow: 0 -8px 26px rgba(31, 42, 14, 0.2);
}

.quiz-podium-block span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #5BA8DC;
  color: #fff;
  font-size: 2rem;
  font-weight: 950;
}

.place-1 .quiz-podium-block { height: 240px; background: #ECF7FD; }
.place-2 .quiz-podium-block { height: 180px; background: #F7FCFF; }
.place-3 .quiz-podium-block { height: 132px; background: #EAF6FD; }
.place-1 .quiz-podium-block span { background: #7BC8F0; color: #256A9E; }

.quiz-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-confetti i {
  position: absolute;
  top: -12%;
  width: 13px;
  height: 24px;
  background: #7BC8F0;
  animation: quizConfettiFall 3.2s linear infinite;
}

.quiz-confetti i:nth-child(2n) { background: #dfeacb; }
.quiz-confetti i:nth-child(3n) { background: #3A86C0; }
.quiz-confetti i:nth-child(1) { left: 8%; animation-delay: -0.4s; }
.quiz-confetti i:nth-child(2) { left: 20%; animation-delay: -1.7s; }
.quiz-confetti i:nth-child(3) { left: 34%; animation-delay: -0.9s; }
.quiz-confetti i:nth-child(4) { left: 48%; animation-delay: -2.4s; }
.quiz-confetti i:nth-child(5) { left: 61%; animation-delay: -1.2s; }
.quiz-confetti i:nth-child(6) { left: 74%; animation-delay: -2.8s; }
.quiz-confetti i:nth-child(7) { left: 86%; animation-delay: -0.2s; }
.quiz-confetti i:nth-child(8) { left: 95%; animation-delay: -2s; }

@keyframes quizConfettiFall {
  from { transform: translateY(-10vh) rotate(0); }
  to { transform: translateY(115vh) rotate(720deg); }
}

.quiz-phone-final {
  position: relative;
  overflow: hidden;
  background: #3A86C0;
  color: #fff;
}

.quiz-phone-final .quiz-panel-inner {
  position: relative;
  z-index: 1;
  padding: 28px 12px 0;
}

.quiz-phone-final .quiz-final-kicker {
  color: #D9EDF9;
  font-size: 0.7rem;
}

.quiz-phone-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 330px;
  padding-top: 78px;
}

.quiz-phone-place {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  min-width: 0;
  max-width: 150px;
  animation: quizPhoneRunIn 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.quiz-phone-place.place-1 { order: 2; animation-delay: 1500ms; }
.quiz-phone-place.place-2 { order: 1; animation-delay: 750ms; }
.quiz-phone-place.place-3 { order: 3; animation-delay: 0ms; }

@keyframes quizPhoneRunIn {
  0% { opacity: 0; transform: translateY(120px) scale(0.65); }
  70% { opacity: 1; transform: translateY(-8px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.quiz-phone-avatar-stack {
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding-left: 10px;
  margin-bottom: 7px;
}

.quiz-phone-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-left: -10px;
  overflow: hidden;
  border: 3px solid #F5FBFF;
  border-radius: 50%;
  background: #EAF6FD;
  color: #3A86C0;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(20, 28, 10, 0.28);
}

.quiz-phone-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quiz-phone-team {
  width: 100%;
  min-height: 34px;
  padding: 0 5px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.quiz-phone-score {
  margin: 3px 0 7px;
  color: #E8F6FD;
  font-size: 0.72rem;
  font-weight: 800;
}

.quiz-phone-block {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: 12px;
  border-radius: 13px 13px 0 0;
  background: #F5FBFF;
}

.quiz-phone-block span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5BA8DC;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 950;
}

.quiz-phone-place.place-1 .quiz-phone-block {
  height: 168px;
  background: #F1F9FE;
}

.quiz-phone-place.place-2 .quiz-phone-block {
  height: 122px;
}

.quiz-phone-place.place-3 .quiz-phone-block {
  height: 88px;
  background: #EAF6FD;
}

.quiz-phone-place.place-1 .quiz-phone-block span {
  background: #7BC8F0;
  color: #256A9E;
}

.quiz-phone-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-phone-confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 18px;
  background: #7BC8F0;
  animation: quizConfettiFall 2.8s linear infinite;
}

.quiz-phone-confetti i:nth-child(2n) { background: #EAF6FD; }
.quiz-phone-confetti i:nth-child(1) { left: 8%; animation-delay: -0.3s; }
.quiz-phone-confetti i:nth-child(2) { left: 24%; animation-delay: -1.6s; }
.quiz-phone-confetti i:nth-child(3) { left: 42%; animation-delay: -0.8s; }
.quiz-phone-confetti i:nth-child(4) { left: 61%; animation-delay: -2.1s; }
.quiz-phone-confetti i:nth-child(5) { left: 78%; animation-delay: -1.2s; }
.quiz-phone-confetti i:nth-child(6) { left: 93%; animation-delay: -2.5s; }

@media (max-width: 760px) {
  .quiz-display {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    min-height: 0;
  }

  .quiz-display-dock {
    flex-wrap: wrap;
    min-height: 0;
  }

  .quiz-dock-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .quiz-podium {
    min-height: 330px;
    padding-top: 48px;
  }

  .quiz-avatar.is-large {
    width: 48px;
    height: 48px;
  }

  .place-1 .quiz-podium-block { height: 180px; }
  .place-2 .quiz-podium-block { height: 135px; }
  .place-3 .quiz-podium-block { height: 105px; }
}

.student-view-card {
  border-radius: 1.25rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.student-view-card:hover {
  transform: translateY(-2px);
}

.student-view-rads {
  min-width: 4.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 1rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(145deg, #5BA8DC, #4A96CE);
}

.student-view-rads strong,
.student-view-rads span {
  display: block;
  line-height: 1;
}

.student-view-rads strong {
  font-size: 1.45rem;
}

.student-view-rads span {
  margin-top: 0.22rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.82;
}

.student-view-card summary {
  color: var(--bs-primary);
  cursor: pointer;
}

a.staff-action-btn {
  text-decoration: none;
}

.attendance-day-btn.active,
.attendance-day-btn.active:hover,
.attendance-day-btn.active:focus {
  background: var(--sbs-brand);
  border-color: var(--sbs-brand);
  color: #fff;
}

.attendance-mark {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  color: #fff;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.attendance-mark.is-present {
  background: var(--sbs-accent);
  box-shadow: 0 8px 18px rgba(123, 200, 240, 0.28);
}

.attendance-mark.is-absent {
  background: #a03c32;
  box-shadow: 0 8px 18px rgba(160, 60, 50, 0.28);
}

.attendance-mark.is-saving {
  transform: scale(0.86);
}

.attendance-mark.is-saved {
  animation: attendance-pop 280ms ease;
}

@keyframes attendance-pop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

#staffRadAttendanceWarnModal {
  z-index: 1065;
}

.pin-recovery {
  text-align: left;
  background: #fff8e8;
  border: 1px solid rgba(154, 107, 18, 0.28);
  border-radius: 16px;
  padding: 16px;
}

.pin-recovery-hint {
  font-weight: 650;
  color: #6d4c0d;
  line-height: 1.35;
}

.avatar:has(img:not(.d-none)[src]),
.avatar-preview:has(img:not(.d-none)[src]),
.rad-history-avatar:has(img[src]),
.qr-result-avatar:has(img:not(.d-none)[src]),
.quiz-avatar:has(img[src]),
.quiz-phone-avatar:has(img[src]) {
  cursor: zoom-in;
}

.avatar-zoom {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 64px 20px 24px;
  background: rgba(18, 22, 14, 0.82);
  backdrop-filter: blur(8px);
}

.avatar-zoom.is-open {
  display: grid;
}

.avatar-zoom-photo {
  width: min(86vw, 86vh, 440px);
  height: min(86vw, 86vh, 440px);
  object-fit: cover;
  border-radius: 32px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  background: #1c2414;
  animation: avatar-zoom-in 180ms ease-out;
}

.avatar-zoom-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #2b331f;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.avatar-zoom-close:active {
  transform: scale(0.94);
}

@keyframes avatar-zoom-in {
  from { transform: scale(0.86); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

.verse-troop-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.verse-troop-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: #F7FCFF;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.verse-troop-pick:has(input:checked) {
  background: #e8f2c8;
  border-color: #5BA8DC;
}
.verse-troop-pick input {
  margin: 0;
}

.origin-survey-card {
  background: #fff;
}

.origin-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.origin-tally-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #F2F9FE;
  color: var(--sbs-brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.origin-tally-chip.is-empty {
  background: #f4f1ea;
  color: #7A93A8;
  font-weight: 600;
}

.origin-stage {
  position: relative;
  min-height: 280px;
}

.origin-load {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  border-radius: 22px;
}

.origin-load-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 236, 170, 0.35), transparent 42%),
    linear-gradient(145deg, #5BA8DC, #5BA8DC 55%, #3D5649);
  opacity: 0.94;
}

.origin-load-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
}

.origin-load-card img {
  width: min(168px, 42vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.22));
  animation: originLogoPulse 720ms cubic-bezier(0.18, 0.84, 0.22, 1) 1 both;
}

.origin-load-text {
  color: #fff8dc;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

@keyframes originLogoPulse {
  0% { transform: scale(0.82); opacity: 0; }
  55% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.origin-kids {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.origin-kid {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(91, 168, 220, 0.18);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  color: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.origin-kid:hover,
.origin-kid:focus-visible {
  border-color: var(--sbs-brand);
  box-shadow: 0 10px 24px rgba(45, 62, 20, 0.08);
  outline: none;
}

.origin-kid.is-selected {
  border-color: var(--sbs-brand);
  box-shadow: 0 0 0 3px rgba(91, 168, 220, 0.18);
  background: #f4f8ea;
}

.origin-kid.is-marked .origin-kid-meta {
  color: var(--sbs-brand);
  font-weight: 700;
}

.origin-kid-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.origin-kid-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.origin-kid-meta {
  font-size: 13px;
  color: #7A93A8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.origin-answers {
  overflow: hidden;
}

.origin-answers-head {
  margin-bottom: 14px;
}

.origin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.origin-chip {
  border: 1px solid rgba(91, 168, 220, 0.22);
  background: #F7FCFF;
  color: var(--sbs-brand-deep);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 14px;
}

.origin-chip:hover,
.origin-chip:focus-visible {
  border-color: var(--sbs-brand);
  background: #F2F9FE;
  outline: none;
}

.origin-chip.is-selected {
  background: var(--sbs-brand);
  border-color: var(--sbs-brand);
  color: #fff;
}

.origin-custom .form-control {
  min-width: min(100%, 260px);
  flex: 1;
}

.origin-stage.is-loading .origin-kids,
.origin-stage.is-loading .origin-answers {
  filter: saturate(0.85);
}

.unenroll-hub-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(237, 198, 98, 0.28), transparent 42%),
    linear-gradient(180deg, #fffdf6, #fff);
}
.unenroll-page {
  max-width: 1180px;
}
.unenroll-top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.unenroll-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #9a7a2a;
}
.unenroll-title {
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.35rem;
}
.unenroll-lead {
  max-width: 46rem;
  color: #5c634c;
  margin: 0;
}
.unenroll-top-side {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.unenroll-stat {
  min-width: 7.5rem;
  padding: 0.7rem 0.95rem;
  border-radius: 1rem;
  background: #F5FBFF;
  border: 1px solid rgba(91, 168, 220, 0.12);
}
.unenroll-stat.is-archive {
  background: #fbf6e8;
  border-color: rgba(168, 132, 42, 0.18);
}
.unenroll-stat-n {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  color: var(--sbs-brand-deep);
}
.unenroll-stat-l {
  font-size: 0.78rem;
  color: #7A93A8;
}
.unenroll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .unenroll-grid { grid-template-columns: 1fr; }
}
.unenroll-reader {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  aspect-ratio: 4 / 3;
  background: #1b2412;
}
.unenroll-reader video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.unenroll-manual { margin-top: 1rem; }
.unenroll-hint {
  min-height: 1.4em;
  margin-top: 0.7rem;
  font-weight: 700;
}
.unenroll-hint.is-ok { color: var(--sbs-brand-deep); }
.unenroll-hint.is-warn { color: #8a6a18; }
.unenroll-hint.is-err { color: #a33b3b; }
.unenroll-queue .card-body { min-height: 100%; }
.unenroll-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  max-height: 52vh;
  overflow: auto;
}
.unenroll-empty {
  text-align: center;
  color: #7a816c;
  padding: 2.2rem 1rem;
}
.unenroll-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--sbs-brand);
}
.unenroll-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 1rem;
  background: #F7FCFF;
  border: 1px solid rgba(91, 168, 220, 0.1);
}
.unenroll-chip.is-pulse {
  animation: unenrollPulse 0.55s ease;
}
@keyframes unenrollPulse {
  50% { transform: scale(1.02); background: #edf6d8; }
}
.unenroll-chip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sbs-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: none;
}
.unenroll-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.unenroll-chip-body { flex: 1; min-width: 0; }
.unenroll-chip-name { font-weight: 800; }
.unenroll-chip-meta { font-size: 0.82rem; color: #7A93A8; }
.unenroll-commit { margin-top: 1rem; }
.unenroll-archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
}
.unenroll-archive-row {
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  background: #fbf6e8;
  border: 1px solid rgba(168, 132, 42, 0.14);
}
.unenroll-archive-row.is-new {
  animation: qrVersePromoIn 420ms ease both;
}
.unenroll-confirm {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(24, 36, 12, 0.45);
}
.unenroll-confirm[hidden] { display: none; }
.unenroll-confirm-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 1.4rem;
  padding: 1.6rem 1.4rem 1.35rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(24, 36, 12, 0.28);
}
.unenroll-confirm-title {
  font-weight: 900;
  margin: 0.2rem 0 0.55rem;
}


