/* FINAL V25 — consolidated fixes. One stylesheet, same cascade, less request/parse churn. */

/* --- merged: v11-fixes-FINAL-V11-20260828-1021.css --- */
/* FINAL V9 — iPhone viewport, one physical-left close rule, frame live workspace */
:root {
  --v9-safe-top: env(safe-area-inset-top, 0px);
  --v9-safe-bottom: env(safe-area-inset-bottom, 0px);
  --v9-visual-height: 100dvh;
}

html, body, #root {
  width: 100%;
  min-height: 100%;
  min-height: 100svh;
  min-height: var(--v9-visual-height, 100dvh);
  max-width: 100%;
}
html {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: calc(4.75rem + var(--v9-safe-top));
  scroll-padding-bottom: calc(7.5rem + var(--v9-safe-bottom));
}
body, #root {
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}
body { overscroll-behavior-y: auto !important; }

@supports (-webkit-touch-callout: none) {
  html, body, #root { min-height: -webkit-fill-available; }
}

/* iPhone/PWA: content begins BELOW the status/notch area instead of touching it.
   safe-area is additive so Safari browser mode also keeps a small comfortable gap. */
@media (max-width: 1023px) {
  .admin-mobile-header {
    padding-top: calc(var(--v9-safe-top) + .8rem) !important;
    padding-bottom: .75rem !important;
    min-height: calc(4rem + var(--v9-safe-top)) !important;
  }
  .admin-mobile-main {
    min-height: calc(var(--v9-visual-height, 100dvh) - 4rem) !important;
    padding-top: 1.35rem !important;
    padding-bottom: calc(4.25rem + var(--v9-safe-bottom)) !important;
    overflow: visible !important;
  }
  .admin-mobile-scroll {
    height: var(--v9-visual-height, 100dvh) !important;
    max-height: var(--v9-visual-height, 100dvh) !important;
    padding-top: calc(var(--v9-safe-top) + 1rem) !important;
    padding-bottom: calc(3rem + var(--v9-safe-bottom)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .participant-safe-shell {
    min-height: var(--v9-visual-height, 100dvh) !important;
    padding-top: calc(var(--v9-safe-top) + .85rem) !important;
    padding-bottom: calc(7.5rem + var(--v9-safe-bottom)) !important;
    overflow: visible !important;
  }
  .participant-bottom-nav {
    bottom: 0 !important;
    padding-bottom: max(.8rem, var(--v9-safe-bottom)) !important;
  }
  input, textarea, select, button, [tabindex] {
    scroll-margin-top: calc(5.5rem + var(--v9-safe-top));
    scroll-margin-bottom: calc(7.5rem + var(--v9-safe-bottom));
  }
}

/* Every popup / sheet / drawer close button sits on the PHYSICAL LEFT,
   opposite Arabic headings. Inline logical/right positioning is neutralized. */
.ui-close-button,
[data-ui-close="true"],
.v9-close-button {
  position: absolute !important;
  inset: auto !important;
  left: .85rem !important;
  right: auto !important;
  inset-inline-start: auto !important;
  inset-inline-end: auto !important;
  top: .85rem !important;
  margin: 0 !important;
  transform: none !important;
  direction: ltr !important;
  z-index: 2147483000 !important;
}
[role="dialog"] > h2:first-child,
[role="dialog"] [data-radix-dialog-title],
[data-vaul-drawer] h2:first-child,
[data-radix-dialog-content] h2:first-child {
  padding-left: 3.4rem !important;
  padding-right: 0 !important;
}
/* Full-screen mobile sheets own the safe-area too, so their X is never under the notch. */
@media (max-width: 1023px) and (display-mode: standalone) {
  .admin-mobile-scroll .ui-close-button,
  .admin-mobile-scroll [data-ui-close="true"],
  .admin-mobile-scroll .v9-close-button {
    top: calc(var(--v9-safe-top) + .7rem) !important;
  }
}

/* Admin frame editor: preview is sticky on one side, ALL controls stay beside it.
   This removes the up/down loop while positioning elements. */
@media (min-width: 1100px) {
  .event-frame-editor {
    display: grid !important;
    grid-template-columns: minmax(350px, 520px) minmax(430px, 1fr) !important;
    align-items: start !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 1260px !important;
    margin-inline: auto !important;
  }
  .event-frame-editor > .frame-preview-column {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: sticky !important;
    top: 1rem !important;
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 !important;
    align-self: start !important;
  }
  .event-frame-editor > .frame-preview-column > .glass { max-width: 500px !important; }
  .event-frame-editor > :not(.frame-preview-column) {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .event-frame-editor > .grid {
    grid-template-columns: 1fr !important;
    align-content: start !important;
  }
}

/* Member frame editor gets a live preview beside controls on tablets/desktops. */
@media (min-width: 900px) {
  .v9-user-frame-layout {
    display: grid !important;
    grid-template-columns: minmax(330px, 500px) minmax(360px, 1fr) !important;
    gap: 1rem !important;
    align-items: start !important;
    max-width: 1040px !important;
    margin-inline: auto !important;
  }
  .v9-user-frame-layout > header { grid-column: 1 / -1 !important; }
  .v9-user-frame-preview {
    grid-column: 1 !important;
    grid-row: 2 / span 4 !important;
    position: sticky !important;
    top: 1rem !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 !important;
  }
  .v9-user-frame-controls,
  .v9-user-frame-actions,
  .v9-user-frame-note { grid-column: 2 !important; }
}

/* Never show technical resolution/watermark text inside the visual frame. */
[data-frame-width] .v9-hide-frame-label { display: none !important; }
.v9-hide-frame-label { display: none !important; }

/* Audit Excel export for whichever category/search is currently displayed. */
.v9-audit-export {
  min-height: 2.75rem;
  width: fit-content;
  border-radius: .85rem;
  padding-inline: 1rem;
  border: 1px solid color-mix(in oklab, var(--color-primary) 45%, transparent);
  background: color-mix(in oklab, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 800;
  font-size: .8rem;
  cursor: pointer;
}
.v9-audit-export:hover { background: color-mix(in oklab, var(--color-primary) 18%, transparent); }

/* FINAL V10 — searchable notification recipient */
.recipient-search-v10{position:relative;width:100%;z-index:35}
.recipient-search-v10__row{position:relative;display:flex;align-items:center;width:100%}
.recipient-search-v10__input{width:100%;height:48px;border:1px solid hsl(var(--input));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));padding:0 42px 0 42px;font-size:14px;font-weight:700;outline:none;transition:border-color .15s ease,box-shadow .15s ease}
.recipient-search-v10__input::placeholder{color:hsl(var(--muted-foreground));font-weight:500}
.recipient-search-v10__input:focus{border-color:rgba(239,68,68,.75);box-shadow:0 0 0 3px rgba(239,68,68,.12)}
.recipient-search-v10__icon{position:absolute;right:15px;z-index:2;color:hsl(var(--muted-foreground));pointer-events:none;font-size:14px}
.recipient-search-v10__clear{position:absolute;left:8px;width:32px;height:32px;border:0;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));display:grid;place-items:center;cursor:pointer}
.recipient-search-v10__clear:hover{background:rgba(255,255,255,.06);color:hsl(var(--foreground))}
.recipient-search-v10__results{position:absolute;inset-inline:0;top:calc(100% + 7px);max-height:310px;overflow:auto;padding:6px;border:1px solid rgba(148,163,184,.22);border-radius:14px;background:#0b1018;box-shadow:0 20px 55px rgba(0,0,0,.48);z-index:9999;overscroll-behavior:contain}
.recipient-search-v10__item{width:100%;border:0;background:transparent;color:#f8fafc;border-radius:10px;padding:10px 11px;display:flex;align-items:center;gap:10px;text-align:right;cursor:pointer;font-family:inherit}
.recipient-search-v10__item:hover,.recipient-search-v10__item:focus-visible{background:rgba(239,68,68,.12);outline:none}
.recipient-search-v10__item>span:last-child{display:flex;flex-direction:column;min-width:0;line-height:1.35}
.recipient-search-v10__item strong{font-size:13px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recipient-search-v10__item small{font-size:12px;color:#cbd5e1;direction:ltr;text-align:right;margin-top:2px}
.recipient-search-v10__avatar,.recipient-search-v10__all-icon{flex:0 0 34px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:rgba(239,68,68,.15);color:#ff3535;font-weight:900}
.recipient-search-v10__item.is-all{border-bottom:1px solid rgba(148,163,184,.13);border-radius:10px 10px 6px 6px;margin-bottom:4px}
.recipient-search-v10__item.is-all small{direction:rtl;text-align:right}
.recipient-search-v10__empty{padding:18px 12px;text-align:center;color:#94a3b8;font-size:12px}
.recipient-search-v10__native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media (max-width:640px){
  .recipient-search-v10__results{max-height:min(330px,48vh)}
  .recipient-search-v10__input{font-size:16px} /* prevent iOS input zoom */
  .recipient-search-v10__item{padding:12px 10px}
}

/* FINAL V11 — hard stop for any accidental duplicated admin shell/page. */
[data-admin-duplicate-shell="true"],
[data-admin-duplicate-page="true"] { display: none !important; }

/* Gate lists are intentionally collapsible and searchable. */
main.admin-mobile-main details > summary::-webkit-details-marker { display: none; }
main.admin-mobile-main details > summary { user-select: none; }

/* Participant frame is display-only; never expose drag affordances. */
.participant-shell .pointer-events-none [data-frame-width] { cursor: default !important; }

/* --- merged: v12-fixes-FINAL-V12-20260830-2240.css --- */
/* FINAL V12 operational fixes */
[data-v12-duplicate-shell="1"],[data-v12-duplicate-page="1"]{display:none!important}
.v12-close{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;border-radius:12px!important;display:grid!important;place-items:center!important;pointer-events:auto!important}
.v12-member-frame-preview{pointer-events:none!important;user-select:none!important;touch-action:pan-y!important}
.v12-member-frame-page .v9-user-frame-controls,.v12-member-frame-page .v9-user-frame-actions,.v12-member-frame-page .v9-user-frame-note{display:none!important}
.v12-frame-admin-note{display:flex;align-items:flex-start;gap:12px;margin:0 auto 14px;max-width:760px;border:1px solid rgba(239,68,68,.3);background:rgba(127,29,29,.12);border-radius:18px;padding:13px 15px;color:#fff}
.v12-frame-admin-note>i{margin-top:3px;color:#ef4444}.v12-frame-admin-note strong{display:block;font-size:13px}.v12-frame-admin-note span{display:block;margin-top:4px;font-size:11px;line-height:1.7;color:#a1a1aa}
#participant-real-qr.v12-big-qr,.v12-big-qr{width:min(78vw,440px)!important;height:min(78vw,440px)!important;max-width:440px!important;max-height:440px!important;image-rendering:auto}
@media(max-width:600px){#participant-real-qr.v12-big-qr,.v12-big-qr{width:min(88vw,390px)!important;height:min(88vw,390px)!important}}
.v12-member-sort-note{display:inline-flex;align-items:center;gap:7px;margin:0 0 10px;padding:8px 11px;border-radius:12px;border:1px solid rgba(239,68,68,.22);background:rgba(239,68,68,.07);font-size:11px;font-weight:700;color:#d4d4d8}
.v12-vio-count{display:inline-flex;border:1px solid rgba(239,68,68,.4);background:rgba(239,68,68,.1);color:#f87171;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900}.v12-round-count{font-weight:900;font-variant-numeric:tabular-nums}.v12-zero{color:#71717a}
.v12-clickable-violation{cursor:pointer!important;transition:border-color .15s ease,background .15s ease}.v12-clickable-violation:hover{border-color:rgba(239,68,68,.45)!important;background:rgba(239,68,68,.045)!important}
.v12-quick-violation{position:relative;overflow:visible!important}.v12-qv-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:16px}.v12-qv-head h3{font-size:16px;font-weight:900}.v12-qv-head p{margin-top:4px;color:#a1a1aa;font-size:11px;line-height:1.8}.v12-qv-head>i{color:#ef4444;font-size:22px}.v12-qv-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.v12-qv-grid label{display:grid;gap:6px;font-size:11px;font-weight:800;color:#d4d4d8}.v12-qv-grid input,.v12-qv-grid select,.v12-qv-grid textarea{width:100%;border:1px solid #27272a;background:#09090b;color:#fff;border-radius:12px;padding:10px 12px;outline:none}.v12-qv-grid input,.v12-qv-grid select{height:44px}.v12-qv-grid input:focus,.v12-qv-grid select:focus,.v12-qv-grid textarea:focus{border-color:#ef4444}.v12-span2{grid-column:1/-1}.v12-qv-results{display:grid;gap:6px;margin-top:8px}.v12-qv-result{text-align:right;border:1px solid #27272a;background:#121217;border-radius:12px;padding:9px 11px;color:#fff}.v12-qv-result strong{display:block;font-size:12px}.v12-qv-result span{display:block;margin-top:2px;color:#a1a1aa;font-size:10px}.v12-qv-save{display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:14px;height:44px;border-radius:12px;background:#ef1d25;color:#fff;padding:0 18px;font-weight:900;font-size:12px}.v12-qv-save:disabled{opacity:.6}
.v12-event-export{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.v12-event-export button{display:inline-flex;align-items:center;gap:7px;height:40px;border:1px solid #3f3f46;background:#111116;color:#fff;border-radius:12px;padding:0 13px;font-size:11px;font-weight:900}.v12-event-export button:hover{border-color:#ef4444;color:#f87171}.v12-event-export button:disabled{opacity:.55}
.v12-current-dot{display:inline-block;width:8px;height:8px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12);margin-left:7px}.v12-important-instructions{border-color:rgba(239,68,68,.22)!important}.v12-event-ongoing{outline:1px solid rgba(34,197,94,.24);outline-offset:-1px}.v12-camera-action{min-height:48px!important;touch-action:manipulation!important}
@media(max-width:640px){.v12-qv-grid{grid-template-columns:1fr}.v12-span2{grid-column:auto}.v12-event-export{width:100%}.v12-event-export button{flex:1 1 100%}}
.v12-open-member{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:36px!important;border:1px solid rgba(239,68,68,.35)!important;background:rgba(239,68,68,.08)!important;color:#f87171!important;border-radius:10px!important;padding:0 10px!important;font-size:11px!important;font-weight:900!important;text-decoration:none!important}
.v12-current-event-badge{display:inline-flex;align-items:center;gap:6px;width:max-content;margin:10px 10px 0;border:1px solid rgba(34,197,94,.35);background:rgba(34,197,94,.1);color:#4ade80;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:900}
.v12-member-frame-page.v9-user-frame-layout{display:block!important;max-width:780px!important;margin-inline:auto!important}
.v12-member-frame-page .v9-user-frame-preview{position:static!important;width:min(100%,560px)!important;max-width:560px!important;margin:0 auto!important}

/* --- merged: v14-fixes-FINAL-V14-20260831-0220.css --- */
/* FINAL V14 — upload preview + professional camera layout */

/* Registration uploads: every preview owns a fixed box and never pushes/overlaps the form. */
body.v14-register-route .v14-file-thumb{
  display:block!important;
  width:72px!important;
  height:72px!important;
  min-width:72px!important;
  min-height:72px!important;
  max-width:72px!important;
  max-height:72px!important;
  flex:0 0 72px!important;
  overflow:hidden!important;
  border-radius:14px!important;
  position:relative!important;
}
body.v14-register-route .v14-file-thumb img,
body.v14-register-route img[alt="معاينة الملف"]{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
}
body.v14-register-route .v14-upload-gallery{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,72px)!important;
  gap:10px!important;
  justify-content:start!important;
  align-items:start!important;
  min-height:0!important;
  overflow:visible!important;
}
body.v14-register-route .v14-upload-cell{
  position:relative!important;
  width:72px!important;
  height:72px!important;
  min-width:72px!important;
  min-height:72px!important;
  max-width:72px!important;
  max-height:72px!important;
  overflow:visible!important;
}
body.v14-register-route .v14-upload-cell > .v14-file-thumb{
  width:72px!important;
  height:72px!important;
}
body.v14-register-route label:has(.v14-file-thumb){
  min-height:104px!important;
  overflow:hidden!important;
  align-items:center!important;
}
@media (max-width:640px){
  body.v14-register-route .v14-file-thumb,
  body.v14-register-route .v14-upload-cell,
  body.v14-register-route .v14-upload-cell > .v14-file-thumb{
    width:68px!important;height:68px!important;min-width:68px!important;min-height:68px!important;max-width:68px!important;max-height:68px!important;flex-basis:68px!important;
  }
  body.v14-register-route .v14-upload-gallery{grid-template-columns:repeat(auto-fill,68px)!important;gap:9px!important}
}

/* Admin registration instructions: clearer clickable section + direct preview link. */
.v14-registration-instructions > summary{
  min-height:76px!important;
  position:relative!important;
}
.v14-registration-preview-link{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  min-height:38px!important;
  padding:0 13px!important;
  border:1px solid rgba(239,29,37,.45)!important;
  border-radius:12px!important;
  background:rgba(239,29,37,.10)!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  text-decoration:none!important;
}
.v14-registration-preview-link:hover{background:rgba(239,29,37,.18)!important;border-color:rgba(239,29,37,.75)!important}

/* Camera pages: all controls/info are normal-flow ABOVE the camera, never on top of it. */
body.v14-camera-route .mobile-scanner-box{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
}
body.v14-camera-route .v14-camera-card{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  overflow:visible!important;
}
body.v14-camera-route .v14-camera-tools-toggle{
  order:-30!important;
  width:100%!important;
  min-height:48px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:10px 14px!important;
  border:1px solid rgba(239,29,37,.32)!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,rgba(239,29,37,.10),rgba(239,29,37,.04))!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:900!important;
  cursor:pointer!important;
}
body.v14-camera-route .v14-camera-tools-toggle .v14-chevron{transition:transform .18s ease!important}
body.v14-camera-route .v14-camera-card.v14-tools-collapsed .v14-camera-tools-toggle .v14-chevron{transform:rotate(180deg)!important}
body.v14-camera-route .v14-before-camera{order:0!important}
body.v14-camera-route .v14-camera-card.v14-tools-collapsed .v14-before-camera:not(.v14-camera-tools-toggle){display:none!important}
body.v14-camera-route .scanner-viewport{
  order:100!important;
  margin-top:2px!important;
  isolation:isolate!important;
  overflow:hidden!important;
}
/* The old compact scan card covered the live video. V14 uses the full result panel above instead. */
body.v14-camera-route .scanner-viewport > .pointer-events-auto.absolute{
  display:none!important;
}

/* Full scan result/action appears above the camera as an admin-controlled dropdown. */
body.v14-camera-route .v14-camera-result-toggle{
  order:-20!important;
  width:100%!important;
  min-height:50px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:11px 14px!important;
  border:1px solid rgba(34,197,94,.34)!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,rgba(34,197,94,.10),rgba(34,197,94,.04))!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:900!important;
  cursor:pointer!important;
}
body.v14-camera-route .v14-camera-result-toggle .v14-chevron{transition:transform .18s ease!important}
body.v14-camera-route .v14-camera-result-toggle[aria-expanded="false"] .v14-chevron{transform:rotate(180deg)!important}
body.v14-camera-route .v14-camera-result{
  order:-19!important;
  width:100%!important;
  margin:0!important;
  position:relative!important;
  z-index:2!important;
}
body.v14-camera-route .v14-camera-result.v14-result-collapsed{display:none!important}
body.v14-camera-route .v14-camera-result > *{max-width:100%!important}

/* Keep all generated messages/toolbars above the viewport and prevent accidental overlap. */
body.v14-camera-route .v14-camera-card > :not(.scanner-viewport){position:relative!important;z-index:3!important}
body.v14-camera-route .v14-camera-card .scanner-viewport{z-index:1!important}

@media (max-width:640px){
  body.v14-camera-route .v14-camera-card{padding:12px!important}
  body.v14-camera-route .v14-camera-tools-toggle,
  body.v14-camera-route .v14-camera-result-toggle{border-radius:14px!important;min-height:48px!important}
  body.v14-camera-route .scanner-viewport{width:min(100%,420px)!important}
  .v14-registration-preview-link{padding:0 10px!important;font-size:10px!important}
}

/* --- merged: v16-fixes-FINAL-V16-20260831-0935.css --- */
/* FINAL V16 — stable SPA + responsive member frame */

/* No delayed page-shape animations on operational pages. Route changes stay SPA-native. */
body.v16-stable-ui main.admin-mobile-main,
body.v16-stable-ui .participant-shell main {
  animation: none !important;
  transition: none !important;
}

/* The member sees the exact admin canvas proportions. Nothing is cropped by the preview wrapper. */
body.v16-member-frame-route .v12-member-frame-page.v9-user-frame-layout {
  display: block !important;
  width: 100% !important;
  max-width: 720px !important;
  margin-inline: auto !important;
}
body.v16-member-frame-route .v9-user-frame-preview,
body.v16-member-frame-route .v12-member-frame-page .v9-user-frame-preview {
  position: static !important;
  width: min(100%, 520px) !important;
  max-width: 520px !important;
  margin-inline: auto !important;
}
body.v16-member-frame-route .v9-user-frame-preview > .glass,
body.v16-member-frame-route .v12-member-frame-page .v9-user-frame-preview > .glass {
  padding: 8px !important;
  overflow: visible !important;
  border-radius: 28px !important;
}
body.v16-member-frame-route [data-frame-width] {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 9 / 16 !important;
  overflow: hidden !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  contain: layout paint !important;
}
body.v16-member-frame-route [data-frame-width] > .absolute {
  max-width: 100%;
}

/* Member preview is read-only but screenshot-friendly; no invisible layer blocks the view. */
body.v16-member-frame-route .v12-member-frame-preview {
  pointer-events: none !important;
  user-select: none !important;
  touch-action: pan-y !important;
}

@media (max-width: 640px) {
  body.v16-member-frame-route .v12-member-frame-page.v9-user-frame-layout {
    max-width: none !important;
    padding-inline: 0 !important;
  }
  body.v16-member-frame-route .v9-user-frame-preview,
  body.v16-member-frame-route .v12-member-frame-page .v9-user-frame-preview {
    width: min(100%, 430px) !important;
    max-width: 430px !important;
  }
  body.v16-member-frame-route .v9-user-frame-preview > .glass,
  body.v16-member-frame-route .v12-member-frame-page .v9-user-frame-preview > .glass {
    padding: 6px !important;
    border-radius: 24px !important;
  }
  body.v16-member-frame-route [data-frame-width] {
    border-radius: 22px !important;
  }
}

/* --- merged: v18-fixes-FINAL-V18-20260831-1055.css --- */
/* FINAL V18 — exact admin/member frame geometry + clean member canvas */

/* Member frame: no gray/glass board around the actual design. */
body.v16-member-frame-route .member-frame-clean {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* The actual 9:16 canvas is the only visible board. */
body.v16-member-frame-route .member-frame-clean [data-frame-width] {
  margin-inline: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 9 / 16 !important;
}

/* Photo element sizing is applied to the positioned wrapper itself in JS. */
body.v16-member-frame-route [data-frame-width] > .absolute > img {
  max-width: none !important;
}

@media (max-width: 640px) {
  body.v16-member-frame-route .member-frame-clean {
    width: min(100%, 430px) !important;
  }
}

/* --- merged: v20-fixes-FINAL-V20-20260831-1645.css --- */
/* FINAL V20 — cache/state stability. Event status uses pseudo content only so React owns its DOM. */
.v20-event-state-host{position:relative}
.v20-event-state-host::after{content:attr(data-v20-event-status) "  •  " attr(data-v20-event-name) "  " attr(data-v20-event-date);display:block;margin-top:.35rem;font-size:11px;line-height:1.7;color:hsl(var(--muted-foreground));font-weight:700}
.v20-event-state-host[data-v20-event-closed="1"]::after{color:#ef4444}

/* --- merged: v24-fixes-FINAL-V24-20260831-1815.css --- */
/* FINAL V22 — camera really first + zero React DOM surgery */
[data-v22-shadow-shell="1"]{display:none!important}
body.v22-admin-route main.admin-mobile-main{animation:none!important;transition:none!important}

/* Camera route page: keep page title first, then scanner immediately. Event selector,
   counters and attendance lists all sit below the scanner. */
body.v22-camera-route main.admin-mobile-main .mx-auto.space-y-5:has(> .mobile-scanner-box){
  display:flex!important;
  flex-direction:column!important;
  gap:16px!important;
}
body.v22-camera-route main.admin-mobile-main .mx-auto.space-y-5:has(> .mobile-scanner-box) > :first-child{order:-200!important}
body.v22-camera-route main.admin-mobile-main .mx-auto.space-y-5:has(> .mobile-scanner-box) > .mobile-scanner-box{order:-150!important}
body.v22-camera-route main.admin-mobile-main .mx-auto.space-y-5:has(> .mobile-scanner-box) > :not(:first-child):not(.mobile-scanner-box){order:0!important}

/* Scanner itself: scanned result dropdown may appear above the live camera after a scan.
   Otherwise the viewport is the first visible scanner element. */
body.v22-camera-route .mobile-scanner-box{display:flex!important;flex-direction:column!important;gap:12px!important;overflow:visible!important}
body.v22-camera-route .v21-scan-result-details{order:-30!important;width:100%!important;overflow:hidden!important;border:1px solid rgba(34,197,94,.32)!important;border-radius:16px!important;background:rgba(17,24,39,.92)!important}
body.v22-camera-route .v21-camera-card{order:0!important;display:flex!important;flex-direction:column!important;gap:11px!important;overflow:visible!important;padding:14px!important}
body.v22-camera-route .v21-camera-viewport{order:-100!important;width:min(100%,620px)!important;max-width:620px!important;margin:0 auto 4px!important;position:relative!important;z-index:1!important;border-radius:24px!important;box-shadow:0 16px 50px rgba(0,0,0,.28)!important}
body.v22-camera-route .v21-in-camera-result{display:none!important}
body.v22-camera-route .v21-camera-status{order:10!important;margin:0!important}
body.v22-camera-route .v21-camera-selector{order:20!important;margin:0!important}
body.v22-camera-route .v21-camera-actions{order:30!important;margin:0!important}
body.v22-camera-route .v21-camera-error{order:40!important}
body.v22-camera-route .v21-camera-note{order:50!important}
body.v22-camera-route .v21-camera-actions button{min-height:48px!important}

body.v22-camera-route .v21-scan-result-details>summary{list-style:none!important;min-height:50px!important;padding:0 14px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;cursor:pointer!important;color:#fff!important;font-size:12px!important;font-weight:900!important;background:rgba(34,197,94,.07)!important}
body.v22-camera-route .v21-scan-result-details>summary::-webkit-details-marker{display:none!important}
body.v22-camera-route .v21-result-chevron{transition:transform .18s ease!important}
body.v22-camera-route .v21-scan-result-details[open] .v21-result-chevron{transform:rotate(180deg)!important}
body.v22-camera-route .v21-scan-result-body{padding-top:10px!important}

@media (max-width:640px){
  body.v22-camera-route .v21-camera-card{padding:8px!important;border-radius:20px!important}
  body.v22-camera-route .v21-camera-viewport{width:100%!important;max-width:none!important;border-radius:20px!important}
  body.v22-camera-route main.admin-mobile-main .mx-auto.space-y-5:has(> .mobile-scanner-box){gap:12px!important}
}

/* FINAL V23 — complete current-event ledger on admin dashboard */
.v23-dashboard-report{position:relative;z-index:1}
.v23-excel-btn{min-height:42px;padding:0 15px;border:1px solid rgba(34,197,94,.45);border-radius:12px;background:rgba(34,197,94,.12);color:#86efac;font-size:12px;font-weight:900;cursor:pointer;transition:.18s ease}
.v23-excel-btn:hover{background:rgba(34,197,94,.2);border-color:#22c55e}.v23-excel-btn:disabled{opacity:.5;cursor:not-allowed}
.v23-report-select,.v23-report-search{width:100%;min-height:42px;border:1px solid var(--border,#2a303b);border-radius:12px;background:#11161f;color:#f5f7fb;padding:0 12px;font:inherit;font-size:12px;outline:none}
.v23-report-select:focus,.v23-report-search:focus{border-color:rgba(239,68,68,.7);box-shadow:0 0 0 3px rgba(239,68,68,.08)}
.v23-kpi{display:inline-flex;align-items:center;gap:4px;border:1px solid rgba(148,163,184,.2);border-radius:999px;background:rgba(148,163,184,.07);padding:6px 10px;font-weight:800}.v23-kpi.v23-danger{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.08);color:#fca5a5}
.v23-report-table{width:100%;min-width:1060px;border-collapse:collapse;font-size:11px}.v23-report-table th{background:#151b25;color:#aeb7c5;text-align:right;font-weight:900;padding:11px;border-bottom:1px solid rgba(148,163,184,.16);white-space:nowrap}.v23-report-table td{padding:10px 11px;border-bottom:1px solid rgba(148,163,184,.11);vertical-align:middle}.v23-report-table tbody tr:hover{background:rgba(255,255,255,.025)}
.v23-report-table td b,.v23-report-table td small,.v23-ok small,.v23-vio small{display:block}.v23-report-table td small{margin-top:3px;color:#8f99a8;font-size:10px;white-space:nowrap}
.v23-photo-pair{display:flex;align-items:center;gap:6px}.v23-photo-pair img,.v23-photo-empty{width:44px;height:44px;flex:0 0 44px;border-radius:10px;border:1px solid rgba(148,163,184,.22);object-fit:cover;background:#0b0f15}.v23-photo-empty{display:grid;place-items:center;color:#778195;font-size:9px}
.v23-ok{color:#4ade80;font-weight:900}.v23-muted{color:#778195}.v23-vio{display:inline-grid;min-width:34px;place-items:center;border:1px solid rgba(239,68,68,.45);border-radius:10px;background:rgba(239,68,68,.1);padding:4px 7px;color:#fca5a5;font-weight:900}.v23-vio small{max-width:190px;overflow:hidden;text-overflow:ellipsis;color:#fca5a5}
.v23-profile-link{display:inline-flex;min-height:34px;align-items:center;justify-content:center;border:1px solid rgba(239,68,68,.32);border-radius:10px;padding:0 10px;color:#fff;font-weight:900;white-space:nowrap}.v23-profile-link:hover{background:rgba(239,68,68,.12);color:#f87171}
@media(max-width:640px){.v23-dashboard-report{padding:14px!important}.v23-excel-btn{width:100%}.v23-report-table{min-width:920px}.v23-photo-pair img,.v23-photo-empty{width:38px;height:38px;flex-basis:38px}}


/* V25 performance/stability: expensive blur on large admin surfaces was a major
   GPU cost on mobile/shared-GPU machines. Keep the design but avoid live backdrop recomposition. */
body.v22-admin-route .admin-mobile-main .backdrop-blur,
body.v22-admin-route .admin-mobile-main .backdrop-blur-sm,
body.v22-admin-route .admin-mobile-main .backdrop-blur-md,
body.v22-admin-route .admin-mobile-main .backdrop-blur-lg{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body.v22-admin-route main.admin-mobile-main{animation:none!important}

/* FINAL V26 — duplication guard + silent route recovery. */
[data-v26-shadow-shell="1"],
[data-v22-shadow-shell="1"]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
.v26-route-retry-spinner{
  display:block;
  width:24px;
  height:24px;
  border:3px solid rgba(239,29,37,.22);
  border-top-color:#ef1d25;
  border-radius:999px;
  animation:v26RouteRetrySpin .7s linear infinite;
}
@keyframes v26RouteRetrySpin{to{transform:rotate(360deg)}}

/* Old DOM-injected attendance UI must never compete with the React V26 gate UI. */
.v15-gate-attendance,
.v19-current-event-panel,
.v19-camera-proxy,
.v19-sort-toolbar{
  display:none!important;
}

/* FINAL V27 — one scroll owner for admin + deterministic route transitions.
   The document itself never competes with the admin content for vertical scrolling. */
body.v22-admin-route{
  height:100dvh!important;
  min-height:100dvh!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.v22-admin-route > #root{
  height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.v22-admin-route [data-v27-admin-shell="1"]{
  height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.v22-admin-route [data-v27-admin-shell="1"] > .flex.min-w-0.flex-1.flex-col{
  height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.v22-admin-route main.admin-mobile-main{
  min-height:0!important;
  height:auto!important;
  flex:1 1 0%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch!important;
  scroll-behavior:auto!important;
  scrollbar-gutter:stable;
  touch-action:pan-y!important;
}
body.v22-admin-route [data-v27-admin-shell="1"] > aside{
  height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
  position:relative!important;
  top:auto!important;
}
body.v22-admin-route .admin-sidebar-scroll{
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-width:thin;
}

/* Mobile drawer is intentionally its own temporary scroll surface. */
@media (max-width:1023px){
  body.v22-admin-route .admin-mobile-main{
    padding-bottom:calc(2rem + env(safe-area-inset-bottom,0px))!important;
  }
  body.v22-admin-route .admin-mobile-header{
    flex:0 0 auto!important;
    position:relative!important;
    top:auto!important;
  }
  body.v22-admin-route .admin-mobile-scroll{
    overscroll-behavior:contain!important;
  }
}

/* If a stale build ever leaves an extra admin shell behind, it cannot affect layout,
   focus, wheel events or pointer input. */
[data-v26-shadow-shell="1"],
[data-v22-shadow-shell="1"],
[data-v27-shadow-shell="1"]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
  position:absolute!important;
  width:0!important;
  height:0!important;
  overflow:hidden!important;
}
