body {
  background: #0b1220;
  color: #f3f4f6;
}

.plugin-hero {
  padding: 48px 24px;
  text-align: center;
  border-bottom: 1px solid #064e3b;
}

.plugin-label {
  color: #22c55e;
  letter-spacing: 3px;
  font-weight: bold;
  margin-bottom: 12px;
}

.plugin-hero h1 {
  color: #22c55e;
  font-size: 54px;
  margin: 0 0 18px 0;
  letter-spacing: 2px;
}

.plugin-hero p {
  max-width: 900px;
  margin: 0 auto;
  color: #d1d5db;
  line-height: 1.7;
  font-size: 18px;
}

.plugin-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.plugin-btn {
  background: #22c55e;
  color: #020617;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: bold;
}

.plugin-btn.secondary {
  background: #1f2937;
  color: #f3f4f6;
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 32px;
}

.plugin-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 22px;
}

.plugin-card.large {
  grid-column: span 2;
}

.plugin-card-title {
  color: #22c55e;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 14px;
}

.plugin-card p,
.plugin-list div,
.plugin-section p {
  color: #d1d5db;
  line-height: 1.7;
}

.plugin-list div {
  margin-bottom: 8px;
}

.plugin-section {
  margin: 10px 32px 40px 32px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 24px;
}

.plugin-section h2 {
  color: #22c55e;
}

@media (max-width: 800px) {
  .plugin-card.large {
    grid-column: span 1;
  }

  .plugin-hero h1 {
    font-size: 38px;
  }
}

.plugin-hero.compact {
  padding: 28px 20px;
}

.plugin-hero.compact h1 {
  font-size: 42px;
}

.plugin-actions button.plugin-btn {
  border: none;
  cursor: pointer;
}

.depth-palette {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  margin: 18px 20px;
  padding: 14px;
}

.depth-palette-title {
  color: #22c55e;
  font-weight: bold;
  margin-right: 8px;
}

.depth-palette button,
.vl-control-row button,
.vl-small-button {
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.depth-palette button:hover,
.vl-control-row button:hover,
.vl-small-button:hover {
  border-color: #22c55e;
}

.vl-status-box div,
.vl-parameter-box div {
  color: #d1d5db;
  line-height: 1.7;
}

.vl-param {
  border-top: 1px solid #374151;
  padding: 12px 0;
}

.vl-param:first-child {
  border-top: none;
}

.vl-param-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #f3f4f6;
}

.vl-param-header span {
  color: #22c55e;
  font-weight: bold;
}

.vl-param-desc {
  color: #9ca3af;
  font-size: 14px;
  margin: 6px 0 8px 0;
}

.vl-param input[type="range"] {
  width: 100%;
}

.vl-param-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280 !important;
}

.vl-control-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vl-help-text {
  margin-top: 12px;
  color: #9ca3af;
  line-height: 1.5;
  font-size: 14px;
}

.vl-notes-box {
  width: 100%;
  min-height: 150px;
  background: #020617;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 10px;
}

.vl-log-box {
  background: #020617;
  color: #d1d5db;
  min-height: 120px;
  border-radius: 10px;
  padding: 10px;
  overflow: auto;
}

.grid-stack-item-content {
  position: relative;
}


