:root,
body[data-theme="aeye"] {
  --bg: #0c1016;
  --bg-soft: #121824;
  --panel: rgba(18, 24, 34, 0.92);
  --panel-strong: rgba(24, 31, 42, 0.98);
  --panel-soft: rgba(28, 36, 49, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(135, 155, 186, 0.22);
  --text: #edf1f7;
  --muted: #9aa8ba;
  --accent: #1456ec;
  --accent-rgb: 20, 86, 236;
  --accent-strong: #0e42ca;
  --accent-2: #061b63;
  --accent-2-rgb: 6, 27, 99;
  --body-glow-1: rgba(var(--accent-rgb), 0.18);
  --body-glow-2: rgba(var(--accent-2-rgb), 0.2);
  --topbar-top: rgba(12, 23, 48, 0.98);
  --topbar-bottom: rgba(10, 17, 36, 0.96);
  --panel-top: rgba(13, 24, 47, 0.98);
  --panel-bottom: rgba(9, 16, 33, 0.98);
  --workspace-top: rgba(5, 12, 27, 0.96);
  --workspace-bottom: rgba(8, 15, 33, 0.99);
  --accent-surface: rgba(var(--accent-rgb), 0.08);
  --accent-surface-strong: rgba(var(--accent-rgb), 0.13);
  --accent-border-soft: rgba(var(--accent-rgb), 0.16);
  --accent-border: rgba(var(--accent-rgb), 0.4);
  --accent-border-strong: rgba(var(--accent-rgb), 0.56);
  --accent-ring: rgba(var(--accent-rgb), 0.55);
  --accent-ring-soft: rgba(var(--accent-rgb), 0.14);
  --accent-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.22);
  --accent-shadow-hover: 0 14px 28px rgba(var(--accent-rgb), 0.28);
  --workspace-mark-shadow: 0 16px 28px rgba(var(--accent-rgb), 0.24);
  --accent-glow: rgba(var(--accent-rgb), 0.12);
  --accent-glow-strong: rgba(var(--accent-rgb), 0.14);
  --brand-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 247, 255, 0.99));
  --brand-card-border: rgba(var(--accent-rgb), 0.22);
  --brand-card-shadow: 0 18px 38px rgba(var(--accent-2-rgb), 0.28);
  --danger: #ff6b6b;
  --success: #3ddc97;
  --warning: #f6c177;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 15px;
  background:
    radial-gradient(circle at 15% 8%, var(--body-glow-1), transparent 24%),
    radial-gradient(circle at 82% 12%, var(--body-glow-2), transparent 20%),
    linear-gradient(180deg, #0b0f15 0%, #0f1520 52%, #0c1016 100%);
}

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

button {
  border: 0;
}

.app-shell {
  width: min(1660px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 22px;
}

.hero-row {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) 380px;
  grid-template-rows: auto auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--topbar-top), var(--topbar-bottom));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  grid-column: 2 / 4;
  grid-row: 1;
}

.brand-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

.brand-assets-shell {
  display: block;
  padding: 10px 12px;
  border-radius: 22px;
  min-height: 128px;
  height: auto;
  min-width: 0;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar-brand {
  display: grid;
  justify-items: start;
  padding: 4px 2px 0;
  width: 100%;
}

.sidebar-brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--brand-card-border);
  box-shadow: var(--brand-card-shadow);
  background: var(--brand-card-bg);
  padding: 8px 10px;
}

.brand-assets-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
}

.brand-assets-tools,
.brand-assets-gallery {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: var(--shadow-soft);
}

.brand-assets-gallery {
  min-height: 0;
  overflow: hidden;
}

.brand-assets-head {
  display: grid;
  gap: 4px;
}

.brand-assets-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.brand-assets-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.upload-limit-note {
  margin-top: 2px;
}

.upload-limit-note.is-limit-reached {
  color: var(--danger);
}

.brand-assets-form {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
}

.brand-assets-form input[type="file"] {
  min-width: 0;
}

.brand-assets-list {
  min-width: 0;
  min-height: 0;
}

