.rv-root,
.rv-root *,
.rv-root *::before,
.rv-root *::after {
  box-sizing: border-box;
}

.rv-root {
  --rv-ink: #111923;
  --rv-muted: #617083;
  --rv-line: #d9e0e7;
  --rv-blue: #1769e0;
  --rv-blue-dark: #0d4dac;
  --rv-green: #23845a;
  --rv-red: #d33c43;
  --rv-paper: #ffffff;
  color: var(--rv-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

.rv-root button,
.rv-root input,
.rv-root textarea {
  margin: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.rv-pin-layer,
.rv-capture {
  position: fixed;
  inset: 0;
}

.rv-pin-layer {
  z-index: 9992;
  overflow: hidden;
  pointer-events: none;
}

.rv-capture {
  z-index: 9990;
  display: none;
  cursor: crosshair;
  background: rgb(23 105 224 / 2%);
}

.rv-capture.rv-active {
  display: block;
}

.rv-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  transform: translate(-5px, -25px);
  border: 2px solid #fff !important;
  border-radius: 50% 50% 50% 4px !important;
  background: var(--rv-blue) !important;
  box-shadow: 0 3px 12px rgb(0 0 0 / 25%);
  color: #fff !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 26px !important;
  text-align: center;
  pointer-events: auto;
  transition: opacity 160ms ease, transform 160ms ease;
}

.rv-pin:hover,
.rv-pin:focus-visible {
  transform: translate(-5px, -25px) scale(1.1);
  outline: 3px solid rgb(23 105 224 / 25%);
  outline-offset: 2px;
}

.rv-pin.rv-resolved {
  background: var(--rv-green) !important;
  opacity: 0.72;
}

.rv-pin.rv-fallback {
  border-style: dashed !important;
}

.rv-pin.rv-device-mismatch {
  opacity: 0.42;
}

.rv-pin-device {
  position: absolute;
  top: -8px;
  right: -13px;
  min-width: 22px;
  height: 15px;
  padding: 0 4px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: var(--rv-ink);
  color: #fff;
  font-size: 8px;
  font-weight: 750;
  line-height: 13px;
  text-align: center;
}

.rv-toolbar {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 7px;
  background: #10151c;
  box-shadow: 0 12px 30px rgb(0 0 0 / 24%);
  transition: opacity 140ms ease, visibility 140ms ease;
}

.rv-tool {
  position: relative;
  min-height: 38px;
  padding: 0 13px !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 650 !important;
  white-space: nowrap;
}

.rv-tool:hover,
.rv-tool:focus-visible,
.rv-tool[aria-pressed="true"] {
  background: #29313b !important;
  outline: none;
}

.rv-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: 6px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  background: #626d79;
  color: #fff;
  font-size: 10px;
  line-height: 19px;
}

.rv-count.rv-has-open {
  background: var(--rv-red);
}

.rv-hint {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 9999;
  padding: 9px 16px;
  transform: translate(-50%, -8px);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 20px;
  background: #10151c;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.rv-hint.rv-active {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.rv-compose,
.rv-thread {
  position: fixed;
  z-index: 9997;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid var(--rv-line);
  border-radius: 6px;
  background: var(--rv-paper);
  box-shadow: 0 18px 52px rgb(18 31 45 / 24%);
}

.rv-compose {
  padding: 16px;
}

.rv-thread {
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  max-height: min(520px, calc(100vh - 110px));
  overflow: auto;
}

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

.rv-panel-title {
  margin: 0;
  color: var(--rv-ink);
  font-size: 13px;
  font-weight: 750;
}

.rv-close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0 !important;
  place-items: center;
  border-radius: 4px !important;
  background: #f1f4f6 !important;
  cursor: pointer;
  font-size: 18px !important;
  line-height: 1 !important;
}

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

.rv-field-label {
  display: block;
  margin-bottom: 5px;
  color: #425064;
  font-size: 11px;
  font-weight: 700;
}

.rv-input,
.rv-textarea {
  display: block;
  width: 100%;
  border: 1px solid #c9d2dc !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--rv-ink) !important;
  outline: none;
}

.rv-input {
  height: 38px;
  padding: 0 10px !important;
}

.rv-textarea {
  min-height: 104px;
  padding: 9px 10px !important;
  resize: vertical;
}

.rv-input:focus,
.rv-textarea:focus {
  border-color: var(--rv-blue) !important;
  box-shadow: 0 0 0 3px rgb(23 105 224 / 12%);
}

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

.rv-button {
  min-height: 36px;
  padding: 0 13px !important;
  border-radius: 4px !important;
  background: #edf1f4 !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.rv-button.rv-primary {
  background: var(--rv-blue) !important;
  color: #fff !important;
}

.rv-button.rv-danger {
  color: #b72931 !important;
}

.rv-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.rv-thread-body {
  padding: 16px;
}

.rv-thread-text {
  margin: 0 0 16px;
  color: var(--rv-ink);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 16px;
  color: var(--rv-muted);
  font-size: 11px;
}

.rv-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 3px;
  background: #eaf0f7;
  color: #31506f;
  font-size: 10px;
  font-weight: 750;
}

.rv-status {
  min-height: 22px;
  margin: 8px 0 0;
  color: #b72931;
  font-size: 11px;
}

@media (max-width: 640px) {
  .rv-root.rv-panel-open .rv-toolbar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .rv-pin {
    width: 34px;
    height: 34px;
    transform: translate(-6px, -28px);
    font-size: 13px !important;
    line-height: 30px !important;
  }

  .rv-pin:hover,
  .rv-pin:focus-visible {
    transform: translate(-6px, -28px) scale(1.06);
  }

  .rv-toolbar {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    justify-content: stretch;
  }

  .rv-tool {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px !important;
    font-size: 11px !important;
  }

  .rv-compose,
  .rv-thread {
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100%;
    max-height: min(76vh, 620px);
    padding-bottom: env(safe-area-inset-bottom);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .rv-compose {
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .rv-thread {
    overflow: auto;
  }

  .rv-hint {
    top: 10px;
    max-width: calc(100vw - 20px);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rv-root * {
    transition-duration: 0.01ms !important;
  }
}
