/* The stylesheet of the admin pages and the sign-in page (its section is at the end). */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/Admin/font/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/Admin/font/poppins-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/Admin/font/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/Admin/font/poppins-700.woff2") format("woff2");
}

:root {
  --admin-primary: #16a34a;
  --admin-primary-hover: #15803d;
  --admin-primary-soft: #f0fdf4;
  --admin-button-bg: #15803d;
  --admin-button-hover: #166534;
  --admin-button-fg: #ffffff;
  --admin-bg: #f0fdf4;
  --admin-surface: #ffffff;
  --admin-border: #d3e9da;
  --admin-border-strong: #b8d8c3;
  --admin-sidebar-bg: #07130c;
  --admin-sidebar-fg: #9db8a8;
  --admin-sidebar-border: #12261a;
  --admin-sidebar-brand-fg: #ffffff;
  --admin-sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --admin-sidebar-hover-fg: #ffffff;
  --admin-sidebar-active-bg: rgba(34, 197, 94, 0.14);
  --admin-sidebar-active-fg: #4ade80;
  --admin-sidebar-accent: #22c55e;
  --admin-sidebar-section-fg: #5f7a6a;
  --admin-text: #0f2a1a;
  --admin-text-muted: #4d6356;
  --admin-success: #15803d;
  --admin-warning: #b45309;
  --admin-danger: #b91c1c;
  --admin-info: #0e7490;
  --admin-on-danger: #ffffff;
  --admin-result-match: var(--admin-success);
  --admin-result-uncertain: var(--admin-warning);
  --admin-result-nomatch: var(--admin-text-muted);
  --admin-overlay: rgba(15, 42, 26, 0.45);
  --admin-stage-bg: #0b1220;
  --admin-stage-fg: #94a3b8;
  --admin-radius: 10px;
  --admin-radius-sm: 6px;
  /* Every button on every page (admin, sign-in, and --lp-radius-btn on the landing page): change both together. */
  --admin-radius-btn: 12px;
  --admin-space: 16px;
  --admin-sidebar-width: 248px;
  --admin-topbar-height: 60px;
  --admin-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --admin-font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --admin-font-size: 14px;
  --admin-shadow: 0 1px 2px rgba(15, 42, 26, 0.05), 0 1px 3px rgba(15, 42, 26, 0.07);
  --admin-shadow-lg: 0 12px 32px rgba(15, 42, 26, 0.13);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--admin-font);
  font-size: var(--admin-font-size);
  line-height: 1.5;
  color: var(--admin-text);
  background: var(--admin-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--admin-primary-hover);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--admin-font-mono);
  font-size: 0.9em;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--admin-text);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--admin-primary);

  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-primary) 25%, transparent);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--admin-bg);
  color: var(--admin-text-muted);
  cursor: not-allowed;
}

input[aria-invalid="true"] {
  border-color: var(--admin-danger);
}

:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.muted {
  color: var(--admin-text-muted);
}

.small {
  font-size: 0.8125rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--admin-topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.admin-sidebar {
  grid-area: sidebar;
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-fg);
  border-right: 1px solid var(--admin-sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: var(--admin-topbar-height);
  padding: 0 1.125rem;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--admin-sidebar-brand-fg);
  flex-shrink: 0;
  text-decoration: none;
}

.admin-brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--admin-primary);
  color: var(--admin-button-fg);
  flex-shrink: 0;
}

.brand-mark .icon {
  width: 18px;
  height: 18px;
}

/* "logo | Vision AI Admin": a divider and the product's name after the logo. In the narrow sidebar the logo is a
   little smaller so the name fits on one line. */
.brand-sep {
  flex: none;
  width: 1px;
  height: 24px;
  margin: 0 0.1rem;
  background: currentColor;
  opacity: 0.35;
}

.brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

/* The sidebar shows the logo alone, large enough to stay sharp; the product's name is in the top bar. */
.admin-brand {
  padding: 0 1.25rem;
}

.admin-brand .brand-logo {
  width: 150px;
  max-width: 100%;
  height: auto;
  flex: none;
}

/* The product's mark (a lens in a camera frame) and its name, at the top of the sidebar. */
.app-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px -8px rgba(34, 197, 94, 0.6);
  transition: transform 0.4s;
}

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

.admin-brand:hover .app-mark {
  transform: rotate(-6deg) scale(1.06);
}

.app-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.app-name strong {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.app-name em {
  font-style: normal;
  background: linear-gradient(135deg, #86efac, #22c55e 55%, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-badge {
  flex: none;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

/* "Powered by" and the company's logo, kept at the foot of the sidebar. */
.admin-powered {
  position: relative;
  margin: auto 0.875rem 0.875rem;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(74, 222, 128, 0.14);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(34, 197, 94, 0.14), transparent 70%),
    rgba(255, 255, 255, 0.025);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* A thin bright line along the card's top edge. */
.admin-powered::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(134, 239, 172, 0.7), transparent);
}

.admin-powered:hover {
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow: 0 10px 30px -14px rgba(34, 197, 94, 0.55);
}

/* "— POWERED BY —" */
.admin-powered span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--admin-sidebar-section-fg);
}

.admin-powered span::before,
.admin-powered span::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 184, 168, 0.3));
}

.admin-powered span::after {
  background: linear-gradient(90deg, rgba(157, 184, 168, 0.3), transparent);
}

.admin-powered img {
  display: block;
  width: 128px;
  height: auto;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.admin-powered:hover img {
  opacity: 1;
}

/* The right of the top bar: the theme switch and the profile menu. */
.topbar-end {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

/* The company logo is black on transparent: .brand-logo-light turns it white for dark backgrounds. */
.brand-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}

.brand-logo-light {
  filter: brightness(0) invert(1);
}

.brand-logo-card {
  height: 44px;
  margin: 0 auto 1.25rem;
}

.admin-nav {
  padding: 0.5rem 0.75rem 1rem;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--admin-radius-sm);
  color: var(--admin-sidebar-fg);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 6px;
}

.admin-nav a .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-nav a:hover {
  background: var(--admin-sidebar-hover-bg);
  color: var(--admin-sidebar-hover-fg);
  text-decoration: none;
}

.admin-nav a[aria-current="page"] {
  background: var(--admin-sidebar-active-bg);
  color: var(--admin-sidebar-active-fg);
  font-weight: 600;
}

.admin-nav a[aria-current="page"] .icon {
  opacity: 1;
}

.admin-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--admin-sidebar-accent);
}

/* A package in the sidebar: its name, opening to its pages. */
.admin-nav-group {
  margin-bottom: 6px;
}

.admin-nav-group > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--admin-radius-sm);
  color: var(--admin-sidebar-fg);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}

.admin-nav-group > summary::-webkit-details-marker {
  display: none;
}

.admin-nav-group > summary .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-nav-group > summary:hover {
  background: var(--admin-sidebar-hover-bg);
  color: var(--admin-sidebar-hover-fg);
}

.admin-nav-group > summary:focus-visible {
  outline: 2px solid var(--admin-sidebar-accent);
  outline-offset: -2px;
}

.admin-nav-group[open] > summary {
  color: var(--admin-sidebar-hover-fg);
}

/* The group holding the page you are on, closed or open. */
.admin-nav-group.has-current > summary {
  color: var(--admin-sidebar-active-fg);
}

.admin-nav-group > summary .admin-nav-caret {
  width: 16px;
  height: 16px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-nav-group[open] > summary .admin-nav-caret {
  transform: rotate(180deg);
}

/* Sliding shut (Master.blade.php): still open until the slide ends, but the caret already turns back. */
.admin-nav-group.is-closing > summary .admin-nav-caret {
  transform: none;
}

/* The package's pages, indented under its name with a guide line. */
.admin-nav-sub {
  display: flex;
  flex-direction: column;
  margin: 4px 0 0 1.3rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-nav-sub a {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
}

.admin-nav-sub a .icon {
  width: 16px;
  height: 16px;
}

.admin-nav-sub a[aria-current="page"]::before {
  left: calc(-0.5rem - 1px);
}

.admin-nav-section {
  padding: 1.25rem 0.75rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-sidebar-section-fg);
}

.admin-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space);
  padding: 0 calc(var(--admin-space) * 1.5);
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.admin-topbar>.row {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

/* The icon of the current page, before its title. */
.topbar-ico {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
  border: 1px solid var(--admin-border);
  border-radius: 11px;
}

.topbar-ico .icon {
  width: 18px;
  height: 18px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--admin-primary-soft);
  color: var(--admin-primary-hover);
  border: 1px solid var(--admin-border);
  font-size: 0.8125rem;
  font-weight: 650;
  flex-shrink: 0;
}

.admin-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}

.admin-user-meta strong {
  font-weight: 600;
}

.admin-main {
  grid-area: main;
  padding: calc(var(--admin-space) * 1.75);
  min-width: 0;
}

.admin-sidebar-toggle {
  display: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--admin-space);

  background:
    radial-gradient(ellipse 80% 60% at 50% -10%,
      color-mix(in srgb, var(--admin-primary) 14%, transparent), transparent 70%),
    var(--admin-primary-soft);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: calc(var(--admin-space) * 2.25);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) + 4px);
  box-shadow: var(--admin-shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-logo .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.auth-logo .brand-mark .icon {
  width: 28px;
  height: 28px;
}

.auth-card h1 {
  margin-bottom: 0.25rem;
  font-size: 1.375rem;
  text-align: center;
  letter-spacing: -0.015em;
}

.auth-card .auth-subtitle {
  margin-bottom: calc(var(--admin-space) * 1.5);
  color: var(--admin-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.auth-card .field {
  margin-bottom: var(--admin-space);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 2.75rem;
}

.input-wrap .input-toggle {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: var(--admin-text-muted);
  cursor: pointer;
}

.input-wrap .input-toggle:hover {
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space);
  margin-bottom: calc(var(--admin-space) * 1.5);
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  letter-spacing: -0.015em;
}

.page-header p {
  margin: 0.25rem 0 0;
}

.grid {
  display: grid;
  gap: var(--admin-space);
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.grid-fill {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--admin-space);
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title {
  margin: calc(var(--admin-space) * 2) 0 var(--admin-space);
  font-size: 1rem;
  font-weight: 650;
}

.icon {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.0625rem;
  font: inherit;
  font-weight: 550;
  line-height: 1.25;
  color: var(--admin-text);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-btn);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--admin-primary-soft);
  border-color: var(--admin-primary);
  color: var(--admin-primary-hover);
  text-decoration: none;
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--admin-button-fg);
  background: var(--admin-button-bg);
  border-color: var(--admin-button-bg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.btn-primary:hover:not(:disabled) {
  color: var(--admin-button-fg);
  background: var(--admin-button-hover);
  border-color: var(--admin-button-hover);
}

.btn-danger {
  color: var(--admin-on-danger);
  background: var(--admin-danger);
  border-color: var(--admin-danger);
}

.btn-danger:hover:not(:disabled) {
  color: var(--admin-on-danger);
  background: var(--admin-danger);
  border-color: var(--admin-danger);
  filter: brightness(0.9);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--admin-primary-soft);
  border-color: transparent;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.375rem;
  font-size: 1rem;
}

.card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: calc(var(--admin-space) * 1.25);
  box-shadow: var(--admin-shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.card-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-text-muted);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.card:hover {
  border-color: var(--admin-primary);
  box-shadow: var(--admin-shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.icon-chip {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--admin-primary-soft);
  color: var(--admin-primary-hover);
  border: 1px solid color-mix(in srgb, var(--admin-primary) 18%, transparent);
  flex-shrink: 0;
}

.icon-chip .icon {
  width: 20px;
  height: 20px;
}

.stat {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--admin-text-muted);
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;

  font-variant-numeric: tabular-nums;
}

.stat-note {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data th,
table.data td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

table.data th {
  font-weight: 650;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
  white-space: nowrap;
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover {
  background: var(--admin-primary-soft);
}

table.data td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: calc(var(--admin-space) * 2.5);
  text-align: center;
  color: var(--admin-text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  white-space: nowrap;
}

.badge-primary {
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
  border-color: color-mix(in srgb, var(--admin-primary) 30%, transparent);
}

.badge-success {
  color: var(--admin-success);
  border-color: currentColor;
}

.badge-warning {
  color: var(--admin-warning);
  border-color: currentColor;
}

.badge-danger {
  color: var(--admin-danger);
  border-color: currentColor;
}

.badge-muted {
  color: var(--admin-text-muted);
}

/* A user's heading row in the Streams table, above that user's streams. */
table.data tr.group-row td {
  background: var(--admin-surface-muted, rgba(0, 0, 0, 0.03));
  padding-block: 0.5rem;
}

.badge-match {
  color: var(--admin-result-match);
  border-color: currentColor;
}

.badge-uncertain {
  color: var(--admin-result-uncertain);
  border-color: currentColor;
}

.badge-no_match {
  color: var(--admin-result-nomatch);
  border-color: currentColor;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--admin-border);
  font-size: 0.875rem;
  margin-bottom: var(--admin-space);
}

.alert-error {
  color: var(--admin-danger);
  border-color: currentColor;
  background: color-mix(in srgb, var(--admin-danger) 7%, var(--admin-surface));
}

#toasts {
  position: fixed;
  top: var(--admin-space);
  right: var(--admin-space);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2 * var(--admin-space)));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-info);
  border-radius: var(--admin-radius-sm);
  box-shadow: var(--admin-shadow-lg);
  font-size: 0.875rem;
  animation: toast-in 0.18s ease;
}

.toast-success {
  border-left-color: var(--admin-primary);
}

.toast-error {
  border-left-color: var(--admin-danger);
}

.toast-warning {
  border-left-color: var(--admin-warning);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

dialog.modal {
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-lg);
  max-width: min(520px, calc(100vw - 2rem));
  width: 100%;
  color: var(--admin-text);
  background: var(--admin-surface);
}

dialog.modal::backdrop {
  background: var(--admin-overlay);
}

dialog.modal:focus,
dialog.modal:focus-visible {
  outline: none;
}

.modal-header,
.modal-footer {
  padding: var(--admin-space) calc(var(--admin-space) * 1.25);
}

.modal-header {
  border-bottom: 1px solid var(--admin-border);
  font-weight: 650;
}

.modal-body {
  padding: calc(var(--admin-space) * 1.25);
}

.modal-footer {
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.spinner {
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.card-flush {
  padding: 0;
  overflow: hidden;
}

.field {
  margin-bottom: var(--admin-space);
}

.field:last-child {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: var(--admin-space);
  border-bottom: 1px solid var(--admin-border);
}

.toolbar .search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.toolbar .search .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  pointer-events: none;
}

.toolbar .search input {
  padding-left: 2.35rem;
}

.toolbar select {
  width: auto;
  min-width: 140px;
}

.toolbar .date-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 500;
  color: var(--admin-text-muted);
}

.toolbar .date-filter input {
  width: auto;
}

.card-flush .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

label.check input {
  accent-color: var(--admin-primary);
}

.alert[hidden] {
  display: none;
}

.stream-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--admin-space);
  align-items: start;
  margin-top: var(--admin-space);
}

@media (max-width: 1000px) {
  .stream-layout {
    grid-template-columns: 1fr;
  }
}

.stream-card.is-selected {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--admin-primary) 25%, transparent);
}

.stream-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stream-head h3 {
  margin: 0 0 0.2rem;
}

.stream-url {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
  word-break: break-all;
}

.stream-meta {
  margin: 0.6rem 0 0;
}

.stream-error {
  margin: 0.6rem 0 0;
}

.stream-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.stream-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.stream-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--admin-text-muted);
}

.stream-ok {
  color: var(--admin-success);
}

.stream-ok i {
  background: var(--admin-primary);
  animation: ad-ping 1.6s ease-out infinite;
}

.stream-wait {
  color: var(--admin-warning);
}

.stream-wait i {
  background: var(--admin-warning);
}

.stream-bad {
  color: var(--admin-danger);
}

.stream-bad i {
  background: var(--admin-danger);
}

.stream-feed {
  position: sticky;
  top: calc(var(--admin-topbar-height) + var(--admin-space));
  max-height: calc(100vh - 8rem);
  overflow: auto;
}

/* Where to watch: a full-width banner, with the one action it offers. */
.stream-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: var(--admin-space);
  padding: 0.9rem 1.1rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-primary);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.stream-banner-ico {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  border-radius: 12px;
}

.stream-banner-ico .icon {
  width: 20px;
  height: 20px;
}

.stream-banner-text {
  flex: 1;
  min-width: 0;
}

.stream-banner-text strong {
  display: block;
}

.stream-banner-text p {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.stream-banner .btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.stream-banner .btn .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 700px) {
  .stream-banner {
    flex-wrap: wrap;
  }

  .stream-banner .btn {
    margin-left: calc(40px + 1rem);
  }
}

/* No streams yet. */
.stream-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
}

.stream-empty strong {
  color: var(--admin-text);
  font-size: 1.0625rem;
}

.stream-empty p {
  max-width: 30rem;
  margin: 0 0 0.6rem;
}

.stream-empty-ico {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.4rem;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  border: 1px dashed var(--admin-border-strong);
  border-radius: 50%;
}

.stream-empty-ico .icon {
  width: 28px;
  height: 28px;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.feed-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  background: var(--admin-primary-soft);
  border-left: 4px solid var(--admin-text-muted);
  border-radius: var(--admin-radius-sm);
}

.feed-match {
  border-left-color: var(--admin-result-match);
}

.feed-uncertain {
  border-left-color: var(--admin-result-uncertain);
}

.feed-face {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
}

.test-ok {
  color: var(--admin-success);
  font-weight: 600;
}

.test-bad {
  color: var(--admin-danger);
  font-weight: 600;
}

.field-hint {
  margin: 0.3rem 0 0;
}

dialog.modal-wide {
  max-width: min(760px, calc(100vw - 2rem));
}

dialog.modal[open] {
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--admin-space);
}

.two-col .field {
  margin-bottom: var(--admin-space);
}

@media (max-width: 600px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.consent-box {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--admin-primary-soft);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
}

.avatar-img {
  object-fit: cover;
  padding: 0;
}

.thumb-missing {
  background: var(--admin-primary-soft);
}

.find {
  margin-bottom: var(--admin-space);
}

.find-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.find-title {
  margin: 0 0 0.15rem;
}

.find-result {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--admin-border);
  display: grid;
  gap: 0.5rem;
}

.find-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.find-row strong {
  min-width: 10rem;
}

.picker-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.picker-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.picker-error {
  color: var(--admin-danger);
  margin: 0.5rem 0 0;
}

.picker-camera {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  margin-top: 0.75rem;
}

.picker-video {
  width: min(100%, 360px);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-stage-bg);
  transform: scaleX(-1);
}

.picker-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.picker-thumb {
  position: relative;
  margin: 0;
  width: 76px;
  height: 76px;
}

.picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--admin-border);
}

.picker-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
  cursor: pointer;
  color: var(--admin-on-danger);
  background: var(--admin-danger);
  border: 0;
  border-radius: 50%;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-header h2 {
  margin: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: var(--admin-space);
}

.photo-card {
  margin: 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  overflow: hidden;
  background: var(--admin-surface);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.photo-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.4rem;
}

.add-photos {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: var(--admin-space);
  padding-top: var(--admin-space);
  border-top: 1px solid var(--admin-border);
}

.reasons {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.setting-edit input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--admin-primary);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem var(--admin-space);
  border-top: 1px solid var(--admin-border);
}

.pager-pages {
  display: flex;
  gap: 0.25rem;
}

.pager .btn {
  min-width: 34px;
  justify-content: center;
}

.pager .icon {
  width: 14px;
  height: 14px;
}

.pager button[aria-current="page"] {
  color: var(--admin-button-fg);
  background: var(--admin-button-bg);
  border-color: transparent;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.person-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.person-email {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.person .you {
  font-size: 0.6875rem;
}

.actions-col {
  width: 1%;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.375rem;
}

.icon-btn {
  padding: 0.4rem;
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

.icon-btn.danger:hover:not(:disabled) {
  color: var(--admin-danger);
}

.icon-btn.delete {
  color: var(--admin-danger);
}

.icon-btn.delete:hover:not(:disabled) {
  background: color-mix(in srgb, var(--admin-danger) 12%, transparent);
}

.icon-btn.delete .icon {
  width: 18px;
  height: 18px;
}

.mono {
  font-family: var(--admin-font-mono);
}

.nowrap {
  white-space: nowrap;
}

.detail {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--admin-text-muted);
  vertical-align: bottom;
}

.alert-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--admin-info);
}

