:root {
  --bg: #f3eee4;
  --bg-accent: #ebe2d2;
  --card: rgba(255, 251, 244, 0.96);
  --card-muted: #f5ecdd;
  --ink: #221b14;
  --muted: #746759;
  --line: rgba(34, 27, 20, 0.12);
  --primary: #8a6a35;
  --primary-dark: #5d4520;
  --primary-soft: #eadbbd;
  --accent: #b38a46;
  --success: #3f8757;
  --error: #b14f42;
  --shadow: 0 26px 56px rgba(90, 63, 22, 0.12);
}

html[data-public-theme="dark"] {
  color-scheme: dark;
  --bg: #101513;
  --bg-accent: #151d1a;
  --card: rgba(25, 34, 31, 0.97);
  --card-muted: #202b27;
  --ink: #f5f0e7;
  --muted: #b9c2bd;
  --line: rgba(235, 241, 237, 0.14);
  --primary: #d2ad69;
  --primary-dark: #efd59f;
  --primary-soft: #3f3525;
  --accent: #e2bd76;
  --success: #76c994;
  --error: #ef9184;
  --shadow: 0 26px 56px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(179, 138, 70, 0.16), transparent 26%),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 55%, var(--bg-accent) 100%);
}

html[data-public-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(210, 173, 105, 0.12), transparent 28%),
    linear-gradient(180deg, #111714 0%, var(--bg) 55%, var(--bg-accent) 100%);
}

html[data-public-theme="dark"] .secondary-button {
  background: rgba(38, 49, 45, 0.92);
  color: var(--ink);
}

html[data-public-theme="dark"] .result-quality-toggle {
  background: #202a27;
}

html[data-public-theme="dark"] .result-card,
html[data-public-theme="dark"] .match-card {
  background: linear-gradient(180deg, #202a27, #18211e);
}

html[data-public-theme="dark"] .result-preview-shell,
html[data-public-theme="dark"] .match-image-shell {
  background: #0d1210;
}

html[data-public-theme="dark"] .result-feedback-panel {
  border-color: var(--line);
  background: var(--card);
}

html[data-public-theme="dark"] .result-feedback-close,
html[data-public-theme="dark"] .result-feedback-star {
  border-color: var(--line);
  background: #202a27;
  color: var(--muted);
}

html[data-public-theme="dark"] .result-feedback-star:hover,
html[data-public-theme="dark"] .result-feedback-star.selected,
html[data-public-theme="dark"] .result-feedback-star:focus-visible {
  background: #3b321f;
  color: #f0c978;
}

.page-shell {
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 0 0 28px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: 0 14px 34px rgba(90, 63, 22, 0.08);
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.hero h1,
.card h2,
.section-head h2 {
  margin: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: min(36vw, 210px);
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 0.94rem;
  line-height: 1.1;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 800;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: rgba(34, 27, 20, 0.12);
  background: rgba(255, 251, 244, 0.78);
}

.site-nav a.active {
  background: var(--ink);
  color: #fffaf0;
  border-color: var(--ink);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(34, 27, 20, 0.14);
}

.nav-workflow-link {
  background: rgba(255, 251, 244, 0.46);
}

.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 0 12px;
}

.hero h1 {
  max-width: 900px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.7rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.subtitle,
.section-head p,
.drop-zone-text,
.result-meta,
.match-meta {
  color: var(--muted);
}

.page-content {
  display: grid;
  gap: 22px;
}

.workspace {
  display: grid;
  gap: 22px;
}

.status-grid {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  align-items: start;
}

.status-grid .card {
  min-width: 0;
  padding: 18px;
  border-radius: 20px;
}

.status-grid .section-head.compact {
  margin-bottom: 10px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.quiet-card {
  padding-top: 34px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-head > p {
  max-width: 560px;
  margin: 0;
  line-height: 1.65;
}

.section-head h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 700;
}

.upload-form {
  display: grid;
  gap: 18px;
}

.search-indexed-face-filter {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(110px, 160px);
  gap: 12px;
  align-items: end;
  width: min(100%, 392px);
}

.search-indexed-face-filter .field-stack input,
.search-indexed-face-filter .field-stack select {
  width: 100%;
}

.toggle-row {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.search-results-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.result-download-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.search-results-tools .result-download-tools,
.result-download-tools .result-quality-toggle {
  margin-top: 0;
}

.result-quality-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
}

.result-quality-toggle button {
  min-height: 34px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 800;
}

.result-quality-toggle button.active {
  background: var(--primary);
  color: #fffaf2;
}

.result-quality-current {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.drop-zone,
.single-upload {
  border: 1.5px dashed rgba(138, 106, 53, 0.32);
  border-radius: 28px;
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  background:
    radial-gradient(circle at top, rgba(179, 138, 70, 0.09), transparent 36%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(247, 239, 226, 0.96));
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.drop-zone.drag-over,
.single-upload.drag-over,
.single-upload:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background:
    radial-gradient(circle at top, rgba(179, 138, 70, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 251, 243, 1), rgba(255, 255, 255, 1));
  box-shadow: 0 18px 34px rgba(138, 106, 53, 0.12);
}

.drop-zone-title {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fffaf2;
  background: linear-gradient(135deg, #7a5929, var(--primary));
  box-shadow: 0 14px 28px rgba(122, 89, 41, 0.18);
}

.secondary-button {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: none;
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--primary-dark);
  font-weight: 800;
}

.inline-control select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.status-surface {
  min-height: 84px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card-muted);
  padding: 18px;
  display: flex;
  align-items: center;
  line-height: 1.6;
}

.status-surface.loading-state {
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.status-loader-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.upload-status-surface {
  display: grid;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  line-height: 1.35;
}

.upload-status-surface.success {
  border-color: rgba(63, 135, 87, 0.28);
  background: rgba(63, 135, 87, 0.08);
}

.upload-status-surface.warning {
  border-color: rgba(177, 118, 43, 0.32);
  background: rgba(177, 118, 43, 0.08);
}

.upload-status-surface.error {
  border-color: rgba(177, 79, 66, 0.3);
  background: rgba(177, 79, 66, 0.08);
}

.upload-status-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.upload-status-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.upload-status-copy strong {
  color: var(--ink);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.upload-status-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upload-status-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(138, 106, 53, 0.22);
  border-top-color: var(--primary-dark);
  border-radius: 999px;
  animation: upload-status-spin 750ms linear infinite;
}

@keyframes upload-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.upload-status-copy span {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.upload-status-badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(138, 106, 53, 0.12);
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.upload-status-progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(138, 106, 53, 0.14);
}

.upload-status-progress span {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 180ms ease;
}

.upload-status-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.upload-status-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(138, 106, 53, 0.14);
  border-radius: 12px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.68);
}

.upload-status-metric.metric-total {
  background: #f1f6ff;
  border-color: #d8e5ff;
}

.upload-status-metric.metric-uploaded {
  background: #f4f1ff;
  border-color: #ded8f7;
}

.upload-status-metric.metric-indexed {
  background: #eef9f2;
  border-color: #d3ecd9;
}

.upload-status-metric.metric-failed {
  background: #fff0ee;
  border-color: #f3d1cc;
}

.upload-status-metric.metric-uploading {
  background: #fff8e8;
  border-color: #f1dfb8;
}

.upload-status-metric.metric-waiting {
  background: #eef7f8;
  border-color: #cfe6e8;
}

.upload-status-metric span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-status-metric strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.05;
}

.upload-status-error {
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(177, 79, 66, 0.1);
  color: #9b2c1f;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.pill-list li {
  max-width: 100%;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff, #f7fbfd);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.82rem;
  line-height: 1.3;
}

.status-grid .pill-list {
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
}

.result-scroll-sentinel {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-align: center;
}

.result-scroll-sentinel.is-retry {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

#whatsapp-results.results-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  #whatsapp-results.results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #whatsapp-results.results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #whatsapp-results.results-grid {
    grid-template-columns: 1fr;
  }
}

/* Public selfie and result experience */
.result-public-page,
.selfie-public-page {
  --result-bg: #f7fbfb;
  --result-surface: #ffffff;
  --result-ink: #0b1727;
  --result-muted: #52647a;
  --result-line: #dbe5eb;
  --result-control: #f7fafc;
  --result-control-border: #dbe5ed;
  --result-action-surface: rgba(255, 255, 255, 0.94);
  --result-action-ink: #10243a;
  --result-shadow: 0 18px 42px rgba(20, 67, 88, 0.1);
  min-height: 100vh;
  color: var(--result-ink);
  background: var(--result-bg);
}

html[data-public-theme="dark"] .result-public-page,
html[data-public-theme="dark"] .selfie-public-page {
  --result-bg: #060c17;
  --result-surface: #0a1220;
  --result-ink: #f6f8fb;
  --result-muted: #9cadc2;
  --result-line: #1c2a3d;
  --result-control: #111b2d;
  --result-control-border: #22324b;
  --result-action-surface: rgba(21, 31, 50, 0.94);
  --result-action-ink: #ffffff;
  --result-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  background: var(--result-bg);
}

html.public-config-loading .result-public-page > .result-page-shell,
html.public-config-loading .selfie-public-page > .selfie-page-shell {
  visibility: hidden;
}

html.public-config-loading .result-public-page::before,
html.public-config-loading .selfie-public-page::before {
  visibility: hidden;
}

