:root {
  color-scheme: light;
  --ink: #25324b;
  --muted: #586880;
  --muted-2: #62718a;
  --line: #e5eaf3;
  --line-strong: #d4dceb;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --surface-muted: #edf1f8;
  --canvas: #f3f5fa;
  --sidebar: #17243d;
  --sidebar-soft: #223451;
  --sidebar-text: #b8c5dc;
  --sidebar-muted: #91a3c0;
  --primary: #4f5ed7;
  --primary-rgb: 79, 94, 215;
  --primary-deep: #3e4cb9;
  --primary-pale: #edf0ff;
  --primary-line: #d8defa;
  --violet: #7a5bc2;
  --violet-pale: #f2eefb;
  --cyan: #287e9c;
  --cyan-pale: #eaf5fa;
  --success: #247c64;
  --success-pale: #eaf6f0;
  --success-line: #cce8db;
  --amber: #9a681e;
  --amber-pale: #fcf4e6;
  --coral: #b34d5b;
  --coral-pale: #fff0f2;
  --coral-line: #f0d0d7;
  --shadow: 0 4px 20px rgba(35, 50, 83, 0.045);
  --focus: rgba(79, 94, 215, 0.28);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
video {
  max-width: 100%;
  display: block;
}
i[data-lucide],
svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
  flex: none;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 244px;
  background: linear-gradient(180deg, #1c2b48 0%, var(--sidebar) 75%);
  color: #eef3fc;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 5px 34px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #7583ee, var(--primary));
  color: var(--surface);
  box-shadow: 0 5px 16px rgba(13, 21, 48, 0.22);
}
.brand-mark svg {
  width: 22px;
  height: 22px;
}
.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.brand small {
  display: block;
  color: var(--sidebar-muted);
  font-size: 12px;
  margin-top: 1px;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}
.nav-caption {
  font-size: 11px;
  color: var(--sidebar-muted);
  letter-spacing: 1px;
  padding: 5px 14px 10px;
}
.nav-caption-secondary {
  padding-top: 27px;
}
.nav-item {
  position: relative;
  min-height: 46px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav-item:hover {
  background: var(--sidebar-soft);
  color: var(--surface);
}
.nav-item.is-active {
  background: #344581;
  color: var(--surface);
  border-color: rgba(167, 184, 255, 0.16);
  box-shadow: 0 3px 10px rgba(7, 15, 35, 0.12);
  font-weight: 600;
}
.nav-item svg {
  width: 17px;
  height: 17px;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #2e405e;
  padding: 17px 13px 2px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}
.sidebar-footer strong {
  font-size: 12px;
}
.sidebar-footer small {
  font-size: 12px;
  color: var(--sidebar-muted);
}
.sidebar-status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--sidebar-muted);
}
.sidebar-status-dot.is-online {
  background: #6dd8b6;
  box-shadow: 0 0 0 4px rgba(109, 216, 182, 0.14);
}
.sidebar-status-dot.is-offline {
  background: #f19ca8;
}
.sidebar-scrim {
  display: none;
}
.workspace {
  min-width: 0;
  margin-left: 244px;
  min-height: 100vh;
}
.topbar {
  min-height: 82px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.topbar-title {
  min-width: 0;
}
.topbar-title .eyebrow {
  font-size: 12px;
  color: var(--muted);
  display: block;
  line-height: 1.25;
}
.topbar h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 11px;
  align-items: center;
}
.service-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--success-line);
  border-radius: 99px;
  background: var(--success-pale);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.service-pill.is-offline {
  border-color: var(--coral-line);
  background: var(--coral-pale);
  color: var(--coral);
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.icon-button {
  height: 38px;
  width: 38px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.icon-button:hover {
  border-color: var(--primary-line);
  color: var(--primary);
}
.mobile-menu {
  display: none;
}
.content {
  max-width: 1620px;
  margin: 0 auto;
  padding: 32px 36px 52px;
}
.view {
  display: none;
}
.view.is-active {
  display: block;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
}
.section-heading h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: -0.5px;
  font-weight: 650;
}
.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.updated-at,
.result-time {
  color: var(--muted-2);
  font-size: 12px;
}
.global-notice {
  margin: 0 0 20px;
  padding: 12px 15px;
  background: var(--coral-pale);
  color: var(--coral);
  border: 1px solid var(--coral-line);
  border-radius: 10px;
}
.global-notice.is-info {
  background: var(--primary-pale);
  color: var(--primary-deep);
  border-color: var(--primary-line);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.metric {
  min-width: 0;
  min-height: 148px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label icon" "value icon" "note note";
  align-items: start;
  column-gap: 10px;
  row-gap: 5px;
}
.metric-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.metric-icon svg {
  width: 17px;
  height: 17px;
}
.tone-blue {
  background: var(--primary-pale);
  color: var(--primary);
}
.tone-slate {
  background: var(--surface-muted);
  color: var(--muted);
}
.metric-label {
  grid-area: label;
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  grid-area: value;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.8px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.metric small {
  grid-area: note;
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 7px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 22px;
  margin-bottom: 22px;
}
.overview-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 22px;
}
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-heading {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.panel-heading > svg {
  color: var(--muted-2);
  width: 17px;
  height: 17px;
}
.panel-body {
  padding: 22px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 88px;
  padding: 15px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: left;
  color: var(--ink);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.quick-action:hover {
  background: var(--primary-pale);
  border-color: var(--primary-line);
  box-shadow: 0 4px 12px rgba(79, 94, 215, 0.07);
  transform: translateY(-2px);
}
.quick-action > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.quick-action strong,
.quick-action small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-action strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.quick-action small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  white-space: normal;
  line-height: 1.6;
}
.quick-action > svg {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}
.quick-icon {
  height: 40px;
  width: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}
.quick-icon svg {
  width: 18px;
  height: 18px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
}
.text-button:hover {
  text-decoration: underline;
}
.text-button svg {
  width: 14px;
  height: 14px;
}
.recent-list {
  min-height: 224px;
  padding: 6px 0;
}
.recent-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.recent-row:last-child {
  border-bottom: 0;
}
.recent-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
  flex: none;
}
.recent-thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.recent-thumb-fallback svg {
  width: 17px;
  height: 17px;
}
.recent-row-body {
  min-width: 0;
  flex: 1;
}
.recent-row strong,
.recent-row small {
  display: block;
}
.recent-row strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-row small {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 2px;
}
.recent-count {
  color: var(--primary-deep);
  background: var(--primary-pale);
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.empty-compact {
  padding: 24px 17px;
  color: var(--muted-2);
  font-size: 13px;
}
.model-summary {
  padding: 6px 22px;
}
.summary-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.summary-row:last-child {
  border-bottom: 0;
}
.summary-row svg {
  color: var(--primary);
  width: 17px;
  height: 17px;
}
.summary-row > div {
  min-width: 0;
  flex: 1;
}
.summary-row strong,
.summary-row small {
  display: block;
}
.summary-row strong {
  font-size: 12px;
}
.summary-row small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-state {
  padding: 6px 22px;
}
.work-state > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.work-state > div:last-child {
  border-bottom: 0;
}
.work-state span {
  color: var(--muted);
  font-size: 12px;
}
.work-state strong {
  font-size: 12px;
}
.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(265px, 330px);
  gap: 18px;
  align-items: start;
}
.task-main,
.task-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.section-step {
  color: var(--muted-2);
  font-size: 12px;
}
.dropzone {
  min-height: 210px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #c8d1eb;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--surface-soft), #f1f4fd);
  color: var(--ink);
  padding: 24px;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.is-dragover {
  background: var(--primary-pale);
  border-color: var(--primary);
}
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dropzone-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-line);
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(79, 94, 215, 0.06);
  margin-bottom: 14px;
}
.dropzone-icon svg {
  width: 21px;
  height: 21px;
}
.dropzone strong {
  font-size: 14px;
  font-weight: 600;
}
.dropzone small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.compact-dropzone {
  min-height: 157px;
}
.file-selected {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.file-selected img {
  height: 42px;
  width: 55px;
  object-fit: cover;
  background: var(--surface-muted);
  border-radius: 6px;
}
.file-selected > div {
  min-width: 0;
  flex: 1;
}
.file-selected strong,
.file-selected small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-selected strong {
  font-size: 12px;
}
.file-selected small {
  font-size: 12px;
  color: var(--muted);
}
.file-selected .icon-button {
  border: 0;
}
.file-type-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--violet-pale);
  color: var(--violet);
  display: grid;
  place-items: center;
}
.form-row {
  margin: 18px 0;
}
.range-field {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
}
.range-field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.range-field output {
  color: var(--primary-deep);
  background: var(--primary-pale);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.range-field input {
  width: 100%;
  accent-color: var(--primary);
  height: 18px;
  margin: 0;
}
.form-actions,
.monitor-controls,
.result-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.primary-button,
.secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.primary-button {
  border: 1px solid var(--primary);
  color: var(--surface);
  background: var(--primary);
  box-shadow: 0 3px 8px rgba(79, 94, 215, 0.16);
}
.primary-button:hover:not(:disabled) {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  box-shadow: 0 5px 12px rgba(79, 94, 215, 0.22);
}
.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}
.secondary-button:hover:not(:disabled) {
  background: var(--primary-pale);
  border-color: var(--primary-line);
}
.primary-button svg,
.secondary-button svg {
  width: 15px;
  height: 15px;
}
.empty-result {
  min-height: 215px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted-2);
  gap: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.empty-result svg {
  width: 42px;
  height: 42px;
  padding: 8px;
  box-sizing: content-box;
  color: #8696bd;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 8px;
}
.empty-result strong {
  color: var(--muted);
  font-size: 13px;
}
.empty-result span {
  font-size: 12px;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.result-stats > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}
