:root {
  --demo-bg: radial-gradient(90rem 50rem at 75% -25%,#123a85 0%,transparent 55%),linear-gradient(130deg,#02040d,#06125a 58%,#190e39);
  --demo-paper: #ffffff;
  --demo-ink: #152132;
  --demo-muted: #697588;
  --demo-line: #e4e9f0;
  --demo-blue: #176bff;
  --demo-blue-soft: #edf4ff;
  --demo-radius: 24px;
}

.demo-body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--demo-bg);
  color: var(--demo-ink);
  font-family: "Inter Tight", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}
.demo-body *, .demo-body *::before, .demo-body *::after { box-sizing: border-box; }
.demo-body [hidden] { display: none !important; }
.screen-reader-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.demo-body button, .demo-body input { font: inherit; }
.demo-body button { -webkit-tap-highlight-color: transparent; }
.demo-body a { color: inherit; }
.demo-body button:focus-visible,
.demo-body a:focus-visible,
.demo-body input:focus-visible {
  outline: 3px solid var(--demo-blue);
  outline-offset: 4px;
}
.demo-body ::selection { color: #0b3475; background: #d7e8ff; }

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1480px;
  min-height: 102px;
  margin-inline: auto;
  padding: 24px 32px;
}
.demo-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.demo-brand img { display: block; width: 40px; height: 40px; object-fit: contain; }
.demo-brand span { font-size: 24px; font-weight: 700; letter-spacing: -.055em; }
.demo-brand .brand-divider { display: inline-block; margin-inline: 12px; color: #b1bbc9; font-size: 18px; font-weight: 400; letter-spacing: 0; }
.demo-brand .brand-product { color: #607188; font-size: 15px; font-weight: 500; letter-spacing: 0; }
.demo-nav { display: flex; align-items: center; gap: 26px; font-size: 13px; font-weight: 600; }
.demo-nav a { text-decoration: none; color: #58667a; }
.demo-nav a:hover { color: var(--demo-blue); }
.demo-nav .language-link {
  display: inline-flex;
  min-width: 38px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: var(--demo-ink);
  background: rgba(255, 255, 255, .6);
  font-size: 11px;
  letter-spacing: .04em;
}

.demo-main { width: 100%; max-width: 1480px; margin-inline: auto; padding: 23px 32px 32px; }
.demo-intro { margin-bottom: 31px; }
.demo-intro .eyebrow { margin: 0 0 10px; color: #64748a; font-size: 10px; font-weight: 650; letter-spacing: .18em; line-height: 1.4; text-transform: uppercase; }
.intro-line { display: flex; align-items: baseline; gap: 30px; }
.intro-line h1 { flex-shrink: 0; margin: 0; color: #142235; font-size: clamp(35px, 3.6vw, 52px); font-weight: 600; letter-spacing: -.065em; line-height: 1.08; }
.intro-line p { max-width: 560px; margin: 0; color: var(--demo-muted); font-size: 15px; line-height: 1.55; }

.demo-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--demo-line);
  border-radius: var(--demo-radius);
  background: var(--demo-paper);
  box-shadow: 0 5px 20px rgba(22, 39, 63, .025), 0 1px 2px rgba(22, 39, 63, .025);
}
.player-area { display: flex; flex-direction: column; min-width: 0; padding: 20px; }
.player-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 48px; margin-bottom: 16px; }
.sample-kicker { margin: 0 0 3px; color: #7a8596; font-size: 9px; font-weight: 650; letter-spacing: .13em; line-height: 1.4; text-transform: uppercase; }
.active-title { margin: 0; color: #243449; font-size: 17px; font-weight: 600; letter-spacing: -.025em; line-height: 1.35; }
.video-stage { position: relative; flex-shrink: 0; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #ffffff; }
.video-stage video,
.video-stage svg.overlay { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.video-stage svg.overlay { z-index: 1; overflow: hidden; pointer-events: none; }
.detection-box { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.detection-label { font-family: "Inter Tight", Inter, system-ui, sans-serif; font-weight: 600; letter-spacing: 0; }
.video-message { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 32px; background: rgba(12, 19, 29, .8); color: #e5edf8; text-align: center; font-size: 14px; line-height: 1.6; }
.video-message p { max-width: 400px; margin: 0; }
.video-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }

.player-controls { display: flex; align-items: center; gap: 12px; min-height: 59px; padding: 11px 0 9px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 7px; border: 0; border-radius: 7px; color: #34485f; background: transparent; cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.icon-button:hover { background: #eff4fa; color: var(--demo-blue); }
.icon-button:active { background: #e5eefa; }
.icon-button:disabled { opacity: .4; cursor: default; }
.icon-button svg { display: block; width: 22px; height: 22px; }
.time-code { flex: 0 0 auto; min-width: 34px; color: #607188; font-size: 11px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline { display: block; flex: 1 1 auto; width: 100%; min-width: 30px; height: 22px; margin: 0; padding: 0; accent-color: var(--demo-blue); cursor: pointer; }
.timeline:disabled { opacity: .45; cursor: default; }
.timeline::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--demo-blue) var(--played, 0%), #dee6f0 var(--played, 0%)); }
.timeline::-webkit-slider-thumb { margin-top: -6px; }
.timeline::-moz-range-track { height: 3px; border-radius: 3px; background: #dee6f0; }
.timeline::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--demo-blue); }
.timeline::-moz-range-thumb { width: 12px; height: 12px; border: 0; background: var(--demo-blue); }

.detection-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 48px; margin-top: 1px; padding: 13px 1px 1px; border-top: 1px solid #edf0f5; }
.detection-title { margin: 0; color: #7b8798; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.detection-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.detection-chip { --category-color: #4779b8; --category-tint: #f0f5fb; display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 3px 8px; border-radius: 5px; background: var(--category-tint); color: var(--category-color); font-size: 10px; font-weight: 550; line-height: 1.3; white-space: nowrap; }
.no-detections { color: var(--demo-muted); font-size: 11px; }
.video-message { flex-direction: column; gap: 14px; }
.video-message button { padding: 9px 16px; border: 1px solid #7388a0; border-radius: 7px; background: #fff; color: #152132; cursor: pointer; }
.detection-chip.normal { --category-color: #287a57; --category-tint: #eff7f2; }
.detection-chip.suspicious { --category-color: #a26e17; --category-tint: #fcf5e8; }
.detection-chip.theft { --category-color: #b35056; --category-tint: #fbf0f1; }
.detection-chip.person { --category-color: #4779b8; --category-tint: #f0f5fb; }

/* Size containment lets the player set the shared row height, regardless of the number of samples. */
.sample-library { display: flex; flex-direction: column; min-width: 0; min-height: 0; contain: size; overflow: hidden; padding: 25px 20px 20px; border-left: 1px solid var(--demo-line); background: #ffffff; }
.library-heading { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 12px; margin-bottom: 17px; background: #ffffff; }
.library-heading h2 { margin: 0; color: #4e5f75; font-size: 11px; font-weight: 600; letter-spacing: .015em; line-height: 1.4; }
.sample-count { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding-inline: 5px; border-radius: 5px; background: #eaf0f6; color: #7c8a9c; font-size: 9px; font-weight: 600; }
.sample-list { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; flex: 1 1 0; min-height: 0; gap: 14px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #cbd7e6 transparent; scrollbar-gutter: stable; margin: -5px -6px -5px -5px; padding: 5px 6px 5px 5px; scroll-padding-block: 5px; }
.sample-list::-webkit-scrollbar { width: 6px; height: 6px; }
.sample-list::-webkit-scrollbar-thumb { border-radius: 6px; background: #cbd7e6; }
.sample-list::-webkit-scrollbar-track { background: transparent; }
.sample-card { position: relative; display: block; width: 100%; min-width: 0; overflow: hidden; padding: 0; border: 1px solid #e1e6ed; border-radius: 10px; background: #fff; color: var(--demo-ink); text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.sample-card:hover { border-color: #b9cce7; box-shadow: 0 3px 8px rgba(25, 48, 79, .035); }
.sample-card:focus-visible { outline-width: 2px; outline-offset: 2px; }
.sample-card[aria-pressed="true"] { border-color: #7aaaff; box-shadow: 0 0 0 2px rgba(23, 107, 255, .1); }
.sample-card[aria-pressed="true"] .sample-caption strong { color: #225bb1; }
.sample-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #ffffff; }
.sample-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sample-number { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 4px; background: rgba(15, 25, 39, .65); color: #fff; font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.sample-duration { position: absolute; right: 7px; bottom: 7px; padding: 3px 5px; border-radius: 3px; background: rgba(15, 25, 39, .78); color: #f2f6fb; font-size: 9px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.sample-caption { display: block; padding: 11px 12px 12px; }
.sample-caption strong { display: block; overflow: hidden; margin: 0 0 3px; color: #32455d; font-size: 11px; font-weight: 600; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.sample-caption small { display: block; color: #8290a3; font-size: 9px; font-weight: 400; line-height: 1.4; }
.sample-categories { display: flex; align-items: center; gap: 5px; }
.category-dot { display: inline-block; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--category-color, #7ba0cb); }
.category-dot.normal, .category-dot[data-category="normal"] { --category-color: #3f9c72; }
.category-dot.suspicious, .category-dot[data-category="suspicious"] { --category-color: #d6a03f; }
.category-dot.theft, .category-dot[data-category="theft"] { --category-color: #cb6c72; }
.category-dot.person, .category-dot[data-category="person"] { --category-color: #6f96c9; }

.demo-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 18px 28px; flex-wrap: wrap; width: 100%; max-width: 1480px; margin: 0 auto 24px; padding: 0 32px; color: #8390a1; font-size: 12px; line-height: 1.6; }
.demo-footer p { margin: 0; }
.demo-footer a { color: #66788f; text-decoration: none; text-underline-offset: 3px; }
.demo-footer a:hover { color: var(--demo-blue); text-decoration: underline; }

/* Restore the historical site background; keep player surfaces and controls light. */
.demo-header, .demo-footer { color: #ECF3FF; }
.demo-brand img { filter: invert(1); mix-blend-mode: screen; }
.demo-brand .brand-divider, .demo-brand .brand-product,
.demo-nav a, .demo-intro .eyebrow, .intro-line p,
.demo-footer, .demo-footer a { color: #B8C6EA; }
.intro-line h1 { color: #ECF3FF; }
.demo-nav a:hover, .demo-footer a:hover { color: #12dacf; }
.demo-nav .language-link { color: #ECF3FF; border-color: rgba(186,217,255,.24); background: rgba(255,255,255,.06); }

@media (max-width: 1200px) {
  .intro-line { gap: 24px; }
  .intro-line p { max-width: 440px; font-size: 14px; }
  .demo-main { padding-top: 18px; }
}
@media (max-width: 1000px) {
  .demo-workspace { grid-template-columns: minmax(0, 1fr); }
  .sample-library { contain: none; overflow: visible; border-top: 1px solid var(--demo-line); border-left: 0; padding: 19px 20px 20px; }
  .library-heading { margin-bottom: 13px; }
  .sample-list { display: grid; flex: none; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 190px; grid-auto-rows: auto; gap: 13px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 5px; scrollbar-gutter: auto; margin: -5px; padding: 5px 5px 10px; }
  .sample-card { scroll-snap-align: start; }
  .intro-line { display: block; }
  .intro-line h1 { font-size: 43px; }
  .intro-line p { max-width: 630px; margin-top: 12px; }
  .demo-header { min-height: 90px; }
}
@media (max-width: 600px) {
  .demo-header { min-height: 78px; gap: 16px; padding: 19px 18px; }
  .demo-brand { gap: 9px; min-width: 44px; min-height: 44px; }
  .demo-brand img { width: 33px; height: 33px; }
  .demo-brand span { font-size: 21px; }
  .demo-brand .brand-divider, .demo-brand .brand-product { display: none; }
  .demo-nav { gap: 10px; font-size: 12px; }
  .demo-nav a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; touch-action: manipulation; }
  .demo-nav .language-link { min-width: 44px; min-height: 44px; padding: 8px; font-size: 11px; }
  .demo-main { padding: 20px 12px 24px; }
  .demo-intro { margin-bottom: 23px; padding-inline: 5px; }
  .demo-intro .eyebrow { margin-bottom: 9px; font-size: 9px; }
  .intro-line h1 { font-size: 36px; }
  .intro-line p { max-width: 40ch; margin-top: 10px; font-size: 13px; line-height: 1.6; }
  .demo-workspace { border-radius: 18px; }
  .player-area { padding: 12px; }
  .player-heading { min-height: 44px; gap: 12px; margin-bottom: 12px; }
  .sample-kicker { font-size: 8px; }
  .active-title { font-size: 14px; }
  .video-stage { border-radius: 9px; }
  .video-message { padding: 20px; font-size: 12px; }
  .player-controls { gap: 6px; min-height: 52px; padding: 8px 0; }
  .icon-button { width: 44px; height: 44px; padding: 10px; touch-action: manipulation; }
  .icon-button svg { width: 21px; height: 21px; }
  .time-code { min-width: 29px; font-size: 10px; }
  .timeline { min-width: 24px; height: 44px; }
  .detection-strip { gap: 8px 11px; min-height: 48px; padding-top: 12px; padding-bottom: 3px; }
  .detection-title { font-size: 9px; }
  .detection-chips { gap: 5px; }
  .detection-chip { padding: 3px 6px; font-size: 9px; }
  .sample-library { padding: 16px 15px 13px; }
  .demo-footer { gap: 7px; padding-inline: 12px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-body *, .demo-body *::before, .demo-body *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .sample-list { scroll-snap-type: none; }
}
