:root {
  --accent: #11d6d0;
  --accent-strong: #09b6b4;
  --ink: #162033;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --page: #f2f5f9;
  --dark: #0f172a;
  --admin-bg: #071426;
  --surface-slate: #2c3b4f;
  --surface-soft: #e9eef3;
  --admin-panel: rgba(10, 24, 42, .9);
  --admin-panel-soft: rgba(15, 35, 58, .78);
  --admin-line: rgba(148, 163, 184, .22);
  --admin-text: #eef7fb;
  --admin-muted: #9fb0c4;
  --good: #16a34a;
  --warn: #eab308;
  --bad: #dc2626;
  --good-text: #15803d;
  --warn-text: #b45309;
  --bad-text: #b91c1c;
  --good-tint: #bbf7d0;
  --warn-tint: #fef3c7;
  --bad-tint: #fecaca;
  --text-ink: #111827;
  --surface-black: #050505;
  --admin-tabs-sticky-top: 82px;
  --admin-content-sticky-top: 146px;
  --admin-accent-soft: rgba(17, 214, 208, .16);
  --admin-device: #6d6ff4;
  --admin-device-soft: rgba(109, 111, 244, .14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.38)),
    var(--page);
}

body.setup-gate-open {
  overflow: hidden;
}

/* Boot splash - covers the half-built UI while app.js's boot() is still
   running. Pure CSS reacts to body[data-boot-ready] (set in app.js); no
   JS needed to hide it, so it can never get stuck showing on top of a
   fully-loaded app even if some later boot step throws. */
.app-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(circle at 18% 18%, rgba(17, 214, 208, .22), transparent 30%),
    linear-gradient(135deg, #06111f 0%, #071426 48%, #081d24 100%);
  transition: opacity .5s ease, visibility .5s ease;
}

body[data-boot-ready="true"] .app-boot-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-boot-mark {
  width: clamp(64px, 10vw, 92px);
  filter: drop-shadow(0 0 26px rgba(17, 214, 208, .35));
  animation: app-boot-pulse 2.2s ease-in-out infinite;
}

.app-boot-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.app-boot-corners {
  animation: app-boot-corners 2.2s ease-in-out infinite;
  transform-origin: center;
}

.app-boot-lens {
  animation: app-boot-lens-spin 3.6s linear infinite;
  transform-origin: 256px 267px;
}

.app-boot-status {
  margin: 0 !important;
  color: rgba(238, 247, 251, .72);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
}

@keyframes app-boot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes app-boot-corners {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@keyframes app-boot-lens-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-mark,
  .app-boot-corners,
  .app-boot-lens {
    animation: none;
  }
}

.setup-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 52px);
  color: #f8fbff;
  background:
    radial-gradient(circle at 18% 18%, rgba(17, 214, 208, .22), transparent 30%),
    linear-gradient(135deg, #06111f 0%, #071426 48%, #081d24 100%);
}

.setup-gate-brand {
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  left: clamp(18px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #e6f7fb;
}

.setup-gate-brand strong {
  display: block;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1;
}

.setup-gate-brand span:last-child {
  display: block;
  margin-top: 4px;
  color: rgba(230, 247, 251, .68);
}

.setup-gate-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(148, 224, 228, .22);
  border-radius: 18px;
  background: rgba(5, 16, 31, .82);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px);
}

.setup-gate-panel h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
  color: #ffffff;
}

.setup-gate-panel p {
  color: rgba(238, 247, 251, .72);
  line-height: 1.45;
}

.setup-kicker {
  color: var(--accent) !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .78rem;
}

.setup-gate-panel label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: rgba(238, 247, 251, .78);
}

.setup-gate-panel input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(148, 224, 228, .24);
  border-radius: 12px;
  padding: 0 16px;
  color: #ffffff;
  background: rgba(2, 9, 20, .84);
  outline: none;
}

.setup-gate-panel input:focus {
  border-color: rgba(17, 214, 208, .78);
  box-shadow: 0 0 0 4px rgba(17, 214, 208, .14);
}

.setup-primary,
.setup-secondary {
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 900;
}

.setup-primary {
  color: #02131d;
  background: linear-gradient(135deg, var(--accent), #d8ffff);
  box-shadow: 0 18px 36px rgba(17, 214, 208, .22);
}

.setup-secondary {
  min-height: 42px;
  color: #e8fbff;
  border: 1px solid rgba(148, 224, 228, .28);
  background: rgba(2, 9, 20, .58);
}

.setup-status {
  min-height: 42px;
  border-radius: 12px;
  padding: 12px 14px;
  color: rgba(238, 247, 251, .72);
  background: rgba(2, 9, 20, .48);
  white-space: pre-wrap;
}

.setup-status.good {
  color: var(--good-tint);
  background: rgba(20, 83, 45, .28);
}

.setup-status.warn {
  color: var(--warn-tint);
  background: rgba(113, 63, 18, .3);
}

.setup-status.bad {
  color: var(--bad-tint);
  background: rgba(127, 29, 29, .3);
}

.setup-pairing-qr-wrap {
  justify-self: center;
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}

.setup-pairing-qr-wrap img {
  display: block;
  width: clamp(150px, 22vw, 220px);
  height: clamp(150px, 22vw, 220px);
}

.setup-pairing-code-label {
  justify-self: center;
  margin: 0 !important;
  color: rgba(238, 247, 251, .6) !important;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.setup-pairing-code {
  justify-self: center;
  margin-top: -10px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.setup-pairing-countdown {
  justify-self: center;
  margin: 2px 0 0 !important;
  font-size: .74rem !important;
  color: rgba(238, 247, 251, .5) !important;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.setup-pairing-url {
  justify-self: center;
  margin: -6px 0 0 !important;
  font-size: .8rem !important;
  text-align: center;
}

.setup-event-panel {
  width: min(980px, 100%);
}

.setup-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.setup-event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: min(48vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.setup-event-card {
  display: grid;
  gap: 8px;
  min-height: 136px;
  border: 1px solid rgba(148, 224, 228, .18);
  border-radius: 14px;
  padding: 16px;
  color: #e8fbff;
  background: rgba(255, 255, 255, .06);
  text-align: left;
}

.setup-event-card strong {
  font-size: 1.1rem;
}

.setup-event-card span {
  color: rgba(238, 247, 251, .62);
  line-height: 1.35;
}

.setup-event-card button {
  align-self: end;
  justify-self: start;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #02131d;
  font-weight: 900;
  background: #d8ffff;
}

.setup-gate-fallback {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 224, 228, .18);
}

.setup-gate-fallback p {
  margin: 0;
  color: rgba(238, 247, 251, .62);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
}

.topbar,
.workspace,
.gallery-band {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
}

body:not(.admin-locked) .topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 8px 0;
  background:
    linear-gradient(180deg, rgba(231, 237, 245, .98), rgba(231, 237, 245, .94));
  backdrop-filter: blur(16px);
}

body:not(.admin-locked) .topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(231, 237, 245, .94), rgba(231, 237, 245, .72));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), #06b6d4 52%, #f59e0b);
  box-shadow: 0 14px 26px rgba(37, 99, 235, .24);
  flex: 0 0 auto;
}

.brand-mark.has-logo {
  background-color: var(--surface);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--accent) 22%, rgba(15, 23, 42, .18));
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  letter-spacing: 0;
}

#eventLabel {
  color: var(--muted);
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55vw;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.top-icon {
  width: 36px;
  height: 36px;
  color: var(--dark);
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.top-icon svg {
  width: 18px;
  height: 18px;
}

.admin-lock-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  color: #fff;
  background: var(--dark);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.admin-lock-button.unlocked {
  background: var(--good);
  border-color: transparent;
}

.admin-lock-button svg {
  width: 18px;
  height: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, .1);
  background: rgba(255, 255, 255, .78);
  border-radius: 8px;
  color: var(--dark);
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.session-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

body.admin-view-basic [data-admin-view="debug"] {
  display: none !important;
}

.system-health-card,
.system-stress-card,
.installer-readiness-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgba(248, 250, 252, .9);
}

.installer-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.installer-readiness-grid > div {
  min-height: 84px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
}

.installer-readiness-grid strong {
  color: var(--dark);
  font-size: 14px;
  font-weight: 900;
}

.installer-readiness-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.system-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.system-health-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.system-health-head strong {
  color: var(--dark);
  font-size: 15px;
  font-weight: 900;
}

.system-health-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.system-health-head span.good {
  color: var(--good);
}

.system-health-head span.warn {
  color: #a16207;
}

.system-health-head span.bad {
  color: var(--danger);
}

.no-event-hint {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, #a16207 14%, transparent);
  color: #a16207;
  font-size: 13px;
  font-weight: 800;
}

.no-event-hint[hidden] {
  display: none !important;
}

.system-health-head .wide-button {
  width: auto;
  min-width: 132px;
}

.branding-advanced-toggle {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.system-health-metric {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: #fff;
}

.system-health-metric strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.system-health-metric span {
  min-width: 0;
  color: var(--dark);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.system-health-metric.good {
  border-color: rgba(22, 163, 74, .22);
}

.system-health-metric.warn {
  border-color: rgba(234, 179, 8, .32);
}

.system-health-metric.bad {
  border-color: rgba(220, 38, 38, .3);
}

.stress-test-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.stress-test-grid {
  align-items: end;
}

.stress-test-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, .1);
}

.stress-test-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2563eb);
  transition: width .2s ease;
}

.stress-test-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.system-health-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .system-health-grid,
  .stress-test-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stress-test-actions {
    width: 100%;
    justify-content: stretch;
  }

  .stress-test-actions .wide-button {
    flex: 1;
  }
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, .15);
}

.status-pill.good .status-dot {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .15);
}

.status-pill.bad .status-dot {
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .14);
}

.status-dot.good {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .15);
}

.status-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, .15);
}

.portal-account-status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 18px;
}

.capture-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.preview-wrap {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border-radius: 8px;
  background: #101827;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
  isolation: isolate;
}

.preview-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06), transparent 32%),
    radial-gradient(circle at center, transparent 38%, rgba(0, 0, 0, .22));
  z-index: 2;
}

#previewVideo,
#previewCanvas,
.bridge-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#previewVideo.mirrored,
#previewCanvas.mirrored {
  transform: scaleX(-1);
}

#previewCanvas {
  display: none;
}

.webcam-greenscreen-live #previewVideo {
  display: none;
}

.webcam-greenscreen-live #previewCanvas {
  display: block;
}

.bridge-preview {
  display: none;
  background: #121826;
}

.bridge-mode #previewCanvas {
  display: none;
}

.bridge-mode #previewVideo {
  display: none;
}

.bridge-mode .bridge-preview {
  display: block;
}

.bridge-mode.bridge-webcam-mode #previewVideo {
  display: block;
}

.bridge-mode.bridge-webcam-mode .bridge-preview {
  display: none;
}

.bridge-mode.bridge-webcam-mode.bridge-pause-active .bridge-preview {
  display: block;
}

.customer-screen-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  background-position: center;
  background-size: cover;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-screen-backdrop.active {
  display: block;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
  z-index: 3;
}

.empty-state strong {
  font-size: clamp(24px, 4vw, 48px);
  line-height: 1.05;
}

.empty-state span {
  color: rgba(255, 255, 255, .62);
}

.empty-state.hidden {
  display: none;
}

body.admin-locked.customer-selecting,
body.admin-locked.customer-resulting {
  overflow: hidden;
}