.alert-info .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

dialog.modal-sm {
  max-width: 26rem;
}

.role-card {
  display: grid;
  gap: var(--admin-space);
}

.role-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.role-head h3 {
  margin: 0;
}

.role-head p {
  margin: 0.25rem 0 0;
}

.role-meta {
  display: flex;
  gap: 0.5rem;
}

.role-foot {
  display: flex;
  justify-content: flex-end;
}

.perm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.perm-group-head h4 {
  margin: 0;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-text-muted);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
}

.perm {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.perm:hover {
  background: var(--admin-primary-soft);
}

.perm:has(input:checked) {
  border-color: var(--admin-primary);
  background: var(--admin-primary-soft);
}

.perm:has(input:disabled) {
  cursor: default;
}

/* A drawn checkbox, for every checkbox in the admin: a rounded green square with a white tick, not the browser's own. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--admin-border-strong);
  border-radius: 6px;
  background: var(--admin-surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

input[type="checkbox"]::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s ease-out;
}

input[type="checkbox"]:not(:disabled):hover {
  border-color: var(--admin-primary);
}

.perm input[type="checkbox"] {
  margin-top: 0.1rem;
}

input[type="checkbox"]:checked {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
}

input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-primary) 30%, transparent);
}

input[type="checkbox"]:disabled {
  cursor: default;
  opacity: 0.6;
}

.perm-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.perm-code {
  display: block;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.setting-group-title {
  margin: 0 0 0.5rem;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.9rem 0;
  border-top: 1px solid var(--admin-border);
}

.setting:first-of-type {
  border-top: 0;
}

.setting-info {
  flex: 1;
  min-width: 220px;
}

.setting-info p {
  margin: 0.25rem 0 0;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.setting-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 260px;
  max-width: 460px;
}

.setting-edit input {
  flex: 1;
}

.profile {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  background: var(--admin-primary-soft);
  border-color: var(--admin-border);
}

.profile-trigger .admin-user-meta {
  text-align: right;
}

.profile-trigger .chevron {
  width: 14px;
  height: 14px;
  color: var(--admin-text-muted);
  transition: transform 0.2s;
}

.profile-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 250px;
  padding: 0.5rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-lg);
}

.profile-menu[hidden] {
  display: none;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem 0.75rem;
  border-bottom: 1px solid var(--admin-border);
}

.profile-head strong {
  display: block;
}

.profile-head .muted {
  word-break: break-all;
}

.profile-menu hr {
  width: 100%;
  margin: 0.4rem 0;
  border: 0;
  border-top: 1px solid var(--admin-border);
}

.profile-menu button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  color: var(--admin-text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--admin-radius-sm);
  cursor: pointer;
}

.profile-menu button:hover {
  background: var(--admin-primary-soft);
}

.profile-menu button .icon {
  width: 16px;
  height: 16px;
  color: var(--admin-text-muted);
}

.profile-menu button.danger:hover {
  color: var(--admin-danger);
}

.profile-menu button.danger:hover .icon {
  color: var(--admin-danger);
}

.al-page {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: #e8f5ec;
  font-family: var(--admin-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  background: #050f09;
}

.al-page *,
.al-page *::before,
.al-page *::after {
  box-sizing: border-box;
}

.al-page .hidden {
  display: none !important;
}

.al-page h1,
.al-page p {
  margin: 0;
}

.al-page svg {
  display: block;
}

.al-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 10%, #0f3d24 0, transparent 55%),
    radial-gradient(ellipse at 90% 95%, #0a3a2c 0, transparent 50%),
    #050f09;
}

.al-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 222, 128, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 222, 128, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 50%, #000 5%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 5%, transparent 70%);
  animation: al-grid 18s linear infinite;
}

.al-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: al-float 14s ease-in-out infinite;
}

.al-orb-a {
  width: 420px;
  height: 420px;
  background: #16a34a;
  top: -140px;
  left: -120px;
}

.al-orb-b {
  width: 460px;
  height: 460px;
  background: #0e7490;
  bottom: -180px;
  right: -140px;
  animation-delay: -6s;
  opacity: 0.3;
}

.al-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.al-frame {
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding: 2px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 80px -20px rgba(34, 197, 94, 0.35);
  animation: al-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.al-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0 60%, #22c55e 80%, #4ade80 90%, transparent 100%);
  animation: al-spin 6s linear infinite;
}

.al-card {
  position: relative;
  padding: 2.5rem 2.25rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, #0c1d14, #08140d);
  border-radius: 22px;
}

.al-card>*,
.al-card form>* {
  animation: al-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.al-card> :nth-child(1) {
  animation-delay: 0.1s;
}

.al-card> :nth-child(2) {
  animation-delay: 0.18s;
}

.al-card> :nth-child(3) {
  animation-delay: 0.26s;
}

.al-card> :nth-child(4) {
  animation-delay: 0.32s;
}

.al-card form> :nth-child(1) {
  animation-delay: 0.4s;
}

.al-card form> :nth-child(2) {
  animation-delay: 0.47s;
}

.al-card form> :nth-child(3) {
  animation-delay: 0.54s;
}

.al-card>.al-note {
  animation-delay: 0.65s;
}

.al-frame.is-shaking {
  animation: al-shake 0.45s;
}

.al-frame.is-success {
  animation: al-leave 0.45s ease forwards;
}

.al-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
  animation: al-pop 0.9s 0.1s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.al-badge::before,
.al-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.6);
  animation: al-ripple 2.6s ease-out infinite;
}

.al-badge::after {
  animation-delay: 1.3s;
}

.al-badge .icon {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.al-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 999px;
}

.al-tag b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: al-blink 1.6s ease-in-out infinite;
}

.al-card h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.al-sub {
  margin: 0.35rem 0 1.75rem !important;
  color: #8fb09b;
}

.al-error {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.8125rem;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
}

.al-field {
  margin-bottom: 1rem;
  text-align: left;
}

.al-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #c5dccd;
}

.al-input {
  position: relative;
}

.al-ico {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #6f8f7b;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s;
}

.al-input input {
  width: 100%;
  height: 46px;
  padding: 0 2.75rem;
  font: inherit;
  color: #f1faf4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.al-input input::placeholder {
  color: #5f7a6a;
}

.al-input input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
}

.al-input input:-webkit-autofill {
  -webkit-text-fill-color: #f1faf4;
  box-shadow: 0 0 0 100px #0f2418 inset;
}

.al-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  color: #8fb09b;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.al-eye:hover {
  color: #4ade80;
  background: rgba(255, 255, 255, 0.07);
}

.al-eye .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.al-eye .off,
.al-eye[aria-pressed="true"] .on {
  display: none;
}

.al-eye[aria-pressed="true"] .off {
  display: block;
}

.al-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 48px;
  margin-top: 1.5rem;
  overflow: hidden;
  font: inherit;
  font-weight: 600;
  color: #04140a;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(34, 197, 94, 0.8);
  transition: transform 0.2s, box-shadow 0.2s;
}

.al-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s;
}

.al-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px rgba(34, 197, 94, 0.95);
}

.al-btn:hover:not(:disabled)::after {
  left: 120%;
}

.al-btn:active:not(:disabled) {
  transform: translateY(0);
}

.al-btn:disabled {
  cursor: progress;
  opacity: 0.92;
}

.al-spin {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(4, 20, 10, 0.3);
  border-top-color: #04140a;
  border-radius: 50%;
  animation: al-spinner 0.7s linear infinite;
}

.al-btn[aria-busy="true"] .al-spin {
  display: inline-block;
}

.al-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem !important;
  font-size: 0.75rem;
  color: #6f8f7b;
}

.al-note .icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes al-grid {
  to {
    background-position: 52px 52px;
  }
}

@keyframes al-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(60px, 40px) scale(1.15);
  }
}

@keyframes al-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes al-spinner {
  to {
    transform: rotate(360deg);
  }
}

@keyframes al-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes al-pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes al-ripple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes al-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes al-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes al-leave {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
}

body {
  background: radial-gradient(ellipse at 100% 0%, #dcfce7 0, transparent 40%), radial-gradient(ellipse at 0% 100%, #d1fae5 0, transparent 40%), var(--admin-bg);
  background-attachment: fixed;
}

.admin-sidebar {
  background: linear-gradient(180deg, #0a1a11, #06110a);
  box-shadow: 8px 0 30px -12px rgba(0, 0, 0, 0.35);
}

.admin-brand {
  color: #fff;
}

.admin-brand .brand-mark {
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.55);
  transition: transform 0.4s;
}

.admin-brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.08);
}

.admin-nav a {
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.admin-nav a:hover {
  transform: translateX(3px);
}

.admin-nav a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.04));
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.18);
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(21, 128, 61, 0.12);
}

.admin-topbar h1 {
  letter-spacing: -0.02em;
}

.admin-topbar .avatar {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-color: transparent;
}

.admin-topbar .btn {
  border-radius: var(--admin-radius-btn);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.admin-topbar .btn:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: transparent;
  transform: translateY(-1px);
}

.ad-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.ad-stat {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  box-shadow: var(--admin-shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: al-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ad-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow-lg);
}

.ad-stats> :nth-child(1) {
  animation-delay: 0.2s;
}

.ad-stats> :nth-child(2) {
  animation-delay: 0.27s;
}

.ad-stats> :nth-child(3) {
  animation-delay: 0.34s;
}

.ad-stats> :nth-child(4) {
  animation-delay: 0.41s;
}

.ad-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.ad-stat-top>span:first-child {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--admin-text-muted);
}

.ad-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 13px;
}

.ad-ico .icon {
  width: 20px;
  height: 20px;
}

.ad-ico.g1 {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.ad-ico.g2 {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.ad-ico.g3 {
  background: linear-gradient(135deg, #84cc16, #4d7c0f);
}

.ad-ico.g4 {
  background: linear-gradient(135deg, #06b6d4, #0e7490);
}

.ad-stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}

.ad-stat small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.ad-bar {
  height: 6px;
  margin-top: 0.75rem;
  overflow: hidden;
  background: #e3f3e8;
  border-radius: 999px;
}

.ad-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #15803d);
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ad-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.ad-empty p {
  max-width: 22rem;
  margin: 0;
}

.ad-empty-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.4rem;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  border-radius: 50%;
  animation: ad-bob 4s ease-in-out infinite;
}

.ad-empty-ico .icon {
  width: 28px;
  height: 28px;
}

@keyframes ad-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes ad-ping {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }

  100% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
}

.admin-topbar .admin-sidebar-toggle {
  display: none;
}

input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: var(--admin-border-strong);
}

@media (max-width: 1100px) {
  .ad-stats {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "main";
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--admin-sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
  }

  .admin-shell[data-sidebar="open"] .admin-sidebar {
    transform: translateX(0);
    box-shadow: var(--admin-shadow-lg);
  }

  .admin-sidebar-toggle {
    display: inline-flex;
  }

  .admin-main {
    padding: var(--admin-space);
  }

  .admin-topbar {
    padding: 0 var(--admin-space);
  }

  .admin-user-meta {
    display: none;
  }

  .admin-shell[data-sidebar="open"]::after {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--admin-overlay);
    z-index: 30;
  }

  .admin-topbar .admin-sidebar-toggle {
    display: inline-flex;
  }

}

@media (max-width: 480px) {
  .al-card {
    padding: 2rem 1.5rem 1.5rem;
  }

  .ad-stats,
  .ad-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .al-page *,
  .al-page *::before,
  .al-page *::after,
  .admin-shell *,
  .admin-shell *::before,
  .admin-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- History and analytics ----------------------------------------------------------------- */

.hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem var(--admin-space);
  border-bottom: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-text-muted);
}

.hist-row:last-child {
  border-bottom: 0;
}

.hist-row.hist-match {
  border-left-color: var(--admin-result-match);
}

.hist-row.hist-uncertain {
  border-left-color: var(--admin-result-uncertain);
}

.hist-face {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  background: var(--admin-primary-soft);
  border: 1px solid var(--admin-border);
}

.hist-main {
  flex: 1;
  min-width: 0;
  display: grid;
}

.hist-sub {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-badge {
  padding: 0.1rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
}

.hist-badge.hist-match {
  color: var(--admin-success);
}

.hist-badge.hist-uncertain {
  color: var(--admin-warning);
}

.hist-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hist-del {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--admin-text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.hist-row:hover .hist-del,
.hist-del:focus-visible {
  opacity: 1;
}

.hist-del:hover {
  color: var(--admin-danger);
  background: color-mix(in srgb, var(--admin-danger) 10%, #fff);
}

.hist-del:focus-visible {
  outline: 2px solid var(--admin-danger);
  outline-offset: 1px;
}

.hist-score {
  width: 3rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--admin-text-muted);
  font-size: 0.8125rem;
}

.hist-time {
  width: 11rem;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
  white-space: nowrap;
}

.hist-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--admin-text-muted);
}

@media (max-width: 760px) {
  .hist-time {
    display: none;
  }
}

.an-tiles {
  margin-top: 0;
}

/* Period buttons and the source filter sit on one row, the first as a single segmented control. */
.an-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.an-filters select {
  width: auto;
  min-width: 9.5rem;
}

.an-range {
  display: inline-flex;
  padding: 3px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius-sm) + 3px);
}

.an-range button {
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--admin-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.an-range button:hover {
  color: var(--admin-text);
  background: var(--admin-primary-soft);
}

.an-range button.active {
  color: #fff;
  background: var(--admin-button-bg);
  box-shadow: 0 2px 8px -2px rgba(21, 128, 61, 0.55);
}

.an-range button:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 1px;
}

/* What a card shows when there is nothing to chart yet. */
.an-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--admin-text-muted);
  font-size: 0.875rem;
}

.an-empty strong {
  color: var(--admin-text);
  font-size: 1rem;
}

.an-empty span:last-child {
  max-width: 34rem;
}

.an-empty-ico {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.4rem;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  border: 1px dashed var(--admin-border-strong);
  border-radius: 50%;
}

.an-empty-ico .icon {
  width: 24px;
  height: 24px;
}

.an-empty-small {
  padding: 1.25rem 0.5rem;
}

.an-grid .card .an-bars {
  padding-top: 0.25rem;
}

.an-bars>li.muted {
  padding: 1.25rem 0;
  text-align: center;
}

@media (max-width: 700px) {
  .an-filters {
    justify-content: flex-start;
    width: 100%;
  }

  .an-range {
    max-width: 100%;
    overflow-x: auto;
  }
}

.an-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--admin-space);
  margin-top: var(--admin-space);
}

.an-wide {
  grid-column: 1 / -1;
}

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

.an-chart {
  position: relative;
}

.an-chart canvas {
  display: block;
  width: 100%;
}

.an-tip {
  position: absolute;
  z-index: 5;
  min-width: 130px;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  color: var(--admin-text);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  box-shadow: var(--admin-shadow-lg);
  pointer-events: none;
}