.result-public-page::before,
.selfie-public-page::before {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 4px;
  content: "";
  background: var(--public-top-accent-background, linear-gradient(90deg, #02aee7, #39c6ca, #ffcf2e, #ef2835, #ef7e26, #70cc25));
}

html[data-public-top-accent="disabled"] .result-public-page::before,
html[data-public-top-accent="disabled"] .selfie-public-page::before {
  display: none;
}

.result-public-page .result-page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.result-public-page .result-logo-header,
.selfie-public-page .result-logo-header {
  min-height: 156px;
  margin: 0;
  border-bottom: 1px solid var(--result-line);
  background: rgba(255, 255, 255, 0.42);
}

html[data-public-theme="dark"] .result-public-page .result-logo-header,
html[data-public-theme="dark"] .selfie-public-page .result-logo-header {
  background: rgba(7, 13, 25, 0.72);
}

.result-header-inner {
  position: relative;
  width: min(100% - 40px, 1500px);
  min-height: 155px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 auto;
}

.result-public-page .result-logo-header {
  min-height: 0;
}

.result-public-page .result-header-inner {
  min-height: 94px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.result-logo-frame {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.result-logo-frame.has-logo {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.result-logo-product {
  display: none;
  align-self: flex-end;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--result-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
}

.result-logo-frame.has-logo .result-logo-product {
  display: flex;
}

html[data-public-product-branding="disabled"] .result-logo-frame.has-logo .result-logo-product,
html[data-public-product-branding="disabled"] .result-download-product {
  display: none;
}

.result-logo-product a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  overflow: hidden;
  border-radius: 3px;
}

.result-logo-product a:focus-visible {
  outline: 2px solid var(--result-accent);
  outline-offset: 3px;
}

.result-logo-product img {
  display: block;
  width: 128px;
  height: 28px;
  max-width: 128px;
  max-height: 28px;
  object-fit: contain;
}

.result-public-page .result-logo-header .brand-logo,
.selfie-public-page .result-logo-header .brand-logo {
  width: auto;
  height: auto;
  max-width: min(390px, 45vw);
  max-height: 74px;
  object-fit: contain;
}

.result-help-button {
  position: absolute;
  top: 50%;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--result-control-border);
  border-radius: 15px;
  color: var(--result-muted);
  background: var(--result-control);
  box-shadow: none;
  transform: translateY(-50%);
}

.result-help-button:hover,
.result-help-button:focus-visible {
  color: var(--result-ink);
  border-color: #28aed8;
  background: var(--result-surface);
}

.result-help-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-page-content {
  width: min(100% - 40px, 1500px);
  flex: 1 0 auto;
  display: block;
  margin: 0 auto;
  padding: 46px 0 48px;
}

.result-gallery-surface {
  min-width: 0;
}

.result-page-intro {
  margin-bottom: 48px;
}

.result-page-intro h1 {
  margin: 0;
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
  font-size: clamp(3rem, 4.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.result-page-intro p {
  max-width: 50vw;
  margin: 20px 0 0;
  color: var(--result-muted);
  font-size: clamp(1.15rem, 1.65vw, 1.55rem);
  line-height: 1.55;
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.selfie-public-page .selfie-page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.selfie-page-content {
  width: min(100% - 40px, 780px);
  flex: 1 0 auto;
  display: block;
  margin: 0 auto;
  padding: 40px 0 48px;
}

.selfie-page-intro {
  margin-bottom: 34px;
  text-align: center;
}

.selfie-page-intro h1 {
  margin: 0;
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.5rem, 4.2vw, 3.7rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.selfie-page-intro p {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--result-muted);
  font-size: 1.08rem;
  line-height: 1.55;
  white-space: pre-line;
}

.selfie-public-page .selfie-capture-page {
  gap: 20px;
  width: min(100%, 520px);
}

.selfie-public-page .selfie-camera-shell {
  overflow: hidden;
  border: 1px solid var(--result-control-border);
  border-radius: 27px;
  background: #060a0f;
  box-shadow: var(--result-shadow);
}

.selfie-public-page .selfie-video,
.selfie-public-page #selfie-canvas {
  background: #060a0f;
}

.selfie-public-page .selfie-liveness-panel {
  top: 18px;
  left: 16px;
  right: 16px;
  gap: 9px;
}

.selfie-public-page .selfie-status,
.selfie-public-page .selfie-prompt {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(8, 17, 29, 0.76);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(9px);
}

.selfie-public-page .selfie-status {
  padding: 11px 13px;
}

.selfie-public-page .selfie-prompt {
  padding: 11px 13px;
}

.selfie-public-page .selfie-marks span {
  width: 13px;
  height: 13px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.4);
}

.selfie-public-page .selfie-marks span.complete {
  border-color: #55d47c;
  background: #55d47c;
  box-shadow: 0 0 0 3px rgba(85, 212, 124, 0.18);
}

.selfie-public-page .selfie-upload-overlay {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 17, 29, 0.84);
  backdrop-filter: blur(9px);
}

.selfie-public-page .selfie-actions {
  width: 100%;
}

.selfie-public-page .selfie-actions button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  color: #061521;
  background: linear-gradient(100deg, #08b7df 0%, #4bd2c3 55%, #74d324 100%);
  box-shadow: 0 14px 30px rgba(16, 187, 191, 0.18);
  font-family: "Manrope", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
}

.selfie-public-page .selfie-actions button:hover,
.selfie-public-page .selfie-actions button:focus-visible {
  filter: saturate(1.08) brightness(1.03);
  transform: translateY(-1px);
}

.selfie-public-page .selfie-actions button:disabled {
  filter: grayscale(0.35);
  opacity: 0.66;
  transform: none;
}

.selfie-public-page .selfie-complete {
  padding: 24px;
  border: 1px solid var(--result-control-border);
  border-radius: 22px;
  color: var(--result-ink);
  background: var(--result-surface);
  box-shadow: var(--result-shadow);
}

.selfie-public-page .selfie-feedback-panel h2 {
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
  font-size: 1.3rem;
}

.selfie-public-page .selfie-feedback-panel p {
  color: var(--result-muted);
}

.result-public-page .result-feedback-root,
.selfie-public-page .result-feedback-root {
  padding: 22px;
  background: rgba(2, 8, 18, 0.68);
  backdrop-filter: blur(8px);
}

.result-public-page .result-feedback-panel,
.selfie-public-page .result-feedback-panel {
  width: min(430px, 100%);
  gap: 20px;
  overflow: hidden;
  padding: 32px 28px 26px;
  border: 1px solid var(--result-control-border);
  border-radius: 24px;
  color: var(--result-ink);
  background: var(--result-surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.result-feedback-panel::before,
.selfie-feedback-panel::before {
  display: none !important;
  content: none !important;
}

.result-public-page .result-feedback-close,
.selfie-public-page .result-feedback-close {
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-color: var(--result-control-border);
  color: var(--result-muted);
  background: var(--result-control);
}

.result-public-page .result-feedback-close:hover,
.result-public-page .result-feedback-close:focus-visible,
.selfie-public-page .result-feedback-close:hover,
.selfie-public-page .result-feedback-close:focus-visible {
  color: var(--result-ink);
  border-color: #28aed8;
  background: var(--result-surface);
}

.result-public-page .result-feedback-panel h2,
.selfie-public-page .result-feedback-panel h2 {
  padding: 0 38px;
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
  font-size: 1.34rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.result-public-page .result-feedback-panel p,
.selfie-public-page .result-feedback-panel p,
.result-public-page .result-feedback-status,
.selfie-public-page .result-feedback-status {
  color: var(--result-muted);
}

.result-public-page .result-feedback-stars,
.selfie-public-page .result-feedback-stars {
  gap: 10px;
}

.result-public-page .result-feedback-star,
.selfie-public-page .result-feedback-star {
  width: 48px;
  height: 48px;
  border-color: var(--result-control-border);
  color: #8190a3;
  background: var(--result-control);
  font-size: 1.3rem;
}

.result-public-page .result-feedback-star:hover,
.result-public-page .result-feedback-star.selected,
.result-public-page .result-feedback-star:focus-visible,
.selfie-public-page .result-feedback-star:hover,
.selfie-public-page .result-feedback-star.selected,
.selfie-public-page .result-feedback-star:focus-visible {
  border-color: #f4ba23;
  color: #f2a900;
  background: rgba(255, 195, 46, 0.13);
  box-shadow: 0 0 0 3px rgba(255, 195, 46, 0.12);
}

.result-public-page .result-feedback-actions,
.selfie-public-page .result-feedback-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-public-page .result-feedback-actions button,
.selfie-public-page .result-feedback-actions button {
  min-height: 48px;
  border-radius: 14px;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.result-public-page .result-feedback-actions .secondary-button,
.selfie-public-page .result-feedback-actions .secondary-button {
  border: 1px solid var(--result-control-border);
  color: var(--result-ink);
  background: var(--result-control);
}

.result-public-page .result-feedback-actions .primary-button,
.selfie-public-page .result-feedback-actions .primary-button {
  border: 0;
  color: #061521;
  background: linear-gradient(100deg, #08b7df 0%, #4bd2c3 58%, #74d324 100%);
  box-shadow: 0 10px 24px rgba(16, 187, 191, 0.16);
}

.result-public-page .app-dialog,
.selfie-public-page .app-dialog {
  overflow: hidden;
  border: 1px solid var(--result-control-border);
  border-radius: 24px;
  color: var(--result-ink);
  background: var(--result-surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.result-public-page .app-dialog-backdrop,
.selfie-public-page .app-dialog-backdrop {
  background: rgba(2, 8, 18, 0.68);
  backdrop-filter: blur(8px);
}

.result-public-page .app-dialog::before,
.selfie-public-page .app-dialog::before {
  display: none !important;
  content: none !important;
}

.result-public-page .app-dialog-header h2,
.selfie-public-page .app-dialog-header h2 {
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
}

.result-public-page .app-dialog-message,
.selfie-public-page .app-dialog-message {
  color: var(--result-muted);
}

.result-public-page .app-dialog-message strong,
.selfie-public-page .app-dialog-message strong {
  color: var(--result-ink);
  font-weight: 800;
}

.result-public-page .app-dialog-close,
.selfie-public-page .app-dialog-close,
.result-public-page .app-dialog-button.secondary,
.selfie-public-page .app-dialog-button.secondary {
  border-color: var(--result-control-border);
  color: var(--result-ink);
  background: var(--result-control);
}

.result-public-page .app-dialog-button.primary,
.selfie-public-page .app-dialog-button.primary {
  border: 0;
  color: #061521;
  background: linear-gradient(100deg, #08b7df 0%, #4bd2c3 58%, #74d324 100%);
}

.result-public-page #whatsapp-result-status {
  margin-bottom: 22px;
  border: 1px solid var(--result-line);
  border-radius: 14px;
  background: var(--result-control);
  color: var(--result-muted);
  box-shadow: none;
}

.result-public-page #whatsapp-result-status.has-results {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.result-public-page .result-download-tools {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 50px;
  padding: 0 0 15px;
  border-bottom: 1px solid var(--result-line);
}

.result-public-page .result-quality-toggle {
  width: 425px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin: 0;
  border: 1px solid var(--result-control-border);
  border-radius: 19px;
  background: var(--result-control);
}

html[data-public-theme="dark"] .result-public-page .result-quality-toggle {
  background: var(--result-control);
}

.result-public-page .result-quality-toggle button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 14px;
  color: var(--result-ink);
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.result-public-page .result-quality-toggle button:focus-visible {
  outline: 2px solid rgba(82, 100, 122, 0.55);
  outline-offset: 2px;
}

html[data-public-theme="dark"] .result-public-page .result-quality-toggle button:focus-visible {
  outline-color: rgba(220, 230, 242, 0.58);
}

.result-public-page .result-quality-toggle button.active {
  border: 1px solid rgba(255, 255, 255, 0.92);
  color: var(--result-ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 20px rgba(28, 67, 88, 0.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}

html[data-public-theme="dark"] .result-public-page .result-quality-toggle button.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 22px rgba(0, 0, 0, 0.28);
}

.result-quality-check {
  display: none;
  font-size: 1.15em;
  line-height: 1;
}

.result-quality-toggle button.active .result-quality-check {
  display: inline;
}

.result-public-page .result-quality-current {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.result-download-all-button {
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 12px 22px;
  border: 0;
  border-radius: 19px;
  color: #061521;
  background: linear-gradient(100deg, #08b7df 0%, #4bd2c3 55%, #74d324 100%);
  box-shadow: 0 14px 30px rgba(16, 187, 191, 0.18);
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.result-download-dock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.result-download-product {
  display: flex;
  align-self: center;
  justify-content: center;
  padding-right: 0;
  font-size: 0.61rem;
}

.result-download-product a {
  height: 25px;
}

.result-download-product img {
  width: 115px;
  height: 25px;
  max-width: 115px;
  max-height: 25px;
}

.result-download-all-button:hover,
.result-download-all-button:focus-visible {
  filter: saturate(1.08) brightness(1.03);
  transform: translateY(-1px);
}

.result-download-all-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.65;
  transform: none;
}

.result-download-all-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-download-size {
  padding: 6px 9px;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(11, 117, 116, 0.28);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (min-width: 721px) {
  .result-public-page .result-download-tools {
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 12px;
  }

  .result-public-page .result-quality-toggle {
    width: 350px;
    gap: 3px;
    padding: 3px;
    border-radius: 14px;
  }

  .result-public-page .result-quality-toggle button {
    min-height: 42px;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

  .result-download-all-button {
    min-height: 44px;
    gap: 9px;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  .result-download-all-icon {
    width: 19px;
    height: 19px;
  }

  .result-download-size {
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 0.68rem;
  }
}

.result-public-page #whatsapp-results.results-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 30px;
  margin: 0;
}

.result-public-page #whatsapp-results.empty-state {
  display: block;
  padding: 48px 24px;
  border: 1px solid var(--result-line);
  border-radius: 18px;
  color: var(--result-muted);
  background: var(--result-control);
  text-align: center;
}

.result-public-page .match-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--result-control-border);
  border-radius: 24px;
  background: var(--result-surface);
  box-shadow: var(--result-shadow);
}

.result-public-page .match-card.is-selected {
  border-color: rgba(52, 192, 177, 0.9);
  box-shadow:
    0 0 0 3px rgba(52, 192, 177, 0.3),
    var(--result-shadow);
}

html[data-public-theme="dark"] .result-public-page .match-card {
  background: var(--result-surface);
}

.result-public-page .match-card::before {
  display: none;
}

.result-public-page .match-image-shell,
html[data-public-theme="dark"] .result-public-page .match-image-shell {
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 23px;
  background: var(--result-control);
}

.result-public-page .match-image-button {
  border-radius: 23px;
}

.result-public-page .match-card .match-image {
  border-radius: 23px;
  object-fit: contain;
}

.result-public-page .match-card-action-row {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 16px;
  display: flex;
  gap: 9px;
  pointer-events: none;
}

.result-public-page .match-select-button {
  position: absolute;
  z-index: 5;
  top: 18px;
  left: 16px;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(132, 153, 180, 0.28);
  border-radius: 999px;
  color: var(--result-action-ink);
  background: var(--result-action-surface);
  box-shadow: 0 8px 22px rgba(7, 19, 34, 0.17);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}

.result-public-page .match-select-button.is-selected {
  border-color: rgba(52, 192, 177, 0.82);
  color: #087a70;
  background: rgba(52, 192, 177, 0.16);
}

html[data-public-theme="dark"] .result-public-page .match-select-button.is-selected {
  color: #7ce2d5;
  background: rgba(52, 192, 177, 0.14);
}

.result-public-page .match-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.result-public-page .match-select-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-public-page .match-select-button svg path {
  opacity: 0;
}

.result-public-page .match-select-button.is-selected svg path {
  opacity: 1;
}

.result-public-page .match-download-button,
.result-public-page .match-zoom-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(132, 153, 180, 0.28);
  border-radius: 999px;
  color: var(--result-action-ink);
  background: var(--result-action-surface);
  box-shadow: 0 8px 22px rgba(7, 19, 34, 0.17);
  text-decoration: none;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}

.result-public-page .match-download-button:hover,
.result-public-page .match-zoom-button:hover {
  color: #006c91;
  background: var(--result-action-surface);
  transform: translateY(-1px);
}

.result-public-page .match-select-button:focus-visible,
.result-public-page .match-download-button:focus-visible,
.result-public-page .match-zoom-button:focus-visible {
  outline: 2px solid rgba(52, 192, 177, 0.78);
  outline-offset: 2px;
  background: var(--result-action-surface);
  transform: none;
}

.result-public-page .match-select-button:active,
.result-public-page .match-download-button:active,
.result-public-page .match-zoom-button:active {
  background: rgba(255, 255, 255, 0.88);
  transform: scale(0.96);
}

html[data-public-theme="dark"] .result-public-page .match-select-button:active,
html[data-public-theme="dark"] .result-public-page .match-download-button:active,
html[data-public-theme="dark"] .result-public-page .match-zoom-button:active {
  background: rgba(255, 255, 255, 0.14);
}

.result-public-page .match-download-button svg,
.result-public-page .match-zoom-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-public-page .result-scroll-sentinel {
  min-height: 24px;
  margin: 32px 0 0;
  color: var(--result-muted);
}

.result-public-page .result-protection {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #e8b84b;
  border-left: 5px solid #edae22;
  border-radius: 14px;
  color: var(--result-ink);
  background: rgba(255, 193, 51, 0.1);
}

.result-public-page .result-protection p,
.result-public-page .result-protection small {
  color: var(--result-muted);
}

.result-page-footer {
  width: min(100% - 40px, 1500px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 26px 0 32px;
  border-top: 1px solid var(--result-line);
  color: var(--result-muted);
  font-size: 0.9rem;
}

.result-page-footer > div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 12px;
  text-align: left;
}

.result-page-footer strong {
  flex: 0 0 auto;
  color: var(--result-ink);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.result-page-footer button {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--result-muted);
  background: transparent;
  box-shadow: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-page-footer button:hover,
.result-page-footer button:focus-visible {
  color: var(--result-ink);
  background: transparent;
}

@media (min-width: 721px) {
  .result-public-page .result-page-shell {
    padding-bottom: 70px;
  }

  .result-public-page .result-page-footer {
    position: fixed;
    right: 14px;
    bottom: 0;
    left: 14px;
    z-index: 80;
    width: auto;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  html[data-public-theme="dark"] .result-public-page .result-page-footer {
    background: rgba(7, 13, 25, 0.94);
  }

  .selfie-public-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .selfie-public-page .selfie-page-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .selfie-public-page .result-logo-header,
  .selfie-public-page .result-page-footer {
    flex: 0 0 auto;
  }

  .selfie-public-page .selfie-page-content {
    width: calc(100% - 28px);
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  .selfie-public-page .result-logo-header {
    min-height: 0;
  }

  .selfie-public-page .result-header-inner {
    min-height: 94px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .result-public-page .result-page-content {
    width: calc(100% - 60px);
  }

  .result-public-page .result-header-inner,
  .result-public-page .result-page-footer,
  .selfie-public-page .result-header-inner,
  .selfie-public-page .result-page-footer {
    width: calc(100% - 28px);
  }

  .selfie-public-page .result-logo-frame.has-logo .selfie-header-product {
    display: none;
  }

  .selfie-public-page .result-page-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 0;
  }

  .selfie-public-page .selfie-footer-copy {
    min-width: 0;
    flex-wrap: wrap;
    justify-self: start;
  }

  .selfie-public-page .selfie-footer-product {
    display: flex;
    grid-column: 2;
    align-self: center;
    justify-self: center;
  }

  .selfie-public-page .result-page-footer > button {
    justify-self: end;
  }

  html[data-public-product-branding="disabled"] .selfie-public-page .selfie-footer-product {
    display: none;
  }
}

@media (max-width: 1280px) {
  .result-public-page #whatsapp-results.results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .result-public-page #whatsapp-results.results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .result-public-page .result-page-shell {
    padding-bottom: calc(91px + env(safe-area-inset-bottom, 0px));
  }

  html[data-public-product-branding="disabled"] .result-public-page .result-page-shell {
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
  }

  .result-public-page .result-logo-header,
  .selfie-public-page .result-logo-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  html[data-public-theme="dark"] .result-public-page .result-logo-header,
  html[data-public-theme="dark"] .selfie-public-page .result-logo-header {
    background: rgba(7, 13, 25, 0.94);
  }

  .result-public-page .result-logo-header,
  .selfie-public-page .result-logo-header {
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  html[data-public-top-accent="enabled"] .result-public-page .result-logo-header,
  html[data-public-top-accent="enabled"] .selfie-public-page .result-logo-header {
    padding-top: 8px;
  }

  .result-header-inner {
    width: calc(100% - 28px);
    min-height: 54px;
    justify-content: flex-start;
    padding-top: 0;
    padding-bottom: 0;
  }

  .result-public-page .result-logo-header {
    min-height: 0;
  }

  .result-public-page .result-header-inner {
    min-height: 54px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .result-logo-frame {
    width: auto;
    max-width: min(calc(100% - 62px), 340px);
    min-width: 0;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    gap: 5px;
  }

  .result-public-page .result-logo-header .brand-logo,
  .selfie-public-page .result-logo-header .brand-logo {
    max-width: 100%;
    max-height: 54px;
  }

  .result-logo-product {
    gap: 5px;
    font-size: 0.62rem;
  }

  .result-logo-product img {
    width: 106px;
    height: 23px;
    max-width: 106px;
    max-height: 23px;
  }

  .result-logo-product a {
    height: 23px;
  }

  .result-help-button {
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .result-help-button svg {
    width: 20px;
    height: 20px;
  }

  .result-page-content {
    width: calc(100% - 28px);
    padding: 16px 0 30px;
  }

  .selfie-page-content {
    width: calc(100% - 28px);
    padding: 16px 0 30px;
  }

  .selfie-page-intro {
    display: block;
    margin-bottom: 24px;
  }

  .selfie-page-intro h1 {
    font-size: clamp(2rem, 10vw, 2.65rem);
    line-height: 1.08;
  }

  .selfie-page-intro p {
    max-width: 100%;
    margin-top: 10px;
    font-size: 1rem;
    line-height: 1.5;
  }

  .result-page-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
  }

  .result-page-intro h1 {
    font-size: clamp(2rem, 10vw, 2.65rem);
    line-height: 1.08;
  }

  .result-page-intro p {
    max-width: 100%;
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.5;
  }

  .selfie-public-page .selfie-camera-shell {
    border-radius: 20px;
  }

  .selfie-public-page .selfie-actions button {
    min-height: 56px;
    border-radius: 17px;
  }

  .result-public-page .result-feedback-panel,
  .selfie-public-page .result-feedback-panel {
    gap: 18px;
    padding: 30px 18px 20px;
    border-radius: 20px;
  }

  .result-public-page .result-feedback-star,
  .selfie-public-page .result-feedback-star {
    width: 44px;
    height: 44px;
  }

  .result-public-page #whatsapp-result-status {
    margin-bottom: 16px;
  }

  .result-public-page .result-download-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 28px;
    padding-bottom: 18px;
  }

  .result-public-page .result-quality-toggle {
    width: 100%;
    border-radius: 17px;
  }

  .result-public-page .result-quality-toggle button {
    min-height: 45px;
    padding: 8px 6px;
    border-radius: 12px;
    font-size: clamp(0.78rem, 3.7vw, 0.95rem);
  }

  .result-public-page .result-download-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    gap: 6px;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--result-control-border);
    border-radius: 0;
    background: var(--result-action-surface);
    box-shadow: 0 -12px 30px rgba(5, 63, 78, 0.16);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .result-public-page .result-download-all-button {
    width: 100%;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 14px;
    box-shadow: none;
    font-size: clamp(0.9rem, 4vw, 1.05rem);
  }

  .result-public-page .result-download-product {
    align-self: center;
    padding-right: 0;
    font-size: 0.56rem;
  }

  .result-public-page .result-download-product a {
    height: 20px;
  }

  .result-public-page .result-download-product img {
    width: 94px;
    height: 20px;
    max-width: 94px;
    max-height: 20px;
  }

  .result-download-size {
    padding: 5px 7px;
    font-size: 0.66rem;
  }

  .result-public-page #whatsapp-results.results-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .result-public-page .match-card {
    border-radius: 20px;
  }

  .result-public-page .match-card::before {
    height: 6px;
  }

  .result-public-page .match-image-shell,
  html[data-public-theme="dark"] .result-public-page .match-image-shell,
  .result-public-page .match-image-button,
  .result-public-page .match-card .match-image {
    border-radius: 19px;
  }

  .result-public-page .match-card-action-row {
    top: 16px;
    right: 13px;
    gap: 8px;
  }

  .result-public-page .match-select-button {
    top: 16px;
    left: 13px;
    width: 40px;
    height: 40px;
  }

  .result-public-page .match-select-button svg {
    width: 21px;
    height: 21px;
  }

  .result-public-page .match-download-button,
  .result-public-page .match-zoom-button {
    width: 40px;
    height: 40px;
  }

  .result-public-page .match-download-button svg,
  .result-public-page .match-zoom-button svg {
    width: 19px;
    height: 19px;
  }

  .result-page-footer {
    width: calc(100% - 28px);
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    padding: 22px 0 26px;
    text-align: left;
  }

  .result-public-page .result-page-footer {
    padding-bottom: 4px;
  }

  .result-page-footer > div {
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .result-page-footer > button {
    align-self: center;
  }
}

#bulk-results.results-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.result-card,
.match-card {
  min-width: 0;
  background: linear-gradient(180deg, #fffdf8, #f8f0e3);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
}

.result-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.result-card h4,
.match-card h4 {
  margin: 6px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.55rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.match-current-quality {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.result-card-head > div {
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  width: fit-content;
}

.badge.success {
  background: rgba(30, 157, 103, 0.12);
  color: var(--success);
}

.badge.error {
  background: rgba(217, 72, 95, 0.12);
  color: var(--error);
}

.result-meta,
.match-meta {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
  line-height: 1.55;
}

.result-preview-shell {
  border-radius: 20px;
  overflow: hidden;
  background: #efe3cf;
}

.result-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-chip {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.stat-label,
.subsection-title,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-chip strong {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
}

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

.meta-list.compact {
  gap: 8px;
}

.meta-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.meta-value {
  color: var(--ink);
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
}

.face-gallery-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(34, 27, 20, 0.08);
}

.face-gallery {
  display: grid;
  gap: 12px;
}

.face-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(180deg, #fbf5ea, #f5ead7);
  min-width: 0;
}

.face-card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
}

.face-meta {
  display: grid;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  min-width: 0;
}

.face-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.face-card-head strong {
  font-size: 0.98rem;
  color: var(--ink);
}

.face-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
}

.face-status.ok {
  background: rgba(63, 135, 87, 0.12);
  color: var(--success);
}

.face-status.fail {
  background: rgba(177, 79, 66, 0.12);
  color: var(--error);
}

.match-image-shell {
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 16px;
  background: #efe3cf;
}
.match-image-shell.is-unavailable {
  border: 1px solid rgba(34, 27, 20, 0.12);
  background: #f5f1eb;
}

.match-image-shell.is-unavailable .match-image-button {
  cursor: default;
}

.match-image-shell .match-box-overlay.image-unavailable {
  display: none;
}

.match-image-unavailable {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--ink);
  text-align: center;
  pointer-events: none;
}

.match-image-unavailable.hidden {
  display: none;
}

.match-image-unavailable strong {
  font-size: 1rem;
}

.match-image-unavailable span {
  color: var(--muted);
  font-size: 0.86rem;
}


.match-image-button {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}

.match-card .match-image,
.search-media-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 16px;
  display: block;
}

.match-box-overlay {
  position: absolute;
  border: 2px solid #1c9a50;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 0 0 1px rgba(10, 28, 16, 0.18);
  pointer-events: none;
}

.match-card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.match-card-action-row .badge {
  margin-bottom: 0;
}

.match-download-button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(34, 27, 20, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(34, 27, 20, 0.1);
  cursor: pointer;
}

.match-download-button:hover,
.match-download-button:focus-visible {
  background: #ffffff;
  transform: translateY(-1px);
}

.match-download-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.match-download-button.downloading:disabled {
  cursor: wait;
}

.match-download-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-card.hide-overlays .match-box-overlay {
  display: none;
}

.search-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.search-media-viewer.hidden,
.search-media-overlay.hidden {
  display: none;
}

.search-media-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border-radius: 0;
  background: rgba(10, 8, 5, 0.78);
  box-shadow: none;
}

.search-media-stage {
  position: relative;
  z-index: 1;
  width: min(96vw, 1180px);
  max-height: 92vh;
  display: grid;
  gap: 12px;
  place-items: center;
}

.search-media-image-shell {
  position: relative;
  max-width: 100%;
  max-height: calc(92vh - 58px);
  overflow: hidden;
  border-radius: 18px;
  background: #111;
}

.search-media-image {
  max-width: min(96vw, 1180px);
  max-height: calc(92vh - 58px);
  border-radius: 18px;
}

.search-media-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #fffaf2;
  color: var(--ink);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.search-media-caption {
  color: #fffaf2;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

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

.result-link-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.result-link-panel.hidden {
  display: none;
}

.result-link-panel span {
  font-weight: 800;
  color: var(--primary-dark);
}

.result-link-panel input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px 2px 8px;
}

.home-hero h1 {
  max-width: 980px;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.1rem, 4vw, 4.35rem);
  line-height: 1;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-action,
.secondary-button {
  text-decoration: none;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf0;
  padding: 10px 16px;
  font-weight: 900;
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.home-action-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 174px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(90, 63, 22, 0.08);
}

.home-action-card:hover,
.home-action-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(34, 27, 20, 0.22);
}

.home-action-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-action-card strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.home-action-card span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .home-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .result-stats {
    grid-template-columns: 1fr;
  }

  #bulk-results.results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px 14px 44px;
  }

  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .brand-mark {
    align-items: flex-start;
  }

  .brand-logo {
    height: 40px;
    max-width: min(52vw, 190px);
  }

  .brand-copy {
    display: none;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a,
  .nav-logout-form {
    flex: 1 1 0;
  }

  .site-nav a,
  .nav-logout-button {
    text-align: center;
  }

  .nav-logout-button {
    width: 100%;
  }

  .home-hero,
  .home-action-grid {
    grid-template-columns: 1fr;
  }

  .home-hero-actions {
    justify-content: flex-start;
  }

  .drop-zone,
  .single-upload {
    min-height: 180px;
  }

  .result-link-panel {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .face-card {
    grid-template-columns: 1fr;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .face-card img {
    width: 100%;
    height: 180px;
  }

  #bulk-results.results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-app-body .page-shell {
    padding: 0;
  }

  .search-app-body .page-content {
    min-height: 100vh;
  }

  .phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 0;
  }

  .phone-notch {
    display: none;
  }

  .whatsapp-app {
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  #bulk-results.results-grid {
    grid-template-columns: 1fr;
  }
}

.result-logo-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 68px;
  margin-bottom: 28px;
}

.result-logo-header .brand-logo[hidden] {
  display: none;
}

.result-logo-header .brand-logo {
  height: 68px;
  max-width: min(72vw, 360px);
}

.field-stack {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--primary-dark);
}

.field-stack input {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.hidden {
  display: none !important;
}

.event-qr-result {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.qr-preview-shell {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.qr-preview-shell img {
  display: block;
  width: 100%;
  height: auto;
}

.field-stack select {
  width: min(100%, 720px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.danger-button {
  background: linear-gradient(135deg, #8f2e25, #b14f42);
}

.event-candidate-panel {
  display: grid;
  gap: 14px;
  min-height: 84px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card-muted);
  padding: 18px;
  line-height: 1.6;
}

.event-candidate-panel .meta-row {
  grid-template-columns: 120px minmax(0, 1fr);
}

.event-candidate-panel .meta-value {
  overflow-wrap: anywhere;
}

.status-note {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
}

.status-note.success {
  background: rgba(63, 135, 87, 0.12);
  color: var(--success);
}

.status-note.error,
.event-candidate-panel.error {
  background: rgba(177, 79, 66, 0.1);
  color: var(--error);
}

.event-card-grid {
  display: grid;
  gap: 16px;
}

.event-list-group-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.event-list-group-heading h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.event-list-ungrouped-heading {
  margin-top: 8px;
}

.admin-events-section {
  display: grid;
  gap: 16px;
}

.event-admin-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.event-card-title {
  min-width: 0;
}

.event-card-title h3 {
  margin: 3px 0 4px;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.event-card-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.event-card-admin-actions,
.event-health-strip,
.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-card-grid.deleting .event-admin-card:not(.is-deleting) {
  opacity: 0.58;
}

.event-admin-card.is-deleting {
  outline: 2px solid rgba(176, 71, 50, 0.28);
  outline-offset: 3px;
}

button.is-loading {
  cursor: progress;
  position: relative;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.75s linear infinite;
}

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

.event-resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-card-admin-actions {
  justify-content: flex-end;
  align-items: flex-start;
}

.event-health-strip {
  justify-content: flex-end;
}

.event-card-actions {
  justify-content: center;
}

.compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.compact-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.event-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
}

.event-resource-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.event-resource-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.74);
  padding: 14px;
  min-width: 0;
}

.event-resource-copy {
  min-width: 0;
}

.event-resource-card p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.event-resource-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.event-qr-panel {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.74);
  padding: 14px;
}

.event-qr-panel.unavailable {
  justify-items: start;
  color: var(--muted);
}

.event-qr-panel.unavailable p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.event-card-qr {
  width: 100%;
  max-width: 170px;
  padding: 8px;
  border-radius: 14px;
}

.qr-preview-link {
  display: block;
  cursor: zoom-in;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.qr-preview-link:hover {
  border-color: rgba(18, 140, 126, 0.38);
  box-shadow: 0 10px 24px rgba(45, 34, 22, 0.12);
  transform: translateY(-1px);
}

.qr-primary-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.qr-manage-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.qr-manage-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  list-style: none;
}

.qr-manage-panel > summary::-webkit-details-marker {
  display: none;
}

.qr-manage-panel > summary::marker {
  content: "";
}

.qr-manage-panel > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.76rem;
  transition: transform 0.16s ease;
}

.qr-manage-panel[open] > summary::after {
  transform: rotate(180deg);
}

.qr-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 10px 10px;
}

.resource-status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.resource-status.active {
  color: var(--success);
  background: rgba(63, 135, 87, 0.12);
}

.resource-status.missing {
  color: var(--error);
  background: rgba(177, 79, 66, 0.1);
}

.resource-status.progress {
  color: #2f6f9e;
  background: rgba(47, 111, 158, 0.12);
}

.resource-status.rollback {
  color: #9a5c12;
  background: rgba(154, 92, 18, 0.12);
}

.resource-status.deleted {
  color: var(--muted);
  background: rgba(116, 103, 89, 0.12);
}

.resource-status.neutral {
  color: var(--primary-dark);
  background: rgba(138, 106, 53, 0.12);
}

.resource-status.stale {
  color: #fff;
  background: var(--error);
}

@media (max-width: 860px) {
  .event-card-header,
  .event-card-body,
  .event-resource-card {
    grid-template-columns: 1fr;
  }

  .event-card-header {
    display: grid;
  }

  .event-card-admin-actions,
  .event-health-strip,
  .event-card-actions {
    justify-content: flex-start;
  }

  .event-qr-panel {
    justify-items: start;
  }

  .event-card-qr {
    max-width: 220px;
  }
}

.wa-event-select-row {
  padding: 8px 10px;
  background: #f4efe7;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.wa-event-select-row select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 9px 10px;
  background: #fff;
  color: #1f2a22;
  font: inherit;
  font-size: 0.9rem;
}

.whatsapp-gallery-upload-page {
  display: grid;
  gap: 16px;
  width: min(100%, 560px);
  margin: 0 auto;
}


.upload-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.whatsapp-gallery-upload-page .upload-choice-panel {
  min-height: 150px;
  min-width: 96px;
  box-sizing: border-box;
  gap: 8px;
  overflow: hidden;
  padding: 12px 6px;
}

.camera-choice-panel {
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.camera-capture-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(247, 239, 226, 0.94));
}

.gallery-camera-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(138, 106, 53, 0.2);
  border-radius: 18px;
  background: #101010;
  aspect-ratio: 4 / 3;
}

.gallery-camera-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #111;
  object-fit: cover;
}

.gallery-camera-video.is-front-camera {
  transform: scaleX(-1);
}

.camera-tool-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.camera-tool-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
}

.camera-tool-button svg {
  width: 22px;
  height: 22px;
}

.gallery-zoom-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(138, 106, 53, 0.2);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.gallery-zoom-control input {
  min-width: 0;
  width: 100%;
}

.gallery-zoom-control strong {
  min-width: 34px;
  text-align: right;
  white-space: nowrap;
}

.gallery-camera-preview {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 54px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gallery-camera-preview.empty-state {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(138, 106, 53, 0.28);
  border-radius: 14px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.gallery-camera-thumb {
  display: grid;
  gap: 8px;
  flex: 0 0 132px;
  width: 132px;
  min-width: 132px;
  border: 1px solid rgba(138, 106, 53, 0.2);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.74);
  scroll-snap-align: start;
}

.gallery-camera-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  background: #111;
}

.gallery-camera-thumb-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.2;
}