.brand-assets-gallery #videos-list.asset-list-loaded {
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-height: 120px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 2px;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.brand-assets-gallery .video-card {
  min-width: 300px;
  max-width: 300px;
  width: 300px;
  flex: 0 0 300px;
  scroll-snap-align: start;
}

.brand-assets-gallery .asset-empty-note {
  margin: 0;
}

.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;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.55rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.06rem;
  line-height: 1.2;
}

h3 {
  font-size: 0.98rem;
  line-height: 1.2;
}

.hero-copy {
  max-width: 72ch;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.96rem;
}

.topbar-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.status-pill {
  padding: 10px 14px;
}

.status-pill span {
  color: var(--muted);
  font-size: 0.78rem;
}

.status-pill strong {
  font-size: 0.9rem;
}

.chip {
  padding: 8px 12px;
  color: #d9e3f2;
  font-size: 0.78rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 12, 0.74);
  backdrop-filter: blur(10px);
}

.process-modal-card {
  width: min(520px, 100%);
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(24, 31, 42, 0.98), rgba(12, 17, 26, 0.98));
  box-shadow: var(--shadow);
}

.upload-modal-card {
  width: min(460px, 100%);
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(24, 31, 42, 0.98), rgba(12, 17, 26, 0.98));
  box-shadow: var(--shadow);
}

.analytics-modal-card {
  width: min(1180px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(24, 31, 42, 0.98), rgba(12, 17, 26, 0.98));
  box-shadow: var(--shadow);
}

.frame-preview-modal-card {
  width: min(1080px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(24, 31, 42, 0.98), rgba(12, 17, 26, 0.98));
  box-shadow: var(--shadow);
}

.frame-preview-modal-head {
  align-items: flex-start;
}

.frame-preview-meta {
  max-width: 70ch;
}

.frame-preview-stage {
  margin-top: 18px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(135, 155, 186, 0.2);
  background: #05070b;
}

.frame-preview-stage img {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: #05070b;
}

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

.modal-copy {
  margin: 12px 0;
  line-height: 1.5;
}

.upload-progress-file {
  word-break: break-word;
}

.upload-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.upload-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 120ms ease;
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.upload-progress-meta strong {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.modal-field {
  display: grid;
  gap: 8px;
  align-items: start;
  margin: 12px 0;
}

.modal-field span {
  min-width: 0;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.alerts-panel-head {
  margin-bottom: 12px;
}

.analytics-modal-copy {
  max-width: 88ch;
}

.analytics-dashboard {
  display: grid;
  gap: 14px;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analytics-kpi {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.analytics-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.analytics-kpi strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  align-items: stretch;
}

.analytics-grid-wide {
  grid-template-columns: 1fr 1fr;
}

.analytics-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.analytics-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.analytics-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.analytics-donut-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.analytics-donut {
  position: relative;
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  background: conic-gradient(var(--analytics-donut-gradient));
}

.analytics-donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: inherit;
  background: rgba(12, 17, 26, 0.98);
  border: 1px solid var(--border);
}

.analytics-donut-label {
  position: absolute;
  inset: 0;
  place-items: center;
  text-align: center;
  z-index: 1;
  pointer-events: none;
  margin-top: 50px;
}

.analytics-donut-label strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.analytics-donut-label span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-legend {
  display: grid;
  gap: 10px;
}

.analytics-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 10px;
}

.analytics-legend-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.analytics-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.analytics-legend-item span:last-child {
  color: #dbe6f6;
  font-variant-numeric: tabular-nums;
}

.analytics-bars {
  display: grid;
  gap: 12px;
}

.analytics-bar-row {
  display: grid;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
}

.analytics-bar-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.analytics-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dbe6f6;
  font-size: 0.86rem;
}

.analytics-bar-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.analytics-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-color, var(--accent)), color-mix(in srgb, var(--bar-color, var(--accent)) 75%, white));
}

.analytics-trend {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 160px;
}

.analytics-line-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.analytics-grid-lines line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.analytics-mini-axis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.analytics-trend-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-items: end;
}

.analytics-trend-fill {
  width: 100%;
  min-height: 18px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-2-rgb), 0.82));
  box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.18);
}