.an-legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.an-key {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.an-key i,
.an-keys i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.an-donut {
  display: grid;
  justify-items: center;
}

.an-keys {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.an-keys li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.an-keys li span:first-of-type {
  flex: 1;
}

.an-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.an-bar {
  display: grid;
  grid-template-columns: minmax(5rem, 9rem) 1fr 2.5rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.an-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-bar-track {
  height: 8px;
  background: #e3f3e8;
  border-radius: 999px;
  overflow: hidden;
}

.an-bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #15803d);
  border-radius: 999px;
}

.an-bar strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.an-table {
  margin-top: 0.75rem;
}

.an-table summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.an-datatable {
  margin-top: 0.5rem;
}

/* Every control in a toolbar is the same height and sits on one line, whatever it is (search box, drop-down, date). */
.toolbar .search {
  display: block;
  margin: 0;
}

.toolbar input,
.toolbar select,
.toolbar .btn {
  height: 40px;
  box-sizing: border-box;
  margin: 0;
}

.toolbar select {
  padding-top: 0;
  padding-bottom: 0;
}

/* Themed drop-down (assets/Admin/js/customselect.js). Reads the colours of whichever area it is on:
   the user pages define --u-*, the admin pages --admin-*. */

.sel,
.sel-menu {
  --sel-primary: var(--u-primary, var(--admin-primary, #16a34a));
  --sel-soft: var(--u-primary-soft, var(--admin-primary-soft, #f0fdf4));
  --sel-surface: var(--u-surface, var(--admin-surface, #ffffff));
  --sel-border: var(--u-border, var(--admin-border, #d3e9da));
  --sel-border-strong: var(--u-border-strong, var(--admin-border-strong, #b8d8c3));
  --sel-text: var(--u-text, var(--admin-text, #0f2a1a));
  --sel-muted: var(--u-text-muted, var(--admin-text-muted, #4d6356));
  --sel-radius: var(--u-radius-sm, var(--admin-radius-sm, 6px));
  --sel-shadow: var(--u-shadow-lg, var(--admin-shadow-lg, 0 12px 32px rgba(15, 42, 26, 0.13)));
}

.sel-native {
  display: none !important;
}

.sel {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  min-width: 9rem;
}

.sel.sel-hidden {
  display: none;
}

/* Where the select filled its row (a form field), the button does too. */
.field .sel {
  display: block;
  width: 100%;
}

.sel-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sel-text);
  text-align: left;
  background: var(--sel-surface);
  border: 1px solid var(--sel-border);
  border-radius: var(--sel-radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.toolbar .sel-field {
  height: 40px;
  box-sizing: border-box;
}

.sel-field:hover:not(:disabled) {
  border-color: var(--sel-border-strong);
}

.sel-field:focus-visible,
.sel-field[aria-expanded="true"] {
  outline: none;
  border-color: var(--sel-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel-primary) 25%, transparent);
}

.sel-field:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.sel-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sel-chevron {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--sel-primary);
  transition: transform 0.15s;
}

.sel-field[aria-expanded="true"] .sel-chevron {
  transform: rotate(180deg);
}

.sel svg,
.sel-menu svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sel-menu {
  position: fixed;
  z-index: 1000;
  max-height: 16rem;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  font-family: var(--u-font, var(--admin-font, system-ui, sans-serif));
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  color: var(--sel-text);
  background: var(--sel-surface);
  border: 1px solid var(--sel-border);
  border-radius: calc(var(--sel-radius) + 2px);
  box-shadow: var(--sel-shadow);
  animation: cs-in 0.12s ease-out both;
}

@keyframes cs-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.sel-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--sel-radius);
  cursor: pointer;
}

.sel-option.sel-active {
  background: var(--sel-soft);
}

.sel-option.sel-selected {
  font-weight: 600;
  color: var(--sel-primary);
}

.sel-option.sel-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.sel-tick {
  display: inline-grid;
  place-items: center;
  visibility: hidden;
}

.sel-option.sel-selected .sel-tick {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .sel-menu {
    animation: none;
  }
}

/* Shimmer (skeleton) placeholders, shown while a page loads its data. They take the colours of whichever area they
   are on: the user pages define --u-*, the admin pages --admin-*. */

.sk,
.sk-text {
  --sk-base: color-mix(in srgb, var(--u-border, var(--admin-border, #d3e9da)) 55%, var(--u-surface, var(--admin-surface, #ffffff)));
  --sk-light: color-mix(in srgb, var(--u-primary-soft, var(--admin-primary-soft, #f0fdf4)) 45%, var(--u-surface, var(--admin-surface, #ffffff)));
  background: linear-gradient(100deg, var(--sk-base) 30%, var(--sk-light) 50%, var(--sk-base) 70%);
  background-size: 300% 100%;
  border-radius: 6px;
  animation: sk-shimmer 1.3s ease-in-out infinite;
}

@keyframes sk-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}

.sk-line {
  display: block;
  height: 0.8rem;
}

.sk-avatar {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.sk-block {
  height: 7rem;
  border-radius: 12px;
}

.sk-card+.sk-card {
  margin-top: 1rem;
}

/* A table row: a few bars of different lengths. */
.sk-row td:nth-child(1) .sk-line {
  width: 70%;
}

.sk-row td:nth-child(2) .sk-line {
  width: 50%;
}

.sk-row td:nth-child(3) .sk-line {
  width: 35%;
}

.sk-row td:nth-child(4) .sk-line {
  width: 55%;
}

.sk-row td:nth-child(5) .sk-line {
  width: 45%;
}

.sk-row td:nth-child(6) .sk-line {
  width: 60%;
}

/* A list row: a round picture and two lines. */
.sk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--u-border, var(--admin-border, #d3e9da));
}

.sk-item:last-child {
  border-bottom: 0;
}

.sk-item .sk-avatar {
  width: 40px;
  height: 40px;
}

.sk-item .sk-main {
  flex: 1;
  display: grid;
  gap: 0.45rem;
}

.sk-item .sk-main .sk-line:first-child {
  width: 30%;
}

.sk-item .sk-main .sk-line:last-child {
  width: 50%;
  height: 0.65rem;
}

/* A number that has not arrived yet: its "—" shimmers until a script writes the value (see ui.js). */
.sk-text {
  display: inline-block;
  min-width: 3ch;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {

  .sk,
  .sk-text {
    animation: none;
  }
}

/* The whole page as shimmer while it loads: Layouts/sk-page, shown while <html> has .is-loading (see Master). */
.page-sk {
  display: none;
}

.is-loading .page-sk {
  display: block;
}

.is-loading .admin-main> :not(.page-sk) {
  display: none;
}

/* One wave of light crosses every block at once (the gradient is fixed to the window), in the panel's green. */
.page-sk .sk {
  --sk-base: color-mix(in srgb, var(--admin-border, #d3e9da) 62%, var(--admin-surface, #ffffff));
  --sk-light: color-mix(in srgb, var(--admin-primary-soft, #f0fdf4) 55%, #ffffff);
  display: block;
  background-image: linear-gradient(105deg, var(--sk-base) 0%, var(--sk-base) 40%, var(--sk-light) 48%, #ffffff 50%, var(--sk-light) 52%, var(--sk-base) 60%, var(--sk-base) 100%);
  background-size: 250% 100%;
  background-attachment: fixed;
  animation: sk-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* On the dark dashboard banner. */
.page-sk .sk-dark {
  --sk-base: rgba(255, 255, 255, 0.08);
  --sk-light: rgba(134, 239, 172, 0.22);
  background-image: linear-gradient(105deg, var(--sk-base) 0%, var(--sk-base) 40%, var(--sk-light) 50%, var(--sk-base) 60%, var(--sk-base) 100%);
}

/* The blocks rise into place one after another; the page's content fades in when it is ready. */
.page-sk-in>*,
.page-sk-grid>*,
.page-sk-stats>*,
.page-sk-tr {
  animation: page-sk-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

/* Not `both`, and never a dialog: a transform left on an element makes it the box that fixed things inside it (the
   drop-down menus of customselect.js) are placed in, which throws them out of place. */
.is-loaded .admin-main> :not(.page-sk, dialog) {
  animation: page-sk-reveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

@keyframes page-sk-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes page-sk-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.page-sk .card {
  border-radius: 18px;
}

.page-sk-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.page-sk-lines {
  flex: 1;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.page-sk-lines .sk-line:first-child {
  width: 55%;
}

.page-sk-lines .sk-line:last-child {
  width: 35%;
  height: 0.6rem;
}

.page-sk-title {
  width: 240px;
  max-width: 70%;
  height: 1.75rem;
  border-radius: 8px;
}

.page-sk-pill {
  width: 72px;
  height: 1.35rem;
  border-radius: 999px !important;
}

.page-sk-btn {
  width: 130px;
  height: 2.5rem;
  border-radius: var(--admin-radius-btn) !important;
}

.page-sk-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
}

.page-sk-ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px !important;
}

.page-sk-input {
  height: 2.6rem;
  border-radius: 12px !important;
}

/* The page title and its button. */
.page-sk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: calc(var(--admin-space) * 1.5);
}

.page-sk-head>div {
  flex: 1;
  display: grid;
  gap: 0.6rem;
}

.page-sk-head .sk-line {
  width: 440px;
  max-width: 90%;
}

/* Dashboard: the dark welcome banner and the number cards. */
.page-sk-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 2.75rem;
  background: linear-gradient(135deg, #050f09, #0b2a1a 55%, #0f3d24);
  border-radius: 26px;
  box-shadow: 0 30px 60px -28px rgba(5, 15, 9, 0.8), 0 0 0 1px rgba(74, 222, 128, 0.12);
}

.page-sk-hero-copy {
  flex: 1;
  display: grid;
  gap: 0.9rem;
  justify-items: start;
}

.page-sk-hero-copy .page-sk-pill {
  width: 120px;
}

.page-sk-hero-copy .page-sk-title {
  width: 360px;
  height: 2.4rem;
}

.page-sk-hero-copy .sk-line {
  width: 460px;
  max-width: 90%;
}

.page-sk-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.page-sk-orb {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 32px !important;
}

.page-sk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.page-sk-stat {
  display: grid;
  gap: 0.8rem;
  justify-items: start;
}

.page-sk-stat .page-sk-row {
  width: 100%;
}

.page-sk-stat .page-sk-row .sk-line {
  width: 45%;
}

.page-sk-num {
  width: 90px;
  height: 2.6rem;
  border-radius: 10px;
}

.page-sk-stat .page-sk-foot {
  width: 100%;
  height: 0.7rem;
  margin-top: 0.4rem;
}

/* Admin Users: the filters and the rows of the table. */
.page-sk-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
}

.page-sk-tr {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) repeat(2, minmax(0, 0.8fr)) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
}

.page-sk-tr:last-child {
  border-bottom: 0;
}

.page-sk-tr>.sk-line:nth-last-child(2) {
  width: 70%;
}

.page-sk-tr>.sk-line:last-child {
  width: 85%;
}

/* Roles: one card per role. */
.page-sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.page-sk-role {
  display: grid;
  gap: 1rem;
}

.page-sk-meter {
  display: grid;
  gap: 0.5rem;
}

.page-sk-meter .sk-line {
  width: 45%;
  height: 0.65rem;
}

.page-sk-bar {
  height: 0.55rem;
  border-radius: 999px !important;
}

.page-sk-module .sk-line {
  flex: 1;
}

.page-sk-module .page-sk-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px !important;
}

.page-sk-role .page-sk-foot {
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--admin-border);
}

.page-sk-role .page-sk-foot .sk-line {
  width: 70px;
}

.page-sk-role .page-sk-foot .page-sk-btn {
  width: 80px;
  height: 2rem;
}

/* Forms: Add / Edit role and Settings. */
.page-sk-form+.page-sk-form {
  margin-top: 1.25rem;
}

.page-sk-form-head {
  margin-bottom: 1.4rem;
}

.page-sk-step {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50% !important;
}

.page-sk-tabs {
  display: flex;
  gap: 0.6rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--admin-border);
}

.page-sk-tab {
  width: 150px;
  height: 2.4rem;
  border-radius: 12px !important;
}

.page-sk-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.page-sk-fields .sk-line {
  width: 30%;
  margin-bottom: 0.55rem;
}

@media (max-width: 760px) {

  .page-sk-tr {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .page-sk-tr>:nth-child(n + 3) {
    display: none;
  }

  .page-sk-hero {
    padding: 1.75rem;
  }

  .page-sk-orb {
    display: none;
  }
}

@media (max-width: 640px) {

  .page-sk-fields,
  .page-sk-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {

  .page-sk .sk,
  .page-sk-in>*,
  .page-sk-grid>*,
  .page-sk-stats>*,
  .page-sk-tr,
  .is-loaded .admin-main> :not(.page-sk, dialog) {
    animation: none;
  }
}

/* The pages that used to be the user area (live streaming, upload, results, the dashboard numbers), now inside the one
   application. They are written with --u-* colours; these map them onto the admin theme. */
:root {
  --u-border: var(--admin-border);
  --u-border-strong: var(--admin-border-strong);
  --u-button-bg: var(--admin-button-bg);
  --u-button-hover: var(--admin-button-hover);
  --u-danger: var(--admin-danger);
  --u-font: var(--admin-font);
  --u-font-mono: var(--admin-font-mono);
  --u-primary: var(--admin-primary);
  --u-primary-hover: var(--admin-primary-hover);
  --u-primary-soft: var(--admin-primary-soft);
  --u-radius-sm: var(--admin-radius-sm);
  --u-result-match: var(--admin-result-match);
  --u-result-nomatch: var(--admin-result-nomatch);
  --u-result-uncertain: var(--admin-result-uncertain);
  --u-shadow: var(--admin-shadow);
  --u-shadow-lg: var(--admin-shadow-lg);
  --u-stage-bg: var(--admin-stage-bg);
  --u-stage-fg: var(--admin-stage-fg);
  --u-success: var(--admin-success);
  --u-surface: var(--admin-surface);
  --u-text: var(--admin-text);
  --u-text-muted: var(--admin-text-muted);
  --u-warning: var(--admin-warning);
}

.ud-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 2.75rem;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #052e16, #14532d, #15803d, #16a34a);
  background-size: 300% 300%;
  border-radius: 26px;
  box-shadow: 0 30px 60px -28px rgba(21, 128, 61, 0.65);
  animation: lg-gradient 14s ease infinite, ut-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ud-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 80% 50%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 80% 50%, #000 10%, transparent 70%);
}

.ud-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.ud-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.ud-hero h1 {
  margin: 1rem 0 0.6rem;
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
}

.ud-hero p {
  margin: 0 0 1.6rem;
  opacity: 0.88;
}

.ud-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ud-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--admin-radius-btn);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.ud-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.ud-btn .icon {
  width: 16px;
  height: 16px;
}

.ud-btn-light {
  color: #14532d;
  background: #fff;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.4);
}

.ud-btn-glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ud-btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ud-btn-solid {
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 12px 24px -10px rgba(21, 128, 61, 0.7);
}

.ud-visual {
  position: relative;
  z-index: 1;
  flex: none;
  width: 190px;
}

.ud-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.ud-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--u-border);
  border-radius: 18px;
  box-shadow: var(--u-shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: ut-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ud-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--u-shadow-lg);
}

.ud-stat-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  color: #fff;
  border-radius: 14px;
}

.ud-stat-ico .icon {
  width: 22px;
  height: 22px;
}

.ud-stat-ico.g1 {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.ud-stat-ico.g2 {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.ud-stat-ico.g3 {
  background: linear-gradient(135deg, #84cc16, #4d7c0f);
}

.ud-stat-ico.g4 {
  background: linear-gradient(135deg, #06b6d4, #0e7490);
}

.ud-stat strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ud-stat div span {
  font-size: 0.75rem;
  color: var(--u-text-muted);
}

.ud-stats> :nth-child(1) {
  animation-delay: 0.2s;
}

.ud-stats> :nth-child(2) {
  animation-delay: 0.27s;
}

.ud-stats> :nth-child(3) {
  animation-delay: 0.34s;
}

.ud-stats> :nth-child(4) {
  animation-delay: 0.41s;
}

.ud-head {
  margin: 2.25rem 0 1rem;
}

.ud-head h2 {
  margin: 0;
  font-size: 1.125rem;
}

.ud-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.ud-action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  overflow: hidden;
  color: inherit;
  background: #fff;
  border: 1px solid var(--u-border);
  border-radius: 20px;
  box-shadow: var(--u-shadow);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  animation: ut-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ud-action::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 100% 0, rgba(34, 197, 94, 0.18), transparent 60%);
  transition: opacity 0.3s;
}

.ud-action:hover {
  text-decoration: none;
  transform: translateY(-6px);
  border-color: #86efac;
  box-shadow: 0 28px 50px -24px rgba(21, 128, 61, 0.45);
}

.ud-action:hover::before {
  opacity: 1;
}

.ud-actions> :nth-child(1) {
  animation-delay: 0.35s;
}

.ud-actions> :nth-child(2) {
  animation-delay: 0.42s;
}

.ud-actions> :nth-child(3) {
  animation-delay: 0.49s;
}

.ud-action-ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-radius: 16px;
  box-shadow: 0 14px 24px -10px rgba(21, 128, 61, 0.7);
  transition: transform 0.35s;
}

.ud-action-ico .icon {
  width: 24px;
  height: 24px;
}

.ud-action:hover .ud-action-ico {
  transform: scale(1.08) rotate(-6deg);
}

.ud-action h3 {
  position: relative;
  margin: 0.4rem 0 0;
  font-size: 1.0625rem;
}

.ud-action p {
  position: relative;
  flex: 1;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--u-text-muted);
}

.ud-action-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.ud-soon {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
}

.ud-ready {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
}

.ud-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--u-primary-hover);
  background: var(--u-primary-soft);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s, color 0.3s;
}

.ud-action:hover .ud-arrow {
  color: #fff;
  background: var(--u-primary);
  transform: translateX(4px);
}

.ud-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.ud-panel {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--u-border);
  border-radius: 20px;
  box-shadow: var(--u-shadow);
  animation: ut-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ud-split> :nth-child(1) {
  animation-delay: 0.55s;
}

.ud-split> :nth-child(2) {
  animation-delay: 0.62s;
}

.ud-panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.ud-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.ud-empty p {
  max-width: 22rem;
  margin: 0;
}

.ud-empty-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.4rem;
  color: var(--u-primary);
  background: var(--u-primary-soft);
  border-radius: 50%;
  animation: lg-bob 4s ease-in-out infinite;
}

.ud-empty-ico .icon {
  width: 28px;
  height: 28px;
}

.ud-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ud-perm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--u-primary-hover);
  text-transform: capitalize;
  background: var(--u-primary-soft);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  transition: transform 0.2s, background 0.2s;
}

.ud-perm:hover {
  background: #dcfce7;
  transform: translateY(-2px);
}

.ud-perm .icon {
  width: 13px;
  height: 13px;
}

.us-wrap {
  display: grid;
  place-items: center;
  min-height: 62vh;
}

.us-card {
  width: 100%;
  max-width: 34rem;
  padding: 2.75rem 2.5rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--u-border);
  border-radius: 26px;
  box-shadow: var(--u-shadow-lg);
  animation: ut-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.us-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-radius: 50%;
  box-shadow: 0 18px 34px -12px rgba(21, 128, 61, 0.7);
  animation: lg-pop 0.8s 0.1s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.us-orb::before,
.us-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(34, 197, 94, 0.5);
  border-radius: 50%;
  animation: ut-ripple 2.6s ease-out infinite;
}

.us-orb::after {
  animation-delay: 1.3s;
}

.us-orb .icon {
  width: 40px;
  height: 40px;
}

.us-card h1 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.us-card p {
  margin: 0;
  color: var(--u-text-muted);
}

.us-list {
  display: grid;
  gap: 0.6rem;
  margin: 1.75rem 0;
  padding: 0;
  text-align: left;
  list-style: none;
}

.us-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.875rem;
  background: var(--u-primary-soft);
  border-radius: 12px;
}

.us-list .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--u-primary);
}

@media (max-width: 1000px) {
  .ud-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .ud-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .ud-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .ud-visual {
    display: none;
  }
}

@media (max-width: 760px) {
  .ud-hero {
    padding: 1.75rem 1.5rem;
  }

  .ud-hero h1 {
    font-size: 1.75rem;
  }

  .ud-actions {
    grid-template-columns: 1fr;
  }

  .us-card {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .ud-stats {
    grid-template-columns: 1fr;
  }
}

.cam-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.cam-head h1 {
  margin: 0 0 0.25rem;
}

.cam-head p {
  margin: 0;
}

.cam-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cam-controls select {
  width: auto;
  min-width: 11rem;
  max-width: 15rem;
  text-overflow: ellipsis;
}

.cam-controls .ud-btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.cam-controls .ud-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ud-btn-outline {
  color: var(--u-text);
  background: var(--u-surface);
  border: 1px solid var(--u-border-strong) !important;
}

.cam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}

.cam-fit .cam-stage:not(:fullscreen),
.cam-fit .cam-gridwrap:not(:fullscreen) {
  width: min(100%, calc((100vh - 19rem) * 16 / 9));
  min-width: min(100%, 28rem);
  margin-inline: auto;
}

.cam-fit .cam-status {
  text-align: center;
}

.cam-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.cam-bar .cam-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: none;
  overflow: visible;
}

.cam-bar .cams-choice {
  width: auto;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(5, 15, 9, 0.06);
}

.cam-bar .cams-all {
  margin: 0;
  justify-content: flex-start;
}

.cam-bar .cams-all .icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cam-bar .cams-choice.is-chosen {
  color: #fff;
  background: var(--u-primary);
  border-color: var(--u-primary);
  box-shadow: 0 6px 16px -8px var(--u-primary);
}

.cam-bar .cams-choice.is-chosen .cams-state,
.cam-bar .cams-choice.is-chosen .cams-state.cams-ok {
  color: #fff;
}

.cam-bar .cams-choice.is-chosen .cams-state i {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.cam-bar .cam-empty {
  padding: 0.5rem 0;
}

.cam-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: var(--u-stage-fg);
  background: var(--u-stage-bg);
  border-radius: 20px;
  box-shadow: 0 24px 50px -28px rgba(5, 15, 9, 0.8);
}

.cam-stage video,
.cam-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cam-stage video {
  object-fit: fill;
}

.cam-fullscreen {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #fff;
  background: rgba(5, 15, 9, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
}

.cam-fullscreen:hover {
  background: rgba(5, 15, 9, 0.8);
}

.cams-all {
  margin-bottom: 0.6rem;
}

.cams-all .icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.cam-gridwrap {
  position: relative;
  padding: 0.5rem;
  background: var(--u-stage-bg);
  border-radius: 20px;
  box-shadow: 0 24px 50px -28px rgba(5, 15, 9, 0.8);
}

.cam-gridwrap.hidden {
  display: none;
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.cam-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.cam-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: #000;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.cam-tile canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cam-tile:focus-visible {
  outline: 2px solid var(--u-primary);
  outline-offset: 2px;
}

.cam-tile-name {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: rgba(5, 15, 9, 0.6);
  border-radius: 6px;
}

.cam-tile-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: #d6efde;
  pointer-events: none;
}

.cam-tile-note:empty {
  display: none;
}

.cam-gridwrap:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.cam-gridwrap:fullscreen .cam-grid {
  height: 100%;
  grid-auto-rows: 1fr;
}

.cam-gridwrap:fullscreen .cam-tile {
  aspect-ratio: auto;
}

.cam-gridwrap .cam-fullscreen [data-when="on"],
.cam-gridwrap:fullscreen .cam-fullscreen [data-when="off"] {
  display: none;
}

.cam-gridwrap:fullscreen .cam-fullscreen [data-when="on"] {
  display: block;
}

.cam-fullscreen .icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cam-fullscreen.hidden {
  display: none;
}

.cam-fullscreen [data-when="on"],
.cam-stage:fullscreen .cam-fullscreen [data-when="off"] {
  display: none;
}

.cam-stage:fullscreen .cam-fullscreen [data-when="on"] {
  display: block;
}

.cam-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.cam-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.cam-placeholder strong {
  color: #e8f5ec;
  font-size: 1.125rem;
}

.cam-placeholder .us-orb {
  margin-bottom: 0.75rem;
  width: 72px;
  height: 72px;
}

.cam-placeholder .us-orb .icon {
  width: 32px;
  height: 32px;
}

.cam-status {
  margin: 0.75rem 0 0;
  min-height: 1.4em;
  font-size: 0.875rem;
  color: var(--u-text-muted);
}

.cam-status[data-tone="error"] {
  color: var(--u-danger);
  font-weight: 600;
}

.cam-status[data-tone="warn"] {
  color: var(--u-warning);
}

.cam-note {
  margin: 0;
}

.cam-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
}

.cam-empty {
  color: var(--u-text-muted);
  font-size: 0.8125rem;
}

.cams-canvas {
  object-fit: contain;
}

/* The camera's live video stream (number plates), shown in the canvas's place when the server streams it. */
.cam-stage .lp-stream,
.cam-tile .lp-stream {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cams-choices {
  max-height: 320px;
}

.cams-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--u-text);
  text-align: left;
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  border-radius: var(--u-radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cams-choice:hover {
  background: var(--u-primary-soft);
}

.cams-choice.is-chosen {
  border-color: var(--u-primary);
  background: var(--u-primary-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--u-primary) 22%, transparent);
}

.cams-choice:focus-visible {
  outline: 2px solid var(--u-primary);
  outline-offset: 2px;
}

.cams-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cams-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--u-text-muted);
}

.cams-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.cams-ok {
  color: var(--u-success);
}

.cams-ok i {
  background: var(--u-success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--u-success) 25%, transparent);
}

.cams-wait i {
  background: var(--u-warning);
}

.cams-bad i {
  background: var(--u-danger);
}

.cams-face {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  background: var(--u-surface);
  border: 1px solid var(--u-border);
}

.cams-who {
  display: grid;
  min-width: 0;
}

.cams-who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cams-who small {
  font-size: 0.75rem;
}

.cam-person,
.cam-log-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.875rem;
  background: var(--u-primary-soft);
  border-radius: var(--u-radius-sm);
}

.cam-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--u-result-nomatch);
}

