/* 형광펜·북마크·내 표시 — 형광펜은 글자 뒤 배경만 칠해 라이트·다크 모두 글자가 잘 읽히게 한다 */
:root {
  --hl-y: #fde68a; --hl-g: #bbf7d0; --hl-b: #bfdbfe; --hl-p: #fbcfe8; --hl-o: #fed7aa; --hl-v: #ddd6fe;
  --dot-y: #f2b705; --dot-g: #2fb36a; --dot-b: #3b82f6; --dot-p: #e8579b; --dot-o: #f0812a; --dot-v: #8a6ae0;
  --star: #e0a100;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hl-y: rgba(250, 204, 21, .34); --hl-g: rgba(74, 222, 128, .30); --hl-b: rgba(96, 165, 250, .36);
    --hl-p: rgba(244, 114, 182, .36); --hl-o: rgba(251, 146, 60, .36); --hl-v: rgba(167, 139, 250, .40);
    --star: #f2c54b;
  }
}
mark.hl { color: inherit; padding: 0 1px; border-radius: 3px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.hl-y { background: var(--hl-y); } mark.hl-g { background: var(--hl-g); } mark.hl-b { background: var(--hl-b); }
mark.hl-p { background: var(--hl-p); } mark.hl-o { background: var(--hl-o); } mark.hl-v { background: var(--hl-v); }
mark.hl.flash { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 색 도구 */
.hl-bar {
  position: fixed; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22);
}
.hl-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); padding: 0;
  box-shadow: 0 0 0 1px var(--line);
}
.hl-dot.hl-y { background: var(--dot-y); } .hl-dot.hl-g { background: var(--dot-g); } .hl-dot.hl-b { background: var(--dot-b); }
.hl-dot.hl-p { background: var(--dot-p); } .hl-dot.hl-o { background: var(--dot-o); } .hl-dot.hl-v { background: var(--dot-v); }
.hl-dot.on { box-shadow: 0 0 0 2px var(--text); }
.hl-del, .hl-x { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 8px; }
.hl-x { font-size: 15px; }
.hl-copy { color: var(--text); }
/* 터치 화면: 화면 아래 가운데에 붙인다 (홈 표시줄 위 여백 포함) */
.hl-bar.docked { left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); top: auto; max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }

/* 북마크 별 */
.star {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0;
  border: 0; background: transparent; color: var(--faint); border-radius: 50%;
}
.star svg { width: 20px; height: 20px; }
.star.on { color: var(--star); }
.star:active { background: var(--surface-2); }
.head-right { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.star-tool svg { width: 16px; height: 16px; }
.star-tool.on { color: var(--star); border-color: var(--star); }

/* 홈의 '내 표시' 버튼 */
.marks-open {
  position: relative; flex: none; width: 40px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--star);
}
.marks-open svg { width: 19px; height: 19px; }
.cnt-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}

/* 단어 상세 */
.word-page .front.open { padding-top: 22px; }
.word-mean { margin-top: 14px; }
.sr-main[data-act="word"] { cursor: pointer; }

/* 내 표시 */
.mk-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mk-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 12px; font-size: calc(13px * var(--fs)); color: var(--muted);
}
.mk-chip svg { width: 14px; height: 14px; color: var(--star); }
.mk-chip .hl-dot { width: 12px; height: 12px; border: 0; box-shadow: none; display: inline-block; }
.mk-chip.on { border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.mk-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.mk-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding: 8px 0; }
.mk-row:first-child { border-top: 0; }
.mk-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; border: 0; background: transparent; padding: 2px 0; color: var(--text); }
.mk-open b { font-size: calc(15px * var(--fs)); overflow-wrap: anywhere; }
.mk-open > span { font-size: calc(12.5px * var(--fs)); color: var(--muted); word-break: keep-all; overflow-wrap: anywhere; }
.mk-open .mk-text { font-size: calc(14.5px * var(--fs)); color: var(--text); line-height: 1.6; }
.mk-del { flex: none; border: 0; background: transparent; color: var(--faint); width: 32px; height: 32px; border-radius: 50%; }
.mk-del:active { background: var(--surface-2); }
@media print { .hl-bar, .star, .star-tool, .marks-open { display: none !important; } }