.analytics-trend-label {
  color: var(--muted);
  font-size: 0.72rem;
}

.analytics-bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 4px;
}

.analytics-bar-chart-item {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: end;
  min-height: 250px;
  padding: 8px 6px 6px;
  border-radius: 16px;
}

.analytics-bar-chart-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.analytics-bar-chart-track {
  position: relative;
  width: 100%;
  min-height: 190px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 16px;
  padding: 0 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
  border: 1px solid var(--border);
}

.analytics-bar-chart-fill {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, var(--bar-color, var(--success)), color-mix(in srgb, var(--bar-color, var(--success)) 72%, white));
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.16);
}

.analytics-bar-chart-item span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.25;
}

.analytics-chart-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
}

.analytics-scatter-wrap {
  position: relative;
  min-height: 240px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, transparent 0 24%, rgba(255, 255, 255, 0.05) 24% 25%, transparent 25% 49%, rgba(255, 255, 255, 0.05) 49% 50%, transparent 50% 74%, rgba(255, 255, 255, 0.05) 74% 75%, transparent 75% 100%),
    linear-gradient(0deg, transparent 0 24%, rgba(255, 255, 255, 0.05) 24% 25%, transparent 25% 49%, rgba(255, 255, 255, 0.05) 49% 50%, transparent 50% 74%, rgba(255, 255, 255, 0.05) 74% 75%, transparent 75% 100%);
  overflow: hidden;
}

.analytics-scatter-axis {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
}

.analytics-scatter-axis-x {
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 2px;
}

.analytics-scatter-axis-y {
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 2px;
}

.analytics-scatter-point {
  position: absolute;
  width: var(--point-size, 16px);
  height: var(--point-size, 16px);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85), var(--point-color) 60%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--point-color) 24%, transparent), 0 12px 24px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 50%);
  cursor: help;
}

.analytics-scatter-point::after {
  content: "";
  position: absolute;
  inset: -12px;
}

.analytics-scatter-point:hover {
  transform: translate(-50%, 50%) scale(1.08);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--point-color) 24%, transparent), 0 14px 28px rgba(0, 0, 0, 0.24);
}

.analytics-insights {
  display: grid;
  gap: 10px;
}

.analytics-insight {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-insight strong {
  font-size: 0.98rem;
}

.analytics-insight span {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1180px) {
  .analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid,
  .analytics-donut-layout,
  .analytics-grid-wide {
    grid-template-columns: 1fr;
  }

  .analytics-donut {
    margin-left: 0;
  }

  .analytics-mini-axis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: stretch;
  margin-top: 0;
  grid-column: 2 / 4;
  grid-row: 2;
}

.dock-panel {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar,
.alerts-rail {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.sidebar {
  align-self: stretch;
  padding-top: 18px;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-content: start;
  grid-auto-rows: min-content;
}

.sidebar .accordion {
  margin-top: 14px;
}

.alerts-rail {
  align-self: stretch;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  grid-column: 2;
  grid-template-rows: minmax(0, 1fr) auto;
}

.workspace {
  grid-column: 1;
}

#videos-list {
  min-height: 0;
  align-content: start;
}

#videos-list.asset-list-loaded {
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

#runs-list,
#frames-gallery {
  align-items: stretch;
  min-height: 116px;
}

#alert-table-wrapper {
  min-height: 0;
  max-height: 100%;
  display: grid;
  align-content: start;
  overflow: auto;
}

.alerts-rail .data-table {
  table-layout: fixed;
}

.alerts-rail .data-table th:nth-child(1),
.alerts-rail .data-table td:nth-child(1) {
  width: 90px;
}

.alerts-rail .data-table th:nth-child(2),
.alerts-rail .data-table td:nth-child(2) {
  width: auto;
}

