.annotation-tab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  border: 2px solid var(--line, #20251f);
  background: var(--yellow, #d8f35b);
  color: var(--ink, #161816);
  box-shadow: var(--shadow, 5px 5px 0 rgba(22, 24, 22, .12));
}

.annotation-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--panel, #fff);
  border-left: 2px solid var(--line, #20251f);
  box-shadow: -8px 0 24px rgba(22, 24, 22, .14);
  transform: translateX(100%);
  transition: transform .18s ease;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.annotation-panel.open {
  transform: translateX(0);
}

.annotation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 2px solid var(--line, #20251f);
}

.annotation-head h2 {
  font-size: 22px;
}

.annotation-tools,
.annotation-composer {
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--soft, #e6ece4);
  display: grid;
  gap: 10px;
}

.annotation-tool-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.annotation-tools select,
.annotation-composer textarea,
.annotation-item textarea {
  width: 100%;
  border: 1.5px solid var(--line, #20251f);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.annotation-composer[hidden] {
  display: none;
}

.annotation-target {
  border: 1.5px dashed var(--line, #20251f);
  background: #fbfcfb;
  padding: 10px;
  color: var(--muted, #606861);
  font-size: 13px;
  line-height: 1.6;
  max-height: 120px;
  overflow: auto;
}

.annotation-composer textarea {
  min-height: 96px;
  resize: vertical;
}

.annotation-list {
  overflow: auto;
  padding: 14px 18px 28px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.annotation-empty {
  color: var(--muted, #606861);
  font-size: 14px;
  line-height: 1.7;
  border: 1.5px dashed var(--line, #20251f);
  padding: 14px;
  background: #fbfcfb;
}

.annotation-item {
  border: 1.5px solid var(--line, #20251f);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.annotation-item.resolved {
  opacity: .64;
}

.annotation-item-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}

.annotation-quote {
  color: var(--muted, #606861);
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid var(--rust, #c94932);
  padding-left: 9px;
  max-height: 90px;
  overflow: auto;
}

.annotation-thumb {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 1.5px solid var(--line, #20251f);
  border-radius: 8px;
  background: #eef2ee;
}

.annotation-item textarea {
  min-height: 76px;
  resize: vertical;
}

.annotation-status {
  color: var(--muted, #606861);
  font-size: 12px;
  line-height: 1.5;
}

.annotation-mini {
  color: var(--muted, #606861);
  font-size: 12px;
}

.annotation-popover {
  position: fixed;
  z-index: 100;
  display: none;
  border: 2px solid var(--line, #20251f);
  background: var(--yellow, #d8f35b);
  color: var(--ink, #161816);
  box-shadow: 4px 4px 0 rgba(22, 24, 22, .16);
}

.annotation-popover.show {
  display: block;
}

.annotation-has-notes {
  outline: 3px solid rgba(201, 73, 50, .55);
  outline-offset: 3px;
}

.annotation-selected-image {
  outline: 3px solid var(--rust, #c94932);
  outline-offset: 3px;
}

.cover img[data-annotatable-image="true"] {
  cursor: crosshair;
}

@media (max-width: 920px) {
  .annotation-tab {
    right: 12px;
    bottom: 12px;
  }

  .annotation-panel {
    width: 100vw;
  }
}