.cam-match .cam-dot {
  background: var(--u-result-match);
}

.cam-uncertain .cam-dot {
  background: var(--u-result-uncertain);
}

.cam-score,
.cam-log-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--u-text-muted);
  font-size: 0.8125rem;
}

@media (max-width: 900px) {
  .cam-layout {
    grid-template-columns: 1fr;
  }

  .cam-controls select {
    flex: 1;
    min-width: 9rem;
  }
}

.vj-head {
  margin-bottom: 1.25rem;
}

.vj-head h1 {
  margin: 0.25rem 0 0.35rem;
}

.vj-head p {
  margin: 0;
  max-width: 46rem;
}

.vj-back {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--u-primary-hover);
}

.vj-h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.0625rem;
}

.vj-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .vj-layout {
    grid-template-columns: 1fr;
  }
}

.vj-zone {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;
  text-align: center;
  border: 2px dashed var(--u-border-strong);
  border-radius: 16px;
  background: var(--u-primary-soft);
  transition: border-color 0.2s, background 0.2s;
}

.vj-zone.is-over {
  border-color: var(--u-primary);
  background: color-mix(in srgb, var(--u-primary) 10%, #fff);
}

.vj-zone .us-orb {
  width: 64px;
  height: 64px;
  margin-bottom: 0.4rem;
}

.vj-zone .us-orb .icon {
  width: 28px;
  height: 28px;
}

.vj-chosen {
  font-size: 0.875rem;
  font-weight: 600;
  word-break: break-all;
}

.vj-bar,
.vj-progress {
  height: 8px;
  overflow: hidden;
  background: #e3f3e8;
  border-radius: 999px;
}

.vj-bar {
  margin-top: 1rem;
}

.vj-bar i,
.vj-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #15803d);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.vj-error {
  margin-top: 0.9rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--u-danger);
  background: color-mix(in srgb, var(--u-danger) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--u-danger) 40%, #fff);
  border-radius: 10px;
}

.vj-send {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.vj-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.vj-limits {
  margin: 0.9rem 0 0;
}

.vj-jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.vj-job {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: var(--u-primary-soft);
  border: 1px solid var(--u-border);
  border-radius: 14px;
}

.vj-job-main {
  flex: 1;
  min-width: 12rem;
  display: grid;
  gap: 0.25rem;
}

.vj-job-name {
  word-break: break-all;
}

.vj-meta {
  font-size: 0.8125rem;
  color: var(--u-text-muted);
}

.vj-failure {
  font-size: 0.8125rem;
  color: var(--u-danger);
}

.vj-status {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--u-text-muted);
  white-space: nowrap;
}

.vj-running .vj-status,
.vj-completed .vj-status {
  color: var(--u-success);
}

.vj-failed .vj-status {
  color: var(--u-danger);
}

.vj-actions {
  display: flex;
  gap: 0.4rem;
}

.vj-empty {
  padding: 1.2rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--u-text-muted);
}

.vj-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--u-text);
  background: var(--u-surface);
  border: 1px solid var(--u-border-strong);
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
}

.vj-btn:hover {
  background: var(--u-primary-soft);
  text-decoration: none;
}

.vj-btn-primary {
  color: #fff;
  background: var(--u-button-bg);
  border-color: var(--u-button-bg);
}

.vj-btn-primary:hover {
  background: var(--u-button-hover);
}

.vj-btn-quiet {
  color: var(--u-text-muted);
}

.vj-none {
  text-align: center;
  padding: 2.5rem 1rem;
}

.vj-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.vj-person {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.9rem 0.6rem;
  font: inherit;
  text-align: center;
  cursor: pointer;
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  border-top: 3px solid var(--u-result-nomatch);
  border-radius: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.vj-person:hover {
  transform: translateY(-2px);
  box-shadow: var(--u-shadow);
}

.vj-person.vj-r-match {
  border-top-color: var(--u-result-match);
}

.vj-person.vj-r-uncertain {
  border-top-color: var(--u-result-uncertain);
}

.vj-face {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--u-primary-soft);
  border: 1px solid var(--u-border);
}

.vj-face-lg {
  width: 72px;
  height: 72px;
}

.vj-nopic {
  display: inline-block;
}

.vj-score {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--u-text-muted);
}

.vj-filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.vj-filters .vj-h2 {
  margin: 0 auto 0 0;
}

.vj-filters select {
  width: auto;
}

.vj-timeline {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.vj-sighting {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.9rem;
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  border-left: 4px solid var(--u-result-nomatch);
  border-radius: 12px;
}

.vj-sighting.vj-r-match {
  border-left-color: var(--u-result-match);
}

.vj-sighting.vj-r-uncertain {
  border-left-color: var(--u-result-uncertain);
}

.vj-time {
  min-width: 3.4rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--u-primary-hover);
}

.vj-sighting .vj-score {
  margin-left: auto;
}

.vj-badge {
  padding: 0.1rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  color: var(--u-text-muted);
  background: #eef2f0;
}

.vj-badge.vj-r-match {
  color: var(--u-success);
  background: color-mix(in srgb, var(--u-success) 12%, #fff);
}

.vj-badge.vj-r-uncertain {
  color: var(--u-warning);
  background: color-mix(in srgb, var(--u-warning) 12%, #fff);
}

.vj-player {
  margin-bottom: 0.5rem;
}

.vj-stage {
  position: relative;
  overflow: hidden;
  background: #06130b;
  border: 1px solid var(--u-border);
  border-radius: 14px;
  box-shadow: var(--u-shadow);
}

.vj-video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #06130b;
}

.vj-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The player's own controls (player-controls.js), styled like the browser's. Full screen takes the stage (video +
   boxes), not the bare video, so the boxes stay drawn. */
.vj-stage.vpc {
  outline: none;
}

.vpc .vj-video {
  cursor: pointer;
}

.vpc-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 1.75rem 0.6rem 0.45rem;
  color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72));
  transition: opacity 0.25s;
}

.vj-stage.vpc-idle .vpc-bar {
  opacity: 0;
  pointer-events: none;
}

.vj-stage.vpc-idle:fullscreen,
.vj-stage.vpc-idle:fullscreen .vj-video {
  cursor: none;
}

.vpc-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.vpc-btn:hover,
.vpc-btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.vpc-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.vpc-time {
  flex: none;
  padding: 0 0.4rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.vpc-vol {
  display: flex;
  flex: none;
  align-items: center;
}

/* Sliders: a thin track filled up to the position (--vpc-fill), a round white thumb. */
.vpc-seek,
.vpc-volume {
  height: 4px;
  margin: 0;
  background: linear-gradient(to right, #fff var(--vpc-fill, 0%), rgba(255, 255, 255, 0.35) var(--vpc-fill, 0%));
  border-radius: 999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: height 0.12s;
}

.vpc-seek {
  flex: 1;
  min-width: 3rem;
}

.vpc-seek:hover,
.vpc-seek:focus-visible {
  height: 6px;
  outline: none;
}

.vpc-volume {
  width: 0;
  opacity: 0;
  transition: width 0.18s, opacity 0.18s, margin 0.18s;
}

.vpc-vol:hover .vpc-volume,
.vpc-vol:focus-within .vpc-volume {
  width: 4.5rem;
  margin: 0 0.5rem 0 0.15rem;
  opacity: 1;
}

.vpc-seek::-webkit-slider-thumb,
.vpc-volume::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  -webkit-appearance: none;
  appearance: none;
}

.vpc-seek::-moz-range-thumb,
.vpc-volume::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.vpc-seek::-moz-range-track,
.vpc-volume::-moz-range-track {
  background: transparent;
}

.vj-stage:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: #000;
}

.vj-stage:fullscreen .vj-video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #000;
}

.vj-player-note {
  margin: 0.5rem 0 0;
}

.vj-seekable {
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.vj-seekable:hover {
  background: var(--u-primary-soft);
  transform: translateX(2px);
}

.vj-seekable:focus-visible {
  outline: 2px solid var(--u-primary);
  outline-offset: 2px;
}

.ud-open {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--u-primary-hover);
}

.ud-panel h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.uh-section {
  display: grid;
  gap: 1.1rem;
  margin-top: 2.25rem;
}

.uh-section>* {
  animation: uh-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.uh-section> :nth-child(2) {
  animation-delay: 0.05s;
}

.uh-section> :nth-child(3) {
  animation-delay: 0.1s;
}

.uh-section> :nth-child(4) {
  animation-delay: 0.15s;
}

.uh-section> :nth-child(5) {
  animation-delay: 0.2s;
}

.uh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.uh-head h2 {
  margin: 0.15rem 0 0.25rem;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.uh-head p {
  margin: 0;
  max-width: 44rem;
  font-size: 0.875rem;
  color: var(--u-text-muted);
}

.uh-eyebrow {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--u-primary);
}

.uh-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--u-text-muted);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--u-border);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.uh-updated i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.uh-updated[data-state="ok"] {
  color: var(--u-success);
}

.uh-updated[data-state="ok"] i {
  background: var(--u-success);
  animation: uh-pulse 1.8s ease-out infinite;
}

.uh-updated[data-state="bad"] {
  color: var(--u-danger);
}

.uh-updated[data-state="bad"] i {
  background: var(--u-danger);
}

.uh-card,
.uh-kpi {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(15, 42, 26, 0.04), 0 18px 36px -20px rgba(15, 42, 26, 0.22);
  backdrop-filter: blur(10px);
}

.uh-card {
  min-width: 0;
  padding: 1.25rem 1.4rem 1.35rem;
}

.uh-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.uh-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.uh-card-head p {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--u-text-muted);
}

.uh-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.uh-kpi {
  --tone: #16a34a;
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem 1rem;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 100% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.86));
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s;
}

.uh-kpi:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(15, 42, 26, 0.04), 0 26px 44px -22px color-mix(in srgb, var(--tone) 55%, transparent);
}

.uh-kpi[data-tone="teal"] {
  --tone: #0d9488;
}

.uh-kpi[data-tone="amber"] {
  --tone: #f59e0b;
}

.uh-kpi[data-tone="blue"] {
  --tone: #0284c7;
}

.uh-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--u-text-muted);
}

.uh-kpi-ico {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(135deg, var(--tone), color-mix(in srgb, var(--tone) 62%, #000));
  border-radius: 13px;
  box-shadow: 0 10px 18px -8px var(--tone), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.uh-kpi-ico .icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.uh-kpi strong {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.uh-kpi-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 40px;
}

.uh-kpi-foot small {
  font-size: 0.75rem;
  color: var(--u-text-muted);
}

.uh-spark {
  display: inline-flex;
  flex: none;
}

/* ---- The add-ons on the dashboard as tabs (dashboard.blade.php): one add-on at a time, its numbers kept compact ---- */
.dx-addons {
  margin-top: 2rem;
}

.dx-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: 16px;
  box-shadow: 0 10px 24px -18px rgba(15, 42, 26, 0.3);
  backdrop-filter: blur(8px);
}

.dx-tabs::-webkit-scrollbar {
  display: none;
}

.dx-tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--u-text-muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.dx-tabs button .icon {
  width: 17px;
  height: 17px;
}

.dx-tabs button:hover {
  color: var(--u-text);
  background: rgba(22, 163, 74, 0.08);
}

.dx-tabs button[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.8);
}

.dx-tabs button:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

/* Inside a tab: the tab already names the add-on, so its heading is smaller and its note one line. */
.dx-panel .uh-section {
  margin-top: 1rem;
  gap: 0.85rem;
}

.dx-panel .uh-head {
  align-items: center;
}

.dx-panel .uh-eyebrow {
  display: none;
}

.dx-panel .uh-head h2 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
}

.dx-panel .uh-head p {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8125rem;
}

.dx-panel .uh-updated {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.dx-panel .uh-kpis {
  gap: 0.75rem;
}

.dx-panel .uh-kpi {
  gap: 0.15rem;
  padding: 0.8rem 1rem 0.75rem;
  border-radius: 18px;
}

.dx-panel .uh-kpi-top {
  font-size: 0.8125rem;
}

.dx-panel .uh-kpi-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.dx-panel .uh-kpi-ico .icon {
  width: 16px;
  height: 16px;
}

.dx-panel .uh-kpi strong {
  font-size: 1.75rem;
}

.dx-panel .uh-kpi-foot {
  min-height: 24px;
}

.dx-panel .uh-main {
  gap: 0.75rem;
}

.dx-panel .uh-card {
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 18px;
}

:root[data-theme="dark"] .dx-tabs {
  background: rgba(11, 23, 16, 0.75);
  border-color: var(--admin-border);
}

:root[data-theme="dark"] .dx-tabs button:hover {
  color: #fff;
  background: rgba(74, 222, 128, 0.1);
}

.uh-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
}

.uh-seg {
  display: inline-flex;
  padding: 4px;
  background: var(--u-primary-soft);
  border: 1px solid var(--u-border);
  border-radius: 999px;
}

.uh-seg button {
  padding: 0.35rem 0.95rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--u-text-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.uh-seg button:hover {
  color: var(--u-text);
}

.uh-seg button.active {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 8px 16px -8px #16a34a;
}

.uh-seg button:focus-visible {
  outline: 2px solid var(--u-primary);
  outline-offset: 2px;
}

.uh-chart {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.uh-chart.hidden,
.uh-donut.hidden,
.uh-legend.hidden,
.uh-keys.hidden {
  display: none;
}

.hc-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.hc-grid {
  stroke: rgba(15, 42, 26, 0.09);
  stroke-dasharray: 3 6;
}

.hc-axis {
  font-size: 11px;
  fill: #6b8072;
  font-variant-numeric: tabular-nums;
}

.hc-line {
  fill: none;
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hc-cross {
  stroke: rgba(15, 42, 26, 0.3);
  stroke-dasharray: 4 4;
}

.hc-reveal {
  animation: hc-reveal 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.hc-tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 0.65rem 0.8rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #fff;
  background: rgba(15, 42, 26, 0.93);
  border-radius: 14px;
  box-shadow: 0 18px 32px -12px rgba(5, 15, 9, 0.6);
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.hc-tip.hidden {
  display: none;
}

/* The time chart's read-out, placed on the page (home-charts.js) so no card can cut it off. */
.hc-tip-floating {
  position: fixed;
  z-index: 60;
}

.hc-tip strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8125rem;
}

.hc-tip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
}

.hc-tip b {
  font-variant-numeric: tabular-nums;
}

.hc-tip-total {
  margin-top: 0.25rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #bbf7d0;
  font-weight: 700;
}

.uh-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 0.6rem;
}

.uh-key {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--u-text-muted);
}

.uh-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 4px;
}

.uh-donut {
  display: grid;
  justify-items: center;
  padding-top: 0.25rem;
}

.hc-donut-track {
  fill: none;
  stroke: rgba(15, 42, 26, 0.07);
  stroke-width: 18;
}

.hc-donut-arc {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
  animation: hc-fade 0.9s ease backwards;
}

.hc-donut-num {
  font-size: 30px;
  font-weight: 800;
  fill: var(--u-text);
  letter-spacing: -0.02em;
}

.hc-donut-cap {
  font-size: 12px;
  fill: var(--u-text-muted);
}

.hc-spark {
  display: block;
}

.hc-ring-track {
  fill: none;
  stroke: rgba(2, 132, 199, 0.16);
  stroke-width: 5;
}

.hc-ring-arc {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.uh-legend {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.uh-legend li {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr auto 2.6rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
}

.uh-legend-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.uh-legend-name i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 4px;
}

.uh-legend-bar {
  height: 6px;
  overflow: hidden;
  background: rgba(15, 42, 26, 0.07);
  border-radius: 999px;
}

.uh-legend-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.uh-legend small {
  text-align: right;
  color: var(--u-text-muted);
}

.uh-legend strong {
  font-variant-numeric: tabular-nums;
}

.uh-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--u-text-muted);
}

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

.uh-empty>span {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--u-primary);
  background: var(--u-primary-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--u-primary) 8%, transparent);
}

.uh-empty .icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1000px) {
  .uh-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .uh-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .uh-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .uh-legend li {
    grid-template-columns: minmax(5rem, auto) 1fr auto 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .uh-section>*,
  .hc-reveal,
  .hc-donut-arc,
  .uh-updated[data-state="ok"] i {
    animation: none;
  }

  .uh-kpi,
  .uh-kpi:hover {
    transition: none;
    transform: none;
  }
}

.uh-kpis,
.uh-main {
  perspective: 1400px;
}

.uh-card,
.uh-kpi {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(15, 42, 26, 0.06), 0 10px 20px -8px rgba(15, 42, 26, 0.16), 0 26px 44px -22px rgba(22, 101, 52, 0.3);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}

.uh-card::before,
.uh-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tone, #16a34a), color-mix(in srgb, var(--tone, #16a34a) 40%, #0284c7));
}

.uh-card:hover,
.uh-kpi:hover {
  transform: translateY(-5px) rotateX(2deg);
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(15, 42, 26, 0.08), 0 20px 32px -10px rgba(15, 42, 26, 0.22), 0 40px 60px -24px color-mix(in srgb, var(--tone, #16a34a) 55%, transparent);
}

.uh-kpi strong {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 85%, #000), var(--tone) 55%, color-mix(in srgb, var(--tone) 60%, #0284c7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.uh-kpi-ico {
  box-shadow: 0 14px 22px -8px var(--tone), 0 2px 0 rgba(255, 255, 255, 0.4) inset, 0 -3px 0 rgba(0, 0, 0, 0.12) inset;
  transform: translateZ(20px);
}

.uh-seg {
  box-shadow: inset 0 2px 4px rgba(15, 42, 26, 0.1);
}

.uh-seg button.active {
  box-shadow: 0 10px 16px -8px #16a34a, 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.uh-updated {
  box-shadow: 0 1px 0 #fff inset, 0 6px 12px -4px rgba(15, 42, 26, 0.18);
}

.uh-legend-bar {
  box-shadow: inset 0 1px 3px rgba(15, 42, 26, 0.15);
}

.uh-donut svg {
  filter: drop-shadow(0 14px 14px rgba(15, 42, 26, 0.2));
}

@media (prefers-reduced-motion: reduce) {

  .uh-card,
  .uh-kpi {
    transition: none;
  }

  .uh-card:hover,
  .uh-kpi:hover {
    transform: none;
  }
}

.cam-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cam-tools .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
}

.cam-tools .btn .icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cam-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.cam-split.has-side {
  grid-template-columns: minmax(0, 1fr) 21rem;
}

.cam-split>.cam-stage-wrap {
  min-width: 0;
}

.cam-split.has-side .cam-fit .cam-stage:not(:fullscreen) {
  width: 100%;
  min-width: 0;
}

.cam-side {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  gap: 0.6rem;
}

.cam-side.hidden {
  display: none;
}

.cam-side .cs-card {
  padding: 0.75rem 0.9rem 0.85rem;
}

.cam-side .cs-head {
  margin-bottom: 0.5rem;
}

.cam-side .cs-label {
  margin-bottom: 0.4rem;
}

.cam-side .cs-tile {
  padding: 0.4rem 0.6rem;
}

.cam-side .cs-tile strong {
  font-size: 1.25rem;
}

.cam-side .cs-row {
  padding: 0.3rem 0.5rem;
}

.cam-side .cs-face {
  width: 32px;
  height: 32px;
}

.cs-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 999px;
}

.cs-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.cs-chart {
  margin-top: 0.3rem;
  min-width: 0;
  overflow: hidden;
}

.cam-side .cs-label.cs-gap {
  margin-top: 0.8rem;
}