.preview-wrap.bridge-mode .empty-state,
body.admin-locked.customer-selecting .empty-state,
body.admin-locked.customer-resulting .empty-state,
body.admin-locked[data-customer-screen="capture"] .empty-state,
body.admin-locked[data-customer-screen="processing"] .empty-state {
  display: none !important;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .empty-state {
  inset: auto clamp(18px, 3vw, 48px) clamp(26px, 5vh, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .82);
  background: rgba(0, 0, 0, .32);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .empty-state strong {
  font-size: clamp(13px, 1.2vw, 18px);
  line-height: 1;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .empty-state span {
  color: rgba(255, 255, 255, .62);
  font-size: clamp(12px, 1vw, 15px);
}

.countdown {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #fff;
  font-size: clamp(96px, 18vw, 220px);
  font-weight: 900;
  line-height: 1;
  background: rgba(15, 23, 42, .34);
  text-shadow: 0 20px 70px rgba(0, 0, 0, .34);
  z-index: 4;
}

.countdown.active {
  display: grid;
}

.capture-message {
  position: absolute;
  left: var(--customer-capture-message-x, 50%);
  top: var(--customer-capture-message-y, 86%);
  z-index: 4;
  display: none;
  max-width: min(820px, calc(100% - 44px));
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .36);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.capture-message.active {
  display: block;
}

.capture-progress {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 5vh, 64px);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 980px);
  gap: clamp(8px, 1vw, 16px);
  padding: clamp(8px, .9vw, 14px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(0, 0, 0, .32);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(14px);
}

.capture-progress[hidden] {
  display: none;
}

.capture-progress-item {
  position: relative;
  flex: 0 0 auto;
  width: clamp(58px, 6.8vw, 112px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  color: rgba(255, 255, 255, .7);
  background: rgba(0, 0, 0, .28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  font-size: clamp(18px, 2vw, 34px);
  font-weight: 800;
}

.capture-progress-item.has-image {
  border-color: rgba(255, 255, 255, .9);
  color: transparent;
  background: rgba(255, 255, 255, .9);
}

.capture-progress-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.capture-progress-item.done {
  color: var(--text-ink);
  background: rgba(255, 255, 255, .9);
  border-color: rgba(255, 255, 255, .86);
}

.capture-progress-item.done:not(.has-image)::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 12px;
  height: 7px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  rotate: -45deg;
}

.capture-progress-item.active {
  color: #fff;
  border-color: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, .2),
    0 0 0 8px color-mix(in srgb, var(--accent) 54%, transparent),
    0 16px 36px rgba(0, 0, 0, .36);
}

.processing-message {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  padding: 28px;
  color: #fff;
  background: rgb(0 0 0 / var(--customer-processing-overlay-alpha, .42));
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.processing-message.active {
  display: block;
}

.processing-message.error {
  background: rgba(12, 16, 24, .86);
}

.processing-message strong {
  position: absolute;
  left: var(--customer-processing-x, 50%);
  top: calc(var(--customer-processing-y, 50%) - 18px);
  width: min(920px, calc(100% - 56px));
  transform: translate(-50%, -100%);
  font-size: clamp(38px, 6vw, 92px);
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 16px 44px rgba(0, 0, 0, .56);
}

.processing-message span {
  position: absolute;
  left: var(--customer-processing-x, 50%);
  top: calc(var(--customer-processing-y, 50%) + 16px);
  width: min(780px, calc(100% - 56px));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .78);
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 800;
  text-shadow: 0 10px 28px rgba(0, 0, 0, .42);
}

.preview-wrap.flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 5;
  animation: flash .24s ease-out;
}

@keyframes flash {
  0% { opacity: .95; }
  100% { opacity: 0; }
}

body.admin-locked[data-screen-transition="fade"] .customer-ready:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .customer-privacy:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .customer-picker:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .customer-result:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .customer-gallery-overlay:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .capture-message.active,
body.admin-locked[data-screen-transition="fade"] .capture-progress:not([hidden]),
body.admin-locked[data-screen-transition="fade"] .processing-message.active,
body.admin-locked[data-screen-transition="fade"] .countdown.active {
  animation: customer-fade-in var(--customer-transition-duration, 280ms) ease both;
}

body.admin-locked[data-screen-transition="slide"] .customer-ready:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .customer-privacy:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .customer-picker:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .customer-result:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .customer-gallery-overlay:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .capture-message.active,
body.admin-locked[data-screen-transition="slide"] .capture-progress:not([hidden]),
body.admin-locked[data-screen-transition="slide"] .processing-message.active,
body.admin-locked[data-screen-transition="slide"] .countdown.active {
  animation: customer-slide-in var(--customer-transition-duration, 280ms) cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes customer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes customer-slide-in {
  from {
    opacity: 0;
    translate: 0 18px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-locked .customer-ready,
  body.admin-locked .customer-privacy,
  body.admin-locked .customer-picker,
  body.admin-locked .customer-result,
  body.admin-locked .customer-gallery-overlay,
  body.admin-locked .capture-message,
  body.admin-locked .capture-progress,
  body.admin-locked .processing-message,
  body.admin-locked .countdown,
  body.admin-locked .screen-runtime-item {
    animation: none !important;
    transition: none !important;
  }
}

.stage-controls {
  display: grid;
  grid-template-columns: 52px minmax(180px, 280px) 52px 52px;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.primary-action,
.icon-button,
.wide-button,
.text-button,
.tab {
  border: 0;
  border-radius: 8px;
}

.primary-action {
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 30%, transparent);
}

.primary-action:disabled,
.icon-button:disabled,
.wide-button:disabled {
  opacity: .56;
  cursor: not-allowed;
}

.icon-button {
  height: 52px;
  width: 52px;
  display: grid;
  place-items: center;
}

.secondary,
.wide-button {
  color: var(--dark);
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.wide-button {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 800;
}

button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action svg {
  fill: currentColor;
  stroke: none;
}

.side-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.tabs {
  position: sticky;
  top: var(--admin-tabs-sticky-top);
  z-index: 16;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  backdrop-filter: blur(16px);
}

.tabs::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(231, 237, 245, .78), rgba(231, 237, 245, .58));
}

.admin-sidebar {
  display: none;
  min-height: 0;
}

.admin-sidebar-section {
  display: grid;
  gap: 6px;
}

.admin-sidebar-section + .admin-sidebar-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, .16);
}

.admin-sidebar-section > span {
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-sidebar-link {
  min-height: 42px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  text-align: left;
}

.admin-sidebar-link:hover,
.admin-sidebar-link:focus-visible {
  color: var(--dark);
  background: rgba(255, 255, 255, .72);
  outline: none;
}

.admin-sidebar-link.active {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), #eaffff);
  border-color: rgba(17, 214, 208, .34);
  box-shadow: 0 12px 26px rgba(17, 214, 208, .18);
}

.admin-sidebar-link.device-item.active {
  background: linear-gradient(135deg, var(--admin-device), #e4e4ff);
  border-color: rgba(109, 111, 244, .34);
  box-shadow: 0 12px 26px rgba(109, 111, 244, .18);
}

.admin-sidebar-section-neutral {
  margin-bottom: 4px;
}

/* Printer summary cards + print-limit progress card (Drucker page) - the
   card-first, glanceable read that replaces the old always-on raw CRUD
   form as the default view, matching the Admin-Redesign mockup. Raw fields
   still exist unchanged (same IDs/logic), just tucked behind
   #printerEditPanel instead of always visible. */
.printer-card-list {
  display: grid;
  gap: 10px;
}

.printer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
  text-align: left;
  width: 100%;
}

.printer-card:hover,
.printer-card:focus-visible {
  border-color: var(--admin-device, #6d6ff4);
  outline: none;
}

.printer-ic {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--admin-device-soft, rgba(109, 111, 244, .14));
  color: var(--admin-device, #6d6ff4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.printer-ic svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.printer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.printer-info-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dark);
}

.printer-info-desc {
  font-size: 12px;
  color: var(--muted);
}

.printer-tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--page);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 7px;
}

.printer-tag.active {
  color: var(--accent-strong);
  background: var(--admin-accent-soft);
  border-color: rgba(17, 214, 208, .34);
}

.printer-card-add {
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  border-style: dashed;
  background: transparent;
}

.printer-card-add:hover,
.printer-card-add:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent);
  outline: none;
}

.printer-edit-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(248, 250, 252, .9);
  margin-top: 4px;
}

.printer-edit-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.printer-edit-panel-head strong {
  font-size: 13px;
  color: var(--dark);
}

.print-limit-card {
  background: var(--admin-accent-soft);
  border: 1px solid rgba(17, 214, 208, .34);
  border-radius: 12px;
  padding: 18px 20px;
}

.print-limit-usage .num {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dark);
}

.print-limit-usage .num small {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.print-limit-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  overflow: hidden;
  margin: 10px 0 18px;
}

.print-limit-bar .fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}

.print-limit-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.print-limit-field {
  display: grid;
  gap: 6px;
}

.print-limit-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--dark);
}

.print-limit-field input[type="number"] {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

body.admin-workspace-focus .printer-card {
  background: var(--admin-panel-soft);
  border-color: var(--admin-line);
}

body.admin-workspace-focus .printer-info-name {
  color: var(--admin-text);
}

body.admin-workspace-focus .printer-tag {
  background: rgba(255, 255, 255, .06);
  border-color: var(--admin-line);
  color: var(--admin-muted);
}

body.admin-workspace-focus .printer-edit-panel {
  background: var(--admin-panel-soft);
  border-color: var(--admin-line);
}

body.admin-workspace-focus .printer-edit-panel-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .print-limit-usage .num {
  color: var(--admin-text);
}

body.admin-workspace-focus .print-limit-field-label {
  color: var(--admin-text);
}

body.admin-workspace-focus .print-limit-field input[type="number"] {
  background: rgba(7, 20, 38, .5);
  border-color: var(--admin-line);
  color: var(--admin-text);
}

/* Konto & Sync status card + meta grid + sync log - the card-first,
   glanceable read that replaces the old always-on login/status form as
   the default view (raw login/debug fields now live behind
   #accountEditPanel), matching the Admin-Redesign mockup's device page. */
.account-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
}

.account-status-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-status-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--admin-accent-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
}

.account-status-orb::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--good);
  opacity: .5;
}

.account-status-orb.warn::after {
  border-color: var(--warn);
}

.account-status-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 2px;
}

.account-status-sub {
  font-size: 12px;
  color: var(--muted);
}

.account-status-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.account-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.account-status-pill .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.account-status-pill.good {
  color: var(--good);
}

.account-status-pill.warn {
  color: var(--warn);
}

.account-status-actions {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--dark);
  border-color: var(--admin-device, #6d6ff4);
  outline: none;
}

.account-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.account-meta-card {
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.account-meta-card .k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.account-meta-card .v {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dark);
}

.account-meta-card .v.tabular {
  font-variant-numeric: tabular-nums;
}

.account-sync-log .row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.account-sync-log .row:last-child {
  border-bottom: none;
}

.account-sync-log .row .t {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
  width: 44px;
}

.account-sync-log .row .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  flex: none;
}

.account-sync-log .row.warn .pip {
  background: var(--warn);
}

.account-sync-log .row .msg {
  color: var(--dark);
}

.printer-card.device-tint {
  background: var(--admin-device-soft, rgba(109, 111, 244, .14));
  border-color: color-mix(in srgb, var(--admin-device, #6d6ff4) 35%, transparent);
}

.printer-card.device-tint .printer-ic {
  background: var(--admin-device, #6d6ff4);
  color: #fff;
}

body.admin-workspace-focus .account-status-card,
body.admin-workspace-focus .account-meta-card {
  background: var(--admin-panel-soft);
  border-color: var(--admin-line);
}

body.admin-workspace-focus .account-status-name,
body.admin-workspace-focus .account-sync-log .row .msg,
body.admin-workspace-focus .account-meta-card .v {
  color: var(--admin-text);
}

body.admin-workspace-focus .account-status-sub,
body.admin-workspace-focus .account-meta-card .k,
body.admin-workspace-focus .btn-ghost {
  color: var(--admin-muted);
}

body.admin-workspace-focus .account-sync-log .row {
  border-color: var(--admin-line);
}

body.admin-workspace-focus .btn-ghost {
  border-color: var(--admin-line);
}

/* Marks the handoff point on hybrid Geraet+Event pages (e.g. Drucker),
   where hardware fields above are device-scoped but fields below only
   apply to the current event - see the Admin-Redesign Event/Geraet seam. */
/* Guest-journey filmstrip for the Bildschirm-Designer: same 5 screens as
   CUSTOMER_SCREEN_IDS, shown in chronological guest order rather than the
   data model's internal order. Drives the existing #screenLayoutEditorSelect
   via a synthetic change event instead of duplicating its logic. */
.flow-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.flow-arrow {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  opacity: .55;
}

body.admin-workspace-focus .flow-arrow {
  color: var(--admin-muted);
}

.flow-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 74px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
}

.flow-thumb:hover,
.flow-thumb:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.flow-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(17, 214, 208, .18);
}

.flow-thumb-label {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.flow-thumb.active .flow-thumb-label {
  color: var(--accent-strong);
}

body.admin-workspace-focus .flow-thumb {
  border-color: var(--admin-line);
  background: var(--admin-panel-soft);
  color: var(--admin-muted);
}

body.admin-workspace-focus .flow-thumb.active .flow-thumb-label {
  color: var(--accent);
}

/* Static per-step motifs, styled like real guest-screen previews - not
   live-rendered from actual settings, same approach as the mockup itself. */
.flow-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 7px 5px;
  overflow: hidden;
}

.flow-frame-start,
.flow-frame-capture {
  background: linear-gradient(160deg, #182c48, var(--admin-bg));
}

.flow-frame-capture {
  align-items: center;
  justify-content: center;
}

.flow-frame-picker,
.flow-frame-processing {
  background: #152742;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.flow-frame-result {
  background: linear-gradient(160deg, var(--accent), #0a3a3a);
  align-items: center;
  justify-content: center;
}

.flow-frame-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 100%;
}

.flow-frame-grid span {
  height: 13px;
  border-radius: 2px;
  background: #2a4468;
}

.flow-frame-grid span.on {
  background: var(--accent);
}

.flow-frame-capture-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.flow-frame-processing-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, .35);
  border-top-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .flow-frame-processing-ring {
    animation: flow-frame-spin 1.1s linear infinite;
  }
}

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

.flow-frame-title {
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  text-align: center;
}

.flow-frame-btn {
  font-size: 7px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.screen-layout-editor-select-row {
  opacity: .72;
  font-size: 12px;
}

.admin-scope-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
}

.admin-scope-divider::before,
.admin-scope-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.admin-scope-divider span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-strong);
  white-space: nowrap;
}

body.admin-workspace-focus .admin-scope-divider::before,
body.admin-workspace-focus .admin-scope-divider::after {
  background: var(--admin-line);
}

.rail-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rail-group-label.event {
  color: var(--accent-strong);
}

.rail-group-label.device {
  color: var(--admin-device);
}

/* Scope badges: mark a feature/page as Event- or Geraet-scoped, per the
   Admin-Redesign Event/Geraet data-model seam (see store.js EVENT_PACKAGE_SETTING_FIELDS). */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.6;
  vertical-align: middle;
}

.badge .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.badge.event {
  color: var(--accent-strong);
  background: var(--admin-accent-soft);
}

.badge.event .pip {
  background: var(--accent);
}

.badge.device {
  color: var(--admin-device);
  background: var(--admin-device-soft);
}

.badge.device .pip {
  background: var(--admin-device);
}

/* Badges sit inside headings styled by the admin-workspace-focus dark theme
   (e.g. ".screen-editor-head span { color: var(--admin-muted) }"), which
   outranks ".badge.event/.device" on specificity - restate with the
   admin-workspace-focus prefix so the semantic badge color always wins. */
body.admin-workspace-focus .badge.event {
  color: var(--accent-strong);
}