.seek-link {
  color: var(--accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.seek-link:hover {
  text-decoration: underline;
}

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

.runs-panel {
  width: 100%;
  min-width: 0;
  min-height: 180px;
}

.frame-strip-head {
  margin: 0;
  padding-top: 6px;
  padding-bottom: 10px;
}

.frame-strip-head h3 {
  margin-left: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.workspace-hero,
.review-panel,
.timeline-panel {
  padding: 18px;
}

.workspace-hero {
  align-self: start;
}

.frame-strip-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  min-height: 160px;
}

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

.dock-panel-body {
  display: grid;
  gap: 14px;
}

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

.sidebar-gap {
  margin-top: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.button {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  padding: 9px 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--accent-shadow);
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--accent-shadow-hover);
}

.button:disabled,
.button.is-disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-subtle {
  background: rgba(255, 255, 255, 0.05);
  color: #d7e0ef;
  box-shadow: none;
  border: 1px solid var(--border);
}

#reset-upload-btn {
  margin-bottom: 12px;
}

#selected-run-label {
  display: block;
  max-width: 100%;
  margin-top: 6px;
  margin-bottom: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-form,
.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-stack {
  flex-direction: column;
  align-items: stretch;
}

.inline-field {
  margin: 10px 0 4px;
}

.inline-field span {
  min-width: 96px;
  color: var(--muted);
}

.inline-field-dark {
  margin: 10px 0 12px;
}

input[type="file"],
input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  margin-right: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-ring-soft);
}

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

.compact {
  max-height: 360px;
  overflow: auto;
}

.card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card>div {
  min-width: 0;
  flex: 1;
}

.card-title {
  font-size: 0.95rem;
  line-height: 1.25;
}

.video-card {
  width: 100%;
  overflow: hidden;
}

.video-card-main {
  width: 100%;
  min-width: 0;
}

.video-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.video-card-copy {
  min-width: 0;
  flex: 1;
}

.video-card .card-title {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.video-card .card-meta {
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.video-card-actions .button {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

.video-card .zone-preview-btn {
  flex-shrink: 0;
  width: 132px;
}

.card-meta,
.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
  align-self: center;
}

.run-card.active {
  border-color: var(--accent-border-strong);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.24);
}

.run-card {
  align-items: stretch;
  min-height: 100%;
}

.run-card-main {
  display: grid;
  gap: 10px;
  width: 100%;
}

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

.run-card-copy {
  min-width: 0;
  flex: 1;
  max-width: calc(100% - 74px);
}

.run-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  width: 74px;
  justify-content: flex-end;
}

.run-card .card-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.run-card .card-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.run-status {
  display: block;
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: capitalize;
}

.run-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.run-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 160ms ease;
}

.run-card .view-run-btn {
  width: 100%;
}

.run-card .rename-run-btn,
.run-card .delete-run-btn {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 0.95rem;
}

.run-card .icon-button span {
  display: inline-block;
  transform: translateY(-1px);
}

.run-card .run-status {
  margin-top: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-grid-dark .summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.summary-card {
  border-radius: 14px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.summary-card strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 8px;
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
}

.video-wrapper video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: #070a0f;
  object-fit: contain;
}

.workspace-preview {
  display: grid;
  gap: 12px;
  width: 100%;
  overflow: visible;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 20%, var(--accent-glow), transparent 30%),
    linear-gradient(180deg, var(--workspace-top), var(--workspace-bottom));
  box-shadow: var(--shadow);
  padding: 12px;
}

#workspace-placeholder,
#zone-editor-wrapper,
#annotated-video-wrapper {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  min-height: 0;
}

.workspace-placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  aspect-ratio: 16 / 9;
  padding: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.workspace-placeholder-mark {
  display: inline-grid;
  place-items: center;
  width: 98px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: var(--workspace-mark-shadow);
}

.workspace-placeholder h3 {
  font-size: 1rem;
}