@media (max-width: 1100px) {
  .cam-split.has-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cs-card {
  padding: 1rem 1.1rem 1.1rem;
  background: linear-gradient(160deg, #ffffff, color-mix(in srgb, var(--u-primary-soft) 70%, #ffffff));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(15, 42, 26, 0.06), 0 10px 20px -8px rgba(15, 42, 26, 0.16), 0 24px 40px -22px rgba(22, 101, 52, 0.3);
}

.cs-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.cs-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-label {
  margin: 0 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--u-text-muted);
}

.cs-head+.cs-label {
  margin-top: 0;
}

.cs-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.cs-tile {
  --tone: #16a34a;
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem 0.7rem;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--tone) 8%, #fff));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 13px;
  box-shadow: 0 1px 0 #fff inset, 0 3px 6px -2px rgba(15, 42, 26, 0.14), 0 10px 16px -10px color-mix(in srgb, var(--tone) 55%, transparent);
  transition: transform 0.2s ease;
}

.cs-tile:hover {
  transform: translateY(-2px);
}

.cs-tile span {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--u-text-muted);
}

.cs-tile strong {
  font-size: 1.5rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--u-text);
}

.cs-good {
  --tone: #16a34a;
}

.cs-good strong {
  color: #15803d;
}

.cs-muted {
  --tone: #64748b;
}

.cs-muted strong {
  color: #475569;
}

.cs-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cs-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
  border-left: 4px solid var(--u-text-muted);
  border-radius: 11px;
  box-shadow: 0 2px 6px -3px rgba(15, 42, 26, 0.2);
  animation: ut-rise 0.4s ease both;
}

.cs-row.cs-match {
  border-left-color: var(--u-result-match);
}

.cs-row.cs-uncertain {
  border-left-color: var(--u-result-uncertain);
}

.cs-row div {
  min-width: 0;
  display: grid;
}

.cs-row small {
  font-size: 0.75rem;
  color: var(--u-text-muted);
}

.cs-face {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  background: var(--u-primary-soft);
  border: 1px solid var(--u-border);
}

.cs-wait {
  font-size: 0.8125rem;
  color: var(--u-text-muted);
}

.cam-tools .btn-danger-outline.hidden,
.cam-tools .cam-power.hidden {
  display: none;
}

/* Switching the open camera on or off on the Live page: off, it is not read, so it uses no CPU or GPU. */
.cam-tools .cam-power {
  gap: 0.55rem;
  padding: 0 0.9rem 0 0.6rem;
  color: var(--u-text-muted);
  background: var(--u-surface, #fff);
  border: 1px solid var(--u-border);
}

.cam-power-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.cam-power-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
  transition: transform 0.15s ease;
}

.cam-power[aria-checked="true"] {
  color: var(--u-success);
}

.cam-power[aria-checked="true"] .cam-power-track {
  background: var(--u-success);
}

.cam-power[aria-checked="true"] .cam-power-track i {
  transform: translateX(14px);
}

.cam-power:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* The choice in a confirmation (e.g. "Also delete its recognition history"). */
.confirm-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: var(--admin-primary-soft);
  cursor: pointer;
}

.confirm-option input {
  margin-top: 0.15rem;
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--admin-danger);
}

.confirm-option span {
  display: grid;
  gap: 0.2rem;
}

.confirm-option small {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.cam-head {
  align-items: center;
}

.cam-tools {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cam-seg,
.seg-list,
.cam-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cam-tools .btn,
.cam-seg .cams-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
}

.cam-tools .btn .icon,
.cam-seg .cams-choice .icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cam-tools .btn-icon {
  width: 40px;
  padding: 0;
}

.cam-tools .btn-icon.hidden {
  display: none;
}

.cam-seg .cams-choice {
  color: var(--u-text);
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  box-shadow: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cam-seg .cams-choice:hover {
  background: var(--u-primary-soft);
}

.cam-seg .cams-choice.is-chosen {
  color: #fff;
  background: var(--u-primary);
  border-color: var(--u-primary);
  box-shadow: none;
}

.cam-seg .cams-name {
  font-weight: 600;
}

.cam-seg .cams-state {
  gap: 0.3rem;
  font-size: 0.75rem;
}

.cam-seg .cams-state i {
  width: 8px;
  height: 8px;
}

.cam-seg .cams-ok {
  color: #dc2626;
}

.cam-seg .cams-ok i {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.cam-seg .cams-choice.is-chosen .cams-state {
  color: #fff;
}

.cam-seg .cams-choice.is-chosen .cams-ok i {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .cam-tools {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .cam-seg,
  .seg-list,
  .cam-actions {
    justify-content: flex-start;
  }
}

.cam-seg .seg-all {
  display: flex;
}

.cam-seg .seg-all .cams-all {
  margin: 0;
}

.cam-seg .cams-ok i {
  animation: cam-blink 1.2s ease-in-out infinite;
}

.cam-seg .cams-choice.is-chosen .cams-state.cams-ok {
  padding: 0.2rem 0.55rem;
  color: #dc2626;
  font-weight: 700;
  background: #fff;
  border-radius: 999px;
}

.cam-seg .cams-choice.is-chosen .cams-ok i {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .cam-seg .cams-ok i {
    animation: none;
  }
}

.up-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
  perspective: 1600px;
}

.up-split>.up-col {
  position: relative;
  min-width: 0;
  height: calc(100vh - 13rem);
  min-height: 22rem;
}

.up-col>.cs-card {
  height: 100%;
  animation: ut-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.up-main {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.up-zone {
  flex: 1;
  align-content: center;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
}

/* While a video uploads, no other can be chosen or dropped. */
.up-zone.is-busy {
  cursor: progress;
}

.up-zone .vj-bar {
  width: min(26rem, 100%);
  margin-top: 0.8rem;
}

.up-zone .vj-error {
  width: min(34rem, 100%);
}

.up-limits {
  margin: 0;
  text-align: center;
}

.up-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.up-side .vj-jobs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  padding: 0 0.25rem 0.3rem 0;
  scrollbar-width: thin;
}

@media (max-width: 1000px) {
  .up-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .up-split>.up-col {
    height: auto;
  }

  .up-col>.cs-card {
    height: auto;
  }

  .up-side .vj-jobs {
    max-height: 24rem;
  }

  .up-an {
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {

  .up-col>.cs-card,
  .up-an,
  .up-view {
    animation: none;
  }
}

.up-view {
  padding: 0;
  overflow: hidden;
  background: #06130b;
  animation: up-slide 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.up-view #up-player,
.up-view .vj-player,
.up-view .vj-stage {
  height: 100%;
  margin: 0;
}

.up-view .vj-stage {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.up-view .vj-video {
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.up-view .vj-player-note,
.up-view .up-none {
  color: #cfe9d8;
}

@media (max-width: 1000px) {

  .up-view,
  .up-view #up-player,
  .up-view .vj-player,
  .up-view .vj-stage {
    height: auto;
  }

  .up-view .vj-video {
    height: auto;
    max-height: 70vh;
  }
}

.up-none {
  padding: 2rem;
  text-align: center;
}

.up-an {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  transform-origin: left center;
  animation: up-swing 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.up-an.hidden {
  display: none;
}

.up-an .cs-card {
  padding: 0.8rem 0.9rem 0.9rem;
  min-height: 0;
}

.up-an .cs-card:last-child {
  display: flex;
  flex-direction: column;
}

.up-an .cs-card:last-child .cs-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.2rem 0.3rem 0;
  scrollbar-width: thin;
}

.up-an .up-people {
  max-height: 9.5rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
}

.up-an .cs-tile {
  padding: 0.45rem 0.6rem;
}

.up-an .cs-tile strong {
  font-size: 1.25rem;
}

.cs-sub {
  margin: -0.2rem 0 0.6rem;
  font-size: 0.75rem;
  color: var(--u-text-muted);
}

.cs-done {
  padding: 0.1rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--u-success);
  background: color-mix(in srgb, var(--u-success) 12%, #fff);
  border-radius: 999px;
}

.cs-time {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--u-primary-hover);
}

.cs-seek {
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.cs-seek:hover {
  transform: translateX(2px);
  background: var(--u-primary-soft);
}

.cs-seek:focus-visible {
  outline: 2px solid var(--u-primary);
  outline-offset: 2px;
}

.cs-row.is-picked {
  background: color-mix(in srgb, var(--u-primary) 12%, #fff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--u-primary) 35%, transparent);
}

.vj-empty-3d {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.3rem;
  min-height: 100%;
  padding: 1.5rem 0.5rem 1rem;
  text-align: center;
}

.up-side .vj-jobs:has(.vj-empty-3d) {
  align-content: center;
}

.up-side .vj-jobs:has(.vj-empty-3d)>.vj-empty-3d {
  min-height: 0;
}

.vj-empty-3d strong {
  font-size: 0.95rem;
  color: var(--u-text);
}

.vj-empty-3d>span {
  max-width: 17rem;
  line-height: 1.45;
}

.ve-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: 14rem;
  height: 12.5rem;
  margin-top: 1.5rem;
  perspective: 900px;
}

.ve-stack {
  position: relative;
  width: 7.4rem;
  height: 5.2rem;
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-32deg);
  animation: ve-turn 9s ease-in-out infinite;
}

.ve-shadow {
  position: absolute;
  inset: -22%;
  transform: translateZ(-26px);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--u-primary) 38%, transparent), transparent);
  filter: blur(7px);
  animation: ve-shadow 3.6s ease-in-out infinite;
}

.ve-layer {
  --z: 0px;
  position: absolute;
  inset: 0;
  transform: translateZ(var(--z));
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--u-primary) 45%, #ffffff);
  background: linear-gradient(135deg, #ffffff, var(--u-primary-soft));
  box-shadow: 0 0.7rem 1.2rem color-mix(in srgb, var(--u-primary) 18%, transparent);
  animation: ve-lift 3.6s ease-in-out infinite;
}

.ve-layer:nth-of-type(2) {
  --z: 0px;
  opacity: 0.65;
  animation-delay: 0s;
}

.ve-layer:nth-of-type(3) {
  --z: 14px;
  opacity: 0.85;
  animation-delay: 0.15s;
}

.ve-layer:nth-of-type(4) {
  --z: 28px;
  animation-delay: 0.3s;
}

.ve-layer:nth-of-type(4)::before {
  content: "";
  position: absolute;
  inset: 0.45rem 0.35rem;
  border-left: 5px dotted color-mix(in srgb, var(--u-primary) 55%, #ffffff);
  border-right: 5px dotted color-mix(in srgb, var(--u-primary) 55%, #ffffff);
}

.ve-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.ve-play i {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--u-primary), var(--u-primary-hover));
  box-shadow: 0 0.35rem 0.8rem color-mix(in srgb, var(--u-primary) 45%, transparent);
}

.ve-play svg {
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0.1rem;
  fill: #ffffff;
}

.ve-scan {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.6rem;
  height: 3.6rem;
  margin: -1.8rem 0 0 -1.8rem;
  transform: translateZ(62px) rotateZ(32deg) rotateX(-58deg);
  animation: ve-bob 2.8s ease-in-out infinite;
}

.ve-scan-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--u-surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--u-primary) 35%, #ffffff);
  box-shadow: 0 0.6rem 1.2rem color-mix(in srgb, var(--u-primary) 25%, transparent);
  overflow: hidden;
}

.ve-scan-face svg {
  width: 2.1rem;
  height: 2.1rem;
  fill: none;
  stroke: var(--u-primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ve-scan-face::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--u-primary), transparent);
  box-shadow: 0 0 0.5rem var(--u-primary);
  animation: ve-sweep 2.2s ease-in-out infinite;
}

.ve-scan i {
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border: 0 solid var(--u-primary);
}

.ve-scan i:nth-of-type(1) {
  top: -0.25rem;
  left: -0.25rem;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 0.4rem;
}

.ve-scan i:nth-of-type(2) {
  top: -0.25rem;
  right: -0.25rem;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 0.4rem;
}

.ve-scan i:nth-of-type(3) {
  bottom: -0.25rem;
  left: -0.25rem;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 0.4rem;
}

.ve-scan i:nth-of-type(4) {
  bottom: -0.25rem;
  right: -0.25rem;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 0.4rem;
}

.ve-dot {
  position: absolute;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--u-primary);
  opacity: 0.5;
  animation: ve-drift 4.2s ease-in-out infinite;
}

.ve-dot:nth-of-type(1) {
  top: 14%;
  left: 12%;
}

.ve-dot:nth-of-type(2) {
  top: 26%;
  right: 10%;
  width: 0.3rem;
  height: 0.3rem;
  animation-delay: 1.1s;
}

.ve-dot:nth-of-type(3) {
  bottom: 18%;
  left: 20%;
  width: 0.28rem;
  height: 0.28rem;
  animation-delay: 2.2s;
}

@media (prefers-reduced-motion: reduce) {

  .ve-stack,
  .ve-shadow,
  .ve-layer,
  .ve-scan,
  .ve-scan-face::after,
  .ve-dot {
    animation: none;
  }
}

@keyframes cam-blink {
  50% {
    opacity: 0.35;
  }
}

@keyframes hc-fade {
  from {
    opacity: 0;
    stroke-width: 6;
  }
}

@keyframes hc-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes lg-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes lg-gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes lg-pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes uh-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--u-success) 55%, transparent);
  }

  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}

@keyframes uh-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes up-slide {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
}

@keyframes up-swing {
  from {
    opacity: 0;
    transform: perspective(1600px) rotateY(-38deg) translateX(70px) scale(0.94);
  }
}

@keyframes ut-ripple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes ut-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ve-bob {
  50% {
    transform: translateZ(78px) rotateZ(32deg) rotateX(-58deg);
  }
}

@keyframes ve-drift {
  50% {
    transform: translate(0.5rem, -0.7rem);
    opacity: 0.15;
  }
}

@keyframes ve-lift {
  50% {
    transform: translateZ(calc(var(--z) + 16px));
  }
}

@keyframes ve-shadow {
  50% {
    opacity: 0.55;
    transform: translateZ(-26px) scale(1.12);
  }
}

@keyframes ve-sweep {

  0%,
  100% {
    top: 10%;
    opacity: 0;
  }

  15%,
  85% {
    opacity: 1;
  }

  50% {
    top: 86%;
  }
}

@keyframes ve-turn {

  0%,
  100% {
    transform: rotateX(58deg) rotateZ(-32deg);
  }

  50% {
    transform: rotateX(58deg) rotateZ(-16deg);
  }
}

.admin-main:has(.cam-split),
.admin-main:has(.up-split) {
  padding-bottom: 1rem;
}

p.vj-error {
  margin: 0;
}

/* Permissions of one person (Users page): how each differs from the role's. */
.perm-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--admin-text-muted);
}

.perm-note-custom {
  color: var(--admin-warning);
  font-weight: 600;
}

.modal-header .muted {
  margin: 0.15rem 0 0;
  font-weight: 400;
}

/* The permissions window of one person: wide, three to a row, and short enough to fit the screen. The list scrolls
   inside it while the title and the buttons stay in view. */
dialog#perm-modal {
  width: min(68rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
}

dialog#perm-modal[open] {
  display: flex;
  flex-direction: column;
}

#perm-modal .modal-header {
  flex: none;
  padding-block: 0.75rem;
}

#perm-modal .modal-header h2 {
  font-size: 1.125rem;
}

#perm-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-block: 0.75rem;
}

#perm-modal .modal-body>p {
  margin: 0 0 0.6rem;
}

#perm-modal .modal-footer {
  flex: none;
  padding-block: 0.65rem;
}

#perm-modal .stack {
  gap: 0.6rem;
}

#perm-modal .perm-group-head {
  margin-bottom: 0.3rem;
}

#perm-modal .perm-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

#perm-modal .perm {
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
}

#perm-modal .perm-label {
  font-size: 0.8125rem;
  line-height: 1.25;
}

#perm-modal .perm-code {
  font-size: 0.6875rem;
}

#perm-modal .perm-note {
  margin-top: 0.05rem;
  font-size: 0.625rem;
}

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

@media (max-width: 560px) {
  #perm-modal .perm-grid {
    grid-template-columns: 1fr;
  }
}

/* A permission's one-line description, under its name. */
.perm-desc {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--admin-text-muted);
}

#perm-modal .perm-desc {
  font-size: 0.6875rem;
}

/* The Permissions screen: the groups side by side, a card per permission, and the Save button up in the header. */
.role-head {
  align-items: center;
}

.role-meta {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.perm-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.5rem 1.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--admin-border);
}

.perm-group {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.perm-group .perm-group-head {
  margin: 0;
}

.perm-group .perm-grid {
  grid-template-columns: 1fr;
}

.perm-group .perm {
  padding: 0.65rem 0.85rem;
}

.perm-group .perm-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.perm-group .perm-desc {
  font-size: 0.78rem;
}

/* Live streaming and Upload: the side panel that is not open yet is turned and moved off to the side. Whatever it
   sticks out beyond the page must not make the page scroll, sideways or down. A little margin is kept so the picture's
   shadow is not cut off. */
.cam-split,
.up-split {
  overflow: clip;
  overflow-clip-margin: 2rem;
}

.admin-main:has(.cam-split),
.admin-main:has(.up-split) {
  overflow-x: clip;
}

/* The welcome banner at the top of the dashboard. */
.ad-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 2.75rem;
  overflow: hidden;
  color: #e8f5ec;
  background: linear-gradient(135deg, #050f09, #0b2a1a 55%, #0f3d24);
  border-radius: 26px;
  box-shadow: 0 30px 60px -28px rgba(5, 15, 9, 0.8), 0 0 0 1px rgba(74, 222, 128, 0.12);
  animation: al-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ad-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(74, 222, 128, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(74, 222, 128, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 85% 50%, #000 5%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 85% 50%, #000 5%, transparent 70%);
  animation: al-grid 18s linear infinite;
}

.ad-orb {
  position: absolute;
  right: -80px;
  top: -120px;
  width: 360px;
  height: 360px;
  background: #16a34a;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: al-float 14s ease-in-out infinite;
}

.ad-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.ad-hero h1 {
  margin: 1rem 0 0.6rem;
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
}

.ad-hero p {
  margin: 0 0 1.5rem;
  color: #9db8a8;
}

.ad-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 999px;
}

.ad-tag b {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: al-blink 1.6s ease-in-out infinite;
}

.ad-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ad-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--admin-radius-btn);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.ad-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.ad-btn .icon {
  width: 16px;
  height: 16px;
}

.ad-btn-solid {
  color: #04140a;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 14px 28px -12px rgba(34, 197, 94, 0.8);
}

.ad-btn-glass {
  color: #e8f5ec;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ad-btn-glass:hover {
  background: rgba(255, 255, 255, 0.13);
}

.ad-shield {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  place-items: center;
  width: 120px;
  height: 120px;
  margin-right: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(34, 197, 94, 0.5);
  animation: al-pop 0.9s 0.2s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.ad-shield::before,
.ad-shield::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(74, 222, 128, 0.6);
  border-radius: 50%;
  animation: al-ripple 2.6s ease-out infinite;
}

.ad-shield::after {
  animation-delay: 1.3s;
}

.ad-shield .icon {
  width: 52px;
  height: 52px;
}

@media (max-width: 860px) {
  .ad-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem 1.5rem;
  }

  .ad-hero h1 {
    font-size: 1.7rem;
  }

  .ad-shield {
    display: none;
  }
}

@keyframes al-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes al-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(60px, 40px) scale(1.15);
  }
}

@keyframes al-grid {
  to {
    background-position: 52px 52px;
  }
}

@keyframes al-pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes al-ripple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes al-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dashboard summary: as many columns as cards (ad-stats-N), the stat cards are links to their page. */
.ad-stats-1 {
  grid-template-columns: minmax(0, 1fr);
}

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

a.ad-stat {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.ad-stat:focus-visible {
  outline: 2px solid var(--u-primary, var(--admin-primary, #16a34a));
  outline-offset: 2px;
}

@media (max-width: 480px) {

  .ad-stats-1,
  .ad-stats-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Roles page: the "Built-in" mark next to a role's name. */
.role-system {
  margin-left: 0.5rem;
  vertical-align: middle;
  font-size: 0.7rem;
}


/* ==== Roles list: one card per role ===================================================================== */
.rl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.rl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.35rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  box-shadow: var(--admin-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: al-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.rl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow-lg);
  border-color: var(--admin-border-strong);
}

.rl-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rl-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 8px 18px -8px rgba(21, 128, 61, 0.7);
}

.rl-avatar .icon {
  width: 20px;
  height: 20px;
}

.rl-title {
  min-width: 0;
  flex: 1;
}

.rl-title h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-code {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
  border-radius: 6px;
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
}

.rl-tag {
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.rl-meter-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-bottom: 0.4rem;
}

.rl-meter-top strong {
  color: var(--admin-text);
}

.rl-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--admin-primary-soft);
  overflow: hidden;
}

