.comments-toolbar {
  position: fixed;
  z-index: 4;
  right: max(.65rem, env(safe-area-inset-right));
  bottom: max(.65rem, env(safe-area-inset-bottom));
  display: flex;
  gap: .35rem;
  padding: .3rem;
  border: 1px solid #555;
  border-radius: 1.5rem;
  background: white;
  color: #222;
  box-shadow: 0 2px 8px #0003;
}
.comments-toolbar button, .comments-dialog button {
  min-height: 2.75rem;
  border: 1px solid #333;
  border-radius: 1.5rem;
  background: white;
  color: #222;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.comments-toolbar [data-place], .comments-dialog [data-save], .comments-dialog [aria-pressed="true"] {
  background: #222;
  color: #fff;
}
.comments-toolbar [data-place]:focus-visible, .comments-dialog :is([data-save], [aria-pressed="true"]):focus-visible {
  outline-color: #222;
}
.comments-toolbar [data-place][aria-pressed="true"] {
  background: #555;
}
.comments-hint:not(:empty) {
  position: absolute;
  right: 0;
  bottom: calc(100% + .35rem);
  width: max-content;
  max-width: calc(100vw - 1.5rem);
  margin: 0;
  border: 1px solid #555;
  border-radius: .5rem;
  background: white;
  padding: .35rem .6rem;
  font-size: .8rem;
}
.comments-hint:empty, .comments-error:empty { margin: 0; }
.comment-placing :is(main, header, footer) { cursor: crosshair; }
.comments-pins {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  pointer-events: none;
}
.comment-pin {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  min-width: 2rem;
  min-height: 2rem;
  padding: .1rem;
  border: 2px solid white;
  border-radius: 50%;
  background: #222;
  color: white;
  box-shadow: 0 0 0 1px #333, 0 2px 5px #0004;
  font: 750 .7rem system-ui, sans-serif;
  pointer-events: auto;
  cursor: pointer;
}
.comment-pin[data-resolved="true"] { background: white; color: #222; }
.comments-dialog {
  position: fixed;
  width: min(30rem, calc(100% - 1.25rem));
  max-height: calc(100% - 1.25rem);
  margin: auto;
  border: 1px solid #555;
  border-radius: .75rem;
  padding: 1rem;
  background: white;
  color: #222;
  overscroll-behavior: contain;
}
.comments-dialog::backdrop { background: #0008; }
.comments-dialog h2 { font-size: 1.3rem; line-height: 1.2; text-transform: none; letter-spacing: 0; }
.comments-description { font-size: .875rem; }
.comments-dialog label { display: grid; gap: .25rem; margin-bottom: .7rem; font-size: .9rem; font-weight: 650; }
.comments-dialog :is(input, textarea) {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem;
  border: 1px solid #555;
  border-radius: .2rem;
  font: 1rem system-ui, sans-serif;
}
.comments-dialog textarea { resize: vertical; }
.comments-dialog button:disabled { opacity: .55; cursor: default; }
.comments-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.comments-error:not(:empty) { margin: .6rem 0; font-weight: 700; }
.comments-list { margin: .7rem 0 0; }
.comments-list > li { border-top: 1px solid #aaa; padding: .65rem 0; }
.comments-list p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0; }
.comments-list time { display: block; color: #444; font-size: .78rem; }
.comments-list a { overflow-wrap: anywhere; font-size: .8rem; }