.workspace-placeholder p {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

#zone-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

#workspace-placeholder.hidden,
#zone-editor-wrapper.hidden,
#annotated-video-wrapper.hidden {
  display: none !important;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  color: #c7d2e3;
  font-weight: 600;
  font-size: 0.8rem;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.table-pagination {
  display: flex;
  gap: 8px;
}

.frames-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.frames-gallery-strip {
  scroll-snap-type: x proximity;
}

.runs-gallery-strip {
  width: 100%;
  min-width: 0;
  padding-top: 2px;
  padding-bottom: 6px;
}

.runs-gallery-strip .run-card {
  min-width: 240px;
  max-width: 240px;
  flex: 0 0 240px;
  min-height: 180px;
  scroll-snap-align: start;
}

.frame-card {
  min-width: 180px;
  max-width: 220px;
  flex: 0 0 200px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  scroll-snap-align: start;
}

.frame-card img {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.frame-card.alert {
  border-color: rgba(255, 107, 107, 0.5);
}

.frame-card.selected {
  border-color: rgba(var(--accent-rgb), 0.9);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.16);
}

.frame-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 0;
  margin-top: auto;
}

.panel-empty {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  min-height: 92px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top, var(--accent-surface), transparent 58%);
  color: var(--muted);
}

.panel-empty strong {
  color: var(--text);
}

.panel-empty span {
  max-width: 34ch;
  line-height: 1.5;
}