.result-stats > div:last-child {
  border-right: 0;
}
.result-stats span,
.result-stats strong {
  display: block;
}
.result-stats span {
  font-size: 12px;
  color: var(--muted);
}
.result-stats strong {
  font-size: 22px;
  line-height: 1.4;
  margin-top: 4px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.media-frame {
  display: grid;
  place-items: center;
  min-height: 190px;
  max-height: 620px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-muted);
}
.image-zoom-link {
  display: block;
  width: 100%;
  cursor: zoom-in;
}
.media-frame img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
}
.result-footer {
  margin-top: 13px;
  min-height: 36px;
}
.result-footer > span {
  color: var(--muted);
  font-size: 12px;
}
.field-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.side-image {
  min-height: 132px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.side-image span {
  color: var(--muted-2);
  font-size: 12px;
}
.side-image img {
  width: 100%;
  max-height: 275px;
  object-fit: contain;
}
.inline-state {
  padding: 10px 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.inline-state.is-error {
  background: var(--coral-pale);
  color: var(--coral);
}
.inline-state.is-info {
  background: var(--primary-pale);
  color: var(--primary-deep);
}
.density-inline-count {
  margin-top: 10px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
}
.density-inline-count strong {
  font-size: 18px;
  color: var(--primary-deep);
  margin-left: 5px;
}
.detail-list > div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.detail-list > div:last-child {
  border-bottom: 0;
}
.detail-list span {
  color: var(--muted);
  font-size: 12px;
}
.detail-list strong {
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 64%;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.progress-track {
  height: 7px;
  width: 100%;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 9px;
}
.progress-track > div {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.25s;
}
.progress-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.output-video {
  width: 100%;
  max-height: 560px;
  background: var(--sidebar);
  border-radius: 8px;
}
.monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(255px, 300px);
  gap: 18px;
  align-items: start;
}
.camera-stage {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 240px;
  max-height: 620px;
  background: var(--sidebar);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.camera-stage video,
.camera-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.camera-placeholder {
  color: var(--sidebar-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.camera-placeholder svg {
  width: 38px;
  height: 38px;
  margin-bottom: 5px;
}
.camera-placeholder strong {
  color: #dbe5f7;
  font-size: 13px;
}
.camera-placeholder span {
  font-size: 12px;
}
.live-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--coral);
  color: var(--surface);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
.live-tag > span {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--surface);
}
.monitor-controls {
  margin-top: 13px;
}
.settings-stack {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.field input,
.field select,
.panel-tools select {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  min-width: 0;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input::placeholder {
  color: var(--muted-2);
}
.settings-stack .field-note {
  margin: 0;
}
.live-count {
  display: grid;
  gap: 2px;
  padding: 16px;
  background: var(--primary-pale);
  border-radius: 12px;
  margin-bottom: 10px;
}
.live-count strong {
  font-size: 36px;
  line-height: 1.2;
  color: var(--primary-deep);
}
.live-count span {
  font-size: 12px;
  color: var(--muted);
}
.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.state-badge.is-ready {
  background: var(--success-pale);
  color: var(--success);
}
.state-badge.is-warn {
  background: var(--amber-pale);
  color: var(--amber);
}
.state-badge.is-error {
  background: var(--coral-pale);
  color: var(--coral);
}
.events-list {
  min-height: 80px;
  max-height: 300px;
  overflow: auto;
}
.event-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
}
.event-row:last-child {
  border: 0;
}
.event-icon {
  height: 25px;
  width: 25px;
  border-radius: 8px;
  background: var(--amber-pale);
  color: var(--amber);
  display: grid;
  place-items: center;
}
.event-icon svg {
  height: 14px;
  width: 14px;
}
.event-row > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.event-row strong {
  font-size: 12px;
}
.event-row small {
  font-size: 12px;
  color: var(--muted);
}
.density-layout {
  display: grid;
  grid-template-columns: minmax(255px, 315px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.density-results {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.density-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.density-metrics > div {
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.density-metrics span {
  font-size: 12px;
  color: var(--muted);
}
.density-metrics strong {
  font-size: 23px;
}
.density-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.density-visual {
  min-height: 200px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.density-visual > span {
  color: var(--muted-2);
  font-size: 12px;
}
.density-visual img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
}
.density-visual-grid .field-note {
  margin: 10px 0 0;
}
.method-tag {
  padding: 3px 7px;
  background: var(--surface-muted);
  color: var(--muted);
  border-radius: 8px;
  font-size: 10px;
  white-space: nowrap;
}
.method-tag-primary {
  background: var(--primary-pale);
  color: var(--primary-deep);
}
.density-grid-placeholder {
  color: var(--muted-2);
  font-size: 12px;
  padding: 20px 0;
}
.spatial-grid {
  display: grid;
  gap: 5px;
  width: min(100%, 430px);
  aspect-ratio: 1.45;
}
.spatial-cell {
  display: grid;
  place-items: center;
  min-height: 27px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: background 0.15s;
}
.spatial-cell.is-hot {
  color: var(--surface);
}
.spatial-legend {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.history-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}
.panel-tools select {
  width: auto;
  min-width: 120px;
  height: 34px;
  font-size: 12px;
}
.history-list {
  max-height: 650px;
  min-height: 260px;
  overflow: auto;
}
.history-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.history-row:hover,
.history-row.is-selected {
  background: var(--primary-pale);
}
.history-row img,
.history-row .recent-thumb-fallback {
  height: 50px;
  width: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}
.history-row > span {
  min-width: 0;
  flex: 1;
}
.history-row strong,
.history-row small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-row strong {
  font-size: 12px;
}
.history-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.history-row > svg {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}
.history-detail-panel .panel-body {
  min-height: 260px;
}
.history-detail-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: var(--surface-muted);
  border-radius: 8px;
}
.history-detail-title {
  font-weight: 700;
  margin: 0 0 12px;
}
.history-detail-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.history-detail-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.models-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.model-status-list {
  display: grid;
}
.model-status-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.model-status-item:first-child {
  padding-top: 0;
}
.model-status-item > div {
  min-width: 0;
  flex: 1;
}
.model-status-item strong,
.model-status-item small {
  display: block;
}
.model-status-item strong {
  font-size: 12px;
}
.model-status-item small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 2px;
}
.model-status-item > .state-badge {
  flex: none;
}
.model-status-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  background: var(--primary-pale);
  color: var(--primary);
  border-radius: 8px;
  flex: none;
}
.model-status-icon.tone-violet {
  background: var(--violet-pale);
  color: var(--violet);
}
#models-warning {
  margin-top: 13px;
}
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--sidebar);
  color: var(--surface);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.toast.is-error {
  background: #923e4b;
}
.toast svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
}
.inline-state {
  white-space: pre-line;
}

.tone-violet {
  background: var(--violet-pale);
  color: var(--violet);
}
.tone-cyan {
  background: var(--cyan-pale);
  color: var(--cyan);
}
.nav-item.is-active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bdc8ff;
  margin-left: auto;
  flex: none;
}
.quick-action:hover > svg {
  color: var(--primary);
}
.dropzone:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}
.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.quick-action:active {
  transform: translateY(1px);
}
.field input:hover,
.field select:hover,
.panel-tools select:hover {
  border-color: #b0bce0;
}
.recent-thumb,
.history-row img {
  border: 1px solid var(--line);
}
.panel-heading > svg {
  color: #95a3bf;
}
.quick-panel .panel-heading,
.recent-panel .panel-heading {
  border-bottom-color: transparent;
  padding-bottom: 8px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 1200px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-grid,
  .overview-lower {
    grid-template-columns: 1fr 1fr;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .density-layout {
    grid-template-columns: 275px minmax(0, 1fr);
  }
  .density-visual-grid {
    grid-template-columns: 1fr;
  }
  .density-visual {
    min-height: 170px;
  }
}
@media (max-width: 960px) {
  .sidebar {
    width: 232px;
  }
  .workspace {
    margin-left: 232px;
  }
  .content {
    padding: 23px 22px 40px;
  }
  .topbar {
    padding: 0 22px;
  }
  .overview-grid,
  .overview-lower,
  .task-layout,
  .monitor-layout,
  .history-layout,
  .models-layout {
    grid-template-columns: 1fr;
  }
  .task-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .density-layout {
    grid-template-columns: 1fr;
  }
  .density-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recent-list {
    min-height: 0;
  }
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .sidebar {
    width: min(284px, calc(100vw - 48px));
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s, visibility 0.2s;
  }
  .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar-scrim.is-open {
    position: fixed;
    inset: 0;
    background: rgba(17, 29, 52, 0.5);
    z-index: 25;
    display: block;
  }
  .workspace {
    margin-left: 0;
  }
  .topbar {
    min-height: 72px;
    padding: 0 15px;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .content {
    padding: 21px 15px 35px;
  }
  .section-heading h2 {
    font-size: 18px;
  }
  .metric-grid {
    gap: 12px;
  }
  .metric {
    min-height: 132px;
    padding: 16px;
  }
  .metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
  .primary-button,
  .secondary-button {
    min-height: 44px;
  }
  .panel-heading {
    flex-wrap: wrap;
  }
  .metric strong {
    font-size: 22px;
  }
  .overview-grid,
  .overview-lower {
    gap: 12px;
  }
  .task-side {
    grid-template-columns: 1fr;
  }
  .models-layout,
  .history-layout {
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .metric {
    grid-template-areas: "label icon" "value value" "note note";
  }
  .topbar-title .eyebrow {
    display: none;
  }
  .service-pill {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .service-pill span:last-child {
    display: none;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading p {
    font-size: 12px;
  }
  .updated-at {
    display: none;
  }
  .quick-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric small {
    font-size: 11px;
  }
  .panel-body {
    padding: 14px;
  }
  .panel-heading {
    padding: 0 14px;
  }
  .result-stats {
    gap: 5px;
  }
  .result-stats > div {
    padding: 8px;
  }
  .result-stats strong {
    font-size: 16px;
  }
  .density-visual-grid {
    grid-template-columns: 1fr;
  }
  .camera-stage {
    min-height: 185px;
  }
  .history-row {
    padding: 9px;
  }
  .history-row img,
  .history-row .recent-thumb-fallback {
    width: 52px;
    height: 43px;
  }
  .model-status-item > .state-badge {
    max-width: 75px;
    white-space: normal;
    text-align: center;
  }
}