.gallery-camera-thumb-meta strong,
.gallery-camera-thumb-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-camera-thumb-actions {
  display: grid;
  justify-items: stretch;
}

.camera-mini-button {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 7px 6px;
  border-radius: 10px;
  line-height: 1;
}

.camera-mini-button svg {
  width: 18px;
  height: 18px;
}

.camera-mini-button.danger {
  background: #fff2ef;
  color: #9b2c1f;
}

.camera-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 380px) {
  .camera-tool-row,
  .camera-action-row {
    grid-template-columns: 1fr;
  }

  .camera-tool-button {
    justify-self: center;
  }
}

.whatsapp-gallery-upload-page .upload-choice-panel .drop-zone-title {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
}

@media (max-width: 380px) {
  .whatsapp-gallery-upload-page .upload-choice-panel .drop-zone-title {
    font-size: 0.82rem;
  }
}

.whatsapp-gallery-upload-page .upload-icon {
  display: block;
  width: 44px;
  height: 44px;
  color: var(--primary-dark);
  flex: 0 0 auto;
}

.whatsapp-gallery-upload-page .upload-form {
  gap: 14px;
}

.whatsapp-gallery-upload-page #selected-files {
  display: none;
}

.compact-actions {
  gap: 10px;
}

.selfie-capture-page {
  display: grid;
  gap: 18px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.selfie-camera-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #111;
  aspect-ratio: 3 / 4;
}