body.admin-workspace-focus .badge.device {
  color: var(--admin-device);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Internal switcher shown atop both tab-screen and tab-designer, since the
   sidebar now has a single "Design" rail entry for both (matches the
   Admin-Redesign mockup's merged Design entry with internal a-tabs). */
.design-subnav {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.design-subnav-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.design-subnav-link.active {
  border-color: var(--accent);
  background: var(--admin-accent-soft, rgba(17, 214, 208, .16));
  color: var(--accent-strong);
}

body.admin-workspace-focus .design-subnav-link {
  border-color: var(--admin-line);
  color: var(--admin-muted);
}

body.admin-workspace-focus .design-subnav-link.active {
  border-color: var(--accent);
  color: var(--accent);
}

.event-switch-wrap {
  position: relative;
}

.event-switch-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(420px, 86vw);
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
}

.event-switch-manage-btn {
  justify-self: start;
}

body.admin-workspace-focus .event-switch-panel {
  background: var(--admin-panel);
  border-color: var(--admin-line);
}

.event-switch-btn,
.device-entry-btn {
  display: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  color: var(--dark);
  font-weight: 800;
  white-space: nowrap;
}

.event-switch-btn:hover,
.event-switch-btn:focus-visible,
.device-entry-btn:hover,
.device-entry-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.event-switch-btn .ic,
.device-entry-btn .ic {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.event-switch-btn .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.event-switch-btn .meta small {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.event-switch-btn .meta strong {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-switch-btn .chev {
  width: 13px;
  height: 13px;
  flex: none;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2.4;
}

.device-entry-btn {
  color: var(--admin-device);
  border-color: rgba(109, 111, 244, .3);
}

.device-entry-btn:hover,
.device-entry-btn:focus-visible {
  border-color: var(--admin-device);
}

body:not(.admin-locked) .event-switch-btn,
body:not(.admin-locked) .device-entry-btn {
  display: flex;
}

.tab {
  height: 38px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: var(--dark);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

body.admin-locked .tab[data-tab="camera"],
body.admin-locked .tab[data-tab="event"],
body.admin-locked .tab[data-tab="designer"],
body.admin-locked .tab[data-tab="settings"] {
  display: none;
}

body.admin-locked .tabs {
  display: none;
}

body.admin-locked {
  background: #000;
}

body.admin-locked .app-shell {
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #000;
}

body.admin-locked .topbar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: auto;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

body.admin-locked .brand,
body.admin-locked .status-pill,
body.admin-locked .session-pill,
body.admin-locked #fullscreenBtn {
  display: none;
}

body.admin-locked .status-row {
  pointer-events: none;
}

body.admin-locked .admin-lock-button {
  pointer-events: auto;
  opacity: .46;
  color: #fff;
  background: rgba(15, 23, 42, .46);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
  backdrop-filter: blur(10px);
}

body.admin-locked .admin-lock-button:hover,
body.admin-locked .admin-lock-button:focus-visible {
  opacity: .92;
}

body.admin-locked:not(.customer-selecting) .workspace {
  position: relative;
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

body.admin-locked:not(.customer-selecting) .capture-stage {
  min-height: 100vh;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

body.admin-locked:not(.customer-selecting) .preview-wrap {
  min-height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .preview-wrap::before {
  background:
    linear-gradient(
      180deg,
      rgb(0 0 0 / var(--customer-start-overlay-alpha, .18)),
      rgb(0 0 0 / var(--customer-start-overlay-alpha, .18))
    ),
    radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, .28));
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .preview-wrap {
  cursor: pointer;
}

body.admin-locked:not(.customer-selecting) .stage-controls,
body.admin-locked:not(.customer-selecting) .gallery-band {
  display: none;
}

.customer-gallery-button {
  display: none;
}

body.admin-locked .customer-gallery-button {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 35;
  width: clamp(78px, 8vw, 120px);
  height: clamp(78px, 8vw, 120px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .16);
  backdrop-filter: blur(10px);
}

body.admin-locked .customer-gallery-button[hidden] {
  display: none;
}

body.admin-locked.customer-selecting .customer-gallery-button {
  display: none !important;
}

.customer-gallery-button svg {
  width: 72%;
  height: 72%;
  fill: rgba(255, 255, 255, .18);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .25));
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .side-panel {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) #tab-layout.panel-view.active {
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  align-content: center;
  overflow: visible;
  pointer-events: none;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-flow {
  width: 100%;
  pointer-events: none;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-ready {
  position: fixed;
  left: var(--customer-start-x, 50%);
  top: var(--customer-start-y, 50%);
  width: min(var(--customer-start-width, 92%), calc(100vw - 32px));
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: center;
  transform: translate(-50%, -50%);
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-start {
  justify-self: center;
  width: auto;
  min-height: 0;
  padding: 8px 14px;
  pointer-events: auto;
  color: var(--customer-start-text-color, #fff);
  background: transparent;
  box-shadow: none;
  font-size: clamp(
    calc(44px * var(--customer-start-scale, 1)),
    calc(7.4vw * var(--customer-start-scale, 1)),
    calc(124px * var(--customer-start-scale, 1))
  );
  font-weight: 500;
  line-height: .98;
  text-shadow: 0 12px 38px rgba(0, 0, 0, .58);
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-start:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .7);
  outline-offset: 8px;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-ready .customer-kicker,
body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-selected-design,
body.admin-locked:not(.customer-selecting):not(.customer-resulting) #customerChooseLayoutBtn {
  display: none !important;
}

body.admin-locked:not(.customer-selecting):not(.customer-resulting) .customer-secondary {
  pointer-events: auto;
  justify-self: center;
  min-width: min(360px, 90vw);
  text-shadow: 0 8px 22px rgba(0, 0, 0, .38);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .side-panel {
  position: fixed;
  inset: 0;
  display: block;
  background: var(--surface-black);
  pointer-events: none;
  z-index: 45;
}

body.admin-locked.customer-selecting.screen-background-active .workspace,
body.admin-locked.customer-resulting.screen-background-active:not(.customer-selecting) .side-panel {
  background-image:
    linear-gradient(rgba(0, 0, 0, .42), rgba(0, 0, 0, .42)),
    var(--customer-screen-background-image);
  background-position: center;
  background-size: cover;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #tab-layout.panel-view.active {
  width: 100vw;
  height: 100vh;
  align-content: stretch;
  gap: 0;
  overflow: hidden;
  pointer-events: auto;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-flow {
  width: 100%;
  height: 100%;
  display: block;
}

body.admin-locked.customer-selecting .workspace {
  min-height: 100vh;
  padding: clamp(22px, 3vw, 48px);
  background: var(--surface-black);
}

.panel-view {
  display: none;
  min-height: 0;
  overflow: auto;
}

.panel-view.active {
  display: grid;
  align-content: start;
  gap: 12px;
}

.customer-flow {
  display: none;
}

.admin-layout-tools {
  display: grid;
  gap: 12px;
}

body.admin-locked .customer-flow {
  display: grid;
  gap: 12px;
}

body.admin-locked .admin-layout-tools {
  display: none;
}

.customer-ready {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 14px;
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  backdrop-filter: blur(12px);
}

.customer-kicker {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-ready h2 {
  color: #fff;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.04;
  text-shadow: 0 10px 26px rgba(0, 0, 0, .24);
}

.customer-privacy {
  display: grid;
  place-items: center;
  width: 100%;
  pointer-events: auto;
}

.customer-privacy[hidden] {
  display: none !important;
}

.customer-privacy-panel {
  width: min(760px, calc(100vw - 40px));
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  padding: clamp(24px, 3.2vw, 46px);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  color: #fff;
  background: rgba(5, 5, 5, .74);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
  backdrop-filter: blur(16px);
}

.customer-privacy-panel > span {
  color: rgba(255, 255, 255, .68);
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.customer-privacy-panel > strong {
  font-size: clamp(28px, 3.2vw, 52px);
  font-weight: 850;
  line-height: 1.04;
}

.customer-privacy-panel p {
  max-height: min(32vh, 280px);
  margin: 0;
  overflow: auto;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 650;
  line-height: 1.35;
  white-space: pre-wrap;
}

.customer-privacy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-privacy-actions .wide-button {
  min-height: clamp(62px, 6vw, 84px);
  border-radius: 999px;
  font-size: clamp(18px, 1.6vw, 24px);
}

body.admin-locked.customer-privacying:not(.customer-selecting):not(.customer-resulting) #tab-layout.panel-view.active,
body.admin-locked.customer-privacying:not(.customer-selecting):not(.customer-resulting) .customer-flow {
  pointer-events: auto;
}

body.admin-locked.customer-privacying:not(.customer-selecting):not(.customer-resulting) .customer-ready {
  display: none !important;
}

body.admin-locked.customer-privacying:not(.customer-selecting):not(.customer-resulting) .customer-privacy {
  position: fixed;
  inset: 0;
  z-index: 56;
  padding: clamp(22px, 4vw, 64px);
}

body.admin-locked.customer-privacying .customer-gallery-button,
body.admin-locked.customer-privacying .screen-runtime-layers {
  display: none !important;
}

.customer-start {
  min-height: 74px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: color-mix(in srgb, var(--customer-accent, var(--accent)) 82%, #111827);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  box-shadow: 0 18px 36px color-mix(in srgb, var(--customer-accent, var(--accent)) 28%, transparent);
}

.customer-start:disabled {
  cursor: not-allowed;
  opacity: .45;
  box-shadow: none;
}

.customer-no-event-hint {
  margin: 0 auto;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  text-align: center;
  max-width: 320px;
}

.customer-no-event-hint[hidden] {
  display: none !important;
}

.customer-selected-design {
  display: grid;
  gap: 4px;
  color: rgba(255, 255, 255, .78);
  text-align: center;
}

.customer-selected-design[hidden],
.customer-secondary[hidden] {
  display: none !important;
}

.customer-selected-design strong {
  color: #fff;
  font-size: 18px;
}

.customer-secondary {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  font-weight: 800;
}

.customer-picker {
  display: grid;
  gap: 14px;
}

.customer-picker[hidden],
.customer-ready[hidden],
.customer-result[hidden] {
  display: none;
}

.customer-result {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  background: rgb(255 255 255 / var(--customer-result-panel-alpha, .9));
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
  gap: 0;
  padding: var(--customer-result-padding, 1vw) clamp(110px, 9vw, 158px) var(--customer-result-padding, 1vw) var(--customer-result-padding, 1vw);
  border: 0;
  border-radius: 0;
  background: var(--surface-black);
  box-shadow: none;
}

body.admin-locked.customer-resulting.screen-background-active:not(.customer-selecting) .customer-result {
  background: rgba(5, 5, 5, .18);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result [hidden] {
  display: none !important;
}

.customer-result .customer-kicker {
  color: var(--muted);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result .customer-kicker,
body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.customer-result h2 {
  color: var(--dark);
  font-size: clamp(28px, 3vw, 42px);
}

.customer-result img {
  max-width: min(100%, 440px);
  max-height: min(58vh, 560px);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result > img {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  background: var(--surface-black);
  box-shadow: none;
}

.customer-result-browser-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  color: var(--text-ink);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .18);
}

.customer-result-browser-button[hidden],
.customer-result-browser[hidden],
.customer-result-selection-label[hidden] {
  display: none;
}

.customer-result-qr {
  width: 112px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-ink);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .16);
}

.customer-result-qr[hidden] {
  display: none;
}

.customer-result-qr img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: none;
}

.customer-result-qr span {
  color: var(--text-ink);
  font-size: 11px;
  font-weight: 900;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-qr {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(92px, 10vw, 172px);
  z-index: 50;
  width: clamp(96px, 10vw, 176px);
  padding: clamp(7px, .75vw, 12px);
  border: clamp(4px, .55vw, 8px) solid rgba(0, 0, 0, .82);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 24px 52px rgba(0, 0, 0, .38);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-qr span {
  display: none;
}

.customer-result-upload-progress {
  width: 172px;
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-ink);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .16);
}

.customer-result-upload-progress[hidden] {
  display: none;
}

.customer-result-upload-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .12);
  overflow: hidden;
}

.customer-result-upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s ease;
}

.customer-result-upload-progress.failed .customer-result-upload-progress-fill {
  background: var(--warn);
}

.customer-result-upload-progress span {
  color: var(--text-ink);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-upload-progress {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(206px, 21vw, 300px);
  z-index: 50;
  width: clamp(140px, 14vw, 200px);
  padding: clamp(7px, .75vw, 10px) clamp(9px, 1vw, 14px);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 52px rgba(0, 0, 0, .28);
}

.customer-result-browser-button svg {
  width: 30px;
  height: 30px;
}

.customer-result-stack-preview {
  display: none;
}

.customer-result-stack-preview[hidden] {
  display: none !important;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-button {
  position: fixed;
  top: clamp(18px, 2vw, 32px);
  left: clamp(18px, 2vw, 32px);
  z-index: 51;
  width: clamp(82px, 8vw, 128px);
  height: clamp(82px, 8vw, 128px);
  color: #fff;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-button svg {
  display: none;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-stack-preview {
  position: absolute;
  inset: 4%;
  display: block;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-stack-preview img {
  position: absolute;
  inset: 9% 6%;
  width: 88%;
  height: 76%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border: clamp(3px, .42vw, 6px) solid #fff;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .38);
  transform: translate(calc(var(--stack-index, 0) * -7px), calc(var(--stack-index, 0) * 7px)) rotate(calc((var(--stack-index, 0) - 1) * -7deg));
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-stack-preview img:first-child {
  z-index: 3;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-button[hidden] {
  display: none;
}

.customer-result-selection-label {
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-ink);
  background: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-selection-label {
  display: none;
}

.customer-result-browser {
  width: min(100%, 760px);
  display: grid;
  gap: 14px;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser {
  position: fixed;
  inset: 0;
  z-index: 76;
  width: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: clamp(88px, 8vw, 124px) clamp(42px, 6vw, 96px) clamp(46px, 6vw, 96px);
  color: #fff;
  background: var(--surface-black);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser[hidden] {
  display: none;
}

.customer-result-browser-close {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .22);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-close {
  position: fixed;
  top: clamp(18px, 2.5vw, 42px);
  left: clamp(18px, 2.5vw, 42px);
  z-index: 77;
  width: clamp(58px, 5vw, 84px);
  height: clamp(58px, 5vw, 84px);
  background: transparent;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-close svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.4;
}

.customer-result-browser-head {
  display: grid;
  gap: 4px;
  text-align: center;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.customer-result-browser-head span {
  color: rgba(255, 255, 255, .55);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-result-browser-head strong {
  color: #fff;
  font-size: clamp(28px, 3.8vw, 58px);
  line-height: 1.04;
  font-weight: 650;
}

.customer-result-options {
  width: min(100%, 720px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-options {
  position: fixed;
  top: clamp(14px, 2vw, 28px);
  left: clamp(14px, 2vw, 28px);
  z-index: 49;
  width: clamp(86px, var(--customer-result-thumb-width, 12vw), 260px);
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: clamp(8px, 1vw, 14px);
  overflow: auto;
  padding: 0 4px 8px 0;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser .customer-result-options {
  position: static;
  width: min(90vw, 1500px);
  height: 100%;
  max-height: none;
  align-content: center;
  justify-self: center;
  grid-template-columns: repeat(auto-fit, minmax(clamp(180px, 20vw, 330px), 1fr));
  gap: clamp(18px, 3vw, 44px);
  overflow: auto;
  padding: 0 2vw 3vw;
}

.customer-result-option {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .78);
  color: var(--dark);
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-option {
  min-height: 0;
  padding: 4px;
  border: 3px solid rgba(255, 255, 255, .42);
  background: rgba(0, 0, 0, .22);
  color: #fff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .42);
  backdrop-filter: blur(8px);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser .customer-result-option {
  gap: 10px;
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid transparent;
  background: transparent;
  color: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.customer-result-option.active {
  border-color: var(--customer-accent, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--customer-accent, var(--accent)) 18%, transparent);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-option.active {
  border-color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--customer-accent, var(--accent)) 72%, transparent);
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser .customer-result-option.active {
  border-color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--customer-accent, var(--accent)) 75%, transparent);
}

.customer-result-option img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: none;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-option img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-browser .customer-result-option img {
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
  box-shadow: 0 26px 54px rgba(0, 0, 0, .36);
}

.customer-result-option span {
  overflow: hidden;
  color: var(--dark);
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-locked.customer-resulting:not(.customer-selecting) .customer-result-option span {
  display: none;
}

.customer-result-action {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.customer-result-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.customer-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerResultActions {
  position: fixed;
  /* Untere Grenze haelt sichtbaren Abstand zum fixierten #customerDoneBtn (max. gemessene
     Unterkante 148px), damit ein niedrig eingestellter --customer-result-actions-y
     (Admin-Setting resultActionsY) den Button-Stack nicht unter "Fertig" schieben kann. */
  top: max(calc(var(--customer-result-actions-y, 50%) - clamp(110px, 13vw, 180px)), 172px);
  right: clamp(14px, 2vw, 28px);
  z-index: 50;
  width: clamp(72px, 7vw, 112px);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: clamp(12px, 2vh, 24px);
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerResultActions .wide-button {
  width: clamp(70px, 7vw, 112px);
  min-height: clamp(70px, 7vw, 112px);
  aspect-ratio: 1;
  display: grid;
  grid-auto-flow: row;
  place-items: center;
  gap: 5px;
  padding: 8px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(11px, .9vw, 15px);
  line-height: 1.05;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .34);
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerResultActions .wide-button svg {
  width: 44%;
  height: 44%;
  stroke-width: 1.75;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerResultActions .customer-action-label {
  max-width: 100%;
  font-size: clamp(10px, .78vw, 13px);
  font-weight: 850;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerPrintBtn {
  background: #ef4444;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerDownloadBtn {
  background: #9333ea;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerAgainBtn {
  background: #334155;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerDoneBtn {
  position: fixed;
  top: clamp(16px, 2.3vw, 36px);
  right: clamp(14px, 2vw, 28px);
  width: clamp(190px, 18vw, 300px) !important;
  height: clamp(62px, 6.4vw, 92px) !important;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 3vw, 46px);
  border-radius: 999px;
  color: var(--text-ink) !important;
  background: #fff;
  font-size: clamp(20px, 2vw, 34px);
  font-weight: 900;
  line-height: 1;
  overflow: visible;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerDoneBtn svg {
  display: none;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerDoneBtn .customer-action-label {
  display: block;
  color: var(--text-ink) !important;
  font-size: inherit;
  line-height: 1;
  overflow: visible;
  text-overflow: clip;
}

body.admin-locked.customer-resulting:not(.customer-selecting) #customerResultDesignBtn {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(18px, 2.3vw, 38px);
  z-index: 50;
  min-height: clamp(44px, 4.8vw, 62px);
  max-width: clamp(138px, 16vw, 240px);
  padding: 0 clamp(12px, 1.4vw, 20px);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .36);
  font-size: clamp(13px, 1vw, 16px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
}

.customer-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 54px);
  color: #fff;
  background: var(--surface-black);
}

.customer-gallery-overlay[hidden] {
  display: none;
}

.customer-gallery-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.customer-gallery-close {
  width: clamp(66px, 6vw, 92px);
  height: clamp(66px, 6vw, 92px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
}

.customer-gallery-close svg {
  width: 78%;
  height: 78%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-gallery-head span {
  display: block;
  color: rgba(255, 255, 255, .56);
  font-size: clamp(15px, 1.5vw, 22px);
  font-weight: 800;
  text-transform: uppercase;
}

.customer-gallery-head h2 {
  overflow: hidden;
  color: #fff;
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 400;
  line-height: .98;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-gallery-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 20vw, 330px), 1fr));
  align-content: start;
  gap: clamp(18px, 3vw, 38px);
  overflow: auto;
  padding: 8px 10px 28px;
}

.customer-gallery-card {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, .9);
  background: transparent;
  text-align: left;
}

.customer-gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #181818;
  box-shadow: 0 22px 44px rgba(0, 0, 0, .34);
}

.customer-gallery-card img.missing-image {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 36%),
    #181818;
}

.customer-gallery-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.customer-gallery-strip img,
.customer-gallery-strip span {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #181818;
  object-fit: cover;
}

.customer-gallery-strip span {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-size: 16px;
  font-weight: 900;
}

.customer-gallery-card span {
  overflow: hidden;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-gallery-empty {
  align-self: center;
  justify-self: center;
  color: rgba(255, 255, 255, .62);
  font-size: clamp(24px, 3vw, 42px);
}

.customer-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: rgb(255 255 255 / var(--customer-picker-panel-alpha, .86));
  border: 1px solid rgba(15, 23, 42, .1);
}

.customer-picker-head h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.customer-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.customer-template-selected {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: rgb(255 255 255 / var(--customer-picker-panel-alpha, .86));
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.customer-template-selected[hidden] {
  display: none;
}

#customerSelectedTemplatePreview {
  width: min(100%, 340px);
  height: auto;
  aspect-ratio: 900 / 520;
  box-sizing: border-box;
  display: block;
  object-fit: contain;
  justify-self: center;
  border-radius: 4px;
  background: transparent;
  filter: drop-shadow(0 16px 30px rgba(15, 23, 42, .2));
}

.customer-template-selected-info {
  display: grid;
  gap: 12px;
}

.customer-template-selected-info span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-template-selected-info strong {
  color: var(--dark);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.04;
}

.customer-template-selected-info p {
  color: var(--muted);
  font-weight: 700;
}

.customer-template-card {
  min-height: 260px;
  display: grid;
  grid-template-rows: minmax(160px, 1fr) auto auto;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgb(255 255 255 / var(--customer-picker-panel-alpha, .86));
  color: var(--dark);
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

.customer-template-card.active {
  border-color: var(--customer-accent, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--customer-accent, var(--accent)) 16%, transparent);
}

.customer-template-thumb {
  max-width: 100%;
  max-height: 190px;
  align-self: center;
  border-radius: 4px;
  background: transparent;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, .14));
}

.customer-template-card strong {
  font-size: 16px;
  line-height: 1.1;
}

.customer-template-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.admin-locked.customer-selecting .capture-stage,
body.admin-locked.customer-selecting .gallery-band {
  display: none;
}

body.admin-locked.customer-selecting .workspace {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

body.admin-locked.customer-selecting .side-panel {
  min-height: calc(100vh - clamp(44px, 6vw, 96px));
  display: block;
}

body.admin-locked.customer-selecting #tab-layout.panel-view.active {
  height: 100%;
  overflow: hidden;
}

body.admin-locked.customer-selecting .customer-flow,
body.admin-locked.customer-selecting .customer-picker {
  width: 100%;
  height: 100%;
}

body.admin-locked.customer-selecting .customer-picker {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-content: stretch;
  justify-items: center;
  gap: clamp(12px, 2.4vh, 28px);
  padding: clamp(54px, 7vh, 96px) clamp(22px, 4vw, 72px) clamp(34px, 5vh, 72px);
  color: #fff;
}

body.admin-locked.customer-selecting .customer-picker-head {
  min-height: 0;
  height: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.admin-locked.customer-selecting .customer-picker-head h2 {
  display: block;
  color: #fff;
  font-size: clamp(28px, 3.3vw, 48px);
  font-weight: 750;
  line-height: 1;
  text-align: center;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .48);
}

body.admin-locked.customer-selecting #customerBackBtn {
  position: fixed;
  top: clamp(18px, 2.5vw, 38px);
  left: clamp(18px, 2.5vw, 38px);
  z-index: 55;
  width: clamp(64px, 6.5vw, 104px);
  min-height: clamp(64px, 6.5vw, 104px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-size: 0;
  box-shadow: none;
}

body.admin-locked.customer-selecting #customerBackBtn::before {
  content: "X";
  font-size: clamp(58px, 6vw, 92px);
  font-weight: 300;
  line-height: 1;
}

body.admin-locked.customer-selecting .admin-lock-button {
  width: clamp(44px, 4.8vw, 58px);
  min-height: clamp(38px, 4vw, 48px);
  justify-content: center;
  padding: 0;
}

body.admin-locked.customer-selecting #adminLockLabel {
  display: none;
}

body.admin-locked.customer-selecting .customer-template-selected {
  grid-row: 4;
  position: static;
  align-self: start;
  z-index: 54;
  width: auto;
  height: auto;
  max-height: none;
  margin-top: clamp(-40px, -3vh, -16px);
  transform: none;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.admin-locked.customer-selecting #customerSelectedTemplatePreview {
  display: none;
}

body.admin-locked.customer-selecting .customer-template-selected-info {
  display: grid;
  min-width: min(280px, 54vw);
  align-content: center;
  justify-items: center;
  gap: 0;
  color: #fff;
}

body.admin-locked.customer-selecting .customer-template-selected-info span {
  display: none;
  color: rgba(255, 255, 255, .56);
  font-size: clamp(13px, 1.2vw, 18px);
}

body.admin-locked.customer-selecting .customer-template-selected-info strong {
  display: none;
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(32px, 4vw, 72px);
  font-weight: 500;
  line-height: 1.04;
  text-overflow: ellipsis;
}

body.admin-locked.customer-selecting .customer-template-selected-info p {
  display: none;
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  font-size: clamp(16px, 1.4vw, 22px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-locked.customer-selecting #customerTemplateStartBtn {
  width: min(250px, 54vw);
  min-height: clamp(48px, 5vw, 66px);
  border-radius: 999px;
  color: var(--text-ink);
  background: rgba(255, 255, 255, .92);
  font-size: clamp(17px, 1.55vw, 23px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
  backdrop-filter: blur(8px);
}

body.admin-locked.customer-selecting .customer-template-grid {
  grid-row: 2;
  width: min(1180px, 88vw);
  height: min(58vh, 560px);
  min-height: 0;
  align-self: center;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(22px, 4vw, 56px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: clamp(20px, 4vh, 54px) max(10vw, calc((88vw - min(1180px, 88vw)) / 2 + 4vw)) clamp(22px, 4vh, 58px);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .52) rgba(255, 255, 255, .12);
  scroll-padding-inline: 40vw;
  scroll-snap-type: x proximity;
}

body.admin-locked.customer-selecting .customer-template-grid::-webkit-scrollbar {
  height: 8px;
}

body.admin-locked.customer-selecting .customer-template-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .08);
}

body.admin-locked.customer-selecting .customer-template-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
}

body.admin-locked.customer-selecting .customer-template-dots {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 18px;
  margin-top: clamp(-32px, -2.6vh, -12px);
}

body.admin-locked.customer-selecting .customer-template-dots[hidden] {
  display: none;
}

body.admin-locked.customer-selecting .customer-template-dot {
  width: 10px;
  height: 10px;
  min-height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .36);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .26);
}

body.admin-locked.customer-selecting .customer-template-dot.active {
  background: #fff;
  transform: scale(1.18);
}

body.admin-locked.customer-selecting .customer-template-card {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 clamp(150px, 17vw, 250px);
  width: auto;
  height: clamp(220px, 34vh, 390px);
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .34);
  overflow: hidden;
  scroll-snap-align: center;
  contain: layout paint;
  opacity: .9;
  transition:
    opacity .2s ease,
    transform .2s ease,
    box-shadow .2s ease;
}

body.admin-locked.customer-selecting .customer-template-card.active {
  z-index: 2;
  flex-basis: clamp(420px, 46vw, 720px);
  height: clamp(280px, 44vh, 500px);
  border-color: rgba(255, 255, 255, .94);
  opacity: 1;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .42),
    0 30px 80px rgba(0, 0, 0, .48);
}

body.admin-locked.customer-selecting .customer-template-card.active::after {
  content: "";
  position: absolute;
  right: clamp(10px, 1.8vw, 22px);
  bottom: clamp(10px, 1.8vw, 22px);
  width: clamp(38px, 4.2vw, 56px);
  height: clamp(38px, 4.2vw, 56px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .28);
}

body.admin-locked.customer-selecting .customer-template-card.active::before {
  content: "";
  position: absolute;
  right: calc(clamp(10px, 1.8vw, 22px) + clamp(10px, 1.2vw, 16px));
  bottom: calc(clamp(10px, 1.8vw, 22px) + clamp(14px, 1.4vw, 20px));
  z-index: 1;
  width: clamp(16px, 2vw, 26px);
  height: clamp(8px, 1vw, 14px);
  border-left: clamp(4px, .45vw, 6px) solid #111827;
  border-bottom: clamp(4px, .45vw, 6px) solid #111827;
  transform: rotate(-45deg);
}

body.admin-locked.customer-selecting .customer-template-thumb {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  align-self: stretch;
  object-fit: contain;
  contain: layout paint;
  border-radius: 8px;
  background: transparent;
  filter: none;
}

body.admin-locked.customer-selecting .customer-template-card strong {
  display: none;
  width: 100%;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-locked.customer-selecting .customer-template-card span {
  display: none;
  width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, .68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-locked):not(.active-tab-camera) .capture-stage,
body:not(.admin-locked):not(.active-tab-camera) .gallery-band,
body.admin-workspace-focus .capture-stage,
body.admin-workspace-focus .gallery-band {
  display: none;
}

body:not(.admin-locked):not(.active-tab-camera) .workspace,
body.admin-workspace-focus .workspace {
  width: min(1680px, 100%);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

body.admin-workspace-focus .topbar {
  width: min(1680px, 100%);
}

body:not(.admin-locked):not(.active-tab-camera) .side-panel,
body.admin-workspace-focus .side-panel {
  min-width: 0;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

body:not(.admin-locked):not(.active-tab-camera) .tabs {
  display: none;
}

body.admin-workspace-focus .tabs {
  display: none !important;
}

body:not(.admin-locked):not(.active-tab-camera) .admin-sidebar,
body.admin-workspace-focus .admin-sidebar {
  position: sticky;
  top: var(--admin-tabs-sticky-top);
  z-index: 16;
  display: grid;
  gap: 18px;
  width: 100%;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  backdrop-filter: blur(16px);
}

body:not(.admin-locked):not(.active-tab-camera) .panel-view.active,
body.admin-workspace-focus .panel-view.active {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

body:not(.admin-locked).active-tab-camera:not(.admin-workspace-focus) .workspace {
  width: min(1680px, 100%);
  grid-template-columns: minmax(520px, 1fr) minmax(840px, 920px);
  align-items: start;
}

body:not(.admin-locked) .side-panel {
  min-width: 0;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

body:not(.admin-locked) .tabs {
  display: none !important;
}

body:not(.admin-locked) .admin-sidebar {
  position: sticky;
  top: var(--admin-tabs-sticky-top);
  z-index: 16;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  display: grid;
  gap: 18px;
  width: 100%;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  backdrop-filter: blur(16px);
}

body:not(.admin-locked) .panel-view.active {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

body.admin-workspace-focus .admin-section > .form-grid,
body.admin-workspace-focus #tab-camera > .form-grid,
body.admin-workspace-focus #tab-event > .form-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-items: start;
}

body.admin-workspace-focus #tab-camera > .button-row,
body.admin-workspace-focus #tab-camera > .preflight-panel,
body.admin-workspace-focus #tab-camera > .event-log-panel,
body.admin-workspace-focus #tab-event > .button-row,
body.admin-workspace-focus #tab-event > .event-log-panel {
  grid-column: 1 / -1;
}

body.admin-workspace-focus .admin-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.admin-workspace-focus .admin-overview-group.event .admin-overview-group-actions,
body.admin-workspace-focus .admin-overview-group.design .admin-overview-group-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-preview {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
}

#printCanvas {
  width: min(100%, 292px);
  height: auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
}

.form-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
}

#tab-settings.panel-view.active {
  overflow: visible;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: grid;
  gap: 12px;
  scroll-margin-top: calc(var(--admin-content-sticky-top) + 70px);
}

.workspace-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  color: var(--dark);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.workspace-section-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-section-head h2 {
  overflow: hidden;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-section-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.workspace-section-head .wide-button {
  width: auto;
  min-width: 150px;
  min-height: 44px;
  padding: 0 14px;
}

.designer-section-head {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(255, 255, 255, .88) 42%),
    rgba(255, 255, 255, .9);
}

.designer-pane-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.designer-pane-title strong {
  color: var(--dark);
  font-size: 14px;
  font-weight: 900;
}

.designer-pane-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

/* Dashboard (data view, Admin-Redesign follow-up) - live system health,
   today's event+box-lifetime usage counters, and per-printer paper level,
   ahead of the quick-launch navigation grid below it. Every number here
   comes from a real data source (SystemMetrics.cs, box-stats.js,
   state.dnpPrinterStatusByProfileId) - no placeholder/fake fields. */
.dashboard-refresh-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-refresh-note .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

.dashboard-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-section-hint {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  opacity: .75;
}

.dashboard-health-grid,
.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.dashboard-health-tile {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-ring-value {
  position: absolute;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dark);
}

.dashboard-health-info { min-width: 0; }
.dashboard-health-info .k { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.dashboard-health-info .v { font-size: 13.5px; font-weight: 800; color: var(--dark); font-variant-numeric: tabular-nums; }

.dashboard-hub-tile { gap: 12px; }
.dashboard-hub-icon {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--admin-accent-soft); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
}
.dashboard-hub-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 800; color: var(--muted);
}
.dashboard-hub-pill .pip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dashboard-hub-pill.good { color: var(--good); }
.dashboard-hub-pill.warn { color: var(--warn); }
.dashboard-hub-latency { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.dashboard-speed-test-btn { margin-left: auto; flex: none; white-space: nowrap; }
.dashboard-speed-test-btn:disabled { opacity: .55; cursor: default; }

.dashboard-stat-card {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  padding: 14px 15px;
}
.dashboard-stat-card .icon {
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--admin-accent-soft); color: var(--accent-strong); margin-bottom: 10px;
}
.dashboard-stat-card .icon svg { width: 14px; height: 14px; }
.dashboard-stat-card .num { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--dark); line-height: 1; }
.dashboard-stat-card .label { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 5px; }
.dashboard-stat-card .box-total { font-size: 10px; color: var(--muted); opacity: .8; margin-top: 6px; font-variant-numeric: tabular-nums; }

.dashboard-printer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dashboard-empty-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 2px;
}
.dashboard-printer-card {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  padding: 14px 16px;
}
.dashboard-printer-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.dashboard-printer-card .name { font-size: 12.5px; font-weight: 800; color: var(--dark); }
.dashboard-printer-card .pill { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; flex: none; }
.dashboard-printer-card .pill.good { color: var(--good-text); background: var(--good-tint); }
.dashboard-printer-card .pill.warn { color: var(--warn-text); background: var(--warn-tint); }
.dashboard-printer-card .amount { font-size: 18px; font-weight: 800; color: var(--dark); font-variant-numeric: tabular-nums; }
.dashboard-printer-card .amount small { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.dashboard-printer-card .bar { height: 6px; border-radius: 999px; background: rgba(15,23,42,.08); overflow: hidden; margin-top: 8px; }
.dashboard-printer-card .bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.dashboard-printer-card .bar .fill.low { background: linear-gradient(90deg, #d97706, var(--warn)); }

body.admin-workspace-focus .dashboard-health-tile,
body.admin-workspace-focus .dashboard-stat-card,
body.admin-workspace-focus .dashboard-printer-card {
  background: var(--admin-panel-soft);
  border-color: var(--admin-line);
}
body.admin-workspace-focus .dashboard-ring-value,
body.admin-workspace-focus .dashboard-health-info .v,
body.admin-workspace-focus .dashboard-stat-card .num,
body.admin-workspace-focus .dashboard-printer-card .name,
body.admin-workspace-focus .dashboard-printer-card .amount {
  color: var(--admin-text);
}
body.admin-workspace-focus .dashboard-health-info .k,
body.admin-workspace-focus .dashboard-stat-card .label,
body.admin-workspace-focus .dashboard-stat-card .box-total,
body.admin-workspace-focus .dashboard-hub-latency,
body.admin-workspace-focus .dashboard-empty-note {
  color: var(--admin-muted);
}
body.admin-workspace-focus .dashboard-hub-pill { color: var(--admin-muted); }
body.admin-workspace-focus .dashboard-hub-pill.good { color: var(--good); }
body.admin-workspace-focus .dashboard-hub-pill.warn { color: var(--warn); }

@media (max-width: 1100px) {
  .dashboard-health-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-printer-grid { grid-template-columns: 1fr; }
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
}

.admin-overview-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .09);
  border-radius: 8px;
  background: rgba(248, 250, 252, .74);
}

.admin-overview-group.event,
.admin-overview-group.design {
  grid-column: span 1;
}

.admin-overview-group.output,
.admin-overview-group.system {
  background: rgba(15, 23, 42, .04);
}

.admin-overview-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.admin-overview-group-head strong {
  min-width: 0;
  color: var(--dark);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.05;
}

.admin-overview-group-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  text-align: right;
}

.admin-overview-group-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-overview-group:not(.event):not(.design) .admin-overview-group-actions {
  grid-template-columns: 1fr;
}

.admin-launch-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  text-align: left;
}

.admin-launch-card-large {
  min-height: 130px;
  padding: 18px;
}

.admin-launch-card.primary {
  color: #fff;
  background: var(--dark);
  border-color: transparent;
}

.admin-launch-card strong {
  font-size: 16px;
  line-height: 1.1;
}

.admin-launch-card-large strong {
  font-size: clamp(19px, 1.8vw, 26px);
}

.admin-launch-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.admin-launch-card-large span {
  font-size: 13px;
}

.admin-launch-card.primary span {
  color: rgba(255, 255, 255, .68);
}

.admin-launch-card.deferred {
  min-height: 72px;
  color: rgba(15, 23, 42, .72);
  background: rgba(248, 250, 252, .78);
  border-style: dashed;
  box-shadow: none;
}

.admin-launch-card.deferred strong {
  font-size: 15px;
}

.license-status-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  color: var(--dark);
  background: rgba(248, 250, 252, .86);
}

.license-status-card strong {
  font-size: 15px;
  font-weight: 950;
}

.license-status-card span,
.license-status-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.license-status-card em {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #064e3b;
  background: rgba(16, 185, 129, .14);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.whitelabel-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, #ffffff), #ffffff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.brand-preview-mark {
  width: 54px;
  height: 54px;
}

.whitelabel-preview div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.whitelabel-preview strong {
  color: var(--dark);
  font-size: 20px;
  line-height: 1.05;
}

.whitelabel-preview span:not(.brand-mark) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.admin-workspace-focus {
  color: var(--admin-text);
  background:
    radial-gradient(circle at 14% 8%, rgba(17, 214, 208, .18), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(37, 99, 235, .16), transparent 30%),
    linear-gradient(180deg, #08192c 0%, var(--admin-bg) 42%, #040b14 100%);
}

body.admin-workspace-focus .app-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 220px),
    transparent;
}

body.admin-workspace-focus .topbar {
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-text);
  background: rgba(5, 16, 29, .82);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}

body.admin-workspace-focus .topbar::after,
body.admin-workspace-focus .tabs::after {
  background: linear-gradient(180deg, rgba(7, 20, 38, .9), rgba(7, 20, 38, 0));
}

body.admin-workspace-focus .brand-mark {
  background:
    linear-gradient(135deg, var(--accent), #22d3ee 52%, #ffffff);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 18px 36px rgba(17, 214, 208, .22);
}

/* Event-switch/device-entry pill buttons never got a dark variant when the
   admin-redesign mockup introduced them - they kept the light-mode white
   pill (background: rgba(255,255,255,.82)) even inside the otherwise fully
   dark admin-workspace-focus topbar. Matches the mockup's .event-switch
   (accent-tinted fill) / .device-entry (outline-only, muted) treatment. */
body.admin-workspace-focus .event-switch-btn {
  background: var(--admin-accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--admin-text);
}

body.admin-workspace-focus .event-switch-btn:hover,
body.admin-workspace-focus .event-switch-btn:focus-visible {
  border-color: var(--accent);
}

body.admin-workspace-focus .event-switch-btn .ic {
  color: var(--accent);
}

body.admin-workspace-focus .event-switch-btn .meta small {
  color: var(--admin-muted);
}

body.admin-workspace-focus .event-switch-btn .chev {
  stroke: var(--admin-muted);
}

body.admin-workspace-focus .device-entry-btn {
  background: transparent;
  border-color: rgba(109, 111, 244, .3);
  color: var(--admin-muted);
}

body.admin-workspace-focus .device-entry-btn:hover,
body.admin-workspace-focus .device-entry-btn:focus-visible {
  color: var(--admin-text);
  border-color: var(--admin-device);
}

body.admin-workspace-focus .device-entry-btn .ic {
  color: var(--admin-device);
}

body.admin-workspace-focus h1,
body.admin-workspace-focus .workspace-section-head h2,
body.admin-workspace-focus .admin-overview-group-head strong,
body.admin-workspace-focus .designer-pane-title strong,
body.admin-workspace-focus .screen-editor-head strong,
body.admin-workspace-focus .preflight-head strong,
body.admin-workspace-focus .event-log-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus #eventLabel,
body.admin-workspace-focus .workspace-section-head p,
body.admin-workspace-focus .workspace-section-head span,
body.admin-workspace-focus .admin-overview-group-head span,
body.admin-workspace-focus .designer-pane-title span,
body.admin-workspace-focus .screen-editor-head span {
  color: var(--admin-muted);
}

body.admin-workspace-focus .status-pill,
body.admin-workspace-focus .top-icon,
body.admin-workspace-focus .admin-lock-button,
body.admin-workspace-focus .admin-sidebar,
body.admin-workspace-focus .form-grid,
body.admin-workspace-focus .admin-overview-grid,
body.admin-workspace-focus .workspace-section-head,
body.admin-workspace-focus .camera-liveview-card,
body.admin-workspace-focus .preflight-panel,
body.admin-workspace-focus .event-log-panel,
body.admin-workspace-focus .portal-sync-panel,
body.admin-workspace-focus .screen-object-panel {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: var(--admin-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

body.admin-workspace-focus .admin-sidebar {
  background: rgba(5, 16, 29, .86);
}

body.admin-workspace-focus:not(.active-tab-camera) .admin-sidebar {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: rgba(5, 16, 29, .86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

body.admin-workspace-focus .session-pill,
body.admin-workspace-focus .tab {
  color: var(--admin-muted);
}

body.admin-workspace-focus .admin-sidebar-section > span {
  color: rgba(159, 176, 196, .82);
}

body.admin-workspace-focus .admin-sidebar-section + .admin-sidebar-section {
  border-top-color: var(--admin-line);
}

body.admin-workspace-focus .admin-sidebar-link {
  color: var(--admin-muted);
}

body.admin-workspace-focus .admin-sidebar-link:hover,
body.admin-workspace-focus .admin-sidebar-link:focus-visible {
  color: var(--admin-text);
  background: rgba(17, 214, 208, .1);
  border-color: rgba(17, 214, 208, .16);
}

body.admin-workspace-focus .tab.active,
body.admin-workspace-focus .admin-sidebar-link.active {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), #eaffff);
  box-shadow: 0 14px 30px rgba(17, 214, 208, .22);
}

body.admin-workspace-focus .admin-overview-group,
body.admin-workspace-focus .admin-overview-group.system,
body.admin-workspace-focus .screen-editor-head,
body.admin-workspace-focus .license-status-card,
body.admin-workspace-focus #tab-camera .screen-editor-head,
body.admin-workspace-focus .preflight-item,
body.admin-workspace-focus .layer-item,
body.admin-workspace-focus .screen-item-button,
body.admin-workspace-focus .screen-item-empty {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: var(--admin-panel-soft);
}

body.admin-workspace-focus .designer-section-head {
  background:
    linear-gradient(135deg, rgba(17, 214, 208, .14), rgba(15, 35, 58, .88) 42%),
    var(--admin-panel);
}

body.admin-workspace-focus .admin-launch-card {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: rgba(11, 27, 47, .92);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .2);
}

body.admin-workspace-focus .admin-launch-card.primary {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), #dffeff);
}

body.admin-workspace-focus .admin-launch-card.primary span {
  color: rgba(6, 17, 31, .72);
}

body.admin-workspace-focus .admin-launch-card span,
body.admin-workspace-focus .layer-item span,
body.admin-workspace-focus .screen-item-content span,
body.admin-workspace-focus label,
body.admin-workspace-focus .license-status-card span,
body.admin-workspace-focus .license-status-card p,
body.admin-workspace-focus .preflight-item p,
body.admin-workspace-focus .field-note {
  color: var(--admin-muted);
}

body.admin-workspace-focus .license-status-card em {
  color: #99f6e4;
  background: rgba(17, 214, 208, .13);
}

body.admin-workspace-focus .whitelabel-preview {
  border-color: var(--admin-line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), rgba(255, 255, 255, .06));
  box-shadow: 0 18px 34px rgba(0, 0, 0, .22);
}

body.admin-workspace-focus .whitelabel-preview strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .whitelabel-preview span:not(.brand-mark) {
  color: var(--admin-muted);
}

body.admin-workspace-focus input,
body.admin-workspace-focus select,
body.admin-workspace-focus textarea {
  border-color: rgba(148, 163, 184, .26);
  color: var(--admin-text);
  background: rgba(4, 13, 24, .84);
}

body.admin-workspace-focus input::placeholder,
body.admin-workspace-focus textarea::placeholder {
  color: rgba(159, 176, 196, .72);
}

body.admin-workspace-focus .secondary,
body.admin-workspace-focus .wide-button,
body.admin-workspace-focus .file-button {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: rgba(15, 35, 58, .9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

body.admin-workspace-focus .primary-action,
body.admin-workspace-focus .wide-button:not(.secondary):not(.danger-button),
body.admin-workspace-focus .admin-lock-button.unlocked {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), #eaffff);
  box-shadow: 0 16px 34px rgba(17, 214, 208, .24);
}

body.admin-workspace-focus .danger-button {
  color: #fff;
  background: linear-gradient(135deg, var(--bad), #f87171);
  border-color: rgba(248, 113, 113, .44);
  box-shadow: 0 14px 30px rgba(220, 38, 38, .2);
}

body.admin-workspace-focus .print-preview,
body.admin-workspace-focus .designer-toolbar,
body.admin-workspace-focus .designer-workbench-grid,
body.admin-workspace-focus .designer-settings-card,
body.admin-workspace-focus .designer-pane,
body.admin-workspace-focus .screen-layout-preview {
  border-color: var(--admin-line);
  background: rgba(5, 16, 29, .72);
}

body.admin-workspace-focus .designer-rail,
body.admin-workspace-focus .designer-inspector {
  background: rgba(5, 16, 29, .45);
  border-color: var(--admin-line);
}

body.admin-workspace-focus .designer-toolbar-field span,
body.admin-workspace-focus .designer-rail-heading,
body.admin-workspace-focus .designer-rail-field span,
body.admin-workspace-focus .template-availability-label,
body.admin-workspace-focus .designer-stage-meta {
  color: var(--admin-muted);
}

body.admin-workspace-focus .designer-rail-tool {
  color: var(--admin-muted);
}

body.admin-workspace-focus .designer-rail-tool:hover {
  background: var(--admin-panel-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

body.admin-workspace-focus .designer-rail-divider {
  background: var(--admin-line);
}

body.admin-workspace-focus .template-availability-item {
  border-color: var(--admin-line);
  background: var(--admin-panel-soft);
}

body.admin-workspace-focus .template-availability-item strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .template-availability-item small {
  color: var(--admin-muted);
}

body.admin-workspace-focus .designer-selection-bar {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--admin-accent-soft);
}

body.admin-workspace-focus .designer-selection-bar strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .designer-selection-actions button {
  background: rgba(15, 35, 58, .9);
  border-color: var(--admin-line);
  color: var(--admin-text);
}

body.admin-workspace-focus .layer-row-actions button {
  background: rgba(148, 163, 184, .16);
  color: var(--admin-text);
}

body.admin-workspace-focus .screen-layout-group,
body.admin-workspace-focus .screen-property-section {
  border-color: var(--admin-line);
  background: rgba(5, 16, 29, .72);
}

body.admin-workspace-focus .screen-property-grid {
  border-color: var(--admin-line);
}

body.admin-workspace-focus .screen-object-panel-head strong,
body.admin-workspace-focus .screen-property-section summary {
  color: var(--admin-text);
}

body.admin-workspace-focus .screen-object-panel-head span {
  color: var(--admin-muted);
}

body.admin-workspace-focus .installer-readiness-card,
body.admin-workspace-focus .installer-readiness-grid > div,
body.admin-workspace-focus .system-health-card,
body.admin-workspace-focus .system-stress-card {
  border-color: var(--admin-line);
  color: var(--admin-text);
  background: rgba(5, 16, 29, .72);
}

body.admin-workspace-focus .system-health-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .system-health-head span {
  color: var(--admin-muted);
}

body.admin-workspace-focus .branding-advanced-toggle {
  color: var(--admin-muted);
}

body.admin-workspace-focus .installer-readiness-grid strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .installer-readiness-grid span {
  color: var(--admin-muted);
}

body.admin-workspace-focus .camera-liveview-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .camera-liveview-head span {
  color: var(--admin-muted);
}

body.admin-workspace-focus #cameraAdminLiveviewBadge {
  border-color: rgba(17, 214, 208, .2);
  color: #99f6e4;
  background: rgba(17, 214, 208, .1);
}

body.admin-workspace-focus #cameraAdminLiveviewBadge.good {
  border-color: rgba(45, 212, 191, .34);
  color: #99f6e4;
  background: rgba(20, 184, 166, .14);
}

body.admin-workspace-focus #cameraAdminLiveviewBadge.warn {
  border-color: rgba(245, 158, 11, .32);
  color: #fde68a;
  background: rgba(245, 158, 11, .12);
}

body.admin-workspace-focus #cameraAdminLiveviewBadge.bad {
  border-color: rgba(248, 113, 113, .34);
  color: var(--bad-tint);
  background: rgba(248, 113, 113, .12);
}

body.admin-workspace-focus .camera-liveview-frame {
  border-color: rgba(148, 163, 184, .2);
  background: #05070d;
}

body.admin-workspace-focus .designer-canvas-frame,
body.admin-workspace-focus .screen-layout-stage {
  border-color: rgba(148, 163, 184, .2);
  background-color: #0b1624;
}

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

  .admin-overview-group.event,
  .admin-overview-group.design {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .admin-overview-group-actions,
  .admin-overview-group.event .admin-overview-group-actions,
  .admin-overview-group.design .admin-overview-group-actions {
    grid-template-columns: 1fr;
  }
}

.screen-editor-grid {
  align-content: start;
}

.screen-editor-grid > .screen-editor-head:first-child {
  order: -4;
}

.screen-designer-shell {
  display: grid;
  grid-template-columns: minmax(620px, 1.42fr) minmax(340px, .58fr);
  gap: 18px;
  align-items: start;
  scroll-margin-top: calc(var(--admin-content-sticky-top) + 82px);
  order: -2;
}

.screen-designer-shell.tools-hidden {
  grid-template-columns: 1fr;
}

.screen-preset-gallery {
  display: grid;
  gap: 6px;
}

.screen-preset-gallery-head {
  display: grid;
  gap: 2px;
}

.screen-preset-gallery-head strong {
  font-size: 13px;
  color: var(--dark);
}

.screen-preset-gallery-head span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

body.admin-workspace-focus .screen-preset-gallery-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .screen-preset-gallery-head span {
  color: var(--admin-muted);
}

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

.preset-card {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.preset-card:hover,
.preset-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.preset-card.selected {
  border-color: var(--accent);
  background: var(--admin-accent-soft);
  box-shadow: 0 0 0 2px var(--admin-accent-soft);
}

.preset-checkmark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #06111f;
  font-size: 9px;
  font-weight: 800;
}

.preset-card.selected .preset-checkmark {
  display: flex;
}

.preset-thumb {
  position: relative;
  height: 46px;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
}

.preset-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--dark);
}

.preset-meta {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

body.admin-workspace-focus .preset-card {
  border-color: var(--admin-line);
  background: var(--admin-panel-soft);
}

body.admin-workspace-focus .preset-name {
  color: var(--admin-text);
}

body.admin-workspace-focus .preset-meta {
  color: var(--admin-muted);
}

.screen-editor-grid > .screen-layout-controls-head,
.screen-editor-grid > .screen-layout-group {
  order: -1;
}

.screen-designer-preview-column,
.screen-designer-tools-column {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  scroll-margin-top: calc(var(--admin-content-sticky-top) + 82px);
}

.screen-designer-preview-column {
  position: sticky;
  top: calc(var(--admin-content-sticky-top) + 68px);
}

.screen-designer-tools-column {
  grid-template-columns: 1fr;
  position: sticky;
  top: calc(var(--admin-content-sticky-top) + 68px);
  max-height: calc(100vh - var(--admin-content-sticky-top) - 86px);
  overflow-y: auto;
  padding: 0 4px 2px 0;
  scrollbar-gutter: stable;
}

.screen-designer-column-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
}

.screen-designer-column-head strong {
  color: var(--dark);
  font-size: 15px;
}

.screen-designer-column-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.screen-designer-tools-column .screen-object-panel {
  order: 1;
}

.screen-designer-tools-column .screen-object-toolbar {
  order: 2;
}

.screen-designer-tools-column .screen-preset-row {
  order: 3;
}

.screen-designer-tools-column .screen-copy-row {
  order: 4;
}

.screen-designer-tools-column > .button-row {
  order: 5;
}

.screen-designer-tools-column .screen-align-row {
  order: 6;
}

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

.screen-editor-head {
  display: grid;
  gap: 3px;
  padding-bottom: 3px;
}

.screen-editor-head strong {
  color: var(--dark);
  font-size: 16px;
}

.screen-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.full-row {
  grid-column: 1 / -1;
}

.screen-layout-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(248, 250, 252, .82);
}

.texts-advanced-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .texts-advanced-groups {
    grid-template-columns: 1fr;
  }
}

