html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family: system-ui, sans-serif;
}
.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #ccc;
  overflow: hidden;
  padding: 0.75rem;
  gap: 0.75rem;
}
header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
header h1 {
  margin: 0;
  font-size: 1rem;
}
.title-row,
.upload-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.brand-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-links a {
  display: flex;
}
.brand-links img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.brand-links .iti-icon {
  height: 18px;
  margin-block: 3px;
  object-fit: cover;
  object-position: left;
}
.review-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#continue-processing {
  align-self: flex-start;
}
#help-button {
  margin-left: auto;
}
#help-dialog {
  width: min(48rem, calc(100% - 4rem));
  max-height: calc(100dvh - 4rem);
  padding: 1.25rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  line-height: 1.5;
}
#help-dialog h2 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.1rem;
}
#help-dialog h2:first-child {
  margin-top: 0;
}
#help-process {
  text-align: center;
}
#help-process svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
#help-dialog video {
  display: block;
  width: 100%;
  height: auto;
}
#help-dialog::backdrop {
  background: rgb(0 0 0 / 50%);
}
#help-dialog li + li {
  margin-top: 0.5rem;
}
#help-dialog form {
  text-align: right;
}
button,
input,
select {
  font: inherit;
}
.icon-button:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.35rem;
}
.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.status {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.activity-panel {
  display: grid;
  gap: 0.5rem;
  flex-shrink: 0;
  max-height: 35%;
  overflow: auto;
}
#review-messages,
#upload-messages {
  display: grid;
  gap: 0.5rem;
  overflow-wrap: anywhere;
}
.activity-panel p {
  margin: 0;
}
.status:empty,
#upload-messages:empty,
#review-messages:empty {
  display: none;
}
.check-progress {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.check-progress[hidden] {
  display: none;
}
.check-progress progress {
  width: 100%;
}
#pending-count {
  margin: 0;
}
.image-pane {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  background: #111;
}
.image-pane.reviewing {
  display: flex;
  overflow: hidden;
}
.selected-image {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  min-width: 0;
  container-type: size;
}
.selected-image .image-stage {
  width: min(100cqw, calc(100cqh * var(--image-ratio, 1)));
  aspect-ratio: var(--image-ratio, 1);
}
.selected-image canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.redaction-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.image-stage.drawing .redaction-overlay {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}
.text-box {
  stroke: #c51616;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  fill: rgb(197 22 22 / 24%);
}
.manual-box {
  stroke: #1676d2;
  stroke-dasharray: 5 3;
  fill: rgb(22 118 210 / 24%);
}
button[aria-pressed="true"] {
  background: #dbeafe;
}
.review-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#review-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.accept-button {
  color: #15803d;
}
.accept-button:disabled {
  color: #777;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.slider-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.slider-row output {
  flex-shrink: 0;
  min-width: 6ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ocr-muted {
  color: #777;
}
.ocr-status {
  font-size: 0.85rem;
}
.check-review {
  color: #ae2a2a;
}

.image-pane.grid-view {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr));
  gap: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.grid-image {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #111;
  overflow: hidden;
  cursor: pointer;
}
.grid-image canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.grid-image:focus-visible {
  outline: 2px solid #1676d2;
  outline-offset: -2px;
}