.selfie-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}

#selfie-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.selfie-shutter {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

.selfie-shutter.is-active {
  animation: selfieShutterFlash 220ms ease-out;
}

.selfie-upload-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(18, 28, 24, 0.84);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.selfie-upload-overlay.hidden {
  display: none;
}

.selfie-upload-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: upload-status-spin 750ms linear infinite;
  flex: 0 0 auto;
}

.selfie-face-guide {
  position: absolute;
  left: 15%;
  top: 16%;
  width: 70%;
  height: 72%;
  z-index: 4;
  pointer-events: none;
  transition: filter 160ms ease, opacity 160ms ease;
}

.selfie-face-guide-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  border: 5px solid #d92d20;
  border-radius: 48% 48% 45% 45% / 40% 40% 56% 56%;
  background: rgba(217, 45, 32, 0.07);
  box-shadow: 0 0 0 999px rgba(10, 13, 12, 0.08), 0 0 22px rgba(217, 45, 32, 0.45);
}

.selfie-face-guide-neck {
  display: none;
}

.selfie-face-guide.is-valid .selfie-face-guide-head,
.selfie-face-guide.is-valid .selfie-face-guide-neck {
  border-color: #16a34a;
  box-shadow: 0 0 0 999px rgba(10, 13, 12, 0.04), 0 0 24px rgba(22, 163, 74, 0.58);
}

.selfie-face-guide.is-valid .selfie-face-guide-head {
  background: rgba(22, 163, 74, 0.08);
}

.selfie-status {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.selfie-actions {
  display: flex;
  justify-content: center;
}

.selfie-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.selfie-complete {
  justify-content: center;
  text-align: center;
  color: var(--success);
  font-weight: 900;
}

.selfie-feedback-panel {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: var(--ink);
  font-weight: 700;
}

.selfie-feedback-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.2;
}

.selfie-feedback-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.result-feedback-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(34, 27, 20, 0.38);
  backdrop-filter: blur(3px);
}

.result-feedback-root.closing {
  opacity: 0;
  transition: opacity 150ms ease;
}

.result-feedback-panel {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 14px;
  background: #fffaf2;
  box-shadow: 0 24px 70px rgba(41, 64, 72, 0.24);
  text-align: center;
}

.result-feedback-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(41, 64, 72, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.2rem;
  line-height: 1;
}

.result-feedback-panel h2 {
  margin: 0;
  padding: 0 28px;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.2;
}

.result-feedback-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.result-feedback-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.result-feedback-star {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(138, 106, 53, 0.24);
  border-radius: 999px;
  background: #fffdf8;
  color: rgba(138, 106, 53, 0.42);
  box-shadow: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  outline: none;
  text-align: center;
  user-select: none;
}

.result-feedback-star:hover,
.result-feedback-star.selected {
  border-color: rgba(220, 151, 35, 0.72);
  background: #fff4d6;
  color: #d28a0c;
}

.result-feedback-star:focus-visible {
  border-color: rgba(220, 151, 35, 0.82);
  background: #fff4d6;
  color: #d28a0c;
  box-shadow: 0 0 0 3px rgba(220, 151, 35, 0.22);
}

.result-feedback-status {
  min-height: 1.3em;
}

.result-feedback-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.result-feedback-actions button {
  min-width: 92px;
}

.selfie-liveness-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 6;
  display: grid;
  gap: 8px;
}

.selfie-liveness-panel .selfie-status {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
}

.selfie-prompt {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(18, 28, 24, 0.78);
  color: #fffaf2;
  font-size: clamp(0.98rem, 4.4vw, 1.2rem);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.selfie-prompt-inline,
.selfie-blink-eyes {
  display: inline-flex;
  align-items: center;
}

.selfie-prompt-inline {
  gap: 0.55em;
}

.selfie-blink-eyes {
  gap: 0.24em;
  font-size: 1em;
}

.selfie-blink-eye {
  position: relative;
  width: 0.74em;
  height: 0.42em;
  border: 0.12em solid currentColor;
  border-radius: 999px 999px 70% 70%;
  background: rgba(255, 255, 255, 0.16);
  transform-origin: center;
  animation: selfieInlineBlink 1.25s ease-in-out infinite;
}

.selfie-blink-eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.2em;
  height: 0.2em;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.selfie-blink-eye + .selfie-blink-eye {
  animation-delay: 0.03s;
}

.selfie-marks {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.selfie-marks span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.86);
}

.selfie-marks span.complete {
  background: var(--success);
  border-color: var(--success);
}

.selfie-countdown {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(18, 28, 24, 0.42);
  color: #fffaf2;
  font-size: clamp(5rem, 24vw, 9rem);
  font-weight: 900;
  line-height: 1;
}

.selfie-countdown.is-message {
  padding: 24px;
  text-align: center;
  font-size: clamp(2rem, 11vw, 4rem);
  line-height: 1.05;
}

.selfie-countdown.is-paused {
  background: transparent;
}

.selfie-countdown.is-loader {
  gap: 14px;
  grid-template-rows: auto auto;
  padding: 24px;
  font-size: 1rem;
  line-height: 1.2;
}

.selfie-countdown-loader-label {
  color: #fffaf2;
  font-size: 1rem;
  font-weight: 900;
}

.selfie-countdown-loader {
  display: block;
  width: min(220px, 58vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 250, 242, 0.22);
}

.selfie-countdown-loader::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fffaf2;
  transform: scaleX(0);
  transform-origin: left center;
  animation: selfieCaptureLoader var(--selfie-capture-loader-duration, 1000ms) linear forwards;
}

@keyframes selfieCaptureLoader {
  to {
    transform: scaleX(1);
  }
}

@keyframes selfieInlineBlink {
  0%, 36%, 100% { transform: scaleY(1); }
  46%, 54% { transform: scaleY(0.12); }
}

@keyframes selfieShutterFlash {
  0% { opacity: 0; }
  16% { opacity: 0.88; }
  100% { opacity: 0; }
}

.selfie-cue {
  display: none;
  position: absolute;
  inset: 8% 0 auto;
  place-items: center;
  pointer-events: none;
  opacity: 0.74;
  z-index: 2;
  perspective: 900px;
}

.cue-head {
  position: relative;
  width: min(46vw, 190px);
  aspect-ratio: 0.82 / 1;
  transform-style: preserve-3d;
  transform-origin: 50% 58%;
}

.cue-face {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255, 250, 242, 0.78);
  border-radius: 46% 46% 43% 43% / 42% 42% 50% 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 250, 242, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.18), rgba(18, 28, 24, 0.1));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.24), inset 0 0 36px rgba(255, 250, 242, 0.08);
  transform-style: preserve-3d;
}

.cue-ear {
  position: absolute;
  top: 39%;
  width: 12%;
  height: 18%;
  border: 3px solid rgba(255, 250, 242, 0.58);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.1);
}

.cue-ear-left {
  left: -7%;
}

.cue-ear-right {
  right: -7%;
}

.cue-brow {
  position: absolute;
  top: 32%;
  width: 20%;
  height: 4%;
  border-top: 4px solid rgba(255, 250, 242, 0.72);
  border-radius: 999px;
}

.cue-brow-left {
  left: 25%;
  transform: rotate(-5deg);
}

.cue-brow-right {
  right: 25%;
  transform: rotate(5deg);
}

.cue-eye {
  position: absolute;
  top: 39%;
  width: 18%;
  height: 9%;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.86);
  box-shadow: inset 0 -4px 0 rgba(18, 28, 24, 0.18);
  overflow: hidden;
}

.cue-eye::before,
.cue-eye::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(18, 28, 24, 0.68);
  transform: scaleY(0);
  z-index: 2;
}

.cue-eye::before {
  top: 0;
  transform-origin: top;
  border-radius: 999px 999px 0 0;
}

.cue-eye::after {
  bottom: 0;
  transform-origin: bottom;
  border-radius: 0 0 999px 999px;
}

.cue-eye i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 82%;
  border-radius: 999px;
  background: radial-gradient(circle at 45% 42%, rgba(255, 255, 255, 0.9) 0 9%, rgba(18, 28, 24, 0.82) 10% 100%);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(18, 28, 24, 0.12);
}

.cue-eye-left {
  left: 27%;
}

.cue-eye-right {
  right: 27%;
}

.cue-nose {
  position: absolute;
  left: 50%;
  top: 49%;
  width: 8%;
  height: 20%;
  border-left: 3px solid rgba(255, 250, 242, 0.5);
  border-bottom: 3px solid rgba(255, 250, 242, 0.34);
  border-radius: 0 0 0 12px;
  transform: translateX(-30%);
}

.cue-mouth {
  position: absolute;
  left: 39%;
  right: 39%;
  top: 75%;
  height: 6%;
  border-bottom: 3px solid rgba(255, 250, 242, 0.62);
  border-radius: 0 0 999px 999px;
}

.cue-blink .cue-eye {
  animation: cueHumanBlink 2s ease-in-out infinite;
  transform-origin: center;
}

.cue-blink .cue-brow-left,
.cue-blink .cue-brow-right {
  animation: cueBlinkBrow 2s ease-in-out infinite;
}

.cue-look-left .cue-head {
  animation: cueHeadLeft 1.55s ease-in-out infinite;
}

.cue-look-right .cue-head {
  animation: cueHeadRight 1.55s ease-in-out infinite;
}

.cue-look-left .cue-eye i {
  animation: cueIrisLeft 1.55s ease-in-out infinite;
}

.cue-look-right .cue-eye i {
  animation: cueIrisRight 1.55s ease-in-out infinite;
}

.cue-look-left .cue-ear-left,
.cue-look-left .cue-ear-right,
.cue-look-right .cue-ear-left,
.cue-look-right .cue-ear-right {
  animation-duration: 1.55s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.cue-look-left .cue-ear-left {
  animation-name: cueNearEarLeft;
}

.cue-look-left .cue-ear-right {
  animation-name: cueFarEarLeft;
}

.cue-look-right .cue-ear-left {
  animation-name: cueFarEarRight;
}

.cue-look-right .cue-ear-right {
  animation-name: cueNearEarRight;
}

.cue-look-left .cue-nose,
.cue-look-left .cue-mouth,
.cue-look-right .cue-nose,
.cue-look-right .cue-mouth {
  animation-duration: 1.55s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.cue-look-left .cue-nose,
.cue-look-left .cue-mouth {
  animation-name: cueFeatureLeft;
}

.cue-look-right .cue-nose,
.cue-look-right .cue-mouth {
  animation-name: cueFeatureRight;
}

.cue-complete .cue-face {
  border-color: rgba(63, 135, 87, 0.95);
  background: rgba(63, 135, 87, 0.18);
}

@keyframes cueHumanBlink {
  0%, 38%, 52%, 100% {
    transform: scaleY(1);
  }
  43% {
    transform: scaleY(0.16);
  }
  46% {
    transform: scaleY(0.06);
  }
  49% {
    transform: scaleY(0.45);
  }
}

@keyframes cueBlinkBrow {
  0%, 38%, 52%, 100% {
    transform: translateY(0) rotate(var(--brow-tilt, 0deg));
  }
  45%, 48% {
    transform: translateY(1px) rotate(var(--brow-tilt, 0deg));
  }
}

.cue-brow-left {
  --brow-tilt: -5deg;
}

.cue-brow-right {
  --brow-tilt: 5deg;
}

@keyframes cueHeadLeft {
  0%, 100% {
    transform: rotateY(0deg) rotateZ(0deg) translateX(0) scaleX(1);
  }
  50% {
    transform: rotateY(-58deg) rotateZ(-4deg) translateX(-24px) scaleX(0.78);
  }
}

@keyframes cueHeadRight {
  0%, 100% {
    transform: rotateY(0deg) rotateZ(0deg) translateX(0) scaleX(1);
  }
  50% {
    transform: rotateY(58deg) rotateZ(4deg) translateX(24px) scaleX(0.78);
  }
}

@keyframes cueIrisLeft {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-88%, -50%);
  }
}

@keyframes cueIrisRight {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-12%, -50%);
  }
}

@keyframes cueNearEarLeft {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-14px) scale(1.18);
    opacity: 1;
  }
}

@keyframes cueFarEarLeft {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-10px) scale(0.72);
    opacity: 0.22;
  }
}

@keyframes cueNearEarRight {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(14px) scale(1.18);
    opacity: 1;
  }
}

/* Neutral human face guide for selfie liveness. */
.cue-face {
  inset: 6% 9% 6%;
  border: 2px solid rgba(255, 250, 242, 0.88);
  border-radius: 50% / 50%;
  background: rgba(18, 28, 24, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  overflow: visible;
}

.cue-face::before,
.cue-face::after {
  content: none;
}

.cue-face > * {
  z-index: 2;
}

.cue-ear {
  top: 41%;
  width: 6%;
  height: 13%;
  border-width: 2px;
  border-color: rgba(255, 250, 242, 0.7);
  border-radius: 50% 36% 36% 50%;
  background: transparent;
}

.cue-ear-left {
  left: 4%;
}

.cue-ear-right {
  right: 4%;
  border-radius: 36% 50% 50% 36%;
}

.cue-brow {
  top: 32%;
  width: 17%;
  height: 3%;
  border-top-width: 2px;
  border-color: rgba(255, 250, 242, 0.76);
}

.cue-brow-left {
  left: 27%;
}

.cue-brow-right {
  right: 27%;
}

.cue-eye {
  top: 39%;
  width: 14%;
  height: 5.5%;
  border: 2px solid rgba(255, 250, 242, 0.82);
  background: rgba(255, 250, 242, 0.18);
  box-shadow: none;
}

.cue-eye i {
  width: 28%;
  height: 78%;
  background: rgba(18, 28, 24, 0.84);
  box-shadow: none;
}

.cue-eye-left {
  left: 29%;
}

.cue-eye-right {
  right: 29%;
}

.cue-nose {
  top: 50%;
  width: 6%;
  height: 17%;
  border-left-width: 2px;
  border-bottom-width: 2px;
  border-color: rgba(255, 250, 242, 0.52);
}

.cue-mouth {
  left: 42%;
  right: 42%;
  top: 69%;
  height: 3%;
  border-bottom-width: 2px;
  border-color: rgba(255, 250, 242, 0.66);
}

@keyframes cueFarEarRight {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(10px) scale(0.72);
    opacity: 0.22;
  }
}

