/* Forte rebrand palette: crimson → coral gradient, cyan arcs, soft pink surfaces. */
:root {
  font-family:
    "Open Sans",
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #2a1621;
  background: #fbf4f6;
  --accent: #a8194f;
  --accent-deep: #7d0c37;
  --accent-soft: #fbe8ee;
  --coral: #f4917f;
  --cyan: #00c8f0;
  --cyan-soft: #e3f8fd;
  --muted: #7b6870;
  --border: #f0dfe5;
  --surface: #ffffff;
  --shadow: 0 1px 2px rgba(125, 12, 55, 0.04), 0 8px 24px rgba(125, 12, 55, 0.06);
  --brand-gradient: linear-gradient(135deg, #8e0f3f 0%, #c23a62 52%, #f4917f 100%);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: #fbf4f6;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--cyan);
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
}
/* Slim brand bar: the Forte gradient and cyan arcs, without a column of empty space. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--brand-gradient);
  background-color: #8e0f3f;
  color: white;
  overflow: visible;
  isolation: isolate;
  box-shadow: 0 6px 24px rgba(125, 12, 55, 0.18);
}
/* Arcs live in their own clipped layer so they never widen the page or cover content;
   the bar itself stays overflow-visible for the history dropdown. */
.topbar-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.topbar-art::before,
.topbar-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 14px solid var(--cyan);
  pointer-events: none;
}
.topbar-art::before {
  width: 150px;
  height: 46px;
  top: -14px;
  left: -60px;
  border-radius: 0 0 44px 0;
  border-top: 0;
  border-left: 0;
}
.topbar-art::after {
  width: 120px;
  height: 46px;
  bottom: -14px;
  right: -30px;
  border-radius: 44px 0 0 0;
  border-bottom: 0;
  border-right: 0;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 92px;
  height: auto;
}
.brand-product {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}
.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav {
  border: 0;
  padding: 9px 15px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: none;
  color: white;
}
.nav:hover,
.nav.open {
  background: rgba(255, 255, 255, 0.16);
}
.nav.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(80, 0, 30, 0.2);
}
.history-menu {
  position: relative;
}
.history {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 320px;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(80, 0, 30, 0.22);
}
.history:empty::after {
  content: "Пока нет проверок";
  display: block;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
}
.history button {
  border: 0;
  background: none;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
  border-radius: 10px;
  color: var(--accent-deep);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.history button:hover {
  background: var(--accent-soft);
}
.history small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 32px 24px;
}
.page-header {
  margin-bottom: 28px;
}
.lead {
  max-width: 640px;
  margin: 10px 0 0;
  font-size: 15px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--accent);
}
h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 8px 0 0;
  color: var(--accent-deep);
}
h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: var(--accent-deep);
}
h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0 0 8px;
}
p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.badge {
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 99px;
  color: var(--accent);
}
.connection {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 30px;
}
.connection.notice-only label,
.connection.notice-only input,
.connection.notice-only button {
  display: none;
}
.connection label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent-deep);
}
.connection input {
  min-width: 0;
  max-width: 350px;
  flex: 1;
  border: 1px solid var(--border);
  background: #fdf8fa;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}
.connection span {
  font-size: 11px;
  color: var(--muted);
}
.secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.secondary:hover {
  background: var(--accent-soft);
}
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 240px;
  background: var(--surface);
  border: 2px dashed #e6c3cf;
  border-radius: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: 0.15s;
}
.dropzone:hover,
.dropzone.drag {
  background: #fff7fa;
  border-color: var(--accent);
}
.upload-symbol {
  font-size: 26px;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--brand-gradient);
  text-align: center;
  line-height: 54px;
  box-shadow: 0 8px 20px rgba(168, 25, 79, 0.28);
}
.dropzone strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
}
.dropzone > span:last-of-type {
  font-size: 12px;
  color: var(--muted);
}
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  gap: 20px;
}
.submit-row p {
  font-size: 12px;
}
.primary {
  border: 0;
  background: var(--accent);
  color: white;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(168, 25, 79, 0.25);
  transition: background 0.15s;
}
.primary:hover {
  background: var(--accent-deep);
}
.primary span {
  padding-left: 26px;
}
.primary:disabled {
  opacity: 0.5;
  cursor: wait;
}
.card {
  background: var(--surface);
  border: 0;
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 24px;
  margin: 20px 0;
}
.card ul {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  padding-left: 20px;
}
.section-heading,
.job-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.section-heading p {
  font-size: 12px;
  margin: 3px 0;
}
.section-heading > span {
  font-size: 12px;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
select {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.progress {
  background: var(--accent-soft);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin: 18px 0 24px;
}
.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--coral));
  border-radius: 99px;
  transition: width 0.3s;
}
.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.pipeline span {
  padding: 5px 10px;
  border-radius: 99px;
  background: #f7eef1;
}
.pipeline .done {
  color: #0a6f87;
  background: var(--cyan-soft);
}
.pipeline .current {
  color: white;
  background: var(--accent);
  font-weight: 700;
}
.error {
  border: 0;
  background: #fff0f2;
  color: var(--accent-deep);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 14px;
}
.verdict {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 24px;
  padding: 26px 30px;
  background: var(--brand-gradient);
  color: white;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.verdict::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 90px;
  right: -40px;
  bottom: -36px;
  border: 22px solid var(--cyan);
  border-right: 0;
  border-bottom: 0;
  border-radius: 64px 0 0 0;
}
.verdict.clear {
  background: var(--cyan-soft);
  color: #075b70;
}
.verdict small {
  font-weight: 400;
  display: block;
  font-size: 13px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.86);
}
.verdict.clear small {
  color: #3f7484;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0;
}
.metric {
  padding: 18px 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 20px;
}
.metric strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--accent-deep);
}
.metric span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  background: #f3e4ea;
  border-radius: 16px;
  margin: 28px 0 22px;
  overflow: auto;
}
.tab {
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(125, 12, 55, 0.1);
}
.finding {
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  border-radius: 22px;
  margin: 18px 0;
}
.finding-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.timestamp {
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  border-radius: 99px;
  font-size: 12px;
  padding: 6px 11px;
  font-weight: 700;
  white-space: nowrap;
}
.timestamp:hover {
  background: var(--accent);
  color: white;
}
.finding h3 {
  margin: 0;
  color: var(--accent-deep);
}
.finding .source {
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
}
.evidence {
  display: flex;
  gap: 12px;
  overflow: auto;
  margin: 18px 0;
}
.evidence figure {
  margin: 0;
  min-width: 140px;
  width: 180px;
}
.evidence img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #f6eef1;
  border-radius: 14px;
}
.evidence figcaption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.finding video {
  width: 300px;
  max-width: 100%;
  max-height: 360px;
  background: #1d0b13;
  border-radius: 14px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin-top: 15px;
}
td,
th {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
}
tbody tr:hover {
  background: #fdf6f8;
}
td button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
details summary {
  cursor: pointer;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}