.screen-layout-group[hidden] {
  display: none;
}

.screen-layout-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgba(248, 250, 252, .88);
}

.screen-layout-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.screen-layout-preview-head strong {
  color: var(--dark);
  font-size: 15px;
}

.screen-layout-preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.screen-layout-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--screen-stage-aspect-ratio, 16 / 9);
  min-height: 220px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 32%),
    #121826;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  touch-action: none;
}

.screen-designer-preview-column .screen-layout-stage {
  min-height: clamp(420px, 42vw, 760px);
}

.screen-layout-stage:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .78);
  outline-offset: 4px;
}

.screen-layout-stage.show-grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .11) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .11) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 32%),
    #121826;
  background-size:
    var(--screen-grid-step, 2%) var(--screen-grid-step, 2%),
    var(--screen-grid-step, 2%) var(--screen-grid-step, 2%),
    auto,
    auto;
}

.screen-layout-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, .24), rgba(0, 0, 0, .24)),
    linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 28%),
    linear-gradient(30deg, #1f2937, #020617);
  background-position: center;
  background-size: cover;
}

.screen-layout-media.has-image {
  filter: saturate(.88) brightness(.82);
}

.screen-layout-item {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, .68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
  cursor: grab;
  text-align: center;
  user-select: none;
}