@keyframes cueFeatureLeft {
  0%, 100% {
    margin-left: 0;
    opacity: 1;
  }
  50% {
    margin-left: -18px;
    opacity: 0.78;
  }
}

@keyframes cueFeatureRight {
  0%, 100% {
    margin-left: 0;
    opacity: 1;
  }
  50% {
    margin-left: 18px;
    opacity: 0.78;
  }
}

.selfie-debug {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 4;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(18, 28, 24, 0.72);
  color: #fffaf2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
}

.nav-logout-form {
  display: flex;
  margin: 0;
}

.nav-logout-button {
  appearance: none;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.68);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: normal;
  padding: 12px 18px;
  white-space: nowrap;
}

.nav-logout-button:hover,
.nav-logout-button:focus-visible {
  border-color: rgba(34, 27, 20, 0.22);
  color: var(--ink);
}

.admin-login-card {
  max-width: 520px;
  margin-inline: auto;
}

.error-state {
  border-color: rgba(170, 46, 46, 0.24);
  background: #fff1f0;
  color: #8d2424;
}

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

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

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

.admin-secret-pill {
  min-width: 0;
  border: 1px solid rgba(30, 57, 50, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf8;
  display: grid;
  gap: 4px;
}

.admin-secret-pill.missing {
  background: #fff4ee;
  border-color: rgba(170, 92, 46, 0.18);
}

.admin-secret-pill span,
.admin-secret-pill small {
  color: #65736f;
  font-size: 0.78rem;
}

.admin-secret-pill strong {
  color: #12312b;
}

.admin-secret-pill code {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  color: #233a35;
}

@media (max-width: 720px) {
  .admin-config-grid,
  .admin-secret-status {
    grid-template-columns: 1fr;
  }
}

.secret-preview {
  overflow-wrap: anywhere;
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(18, 49, 43, 0.06);
  color: #12312b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
}

.admin-page .hero {
  display: none;
}

.admin-page .page-shell {
  padding-top: 18px;
}

.admin-page .topbar {
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.admin-page .page-content {
  gap: 16px;
}

.admin-top-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-page .card {
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(90, 63, 22, 0.09);
}

.admin-page .quiet-card {
  padding-top: 18px;
}

.admin-page .section-head,
.admin-page .section-head.compact {
  margin-bottom: 12px;
}

.admin-page .section-head h2 {
  font-family: "Manrope", sans-serif;
  font-size: 1.18rem;
  line-height: 1.2;
}

.admin-page .eyebrow {
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.admin-page .upload-form,
.admin-page .compact-form {
  gap: 12px;
}

.admin-page .field-stack {
  gap: 6px;
  font-size: 0.86rem;
}

.admin-page .field-stack input,
.admin-page .field-stack select {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 42px;
}

.admin-page .actions {
  gap: 8px;
  margin-top: 2px;
}

.admin-page .status-surface,
.admin-page .event-candidate-panel {
  min-height: 60px;
  border-radius: 14px;
  padding: 12px;
  font-size: 0.9rem;
}

.admin-page .event-candidate-panel {
  gap: 10px;
}

.admin-page .event-candidate-panel .meta-row {
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
}

.admin-page .status-note {
  border-radius: 10px;
  padding: 9px 10px;
}

.admin-page .event-qr-result {
  gap: 12px;
  margin-top: 12px;
}

.admin-page .event-qr-result .qr-preview-shell {
  width: min(100%, 220px);
  padding: 8px;
  border-radius: 12px;
}

.admin-page .admin-secret-pill {
  border-radius: 10px;
  padding: 10px;
  gap: 3px;
}

.admin-page .admin-events-section {
  gap: 12px;
}

.section-head-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gallery-review-card {
  display: grid;
  gap: 12px;
}

.approval-page .page-content {
  gap: 14px;
}

.approval-summary-card,
.approval-detail-card {
  display: grid;
  gap: 12px;
}

.approval-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.approval-metric-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.74);
  padding: 12px;
  min-width: 0;
}

.approval-metric-card span,
.approval-metric-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.approval-metric-card strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.15;
}

.approval-events-section {
  display: grid;
  gap: 12px;
}

.approval-event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.approval-event-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 22px rgba(90, 63, 22, 0.08);
  padding: 14px;
  min-width: 0;
  cursor: pointer;
}

.approval-event-card:hover,
.approval-event-card:focus-visible,
.approval-event-card.active {
  border-color: rgba(138, 106, 53, 0.5);
  outline: 2px solid rgba(138, 106, 53, 0.14);
  outline-offset: 2px;
}

.approval-event-card.empty {
  opacity: 0.72;
}

.approval-event-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.approval-event-card h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.approval-event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.approval-detail-card.hidden {
  display: none;
}

.approval-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.72);
  padding: 10px;
}

.approval-pagination.hidden {
  display: none;
}

.approval-pagination span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .approval-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .approval-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .approval-event-grid,
  .approval-metrics-grid {
    grid-template-columns: 1fr;
  }

  .approval-event-card-head {
    display: grid;
  }
}

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

.gallery-review-item {
  display: grid;
  grid-template-columns: auto 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.74);
  padding: 10px;
  min-width: 0;
}

.gallery-review-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.gallery-review-thumb {
  width: 92px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(34, 27, 20, 0.08);
}

.gallery-review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-review-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gallery-review-title-row,
.gallery-review-meta,
.gallery-review-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gallery-review-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gallery-review-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-review-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.gallery-review-row-actions {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .gallery-review-item {
    grid-template-columns: auto 82px minmax(0, 1fr);
  }

  .gallery-review-row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .section-head-with-actions,
  .gallery-review-item {
    grid-template-columns: 1fr;
  }

  .section-head-with-actions {
    display: grid;
  }

  .gallery-review-row-actions {
    grid-column: auto;
  }
}

.admin-page .event-card-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.admin-page .event-admin-card {
  gap: 12px;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(90, 63, 22, 0.08);
}

.admin-page .event-card-header {
  gap: 10px;
}

.admin-page .event-card-title h3 {
  font-size: 1rem;
  margin: 2px 0 3px;
}

.admin-page .event-card-date {
  font-size: 0.78rem;
}

.admin-page .event-health-strip {
  gap: 6px;
}

.admin-page .event-card-admin-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-page .resource-status {
  padding: 3px 7px;
  font-size: 0.68rem;
}

.admin-page .compact-button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.admin-page .event-card-body {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 10px;
}

.admin-page .event-resource-list {
  gap: 8px;
}

.admin-page .event-resource-card,
.admin-page .event-qr-panel {
  border-radius: 12px;
  padding: 10px;
}

.admin-page .event-resource-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.admin-page .event-resource-card p {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-page .event-resource-actions,
.admin-page .event-card-actions {
  justify-content: flex-start;
}

.admin-page .event-qr-panel {
  gap: 8px;
}

.admin-page .event-card-qr {
  max-width: 112px;
  padding: 6px;
  border-radius: 10px;
}

@media (max-width: 1100px) {
  .admin-top-grid,
  .admin-page .event-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-page .page-shell {
    padding: 14px 12px 40px;
  }

  .admin-page .card {
    padding: 14px;
  }

  .admin-page .event-card-body {
    grid-template-columns: 1fr;
  }

  .admin-page .event-card-qr {
    max-width: 160px;
  }
}

.admin-runtime-config-card .status-surface {
  min-height: 48px;
}

.runtime-config-editor,
.runtime-config-panel-body {
  display: grid;
  gap: 12px;
}

.runtime-config-fields {
  display: grid;
  gap: 12px;
}

.runtime-config-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.72);
  overflow: hidden;
}

.runtime-config-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.runtime-config-group > summary::-webkit-details-marker {
  display: none;
}

.runtime-config-group > summary::marker {
  content: "";
}

.runtime-config-group[open] > summary .runtime-config-disclosure {
  transform: rotate(90deg);
}

.runtime-config-group .runtime-config-grid {
  padding: 0 12px 12px;
}

.runtime-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.runtime-config-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.76);
  font-size: 0.82rem;
  font-weight: 800;
}

.runtime-config-field input,
.runtime-config-field select {
  width: 100%;
  appearance: auto;
  min-width: 0;
  min-height: 36px;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.runtime-config-field small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
}

.runtime-color-list-field {
  grid-column: span 2;
}

.runtime-color-preview {
  width: 100%;
  height: 18px;
  border: 1px solid rgba(34, 27, 20, 0.14);
  border-radius: 999px;
  background: linear-gradient(90deg, #02aee7, #39c6ca, #ffcf2e, #ef2835, #ef7e26, #70cc25);
}

.runtime-color-rows {
  display: grid;
  gap: 6px;
}

.runtime-color-row {
  display: grid;
  grid-template-columns: 42px minmax(92px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.runtime-color-row .runtime-color-picker {
  min-height: 36px;
  padding: 3px;
  cursor: pointer;
}

.runtime-color-row .runtime-color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  text-transform: uppercase;
}

.runtime-color-actions {
  display: inline-flex;
  gap: 4px;
}

.runtime-color-actions button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.runtime-color-actions .runtime-color-remove {
  color: var(--danger);
}

.runtime-color-add {
  justify-self: start;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .runtime-color-list-field {
    grid-column: 1 / -1;
  }

  .runtime-color-row {
    grid-template-columns: 38px minmax(84px, 1fr) auto;
  }
}

.runtime-config-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.runtime-config-toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--primary);
}

.runtime-config-toggle small {
  grid-column: 1 / -1;
}

.runtime-json-panel,
.runtime-config-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.72);
  overflow: hidden;
}

.runtime-json-panel > summary,
.runtime-config-panel > summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 900;
  list-style: none;
}

.runtime-json-panel > summary::-webkit-details-marker,
.runtime-config-panel > summary::-webkit-details-marker {
  display: none;
}

.runtime-json-panel > summary::marker,
.runtime-config-panel > summary::marker {
  content: "";
}

.runtime-json-panel textarea {
  width: calc(100% - 20px);
  min-height: 180px;
  max-height: 420px;
  margin: 0 10px 10px;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
}

.runtime-config-field textarea {
  min-height: 104px;
  resize: vertical;
}

.event-runtime-config-panel {
  margin-top: 2px;
}

.event-runtime-config-panel > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.runtime-config-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.runtime-config-disclosure {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transition: transform 160ms ease;
}

.event-runtime-config-panel[open] > summary .runtime-config-disclosure {
  transform: rotate(90deg);
}

.runtime-config-summary-note {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.event-runtime-config-panel .runtime-config-panel-body {
  padding: 0 10px 10px;
}

.event-runtime-config-panel .runtime-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-runtime-config-panel .runtime-json-panel textarea {
  min-height: 150px;
}

@media (max-width: 1100px) {
  .runtime-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .runtime-config-grid,
  .event-runtime-config-panel .runtime-config-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-page .page-content {
  gap: 12px;
}

.analytics-page .status-surface {
  min-height: 0;
  padding: 10px 12px;
}

.analytics-summary-card .section-head {
  align-items: center;
}

.analytics-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.analytics-filter-bar label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-filter-bar select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  padding: 6px 28px 6px 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.analytics-filter-bar.inline {
  margin-top: 0;
  justify-content: flex-end;
}

.analytics-collapse-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.66);
  overflow: hidden;
}

.analytics-collapse-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.analytics-collapse-panel > summary::-webkit-details-marker {
  display: none;
}

.analytics-collapse-panel > summary::marker {
  content: "";
}

.analytics-collapse-panel > summary::after {
  content: "▾";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.16s ease;
}

.analytics-collapse-panel[open] > summary::after {
  transform: rotate(180deg);
}

.analytics-global-panel {
  margin-top: 12px;
}

.analytics-global-panel > summary span,
.analytics-event-summary-main strong {
  color: var(--ink);
  font-weight: 900;
}

.analytics-global-panel > summary small,
.analytics-event-summary-main small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.analytics-global-panel > .analytics-global-sections {
  padding: 10px;
}

.analytics-global-sections,
.analytics-metric-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.analytics-metric-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.66);
}

.analytics-metric-section h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.analytics-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.analytics-metric-grid.compact {
  min-width: 0;
}

.analytics-metric-card {
  min-width: 0;
  position: relative;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.78);
}

.analytics-metric-card span {
  min-height: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.analytics-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
}

.analytics-tooltip-trigger {
  cursor: help;
  outline: none;
}

.analytics-tooltip-mark {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(41, 64, 72, 0.28);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.analytics-tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 8px;
  right: 8px;
  top: 32px;
  z-index: 20;
  display: none;
  padding: 8px 10px;
  border: 1px solid rgba(41, 64, 72, 0.2);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(41, 64, 72, 0.14);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.analytics-tooltip-trigger:hover::after,
.analytics-tooltip-trigger:focus-visible::after {
  display: block;
}

.analytics-metric-card strong {
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1;
}

.analytics-event-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.analytics-event-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 22px rgba(90, 63, 22, 0.08);
}

.analytics-scope-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.analytics-scope-card:hover,
.analytics-scope-card:focus-visible {
  border-color: rgba(138, 106, 53, 0.48);
  box-shadow: 0 14px 28px rgba(90, 63, 22, 0.13);
  outline: none;
  transform: translateY(-1px);
}

.analytics-scope-card-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.analytics-open-label {
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.analytics-event-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.analytics-event-head h3 {
  margin: 2px 0 3px;
  font-size: 1rem;
}

.analytics-phone-activity {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.62);
}

.analytics-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.analytics-phone-head h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.analytics-phone-head span,
.analytics-phone-more,
.analytics-phone-meta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.analytics-phone-list {
  display: grid;
  gap: 6px;
}

.analytics-phone-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(138, 106, 53, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.78);
}

.analytics-phone-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.analytics-phone-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.84rem;
}

.analytics-phone-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.analytics-phone-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.analytics-phone-stats.feedback-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 4px;
  border-top: 1px solid rgba(138, 106, 53, 0.12);
}

.analytics-phone-stats.download-row {
  padding-top: 4px;
  border-top: 1px solid rgba(138, 106, 53, 0.12);
}

.analytics-phone-stats.download-quality-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-phone-stats strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.analytics-phone-more {
  margin: 0;
}


.analytics-event-summary-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analytics-event-summary-main strong {
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.analytics-event-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.analytics-phone-list.compact-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 31%);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.analytics-phone-list.compact-scroll .analytics-phone-row {
  align-content: start;
}

.analytics-phone-result-link {
  width: fit-content;
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.analytics-phone-browser-section .section-head {
  align-items: center;
}

.analytics-detail-header-card,
.analytics-detail-metrics-card {
  display: grid;
  gap: 12px;
}

.analytics-detail-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.4;
}

.analytics-detail-sections {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.analytics-detail-errors:empty {
  display: none;
}

.analytics-cost-card {
  display: grid;
  gap: 12px;
}

.analytics-cost-range-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.analytics-cost-range-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.analytics-cost-range-form input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  padding: 6px 9px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.analytics-cost-summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
}

.analytics-cost-total,
.analytics-cost-service {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.78);
  padding: 10px;
}

.analytics-cost-total span,
.analytics-cost-service span,
.analytics-cost-total small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.analytics-cost-total strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.analytics-cost-service strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.analytics-cost-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.analytics-cost-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.78);
}

