/* Studio section styles: moderation. Owned by the moderation view; tokens come from styles.css :root. */

/* The hidden attribute must win over the .btn and .actions display rules inside this view. */
.review-split [hidden],
.queue-filters [hidden] { display: none !important; }

/* ---------------------------------------------------------------- filters (the shared .filter-bar grid) */

.queue-filters { margin-bottom: 20px; }
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.filter-field label {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.filter-field select { width: 100%; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- automatic check */

.checks-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.block-title {
  margin: 0 0 8px;
  font-size: var(--fs-base);
  font-weight: 600;
}
.checks-summary {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.checks-summary.has-warn { color: var(--pending-fg); }
.review-checks-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.review-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.review-check-tag {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
}
.review-check-ok .review-check-tag { background: var(--ok-bg); color: var(--ok-fg); }
.review-check-warn .review-check-tag { background: var(--pending-bg); color: var(--pending-fg); }
.review-check-info .review-check-tag { background: var(--draft-bg); color: var(--draft-fg); }

/* ---------------------------------------------------------------- reason templates */

.templates { margin-bottom: 14px; }
.templates .hint { margin: 0; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.chip-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.chip-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------------------------------------------------------------- queue column extras */

.history { margin-top: 28px; }
.history .section-title { margin-bottom: 4px; }
.history .hint { margin: 0 0 10px; }
.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-item {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.history-title {
  margin: 6px 0 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.history-item .meta {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.kbd-toggle { margin-top: 24px; }
.kbd-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.kbd-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kbd-list dt,
.kbd-list dd { margin: 0; }
.kbd-list kbd {
  display: inline-block;
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font: 600 var(--fs-xs) var(--font);
  text-align: center;
}

/* ---------------------------------------------------------------- long text and the sticky top bar */

/* Long unbroken words (a Russian title can be one word) wrap inside the card instead of pushing it wider. */
.review-split > *,
.queue-col,
.review-pane,
.review-card,
.review-media,
.review-info,
.queue-list,
.queue-list li { min-width: 0; }
.review-title,
.review-info .meta,
.review-info .fact-list dd,
.queue-title,
.history-title { overflow-wrap: anywhere; }

/* The sticky top bar covers the top of the page: a list item or card brought into view stops below it. */
.queue-item,
.review-card,
.review-title,
.reject-form { scroll-margin-top: 88px; }

.review-title { text-wrap: balance; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1023px) {
  /* Phones: the queue strip and the review card come first; history and the key list follow the card. */
  .review-split { gap: 16px; }
  .queue-col { display: contents; }
  .history,
  .kbd-toggle,
  .kbd-list { order: 10; }
  .history { margin-top: 8px; }
}

@media (max-width: 699px) {
  .queue-filters { margin-bottom: 16px; }
  .filter-actions { width: 100%; }
  .review-check-tag { min-width: 68px; }
  /* The queue strip scrolls sideways: items snap to the edge, so the cut-off one reads as a scroller. */
  .queue-list { scroll-snap-type: x proximity; scroll-padding-inline: 0; max-width: 100%; }
  .queue-list > li { scroll-snap-align: start; }
}

@media (pointer: coarse) {
  .chip-btn { min-height: var(--hit); }
  /* The key list is hidden on touch, so its toggle is hidden too (it would change nothing). */
  .kbd-toggle,
  .kbd-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chip-btn { transition: none; }
}
