/* Local-only revision comments layered over the review reader. */

.manuscript-line.has-user-comment .manuscript-text {
  box-shadow: inset 2px 0 0 var(--accent);
}

.selection-comment-action {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 65;
  min-height: 44px;
  padding: 0 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(156, 167, 255, .48);
  border-radius: 999px;
  background: #292e4f;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  color: #f5f6ff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.selection-comment-action--with-dock {
  bottom: calc(78px + env(safe-area-inset-bottom));
}

.selection-comment-action:active {
  transform: translateX(-50%) scale(.97);
}

.selection-comment-action[hidden],
.comment-dock[hidden] {
  display: none !important;
}

.comment-dock {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 55;
  width: min(520px, calc(100vw - 20px));
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid #373c47;
  border-radius: 17px;
  background: rgba(20, 22, 27, .96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .48);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.comment-dock button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.comment-dock__list {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: #1b1e25;
  color: #dce0e7;
  text-align: left;
  font-size: 12px;
  font-weight: 760;
}

.comment-dock__list strong {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #343a63;
  color: #eef0ff;
  font-size: 11px;
}

.comment-dock__copy {
  padding: 0 14px;
  background: #e8eaff;
  color: #16182b;
  font-size: 12px;
  font-weight: 850;
}

.comment-dock__copy.is-success,
.comment-primary-button.is-success,
.comment-card__actions button.is-success {
  background: #73d69b;
  color: #062b16;
}

.comment-editor__quote {
  padding: 13px;
  border: 1px solid #303540;
  border-radius: 14px;
  background: #0e1014;
}

.comment-editor__quote pre,
.comment-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #ece9e4;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 13px;
  line-height: 1.8;
}

.comment-stale {
  margin: 9px 0 0;
  color: #ffc97f;
  font-size: 11px;
  line-height: 1.55;
}

.comment-editor {
  display: grid;
  gap: 9px;
}

.comment-editor label {
  color: #dfe2e7;
  font-size: 13px;
  font-weight: 780;
}

.comment-editor textarea {
  width: 100%;
  min-height: 138px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid #3a404b;
  border-radius: 12px;
  outline: none;
  background: #0d0f13;
  color: #f1f2f4;
  font: 15px/1.65 inherit;
  caret-color: var(--accent);
}

.comment-editor textarea:focus {
  border-color: #7884e8;
  box-shadow: 0 0 0 3px rgba(156, 167, 255, .12);
}

.comment-editor textarea.is-invalid {
  border-color: #d85d68;
  box-shadow: 0 0 0 3px rgba(255, 122, 134, .10);
}

.comment-editor__privacy {
  margin: 0;
  color: #7f8793;
  font-size: 11px;
  line-height: 1.55;
}

.comment-editor__error {
  margin: 0;
  color: #ff9ca5;
  font-size: 11px;
}

.comment-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 3px;
}

.comment-primary-button,
.comment-secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.comment-primary-button {
  border: 0;
  background: #e8eaff;
  color: #17192c;
}

.comment-secondary-button {
  border: 1px solid #3a404a;
  background: #1a1d23;
  color: #ccd1d9;
}

.comment-danger-button {
  margin-right: auto;
  color: #ff9ba4;
  border-color: rgba(255, 122, 134, .28);
}

.comment-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.comment-list-toolbar p {
  margin: 0;
  color: #89929f;
  font-size: 11px;
  line-height: 1.55;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-card {
  padding: 13px;
  border: 1px solid #30353f;
  border-radius: 14px;
  background: #171a20;
}

.comment-card--stale {
  border-color: rgba(242, 179, 95, .34);
}

.comment-card__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #8c95a1;
  font-size: 10px;
  font-weight: 800;
}

.comment-card__meta > span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #343a63;
  color: #f0f1ff;
}

.comment-card__meta strong {
  color: #b5bcc7;
}

.comment-card__meta em {
  margin-left: auto;
  color: #ffc97f;
  font-style: normal;
}

.comment-card pre {
  padding: 10px 11px;
  border-radius: 9px;
  background: #0d0f13;
  font-size: 12px;
}

.comment-card p {
  margin: 10px 1px 0;
  white-space: pre-wrap;
  color: #e1e3e7;
  font-size: 13px;
  line-height: 1.68;
}

.comment-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 11px;
}

.comment-card__actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #383e48;
  border-radius: 9px;
  background: #20232a;
  color: #cdd2da;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.review-sheet[data-status="comment"] .sheet-kicker {
  color: #c6ccff;
  border-color: rgba(156, 167, 255, .36);
  background: rgba(156, 167, 255, .09);
}

@media (min-width: 760px) {
  .selection-comment-action {
    bottom: 22px;
  }

  .selection-comment-action--with-dock {
    bottom: 82px;
  }
}

/* Polished local-comment affordances. */
.comment-hint {
  width: calc(100% - 28px);
  max-width: 732px;
  margin: 12px auto 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(156, 167, 255, .22);
  border-radius: 12px;
  background: rgba(156, 167, 255, .065);
  color: #aeb5c2;
}

.comment-hint[hidden] {
  display: none !important;
}

.comment-hint__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(156, 167, 255, .14);
  color: #cbd0ff;
  font-size: 14px;
  font-weight: 900;
}

.comment-hint > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.comment-hint strong {
  color: #dfe2e9;
  font-size: 11px;
  font-weight: 800;
}

.comment-hint small {
  color: #858e9b;
  font-size: 10px;
  line-height: 1.45;
}

.user-comment-pin {
  width: 27px;
  height: 27px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #6974ca;
  border-radius: 999px;
  background: #343a63;
  box-shadow: 0 0 0 3px rgba(156, 167, 255, .07);
  color: #eef0ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.user-comment-pin:active {
  transform: scale(.94);
  background: #41487a;
}

body.has-comment-dock .manuscript,
body.has-comment-dock .diff-reader {
  padding-bottom: 150px;
}

.comment-editor__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  color: #7f8793;
  font-size: 10px;
  line-height: 1.5;
}

.comment-editor__shortcut {
  color: #69717d;
}

.work-local-comments {
  margin-top: 15px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(156, 167, 255, .25);
  border-radius: 13px;
  background: rgba(156, 167, 255, .06);
}

.work-local-comments[hidden],
.episode-local-comments[hidden] {
  display: none !important;
}

.work-local-comments__summary {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #aab1bd;
  font-size: 11px;
  font-weight: 700;
}

.work-local-comments__summary strong {
  color: #f0f1ff;
  font-size: 16px;
}

.work-local-comments__copy {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #e8eaff;
  color: #16182b;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.work-local-comments__copy.is-success {
  background: #73d69b;
  color: #062b16;
}

.episode-local-comments {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(156, 167, 255, .10);
  color: #bbc2ff;
  font-size: 10px;
  font-weight: 800;
}

@media (min-width: 760px) {
  .comment-hint {
    margin-top: 16px;
  }
}