.eca-annotations-toolbar {
  position: absolute;
  z-index: 2400;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.eca-annotations-toolbar[hidden],
.eca-annotations-panel[hidden],
.eca-annotations-toast[hidden] {
  display: none;
}

:root {
  --eca-annotations-panel-width: min(390px, 100vw);
}

.eca-annotations-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  margin: 0 0 0.85rem 0;
  padding: 0.42rem 0.48rem 0.42rem 0.62rem;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  font-size: 0.78rem;
  line-height: 1.1;
}

.eca-annotations-auth__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eca-annotations-auth button {
  flex: 0 0 auto;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.28rem 0.48rem;
  font: inherit;
  cursor: pointer;
}

.eca-annotations-auth button:hover {
  background: #dbeafe;
  color: #1e40af;
}

.eca-annotations-auth--floating {
  position: fixed;
  z-index: 2430;
  top: 3.25rem;
  right: 0.75rem;
  max-width: min(24rem, calc(100vw - 1.5rem));
  margin: 0;
}

.eca-annotations-toolbar button,
.eca-annotations-form button,
.eca-annotations-signin a {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 0.36rem 0.52rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.eca-annotations-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.eca-annotations-toolbar button:hover,
.eca-annotations-form button:hover,
.eca-annotations-signin a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.eca-annotations-form button[type="submit"],
.eca-annotations-signin a {
  background: #2563eb;
  color: #fff;
}

.eca-annotations-form button[type="submit"]:hover,
.eca-annotations-signin a:hover {
  background: #1d4ed8;
  color: #fff;
}

.eca-annotations-panel {
  position: fixed;
  z-index: 2450;
  top: 0;
  right: 0;
  width: var(--eca-annotations-panel-width);
  height: 100dvh;
  background: #fff;
  color: #111827;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
}

.eca-annotations-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.eca-annotations-panel__header h2 {
  margin: 0;
  font-size: 1rem;
}

.eca-annotations-panel__close {
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.eca-annotations-panel__body {
  overflow: auto;
  padding: 1rem;
}

.eca-annotation-highlight {
  background: rgba(250, 204, 21, 0.34);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.16);
  border-radius: 0.15rem;
  cursor: pointer;
}

.eca-annotation-highlight:hover {
  background: rgba(250, 204, 21, 0.52);
}

.eca-annotation-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  margin: 0 0.12rem;
  padding: 0 0.18rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #64748b;
  font:
    0.64em/1 ui-serif,
    Georgia,
    "Times New Roman",
    serif;
  vertical-align: super;
  cursor: pointer;
}

.eca-annotation-cue:hover,
.eca-annotation-cue:focus {
  background: rgba(219, 234, 254, 0.72);
  color: #1d4ed8;
}

.eca-annotation-cue span + span::before {
  color: #cbd5e1;
  content: "/";
  margin-right: 0.16rem;
}

.eca-annotations-reactions span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.eca-annotations-thread {
  border-bottom: 1px solid #e5e7eb;
  padding: 0 0 1rem;
  margin: 0 0 1rem;
}

.eca-annotations-thread blockquote,
.eca-annotations-form blockquote {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #facc15;
  background: #fffbeb;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.45;
}

.eca-annotations-reactions {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 0.78rem;
}

.eca-annotations-comment {
  margin: 0.7rem 0 0;
  padding: 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
}

.eca-annotations-comment--pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.eca-annotations-comment__meta {
  color: #6b7280;
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
}

.eca-annotations-comment p {
  margin: 0;
  line-height: 1.45;
}

.eca-annotations-form textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.65rem;
  font: inherit;
}

.eca-annotations-form__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.eca-annotations-form__actions button[data-action="cancel"] {
  background: #e5e7eb;
  color: #111827;
}

.eca-annotations-signin {
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 1rem;
  background: #f9fafb;
}

.eca-annotations-signin p {
  margin: 0 0 0.75rem;
}

.eca-annotations-empty {
  color: #6b7280;
  margin: 0;
}

.eca-annotations-toast {
  position: fixed;
  z-index: 2500;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  max-width: min(92vw, 32rem);
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.28);
  font-size: 0.88rem;
}

.eca-annotations-turnstile {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 900px) {
  body.eca-annotations-panel-open {
    overflow-x: hidden;
    padding-right: var(--eca-annotations-panel-width);
  }

  body.eca-annotations-panel-open #quarto-header {
    right: var(--eca-annotations-panel-width);
    width: auto;
  }

  body.eca-annotations-panel-open .public-reader-actions,
  body.eca-annotations-panel-open .eca-annotations-auth--floating {
    right: calc(var(--eca-annotations-panel-width) + 0.75rem);
  }
}

@media (max-width: 640px) {
  .eca-annotations-toolbar {
    max-width: calc(100vw - 1rem);
    flex-wrap: wrap;
  }

  .eca-annotations-panel {
    width: 100vw;
  }

  .eca-annotations-auth {
    top: 2.85rem;
    right: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
}