.analytics-cost-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.analytics-cost-table th,
.analytics-cost-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(138, 106, 53, 0.12);
  text-align: right;
  white-space: nowrap;
}

.analytics-cost-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 190px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}

.analytics-cost-table thead th {
  background: #fff9ef;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-cost-table thead th:first-child {
  z-index: 2;
  background: #fff9ef;
}

.analytics-cost-table tr:last-child th,
.analytics-cost-table tr:last-child td {
  border-bottom: 0;
}

.analytics-cost-total-row th,
.analytics-cost-total-row td {
  color: var(--ink);
  font-weight: 900;
}

.analytics-cost-service-row.is-expandable th:first-child {
  padding: 0;
}

.analytics-cost-service-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 37px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.analytics-cost-service-toggle:hover,
.analytics-cost-service-toggle:focus-visible {
  background: rgba(184, 132, 44, 0.08);
}

.analytics-cost-service-toggle small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.analytics-cost-chevron {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 140ms ease;
}

.analytics-cost-service-toggle[aria-expanded="true"] .analytics-cost-chevron {
  transform: rotate(90deg);
}

.analytics-cost-line-item-row th:first-child {
  background: #fffaf1;
  color: var(--muted);
  font-weight: 800;
}

.analytics-cost-line-item-row th:first-child span {
  display: block;
  padding-left: 23px;
}

.analytics-cost-line-item-row td {
  background: rgba(255, 250, 241, 0.55);
  color: var(--muted);
  font-size: 0.74rem;
}

.analytics-cost-table sup {
  color: var(--error);
  font-size: 0.68rem;
}

.analytics-cost-footnote {
  margin: 0;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.analytics-phone-browser {
  display: grid;
  gap: 8px;
}

.analytics-phone-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.78);
}

.analytics-phone-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.analytics-phone-table th,
.analytics-phone-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(138, 106, 53, 0.12);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.analytics-phone-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.analytics-table-sort:hover,
.analytics-table-sort:focus-visible {
  color: var(--ink);
}

.analytics-sort-indicator {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}

.analytics-sort-indicator::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.65;
  transform: translate(-50%, -50%);
}

.analytics-sort-indicator.is-asc::before {
  border-bottom: 6px solid currentColor;
}

.analytics-sort-indicator.is-desc::before {
  border-top: 6px solid currentColor;
}

.analytics-sort-indicator.is-unsorted::before {
  width: 6px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}

.analytics-phone-table td:first-child {
  color: var(--ink);
  font-weight: 900;
}

.analytics-phone-table tr:last-child td {
  border-bottom: 0;
}

.analytics-muted {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-errors {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(177, 79, 66, 0.2);
  border-radius: 10px;
  background: #fff1f0;
  color: #8d2424;
  font-size: 0.78rem;
}

.analytics-errors p {
  margin: 0;
}

@media (max-width: 1100px) {
  .analytics-global-sections,
  .analytics-metric-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .analytics-global-sections,
  .analytics-metric-sections,
  .analytics-metric-grid,
  .analytics-event-list {
    grid-template-columns: 1fr;
  }

  .analytics-event-head {
    display: grid;
  }

  .analytics-scope-card {
    grid-template-columns: 1fr;
  }

  .analytics-scope-card-actions {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
  }

  .analytics-cost-range-form,
  .analytics-cost-range-form label,
  .analytics-cost-range-form input,
  .analytics-cost-range-form button {
    width: 100%;
  }

  .analytics-cost-summary {
    grid-template-columns: 1fr;
  }
}

.stack-log-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.72);
  overflow: hidden;
}

.stack-log-panel summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--primary-dark);
  font-weight: 900;
  list-style-position: inside;
}

.stack-log-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 0 10px 10px;
}

.stack-log-row {
  display: grid;
  gap: 5px;
  border-left: 3px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffdf8;
  font-size: 0.78rem;
}

.stack-log-row.failed {
  border-left-color: var(--error);
  background: #fff1f0;
}

.stack-log-row.complete {
  border-left-color: var(--success);
  background: rgba(63, 135, 87, 0.08);
}

.stack-log-row.running {
  border-left-color: var(--primary);
}

.stack-log-main,
.stack-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.stack-log-main strong,
.stack-log-row p {
  overflow-wrap: anywhere;
}

.stack-log-main span,
.stack-log-meta,
.stack-log-row p,
.stack-log-empty {
  color: var(--muted);
}

.stack-log-row p {
  margin: 0;
  line-height: 1.45;
}

.stack-log-status {
  color: var(--ink);
  font-weight: 900;
}

.stack-log-empty {
  padding: 10px 2px;
  font-size: 0.84rem;
}

.app-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.app-dialog-root.hidden {
  display: none;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 27, 20, 0.42);
  backdrop-filter: blur(3px);
}

.app-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: #fffaf2;
  box-shadow: 0 28px 70px rgba(34, 27, 20, 0.24);
  padding: 18px;
}

.app-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.app-dialog-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
}

.app-dialog-close {
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.9);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
}

.app-dialog-message {
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.app-dialog-field {
  margin-top: 14px;
}

.app-dialog-input-label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-dialog-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}

.app-dialog-warning {
  margin: 8px 0 0;
  color: #9f2f1f;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.app-dialog-warning.hidden {
  display: none;
}

.app-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.app-dialog-button {
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.app-dialog-button.secondary {
  background: rgba(255, 251, 244, 0.84);
  color: var(--muted);
}

.app-dialog-button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf0;
}

.app-dialog-button.danger {
  border-color: var(--error);
  background: var(--error);
  color: #fffaf0;
}

.nav-user-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.7);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 10px;
  white-space: nowrap;
}

.admin-users-card {
  display: grid;
  gap: 18px;
}

.admin-user-create-panel,
.admin-user-directory {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 16px;
  background: rgba(255, 251, 244, 0.6);
  padding: 18px;
}

.admin-user-subsection-head,
.admin-user-directory-head,
.admin-user-card-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-user-subsection-head h3,
.admin-user-directory-head h3,
.admin-user-card-section-head h4 {
  margin: 2px 0 0;
  color: var(--ink);
}

.admin-user-subsection-head > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: right;
}

.admin-user-form {
  display: grid;
  gap: 16px;
  margin: 0;
}

.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-user-form-actions,
.admin-user-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-user-form-actions {
  border-top: 1px solid rgba(34, 27, 20, 0.08);
  padding-top: 14px;
}

.admin-user-directory-head {
  align-items: center;
}

.admin-user-directory-head #admin-users-status {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.admin-user-upload-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-user-target-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.admin-user-target-fieldset legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-user-target-fieldset > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.admin-user-target-options {
  width: 100%;
  max-height: 190px;
  display: grid;
  gap: 2px;
  overflow-y: auto;
  border: 1px solid rgba(34, 27, 20, 0.12);
  border-radius: 10px;
  background: #fffdf8;
  padding: 6px;
}

.admin-user-target-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.admin-user-target-option:hover {
  background: rgba(34, 27, 20, 0.045);
}

.admin-user-target-option:has(input:checked) {
  background: rgba(219, 234, 254, 0.62);
}

.admin-user-target-option input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
  margin: 0;
}

.admin-user-target-option > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-user-target-option strong,
.admin-user-target-option small {
  overflow-wrap: anywhere;
}

.admin-user-target-option strong {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.3;
}

.admin-user-target-option small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.3;
}

.admin-role-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.6fr) auto;
  gap: 14px;
  align-items: end;
}

.admin-role-permissions {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.admin-role-permissions legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-role-permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-role-permission-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.78);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 10px;
}

.admin-role-permission-option input {
  width: auto;
  margin: 0;
}

.admin-roles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.admin-role-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 14px;
  background: rgba(255, 251, 244, 0.74);
  padding: 14px;
}

.admin-role-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-role-card h3 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.admin-users-list {
  display: grid;
  gap: 14px;
}

.admin-user-card {
  display: grid;
  gap: 0;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 16px;
  background: #fffdf8;
  overflow: hidden;
}

.admin-user-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-user-card-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(34, 27, 20, 0.08);
  background: rgba(255, 248, 237, 0.76);
}

.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-user-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 12px;
  background: var(--ink);
  color: #fffaf0;
  font-size: 1rem;
  font-weight: 900;
}

.admin-user-title-row,
.admin-user-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.admin-user-role-chip,
.admin-user-state-chip,
.admin-user-access-summary {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.admin-user-role-chip {
  border: 1px solid rgba(29, 78, 216, 0.16);
  background: rgba(219, 234, 254, 0.72);
  color: #1d4ed8;
}

.admin-user-state-chip.is-active {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(204, 251, 241, 0.72);
  color: #0f766e;
}

.admin-user-state-chip.is-inactive {
  border: 1px solid rgba(153, 27, 27, 0.16);
  background: rgba(254, 226, 226, 0.72);
  color: #991b1b;
}

.admin-user-dates {
  gap: 6px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-user-card-body {
  display: grid;
}

.admin-user-account-section,
.admin-user-access-section {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.admin-user-access-section {
  border-top: 1px solid rgba(34, 27, 20, 0.08);
  background: rgba(255, 251, 244, 0.64);
}

.admin-user-card-section-head {
  align-items: center;
}

.admin-user-card-section-head h4 {
  font-size: 0.94rem;
}

.admin-user-access-summary {
  border: 1px solid rgba(34, 27, 20, 0.1);
  background: rgba(255, 251, 244, 0.82);
  color: var(--muted);
  white-space: nowrap;
}

.admin-user-account-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(220px, 1fr) minmax(190px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.admin-user-account-grid select,
.admin-user-account-grid input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(34, 27, 20, 0.12);
  border-radius: 10px;
  background: #fffdf8;
  padding: 8px 10px;
}

.admin-user-active-control {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(34, 27, 20, 0.1);
  border-radius: 11px;
  background: rgba(255, 251, 244, 0.78);
  padding: 10px 12px;
}

.admin-user-active-control > span {
  display: grid;
  gap: 2px;
}

.admin-user-active-control strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.admin-user-active-control small {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-user-active-control input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
}

.admin-user-card-actions {
  justify-content: space-between;
  border-top: 1px solid rgba(34, 27, 20, 0.08);
  background: rgba(255, 248, 237, 0.54);
  padding: 12px 18px;
}

@media (max-width: 980px) {
  .admin-user-form-grid,
  .admin-user-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-active-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .admin-role-form,
  .admin-user-form-grid,
  .admin-user-account-grid,
  .admin-user-upload-targets {
    grid-template-columns: 1fr;
  }

  .admin-user-subsection-head,
  .admin-user-directory-head,
  .admin-user-card-section-head {
    display: grid;
  }

  .admin-user-subsection-head > p {
    max-width: none;
    text-align: left;
  }

  .admin-user-directory-head #admin-users-status {
    width: 100%;
  }

  .admin-user-active-control {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .admin-user-create-panel,
  .admin-user-directory {
    padding: 14px;
  }

  .admin-user-card-head,
  .admin-user-account-section,
  .admin-user-access-section,
  .admin-user-card-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .admin-user-title-row {
    align-items: flex-start;
  }
}


/* Compact, stable cards for gallery upload status results. */
#bulk-results.results-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: stretch;
}

#bulk-results .result-card {
  gap: 12px;
  min-height: 0;
  border-radius: 14px;
  padding: 12px;
  overflow: hidden;
}

#bulk-results .result-card-head {
  display: grid;
  gap: 6px;
}

#bulk-results .result-card-head h4 {
  display: -webkit-box;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: "Manrope", sans-serif;
  font-size: 0.94rem;
  line-height: 1.25;
}

#bulk-results .badge {
  margin: 0;
  max-width: 100%;
  padding: 4px 8px;
  font-size: 0.68rem;
  line-height: 1.1;
  text-transform: uppercase;
}

#bulk-results .result-preview-shell {
  border-radius: 12px;
}

#bulk-results .result-preview {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
}

#bulk-results .result-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#bulk-results .stat-chip {
  min-width: 0;
  border-radius: 10px;
  padding: 8px;
}

#bulk-results .stat-label,
#bulk-results .meta-label,
#bulk-results .subsection-title {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

#bulk-results .stat-chip strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

#bulk-results .meta-list {
  gap: 7px;
  min-width: 0;
}

#bulk-results .meta-row {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

#bulk-results .meta-value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.78rem;
}

#bulk-results .mono {
  font-size: 0.7rem;
}

#bulk-results .face-gallery-block {
  gap: 8px;
}

#bulk-results .face-card {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  border-radius: 12px;
  padding: 8px;
}

#bulk-results .face-card img {
  width: 58px;
  height: 58px;
  border-radius: 9px;
}

#bulk-results .face-meta {
  gap: 6px;
  font-size: 0.76rem;
}

#bulk-results .face-card-head {
  gap: 6px;
}

#bulk-results .face-card-head strong {
  font-size: 0.82rem;
}

#bulk-results .face-status {
  padding: 3px 6px;
  font-size: 0.62rem;
}

@media (max-width: 720px) {
  #bulk-results.results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  #bulk-results .result-stats,
  #bulk-results .meta-row,
  #bulk-results .face-card {
    grid-template-columns: 1fr;
  }

  #bulk-results .face-card img {
    width: 100%;
    height: 140px;
  }
}

.qr-logo-manager {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.qr-logo-preview {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.qr-logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.result-logo-admin-preview {
  display: grid;
  min-height: 110px;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.result-logo-admin-preview.compact {
  min-height: 82px;
}

.result-logo-admin-preview img {
  display: block;
  max-width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.result-branding-admin-content {
  display: grid;
  gap: 12px;
}

.result-logo-status {
  width: 100%;
  padding: 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.result-logo-dialog-preview {
  display: grid;
  min-height: 280px;
  place-items: center;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.result-logo-crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.result-logo-crop-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 480px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.result-logo-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #08a7d7;
  border-radius: 3px;
  outline: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 9999px rgba(3, 12, 20, 0.38);
  cursor: move;
  touch-action: none;
}

.result-logo-crop-box:focus-visible {
  outline: 3px solid rgba(8, 167, 215, 0.35);
  outline-offset: 4px;
}

.result-logo-crop-box [data-crop-handle] {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #08a7d7;
  box-shadow: 0 2px 7px rgba(3, 12, 20, 0.3);
}

.result-logo-crop-box [data-crop-handle="nw"] {
  top: 0;
  left: 0;
  cursor: nwse-resize;
  transform: translate(-50%, -50%);
}

.result-logo-crop-box [data-crop-handle="n"] {
  top: 0;
  left: 50%;
  cursor: ns-resize;
  transform: translate(-50%, -50%);
}

.result-logo-crop-box [data-crop-handle="ne"] {
  top: 0;
  right: 0;
  cursor: nesw-resize;
  transform: translate(50%, -50%);
}

.result-logo-crop-box [data-crop-handle="e"] {
  top: 50%;
  right: 0;
  cursor: ew-resize;
  transform: translate(50%, -50%);
}

.result-logo-crop-box [data-crop-handle="se"] {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
  transform: translate(50%, 50%);
}

.result-logo-crop-box [data-crop-handle="s"] {
  bottom: 0;
  left: 50%;
  cursor: ns-resize;
  transform: translate(-50%, 50%);
}

.result-logo-crop-box [data-crop-handle="sw"] {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
  transform: translate(-50%, 50%);
}

.result-logo-crop-box [data-crop-handle="w"] {
  top: 50%;
  left: 0;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
}

.qr-logo-cropper-panel.result-logo-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.result-logo-edit-step,
.result-logo-preview-step {
  display: grid;
  gap: 12px;
}

.result-logo-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(34, 27, 20, 0.05);
}

.result-logo-mode-toggle button {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.84rem;
}

.result-logo-mode-toggle button.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 7px 16px rgba(18, 140, 126, 0.2);
}

.result-logo-crop-instructions,
.result-logo-preview-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.result-logo-final-preview {
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.result-logo-final-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(430px, 100%);
  max-height: 84px;
  object-fit: contain;
}

@media (max-width: 720px) {
  .qr-logo-cropper-panel.result-logo-dialog {
    gap: 11px;
    padding: 15px;
  }

  .result-logo-dialog-preview {
    min-height: 140px;
  }

  .result-logo-final-preview {
    min-height: 62px;
    padding: 0;
  }
}

.runtime-public-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.runtime-public-preview-actions small {
  color: var(--muted);
  line-height: 1.4;
}

.public-site-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
}

.public-site-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 18, 0.74);
  backdrop-filter: blur(5px);
}

