@media (max-width: 980px) {
  .training-editor-layout {
    grid-template-columns: 1fr;
  }

  .annotation-image-wrap img {
    max-height: 58vh;
  }

  .exception-conflict-layout {
    grid-template-columns: 1fr;
  }

  .exception-photo-stage {
    height: 300px;
  }

  .exception-photo-meta,
  .exception-detail-grid {
    grid-template-columns: 1fr;
  }
}

.check-row,
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-auth-field {
  align-items: start;
}

.compact-auth-field > span {
  padding-top: 5px;
}

.compact-warehouse-grid {
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 6px 8px;
  align-items: start;
}

.compact-warehouse-grid label {
  min-width: 0;
  min-height: 30px;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.25;
}

.compact-warehouse-grid label:hover {
  border-color: #91caff;
  background: #f8fbff;
}

.compact-warehouse-grid input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
}

.compact-warehouse-grid span {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.compact-customer-grid label {
  min-height: 34px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #172033;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.toast[hidden],
.hidden {
  display: none !important;
}

.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: 1fr;
  background: rgba(15, 23, 42, 0.88);
}

.image-viewer-backdrop[hidden] {
  display: none;
}

.image-viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.image-viewer-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.image-viewer-toolbar h2 {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.image-viewer-toolbar .icon-button {
  width: 48px;
  height: 48px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

.image-viewer-toolbar .inline-icon {
  width: 22px;
  height: 22px;
}

.image-viewer-toolbar .icon-button:hover,
.image-viewer-actions .icon-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: grab;
}

.image-viewer-actions {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  transform: translateX(-50%);
}

.image-viewer-actions .icon-button {
  width: 48px;
  height: 48px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.image-viewer-actions .inline-icon {
  width: 22px;
  height: 22px;
}

.image-viewer-stage.dragging {
  cursor: grabbing;
}

#imageViewerImage {
  max-width: 92vw;
  max-height: calc(100vh - 150px);
  user-select: none;
  transform-origin: center center;
  transition: transform 120ms ease;
  will-change: transform;
}

@media (max-width: 640px) {
  .image-viewer-actions {
    bottom: 14px;
    gap: 8px;
    padding: 8px;
  }

  .image-viewer-actions .icon-button {
    width: 44px;
    height: 44px;
  }
}

[data-image-viewer-src] {
  cursor: zoom-in;
}