.screen-layout-item.builtin {
  border-style: dashed;
  outline: 0 solid transparent;
  outline-offset: 2px;
  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    outline-color .16s ease,
    outline-width .16s ease;
}

.screen-layout-item.builtin::before {
  content: "Basis";
  position: absolute;
  top: 6px;
  left: 6px;
  opacity: 0;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgba(37, 99, 235, .92);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  pointer-events: none;
  transition: opacity .16s ease;
}

.screen-layout-item.builtin:hover,
.screen-layout-item.builtin:focus-visible,
.screen-layout-item.builtin.active {
  border-color: rgba(37, 99, 235, .78);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, .18),
    0 16px 34px rgba(0, 0, 0, .22);
}

.screen-layout-item.builtin:hover::before,
.screen-layout-item.builtin:focus-visible::before,
.screen-layout-item.builtin.active::before {
  opacity: 1;
}

.screen-layout-item.dragging {
  cursor: grabbing;
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white 30%);
  outline-offset: 2px;
}

.screen-layout-item strong,
.screen-layout-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-layout-item strong {
  font-size: clamp(12px, 1.4vw, 20px);
  line-height: 1.05;
}

.screen-layout-item span {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 800;
}

.screen-layout-item span:empty {
  display: none;
}

.screen-layout-item.hero {
  color: var(--customer-start-text-color, #fff);
  background: rgba(0, 0, 0, .18);
  border-color: rgba(255, 255, 255, .38);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .26);
  font-size: calc(1rem * var(--customer-start-scale, 1));
}

