/* Review: the document bar, the two pages, the legend and the segment panel. */

.review-bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
  padding: 14px var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.review-title {
  flex: 1;
  min-width: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 13px;
  text-decoration: none;
}

.review-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 2px;
}

.review-title-row h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.review-title-row .status {
  font-size: 13px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager-pages {
  display: flex;
  gap: 4px;
  margin: 0 4px;
  padding: 4px 4px;
  list-style: none;
}

.pager-page {
  position: relative;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.pager-page:hover {
  background: var(--color-sunken);
}

.pager-page.is-current {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.pager-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-attention);
}

.pager-gap {
  display: grid;
  place-items: center;
  min-width: 16px;
  color: var(--color-muted);
}

.review-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.button.attention-button {
  height: 34px;
  padding: 0 10px;
  border-color: var(--color-warn-border);
  background: #fdf7ec;
  color: var(--color-warn-text);
  font-size: 13px;
}

.button.attention-button:hover {
  background: var(--color-warn-bg);
  color: var(--color-warn-text);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 28px;
  align-items: start;
}

.review-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.review-pages figure {
  margin: 0;
}

.review-pages figcaption {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  color: var(--color-text-2);
  font-size: 13px;
  font-weight: 500;
}

.rendering-note {
  color: var(--color-accent);
}

.is-rendering .page {
  opacity: 0.45;
  transition: opacity 0.15s;
}

.legend {
  margin-top: var(--space-3);
  padding: var(--space-3) 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.legend ol {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.legend li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
}

.legend-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-marker);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}

/* Segment panel */

.segment-panel {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.segment-panel-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.segment-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.segment-panel-list {
  flex: 1;
  overflow: auto;
  padding: var(--space-3);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.card:hover {
  border-color: #c3c9d0;
}

.card.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: var(--space-3) 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: 12.5px;
}

.card-meta .mono {
  color: var(--color-text-2);
}

.card-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-preview.is-missing {
  color: var(--color-danger-text);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 14px 14px;
}

.card-body .field {
  max-width: none;
  gap: 4px;
}

.field-label {
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
}

.card-body .field label.field-label {
  font-weight: 500;
}

.source-text {
  color: var(--color-text-2);
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: var(--space-8) var(--space-4);
  color: var(--color-ok);
  text-align: center;
}

.panel-empty p {
  color: var(--color-text);
  font-weight: 500;
}

/* Pages drawn by render-page.js: everything inside is in PDF points scaled to the page's
   width through container query units, so a page reads the same at any size. Every
   segment is a button, so it can be picked on the page. */

.page {
  position: relative;
  container-type: inline-size;
  border: 1px solid #dfe3e8;
  background: var(--color-surface);
  box-shadow: var(--shadow-page);
  overflow: hidden;
}

.page img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.page-hit,
.page-text {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.page-hit {
  background: transparent;
}

.page-hit:hover,
.page-text:hover {
  outline: 1px solid rgb(31 78 121 / 0.45);
}

.page-hit:hover {
  background: rgb(31 78 121 / 0.08);
}

.page-text {
  display: block;
  overflow: hidden;
  color: #1a1a1a;
  font-family: var(--font-page);
  line-height: var(--page-leading);
}

.page-hit.is-flagged,
.page-text.is-flagged {
  outline: 1.5px dashed var(--color-attention);
  outline-offset: 1px;
}

.page-hit.is-untranslated {
  outline-color: var(--color-danger);
  background: rgb(165 42 31 / 0.06);
}

.page-hit.is-selected,
.page-text.is-selected {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.page-hit.is-selected {
  background: rgb(31 78 121 / 0.12);
}

.page-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--color-marker);
  color: #ffffff;
  font: 600 11px/16px var(--font-ui);
  text-align: center;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transform: translate(-30%, -50%);
  cursor: pointer;
}

.page-marker.is-selected {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
