/* ─── Highlight colors ─────────────────────────────────────────────── */
.user-highlight                        { background: #fffd8c; position: relative; }
.user-highlight[data-hcolor="yellow"]  { background: #fffd8c; }
.user-highlight[data-hcolor="green"]   { background: #b6f5b6; }
.user-highlight[data-hcolor="blue"]    { background: #a8d8ff; }
.user-highlight[data-hcolor="pink"]    { background: #ffb3d9; }
.user-highlight[data-hcolor="orange"]  { background: #ffd59e; }
.user-highlight[data-hcolor="purple"]  { background: #d4b3ff; }
.user-highlight[data-hcolor="red"]     { background: #ffb3b3; }
.user-highlight[data-hcolor="cyan"]    { background: #a8f0f0; }

/* ─── Delete button ─────────────────────────────────────────────────── */
.highlight-delete-btn {
  position: absolute; top: -28px; right: 0;
  padding: 4px 8px; font-size: 12px; border: none;
  border-radius: 4px; background: #ff4d4d; color: #fff;
  cursor: pointer; z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.highlight-delete-btn::before { content: "🗑️ "; }

/* ─── Floating color-picker bar (bottom-right) ─────────────────────── */
#highlite-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #1e1e2e;
  border-radius: 16px;
  padding: 10px 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
  transition: opacity .2s, transform .2s;
}

/* toggle icon on top */
#highlite-bar-toggle {
  width: 36px; height: 36px;
  background: #333; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
  user-select: none;
  transition: background .15s;
}
#highlite-bar-toggle:hover { background: #555; }

/* color swatches */
.highlite-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.highlite-swatch:hover         { transform: scale(1.2); }
.highlite-swatch.active        { border-color: #fff; transform: scale(1.2); }

/* collapsed state: hide swatches */
#highlite-floating-bar.collapsed .highlite-swatch { display: none; }

/* inline popup button (near cursor) */
#highlight-action-btn {
  position: absolute; display: none;
  padding: 5px 12px; background: #1e1e2e; color: #fff;
  font-size: 12px; border-radius: 20px; cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  white-space: nowrap;
}
#highlight-action-btn .hlbtn-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ─── Login / membership modal ──────────────────────────────────────── */
#highlite-login-modal,
#highlite-instructions-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.55);
  align-items: center;
  justify-content: center;
}
/* Use flex when JS sets display:block → override with flex via the fadeIn trick */
#highlite-login-modal[style*="display: block"],
#highlite-login-modal[style*="display:block"],
#highlite-instructions-modal[style*="display: block"],
#highlite-instructions-modal[style*="display:block"] {
  display: flex !important;
}

#highlite-login-modal-inner,
#highlite-instructions-modal-inner {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#highlite-login-modal-inner h3,
#highlite-instructions-modal-inner h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #1e1e2e;
}

#highlite-login-modal-inner p {
  margin: 0 0 20px;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

#highlite-instructions-modal-inner ul {
  text-align: left;
  margin: 0 0 20px 0;
  padding-left: 18px;
  color: #444;
  font-size: 14px;
  line-height: 1.8;
}

.highlite-modal-btn,
#highlite-instructions-got-it {
  display: inline-block;
  padding: 10px 24px;
  background: #1e1e2e;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.highlite-modal-btn:hover,
#highlite-instructions-got-it:hover { background: #3a3a5c; }

#highlite-modal-close,
#highlite-instructions-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 0;
}
#highlite-modal-close:hover,
#highlite-instructions-close:hover { color: #333; }
