/* Review. Desktop-first, unlike capture: this is a lot of text editing, and it
   is done sitting down. It collapses to one column on a phone so a page can be
   checked from the same device it was shot on, but that is the fallback. */

body.review { max-width: none; }

header .spacer { flex: 1; }
header a.link { color: var(--muted); font-size: .9rem; }
header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
button.danger { color: var(--bad); }

/* ---------- queue ---------- */

.list { max-width: 60rem; padding: 0 .8rem 3rem; }
.list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 14rem) 9rem;
  gap: .9rem;
  align-items: baseline;
  padding: .75rem .2rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.list-item .count { text-align: right; white-space: nowrap; }
.list-item:hover { background: var(--panel); }
.list-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bad { color: var(--bad); }

.badge {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.high { color: var(--good); border-color: var(--good); }
.badge.low { color: var(--bad); border-color: var(--bad); }

/* ---------- editor ---------- */

.columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
  padding: 1rem .9rem 4rem;
  align-items: start;
}
.fields { min-width: 0; }
.columns.no-transcript { grid-template-columns: minmax(0, 1fr); }
.columns.no-transcript .transcript { display: none; }

.transcript { position: sticky; top: 1rem; min-width: 0; }
.transcript pre {
  margin: .6rem 0 0;
  padding: .9rem;
  max-height: 76vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: .82rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 1.6rem 0 .6rem;
  scroll-margin-top: 1rem;
}
.fields section:first-of-type h2 { margin-top: 0; }

/* ---------- issues ---------- */

.issues { margin-bottom: 1.4rem; }
.issues h2 { margin-top: 0; color: var(--bad); }
.issues .clear { color: var(--good); font-size: .9rem; margin: 0; }

.issue {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: .6rem;
  align-items: baseline;
  padding: .45rem .6rem;
  border-left: 2px solid var(--bad);
  background: var(--panel);
  border-radius: 0 6px 6px 0;
  margin-bottom: .3rem;
  font-size: .88rem;
  cursor: pointer;
}
/* The model's own uncertainty and a code-side lint failure want different
   responses from a reviewer, so they do not look alike. */
.issue.validator { border-left-color: var(--accent); }
.issue code { color: var(--accent); font-size: .8rem; }
.issue .origin { color: var(--muted); font-size: .72rem; text-transform: uppercase; }

/* ---------- fields ---------- */

.field { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.field > span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field.narrow { flex: 0 0 6.5rem; }
.field.inline { flex-direction: row; align-items: center; justify-content: flex-start; gap: .4rem; margin: .45rem 0; }
/* The full-width rule below is for text fields; a checkbox has to keep its own
   size or the label beside it is pushed off the row. */
.field.inline input { flex: 0 0 auto; width: auto; }
.field.inline > span { flex: 0 0 auto; }

.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .4rem .55rem;
  font-size: .92rem;
}
.field textarea { resize: vertical; overflow: hidden; line-height: 1.45; }
.field input:focus, .field textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.row { display: flex; gap: .5rem; align-items: flex-end; margin-bottom: .4rem; }
.row-controls { display: flex; flex: 0 0 auto; }
.row-controls button { padding: .3rem .25rem; text-decoration: none; font-size: .95rem; }

.add { background: none; border: 1px dashed var(--line); color: var(--muted); font-size: .85rem; padding: .4rem .8rem; }

/* ---------- ingredients ---------- */

.ingredient {
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: .5rem;
}
/* The printed line is the only thing left to check the split against, so it
   reads as the source it is rather than as another editable field. */
.ingredient .raw {
  margin: 0 0 .45rem;
  font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  scroll-margin-top: 1rem;
}
.ingredient.flagged { border-color: var(--bad); }
.ingredient .toggle {
  padding: .25rem .7rem;
  min-height: 1.9rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: .78rem;
}
/* Offset from the card so a long list reads as rows with attachments rather
   than as one field of controls. */
.ingredient .more {
  display: none;
  margin-top: .4rem;
  padding: .55rem .6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.ingredient.open .more { display: block; }
/* The panel behind them is the field fill everywhere else, so they take the
   page background to stay distinct. */
.ingredient .more input,
.ingredient .more textarea,
.ingredient .more select { background: var(--bg); }
.ingredient.open .toggle { color: var(--accent); border-color: var(--accent); }
.alternative { padding-left: 1rem; border-left: 2px solid var(--line); }

.step { align-items: flex-start; }
.step-number { flex: 0 0 1.4rem; color: var(--muted); font-size: .8rem; padding-top: .5rem; }

/* Set by the issue queue, so a flagged field is findable without reading the
   list first. */
.flagged input, .flagged textarea, .flagged select { border-color: var(--bad); }

@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
  /* The transcription leads on a phone: the fields below are only meaningful
     read against it, and there is no second column to put it in. */
  .transcript { position: static; order: -1; }
  .transcript pre { max-height: 40vh; }

  header { flex-wrap: wrap; }
  header .spacer { display: none; }
  /* Book and confidence are already on the queue row that got here. */
  #editor-meta { display: none; }
  #editor-title { flex: 1 0 100%; }

  .list-item { grid-template-columns: auto minmax(0, 1fr); }
  .list-item .muted { grid-column: 1 / -1; text-align: left; }
  .row { flex-wrap: wrap; }
  .field.narrow { flex: 1 0 5.5rem; }
}
