/* ------------------------------------------------------------
   Review overlay — XD 風コメントピン
   サイト本体と衝突しないよう rv- プレフィックス / 高 z-index
   アクセント: レビュー用ブルー(サイトの墨色と混ざらない色)
   ------------------------------------------------------------ */

:root {
  --rv-blue: #2563eb;
  --rv-blue-dark: #1d4ed8;
  --rv-done: #059669;
  --rv-ink: #16181a;
  --rv-paper: #ffffff;
  --rv-line: #e2e0da;
}

/* ---------- pin layer ---------- */
.rv-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  z-index: 9990;
  pointer-events: none;
}

.rv-pin {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50% 50% 50% 4px;
  background: var(--rv-blue);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
  font: 600 12px/1 'Inter', sans-serif;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease;
}
.rv-pin:hover { transform: scale(1.15); }
.rv-pin.is-resolved { background: var(--rv-done); box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4); opacity: 0.8; }
.rv-pin.is-approx { border-style: dashed; }
.rv-pin.is-otherdev { opacity: 0.55; }

/* ---------- comment-mode click catcher ---------- */
.rv-catcher {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;
  z-index: 9991;
  display: none;
  cursor: crosshair;
}
html.rv-mode .rv-catcher { display: block; height: 100%; min-height: 100vh; }
html.rv-mode .rv-catcher { height: auto; inset: 0; position: fixed; }
html.rv-mode body { cursor: crosshair; }

/* ---------- toolbar ---------- */
.rv-toolbar {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 9995;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--rv-ink);
  padding: 8px;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.rv-btn {
  font: 500 12px/1 'Noto Sans JP', sans-serif;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}
.rv-btn:hover { background: rgba(255, 255, 255, 0.12); }
.rv-btn--mode.is-on { background: var(--rv-blue); color: #fff; }
.rv-btn--resolved.is-on { color: #6ee7b7; }
.rv-count {
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 3px 8px;
}
.rv-has-open .rv-count { background: #ef4444; color: #fff; }

/* ---------- placement hint ---------- */
.rv-hint {
  position: fixed;
  left: 50%; top: 18px;
  transform: translate(-50%, -90px);
  opacity: 0;
  visibility: hidden;
  z-index: 9995;
  background: var(--rv-blue);
  color: #fff;
  font: 500 12.5px/1.4 'Noto Sans JP', sans-serif;
  letter-spacing: 0.05em;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
}
html.rv-mode .rv-hint { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- panel ---------- */
.rv-panel {
  position: absolute;
  z-index: 9996;
  width: 300px;
  background: var(--rv-paper);
  border: 1px solid var(--rv-line);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  padding: 16px;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--rv-ink);
}
.rv-panel__head {
  font: 600 13px/1 'Inter', 'Noto Sans JP', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rv-chip {
  font: 600 9.5px/1 'Inter', sans-serif;
  letter-spacing: 0.1em;
  background: #eef2ff;
  color: var(--rv-blue-dark);
  padding: 4px 8px;
  border-radius: 999px;
}
.rv-chip--done { background: #ecfdf5; color: var(--rv-done); }
.rv-panel__meta { font-size: 11px; color: #71757a; margin-bottom: 8px; }
.rv-panel__body {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 40vh;
  overflow-y: auto;
}
.rv-panel__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.rv-panel .rv-btn { color: #71757a; padding: 9px 12px; }
.rv-panel .rv-btn:hover { background: #f2f1ed; color: var(--rv-ink); }
.rv-panel .rv-primary { background: var(--rv-blue); color: #fff; }
.rv-panel .rv-primary:hover { background: var(--rv-blue-dark); }
.rv-panel .rv-del:hover { color: #dc2626; }

.rv-input {
  width: 100%;
  border: 1px solid var(--rv-line);
  border-radius: 7px;
  background: #fbfaf8;
  font: 400 13px/1.7 'Noto Sans JP', sans-serif;
  padding: 9px 11px;
  margin-bottom: 8px;
  color: var(--rv-ink);
  box-sizing: border-box;
  resize: vertical;
}
.rv-input:focus { outline: none; border-color: var(--rv-blue); background: #fff; }

/* ---------- SP: bottom sheet ---------- */
@media (max-width: 640px) {
  .rv-panel {
    position: fixed;
    left: 0 !important; right: 0;
    top: auto !important; bottom: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.3);
  }
  .rv-toolbar { right: 12px; bottom: 12px; }
  .rv-btn--dash span { display: none; }
  .rv-pin { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
}