.rl-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, var(--admin-primary));
}

.rl-modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.rl-module {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: #f8fcf9;
  font-size: 0.85rem;
}

.rl-module-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: none;
  color: var(--admin-primary);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
}

.rl-module-ico .icon {
  width: 15px;
  height: 15px;
}

.rl-module-name {
  font-weight: 500;
}

.rl-level {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.rl-full .rl-level {
  color: var(--admin-success);
}

.rl-partial .rl-level {
  color: var(--admin-warning);
}

.rl-none {
  opacity: 0.6;
}

.rl-none .rl-level {
  color: var(--admin-text-muted);
  font-weight: 500;
}

.rl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--admin-border);
}

.rl-users {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--admin-text-muted);
}

.rl-users .icon {
  width: 16px;
  height: 16px;
}

.rl-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rl-actions .btn .icon {
  width: 15px;
  height: 15px;
}

/* The administrator: the dark green of the dashboard hero. */
.rl-card-admin {
  color: #e8f5ec;
  border-color: rgba(74, 222, 128, 0.18);
  background: radial-gradient(120% 90% at 100% 0%, rgba(74, 222, 128, 0.18), transparent 55%), linear-gradient(140deg, #050f09, #0b2a1a 55%, #0f3d24);
  box-shadow: 0 24px 48px -26px rgba(5, 15, 9, 0.8);
}

.rl-card-admin:hover {
  border-color: rgba(74, 222, 128, 0.35);
}

.rl-card-admin .rl-avatar {
  background: linear-gradient(135deg, #4ade80, #16a34a);
}

.rl-card-admin .rl-code {
  color: #bbf7d0;
  background: rgba(255, 255, 255, 0.08);
}

.rl-card-admin .rl-meter-top,
.rl-card-admin .rl-users {
  color: #9db8a8;
}

.rl-card-admin .rl-meter-top strong {
  color: #fff;
}

.rl-card-admin .rl-bar {
  background: rgba(255, 255, 255, 0.1);
}

.rl-card-admin .rl-module {
  background: rgba(255, 255, 255, 0.05);
}

.rl-card-admin .rl-module-ico {
  color: #4ade80;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.rl-card-admin .rl-full .rl-level {
  color: #4ade80;
}

.rl-card-admin .rl-foot {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* The last card: make a new role. */
.rl-card-add {
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 260px;
  text-align: center;
  color: var(--admin-text);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.7), var(--admin-surface));
  border: 2px dashed var(--admin-border-strong);
  box-shadow: none;
}

.rl-card-add:hover {
  border-color: var(--admin-primary);
  color: var(--admin-text);
}

.rl-add-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.4rem;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 10px 22px -10px rgba(21, 128, 61, 0.8);
  transition: transform 0.2s ease;
}

.rl-card-add:hover .rl-add-ico {
  transform: rotate(90deg);
}

/* ==== Add / Edit role: details, then a matrix of modules x actions, then a bar that stays at the bottom ==== */
.rf-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--admin-text-muted);
  text-decoration: none;
}

.rf-back:hover {
  color: var(--admin-primary);
}

.rf-back .icon {
  width: 16px;
  height: 16px;
}

.rf {
  display: grid;
  gap: 1.25rem;
}

.rf-title {
  margin-bottom: 0;
}

.rf-card {
  padding: 1.5rem;
  border-radius: 18px;
}

.rf-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.rf-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.rf-card-head p {
  margin: 0.15rem 0 0;
}

.rf-step {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 8px 16px -8px rgba(21, 128, 61, 0.8);
}

.rf-quick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.rf-quick .icon {
  width: 14px;
  height: 14px;
}

.rf-count {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 999px;
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
  border: 1px solid var(--admin-border);
  white-space: nowrap;
}

.rf-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.rf-fields .field {
  margin: 0;
}

.rf-code-input {
  display: flex;
  align-items: stretch;
}

.rf-code-input span {
  display: grid;
  place-items: center;
  padding: 0 0.75rem;
  font-weight: 600;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  border: 1px solid var(--admin-border);
  border-right: 0;
  border-radius: var(--admin-radius) 0 0 var(--admin-radius);
}

.rf-code-input input {
  flex: 1;
  min-width: 0;
  border-radius: 0 var(--admin-radius) var(--admin-radius) 0;
  font-family: var(--admin-font-mono);
}

/* The matrix. */
.rf-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
}

.rf-matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.rf-matrix th,
.rf-matrix td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--admin-border);
}

.rf-matrix thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  background: #f6fbf8;
}

.rf-matrix thead th:first-child,
.rf-matrix tbody th {
  text-align: left;
}

.rf-matrix tbody tr:last-child th,
.rf-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.rf-row {
  transition: background 0.15s ease;
}

.rf-row:hover {
  background: #fbfefc;
}

.rf-row.is-on {
  background: linear-gradient(90deg, rgba(240, 253, 244, 0.9), transparent 70%);
}

.rf-all-col {
  width: 90px;
  border-left: 1px dashed var(--admin-border);
}

.rf-module {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 400;
}

.rf-module-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.rf-row.is-on .rf-module-ico {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 8px 16px -10px rgba(21, 128, 61, 0.9);
}

.rf-module-ico .icon {
  width: 18px;
  height: 18px;
}

.rf-module-text {
  display: grid;
  line-height: 1.3;
}

.rf-module-text strong {
  font-weight: 600;
  color: var(--admin-text);
}

.rf-none {
  color: var(--admin-border-strong);
}

/* One action: a rounded box that fills green with a tick. */
.rf-tick {
  position: relative;
  display: inline-grid;
  cursor: pointer;
}

.rf-tick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rf-tick span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--admin-surface);
  border: 1.5px solid var(--admin-border-strong);
  transition: all 0.15s ease;
}

.rf-tick span .icon {
  width: 16px;
  height: 16px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}

.rf-tick:hover span {
  border-color: var(--admin-primary);
}

.rf-tick input:checked+span {
  border-color: transparent;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 6px 14px -8px rgba(21, 128, 61, 0.9);
}

.rf-tick input:checked+span .icon {
  opacity: 1;
  transform: scale(1);
}

.rf-tick input:focus-visible+span {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

/* A module's "All" switch. */
.rf-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.rf-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rf-switch-track {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--admin-border-strong);
  transition: background 0.2s ease;
}

.rf-switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 42, 26, 0.3);
  transition: transform 0.2s ease;
}

.rf-switch input:checked+.rf-switch-track {
  background: var(--admin-primary);
}

.rf-switch input:checked+.rf-switch-track i {
  transform: translateX(18px);
}

.rf-switch input:indeterminate+.rf-switch-track {
  background: linear-gradient(90deg, var(--admin-primary) 50%, var(--admin-border-strong) 50%);
}

.rf-switch input:focus-visible+.rf-switch-track {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

/* The bar at the bottom: Cancel and Save, after the form (it scrolls with the page). */
.rf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border-radius: 16px;
  color: #e8f5ec;
  background: linear-gradient(135deg, #050f09, #0b2a1a 60%, #0f3d24);
  box-shadow: 0 20px 40px -20px rgba(5, 15, 9, 0.8), 0 0 0 1px rgba(74, 222, 128, 0.14);
}

/* Only the buttons: a small bar at the right. */
.rf-bar-compact {
  justify-self: end;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.rf-bar-compact .rf-bar-buttons .btn:not(.btn-primary) {
  color: var(--admin-text);
  background: var(--admin-surface);
  border-color: var(--admin-border-strong);
}

.rf-bar-compact .rf-bar-buttons .btn:not(.btn-primary):hover {
  background: var(--admin-primary-soft);
}

.rf-bar-compact .rf-bar-buttons .btn-primary {
  box-shadow: 0 10px 24px -10px rgba(21, 128, 61, 0.8);
}

.rf-bar-info {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #9db8a8;
}

.rf-bar-info b {
  color: #fff;
}

.rf-bar-info .icon {
  width: 18px;
  height: 18px;
  color: #4ade80;
}

.rf-bar-buttons {
  display: flex;
  gap: 0.6rem;
}

.rf-bar-buttons .btn {
  min-width: 7.5rem;
  justify-content: center;
}

.rf-bar-buttons .btn:not(.btn-primary) {
  color: #e8f5ec;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.rf-bar-buttons .btn:not(.btn-primary):hover {
  background: rgba(255, 255, 255, 0.12);
}

.rf-bar-buttons .btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent;
}

@media (max-width: 760px) {
  .rf-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .rf-card-head {
    flex-wrap: wrap;
  }

  .rf-quick {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .rf-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .rf-bar-compact {
    justify-self: stretch;
  }

  .rf-bar-buttons .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  .rl-card,
  .rl-card-add .rl-add-ico,
  .rf-tick span,
  .rf-switch-track i {
    animation: none;
    transition: none;
  }
}

/* ==== Settings: one card, a segmented tab bar at its top, a panel per section, saved together ============= */
.st {
  display: grid;
  gap: 1.25rem;
}

.st-card {
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
}

.st-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(180deg, #f6fbf8, var(--admin-surface));
  border-bottom: 1px solid var(--admin-border);
}

.st-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--admin-radius-btn);
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.st-tab .icon {
  width: 17px;
  height: 17px;
}

.st-tab:hover {
  color: var(--admin-text);
  background: var(--admin-primary-soft);
}

.st-tab:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.st-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 8px 18px -10px rgba(21, 128, 61, 0.9);
}

.st-panel {
  padding: 1.5rem;
  animation: al-rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.st-panel-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.st-panel-head p {
  margin: 0;
  font-size: 0.9rem;
}

/* Whether the app is sending through the SMTP server saved here. */
.st-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  color: var(--admin-text-muted);
  background: #f6f8f7;
  border: 1px solid var(--admin-border);
}

.st-status b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-border-strong);
}

.st-status.is-on {
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
  border-color: rgba(22, 163, 74, 0.3);
}

.st-status.is-on b {
  background: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}

.st-grid .field {
  margin: 0;
}

.st-wide {
  grid-column: 1 / -1;
}

/* SMTP in two rows: host (wide), port, encryption / username, password, from email, from name. */
.st-grid-smtp {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem 1.5rem;
}

.st-grid-smtp .st-span2 {
  grid-column: span 2;
}

.st-grid-smtp .field label {
  margin-bottom: 0.45rem;
}

.st-grid-smtp .field-hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--admin-text-muted);
}

.st-grid-smtp+.st-test {
  margin-top: 1.75rem;
  padding: 0.85rem 1.1rem;
}

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

.st-secret {
  position: relative;
}

.st-secret input {
  width: 100%;
  padding-right: 2.75rem;
}

.st-eye {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.st-eye:hover {
  color: var(--admin-primary);
  background: var(--admin-primary-soft);
}

.st-eye .icon {
  width: 17px;
  height: 17px;
}

/* Try the SMTP settings. */
.st-test {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--admin-primary-soft), rgba(240, 253, 244, 0.3));
  border: 1px solid var(--admin-border);
}

.st-test-text {
  display: grid;
  gap: 0.1rem;
}

.st-test-form {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex: 1;
  max-width: 460px;
}

.st-test-form input {
  flex: 1;
  min-width: 0;
}

.st-test-form .btn {
  white-space: nowrap;
}

.st-test-form .icon {
  width: 15px;
  height: 15px;
}

/* ==== Packages: a card per installed package, and a page of details for each ============================== */
.pk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
}

a.card.pk-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  animation: al-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.pk-card-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  max-height: 210px;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #050f09, #0b2a1a 60%, #0f3d24);
}

.pk-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

a.card.pk-card:hover .pk-card-art img {
  transform: scale(1.04);
}

.pk-card-version {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #dcfce7;
  border-radius: 999px;
  background: rgba(5, 46, 22, 0.75);
  border: 1px solid rgba(74, 222, 128, 0.35);
  backdrop-filter: blur(4px);
}

.pk-card-body {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem 1.25rem 0;
}

.pk-card-body h3 {
  margin: 0;
  font-size: 1.1rem;
}

.pk-card-body code {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.pk-card-about {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pk-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: auto 1.25rem 0;
  padding: 0.85rem 0 1rem;
  border-top: 1px solid var(--admin-border);
  margin-top: 1rem;
}

.pk-card-open {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-primary-hover);
}

.pk-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* The top of a package's page: what it is, beside its picture. */
.pk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: 22px;
  color: #e8f5ec;
  background:
    radial-gradient(circle at 85% 20%, rgba(74, 222, 128, 0.18), transparent 45%),
    linear-gradient(135deg, #050f09, #0b2a1a 60%, #0f3d24);
  box-shadow: 0 24px 48px -24px rgba(5, 15, 9, 0.85), 0 0 0 1px rgba(74, 222, 128, 0.14);
  animation: al-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pk-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.pk-hero-tag {
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #bbf7d0;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.pk-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.02em;
  color: #fff;
}

.pk-hero-text > p {
  margin: 0.6rem 0 0;
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.6;
  color: #b7d3c2;
}

.pk-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.pk-hero-meta code {
  font-size: 0.8rem;
  color: #9db8a8;
}

.pk-hero .badge-success {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}

.pk-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.pk-hero-stats div {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pk-hero-stats dt {
  font-size: 0.75rem;
  color: #9db8a8;
}

.pk-hero-stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  overflow-wrap: anywhere;
}

.pk-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(74, 222, 128, 0.2);
}

.pk-hero-icon {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  color: #4ade80;
}

.pk-hero-icon .icon {
  width: 72px;
  height: 72px;
}

.pk-block {
  margin-top: 2rem;
}

.pk-block-head {
  margin-bottom: 1rem;
}

.pk-block-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pk-block-head p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

/* What it is used for: one card per use, filling the row. They rise in one after another; on hover a card lifts
   and glows, a shine crosses it, its icon turns and a line fills along its foot. */
.pk-uses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
}

.pk-use {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.25rem 1.5rem;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(74, 222, 128, 0.12), transparent 55%),
    var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  animation: pk-use-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

/* The shine that crosses the card on hover. */
.pk-use::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(74, 222, 128, 0.16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s ease;
}

/* The line along its foot. */
.pk-use::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, var(--admin-button-bg), #4ade80);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pk-use:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 22px 40px -22px rgba(21, 128, 61, 0.55), 0 0 0 1px rgba(74, 222, 128, 0.15);
}

.pk-use:hover::before {
  transform: translateX(120%);
}

.pk-use:hover::after {
  transform: scaleX(1);
}

.pk-use-num {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--admin-primary);
  opacity: 0.1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.pk-use:hover .pk-use-num {
  opacity: 0.22;
  transform: translateY(-2px) scale(1.06);
}

.pk-use-ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 10px 20px -10px rgba(21, 128, 61, 0.9);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* A ring that breathes around the icon. */
.pk-use-ico::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 18px;
  border: 2px solid rgba(34, 197, 94, 0.35);
  animation: pk-ring 2.6s ease-out infinite;
  animation-delay: calc(var(--i, 0) * 0.4s);
}

.pk-use-ico .icon {
  width: 22px;
  height: 22px;
}

.pk-use:hover .pk-use-ico {
  transform: translateY(-3px) rotate(-8deg) scale(1.08);
}

.pk-use h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
  transition: color 0.25s ease;
}

.pk-use:hover h3 {
  color: var(--admin-primary-hover);
}

.pk-use p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
}

@keyframes pk-use-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pk-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.92);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

/* Install and remove: two tabs, each with numbered steps joined by a line. */
.pk-howto {
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
}

.pk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(180deg, #f6fbf8, var(--admin-surface));
  border-bottom: 1px solid var(--admin-border);
}

.pk-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--admin-radius-btn);
  transition: color 0.15s ease, background 0.15s ease;
}

.pk-tab .icon {
  width: 16px;
  height: 16px;
}

.pk-tab:hover {
  color: var(--admin-text);
  background: var(--admin-primary-soft);
}

.pk-tab:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.pk-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 8px 18px -10px rgba(21, 128, 61, 0.9);
}

.pk-tab-panel {
  padding: 1.25rem 1.5rem 1.5rem;
  animation: al-rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pk-tab-panel > p {
  margin: 0 0 1.1rem;
}

.pk-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A step that deletes data. */
.pk-step-danger .pk-step-num {
  background: linear-gradient(135deg, #f87171, var(--admin-danger));
  box-shadow: 0 6px 14px -6px rgba(185, 28, 28, 0.8);
}

.pk-step-danger .pk-step-body h3 {
  color: var(--admin-danger);
}

.pk-step-danger .pk-cmd {
  border-color: rgba(248, 113, 113, 0.45);
}

.pk-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 1.4rem;
}

.pk-step:last-child {
  padding-bottom: 0;
}

.pk-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 38px;
  bottom: 4px;
  left: 17px;
  width: 2px;
  background: linear-gradient(var(--admin-primary), var(--admin-border));
  opacity: 0.45;
}

.pk-step-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 6px 14px -6px rgba(21, 128, 61, 0.8);
}

.pk-step-body h3 {
  margin: 0.4rem 0 0.2rem;
  font-size: 0.98rem;
}

.pk-step-body p {
  margin: 0;
  font-size: 0.88rem;
}

.pk-cmd {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  border-radius: var(--admin-radius-btn);
  background: #0b1f14;
  border: 1px solid rgba(74, 222, 128, 0.18);
}

.pk-cmd code {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: #bbf7d0;
  background: none;
  overflow-x: auto;
  white-space: nowrap;
}

.pk-cmd .btn {
  flex-shrink: 0;
}

.pk-block-first {
  margin-top: 0.5rem;
}

.pk-block-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* No add-on installed yet: a floating add-on with dots circling it, and the way to the ones that can be installed. */
.pk-empty {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2rem 2.25rem;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 50%, rgba(74, 222, 128, 0.16), transparent 40%),
    var(--admin-surface);
  border: 1.5px dashed color-mix(in srgb, var(--admin-primary) 40%, var(--admin-border));
  box-shadow: var(--admin-shadow);
  animation: pk-use-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pk-empty-art {
  position: relative;
  width: 150px;
  height: 150px;
}

.pk-empty-orbit {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--admin-primary) 35%, transparent);
  animation: pk-empty-spin 14s linear infinite;
}

.pk-empty-orbit i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #4ade80;
}

.pk-empty-orbit i:nth-child(1) { top: -5px; left: calc(50% - 5px); }
.pk-empty-orbit i:nth-child(2) { bottom: 14%; left: 4%; width: 7px; height: 7px; }
.pk-empty-orbit i:nth-child(3) { bottom: 14%; right: 4%; width: 8px; height: 8px; opacity: 0.7; }

.pk-empty-box {
  position: absolute;
  top: 41px;
  left: 41px;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
  box-shadow: 0 18px 30px -14px rgba(21, 128, 61, 0.85), inset 0 0 16px rgba(255, 255, 255, 0.25);
  animation: pk-empty-float 3s ease-in-out infinite;
}

.pk-empty-box .icon {
  width: 30px;
  height: 30px;
}

.pk-empty-plus {
  position: absolute;
  top: 30px;
  right: 30px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--admin-primary-hover);
  border-radius: 50%;
  background: var(--admin-surface);
  border: 2px solid var(--admin-primary);
  box-shadow: 0 6px 14px -6px rgba(21, 128, 61, 0.7);
  animation: pk-empty-float 3s ease-in-out infinite, pk-empty-pulse 2s ease-in-out infinite;
}

.pk-empty-plus .icon {
  width: 14px;
  height: 14px;
}

.pk-empty-shadow {
  position: absolute;
  bottom: 14px;
  left: 45px;
  width: 60px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(21, 128, 61, 0.35), transparent);
  animation: pk-empty-shadow 3s ease-in-out infinite;
}

.pk-empty-text h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.pk-empty-text p {
  max-width: 56ch;
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.pk-empty-text .btn {
  margin-top: 1.1rem;
}

/* The Available section, glowing for a moment after "See available add-ons". */
.pk-flash .pk-card {
  animation: pk-flash 1.4s ease 0.35s;
}

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

@keyframes pk-empty-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes pk-empty-pulse {
  0%, 100% { scale: 1; }
  50% { scale: 1.12; }
}

@keyframes pk-empty-shadow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.5; }
}