.screen-layout-item.hero span {
  color: color-mix(in srgb, var(--customer-start-kicker-color, #fff) 78%, transparent);
}

.screen-layout-item.message {
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(8px);
}

.screen-layout-item.strong strong {
  font-size: clamp(18px, 2vw, 32px);
}

.screen-layout-item.template-preview,
.screen-layout-item.result-image {
  color: var(--text-ink);
  background: rgba(255, 255, 255, .88);
  border-color: rgba(255, 255, 255, .76);
}

.screen-layout-item.template-preview span,
.screen-layout-item.result-image span {
  color: rgba(15, 23, 42, .58);
}

.screen-layout-item.thumb-strip {
  align-content: center;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .18);
  border-style: dashed;
}

.screen-layout-item.actions {
  background: rgba(20, 20, 20, .68);
}

.screen-layout-item.custom {
  background: rgb(15 23 42 / var(--screen-item-alpha, .76));
  border-style: solid;
}

.screen-layout-item.custom.active {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white 30%);
  outline-offset: 2px;
}

.screen-layout-item.custom.locked {
  cursor: default;
  border-style: dashed;
  outline: 2px solid rgba(255, 255, 255, .44);
  outline-offset: 2px;
}

.screen-layout-item.custom.locked.active {
  outline: 3px solid color-mix(in srgb, var(--accent) 56%, white 44%);
}

