.qps-anpr-app {
  --qps-bg: #f7f8fa;
  --qps-panel: #ffffff;
  --qps-text: #17202a;
  --qps-muted: #667085;
  --qps-line: #d9dee7;
  --qps-accent: #0f766e;
  --qps-accent-strong: #115e59;
  --qps-warn: #b45309;
  color: var(--qps-text);
  font-family: inherit;
}

.qps-shell {
  background: var(--qps-bg);
  border: 1px solid var(--qps-line);
  border-radius: 8px;
  padding: 18px;
}

.qps-header {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qps-title {
  font-size: 24px;
  font-weight: 700;
}

.qps-subtitle,
.qps-stat-label,
.qps-meta,
.qps-time,
.qps-camera {
  color: var(--qps-muted);
}

.qps-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.qps-stat {
  background: var(--qps-panel);
  border: 1px solid var(--qps-line);
  border-radius: 8px;
  min-height: 82px;
  padding: 14px;
}

.qps-stat-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.qps-stat-value {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.qps-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.3fr repeat(4, minmax(120px, 1fr)) auto auto;
  margin-bottom: 16px;
}

.qps-filters input,
.qps-filters button,
.qps-load-more {
  border: 1px solid var(--qps-line);
  border-radius: 6px;
  font: inherit;
  min-height: 42px;
  padding: 8px 10px;
}

.qps-filters input {
  background: #fff;
  color: var(--qps-text);
  min-width: 0;
}

.qps-filters button,
.qps-load-more {
  background: var(--qps-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.qps-filters button[data-action="clear"],
.qps-load-more {
  background: #fff;
  color: var(--qps-text);
}

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

.qps-event {
  align-items: center;
  background: var(--qps-panel);
  border: 1px solid var(--qps-line);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 16px;
  grid-template-columns: 160px minmax(0, 1fr) minmax(84px, auto);
  min-height: 120px;
  padding: 10px;
  text-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 100%;
}

.qps-event:hover,
.qps-event:focus {
  border-color: var(--qps-accent);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.12);
  outline: 0;
  transform: translateY(-1px);
}

.qps-event-media {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #e8edf3;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.qps-event-media img,
.qps-modal-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.qps-no-image {
  color: var(--qps-muted);
  font-size: 13px;
}

.qps-plate {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.qps-time {
  font-size: 15px;
  margin-top: 8px;
}

.qps-meta {
  font-size: 14px;
  margin-top: 8px;
}

.qps-event-aside {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qps-confidence {
  background: rgba(15, 118, 110, 0.11);
  border-radius: 999px;
  color: var(--qps-accent-strong);
  font-weight: 750;
  padding: 6px 10px;
}

.qps-empty {
  background: var(--qps-panel);
  border: 1px dashed var(--qps-line);
  border-radius: 8px;
  color: var(--qps-muted);
  padding: 28px;
  text-align: center;
}

.qps-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.qps-modal-overlay {
  align-items: center;
  background: rgba(17, 24, 39, 0.65);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 999999;
}

.qps-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  max-height: min(880px, 92vh);
  max-width: 920px;
  overflow: auto;
  padding: 22px;
  position: relative;
  width: min(920px, 100%);
}

.qps-modal h2 {
  font-size: 30px;
  margin: 0 42px 16px 0;
  overflow-wrap: anywhere;
}

.qps-modal-media {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.qps-modal-media img {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
}

.qps-modal-close {
  background: #fff;
  border: 1px solid var(--qps-line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  height: 36px;
  line-height: 1;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
}

.qps-details {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0 0 18px;
}

.qps-details dt {
  color: var(--qps-muted);
  font-weight: 650;
}

.qps-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.qps-metadata {
  background: #111827;
  border-radius: 6px;
  color: #f9fafb;
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.qps-muted {
  opacity: 0.65;
}

[dir="rtl"] .qps-modal h2 {
  margin-left: 42px;
  margin-right: 0;
}

[dir="rtl"] .qps-modal-close {
  left: 16px;
  right: auto;
}

@media (max-width: 900px) {
  .qps-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .qps-filters button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .qps-shell {
    padding: 12px;
  }

  .qps-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .qps-stats,
  .qps-filters {
    grid-template-columns: 1fr;
  }

  .qps-event {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .qps-event-aside {
    align-items: flex-start;
    grid-column: 2;
  }

  .qps-plate {
    font-size: 24px;
  }

  .qps-details {
    grid-template-columns: 1fr;
  }
}