@keyframes pk-flash {
  0%, 100% { box-shadow: var(--admin-shadow); }
  30% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35), 0 20px 40px -20px rgba(21, 128, 61, 0.6); }
}

@media (max-width: 640px) {
  .pk-empty {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pk-empty,
  .pk-empty-orbit,
  .pk-empty-box,
  .pk-empty-plus,
  .pk-empty-shadow,
  .pk-flash .pk-card {
    animation: none;
  }
}

.pk-card-available .pk-card-art img {
  filter: saturate(0.6);
}

/* An add-on that is not installed: the whole card opens its details, and its Install button sits above that link. */
.pk-card-available {
  position: relative;
}

.pk-card-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.pk-card-cover:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.pk-card-available .pk-card-foot .btn {
  position: relative;
  z-index: 2;
}

.pk-card-available:hover .pk-card-art img {
  transform: scale(1.04);
}

/* The Install button on the details page of an add-on that is not installed. */
.pk-hero-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* Remove this add-on: a card of its own at the foot of the page, red-edged, saying what goes and what stays. */
.pk-danger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.1rem 1.25rem;
  align-items: center;
  padding: 1.35rem 1.5rem;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(254, 242, 242, 0.95), var(--admin-surface) 70%);
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow: var(--admin-shadow);
}

.pk-danger-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--admin-danger);
  border-radius: 14px;
  background: rgba(254, 226, 226, 0.9);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.pk-danger-ico .icon {
  width: 20px;
  height: 20px;
}

.pk-danger-text h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--admin-danger);
}

.pk-danger-text > p {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
}

.pk-danger-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
}

.pk-danger-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pk-danger-list .icon {
  width: 14px;
  height: 14px;
}

.pk-danger-list .is-gone {
  color: var(--admin-danger);
}

.pk-danger-list .is-kept {
  color: var(--admin-primary-hover);
}

.pk-danger-btn {
  min-width: 10rem;
  box-shadow: 0 10px 22px -12px rgba(185, 28, 28, 0.8);
}

.pk-danger-btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
}

/* Why Remove is not available yet: the add-on's service is being set up. */
.pk-danger-wait {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.84rem;
  color: #92400e;
  border-radius: 999px;
  background: rgba(254, 243, 199, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pk-danger-wait[hidden] {
  display: none;
}

.pk-danger-wait .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 760px) {
  .pk-danger {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pk-danger-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* "Also delete its data" in the Remove dialog. */
.pk-delete-data {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(254, 226, 226, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.pk-delete-data input {
  margin-top: 0.2rem;
  accent-color: var(--admin-danger);
}

.pk-delete-data span {
  display: grid;
  gap: 0.15rem;
}

/* An install or removal under way: a window in the middle of the screen, over a blurred page. A cube (the add-on)
   turns in 3D while it works, with sparks rising into it (install) or falling from it (remove); it settles with a
   tick when done, or a cross when it failed. */
body.pk-op-open {
  overflow: hidden;
}

.pk-op-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 15, 9, 0.55);
  backdrop-filter: blur(6px);
  animation: pk-op-fade 0.3s ease both;
}

.pk-op-overlay[hidden] {
  display: none;
}

.pk-op {
  --pk-a: #22c55e;
  --pk-b: #15803d;
  --pk-glow: rgba(34, 197, 94, 0.45);
  width: min(100%, 440px);
  padding: 1.75rem 1.75rem 1.5rem;
  text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pk-a) 14%, transparent), transparent 60%),
    var(--admin-surface);
  border: 1px solid color-mix(in srgb, var(--pk-a) 30%, transparent);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: pk-op-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pk-op-overlay[data-action="remove"] .pk-op {
  --pk-a: #fb923c;
  --pk-b: #dc2626;
  --pk-glow: rgba(239, 68, 68, 0.4);
}

.pk-op-overlay[data-status="failed"] .pk-op {
  --pk-a: #f87171;
  --pk-b: #b91c1c;
  --pk-glow: rgba(239, 68, 68, 0.4);
}

.pk-op-overlay[data-status="done"] .pk-op {
  --pk-a: #22c55e;
  --pk-b: #15803d;
  --pk-glow: rgba(34, 197, 94, 0.45);
}

/* The cube. */
.pk-op-scene {
  position: relative;
  height: 150px;
  margin-bottom: 1rem;
  perspective: 700px;
}

.pk-op-cube {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 76px;
  height: 76px;
  margin-left: -38px;
  transform-style: preserve-3d;
  animation: pk-op-turn 5s linear infinite, pk-op-bob 2.4s ease-in-out infinite;
}

.pk-op-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pk-a), var(--pk-b));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.25);
  backface-visibility: visible;
  transition: background 0.4s ease;
}

.pk-op-face .icon {
  width: 30px;
  height: 30px;
}

.pk-op-face-front { transform: translateZ(38px); }
.pk-op-face-back { transform: rotateY(180deg) translateZ(38px); }
.pk-op-face-right { transform: rotateY(90deg) translateZ(38px); filter: brightness(0.85); }
.pk-op-face-left { transform: rotateY(-90deg) translateZ(38px); filter: brightness(0.85); }
.pk-op-face-top { transform: rotateX(90deg) translateZ(38px); filter: brightness(1.15); }
.pk-op-face-bottom { transform: rotateX(-90deg) translateZ(38px); filter: brightness(0.7); }

/* Its shadow on the floor, breathing with the cube. */
.pk-op-floor {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 96px;
  height: 18px;
  margin-left: -48px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--pk-glow), transparent);
  animation: pk-op-shadow 2.4s ease-in-out infinite;
}

/* Sparks: rising into the cube while installing, falling away from it while removing. */
.pk-op-particles i {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pk-a);
  box-shadow: 0 0 10px var(--pk-a);
  opacity: 0;
  animation: pk-op-rise 2.2s ease-in infinite;
}

.pk-op-particles i:nth-child(1) { margin-left: -46px; animation-delay: 0s; }
.pk-op-particles i:nth-child(2) { margin-left: 38px; animation-delay: 0.35s; }
.pk-op-particles i:nth-child(3) { margin-left: -22px; animation-delay: 0.7s; }
.pk-op-particles i:nth-child(4) { margin-left: 18px; animation-delay: 1.05s; }
.pk-op-particles i:nth-child(5) { margin-left: -58px; animation-delay: 1.4s; }
.pk-op-particles i:nth-child(6) { margin-left: 52px; animation-delay: 1.75s; }

.pk-op-overlay[data-action="remove"] .pk-op-particles i {
  bottom: auto;
  top: 40px;
  animation-name: pk-op-fall;
}

/* Done or failed: the cube stops, facing front, and a badge pops onto it. */
.pk-op-overlay[data-status="done"] .pk-op-cube,
.pk-op-overlay[data-status="failed"] .pk-op-cube {
  animation: pk-op-settle 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pk-op-overlay[data-status="done"] .pk-op-particles,
.pk-op-overlay[data-status="failed"] .pk-op-particles,
.pk-op-overlay[data-status="failed"] .pk-op-floor {
  display: none;
}

.pk-op-badge {
  position: absolute;
  top: 12px;
  left: 50%;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 26px;
  color: #fff;
  border-radius: 50%;
  border: 3px solid var(--admin-surface);
  animation: pk-op-pop 0.5s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pk-op-badge .icon {
  width: 16px;
  height: 16px;
}

.pk-op-badge-done {
  background: #16a34a;
}

.pk-op-badge-failed {
  background: var(--admin-danger);
}

.pk-op-overlay[data-status="done"] .pk-op-badge-done,
.pk-op-overlay[data-status="failed"] .pk-op-badge-failed {
  display: grid;
}

/* The words, the bar and the steps. */
.pk-op h2 {
  margin: 0;
  font-size: 1.2rem;
}

.pk-op > p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pk-op-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.pk-op-progress span {
  min-width: 2.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pk-op-bar {
  position: relative;
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
}

.pk-op-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pk-a), var(--pk-b));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* A light running along the bar while it works. */
.pk-op-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: pk-op-shine 1.4s ease-in-out infinite;
}

.pk-op-overlay[data-status="done"] .pk-op-bar i::after,
.pk-op-overlay[data-status="failed"] .pk-op-bar i::after {
  display: none;
}

.pk-op-steps {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 0.9rem;
}

.pk-op-step {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  animation: pk-use-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.pk-op-dot {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid var(--admin-border-strong);
}

.pk-op-dot .icon {
  width: 13px;
  height: 13px;
}

.pk-op-step.is-running {
  color: var(--admin-text);
  font-weight: 600;
  border-color: color-mix(in srgb, var(--pk-a) 45%, transparent);
  background: color-mix(in srgb, var(--pk-a) 8%, var(--admin-surface));
}

.pk-op-step.is-running .pk-op-dot {
  color: transparent;
  border-color: var(--pk-a);
  border-top-color: transparent;
  animation: pk-spin 0.8s linear infinite;
}

.pk-op-step.is-done {
  color: var(--admin-primary-hover);
}

.pk-op-step.is-done .pk-op-dot {
  color: #fff;
  background: var(--admin-primary);
  border-color: var(--admin-primary);
}

.pk-op-step.is-failed {
  color: var(--admin-danger);
  font-weight: 600;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(254, 226, 226, 0.5);
}

.pk-op-step.is-failed .pk-op-dot {
  color: #fff;
  background: var(--admin-danger);
  border-color: var(--admin-danger);
}

.pk-op > .btn {
  margin-top: 1.25rem;
  min-width: 8rem;
}

/* Close only once it has failed: .btn's display would otherwise show it while it works. */
.pk-op > .btn[hidden] {
  display: none;
}

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

@keyframes pk-op-fade {
  from { opacity: 0; }
}

@keyframes pk-op-pop {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
}

@keyframes pk-op-turn {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to { transform: rotateX(-22deg) rotateY(360deg); }
}

@keyframes pk-op-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes pk-op-shadow {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.75); opacity: 0.5; }
}

@keyframes pk-op-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1); }
}

@keyframes pk-op-fall {
  0% { opacity: 0; transform: translateY(0) scale(1); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(90px) scale(0.5); }
}

@keyframes pk-op-settle {
  from { transform: rotateX(-22deg) rotateY(200deg) scale(0.9); }
  to { transform: rotateX(-12deg) rotateY(-28deg) scale(1); }
}

@keyframes pk-op-shine {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .pk-op-overlay,
  .pk-op,
  .pk-op-cube,
  .pk-op-floor,
  .pk-op-particles i,
  .pk-op-bar i::after,
  .pk-op-step,
  .pk-op-badge {
    animation: none !important;
  }

  .pk-op-cube {
    transform: rotateX(-12deg) rotateY(-28deg);
  }
}

/* Status: the service, the model files and the permissions, side by side. */
.pk-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.pk-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: 18px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  animation: pk-use-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.pk-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 18px 36px -22px rgba(21, 128, 61, 0.5);
}

.pk-panel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pk-panel-head h3 {
  flex: 1;
  margin: 0;
  font-size: 1.02rem;
}

.pk-panel-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--admin-primary-hover);
  border-radius: 12px;
  background: var(--admin-primary-soft);
  border: 1px solid color-mix(in srgb, var(--admin-primary) 20%, transparent);
}

.pk-panel-ico .icon {
  width: 18px;
  height: 18px;
}

.pk-panel-note {
  margin: -0.5rem 0 0;
}

.pk-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--admin-border);
}

.pk-panel-foot code {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

/* Running or not, with a dot that pulses while it runs. */
.pk-live {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
}

.pk-live > div {
  display: grid;
  gap: 0.1rem;
}

.pk-live strong {
  font-size: 1.05rem;
}

.pk-live.is-on {
  background: linear-gradient(90deg, var(--admin-primary-soft), transparent);
  border-color: rgba(34, 197, 94, 0.3);
}

.pk-live.is-on strong {
  color: var(--admin-primary-hover);
}

.pk-live.is-off {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.7), transparent);
  border-color: rgba(248, 113, 113, 0.35);
}

.pk-live.is-off strong {
  color: var(--admin-danger);
}

.pk-live-dot {
  position: relative;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--admin-danger);
}

.is-on .pk-live-dot {
  background: #22c55e;
}

.is-on .pk-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: pk-pulse 1.8s ease-out infinite;
}

@keyframes pk-pulse {
  from {
    opacity: 0.7;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(2.8);
  }
}

.pk-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.pk-facts div {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
}

.pk-facts dt {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.pk-facts dd {
  margin: 0.15rem 0 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.pk-facts code {
  font-size: 0.85rem;
}

.pk-path {
  word-break: break-all;
}

/* Model files: a tick when present, a cross when missing. */
.pk-models {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pk-model {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
}

.pk-model strong {
  font-size: 0.92rem;
}

.pk-model p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.pk-model code {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--admin-danger);
}

.pk-model-state {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, var(--admin-button-bg));
}

.pk-model-state .icon {
  width: 15px;
  height: 15px;
}

.pk-model.is-missing {
  border-color: rgba(248, 113, 113, 0.45);
}

.pk-model.is-missing .pk-model-state {
  background: var(--admin-danger);
}

/* Permissions as chips. */
.pk-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pk-perms li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 550;
  border-radius: 999px;
  background: var(--admin-primary-soft);
  border: 1px solid color-mix(in srgb, var(--admin-primary) 25%, transparent);
  color: var(--admin-primary-hover);
  transition: transform 0.2s ease, background 0.2s ease;
}

.pk-perms li:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--admin-primary) 18%, var(--admin-surface));
}

.pk-perms .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  .pk-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.5rem;
  }

  .pk-hero-art {
    order: -1;
  }
}

@media (max-width: 520px) {
  .pk-hero-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .pk-cmd {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.card.pk-card,
  .pk-hero,
  .pk-use,
  .pk-use-ico::after,
  .pk-panel,
  .is-on .pk-live-dot::after {
    animation: none;
  }

  .pk-use,
  .pk-use::before,
  .pk-use::after,
  .pk-use-ico {
    transition: none;
  }
}

/* Save, at the right under the card: the same button as on every other page. */
.st-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .st-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .st-grid-smtp .st-span2 {
    grid-column: auto;
  }

  .st-panel-head {
    flex-wrap: wrap;
  }

  .st-status {
    margin-left: 0;
  }

  .st-test-form {
    max-width: none;
    width: 100%;
    margin-left: 0;
  }
}

/* ==== Dashboard numbers: a colour per card, a faint icon behind, a ring for the active share, a link at the foot ==== */
.ds-card {
  --c: #16a34a;
  --c2: #15803d;
  --soft: #dcfce7;
}

.ds-teal {
  --c: #14b8a6;
  --c2: #0f766e;
  --soft: #ccfbf1;
}

.ds-lime {
  --c: #84cc16;
  --c2: #4d7c0f;
  --soft: #ecfccb;
}

a.ad-stat.ds-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem 1.35rem 1.1rem;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--soft) 70%, transparent), transparent 60%),
    #fff;
  border: 1px solid color-mix(in srgb, var(--c) 18%, var(--admin-border));
}

/* The coloured line along the top. */
a.ad-stat.ds-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--c), var(--c2));
}

.ds-watermark {
  position: absolute;
  right: -18px;
  bottom: -22px;
  color: var(--c);
  opacity: 0.07;
  pointer-events: none;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.ds-watermark .icon {
  width: 130px;
  height: 130px;
  stroke-width: 1.4;
}

a.ad-stat.ds-card:hover .ds-watermark {
  transform: rotate(-10deg) scale(1.08);
  opacity: 0.12;
}

.ds-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ds-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 10px 20px -10px var(--c);
}

.ds-ico .icon {
  width: 19px;
  height: 19px;
}

.ds-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
}

.ds-num {
  display: block;
  margin-top: 0.6rem;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}

.ds-chip {
  align-self: flex-start;
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--c2);
  background: var(--soft);
  border-radius: 999px;
}

.ds-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.ds-row>div {
  display: flex;
  flex-direction: column;
}

.ds-ring {
  width: 68px;
  height: 68px;
  flex: none;
  transform: rotate(-90deg);
}

.ds-ring circle {
  fill: none;
  stroke-width: 5;
}

.ds-ring-track {
  stroke: var(--soft);
}

.ds-ring-fill {
  stroke: var(--c);
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ds-foot {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c2);
  border-top: 1px dashed color-mix(in srgb, var(--c) 25%, transparent);
}

.ds-head+.ds-num,
.ds-head+.ds-row {
  margin-top: 0.4rem;
}

.ds-chip+.ds-foot,
.ds-row+.ds-foot {
  margin-top: 0.9rem;
}

.ds-foot .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

a.ad-stat.ds-card:hover .ds-foot .icon {
  transform: translateX(4px);
}

/* ==== Sign-in page (/signin, Auth/login.blade.php): the green hero on the left, the form card on the right ======== */

.ulogin {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  background: var(--admin-bg);
}

.lg-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 4rem 3rem;
  color: #fff;
  /* The same dark green as the dashboard's welcome banner (.ad-hero). */
  background: linear-gradient(135deg, #050f09, #0b2a1a 55%, #0f3d24);
}

.lg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 45%, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 15%, transparent 72%);
}

/* "logo | Vision AI Admin" at the top left of the hero. */
.lg-brand {
  position: absolute;
  top: 2rem;
  left: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  z-index: 1;
  animation: lg-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The scene in the hero (Auth/auth-hero.blade.php): the AI's lens in the middle, scanning, and the three things it
   recognises around it (a face, a number plate, a crowd), each lit in turn. The pills under the scene light in time
   with the cards. One turn is --loop. --tilt-* follow the pointer (initHeroScene in auth.js). */
.lg-hero {
  --loop: 9s;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(134, 239, 172, 0.22);
  --ink: #e8f5ec;
  --ink-muted: rgba(232, 245, 236, 0.62);
}

.lg-scene {
  position: relative;
  z-index: 1;
  width: min(540px, 92%);
  height: 380px;
  perspective: 1200px;
  animation: lg-rise 0.9s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lg-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(8deg + var(--tilt-x, 0deg))) rotateY(calc(-10deg + var(--tilt-y, 0deg)));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: lg-float-y 7s ease-in-out infinite;
}

/* ---- The lens: rings turning, a radar beam sweeping, the eye at the centre ---- */
.lg-lens {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250px;
  height: 250px;
  margin: -125px 0 0 -125px;
  transform-style: preserve-3d;
}

.lg-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lg-ring-1 {
  inset: 0;
  border: 1.5px dashed rgba(134, 239, 172, 0.35);
  animation: lg-turn 40s linear infinite;
}

.lg-ring-2 {
  inset: 26px;
  border: 1px solid rgba(134, 239, 172, 0.28);
  animation: lg-turn 14s linear infinite reverse;
}

/* A light riding the middle ring. */
.lg-ring-2::before {
  content: "";
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbf7d0;
  box-shadow: 0 0 14px 4px rgba(74, 222, 128, 0.8);
}

.lg-ring-3 {
  inset: 56px;
  border: 1px solid rgba(134, 239, 172, 0.18);
  background: radial-gradient(circle, rgba(34, 197, 94, 0.14), transparent 70%);
}