.asset-empty-note {
  margin: 2px 2px 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.strip-empty {
  min-height: 110px;
  min-width: 100%;
}

.empty-table-row td {
  border-bottom: none;
  padding: 10px 0 0;
}

.table-empty {
  min-height: 180px;
}

.zones-editor {
  min-height: 380px;
  font-family: "SFMono-Regular", ui-monospace, monospace;
  line-height: 1.5;
}

.zone-drawer {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.zone-preview-workspace {
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.accordion {
  margin-top: 0;
  padding: 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.accordion[open] {
  background: rgba(255, 255, 255, 0.04);
}

.accordion>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  user-select: none;
}

.accordion>summary::-webkit-details-marker {
  display: none;
}

.accordion>summary span {
  display: grid;
  gap: 2px;
}

.accordion>summary strong {
  font-size: 0.96rem;
}

.accordion>summary small {
  color: var(--muted);
  font-size: 0.8rem;
}

.accordion> :not(summary) {
  padding: 0 16px 16px;
}

.zone-toolbar {
  display: grid;
  gap: 12px;
}

.zone-panel-view {
  display: grid;
  gap: 12px;
}

.zone-builder-step {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--accent-surface);
  border: 1px solid var(--accent-border-soft);
}

.zone-builder-step-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.zone-builder-step-row span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.zone-builder-step strong {
  font-size: 0.84rem;
}

.zone-builder-step small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.zone-overlay-list {
  display: grid;
  gap: 8px;
  min-height: 96px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.zone-overlay-empty {
  display: grid;
  place-items: center;
  min-height: 78px;
  margin: 0;
  padding: 12px;
  text-align: center;
  line-height: 1.5;
}

.zone-overlay-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.zone-overlay-item:hover {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.055);
}

.zone-overlay-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.zone-overlay-swatch {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--zone-color, #51cf66);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.zone-overlay-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.zone-overlay-copy strong,
.zone-overlay-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.zone-overlay-copy strong {
  font-size: 0.82rem;
}

.zone-overlay-copy small,
.zone-overlay-empty {
  color: var(--muted);
  font-size: 0.74rem;
}

.zone-overlay-edit-btn {
  min-width: 54px;
}

.zone-overlay-empty {
  margin: 0;
  padding: 12px;
}

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

.zone-apply-status {
  margin: 0;
  line-height: 1.4;
}

.zone-edit-actions {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.zone-edit-actions .button {
  width: 100%;
}

.button-mini {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.zone-ppe-options,
.zone-count-options {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.zone-apply-option {
  margin-top: 4px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.zone-toolbar-bottom {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: stretch;
  margin-top: 6px;
}

.zone-editor-controls {
  display: grid;
  gap: 12px;
  flex: 0 0 auto;
}

.zone-field {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  align-items: start;
}

.zone-field-wide {
  flex: 1 1 100%;
  min-width: 100%;
}

.zone-field span {
  min-width: 0;
}

.zone-rule-help {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 36ch;
}

.zone-toolbar .zone-field select,
.zone-toolbar .zone-field input {
  width: 100%;
}

.zone-toolbar-bottom .button {
  width: 100%;
}

.zone-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.zone-rule-actions .button {
  width: 100%;
}

.zone-rules-list {
  display: grid;
  gap: 8px;
}

.zone-rules-empty {
  margin: 0;
  font-size: 0.82rem;
}

.zone-rule-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.zone-rule-row:hover {
  border-color: var(--accent-ring);
  background: rgba(255, 255, 255, 0.06);
}

.zone-rule-row.selected {
  border-color: rgba(var(--accent-rgb), 0.75);
  background: var(--accent-surface-strong);
}

.zone-rule-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.zone-rule-row-copy strong {
  font-size: 0.84rem;
}

.zone-rule-row-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.zone-preview {
  position: relative;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top left, var(--accent-glow-strong), transparent 34%),
    linear-gradient(135deg, rgba(7, 10, 15, 0.95), rgba(15, 21, 31, 0.98));
}

.zone-preview img,
.zone-preview canvas,
.zone-preview-empty {
  position: absolute;
  inset: 0;
}

.zone-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #06080d;
}

.zone-preview canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.zone-preview-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(237, 241, 247, 0.84);
  font-size: 0.92rem;
  line-height: 1.6;
  pointer-events: none;
}

.zone-draft-status {
  margin: 0;
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.analytics-modal-card {
  width: 98%;
  max-height: 92vh;
}

.analytics-modal-card .modal-head {
  align-items: flex-start;
}

.analytics-dashboard {
  position: relative;
  display: grid;
  gap: 18px;
}

.analytics-shell {
  display: grid;
  gap: 18px;
}

.analytics-header-card,
.analytics-section-card,
.analytics-card,
.analytics-side-card {
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow-soft);
}

.analytics-header-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
  border-radius: 22px;
}

.analytics-header-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.analytics-meta-chip,
.analytics-summary-item,
.analytics-mini-metric {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-meta-chip span,
.analytics-summary-item span,
.analytics-mini-metric span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-meta-chip strong,
.analytics-summary-item strong,
.analytics-mini-metric strong {
  font-size: 0.98rem;
}

.analytics-meta-chip {
  min-height: 84px;
}

.analytics-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-filter-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
}

.analytics-filter-group label {
  display: grid;
  gap: 8px;
}

.analytics-filter-group label span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-filter-group select,
.analytics-task-search {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 12px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(9, 12, 18, 0.72);
  color: var(--text);
  outline: none;
}

.analytics-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analytics-kpi-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-kpi-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.analytics-kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.analytics-kpi-icon-1 {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.analytics-kpi-icon-2 {
  background: linear-gradient(135deg, #3ddc97, #11b981);
}

.analytics-kpi-icon-3 {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.analytics-kpi-icon-4 {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
}

.analytics-kpi-trend {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
}

.trend-up {
  color: #9df0c9;
  background: rgba(61, 220, 151, 0.12);
}

.trend-down {
  color: #ffb5b5;
  background: rgba(255, 107, 107, 0.12);
}

.analytics-kpi-card strong {
  font-size: 1.55rem;
  letter-spacing: -0.05em;
}

.analytics-kpi-card span {
  color: var(--text);
  font-weight: 600;
}

.analytics-kpi-card small {
  color: var(--muted);
  line-height: 1.45;
}

.analytics-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.analytics-primary-column {
  display: grid;
  gap: 18px;
}

.analytics-side-column {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 0;
  align-self: start;
}

.analytics-section-card {
  padding: 18px;
  border-radius: 22px;
}

.analytics-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.analytics-section-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.analytics-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 20px;
}

.analytics-card-inset {
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-card-compact {
  display: grid;
  gap: 12px;
}

.analytics-donut-layout-compact {
  grid-template-columns: 166px minmax(0, 1fr);
  align-items: center;
}

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

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

.analytics-mini-metric strong {
  font-size: 1.2rem;
}

.analytics-meta-chip,
.analytics-summary-item,
.analytics-mini-metric {
  text-align: center;
  justify-items: center;
  align-content: center;
}

.analytics-mini-axis-tight {
  margin-top: 4px;
}

.analytics-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-chip strong {
  font-size: 0.78rem;
  color: #fff;
}

.analytics-facility-list,
.analytics-bar-stack,
.analytics-bars-tight {
  display: grid;
  gap: 10px;
}

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

.analytics-stacked-row {
  display: grid;
  gap: 8px;
}

.analytics-stacked-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-inline: 4px;
}

.analytics-stacked-row-head span {
  color: var(--muted);
  font-size: 0.76rem;
}

.analytics-stacked-bar {
  display: flex;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.analytics-stacked-safe {
  background: linear-gradient(90deg, rgba(61, 220, 151, 0.95), rgba(17, 185, 129, 0.95));
}

.analytics-stacked-unsafe {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(245, 158, 11, 0.95));
}

.analytics-heatmap {
  display: grid;
  gap: 8px;
}

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

.analytics-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(135, 155, 186, 0.16);
  background: rgba(var(--accent-rgb), 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: help;
}

.analytics-line-chart circle,
.analytics-legend-item,
.analytics-meta-chip,
.analytics-kpi-card,
.analytics-mini-metric,
.analytics-bar-row,
.analytics-stacked-bar,
.analytics-snapshot-card,
.analytics-timeline-row,
.analytics-report-row,
.analytics-alert-item,
.analytics-summary-item {
  cursor: help;
}

.analytics-heatmap-cell:hover,
.analytics-snapshot-card:hover,
.analytics-alert-item:hover,
.analytics-report-row:hover,
.analytics-summary-item:hover,
.analytics-mini-metric:hover,
.analytics-meta-chip:hover,
.analytics-kpi-card:hover,
.analytics-bar-row:hover {
  transform: translateY(-1px);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.analytics-snapshot-grid {
  display: grid;
  gap: 10px;
}

.analytics-snapshot-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-snapshot-thumb {
  height: 74px;
  border-radius: 14px;
  display: grid;
  place-items: end start;
  padding: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.92);
}

.analytics-snapshot-thumb-1 {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.88), rgba(17, 185, 129, 0.74));
}

.analytics-snapshot-thumb-2 {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.88), rgba(var(--accent-2-rgb), 0.72));
}

.analytics-snapshot-thumb-3 {
  background: linear-gradient(135deg, rgba(245, 193, 119, 0.88), rgba(255, 107, 107, 0.72));
}

.analytics-snapshot-thumb-4 {
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.88), rgba(var(--accent-rgb), 0.72));
}

