/* The dictation sheet is deliberately narrow enough to read a single line aloud.
   Its colors stay legible while the surrounding workspace is dimmed. */
dialog.web-review {
  --rv-paper: #fcfbf8;
  --rv-well: #f0eeed;
  --rv-ink: #252428;
  --rv-mute: #65606b;
  --rv-rule: #d7d3d6;
  --rv-focus: #5e4bab;
  width: min(calc(100vw - 28px), 40rem);
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rv-rule);
  border-radius: 12px;
  background: var(--rv-paper);
  color: var(--rv-ink);
  box-shadow: 0 24px 80px rgb(18 17 22 / 18%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans", sans-serif;
}

.web-review::backdrop {
  background: rgb(20 19 24 / 54%);
}

.web-review .dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 17px clamp(16px, 4vw, 30px);
  border-bottom: 1px solid var(--rv-rule);
}

.web-review .dialog-heading h2 {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: clamp(19px, 3vw, 25px);
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.web-review .import-field {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 19px clamp(16px, 4vw, 30px) 0;
}

.web-review :is(.import-field label, .review-prompt) {
  color: var(--rv-mute);
  font-size: 13px;
  font-weight: 550;
}

.web-review :is(select, textarea) {
  background: var(--rv-well);
  color: var(--rv-ink);
  border: 1px solid var(--rv-rule);
  border-radius: 6px;
  font: inherit;
}

.web-review .import-field select {
  width: 100%;
  padding: 7px 10px;
  min-height: 38px;
}

.review-body {
  display: grid;
  gap: 11px;
  padding: 20px clamp(16px, 4vw, 30px) 22px;
}

.review-body :is(h3, p) { margin: 0; }
.review-body .primary { justify-self: start; }

.web-review :is(.dialog-heading button, .review-button, .primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--rv-rule);
  border-radius: 6px;
  background: transparent;
  color: var(--rv-ink);
  font: 550 13px/1.35 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

.web-review .primary {
  background: var(--rv-ink);
  border-color: var(--rv-ink);
  color: var(--rv-paper);
}

.web-review :is(.dialog-heading button, .review-button):hover:not(:disabled) {
  background: var(--rv-well);
}

.web-review :is(button, select, textarea):focus-visible {
  outline: 2px solid var(--rv-focus);
  outline-offset: 2px;
}

.web-review button:disabled { opacity: .48; }

.review-stamp {
  margin-bottom: 1px;
  color: var(--rv-mute);
  font: 500 12px/1.4 "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.review-controls, .review-paging {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.review-paging {
  justify-content: space-between;
  padding-top: 13px;
  margin-top: 3px;
  border-top: 1px solid var(--rv-rule);
}

.review-note, .review-message {
  color: var(--rv-mute);
  line-height: 1.6;
}

.review-body blockquote {
  padding: 7px 14px;
  margin: 5px 0;
  border: 0;
  border-inline-start: 2px solid var(--rv-focus);
  background: transparent;
  color: var(--rv-ink);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 550;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.review-body textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  min-height: 94px;
  line-height: 1.55;
}

.review-feedback { color: var(--rv-ink); }
.review-feedback:empty { display: none; }
.review-feedback[data-correct="true"] { color: var(--rv-focus); font-weight: 620; }
.web-review [hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
  dialog.web-review {
    color-scheme: dark;
    --rv-paper: #1c1c21;
    --rv-well: #24242a;
    --rv-ink: #f4f1ef;
    --rv-mute: #b1aeb9;
    --rv-rule: #3d3b43;
    --rv-focus: #c5b7ff;
    box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
  }
}

@media (pointer: coarse) {
  .web-review :is(.dialog-heading button, .review-button, .primary, .import-field select) { min-height: 44px; }
}