/* The radar beam: a soft wedge of light going round. */
.lg-radar {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(74, 222, 128, 0.42), rgba(74, 222, 128, 0) 70deg, transparent 360deg);
  mask-image: radial-gradient(circle, transparent 28%, #000 30%);
  -webkit-mask-image: radial-gradient(circle, transparent 28%, #000 30%);
  animation: lg-turn 4.5s linear infinite;
}

/* Corner brackets around the lens, like a camera's focus frame. */
.lg-frame {
  position: absolute;
  inset: -14px;
  pointer-events: none;
  background:
    linear-gradient(#4ade80, #4ade80) top left / 22px 2px,
    linear-gradient(#4ade80, #4ade80) top left / 2px 22px,
    linear-gradient(#4ade80, #4ade80) top right / 22px 2px,
    linear-gradient(#4ade80, #4ade80) top right / 2px 22px,
    linear-gradient(#4ade80, #4ade80) bottom left / 22px 2px,
    linear-gradient(#4ade80, #4ade80) bottom left / 2px 22px,
    linear-gradient(#4ade80, #4ade80) bottom right / 22px 2px,
    linear-gradient(#4ade80, #4ade80) bottom right / 2px 22px;
  background-repeat: no-repeat;
  opacity: 0.7;
  animation: lg-focus 4s ease-in-out infinite;
}

.lg-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(160deg, #0f2b1b, #071509);
  border: 1px solid rgba(134, 239, 172, 0.45);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.08), 0 0 50px rgba(34, 197, 94, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateZ(30px);
  animation: lg-glow 3.5s ease-in-out infinite;
}

.lg-core svg {
  width: 62px;
  height: 62px;
}

.lg-core small {
  position: absolute;
  bottom: -26px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #86efac;
  white-space: nowrap;
}

.lg-core small::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: lg-pulse-dot 1.4s ease-in-out infinite;
}

/* ---- The three things it recognises, around the lens ---- */
.lg-feat {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 168px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: lg-feat-on var(--loop) ease-in-out infinite;
}

.lg-feat strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.lg-feat small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-muted);
}

.lg-feat-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #22c55e);
  box-shadow: 0 6px 16px -6px rgba(34, 197, 94, 0.9);
}

.lg-feat-ico .icon {
  width: 17px;
  height: 17px;
}

.lg-feat-tag {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(134, 239, 172, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}

.lg-feat-face {
  top: 2%;
  left: -6%;
  transform: translateZ(50px);
}

.lg-feat-plate {
  bottom: 0;
  right: -16%;
  transform: translateZ(70px);
  animation-delay: calc(var(--loop) / 3);
}

.lg-feat-crowd {
  top: 44%;
  left: -14%;
  transform: translateZ(40px);
  animation-delay: calc(var(--loop) * 2 / 3);
}

/* The number plate, drawn. */
.lg-plate {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0b1d13;
  background: #ecfdf5;
  border: 1.5px solid #4ade80;
  border-radius: 4px;
}

/* A few bars for the crowd through the day. */
.lg-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  margin-left: auto;
}

.lg-bars i {
  width: 5px;
  height: var(--h);
  border-radius: 2px;
  background: linear-gradient(to top, #22c55e, #86efac);
  transform-origin: bottom;
  animation: lg-bar 2.4s ease-in-out infinite;
  animation-delay: var(--w);
}

.lg-shadow {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -18px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(34, 197, 94, 0.3), transparent 70%);
  filter: blur(8px);
}

/* ---- The words under the scene, and the three pills lit in time with the cards ---- */
.lg-pitch {
  position: relative;
  z-index: 1;
  max-width: 440px;
  text-align: center;
  animation: lg-rise 0.9s 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lg-pitch h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

.lg-pitch h2 em {
  font-style: normal;
  background: linear-gradient(135deg, #86efac, #22c55e 55%, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-pitch p {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.lg-steps {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: -1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  font-weight: 500;
}

.lg-steps li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  color: var(--ink-muted);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  animation: lg-pill-on var(--loop) ease-in-out infinite;
}

.lg-steps li .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.lg-steps li:nth-child(2) {
  animation-delay: calc(var(--loop) / 3);
}

.lg-steps li:nth-child(3) {
  animation-delay: calc(var(--loop) * 2 / 3);
}

/* A narrow or short window: the cards come in closer to the lens and the scene is a little smaller, so nothing is cut
   off or runs into the logo. */
@media (max-width: 1400px) {
  .lg-feat-face {
    left: 0;
  }

  .lg-feat-plate {
    right: -2%;
  }

  .lg-feat-crowd {
    left: -4%;
  }
}

@media (max-width: 1400px), (max-height: 820px) {
  .lg-scene {
    height: 340px;
    scale: 0.86;
  }

  .lg-hero {
    gap: 1.5rem;
  }
}

@keyframes lg-float-y {

  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -10px;
  }
}

@keyframes lg-turn {
  to {
    rotate: 360deg;
  }
}

@keyframes lg-focus {

  0%,
  100% {
    inset: -14px;
    opacity: 0.55;
  }

  50% {
    inset: -6px;
    opacity: 0.95;
  }
}

@keyframes lg-glow {

  0%,
  100% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.08), 0 0 40px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.12), 0 0 70px rgba(34, 197, 94, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

@keyframes lg-pulse-dot {
  50% {
    opacity: 0.3;
  }
}

/* A card's turn: it lifts, brightens and glows for a third of the loop. */
@keyframes lg-feat-on {

  0%,
  30%,
  100% {
    border-color: var(--glass-line);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    translate: 0 0;
    opacity: 0.78;
  }

  6%,
  24% {
    border-color: rgba(134, 239, 172, 0.7);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.6), 0 0 34px -4px rgba(74, 222, 128, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    translate: 0 -6px;
    opacity: 1;
  }
}

@keyframes lg-pill-on {

  0%,
  30%,
  100% {
    color: var(--ink-muted);
    background: var(--glass);
    border-color: rgba(255, 255, 255, 0.08);
  }

  6%,
  24% {
    color: var(--ink);
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(134, 239, 172, 0.5);
  }
}

@keyframes lg-bar {

  0%,
  100% {
    scale: 1 1;
  }

  50% {
    scale: 1 0.55;
  }
}


/* The hero in depth: a light that follows the pointer (--mx, --my from initHeroScene), a grid floor running toward the
   viewer, and specks of light rising.
   --px shifts the far layers a little against the pointer, so they read as further away than the scene. */
.lg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 42%), rgba(74, 222, 128, 0.16), transparent 65%);
  transition: background 0.2s;
}

.lg-floor {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: 0;
  height: 90%;
  pointer-events: none;
  transform-origin: 50% 100%;
  transform: perspective(520px) rotateX(58deg);
  translate: var(--px, 0px) 0;
  transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  background-image:
    linear-gradient(rgba(134, 239, 172, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 239, 172, 0.28) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
  animation: lg-floor 2.8s linear infinite;
}

.lg-horizon {
  position: absolute;
  top: 30%;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4ade80, transparent);
  box-shadow: 0 0 24px 6px rgba(74, 222, 128, 0.45);
  animation: lg-horizon 4s ease-in-out infinite;
}

.lg-dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  translate: calc(var(--px, 0px) * 0.6) 0;
  transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lg-dust i {
  position: absolute;
  left: var(--x);
  bottom: -12px;
  width: var(--s);
  height: var(--s);
  background: #86efac;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(74, 222, 128, 0.7);
  opacity: 0;
  animation: lg-dust var(--d) linear var(--w) infinite;
}

/* A soft glow under the cards, breathing. */
.lg-scene::before {
  content: "";
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(34, 197, 94, 0.32), transparent);
  filter: blur(30px);
  animation: lg-breathe 5s ease-in-out infinite;
}


@keyframes lg-floor {
  to {
    background-position: 0 56px;
  }
}

@keyframes lg-horizon {

  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

@keyframes lg-dust {
  0% {
    opacity: 0;
    translate: 0 0;
  }

  15% {
    opacity: 0.9;
  }

  80% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
    translate: 20px -105vh;
  }
}

@keyframes lg-breathe {

  0%,
  100% {
    opacity: 0.6;
    scale: 0.95;
  }

  50% {
    opacity: 1;
    scale: 1.08;
  }
}


@media (prefers-reduced-motion: reduce) {

  .lg-hero,
  .lg-hero * {
    animation: none !important;
  }
}

.lg-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 5rem;
  overflow: hidden;
}

.lg-panel::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.22), transparent 70%);
  animation: lg-float 10s ease-in-out infinite;
}

.lg-card {
  position: relative;
  width: 100%;
  max-width: 25rem;
  padding: 2.5rem 2.25rem 2rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 22px;
  box-shadow: 0 24px 60px -20px rgba(21, 128, 61, 0.3), var(--admin-shadow);
  animation: lg-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The card's parts rise one after another. */
.lg-card>*,
.lg-card form>* {
  animation: lg-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lg-card> :nth-child(1) {
  animation-delay: 0.15s;
}

.lg-card> :nth-child(2) {
  animation-delay: 0.22s;
}

.lg-card> :nth-child(3) {
  animation-delay: 0.29s;
}

.lg-card form> :nth-child(1) {
  animation-delay: 0.36s;
}

.lg-card form> :nth-child(2) {
  animation-delay: 0.43s;
}

.lg-card form> :nth-child(3) {
  animation-delay: 0.5s;
}

.lg-card>.lg-note {
  animation-delay: 0.6s;
}

/* A wrong password shakes the card; signing in lifts it away. */
.lg-card.is-shaking {
  animation: lg-shake 0.45s;
}

.lg-card.is-success {
  animation: lg-leave 0.45s ease forwards;
}

.lg-card .brand-logo-card {
  height: 40px;
  margin: 0 0 1.25rem;
}

/* The product's logo at the top of the sign-in card: the name in the page's text colour (it is white elsewhere). */
.lg-card-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.5rem;
}

.lg-card-logo .app-mark {
  width: 42px;
  height: 42px;
}

.lg-card-logo .app-name strong {
  font-size: 1.35rem;
  color: var(--admin-text);
}

.lg-card-logo .app-name em {
  background-image: linear-gradient(135deg, #22c55e, #16a34a 55%, #0d9488);
}

.lg-card-logo .app-badge {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}

:root[data-theme="dark"] .lg-card-logo .app-name em {
  background-image: linear-gradient(135deg, #86efac, #22c55e 55%, #2dd4bf);
}

:root[data-theme="dark"] .lg-card-logo .app-badge {
  color: #86efac;
}

/* "POWERED BY Alphanso" under the sign-in card. */
.lg-powered {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--admin-border);
  background: color-mix(in srgb, var(--admin-surface, #fff) 70%, transparent);
  white-space: nowrap;
}

.lg-powered span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--admin-text-muted, #5f7a6a);
}

.lg-powered img {
  display: block;
  width: 100px;
  height: auto;
  opacity: 0.8;
}

:root[data-theme="dark"] .lg-powered img {
  filter: brightness(0) invert(1);
}

.lg-card h1 {
  margin: 0;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
}

.lg-sub {
  margin: 0.35rem 0 1.5rem;
  color: var(--admin-text-muted);
}

.lg-error {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  animation: lg-rise 0.3s both;
}

.lg-field {
  margin-bottom: 1rem;
}

.lg-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.lg-input {
  position: relative;
}

.lg-ico {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--admin-text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s;
}

.lg-input input {
  width: 100%;
  height: 46px;
  padding: 0 2.75rem;
  font: inherit;
  color: var(--admin-text);
  background: #fbfefc;
  border: 1.5px solid var(--admin-border-strong);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.lg-input input::placeholder {
  color: #8aa396;
}

.lg-input input:focus {
  outline: none;
  background: #fff;
}

/* The eye that shows or hides the password. */
.lg-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lg-eye:hover {
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
}

.lg-eye .icon {
  width: 18px;
  height: 18px;
}

.lg-eye .off,
.lg-eye[aria-pressed="true"] .on {
  display: none;
}

.lg-eye[aria-pressed="true"] .off {
  display: block;
}

.lg-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 48px;
  margin-top: 1.5rem;
  overflow: hidden;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: 0;
  border-radius: var(--admin-radius-btn);
  cursor: pointer;
  box-shadow: 0 12px 24px -10px rgba(21, 128, 61, 0.7);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* A gleam that crosses the button on hover. */
.lg-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s;
}

.lg-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -10px rgba(21, 128, 61, 0.8);
}

.lg-btn:hover:not(:disabled)::after {
  left: 120%;
}

.lg-btn:active:not(:disabled) {
  transform: translateY(0);
}

.lg-btn:disabled {
  cursor: progress;
  opacity: 0.92;
}

.lg-spin {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lg-spin 0.7s linear infinite;
}

.lg-btn[aria-busy="true"] .lg-spin {
  display: inline-block;
}

.lg-note {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.lg-note a {
  font-weight: 600;
  color: var(--admin-primary-hover);
}

@media (max-width: 1000px) {
  .lg-hero {
    padding: 4rem 2rem;
  }
}

/* A phone: the form alone. */
@media (max-width: 800px) {
  .ulogin {
    grid-template-columns: 1fr;
  }

  .lg-hero {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .ulogin *,
  .ulogin *::before,
  .ulogin *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* lg-gradient is further up, with the other keyframes. */
@keyframes lg-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(40px, 30px) scale(1.12);
  }
}

@keyframes lg-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lg-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes lg-leave {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
}

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

/* ==== Appearance: light and dark ===========================================================================
   <html data-theme="light|dark"> is set before the page is drawn (Layouts/theme-head). Most colours come from the
   --admin-* tokens, so the dark theme is mostly those tokens; the rules after them are the few that name a light
   colour of their own. The switch is in the top bar (js/theme.js). */

.theme-switch {
  position: relative;
}

.theme-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  color: var(--admin-text-muted);
  background: transparent;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-trigger:hover,
.theme-trigger[aria-expanded="true"] {
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
  border-color: var(--admin-primary);
}

.theme-trigger:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

/* The sun in light, the moon in dark: one turns away as the other turns in. */
.theme-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.theme-ico .icon {
  width: 18px;
  height: 18px;
}

.theme-ico-dark,
:root[data-theme="dark"] .theme-ico-light {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

:root[data-theme="dark"] .theme-ico-dark {
  opacity: 1;
  transform: none;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 0.4rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-lg);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  color: var(--admin-text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--admin-radius-sm);
  cursor: pointer;
}

.theme-menu button .icon {
  width: 16px;
  height: 16px;
  color: var(--admin-text-muted);
}

.theme-menu button:hover {
  background: var(--admin-primary-soft);
}

.theme-menu button[aria-checked="true"] {
  font-weight: 600;
  color: var(--admin-primary-hover);
  background: var(--admin-primary-soft);
}

.theme-menu button[aria-checked="true"] .icon {
  color: var(--admin-primary-hover);
}

/* Switching: the colours glide instead of flipping in one frame. */
:root.theme-changing,
:root.theme-changing *,
:root.theme-changing *::before,
:root.theme-changing *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ---- The dark theme's colours ---- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --admin-primary: #22c55e;
  --admin-primary-hover: #4ade80;
  --admin-primary-soft: rgba(34, 197, 94, 0.12);
  --admin-button-bg: #16a34a;
  --admin-button-hover: #15803d;
  --admin-button-fg: #ffffff;
  --admin-bg: #020604;
  --admin-surface: #0b1710;
  --admin-border: #1d3427;
  --admin-border-strong: #2a4734;
  --admin-sidebar-bg: #040b07;
  --admin-sidebar-border: #10221a;
  --admin-text: #e2f1e7;
  --admin-text-muted: #8eab9a;
  --admin-success: #4ade80;
  --admin-warning: #fbbf24;
  --admin-danger: #f87171;
  --admin-info: #22d3ee;
  --admin-on-danger: #1f0606;
  --admin-overlay: rgba(0, 0, 0, 0.6);
  --admin-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.5);
  --admin-shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.6);
}

/* ---- The few rules that name a light colour of their own ---- */
:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(34, 197, 94, 0.05) 0, transparent 35%),
    var(--admin-bg);
  background-attachment: fixed;
}

:root[data-theme="dark"] .admin-topbar {
  background: rgba(3, 9, 5, 0.85);
  border-bottom-color: rgba(74, 222, 128, 0.1);
}

/* The sidebar a shade lighter than the page, with a faint green edge between them. */
:root[data-theme="dark"] .admin-sidebar {
  background: linear-gradient(180deg, #0c1f14, #07140c);
  border-right-color: rgba(74, 222, 128, 0.12);
  box-shadow: 8px 0 30px -12px rgba(0, 0, 0, 0.8);
}

:root[data-theme="dark"] .ad-stat,
:root[data-theme="dark"] .us-card {
  background: var(--admin-surface);
}

:root[data-theme="dark"] .ad-bar {
  background: #1d3427;
}

:root[data-theme="dark"] .ds-card {
  --soft: rgba(34, 197, 94, 0.14);
}

:root[data-theme="dark"] .ds-teal {
  --soft: rgba(20, 184, 166, 0.14);
}

:root[data-theme="dark"] .ds-lime {
  --soft: rgba(132, 204, 22, 0.14);
}

:root[data-theme="dark"] .rl-module {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .rl-card-add {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.07), var(--admin-surface));
}

:root[data-theme="dark"] .rf-matrix thead th,
:root[data-theme="dark"] .st-tabs,
:root[data-theme="dark"] .pk-tabs {
  background: linear-gradient(180deg, #11241a, var(--admin-surface));
}

:root[data-theme="dark"] .rf-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .rf-row.is-on {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), transparent 70%);
}

:root[data-theme="dark"] .st-status {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .pk-danger {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.12), var(--admin-surface) 70%);
}

:root[data-theme="dark"] .pk-danger-ico {
  background: rgba(248, 113, 113, 0.15);
}

:root[data-theme="dark"] .pk-delete-data,
:root[data-theme="dark"] .pk-op-step.is-failed {
  background: rgba(248, 113, 113, 0.12);
}

:root[data-theme="dark"] .pk-live.is-off {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.14), transparent);
}

:root[data-theme="dark"] .pk-empty {
  background: radial-gradient(circle at 12% 50%, rgba(74, 222, 128, 0.1), transparent 40%), var(--admin-surface);
}

/* The sign-in form. */
:root[data-theme="dark"] .lg-input input {
  background: #0a160f;
}

:root[data-theme="dark"] .lg-input input:focus {
  background: #0d1b13;
}

:root[data-theme="dark"] .lg-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

:root[data-theme="dark"] .lg-card {
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), var(--admin-shadow);
}

/* The black logo made white on a dark surface. */
:root[data-theme="dark"] .brand-logo-card,
:root[data-theme="dark"] .brand-logo-light {
  filter: brightness(0) invert(1);
}

/* The video and camera pages (upload, live cameras, their analytics), shared by the add-ons. */
:root[data-theme="dark"] .cs-card {
  background: linear-gradient(160deg, #0e1d14, var(--admin-surface));
  border-color: var(--admin-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .cs-tile {
  background: linear-gradient(180deg, #10221a, color-mix(in srgb, var(--tone) 10%, var(--admin-surface)));
  border-color: var(--admin-border);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .cs-good strong {
  color: var(--admin-success);
}

:root[data-theme="dark"] .cs-muted strong {
  color: var(--admin-text-muted);
}

:root[data-theme="dark"] .cs-row {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

:root[data-theme="dark"] .cs-row.is-picked {
  background: color-mix(in srgb, var(--admin-primary) 16%, var(--admin-surface));
}

:root[data-theme="dark"] .cs-done {
  background: color-mix(in srgb, var(--admin-success) 14%, var(--admin-surface));
}

:root[data-theme="dark"] .vj-zone {
  background: rgba(34, 197, 94, 0.05);
}

:root[data-theme="dark"] .vj-zone.is-over {
  background: color-mix(in srgb, var(--admin-primary) 14%, var(--admin-surface));
}

:root[data-theme="dark"] .vj-job {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .vj-bar,
:root[data-theme="dark"] .vj-progress {
  background: #1d3427;
}

:root[data-theme="dark"] .vj-error {
  background: color-mix(in srgb, var(--admin-danger) 12%, var(--admin-surface));
  border-color: color-mix(in srgb, var(--admin-danger) 45%, var(--admin-surface));
}

:root[data-theme="dark"] .vj-badge {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .vj-badge.vj-r-match {
  background: color-mix(in srgb, var(--admin-success) 15%, var(--admin-surface));
}

:root[data-theme="dark"] .vj-badge.vj-r-uncertain {
  background: color-mix(in srgb, var(--admin-warning) 15%, var(--admin-surface));
}

/* The "no videos yet" picture: stacked frames on a dark surface. */
:root[data-theme="dark"] .ve-layer {
  background: linear-gradient(135deg, #12291b, var(--admin-surface));
  border-color: color-mix(in srgb, var(--admin-primary) 40%, var(--admin-surface));
}

:root[data-theme="dark"] .ve-layer:nth-of-type(4)::before {
  border-left-color: color-mix(in srgb, var(--admin-primary) 50%, var(--admin-surface));
  border-right-color: color-mix(in srgb, var(--admin-primary) 50%, var(--admin-surface));
}

:root[data-theme="dark"] .ve-scan-face {
  border-color: color-mix(in srgb, var(--admin-primary) 40%, var(--admin-surface));
}

@media (prefers-reduced-motion: reduce) {
  .theme-ico {
    transition: none;
  }
}
