#ink { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; stroke:none; }
#ink.editing { pointer-events:auto; touch-action:none; cursor:crosshair; }
#reader:has(#ink.editing) {
  -webkit-user-select:none; user-select:none;
  -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none;
}
#ink.moving { cursor:grab; }
#ink.moving:active { cursor:grabbing; }
#ink .ink-selection {
  fill:none; stroke:#14745c; stroke-width:1.5; stroke-dasharray:4 3;
  vector-effect:non-scaling-stroke; pointer-events:none;
}
#annotation-dock { position:fixed; z-index:2; bottom:max(14px,env(safe-area-inset-bottom)); right:max(14px,env(safe-area-inset-right));
  display:flex; flex-direction:column; align-items:flex-end; gap:6px; color:#143e33; font:14px/1.35 system-ui,sans-serif; }
#annotation-dock button { width:auto; height:auto; font:inherit; }
#annotation-dock #ink-toggle { width:46px; height:46px; border-radius:50%; border:1px solid #275a49;
  background:#084536; color:white; box-shadow:0 3px 12px #173e3545; touch-action:none; }
#ink-toggle svg { width:23px; }
#ink-toggle[aria-expanded="false"] .ink-close-icon,
#ink-toggle[aria-expanded="true"] .ink-open-icon { display:none; }
#ink-toggle[aria-expanded="true"] svg { display:none; }
#ink-toggle[aria-expanded="true"]::before { content:'×'; font-size:28px; line-height:1; }
#annotation-panel { width:min(248px,calc(100vw - 16px)); padding:12px; background:#fcfdfb;
  border:1px solid #bacdc3; border-radius:14px; box-shadow:0 5px 22px #193a322c; max-height:calc(100dvh - 110px); overflow:auto; }
#annotation-panel[hidden], #ink-status[hidden] { display:none; }
.panel-heading,.ink-settings { display:flex; align-items:center; justify-content:space-between; }
.panel-heading strong { font-size:15px; }
#annotation-dock #palette-grip { border:0; background:transparent; width:32px; height:28px; cursor:grab;
  touch-action:none; font-size:23px; line-height:1; color:#537267; }
.drawing-tools { display:grid; grid-template-columns:repeat(4,1fr); gap:3px; margin:6px 0 10px; }
#annotation-dock .drawing-tools button { height:50px; padding:4px 0; border:1px solid transparent; border-radius:7px;
  background:transparent; font-size:11px; }
.drawing-tools svg { width:19px; }
#annotation-dock .drawing-tools [aria-pressed="true"] { background:#e0ede5; border-color:#a9c6b6; }
.ink-settings { border-top:1px solid #d6e1da; padding-top:8px; gap:6px; }
.ink-settings label { white-space:nowrap; }
.ink-settings label[for="ink-width"] { margin-inline-start:auto; }
#ink-color, #ink-width {
  height:36px; border:1px solid #b7c8be; border-radius:6px; background:white;
  color:inherit; font:inherit; cursor:pointer;
}
#ink-color { width:36px; padding:3px; }
#ink-width { min-width:46px; }
.ink-history { display:grid; grid-template-columns:repeat(2,1fr); gap:6px; margin-top:8px; }
#annotation-dock .ink-history button { min-height:40px; gap:5px; padding:4px 8px; }
.ink-history svg { width:16px; }
#ink-status { display:block; margin-top:6px; }
