/* ===== Reader highlights (Kindle-style) ===== */
mark.hl {
  background: var(--hl-color, rgba(245, 200, 66, 0.42));
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  cursor: pointer;
  transition: background .15s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
mark.hl:hover { background: var(--hl-color-strong, rgba(245, 200, 66, 0.65)); }
mark.hl.is-flash { animation: hlflash 1.1s ease; }
@keyframes hlflash {
  0%, 100% { background: var(--hl-color, rgba(245,200,66,.42)); }
  30% { background: rgba(245, 200, 66, .9); }
}

/* selection toolbar */
.hl-toolbar {
  position: absolute;
  z-index: 1200;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--color-bg, #fff);
  border: 1px solid rgba(128,128,128,.25);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.hl-toolbar.is-open { opacity: 1; pointer-events: auto; }
.hl-toolbar button {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--color-text, #1a1a1a);
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 10px; border-radius: 7px; white-space: nowrap;
}
.hl-toolbar button:hover { background: rgba(128,128,128,.14); }
.hl-toolbar button svg { width: 15px; height: 15px; }
.hl-toolbar .hl-swatch {
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.12);
}
.hl-toolbar .hl-swatch.is-active { outline: 2px solid var(--color-text,#1a1a1a); outline-offset: 1px; }

/* floating "My highlights" launcher */
.hl-fab {
  position: fixed; right: 18px; bottom: 84px; z-index: 1100;
  display: none; align-items: center; gap: 7px;
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
  color: #fff; background: var(--color-accent, #c79a3a);
  border: 0; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.hl-fab.is-show { display: inline-flex; }
.hl-fab svg { width: 16px; height: 16px; }
.hl-fab .hl-count {
  background: rgba(255,255,255,.28); border-radius: 999px;
  padding: 1px 7px; font-size: 12px;
}

/* highlights panel */
.hl-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 92vw);
  z-index: 1300; background: var(--color-bg, #fff);
  border-left: 1px solid rgba(128,128,128,.2);
  box-shadow: -10px 0 40px rgba(0,0,0,.25);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.hl-panel.is-open { transform: translateX(0); }
.hl-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(128,128,128,.18);
}
.hl-panel__head h3 { margin: 0; font-size: 17px; }
.hl-panel__close { background: transparent; border: 0; cursor: pointer; font-size: 22px; line-height: 1; color: var(--color-text,#222); padding: 4px 8px; }
.hl-panel__list { flex: 1; overflow-y: auto; padding: 10px 14px 30px; }
.hl-panel__empty { color: var(--color-muted, #888); font-size: 14px; padding: 24px 6px; text-align: center; }
.hl-item {
  position: relative; border: 1px solid rgba(128,128,128,.18);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer; background: var(--color-surface, rgba(128,128,128,.04));
}
.hl-item:hover { border-color: var(--color-accent, #c79a3a); }
.hl-item__bar { width: 4px; border-radius: 4px; position: absolute; left: 0; top: 10px; bottom: 10px; background: var(--hl-color-strong, #e9c64a); }
.hl-item__text { font-size: 14px; line-height: 1.5; margin: 0 0 6px; padding-left: 8px; }
.hl-item__meta { font-size: 12px; color: var(--color-muted, #999); padding-left: 8px; }
.hl-item__del {
  position: absolute; top: 8px; right: 8px; background: transparent; border: 0;
  cursor: pointer; color: var(--color-muted, #aaa); font-size: 15px; padding: 4px 6px; border-radius: 6px;
}
.hl-item__del:hover { color: #d23; background: rgba(210,40,40,.1); }