details ul {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  padding-left: 20px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.7;
  max-height: 500px;
  overflow: auto;
  background: #fbf4f6;
  padding: 15px;
  border-radius: 14px;
}
#object-canvas {
  display: block;
  max-width: 100%;
  max-height: 500px;
  margin: 12px auto;
  border-radius: 14px;
}
#frame-slider {
  width: 75%;
  accent-color: var(--accent);
}
#frame-label {
  font-size: 12px;
}
.job-heading p {
  font-size: 12px;
  margin: 0;
}
.empty {
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 20px;
  color: var(--muted);
  font-size: 14px;
}
footer {
  display: flex;
  justify-content: space-between;
  margin-top: 55px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.hidden {
  display: none !important;
}
@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .connection {
    flex-wrap: wrap;
  }
  .connection input {
    max-width: none;
  }
}
@media (max-width: 600px) {
  .topbar-art {
    display: none; /* arcs would cover the logo and the buttons on a narrow bar */
  }
  .topbar-inner {
    padding: 10px 16px;
  }
  .brand-logo {
    width: 76px;
  }
  .brand-product {
    display: none;
  }
  .nav {
    padding: 8px 11px;
    font-size: 12px;
  }
  .history {
    width: min(320px, calc(100vw - 32px));
  }
  main {
    padding: 28px 16px;
  }
  h1 {
    font-size: 24px;
  }
  .submit-row {
    align-items: stretch;
    flex-direction: column;
  }
  .connection {
    margin-bottom: 25px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 13px;
  }
  .section-heading {
    align-items: flex-start;
  }
  footer {
    gap: 20px;
  }
}

#source-player {
  width: 320px;
  max-width: 100%;
  max-height: 420px;
  background: #1d0b13;
  border-radius: 14px;
}

.benchmark-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.benchmark-status {
  color: var(--muted);
  font-size: 13px;
}
#benchmark-view .card {
  margin-bottom: 20px;
}
.outcome {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #f4ecef;
}
.outcome-TP,
.outcome-TN {
  background: var(--cyan-soft);
  color: #075b70;
}
.outcome-FN,
.outcome-FP,
.outcome-failed {
  background: var(--accent-soft);
  color: var(--accent);
}
.state-crop {
  display: inline-block;
  vertical-align: top;
  margin: 0 6px 6px 0;
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  background: #1d0b13;
}
#states-table table + table {
  margin-top: 18px;
}