.public-site-preview-panel {
  position: relative;
  z-index: 1;
  width: min(1380px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: #fffaf2;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.public-site-preview-header,
.public-site-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.public-site-preview-header p,
.public-site-preview-header h2 {
  margin: 0;
}

.public-site-preview-header h2 {
  color: var(--ink);
  font-size: 1.18rem;
}

.public-site-preview-close {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: none;
  font-size: 1.35rem;
  line-height: 1;
}

.public-site-preview-toolbar {
  padding-block: 11px;
  background: rgba(255, 255, 255, 0.52);
}

.public-site-preview-tabs,
.public-site-preview-devices {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(34, 27, 20, 0.05);
}

.public-site-preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-site-preview-open-tab {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 800;
}

.public-site-preview-tabs button,
.public-site-preview-devices button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 800;
}

.public-site-preview-tabs button.active,
.public-site-preview-devices button.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(18, 140, 126, 0.2);
}

.public-site-preview-stage {
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #dce2e6;
}

.public-site-preview-viewport {
  position: relative;
  width: min(1320px, 100%);
  height: clamp(480px, calc(100vh - 250px), 760px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(5, 14, 22, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(5, 14, 22, 0.2);
  transition: width 180ms ease, height 180ms ease;
}

.public-site-preview-viewport[data-device="mobile"] {
  width: min(390px, 100%);
  height: clamp(520px, calc(100vh - 250px), 780px);
}

.public-site-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.public-preview-page {
  position: relative;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  background: var(--preview-bg);
}

.public-preview-accent {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  height: 4px;
}

.public-preview-logo-header {
  position: relative;
  min-height: 100px;
  display: grid;
  place-items: center;
  padding: 14px 70px;
  border-bottom: 1px solid var(--preview-line);
  background: color-mix(in srgb, var(--preview-surface) 82%, transparent);
}

.public-preview-logo-header .public-preview-event-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(270px, 60%);
  max-height: 55px;
  object-fit: contain;
}

.public-preview-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.public-preview-product {
  display: flex;
  align-self: flex-end;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--preview-muted);
  font-size: 0.5rem;
  font-weight: 700;
}

.public-preview-product img {
  display: block;
  width: auto;
  height: auto;
  max-width: 82px;
  max-height: 18px;
  object-fit: contain;
}

.public-preview-logo-placeholder {
  padding: 12px 18px;
  border: 1px dashed var(--preview-line);
  border-radius: 10px;
  color: var(--preview-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.public-preview-help {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--preview-line);
  border-radius: 11px;
  color: var(--preview-muted);
  background: var(--preview-control);
  font-weight: 800;
  transform: translateY(-50%);
}

.public-preview-result-content {
  flex: 1;
  padding: 26px 30px 34px;
}

.public-preview-result-intro {
  margin-bottom: 24px;
}

.public-preview-result-intro h3,
.public-preview-selfie-intro h3 {
  margin: 0 0 7px;
  color: var(--preview-ink);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.public-preview-result-intro p,
.public-preview-selfie-intro p {
  margin: 0;
  color: var(--preview-muted);
  font-size: 0.82rem;
}

.public-preview-result-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--preview-line);
}

.public-preview-quality {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 280px;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--preview-line);
  border-radius: 13px;
  background: var(--preview-control);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.public-preview-quality span {
  padding: 9px 7px;
  border-radius: 9px;
  color: var(--preview-muted);
}

.public-preview-quality span.active {
  color: #04141f;
  background: #25b8dc;
}

.public-preview-result-tools > button,
.public-preview-capture {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 13px;
  color: #04141f;
  background: linear-gradient(100deg, #08b7df, #4bd2c3 58%, #74d324);
  box-shadow: 0 8px 20px rgba(16, 187, 191, 0.16);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.public-preview-result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
}

.public-preview-result-card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  border-radius: 14px;
  background: linear-gradient(145deg, #2aa7cd, #f5c369);
}

.public-preview-result-card:nth-child(2) {
  background: linear-gradient(145deg, #764fa1, #ec9a68);
}

.public-preview-result-card:nth-child(3) {
  background: linear-gradient(145deg, #277f77, #abd06d);
}

.public-preview-result-card:nth-child(4) {
  background: linear-gradient(145deg, #315282, #d885a3);
}

.public-preview-result-card:nth-child(5) {
  background: linear-gradient(145deg, #a36d3e, #f1d39a);
}

.public-preview-result-card svg {
  width: 100%;
  height: 100%;
  fill: rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 8px 12px rgba(14, 28, 39, 0.18));
}

.public-preview-result-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
}

.public-preview-result-actions span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #233241;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.68rem;
  font-weight: 900;
}

.public-preview-footer {
  width: calc(100% - 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: auto auto 0;
  padding: 18px 0 20px;
  border-top: 1px solid var(--preview-line);
  color: var(--preview-muted);
  font-size: 0.66rem;
}

.public-preview-footer > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.public-preview-footer strong {
  color: var(--preview-ink);
}

.public-preview-footer button {
  padding: 0;
  border: 0;
  color: var(--preview-muted);
  background: transparent;
  box-shadow: none;
  font: inherit;
  text-decoration: underline;
}

.public-preview-selfie-content {
  width: min(calc(100% - 60px), 620px);
  flex: 1;
  margin: 0 auto;
  padding: 28px 0 34px;
}

.public-preview-selfie-intro {
  margin-bottom: 22px;
  text-align: center;
}

.public-preview-camera {
  position: relative;
  min-height: 310px;
  display: grid;
  place-content: center;
  justify-items: center;
  overflow: hidden;
  border-radius: 22px;
  color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 50% 32%, rgba(74, 151, 182, 0.34), transparent 32%),
    linear-gradient(145deg, #111d2a, #273b49);
  box-shadow: 0 18px 40px rgba(4, 12, 20, 0.2);
}

.public-preview-camera-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 45%);
}

.public-preview-face-outline {
  position: relative;
  width: 145px;
  height: 190px;
  margin-bottom: 13px;
  border: 3px dashed rgba(65, 220, 204, 0.86);
  border-radius: 48% 48% 43% 43% / 42% 42% 50% 50%;
}

.public-preview-face-head {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 62px;
  height: 78px;
  border-radius: 46%;
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(-50%);
}

.public-preview-face-shoulders {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
  height: 46px;
  border-radius: 50% 50% 18% 18%;
  background: rgba(255, 255, 255, 0.13);
}

.public-preview-camera strong,
.public-preview-camera small {
  position: relative;
  z-index: 1;
}

.public-preview-camera small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.66);
}

.public-preview-capture {
  width: 100%;
  margin-top: 16px;
}

.public-preview-privacy {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 18, 0.68);
  backdrop-filter: blur(5px);
}