.screen-layout-item.custom.image,
.screen-layout-item.custom.sessionImage,
.screen-layout-item.custom.qr {
  padding: 0;
  background-position: center;
  background-size: cover;
}

.screen-layout-item.custom.shape,
.screen-runtime-item.shape {
  border-radius: 999px;
}

.screen-layout-item.custom.image strong,
.screen-layout-item.custom.image span,
.screen-layout-item.custom.sessionImage strong,
.screen-layout-item.custom.sessionImage span,
.screen-layout-item.custom.qr strong,
.screen-layout-item.custom.qr span {
  margin: auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .48);
}

.screen-layout-item.no-shadow {
  text-shadow: none;
  box-shadow: none;
}

.screen-layout-item.custom .screen-layout-resize {
  top: auto;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  transform: none;
  cursor: nwse-resize;
}

.screen-layout-item.custom.locked .screen-layout-resize {
  display: none;
}

.screen-object-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.screen-preset-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.screen-copy-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .55fr);
  gap: 8px;
  align-items: end;
}

.screen-align-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.screen-file-button {
  display: grid;
  place-items: center;
  text-align: center;
}

.screen-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.screen-object-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgba(248, 250, 252, .86);
}

.screen-object-panel-head {
  display: grid;
  gap: 3px;
}

.screen-object-panel-head strong {
  color: var(--dark);
  font-size: 14px;
  font-weight: 950;
}

.screen-object-panel-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.screen-item-list {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.screen-designer-tools-column .screen-item-list {
  grid-template-columns: 1fr;
  max-height: min(34vh, 320px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.screen-property-section {
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  overflow: hidden;
}

.screen-property-section summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: var(--dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  list-style: none;
}

.screen-property-section summary::-webkit-details-marker {
  display: none;
}

.screen-property-section summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .52;
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.screen-property-section[open] summary::after {
  transform: rotate(225deg);
}

.screen-property-grid {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(15, 23, 42, .08);
}

.screen-item-section-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.screen-item-button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  text-align: left;
}

.screen-item-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.screen-item-button.hidden-item {
  opacity: .68;
}

.screen-item-button.base-layer {
  border-color: rgba(37, 99, 235, .2);
  background: rgba(239, 246, 255, .92);
}

.screen-item-button.base-layer .screen-item-order {
  background: #2563eb;
}

.screen-item-order {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--dark);
  font-size: 12px;
  font-weight: 950;
}

.screen-item-button.active .screen-item-order {
  background: var(--accent);
}

.screen-item-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.screen-item-content strong,
.screen-item-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-item-content strong {
  color: var(--dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
}

.screen-item-content span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.screen-item-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(15, 23, 42, .18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.screen-runtime-layers {
  display: none;
}

body.admin-locked .screen-runtime-layers {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: block;
  pointer-events: none;
}

.screen-runtime-item {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(8px, 1vw, 18px);
  border-radius: 8px;
  color: var(--screen-item-color, #fff);
  background: rgb(15 23 42 / var(--screen-item-alpha, .72));
  font-size: clamp(14px, 2vw, 40px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 8px 24px rgba(0, 0, 0, .38);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .22);
  transform: rotate(var(--screen-item-rotation, 0deg));
}

.screen-runtime-item.button {
  border-radius: 999px;
}

.screen-runtime-item.button[data-action] {
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.screen-runtime-item.button[data-action]:active {
  transform: rotate(var(--screen-item-rotation, 0deg)) scale(.98);
}

.screen-runtime-item[data-animation="fade"] {
  animation: screen-runtime-fade .42s ease both;
  animation-delay: var(--screen-item-delay, 0ms);
}

.screen-runtime-item[data-animation="slide-up"] {
  animation: screen-runtime-slide-up .48s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--screen-item-delay, 0ms);
}

.screen-runtime-item[data-animation="pop"] {
  animation: screen-runtime-pop .38s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--screen-item-delay, 0ms);
}

.screen-runtime-item.image,
.screen-runtime-item.sessionImage,
.screen-runtime-item.qr {
  padding: 0;
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
}

.screen-runtime-item.qr {
  background-repeat: no-repeat;
}

.screen-runtime-item.no-shadow {
  text-shadow: none;
  box-shadow: none;
}

.screen-runtime-item.timeline-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .24s ease;
}

@keyframes screen-runtime-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: var(--screen-item-opacity, 1);
  }
}

@keyframes screen-runtime-slide-up {
  from {
    opacity: 0;
    transform: translateY(22px) rotate(var(--screen-item-rotation, 0deg));
  }

  to {
    opacity: var(--screen-item-opacity, 1);
    transform: translateY(0) rotate(var(--screen-item-rotation, 0deg));
  }
}

@keyframes screen-runtime-pop {
  from {
    opacity: 0;
    transform: rotate(var(--screen-item-rotation, 0deg)) scale(.88);
  }

  to {
    opacity: var(--screen-item-opacity, 1);
    transform: rotate(var(--screen-item-rotation, 0deg)) scale(1);
  }
}

.screen-layout-resize {
  position: absolute;
  top: 50%;
  right: -9px;
  width: 18px;
  height: 42px;
  transform: translateY(-50%);
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .26);
  cursor: ew-resize;
}

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

.pause-image-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pause-image-preview {
  grid-column: 1 / -1;
  min-height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px dashed rgba(15, 23, 42, .2);
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.pause-image-preview.has-image {
  min-height: 86px;
  border-style: solid;
  background: #fff;
}

.pause-image-preview img {
  width: 100%;
  height: 86px;
  object-fit: cover;
}

.screen-image-preview {
  min-height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px dashed rgba(15, 23, 42, .2);
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.screen-image-preview.has-image {
  min-height: 96px;
  border-style: solid;
  background: #fff;
}

.screen-image-preview img {
  width: 100%;
  height: 96px;
  object-fit: cover;
}

.summary-chip {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .74);
  border-radius: 8px;
}

.summary-chip strong {
  color: var(--dark);
  font-size: 13px;
  line-height: 1.1;
}

.summary-chip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button-row > .wide-button:only-child {
  grid-column: 1 / -1;
}

/* Portal-style workbench: tool rail | canvas stage | properties+layers,
   mirroring the real Photobox-Portal template editor's structure
   (assets/hub.js templateEditorFormHtml: .template-tool-rail / .template-stage
   / .template-inspector) so the two editors read as one family. */
.designer-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .1);
}

.designer-toolbar-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.designer-toolbar-field {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.designer-toolbar-field span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.designer-toolbar-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.template-availability {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, .08);
}

.template-availability-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.template-availability-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-availability-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
}

.template-availability-item:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--admin-accent-soft);
}

.template-availability-item input {
  accent-color: var(--accent);
}

.template-availability-item > span {
  display: flex;
  gap: 5px;
  align-items: baseline;
}

.template-availability-item strong {
  color: var(--dark);
  font-size: 12px;
}

.template-availability-item small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.designer-workbench-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 300px;
  gap: 0;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  overflow: hidden;
  min-height: 560px;
  background: rgba(255, 255, 255, .78);
}

.designer-rail {
  padding: 12px 10px;
  border-right: 1px solid rgba(15, 23, 42, .1);
  background: rgba(248, 250, 252, .7);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.designer-rail-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.designer-rail-tool {
  flex: 1 1 30%;
  min-width: 54px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  cursor: pointer;
}

.designer-rail-tool:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: #fff;
}

.designer-rail-tool .ic {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--admin-accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.designer-rail-tool.wide {
  flex-basis: 100%;
  flex-direction: row;
  justify-content: flex-start;
}

.designer-rail-file {
  position: relative;
  overflow: hidden;
}

.designer-rail-file input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.designer-rail-file select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.designer-rail-divider {
  height: 1px;
  background: rgba(15, 23, 42, .1);
  margin: 2px 0;
}

.designer-rail-heading {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.designer-rail-field {
  display: grid;
  gap: 3px;
}

.designer-rail-field span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.designer-rail-field select,
.designer-rail-field input {
  width: 100%;
}

.designer-rail .toggle-row {
  font-size: 12px;
}

.designer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px;
  min-width: 0;
}

.designer-selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--admin-accent-soft);
}

.designer-selection-bar strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--dark);
}

.designer-selection-bar span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.designer-selection-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.designer-selection-actions button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: #fff;
  color: var(--dark);
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.designer-selection-actions button.danger {
  color: var(--bad);
}

.designer-stage-meta {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.designer-inspector {
  border-left: 1px solid rgba(15, 23, 42, .1);
  background: rgba(248, 250, 252, .7);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.designer-inspector-head {
  padding: 12px 14px 6px;
  display: grid;
  gap: 1px;
}

.designer-inspector-head strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--dark);
}

.designer-inspector-head span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.designer-props-panel {
  padding: 6px 14px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .1);
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.designer-settings-card {
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}

@media (max-width: 1200px) {
  .designer-workbench-grid { grid-template-columns: 1fr; }
  .designer-rail, .designer-inspector { border: 0; border-top: 1px solid rgba(15, 23, 42, .1); }
  .card-row { grid-template-columns: 1fr; }
}

.designer-canvas-frame {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: 560px;
  overflow: auto;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%),
    #f8fafc;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.designer-canvas-stack {
  position: relative;
  width: min(100%, 310px);
}

#designCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
}

/* Interaction-only layer: sits exactly over #designCanvas (which stays the
   sole visual content renderer, print-identical). Holds one real <div> per
   visible layer for native pointer hit-testing/dragging plus real resize-
   and rotate-handle child elements on the selected layer - see designer.js
   renderDesignerStage()/onDesignerStagePointerDown(). */
.designer-stage-overlay {
  position: absolute;
  inset: 0;
  touch-action: none;
  outline: none;
}

.designer-layer-box {
  position: absolute;
  border: 1.5px dashed transparent;
  border-radius: 2px;
  cursor: move;
}

.designer-layer-box:hover {
  border-color: rgba(17, 214, 208, .5);
}

.designer-layer-box.selected {
  border: 1.5px solid var(--accent);
}

.designer-layer-box.locked {
  cursor: not-allowed;
}

.designer-layer-name-badge {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #06111f;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}

.designer-resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .28);
}

.designer-resize-handle.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.designer-resize-handle.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.designer-resize-handle.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.designer-resize-handle.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }

.designer-rotate-handle {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .28);
  cursor: grab;
}

.designer-rotate-handle::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1.5px;
  height: 22px;
  background: var(--accent);
  transform: translateX(-50%);
}

.layer-list {
  display: grid;
  gap: 5px;
  padding: 6px 10px 12px;
  overflow-y: auto;
}

.layer-row {
  display: grid;
  gap: 4px;
}

.layer-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  color: var(--dark);
  text-align: left;
  width: 100%;
}

.layer-row.active .layer-item {
  border-color: var(--accent);
  background: var(--admin-accent-soft);
}

.layer-item strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-item span {
  color: var(--muted);
  font-size: 11px;
}

.layer-badge {
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: rgba(15, 23, 42, .35);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.layer-row.active .layer-badge {
  background: var(--accent);
  color: #06171b;
}

.layer-row-actions {
  display: flex;
  gap: 4px;
  padding-left: 2px;
}

.layer-row-actions button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 0;
  background: rgba(15, 23, 42, .06);
  color: var(--dark);
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.layer-row-actions button.danger {
  color: var(--bad);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--dark);
  padding: 0 10px;
  outline: none;
}

textarea {
  min-height: 78px;
  padding: 10px;
  resize: vertical;
}

input[type="color"] {
  padding: 4px;
}

input[type="file"] {
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.toggle-row {
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--dark);
}

.toggle-row input {
  min-height: 20px;
  width: 20px;
}

.bridge-control[hidden],
.webcam-control[hidden] {
  display: none !important;
}

#tab-camera .screen-editor-head {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, .72);
  border: 1px solid rgba(15, 23, 42, .08);
}

#tab-camera .screen-editor-head.bridge-control {
  background: rgba(37, 99, 235, .07);
  border-color: rgba(37, 99, 235, .16);
}

.camera-source-control,
.webcam-control,
.bridge-control {
  min-width: 0;
}

.camera-action-row {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#tab-camera {
  align-items: start;
}

body.admin-workspace-focus #tab-camera.panel-view.active {
  grid-template-columns: minmax(380px, .95fr) minmax(420px, 1.05fr);
  gap: 14px;
}

body.admin-workspace-focus #tab-camera > .camera-liveview-card {
  grid-column: 1;
  grid-row: 1 / span 8;
  align-self: start;
  position: sticky;
  top: var(--admin-tabs-sticky-top);
}

body.admin-workspace-focus #tab-camera > .form-grid,
body.admin-workspace-focus #tab-camera > .camera-device-list,
body.admin-workspace-focus #tab-camera > .camera-telemetry,
body.admin-workspace-focus #tab-camera > .button-row,
body.admin-workspace-focus #tab-camera > .preflight-panel,
body.admin-workspace-focus #tab-camera > .event-log-panel {
  grid-column: 2;
}

body.admin-workspace-focus #tab-camera > .event-log-panel {
  max-height: 420px;
  overflow: hidden;
}

