/* ============================================================
   CARE-PAC reviewer notes — sticky-note overlay
   Loaded only when NOTES_ENABLED=true at build time.
   Deliberately NOT using design-system tokens — these are an
   admin/review affordance and should look obviously distinct
   from the page content.
   ============================================================ */

.carepac-notes-add {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  min-height: 48px;
  padding: 0.75rem 1.125rem;
  background: #FEEC8B;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.carepac-notes-add:hover { background: #FFF3A8; }
.carepac-notes-add:focus-visible {
  outline: 2px solid #0C77BB;
  outline-offset: 2px;
}
.carepac-notes-add[hidden] { display: none; }

.carepac-note {
  position: absolute;
  z-index: 9999;
  width: 220px;
  min-height: 150px;
  background: #FEEC8B;
  color: #1a1a1a;
  border-radius: 4px;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.10);
  padding: 0.375rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}
.carepac-note--dragging { opacity: 0.85; cursor: grabbing; }

.carepac-note__handle {
  height: 22px;
  cursor: grab;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
}
.carepac-note__handle:active { cursor: grabbing; }

.carepac-note__delete {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.carepac-note__delete:hover { background: rgba(0, 0, 0, 0.18); }
.carepac-note__delete:focus-visible {
  outline: 2px solid #0C77BB;
  outline-offset: 2px;
}

.carepac-note__text {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  resize: none;
  outline: none;
  padding: 0.25rem;
  min-height: 84px;
}
.carepac-note__text::placeholder {
  color: rgba(0, 0, 0, 0.45);
  font-style: italic;
}
.carepac-note__text:focus {
  outline: 2px dashed rgba(0, 0, 0, 0.35);
  outline-offset: -2px;
  border-radius: 2px;
}

.carepac-note__meta {
  font-size: 0.6875rem;
  color: rgba(0, 0, 0, 0.55);
  padding: 0 0.25rem 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

@media print {
  .carepac-notes-add,
  .carepac-note { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .carepac-note,
  .carepac-notes-add { transition: none !important; }
}
