/*
 * review.css
 *
 * Styling for the inline review layer (highlights, side rail, selection
 * popover, compose box, login modal). Kept self-contained so it does not
 * depend on the main stylesheet's variables.
 */

:root {
  --rv-red: #c62b30;
  --rv-ink: #23262b;
  --rv-dim: #5a5f66;
  --rv-line: #d7dade;
  --rv-surface: #ffffff;
  --rv-surface2: #f4f5f6;
  --rv-hl-comment: #fff2b8;
  --rv-hl-suggestion: #ffd7d3;
}

/* Highlights inside the article. */
mark.rv-hl {
  background: var(--rv-hl-comment);
  color: inherit;
  padding: 0;
  cursor: pointer;
  border-bottom: 2px solid #e6c200;
}

mark.rv-hl.rv-suggestion {
  background: var(--rv-hl-suggestion);
  border-bottom-color: var(--rv-red);
}

mark.rv-hl.rv-active {
  outline: 2px solid var(--rv-red);
}

/* Floating launcher, bottom-right. */
.rv-launch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9000;
  background: var(--rv-red);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.rv-launch:hover {
  background: #a8242a;
}

/* Side rail. */
.rv-rail {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: var(--rv-surface);
  border-left: 1px solid var(--rv-line);
  z-index: 9001;
  display: none;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
}

body.rv-open .rv-rail {
  display: flex;
}

@media (min-width: 1200px) {
  body.rv-open main {
    margin-right: 340px;
  }
}

.rv-rail-head {
  padding: 16px;
  border-bottom: 1px solid var(--rv-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rv-rail-title {
  font-weight: 700;
  color: var(--rv-ink);
}

.rv-rail-sub {
  font-size: 12px;
  color: var(--rv-dim);
}

.rv-rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.rv-item {
  border: 1px solid var(--rv-line);
  border-left: 3px solid #e6c200;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--rv-surface);
}

.rv-item.rv-item-suggestion {
  border-left-color: var(--rv-red);
}

.rv-item.rv-resolved {
  opacity: 0.55;
}

.rv-item.rv-orphan {
  border-left-color: var(--rv-dim);
}

.rv-item-meta {
  font-size: 11px;
  color: var(--rv-dim);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rv-item-quote {
  font-size: 12px;
  color: var(--rv-dim);
  border-left: 2px solid var(--rv-line);
  padding-left: 8px;
  margin-bottom: 6px;
  font-style: italic;
}

.rv-item-body {
  font-size: 13px;
  color: var(--rv-ink);
  white-space: pre-wrap;
}

.rv-suggest-box {
  font-size: 13px;
  margin-top: 6px;
}

.rv-suggest-old {
  color: #9a3a3a;
  text-decoration: line-through;
}

.rv-suggest-new {
  color: #1a7a3a;
}

.rv-item-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rv-btn {
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--rv-line);
  background: var(--rv-surface2);
  color: var(--rv-ink);
  padding: 4px 8px;
  cursor: pointer;
}

.rv-btn:hover {
  background: #e9ebee;
}

.rv-btn-primary {
  background: var(--rv-red);
  border-color: var(--rv-red);
  color: #fff;
}

.rv-btn-primary:hover {
  background: #a8242a;
}

.rv-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border: 1px solid var(--rv-line);
  color: var(--rv-dim);
}

.rv-badge-suggestion {
  border-color: var(--rv-red);
  color: var(--rv-red);
}

/* Selection popover. */
.rv-popover {
  position: absolute;
  z-index: 9002;
  background: var(--rv-ink);
  border-radius: 2px;
  display: none;
  gap: 1px;
}

.rv-popover button {
  background: var(--rv-ink);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
}

.rv-popover button:hover {
  background: #000;
}

/* Compose + modal shared overlay. */
.rv-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
}

.rv-overlay.rv-show {
  display: flex;
}

.rv-card {
  background: var(--rv-surface);
  border: 1px solid var(--rv-line);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 20px;
}

.rv-card h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: var(--rv-ink);
}

.rv-card p.rv-hint {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--rv-dim);
}

.rv-field {
  margin-bottom: 12px;
}

.rv-field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rv-dim);
  margin-bottom: 4px;
}

.rv-field input,
.rv-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--rv-line);
  background: #fff;
  color: var(--rv-ink);
}

.rv-field textarea {
  min-height: 80px;
  resize: vertical;
}

.rv-quote-preview {
  font-size: 13px;
  font-style: italic;
  color: var(--rv-dim);
  border-left: 2px solid var(--rv-line);
  padding-left: 8px;
  margin-bottom: 12px;
}

.rv-error {
  color: var(--rv-red);
  font-size: 12px;
  margin-bottom: 10px;
  min-height: 14px;
}

.rv-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.rv-file-note {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9000;
  background: var(--rv-surface2);
  border: 1px solid var(--rv-line);
  color: var(--rv-dim);
  font-size: 12px;
  padding: 8px 12px;
  max-width: 240px;
}