.camera-liveview-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.camera-liveview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.camera-liveview-head > div {
  display: grid;
  gap: 3px;
}

.camera-liveview-head strong {
  color: var(--dark);
  font-size: 15px;
  line-height: 1.15;
}

.camera-liveview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#cameraAdminLiveviewBadge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, .72);
  font-size: 11px;
  font-weight: 900;
}

#cameraAdminLiveviewBadge.good {
  border-color: rgba(22, 163, 74, .26);
  color: var(--good-text);
  background: rgba(220, 252, 231, .76);
}

#cameraAdminLiveviewBadge.warn {
  border-color: rgba(245, 158, 11, .28);
  color: var(--warn-text);
  background: rgba(254, 243, 199, .78);
}

#cameraAdminLiveviewBadge.bad {
  border-color: rgba(220, 38, 38, .28);
  color: var(--bad-text);
  background: rgba(254, 226, 226, .78);
}

.camera-liveview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  background: #05070d;
}

#cameraAdminPreviewVideo,
#cameraAdminBridgeCanvas {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cameraAdminPreviewVideo.visible,
#cameraAdminBridgeCanvas.visible {
  display: block;
}

#cameraAdminPreviewVideo.mirrored {
  transform: scaleX(-1);
}

.camera-liveview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .74);
  font-weight: 850;
  text-align: center;
}

.camera-liveview-empty[hidden] {
  display: none;
}

#checkBridgeBtn[hidden] + #runPreflightBtn {
  grid-column: 1 / -1;
}

.camera-device-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.camera-device-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.camera-device-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.camera-device-chip strong {
  color: var(--dark);
  font-size: 14px;
}

.camera-device-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.camera-device-chip.good {
  border-color: rgba(22, 163, 74, .3);
}

.camera-device-chip.good span {
  color: var(--good);
}

.camera-device-chip.bad {
  border-color: rgba(220, 38, 38, .28);
}

.camera-device-chip.bad span,
.camera-device-chip.bad {
  color: var(--bad);
}

.camera-telemetry {
  display: grid;
  gap: 3px;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 8px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, .72);
  font-size: 12px;
  font-weight: 850;
}

.camera-telemetry-status {
  color: inherit;
  font-size: 13px;
  line-height: 1.15;
}

.camera-telemetry-meta {
  color: color-mix(in srgb, currentColor 76%, #111827);
  font-size: 12px;
  line-height: 1.25;
}

.camera-telemetry[hidden] {
  display: none;
}

.camera-telemetry.good {
  border-color: rgba(22, 163, 74, .26);
  color: var(--good-text);
  background: rgba(220, 252, 231, .76);
}

.camera-telemetry.warn {
  border-color: rgba(245, 158, 11, .32);
  color: #92400e;
  background: rgba(254, 243, 199, .86);
}

.camera-telemetry.pause {
  border-color: rgba(59, 130, 246, .28);
  color: #1d4ed8;
  background: rgba(219, 234, 254, .82);
}

.camera-telemetry.bad {
  border-color: rgba(220, 38, 38, .28);
  color: var(--bad-text);
  background: rgba(254, 226, 226, .78);
}

.preflight-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
}

.preflight-panel[hidden] {
  display: none;
}

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

.preflight-head strong {
  color: var(--dark);
  font-size: 14px;
}

.preflight-summary {
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(100, 116, 139, .12);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.preflight-summary.good {
  color: var(--good);
  background: rgba(22, 163, 74, .12);
}

.preflight-summary.warn {
  color: #a16207;
  background: rgba(234, 179, 8, .18);
}

.preflight-summary.bad {
  color: var(--bad);
  background: rgba(220, 38, 38, .12);
}

.preflight-list {
  display: grid;
  gap: 7px;
}

.preflight-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .78);
}

.preflight-state {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preflight-item.good .preflight-state {
  background: var(--good);
}

.preflight-item.warn .preflight-state {
  background: #ca8a04;
}

.preflight-item.bad .preflight-state {
  background: var(--bad);
}

.preflight-item strong {
  color: var(--dark);
  font-size: 13px;
}

.preflight-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-log-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
}

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

.event-log-head strong {
  color: var(--dark);
  font-size: 14px;
}

.event-log-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.event-log-head .text-button {
  min-height: 30px;
  padding: 0 10px;
}

.event-log-list {
  max-height: 280px;
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.event-log-entry {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .78);
}

.event-log-entry time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.event-log-entry strong {
  color: var(--dark);
  font-size: 13px;
  line-height: 1.2;
}

.event-log-entry p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-log-entry.good {
  border-color: rgba(22, 163, 74, .22);
}

.event-log-entry.warn {
  border-color: rgba(234, 179, 8, .28);
}

.event-log-entry.bad {
  border-color: rgba(220, 38, 38, .24);
}

.event-log-entry.info {
  border-color: rgba(37, 99, 235, .2);
}

.event-log-empty {
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(248, 250, 252, .82);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.event-chooser {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, .9);
  border: 1px solid rgba(15, 23, 42, .08);
}

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

.event-chooser-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.event-chooser-head strong {
  color: var(--dark);
  font-size: 14px;
}

.event-chooser-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.event-chooser-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.event-chooser-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.event-card {
  min-height: 92px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  color: var(--dark);
  background: rgba(255, 255, 255, .92);
  text-align: left;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

.event-card.active {
  border-color: color-mix(in srgb, var(--accent) 64%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent), 0 12px 26px rgba(15, 23, 42, .08);
}

.event-card strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card span {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-card small {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, .06);
  font-size: 11px;
  font-weight: 900;
}

.event-card.active small {
  color: #fff;
  background: var(--accent);
}

.share-status-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
}

.upload-status-panel {
  background:
    linear-gradient(135deg, rgba(22, 163, 74, .08), rgba(255, 255, 255, .9) 48%),
    rgba(255, 255, 255, .86);
}

.portal-sync-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
}

.portal-events-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 214, 208, .08), rgba(255, 255, 255, .92) 52%),
    rgba(255, 255, 255, .86);
  border: 1px solid rgba(17, 214, 208, .16);
}

.portal-event-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.portal-event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
}

.portal-event-card.active {
  border-color: color-mix(in srgb, var(--accent) 58%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.portal-event-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.portal-event-card strong {
  overflow: hidden;
  color: var(--dark);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-event-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.portal-account-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(17, 214, 208, .24);
  border-radius: 14px;
  background: rgba(7, 20, 38, .64);
}

.portal-account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-account-head strong {
  font-size: 1rem;
  color: var(--admin-text);
}

.portal-account-head span {
  color: var(--admin-muted);
  font-size: .82rem;
  text-align: right;
}

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

.portal-account-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-result {
  min-height: 74px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  padding: 12px;
  color: var(--admin-muted);
  background: rgba(2, 6, 23, .42);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .78rem;
  line-height: 1.45;
}

.portal-result.good {
  border-color: rgba(34, 197, 94, .34);
  color: var(--good-tint);
}

.portal-result.warn {
  border-color: rgba(250, 204, 21, .34);
  color: var(--warn-tint);
}

.portal-result.bad {
  border-color: rgba(248, 113, 113, .38);
  color: var(--bad-tint);
}

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

.share-status-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.share-status-head strong {
  color: var(--dark);
  font-size: 14px;
}

.share-status-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.share-status-head span.good {
  color: #047857;
}

.share-status-head span.warn {
  color: var(--warn-text);
}

body.admin-workspace-focus .portal-events-panel .share-status-head span,
body.admin-workspace-focus .portal-sync-panel .share-status-head span {
  color: var(--admin-muted);
}

body.admin-workspace-focus .portal-sync-panel .share-status-head strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .portal-events-panel {
  background: rgba(7, 20, 38, .72);
  border-color: rgba(17, 214, 208, .2);
}

body.admin-workspace-focus .portal-events-panel .share-status-head strong,
body.admin-workspace-focus .portal-event-card strong {
  color: var(--admin-text);
}

body.admin-workspace-focus .portal-event-card {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(2, 6, 23, .32);
}

body.admin-workspace-focus .portal-event-card span {
  color: var(--admin-muted);
}

.share-status-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.share-status-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .78);
}

.share-status-row.good {
  border-color: rgba(22, 163, 74, .22);
}

.share-status-row.warn {
  border-color: rgba(234, 179, 8, .28);
}

.share-status-row.info {
  border-color: rgba(37, 99, 235, .2);
}

.share-status-row strong {
  overflow: hidden;
  color: var(--dark);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-status-row span,
.share-status-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.share-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.share-status-actions .text-button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .05);
}

.share-status-actions .text-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.share-status-empty {
  padding: 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, .82);
  text-align: center;
}

.danger-button {
  color: #fff;
  background: var(--bad);
  border-color: transparent;
}

.file-button {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 8px;
  color: var(--dark);
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  font-size: 14px;
  font-weight: 800;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.gallery-band {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(15, 23, 42, .08);
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2 {
  font-size: 17px;
}

.text-button {
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  min-height: 78px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

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

.gallery-item img.missing-image {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .12), transparent 36%),
    #f8fafc;
}

.gallery-meta {
  position: absolute;
  inset: auto 8px 50px 8px;
  min-height: 24px;
  padding: 5px 7px;
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, .66);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-thumb-strip {
  position: absolute;
  inset: 8px 8px auto 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.gallery-thumb-strip img,
.gallery-thumb-strip span {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 6px;
  background: rgba(15, 23, 42, .76);
  object-fit: cover;
}

.gallery-thumb-strip span {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.gallery-item button {
  position: absolute;
  inset: auto 8px 8px 8px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  font-weight: 800;
}

.pin-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
}

.pin-dialog::backdrop {
  background: rgba(15, 23, 42, .46);
}

body.admin-locked .print-copies-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}

.pin-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.pin-kicker {
  margin: 0 0 -8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pin-help {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.pin-touch-input {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pin-touch-input input {
  min-height: 64px;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .24em;
}

.developer-pin-dialog .pin-card {
  gap: 14px;
}

.developer-pin-dialog .pin-touch-input input {
  text-align: left;
  padding: 0 18px;
  font-size: 24px;
  letter-spacing: .04em;
}

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

.pin-key {
  min-height: 64px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  color: var(--dark);
  background: #f8fafc;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.pin-key:active {
  transform: translateY(1px);
}

.pin-key.secondary {
  color: var(--muted);
  background: #eef2f7;
  font-size: 22px;
}

.print-copies-dialog .pin-card {
  gap: 18px;
}

.print-copy-stepper {
  display: grid;
  grid-template-columns: 86px minmax(120px, 1fr) 86px;
  gap: 12px;
  align-items: center;
}

.print-copy-stepper input {
  min-height: 86px;
  text-align: center;
  font-size: 46px;
  font-weight: 900;
}

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

.pin-error {
  min-height: 18px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 800;
}

.sync-conflict-dialog {
  width: min(560px, calc(100vw - 32px));
}

.sync-conflict-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.sync-conflict-option {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  background: #f8fafc;
}

.sync-conflict-option strong {
  color: var(--dark);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sync-conflict-option span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.sync-conflict-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-conflict-option .wide-button {
  margin-top: 4px;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-wrap {
    min-height: min(68vh, 560px);
  }

  .side-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body:not(.admin-locked):not(.active-tab-camera) .side-panel,
  body.admin-workspace-focus .side-panel {
    grid-template-columns: 1fr;
  }

  body:not(.admin-locked):not(.active-tab-camera) .admin-sidebar,
  body.admin-workspace-focus .admin-sidebar {
    position: static;
    max-height: none;
    display: flex;
    overflow-x: auto;
  }

  .admin-sidebar-section {
    min-width: 220px;
  }

  body:not(.admin-locked):not(.active-tab-camera) .panel-view.active,
  body.admin-workspace-focus .panel-view.active {
    grid-column: auto;
  }

  body.admin-workspace-focus .tabs,
  body.admin-workspace-focus #tab-camera.panel-view.active,
  body.admin-workspace-focus .admin-section > .form-grid,
  body.admin-workspace-focus #tab-camera > .form-grid,
  body.admin-workspace-focus #tab-event > .form-grid,
  body.admin-workspace-focus .admin-overview-grid,
  body.admin-workspace-focus .admin-overview-group-actions {
    grid-template-columns: 1fr;
  }

  body.admin-workspace-focus #tab-camera > .camera-liveview-card,
  body.admin-workspace-focus #tab-camera > .form-grid,
  body.admin-workspace-focus #tab-camera > .camera-device-list,
  body.admin-workspace-focus #tab-camera > .camera-telemetry,
  body.admin-workspace-focus #tab-camera > .button-row,
  body.admin-workspace-focus #tab-camera > .preflight-panel,
  body.admin-workspace-focus #tab-camera > .event-log-panel {
    grid-column: auto;
    grid-row: auto;
  }

  body.admin-workspace-focus #tab-camera > .camera-liveview-card {
    position: static;
  }

  body.admin-workspace-focus #tab-camera > .event-log-panel {
    max-height: none;
  }

  .screen-designer-shell {
    grid-template-columns: 1fr;
  }

  .screen-designer-preview-column,
  .screen-designer-tools-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .screen-designer-preview-column .screen-layout-stage {
    min-height: min(54vw, 440px);
  }

  .designer-canvas-frame {
    min-height: min(68vh, 520px);
    max-height: none;
  }

  #printCanvas {
    width: min(56vw, 310px);
  }

  .customer-template-selected {
    grid-template-columns: 1fr;
  }

  #customerSelectedTemplatePreview {
    width: min(100%, 300px);
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-left {
    flex-wrap: wrap;
    width: 100%;
  }

  .event-switch-btn .meta strong {
    max-width: calc(100vw - 180px);
  }

  .stage-controls {
    grid-template-columns: 46px minmax(140px, 1fr) 46px 46px;
    gap: 8px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .primary-action {
    height: 50px;
    font-size: 18px;
  }

  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .screen-designer-preview-column,
  .screen-designer-tools-column {
    grid-template-columns: 1fr;
  }

  .button-row,
  .screen-preset-row,
  .screen-copy-row,
  .screen-align-row,
  .template-summary {
    grid-template-columns: 1fr;
  }

  .workspace-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-section-head .wide-button {
    width: 100%;
  }
}
