.label-page {
  min-height: 100vh;
  padding-bottom: 2rem;
}

.label-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.label-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.label-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0.2rem 0 0.4rem;
}

.label-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-chip {
  min-width: 4.5rem;
  padding: 0.55rem 0.75rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  text-align: center;
  box-shadow: 3px 3px 0 rgba(43, 33, 64, 0.12);
}

.stat-chip span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.stat-chip small {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.stat-chip.squirrel {
  background: #ffe0c8;
}
.stat-chip.bird {
  background: #d8f0ff;
}
.stat-chip.empty {
  background: #ececec;
}

.label-workspace {
  display: grid;
  grid-template-columns: 1.4fr 0.75fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .label-workspace {
    grid-template-columns: 1fr;
  }
}

.label-stage {
  padding: 0.75rem;
  position: relative;
}

.label-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.label-meta-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.view-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.view-badge.zoom {
  background: #ffe0c8;
}

.register-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #ececec;
  color: var(--ink);
}

.register-badge.none {
  background: #ececec;
  color: var(--ink-soft);
  text-transform: lowercase;
}

.register-badge.squirrel {
  background: #ffe0c8;
}

.register-badge.bird {
  background: #d8f0ff;
}

.register-badge.empty {
  background: #e0e0e0;
}

.suggest-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 2px dashed var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
}

.suggest-badge.squirrel {
  background: #fff0e4;
  color: var(--ink);
}
.suggest-badge.bird {
  background: #eaf6ff;
  color: var(--ink);
}
.suggest-badge.empty {
  background: #f2f2f2;
  color: var(--ink);
}

.label-hint {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
}

/* Confirmed label on current frame */
.label-actions .btn[data-label].is-active {
  color: var(--ink);
  transform: translate(-1px, -2px);
  box-shadow: 8px 10px 0 rgba(43, 33, 64, 0.16);
}

.label-actions .btn[data-label="squirrel"].is-active {
  background: #ffe0c8;
  border-color: var(--ink);
}

.label-actions .btn[data-label="bird"].is-active {
  background: #d8f0ff;
  border-color: var(--ink);
}

.label-actions .btn[data-label="empty"].is-active {
  background: #e0e0e0;
  border-color: var(--ink);
}

/* Soft model suggestion (not yet accepted) */
.label-actions .btn[data-label].is-suggest {
  outline: 3px dashed rgba(43, 33, 64, 0.35);
  outline-offset: 1px;
}

.label-actions .btn[data-label="squirrel"].is-suggest {
  background: #fff6ef;
}
.label-actions .btn[data-label="bird"].is-suggest {
  background: #f3f9ff;
}
.label-actions .btn[data-label="empty"].is-suggest {
  background: #f7f7f7;
}

.label-image-wrap {
  position: relative;
  background: #1a1a22;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feeder crop fills the stage so you can see whiskers and paws */
.label-image-wrap.feeder-zoom {
  min-height: min(72vh, 640px);
}

.label-image-wrap img {
  max-width: 100%;
  max-height: min(70vh, 720px);
  width: auto;
  height: auto;
  display: none;
  object-fit: contain;
  image-rendering: auto;
}

.label-image-wrap.feeder-zoom img {
  width: 100%;
  max-height: min(78vh, 720px);
  object-fit: contain;
}

.label-image-wrap img.show {
  display: block;
}

.label-empty {
  color: #ddd;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-display);
}

.label-empty .fine {
  color: #aaa;
}

.label-empty code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.label-flash {
  position: absolute;
  inset: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.label-flash.show {
  opacity: 1;
}

.label-flash.squirrel {
  background: rgba(255, 120, 40, 0.55);
}
.label-flash.bird {
  background: rgba(60, 140, 255, 0.55);
}
.label-flash.empty {
  background: rgba(80, 80, 80, 0.55);
}
.label-flash.skip {
  background: rgba(120, 80, 180, 0.5);
}

/* Demo scorecard vs pre-labeled training set */
.demo-score {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.25rem 1.5rem;
  background: rgba(18, 16, 28, 0.92);
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  overflow: auto;
}

.demo-score[hidden] {
  display: none !important;
}

.demo-score-eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd27a;
}

.demo-score-rate {
  margin: 0.2rem 0;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1;
  font-weight: 700;
}

.demo-score-detail {
  margin: 0 0 0.5rem;
  max-width: 28ch;
  font-family: var(--font-body, var(--font-display));
  font-size: 0.95rem;
  font-weight: 600;
  color: #ddd;
}

.demo-score-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  width: min(100%, 22rem);
  text-align: left;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  max-height: 9rem;
  overflow: auto;
}

.demo-score-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-score-list li.match {
  color: #9dffb0;
}

.demo-score-list li.miss {
  color: #ffb0a0;
}

.demo-score-list li.skip {
  color: #cbb6ff;
}

.demo-score .btn {
  margin-top: 0.25rem;
}

.label-keys h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.key-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.key-list li {
  margin: 0.4rem 0;
  font-weight: 700;
}

kbd {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0.12rem 0.4rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--sun);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 rgba(43, 33, 64, 0.15);
}

.label-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.label-actions .btn {
  flex: 1 1 auto;
  min-width: 5.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
}

#statusLine {
  margin: 0.5rem 0 0;
}