.analytics-snapshot-copy {
  display: grid;
  gap: 4px;
}

.analytics-snapshot-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.analytics-timeline {
  display: grid;
  gap: 10px;
}

.analytics-timeline-row {
  display: grid;
  grid-template-columns: 58px 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
}

.analytics-timeline-time {
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 2px;
}

.analytics-timeline-pip {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
}

.analytics-timeline-danger {
  background: #ef4444;
}

.analytics-timeline-warning {
  background: #f59e0b;
}

.analytics-timeline-info {
  background: var(--accent);
}

.analytics-timeline-neutral {
  background: #94a3b8;
}

.analytics-timeline-copy {
  display: grid;
  gap: 4px;
}

.analytics-timeline-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.analytics-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(135, 155, 186, 0.18);
}

.analytics-status-danger {
  color: #ffb1b1;
  background: rgba(239, 68, 68, 0.12);
}

.analytics-status-warning {
  color: #ffd797;
  background: rgba(245, 158, 11, 0.12);
}

.analytics-status-success {
  color: #a7f3d0;
  background: rgba(61, 220, 151, 0.12);
}

.analytics-status-info {
  color: color-mix(in srgb, var(--accent) 42%, white);
  background: rgba(var(--accent-rgb), 0.12);
}

.analytics-status-neutral {
  color: #d3dae6;
  background: rgba(148, 163, 184, 0.12);
}

.analytics-task-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.analytics-task-toolbar .muted {
  color: var(--muted);
}

.analytics-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(135, 155, 186, 0.18);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.analytics-table th,
.analytics-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(135, 155, 186, 0.14);
  vertical-align: middle;
}

.analytics-table th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.analytics-report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.analytics-report-summary {
  display: grid;
  gap: 10px;
}