.vl-widget-selected .grid-stack-item-content {
  outline: 2px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

body:not(.vl-edit-mode) .grid-stack-item-content {
  cursor: default;
}

body.vl-edit-mode .grid-stack-item-content {
  cursor: move;
}

body.vl-edit-mode .depth-grid {
  outline: 1px dashed rgba(34, 197, 94, 0.5);
  outline-offset: 4px;
}

body.vl-edit-mode .depth-palette {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.vl-video-widget {
  height: calc(100% - 34px);
  min-height: 180px;
}

.vl-video-frame {
  width: 100%;
  height: calc(100% - 38px);
  min-height: 160px;
  background: #020617;
  border: 1px solid #374151;
  border-radius: 10px;
  object-fit: contain;
}

.vl-video-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: #d1d5db;
}

.vl-video-toolbar button,
.vl-video-config button {
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.vl-video-toolbar button:hover,
.vl-video-config button:hover {
  border-color: #22c55e;
}

.vl-video-empty {
  height: 100%;
  min-height: 160px;
  background: #020617;
  border: 1px dashed #374151;
  border-radius: 10px;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  text-align: center;
}

.vl-video-config {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.vl-video-config input,
.vl-video-config select {
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px;
  min-width: 220px;
}

/* Object Detection Lab */
body.vl-edit-mode .od-grid {
  outline: 1px dashed rgba(34, 197, 94, 0.5);
  outline-offset: 4px;
}

.vl-stream-reload-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
  float: right;
  padding: 0 4px;
  line-height: 1;
}

.vl-stream-reload-btn:hover {
  color: #22c55e;
}

/* Detection rows */
.od-detection-row {
  display: grid;
  grid-template-columns: 90px 36px 40px 1fr;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #1f2937;
  font-size: 13px;
  color: #d1d5db;
}

.od-label { font-weight: bold; color: #f3f4f6; text-transform: capitalize; }
.od-track { color: #9ca3af; font-size: 11px; }
.od-conf  { color: #22c55e; font-weight: bold; text-align: right; }
.od-bar   { color: #22c55e; letter-spacing: -1px; font-size: 10px; }

/* OD stream widget - flexbox fill */
.od-stream-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.od-stream-title {
  flex-shrink: 0;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.od-stream-img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
  background: #020617;
  border: 1px solid #374151;
  border-radius: 10px;
}

/* OD config widget */
.od-config-section { margin-bottom: 12px; }
.od-config-label   { color: #9ca3af; font-size: 12px; margin-bottom: 4px; }

.od-config-select {
  width: 100%;
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 6px 8px;
}

.od-config-select-sm {
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
}

.od-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.od-config-col { display: flex; flex-direction: column; }

.od-config-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #22c55e;
  font-weight: bold;
}

.od-config-slider-row input[type="range"] { flex: 1; }

.od-config-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #d1d5db;
  font-size: 13px;
}

.od-config-checks label { cursor: pointer; }

.od-config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.od-config-save-btn {
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.od-config-save-btn:hover { border-color: #22c55e; }

/* Tooltip ikon */
.od-tip {
  display: inline-block;
  color: #6b7280;
  font-size: 13px;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
}

.od-tip:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  width: 240px;
  z-index: 1000;
  pointer-events: none;
}

/* Pose Tracker edit-mode grid outline */
body.vl-edit-mode .pt-grid {
  outline: 1px dashed rgba(34, 197, 94, 0.5);
  outline-offset: 4px;
}

/* Face Recognition widgets */
.fr-grid.edit-mode .grid-stack-item { outline: 2px dashed #4af; }
.fr-face-header { display:grid; grid-template-columns:36px 1fr 48px 48px; gap:4px; font-size:0.7em; opacity:0.6; padding:2px 4px; border-bottom:1px solid #333; }
.fr-face-row { display:grid; grid-template-columns:36px 1fr 48px 48px; gap:4px; padding:3px 4px; border-bottom:1px solid #222; font-size:0.82em; align-items:center; }
.fr-face-id { color:#888; font-size:0.85em; }
.fr-face-name { font-weight:600; }
.fr-known { color:#4af; }
.fr-unknown { color:#f84; }
.fr-face-conf { color:#aaa; font-size:0.85em; text-align:right; }
.fr-person-row { display:flex; align-items:center; gap:8px; padding:4px 4px; border-bottom:1px solid #222; font-size:0.85em; }
.fr-person-label { flex:1; font-weight:600; color:#4af; }
.fr-person-count { color:#888; font-size:0.8em; }
.fr-del-btn { background:#500; color:#faa; border:none; border-radius:3px; padding:2px 8px; cursor:pointer; font-size:0.78em; }
.fr-del-btn:hover { background:#800; }
.fr-enroll-body { padding:4px 8px; display:flex; flex-direction:column; gap:6px; }
.fr-enroll-row { display:flex; align-items:center; gap:8px; font-size:0.85em; }
.fr-enroll-row label { width:46px; color:#aaa; }
.fr-enroll-input { flex:1; background:#1a1a1a; color:#eee; border:1px solid #444; border-radius:3px; padding:3px 6px; }
.fr-enroll-file { flex:1; font-size:0.82em; color:#aaa; }
.fr-enroll-actions { display:flex; gap:8px; }
.fr-enroll-actions button { flex:1; }
.fr-train-btn { background:#0a4; color:#fff; border:none; }
.fr-train-btn:hover { background:#0c5; }
.fr-train-persons-title { font-size:0.75em; color:#888; margin-top:4px; }
.fr-trainperson-row { display:flex; align-items:center; gap:8px; padding:2px 4px; font-size:0.82em; border-bottom:1px solid #222; }
.fr-trainperson-row span:first-child { flex:1; font-weight:600; color:#ccc; }
.fr-trainperson-row span:nth-child(2) { color:#888; font-size:0.85em; }
.fr-cpu-cores { display:flex; flex-wrap:wrap; gap:4px; font-size:0.78em; color:#aaa; }

/* ReID widgets */
.reid-grid.edit-mode .grid-stack-item { outline: 2px dashed #fa4; }
.reid-track-header { display:grid; grid-template-columns:1fr 52px 44px 44px; gap:4px; font-size:0.7em; opacity:0.6; padding:2px 4px; border-bottom:1px solid #333; }
.reid-track-row { display:grid; grid-template-columns:1fr 52px 44px 44px; gap:4px; padding:3px 4px; border-bottom:1px solid #222; font-size:0.82em; align-items:center; }
.reid-track-id { color:#ccc; font-size:0.85em; }
.reid-gid { color:#888; font-size:0.78em; font-style:italic; }
.reid-src { color:#888; font-size:0.8em; }
.reid-conf { color:#aaa; font-size:0.85em; text-align:right; }
.reid-new { color:#f84; }
.reid-match { color:#4af; }
.reid-gallery-count { font-size:1.1em; font-weight:700; color:#4af; padding:4px 8px 2px; }
.reid-gallery-row { display:flex; align-items:center; justify-content:space-between; padding:3px 8px; border-bottom:1px solid #222; font-size:0.82em; }
.reid-gallery-id { font-family:monospace; color:#ccc; }
.reid-gallery-ts { color:#888; font-size:0.8em; }
.reid-gallery-actions { padding:6px 8px 2px; }
.reid-clear-btn { background:#500; color:#faa; border:none; border-radius:3px; padding:3px 10px; cursor:pointer; font-size:0.8em; }
.reid-clear-btn:hover { background:#800; }
