/* Tide wireframe review — comment overlay. All selectors namespaced .rv-* / #rv-*
   and pushed to a high stacking context so they never clash with wireframe CSS. */

:root {
  --rv-blue: #2f6df6;
  --rv-blue-soft: rgba(47, 109, 246, 0.10);
  --rv-coral: #e87761;
  --rv-navy: #1e3a5f;
  --rv-muted: #6a6a6a;
  --rv-resolved: #9aa3ad;
}

#rv-root, #rv-root * { box-sizing: border-box; }

/* ---- element highlight (hover in comment mode) ---- */
#rv-highlight {
  position: fixed;
  z-index: 2147483600;
  pointer-events: none;
  border: 2px solid var(--rv-blue);
  background: var(--rv-blue-soft);
  border-radius: 3px;
  display: none;
  transition: all 0.04s linear;
}
#rv-highlight-label {
  position: fixed;
  z-index: 2147483601;
  pointer-events: none;
  background: var(--rv-blue);
  color: #fff;
  font: 600 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}
body.rv-comment-mode { cursor: crosshair; }
body.rv-comment-mode a, body.rv-comment-mode button { cursor: crosshair !important; }

/* ---- toolbar (bottom-right) ---- */
#rv-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483602;
  display: flex;
  gap: 8px;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rv-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  background: #fff;
  color: var(--rv-navy);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rv-btn-primary { background: var(--rv-navy); color: #fff; }
.rv-btn-primary.rv-active { background: var(--rv-blue); }
.rv-btn .rv-count {
  background: var(--rv-coral);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
}

/* ---- pins ---- */
.rv-pin {
  position: fixed;
  z-index: 2147483599;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50% 50% 50% 2px;
  background: var(--rv-coral);
  color: #fff;
  font: 700 12px/26px -apple-system, sans-serif;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  transition: transform 0.08s ease;
}
.rv-pin:hover { transform: scale(1.15); }
.rv-pin.rv-pin-resolved { background: var(--rv-resolved); }

/* ---- popups (composer + thread) ---- */
.rv-pop {
  position: fixed;
  z-index: 2147483603;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222;
  overflow: hidden;
}
.rv-pop-head {
  padding: 10px 14px;
  background: #f6f6f4;
  border-bottom: 1px solid #e4e4e2;
  font-size: 12px;
  color: var(--rv-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rv-pop-body { padding: 12px 14px; max-height: 320px; overflow-y: auto; }
.rv-pop textarea {
  width: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 7px;
  padding: 8px;
  font: inherit;
  resize: vertical;
  min-height: 64px;
}
.rv-pop-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.rv-pop-actions .rv-btn { padding: 7px 13px; box-shadow: none; border: 1px solid #e0e0e0; }
.rv-pop-actions .rv-btn-primary { border-color: var(--rv-navy); }
.rv-x { cursor: pointer; font-size: 16px; color: var(--rv-muted); background: none; border: none; }

.rv-comment { padding: 8px 0; border-bottom: 1px solid #efefef; }
.rv-comment:last-child { border-bottom: none; }
.rv-comment .rv-meta { font-size: 12px; color: var(--rv-muted); margin-bottom: 2px; }
.rv-comment .rv-author { font-weight: 600; color: var(--rv-navy); }
.rv-comment .rv-text { white-space: pre-wrap; }
.rv-reply { margin-left: 14px; padding-left: 8px; border-left: 2px solid #eee; }

/* ---- side panel ---- */
#rv-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: #fff;
  z-index: 2147483604;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#rv-panel.rv-open { transform: translateX(0); }
#rv-panel header {
  padding: 14px 16px;
  border-bottom: 1px solid #e4e4e2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--rv-navy);
}
#rv-panel .rv-panel-body { overflow-y: auto; padding: 8px 12px; flex: 1; }
.rv-panel-group { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rv-muted); margin: 14px 4px 6px; }
.rv-panel-item { padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.rv-panel-item:hover { background: #f4f6fa; }
.rv-panel-item .rv-pi-sel { font-size: 12px; color: var(--rv-blue); }
.rv-panel-item.rv-unanchored { opacity: 0.75; }
.rv-empty { color: var(--rv-muted); padding: 20px 8px; text-align: center; }