.analytics-report-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.analytics-report-row span {
  color: #dce5f4;
  font-weight: 700;
}

.analytics-report-row small {
  color: var(--muted);
}

.analytics-alert-feed {
  display: grid;
  gap: 10px;
}

.analytics-alert-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(135, 155, 186, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-alert-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.analytics-alert-thumb-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(245, 158, 11, 0.55));
}

.analytics-alert-thumb-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.85), rgba(255, 255, 255, 0.12));
}

.analytics-alert-thumb-success {
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.85), rgba(var(--accent-rgb), 0.45));
}

.analytics-alert-thumb-info {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-2-rgb), 0.45));
}

.analytics-alert-copy {
  display: grid;
  gap: 5px;
}

.analytics-alert-copy span {
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.4;
}

.analytics-alert-copy small {
  color: #d9e3f2;
  line-height: 1.45;
}

.analytics-alert-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.analytics-summary-item {
  min-height: 94px;
}

.analytics-summary-item small {
  color: var(--muted);
  line-height: 1.35;
}

.analytics-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(135, 155, 186, 0.24);
  background: rgba(8, 12, 18, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}

.analytics-tooltip.hidden {
  display: none;
}

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

.analytics-card-head {
  margin-bottom: 10px;
}

.analytics-card-head small {
  line-height: 1.45;
}

.analytics-donut-label {
  text-align: center;
}

.analytics-donut-label strong {
  font-size: 2rem;
}

.analytics-facility-list .analytics-bar-row,
.analytics-bar-stack .analytics-bar-row,
.analytics-bars-tight .analytics-bar-row {
  padding-block: 8px;
}

.analytics-facility-list .analytics-bar-label,
.analytics-bar-stack .analytics-bar-label,
.analytics-bars-tight .analytics-bar-label {
  align-items: baseline;
}

@media (max-width: 1320px) {

  .analytics-header-card,
  .analytics-content-grid {
    grid-template-columns: 1fr;
  }

  .analytics-side-column {
    position: static;
  }
}

@media (max-width: 1080px) {

  .analytics-kpi-grid,
  .analytics-filter-group,
  .analytics-header-metas,
  .analytics-grid-two,
  .analytics-metrics-row,
  .analytics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {

  .analytics-kpi-grid,
  .analytics-filter-group,
  .analytics-header-metas,
  .analytics-grid-two,
  .analytics-metrics-row,
  .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-task-toolbar,
  .analytics-section-head,
  .analytics-alert-topline {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-timeline-row {
    grid-template-columns: 48px 10px minmax(0, 1fr);
  }

  .analytics-timeline-row .analytics-status-chip {
    grid-column: 3;
    justify-self: start;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1400px) {
  .hero-row {
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .topbar {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .studio-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .workspace {
    grid-column: 1;
  }

  .alerts-rail {
    grid-column: 2;
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1024px) {
  .hero-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    grid-column: auto;
    grid-row: auto;
  }

  .brand-block {
    grid-template-columns: 1fr;
  }

  .brand-assets-layout {
    grid-template-columns: 1fr;
  }

  .hero-row {
    margin-bottom: 14px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
    grid-column: auto;
    grid-row: auto;
  }

  .workspace {
    grid-column: auto;
  }

  .sidebar,
  .alerts-rail {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar-brand-logo {
    width: 100%;
  }

  .alerts-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 12px, 100vw);
    padding-top: 6px;
  }

  .hero-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .brand-block {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .sidebar-brand-logo {
    width: 100%;
  }

  .brand-assets-shell {
    min-width: 0;
    min-height: 0;
  }

  .workspace {
    grid-column: auto;
  }

  .brand-assets-form {
    grid-template-columns: 1fr;
  }

  .brand-assets-form .button {
    width: 100%;
  }

  .brand-assets-gallery .video-card {
    min-width: 280px;
    max-width: 280px;
    width: 280px;
    flex-basis: 280px;
  }

  .topbar,
  .dock-panel {
    border-radius: 20px;
  }

  .panel-head,
  .card,
  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .frame-card {
    flex-basis: 160px;
    min-width: 160px;
  }
}
