/* All selectors are scoped to Three Times Highlights. No theme metadata changes. */
mark.tth-mark {
  background:rgba(247,220,117,.42)!important;
  color:inherit!important;
  padding:0!important;
  border:0!important;
  border-radius:1px;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
mark.tth-mark:focus-visible { outline:2px solid #228b22; outline-offset:2px; }
.tth-toolbar[hidden],.tth-toast[hidden]{display:none!important}
.tth-toolbar{
  position:fixed; z-index:2147481000;
  display:flex;align-items:center;gap:0;
  max-width:calc(100vw - 24px);
  background:#fff;color:#111;border:1px solid #dcdcdc;border-radius:10px;
  box-shadow:0 3px 15px rgba(0,0,0,.1);
  overflow:hidden;-webkit-tap-highlight-color:transparent;
}
.tth-toolbar button{
  appearance:none;-webkit-appearance:none; border:0!important;border-radius:0!important;
  background:transparent!important;color:#111!important;
  box-shadow:none!important;text-shadow:none!important;text-decoration:none!important;
  padding:13px 12px!important;margin:0!important;white-space:nowrap;
  font-family:inherit;font-size:11px;font-weight:500;letter-spacing:.055em;line-height:1.2;
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.tth-toolbar button+button{border-left:1px solid #e5e5e5!important}
.tth-toolbar button:hover{background:#f7f7f7!important;text-decoration:none!important}
.tth-toolbar button:focus-visible{outline:2px solid #228b22!important;outline-offset:-3px}
/* Editorial confirmation, anchored directly above the floating Reader Hub. */
.tth-toast{
  position:fixed; z-index:2147481001;
  left:var(--tth-toast-left, 50%);
  bottom:var(--tth-toast-bottom, calc(100px + env(safe-area-inset-bottom, 0px)));
  transform:translate(-50%, 6px);
  opacity:0;
  transition:opacity .2s ease, transform .2s ease;
  background:#fff!important; color:#111!important;
  border:1px solid var(--ctt-rule, rgba(17,17,17,.16))!important;
  border-radius:9px;
  padding:10px 13px;
  box-shadow:none!important;
  font-family:inherit; font-weight:500;
  font-size:12px;
  line-height:1.35;
  letter-spacing:0;
  max-width:calc(100vw - 24px);
  white-space:nowrap;
  text-align:center;
  pointer-events:none;
  -webkit-tap-highlight-color:transparent;
}
.tth-toast.tth-toast--visible{opacity:1;transform:translate(-50%, 0)}
@media(prefers-reduced-motion:reduce){
  .tth-toast{transition:none!important;transform:translate(-50%,0)!important}
}
@media(prefers-reduced-motion:reduce){.tth-toolbar,.tth-toast{transition:none!important;animation:none!important}}

/* On touch devices, keep the passage tools out of iOS's native selection menu.
   The dock sits above the existing Three Times Reader Hub and safe area. */
@media (pointer: coarse) and (max-width: 850px) {
  .tth-toolbar.tth-toolbar--dock {
    position:fixed!important;
    left:50%!important;
    top:auto!important;
    bottom:calc(114px + env(safe-area-inset-bottom, 0px))!important;
    transform:translateX(-50%)!important;
    width:max-content;
    max-width:calc(100vw - 24px);
    justify-content:center;
    box-shadow:0 3px 12px rgba(0,0,0,.08);
  }
}

/* Temporary selection preview: never persisted until Highlight is chosen. */
::highlight(tth-selection-preview){background:rgba(247,220,117,.32);color:inherit;}
.tth-selection-preview-overlay{position:absolute;inset:0;pointer-events:none;z-index:5000;}