.public-preview-privacy > div {
  position: relative;
  width: min(390px, 100%);
  padding: 24px;
  border: 1px solid var(--preview-line);
  border-radius: 18px;
  color: var(--preview-ink);
  background: var(--preview-surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.public-preview-privacy h3,
.public-preview-privacy p {
  margin: 0;
}

.public-preview-privacy p {
  margin-top: 12px;
  color: var(--preview-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.public-preview-privacy button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--preview-line);
  border-radius: 999px;
  color: var(--preview-ink);
  background: var(--preview-control);
  box-shadow: none;
}

.public-site-preview-note {
  margin: 0;
  padding: 11px 20px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-logo-header {
  min-height: 82px;
  padding-inline: 58px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-logo-header .public-preview-event-logo {
  max-width: 100%;
  max-height: 44px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-product img {
  max-width: 68px;
  max-height: 15px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-help {
  right: 14px;
  width: 34px;
  height: 34px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-content {
  padding: 18px 14px 26px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-intro,
.public-site-preview-viewport[data-device="mobile"] .public-preview-selfie-intro {
  display: none;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-tools {
  display: grid;
  gap: 12px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-quality {
  width: 100%;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-tools > button {
  width: 100%;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-result-card {
  border-radius: 18px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-selfie-content {
  width: calc(100% - 28px);
  padding: 18px 0 26px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-camera {
  min-height: 390px;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-footer {
  width: calc(100% - 28px);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.public-site-preview-viewport[data-device="mobile"] .public-preview-footer > div {
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .runtime-public-preview-actions,
  .public-site-preview-header,
  .public-site-preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .public-site-preview-modal {
    padding: 8px;
  }

  .public-site-preview-panel {
    max-height: calc(100vh - 16px);
  }

  .public-site-preview-header {
    position: relative;
    padding-right: 58px;
  }

  .public-site-preview-close {
    position: absolute;
    top: 13px;
    right: 13px;
  }

  .public-site-preview-tabs,
  .public-site-preview-devices {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .public-site-preview-toolbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .public-site-preview-open-tab {
    width: 100%;
  }

  .public-site-preview-stage {
    padding: 12px;
  }
}

.admin-helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.qr-logo-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.qr-logo-event-status {
  width: 100%;
  padding: 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.qr-logo-cropper {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(34, 27, 20, 0.45);
  backdrop-filter: blur(3px);
}

.qr-logo-cropper-panel {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: #fffaf2;
  box-shadow: 0 24px 70px rgba(41, 64, 72, 0.24);
}

.qr-logo-cropper-panel h2 {
  margin: 0;
  padding-right: 34px;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
}

.qr-logo-cropper-panel canvas {
  width: min(100%, 320px);
  height: auto;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: grab;
  touch-action: none;
}

.qr-logo-cropper-panel canvas:active {
  cursor: grabbing;
}

.qr-logo-step {
  display: grid;
  gap: 12px;
}

.qr-logo-confirm-step {
  justify-items: center;
}

.qr-logo-confirm-preview {
  display: grid;
  width: min(100%, 300px);
  aspect-ratio: 1;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr-logo-confirm-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.qr-logo-confirm-warning {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.qr-color-picker {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.qr-color-picker legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.qr-color-picker p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.qr-color-palette {
  display: grid;
  grid-template-columns: repeat(8, minmax(30px, 1fr));
  gap: 8px;
}

.qr-color-swatch {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--qr-swatch);
  box-shadow: 0 0 0 1px rgba(41, 64, 72, 0.24);
}

.qr-color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(18, 140, 126, 0.4);
}

.qr-color-swatch.selected {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--qr-swatch);
}

.qr-logo-confirm-control {
  display: grid;
  gap: 6px;
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.qr-logo-confirm-control input {
  width: 100%;
}

.qr-logo-cropper-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(41, 64, 72, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.2rem;
  line-height: 1;
}

.qr-logo-zoom-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.qr-logo-zoom-control input {
  width: 100%;
}

.qr-logo-cropper-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .qr-logo-manager {
    grid-template-columns: 1fr;
  }

  .qr-color-palette {
    grid-template-columns: repeat(4, minmax(34px, 1fr));
  }
}


/* Admin event groups */
.groups-page .page-content {
  gap: 14px;
}

.group-create-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.group-create-form > .actions,
.group-create-members {
  grid-column: 1 / -1;
}

.group-all-toggle {
  min-height: 100%;
}

.group-create-members,
.group-membership-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.group-create-members h3,
.group-membership-layout h4,
.group-card-section > h4 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.group-event-options,
.group-member-order {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.group-event-option,
.group-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(34, 27, 20, 0.09);
  background: rgba(255, 253, 248, 0.48);
}

.group-event-option {
  cursor: pointer;
}

.group-event-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.group-event-option span,
.group-order-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.group-event-option strong,
.group-order-name strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-event-option small,
.group-order-name small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
}

.group-order-row {
  grid-template-columns: 26px minmax(0, 1fr) auto;
}

.group-order-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 140, 126, 0.11);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 900;
}

.group-order-actions {
  display: flex;
  gap: 4px;
}

.group-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border-radius: 7px;
  font-size: 0.9rem;
  line-height: 1;
}

.group-card-list {
  display: grid;
  gap: 12px;
}

.group-admin-card {
  gap: 12px;
}

.group-card-header {
  align-items: flex-start;
}

.group-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.group-card-section {
  min-width: 0;
}

.group-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.group-editor > .group-membership-layout,
.group-editor > .actions {
  grid-column: 1 / -1;
}

.group-add-member {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.58);
}

.group-add-member-heading {
  display: grid;
  gap: 3px;
}

.group-add-member-heading strong {
  color: var(--primary-dark);
  font-size: 0.82rem;
}

.group-add-member-heading small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.group-add-member-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.group-add-member-controls select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
}

.admin-page .group-add-member-controls .compact-button {
  min-height: 44px;
  padding-inline: 14px;
}

.group-card-qr-section {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.group-qr-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.group-qr-panel > a {
  display: block;
  width: min(180px, 100%);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.group-qr-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.group-resource-name {
  max-width: 100%;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
}

.group-stack-panel {
  margin: 0;
}

.group-runtime-panel .runtime-config-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .group-card-main,
  .group-create-form,
  .group-create-members,
  .group-membership-layout {
    grid-template-columns: 1fr;
  }

  .group-create-form > .actions,
  .group-create-members,
  .group-editor > .group-membership-layout,
  .group-editor > .actions {
    grid-column: auto;
  }

  .group-card-qr-section {
    padding-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .group-runtime-panel .runtime-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .group-editor,
  .group-runtime-panel .runtime-config-grid {
    grid-template-columns: 1fr;
  }

  .group-add-member {
    padding: 10px;
  }

  .group-add-member-controls {
    grid-template-columns: 1fr;
  }

  .group-add-member-controls .compact-button {
    width: 100%;
  }

  .group-order-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .group-order-actions {
    grid-column: 2;
  }
}


/* Photo protection policy editor */
.photo-protection-panel > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.photo-protection-panel[open] > summary .runtime-config-disclosure {
  transform: rotate(90deg);
}

.photo-protection-body {
  padding: 0 10px 10px;
}

.photo-protection-notice {
  display: flex;
  gap: 8px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-left: 3px solid #2f6f8f;
  background: #edf6fa;
  color: #244b60;
  font-size: 0.76rem;
}

.photo-protection-notice strong {
  flex: 0 0 auto;
}

.photo-protection-editor {
  display: grid;
  gap: 14px;
}

.photo-protection-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.photo-protection-enabled {
  width: min(520px, 100%);
}

.photo-protection-version {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: right;
}

.photo-protection-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.photo-protection-section-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.photo-protection-section-head h4,
.photo-rule-group-head label > span {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.photo-protection-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.photo-person-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.photo-person-row {
  display: grid;
  grid-template-columns: 54px minmax(150px, 1fr) auto auto 32px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-person-preview {
  display: grid;
  width: 54px;
  height: 54px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f5f7f7;
}

.photo-person-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-person-preview span {
  padding: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
}

.photo-person-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.photo-person-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-person-row input,
.photo-rule-row input,
.photo-rule-row select,
.photo-rule-group-head select,
.photo-protection-password input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 0.78rem;
}

.photo-person-state,
.photo-condition-count {
  padding: 5px 7px;
  border: 1px solid rgba(47, 111, 143, 0.22);
  border-radius: 999px;
  background: #edf6fa;
  color: #2f6078;
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.photo-person-state.ready {
  border-color: rgba(24, 122, 82, 0.25);
  background: #eef8f3;
  color: #176747;
}

.photo-person-state.required {
  border-color: rgba(165, 57, 45, 0.22);
  background: #fff2f0;
  color: #8d2f25;
}

.photo-person-empty,
.photo-rule-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.photo-protection-panel .icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(141, 36, 36, 0.2);
  border-radius: 6px;
  background: #fff;
  color: #8d2424;
  font-size: 1rem;
  line-height: 1;
}

.photo-protection-panel .icon-button:hover,
.photo-protection-panel .icon-button:focus-visible {
  border-color: rgba(141, 36, 36, 0.45);
  background: #fff1f0;
}

.photo-protection-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-protection-method {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.photo-protection-method.selected {
  border-color: rgba(18, 140, 126, 0.48);
  background: rgba(18, 140, 126, 0.06);
}

.photo-protection-method input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.photo-protection-method span {
  display: grid;
  gap: 3px;
}

.photo-protection-method strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.photo-protection-method small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.photo-protection-password {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-protection-password.hidden {
  display: none;
}

.photo-protection-password label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.photo-protection-password p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.photo-protection-progress {
  display: grid;
  gap: 5px;
}

.photo-protection-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebed;
}

.photo-protection-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.photo-protection-progress small {
  color: var(--muted);
  font-size: 0.68rem;
}

.photo-rule-builder {
  min-width: 0;
}

.photo-rule-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-left: 3px solid rgba(18, 140, 126, 0.42);
  background: rgba(255, 255, 255, 0.62);
}

.photo-rule-group.nested {
  margin-left: 12px;
  border-left-color: rgba(47, 111, 143, 0.45);
  background: rgba(237, 246, 250, 0.46);
}

.photo-rule-group-head {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
}

.photo-rule-group-head label {
  display: grid;
  grid-template-columns: auto 130px;
  gap: 8px;
  align-items: center;
}

.photo-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.photo-rule-children {
  display: grid;
  gap: 7px;
}

.photo-rule-row {
  display: grid;
  grid-template-columns: 92px minmax(130px, 1fr) 130px 32px;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 0 7px 10px;
  border-left: 1px solid rgba(34, 27, 20, 0.12);
}

.photo-rule-count {
  grid-template-columns: 92px 100px minmax(90px, 140px) 32px;
}

.photo-rule-kind {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.photo-protection-preview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border-left: 3px solid #5c6b4f;
  background: #f2f5ee;
}

.photo-protection-preview > span {
  color: #4b5940;
  font-size: 0.7rem;
  font-weight: 900;
}

.photo-protection-preview output {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.photo-protection-save-actions {
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.photo-protection-save-status {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 1em;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.photo-protection-save-status.error {
  color: #8d2f25;
}

.photo-protection-save-actions [data-protection-save].is-busy {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.photo-protection-save-actions [data-protection-save].is-busy::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  flex: 0 0 auto;
  animation: photo-protection-spin 0.7s linear infinite;
}

@keyframes photo-protection-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 820px) {
  .photo-person-list,
  .photo-protection-methods,
  .photo-protection-password {
    grid-template-columns: 1fr;
  }

  .photo-protection-password p {
    grid-column: auto;
  }

  .photo-protection-toolbar,
  .photo-protection-section-head,
  .photo-rule-group-head {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-protection-version {
    text-align: left;
  }

  .photo-rule-actions {
    justify-content: flex-start;
  }

  .photo-rule-row,
  .photo-rule-count {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
  }

  .photo-rule-kind {
    grid-column: 1 / -1;
  }

  .photo-protection-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .photo-protection-save-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-protection-save-status {
    text-align: left;
  }

  .photo-protection-save-actions [data-protection-save] {
    align-self: flex-end;
  }

  .photo-protection-notice,
  .photo-person-row,
  .photo-rule-group-head label,
  .photo-rule-row,
  .photo-rule-count {
    grid-template-columns: 1fr;
  }

  .photo-protection-notice {
    display: grid;
  }

  .photo-person-state {
    justify-self: start;
  }

  .photo-person-row .icon-button,
  .photo-rule-row .icon-button {
    justify-self: end;
  }

  .photo-rule-group.nested {
    margin-left: 5px;
  }
}


/* Photo protection reconciliation and result unlock */
.photo-protection-threshold {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(100px, 150px);
  gap: 6px 10px;
  align-items: center;
  max-width: 430px;
}

.photo-protection-threshold > span {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.photo-protection-threshold input {
  width: 100%;
}

.photo-protection-threshold small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.photo-protection-reconciliation-summary {
  display: grid;
  gap: 3px;
  color: var(--ink);
  font-size: 0.74rem;
}

.photo-protection-reconciliation-summary small {
  color: var(--muted);
}

.group-member-protection-mode {
  display: grid;
  min-width: 180px;
  gap: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.group-member-protection-mode select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.72rem;
}

.result-protection {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid #b97813;
  background: #fff8e8;
  color: #4f3a15;
}

.result-protection.hidden {
  display: none;
}

.result-protection > div:first-child {
  display: grid;
  gap: 3px;
}

.result-protection strong {
  font-size: 0.82rem;
}

.result-protection p {
  margin: 0;
  color: #685529;
  font-size: 0.74rem;
  line-height: 1.4;
}

.result-protection-requirements {
  display: grid;
  gap: 8px;
}

.result-protection-requirement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(106, 77, 21, 0.18);
}

.result-protection-requirement > span,
.result-protection-requirement label > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.result-protection-requirement small {
  color: #796536;
  font-size: 0.68rem;
}

.result-protection-requirement.password {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.result-protection-requirement.password label {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(140px, 220px);
  gap: 10px;
  align-items: center;
}

.result-protection-requirement input {
  width: 100%;
  min-height: 38px;
}

.result-protection-password-status {
  grid-column: 1 / -1;
}

@media (max-width: 680px) {
  .photo-protection-threshold,
  .result-protection-requirement,
  .result-protection-requirement.password,
  .result-protection-requirement.password label {
    grid-template-columns: 1fr;
  }

  .photo-protection-threshold small {
    grid-column: auto;
  }

  .result-protection-requirement button {
    justify-self: start;
  }
}


html.public-maintenance-checking body {
  visibility: hidden;
}

html.public-maintenance-active,
html.public-maintenance-active body {
  min-height: 100%;
}

html.public-maintenance-active body {
  margin: 0;
  background: #f3f5f4;
}

.public-maintenance-screen {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-top: 6px solid #12665d;
  background: #f3f5f4;
  color: #17211f;
}

.public-maintenance-header {
  border-bottom: 1px solid #d9dfdc;
  background: #ffffff;
}

.public-maintenance-header-inner {
  width: min(1180px, calc(100% - 64px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.public-maintenance-header .brand-logo {
  width: 188px;
  max-width: 48vw;
  height: auto;
}

.public-maintenance-header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #43504c;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
}

.public-maintenance-header-status > span {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #c74a3d;
  box-shadow: 0 0 0 4px rgba(199, 74, 61, 0.12);
}

.public-maintenance-stage {
  width: min(1180px, calc(100% - 64px));
  margin: auto;
  padding: 88px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 96px;
}

.public-maintenance-copy {
  max-width: 640px;
}

.public-maintenance-copy .eyebrow {
  margin: 0 0 18px;
  color: #12665d;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.public-maintenance-copy h1 {
  margin: 0;
  color: #17211f;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  letter-spacing: 0;
}

.public-maintenance-lede {
  max-width: 580px;
  margin: 26px 0 0;
  color: #3f4d48;
  font-size: 1.12rem;
  line-height: 1.65;
}

.public-maintenance-recovery {
  max-width: 560px;
  margin: 26px 0 0;
  padding-left: 18px;
  border-left: 3px solid #12665d;
  color: #56625e;
  font-size: 0.94rem;
  line-height: 1.6;
}

.public-maintenance-panel {
  padding: 28px;
  border: 1px solid #d4dcd8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 33, 31, 0.08);
}

.public-maintenance-panel-heading {
  display: grid;
  gap: 7px;
}

.public-maintenance-panel-heading span {
  color: #697570;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.public-maintenance-panel-heading strong {
  color: #17211f;
  font-size: 1.28rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.public-maintenance-progress {
  height: 5px;
  margin: 25px 0 27px;
  overflow: hidden;
  border-radius: 3px;
  background: #e6ebe8;
}

.public-maintenance-progress span {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: 3px;
  background: #12665d;
  animation: public-maintenance-scan 2.2s ease-in-out infinite;
}

@keyframes public-maintenance-scan {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(215%);
  }
  100% {
    transform: translateX(-110%);
  }
}

.public-maintenance-details {
  margin: 0;
}

.public-maintenance-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid #e5e9e7;
}

.public-maintenance-details dt,
.public-maintenance-details dd {
  margin: 0;
  letter-spacing: 0;
}

.public-maintenance-details dt {
  color: #64706c;
  font-size: 0.86rem;
}

.public-maintenance-details dd {
  color: #26322e;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: right;
}

.public-maintenance-footer {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 24px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid #d9dfdc;
  color: #68736f;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
}

@media (prefers-reduced-motion: reduce) {
  .public-maintenance-progress span {
    width: 100%;
    animation: none;
  }
}

@media (max-width: 900px) {
  .public-maintenance-stage {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 64px 0;
  }

  .public-maintenance-panel {
    width: min(100%, 520px);
  }
}

@media (max-width: 640px) {
  .public-maintenance-screen {
    border-top-width: 5px;
  }

  .public-maintenance-header-inner,
  .public-maintenance-stage,
  .public-maintenance-footer {
    width: calc(100% - 40px);
  }

  .public-maintenance-header-inner {
    min-height: 72px;
  }

  .public-maintenance-header-status {
    font-size: 0;
  }

  .public-maintenance-header-status > span {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  .public-maintenance-stage {
    padding: 48px 0;
    gap: 38px;
  }

  .public-maintenance-copy h1 {
    font-size: 2.8rem;
    line-height: 1.05;
  }

  .public-maintenance-lede {
    margin-top: 21px;
    font-size: 1rem;
  }

  .public-maintenance-recovery {
    margin-top: 22px;
  }

  .public-maintenance-panel {
    width: 100%;
    padding: 22px;
  }

  .public-maintenance-details > div {
    gap: 16px;
  }

  .public-maintenance-footer {
    padding: 20px 0 24px;
  }

  .public-maintenance-footer span:last-child {
    display: none;
  }
}

.admin-detail-heading {
  display: grid;
  gap: 14px;
  padding: 4px 2px;
}

.admin-detail-back {
  width: fit-content;
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-detail-back:hover {
  text-decoration: underline;
}

.admin-detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.admin-detail-title-row h1 {
  margin: 3px 0 4px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.admin-detail-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-detail-resource {
  margin-top: 2px;
}

.admin-resource-summary-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, auto) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 22px rgba(90, 63, 22, 0.08);
  padding: 15px 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-resource-summary-card:hover {
  border-color: rgba(18, 140, 126, 0.45);
  box-shadow: 0 14px 28px rgba(90, 63, 22, 0.13);
  transform: translateY(-1px);
}

.admin-resource-summary-card:focus-visible {
  outline: 3px solid rgba(18, 140, 126, 0.3);
  outline-offset: 3px;
}

.admin-resource-summary-copy {
  min-width: 0;
}

.admin-resource-summary-copy h3 {
  margin: 2px 0 3px;
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.admin-resource-summary-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-resource-summary-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-resource-manage-link {
  white-space: nowrap;
}

.admin-resource-detail-card {
  overflow: hidden;
}

.admin-detail-tabs {
  display: grid;
  gap: 0;
  min-width: 0;
}

.admin-detail-tab-list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.admin-detail-tab-list button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-detail-tab-list button:hover {
  background: rgba(18, 140, 126, 0.07);
  color: var(--primary-dark);
}

.admin-detail-tab-list button[aria-selected="true"] {
  border-bottom-color: var(--primary);
  background: rgba(18, 140, 126, 0.1);
  color: var(--primary-dark);
}

.admin-detail-tab-panel {
  min-width: 0;
  padding: 18px 2px 2px;
}

.admin-detail-tab-panel[hidden] {
  display: none;
}

.admin-detail-tab-panel > .runtime-config-panel,
.admin-detail-tab-panel > .photo-protection-panel,
.admin-detail-tab-panel > .stack-log-panel {
  margin: 0;
}

.admin-detail-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-detail-overview-grid > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.74);
  padding: 13px;
}

.admin-detail-overview-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-detail-overview-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
}

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

.admin-detail-page .event-card-grid,
.admin-detail-page .group-card-list {
  gap: 0;
}

.admin-detail-page .event-resource-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-detail-page .event-qr-panel {
  justify-items: start;
}

.admin-detail-page .qr-branding-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
  justify-items: stretch;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.admin-detail-page .qr-branding-layout-readonly {
  grid-template-columns: minmax(230px, 360px);
}

.qr-artwork-card,
.branding-control-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.74);
  padding: 16px;
}

.qr-artwork-card {
  align-content: start;
  justify-items: stretch;
}

.qr-branding-settings {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.branding-control-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.branding-control-heading h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.branding-control-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.admin-detail-page .qr-artwork-card .qr-preview-link {
  display: block;
  width: min(100%, 250px);
  max-width: 250px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.admin-detail-page .qr-artwork-card .event-card-qr {
  width: min(100%, 250px);
  max-width: 250px;
}

.admin-detail-page .qr-artwork-card .qr-preview-link img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.qr-download-button {
  width: 100%;
}

.branding-control-card .qr-manage-actions {
  padding: 0;
}

.branding-control-card .qr-logo-event-status,
.branding-control-card .result-logo-status {
  margin: 0;
}

.branding-control-card .result-branding-admin-content {
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  align-items: center;
}

.branding-control-card .result-logo-admin-preview {
  min-height: 96px;
}

@media (max-width: 980px) {
  .admin-resource-summary-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-resource-summary-status {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .admin-resource-manage-link {
    grid-column: 2;
    grid-row: 1;
  }

  .admin-detail-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-detail-page .qr-branding-layout {
    grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 640px) {
  .admin-detail-title-row {
    display: grid;
    align-items: start;
  }

  .admin-detail-title-row > .secondary-button {
    width: 100%;
  }

  .admin-resource-summary-card {
    grid-template-columns: 1fr;
  }

  .admin-resource-summary-status,
  .admin-resource-manage-link {
    grid-column: auto;
    grid-row: auto;
  }

  .admin-resource-summary-status {
    justify-content: flex-start;
  }

  .admin-resource-manage-link {
    width: 100%;
  }

  .admin-detail-page .event-resource-list,
  .admin-detail-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-overview-wide {
    grid-column: auto;
  }

  .admin-detail-page .qr-branding-layout,
  .admin-detail-page .qr-branding-layout-readonly {
    grid-template-columns: 1fr;
  }

  .branding-control-card .result-branding-admin-content {
    grid-template-columns: 1fr;
  }

  .branding-control-card .qr-manage-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
