/* split.css — Bible Parlor split-screen shell.
   Modern redesign v7 — glassmorphic bar, animated divider, smooth picker,
   orientation toggle, pane-reload, keyboard shortcut overlay.
   Light + dark mode via data-theme-early. */

/* ── Design tokens ── */
:root {
  --split-bar-h: 52px;

  /* Burgundy accent */
  --acc: #7a1f2b;
  --acc-h: #661820;
  --acc-glow: rgba(122, 31, 43, .28);
  --acc-tint: rgba(122, 31, 43, .10);
  --acc-border: rgba(122, 31, 43, .26);

  /* Light mode palette */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --ink-muted: #a1a1aa;

  /* Bar (always dark) */
  --bar-bg: rgba(10,10,12,.97);
  --bar-border: rgba(255,255,255,.07);
  --bar-ink: #f0f0f2;
  --bar-ink-2: #b0b0ba;
  --bar-ink-3: #6a6a78;
  --bar-surface: rgba(255,255,255,.055);
  --bar-surface-h: rgba(255,255,255,.10);

  /* Divider */
  --divider-w: 6px;
  --divider-grab: 18px;

  /* Radii */
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  --shadow-dialog: 0 32px 80px rgba(0,0,0,.20), 0 8px 24px rgba(0,0,0,.10);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
}

[data-theme-early="dark"] {
  --bg: #050505;
  --surface: #111113;
  --surface-2: #1a1a1d;
  --surface-3: #222226;
  --border: #2c2c30;
  --border-strong: #3c3c42;
  --ink: #ebebed;
  --ink-2: #9898a6;
  --ink-3: #6a6a78;
  --ink-muted: #48484e;
  --acc: #b03444;
  --acc-h: #c64557;
  --acc-glow: rgba(176, 52, 68, .32);
  --acc-tint: rgba(176, 52, 68, .12);
  --acc-border: rgba(176, 52, 68, .30);
  --shadow-dialog: 0 32px 80px rgba(0,0,0,.70), 0 8px 24px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #080809;
  color: var(--bar-ink);
  font: 14px/1.4 "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#split-root { display: flex; flex-direction: column; height: 100dvh; width: 100vw; }

/* Row wrapper that holds #split-panes + #costudy-panel side by side */
#split-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════
   TOP BAR — glass dark strip with accent underline
   ════════════════════════════════════════════════════════════ */
#split-bar {
  height: var(--split-bar-h);
  flex: 0 0 var(--split-bar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--bar-border);
  position: relative;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Accent line at bottom of bar */
#split-bar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--acc) 35%, var(--acc) 65%, transparent 100%);
  opacity: .55;
  pointer-events: none;
}

/* ── Brand ── */
.split-brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--bar-ink); text-decoration: none;
  font: 500 15px/1 "EB Garamond", Georgia, serif;
  padding-right: 14px;
  border-right: 1px solid var(--bar-border);
  height: 24px;
  flex: 0 0 auto;
  transition: opacity .15s;
}
.split-brand:hover { opacity: .75; }
.split-brand svg { flex: 0 0 auto; filter: drop-shadow(0 0 5px rgba(122,31,43,.55)); }
.split-brand span { transform: translateY(-1px); letter-spacing: .01em; }

/* ── Pane labels ── */
.split-panes-labels {
  display: flex; gap: 5px; flex: 1 1 auto; min-width: 0; overflow: hidden;
}

.split-tool-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px 0 8px;
  height: 34px;
  background: var(--bar-surface);
  color: var(--bar-ink);
  border: 1px solid var(--bar-border);
  border-radius: 999px;
  font: 500 12px/1 "Inter", system-ui;
  cursor: pointer;
  min-width: 0; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.split-tool-btn:hover {
  border-color: var(--acc-border);
  background: var(--bar-surface-h);
  box-shadow: 0 0 0 3px var(--acc-tint);
}
.split-tool-btn:active { transform: scale(.97); }

.split-tool-side {
  font-size: 9px; text-transform: uppercase; letter-spacing: .10em;
  color: var(--bar-ink-3); font-weight: 700;
  flex: 0 0 auto;
}
.split-tool-name {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 18ch;
  color: var(--bar-ink);
}
.split-tool-btn::after {
  content: "\25be";
  color: var(--bar-ink-3); font-size: 9px; margin-left: 3px; flex: 0 0 auto;
}

/* ── Reload button inside the pane-label button group ── */
.split-reload-btn {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--bar-surface);
  color: var(--bar-ink-3);
  border: 1px solid var(--bar-border);
  border-radius: var(--r-md);
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color .15s, background .15s, color .15s, transform .3s;
  opacity: 0.28; pointer-events: none;
}
/* Show reload buttons when hovering or focusing the label group */
.split-panes-labels:hover .split-reload-btn,
.split-panes-labels:focus-within .split-reload-btn {
  opacity: 1; pointer-events: auto;
}
.split-reload-btn:hover {
  border-color: var(--acc-border); background: var(--acc-tint); color: var(--bar-ink);
}
.split-reload-btn.spinning svg { animation: spin360 .5s linear; }

@keyframes spin360 {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Controls ── */
.split-controls {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding-left: 10px;
  border-left: 1px solid var(--bar-border);
}

/* Link-to-reader pill toggle */
.split-sync {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12px/1 "Inter", system-ui;
  color: var(--bar-ink-2); user-select: none; cursor: pointer;
  padding: 0 12px;
  height: 30px;
  border: 1px solid var(--bar-border); border-radius: var(--r-lg);
  background: var(--bar-surface);
  transition: border-color .15s, background .15s, color .15s;
}
.split-sync:hover {
  border-color: var(--acc-border); color: var(--bar-ink); background: var(--bar-surface-h);
}
.split-sync:has(input:checked) {
  border-color: var(--acc-border); background: var(--acc-tint); color: var(--bar-ink);
}
.split-sync input { accent-color: var(--acc); width: 12px; height: 12px; margin: 0; }

/* Icon buttons (swap, orient, shortcuts, exit) */
.split-icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--bar-surface);
  color: var(--bar-ink-2);
  border: 1px solid var(--bar-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s, box-shadow .15s;
  flex: 0 0 auto;
}
.split-icon-btn:hover {
  background: var(--bar-surface-h); border-color: var(--acc-border); color: var(--bar-ink);
}
.split-icon-btn:active { transform: scale(.92); }

/* Active state for orientation toggle */
.split-icon-btn.active {
  background: var(--acc-tint);
  border-color: var(--acc-border);
  color: var(--acc);
}

/* Separator between swap and exit */
.split-ctrl-sep {
  width: 1px; height: 20px;
  background: var(--bar-border);
  flex: 0 0 1px;
}

/* ════════════════════════════════════════════════════════════
   PANES
   ════════════════════════════════════════════════════════════ */
#split-panes {
  flex: 1 1 auto; min-height: 0; min-width: 0;
  display: flex; flex-direction: row;
}

.split-pane {
  flex: 1 1 50%; min-width: 0; min-height: 0;
  position: relative; display: flex;
  transition: flex .12s;
}
.split-pane iframe {
  flex: 1 1 auto; width: 100%; height: 100%; border: 0;
  background: var(--surface);
}

/* ── Divider ── */
#split-divider {
  flex: 0 0 var(--divider-w);
  background: rgba(255,255,255,.04);
  cursor: col-resize;
  position: relative;
  transition: background .18s;
  z-index: 10;
}
/* Wide invisible grab zone */
#split-divider::after {
  content: ""; position: absolute; inset: 0 -6px;
  z-index: 1;
}
/* Visible grip pill */
#split-divider::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 3px; height: 42px;
  background: rgba(255,255,255,.14);
  border-radius: 3px;
  transform: translate(-50%, -50%);
  transition: background .18s, height .18s, box-shadow .18s;
  z-index: 2;
  pointer-events: none;
}
#split-divider:hover {
  background: rgba(255,255,255,.07);
}
#split-divider:hover::before,
#split-divider:focus-visible::before {
  background: var(--acc);
  height: 56px;
  box-shadow: 0 0 12px var(--acc-glow);
}
#split-divider:focus-visible {
  outline: none;
  background: var(--acc-tint);
}

body.split-dragging { user-select: none; cursor: col-resize; }
body.split-dragging.split-vert { cursor: row-resize; }
body.split-dragging .split-pane iframe { pointer-events: none; }

/* Active drag — glow the pill */
body.split-dragging #split-divider { background: rgba(255,255,255,.08); }
body.split-dragging #split-divider::before {
  background: var(--acc);
  height: 60px;
  box-shadow: 0 0 16px var(--acc-glow);
}

/* ── Vertical layout (tablet portrait / narrow) ── */
@media (max-width: 900px), (orientation: portrait) and (max-width: 1180px) {
  #split-panes { flex-direction: column; }
  #split-divider { cursor: row-resize; }
  #split-divider::after { inset: -6px 0; }
  #split-divider::before { width: 42px; height: 3px; }
}

/* ── Forced layout orientation via data-orient attribute ── */
#split-root[data-orient="col"] #split-panes { flex-direction: column; }
#split-root[data-orient="row"] #split-panes { flex-direction: row !important; }

#split-root[data-orient="col"] #split-divider { cursor: row-resize; }
#split-root[data-orient="col"] #split-divider::after { inset: -6px 0; }
#split-root[data-orient="col"] #split-divider::before { width: 42px; height: 3px; }

/* ── Phone: stack the panes and offer a single-pane toggle ── */
.split-mobile-only { display: none; }

@media (max-width: 640px) {
  /* Keep split view usable on phones: panes stack vertically (see the ≤900px
     rule) and #split-mobile-toggle cycles both / left-only / right-only. */
  #split-bar {
    flex: 0 0 auto;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--split-bar-h);
    padding: 6px 10px;
    gap: 6px;
  }
  .split-panes-labels { flex: 1 1 auto; }
  .split-controls { border-left: none; padding-left: 0; }
  .split-mobile-only { display: inline-grid; }

  /* Co-Study panel overlays instead of squeezing the panes in the flex row. */
  #split-content { position: relative; }
  #split-content #costudy-panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    height: 100%;
    z-index: 30;
    box-shadow: var(--shadow-dialog);
  }

  /* Single-pane modes hide the sibling pane and the divider. */
  #split-root[data-mobile-view="L"] .split-pane[data-side="R"],
  #split-root[data-mobile-view="R"] .split-pane[data-side="L"],
  #split-root[data-mobile-view="L"] #split-divider,
  #split-root[data-mobile-view="R"] #split-divider {
    display: none !important;
  }
}

/* ════════════════════════════════════════════════════════════
   TOOL PICKER  v6 — animated slide-up + fade, modern cards
   ════════════════════════════════════════════════════════════ */

/* Backdrop */
#tool-picker::backdrop {
  background: rgba(4,4,6,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dialog shell */
#tool-picker {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(560px, 96vw);
  max-height: min(88vh, 700px);
}

/* Entry animation */
@keyframes pickerIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#tool-picker[open] {
  animation: pickerIn .18s cubic-bezier(.22,1,.36,1) both;
}
#tool-picker[open]::backdrop {
  animation: backdropIn .18s ease both;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Inner card */
.tp-inner {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  width: 100%;
  max-height: min(88vh, 700px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Picker header ── */
.tp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  background: var(--surface);
}
.tp-head-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tp-head-side {
  display: inline-flex; align-items: center; gap: 7px;
  font: 700 10px/1 "Inter", system-ui;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.tp-head-side-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc);
  flex: 0 0 7px;
  box-shadow: 0 0 6px var(--acc-glow);
}
#tp-title {
  font: 600 17px/1.2 "EB Garamond", Georgia, serif;
  color: var(--ink);
  display: block;
}
.tp-close {
  border: 0; background: transparent; color: var(--ink-3);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  flex: 0 0 32px;
  border-radius: var(--r-md); cursor: pointer;
  transition: background .12s, color .12s;
}
.tp-close:hover { background: var(--surface-2); color: var(--ink); }

/* ── Body ── */
.tp-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px 6px;
  background: var(--bg);
  scroll-behavior: smooth;
}
.tp-body::-webkit-scrollbar { width: 4px; }
.tp-body::-webkit-scrollbar-track { background: transparent; }
.tp-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ── Section ── */
.tp-section { margin-bottom: 18px; }
.tp-section:last-child { margin-bottom: 6px; }
.tp-section-label {
  font: 700 10px/1 "Inter", system-ui;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 4px;
  margin-bottom: 7px;
}

.tp-filter-input {
  display: block;
  width: 100%;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font: 400 13px/1 "Inter", system-ui;
  padding: 0 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color .13s, box-shadow .13s;
}
.tp-filter-input:focus {
  border-color: var(--acc-border);
  box-shadow: 0 0 0 3px var(--acc-tint);
}
.tp-filter-input::placeholder { color: var(--ink-muted); }

.tp-empty-state {
  text-align: center;
  color: var(--ink-muted);
  font: 400 13px/1.5 "Inter", system-ui;
  padding: 24px 0;
}

.tp-list { display: flex; flex-direction: column; gap: 4px; }

/* ── Tool row ── */
.tp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color .13s, background .13s, box-shadow .13s, transform .1s;
  position: relative;
}
.tp-row:hover {
  border-color: var(--acc-border);
  box-shadow: 0 0 0 3px var(--acc-tint);
}
.tp-row:active { transform: scale(.993); }

.tp-row.tp-row--active {
  border-color: var(--acc-border);
  background: var(--acc-tint);
  box-shadow: 0 0 0 3px var(--acc-tint);
}
.tp-row.tp-row--other { opacity: .60; }
.tp-row.tp-row--other:hover { opacity: 1; }

/* Row icon */
.tp-row-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background .13s, border-color .13s;
}
.tp-row--active .tp-row-icon { background: var(--acc-tint); border-color: var(--acc-border); }
.tp-row:hover .tp-row-icon    { background: var(--acc-tint); border-color: var(--acc-border); }
.tp-row-icon svg { display: block; }

/* Row text */
.tp-row-body { flex: 1 1 auto; min-width: 0; }
.tp-row-name {
  font: 600 13.5px/1.2 "Inter", system-ui;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tp-row-sub {
  font: 400 11.5px/1.3 "Inter", system-ui;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* State badge */
.tp-row-badge {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  font: 700 9px/1 "Inter", system-ui;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tp-row-badge--active { background: var(--acc-tint); color: var(--acc); border: 1px solid var(--acc-border); }
.tp-row-badge--other  { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border); }

/* ── Footer: custom URL ── */
.tp-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}
.tp-foot-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 "Inter", system-ui;
  color: var(--ink-3);
  background: none; border: 0; padding: 2px 0;
  cursor: pointer;
  transition: color .13s;
}
.tp-foot-toggle:hover { color: var(--ink); }
.tp-foot-toggle svg { transition: transform .2s; }
.tp-foot-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tp-foot-custom {
  display: none; flex-direction: column; gap: 8px;
  margin-top: 10px;
}
.tp-foot-custom.open { display: flex; }
.tp-foot-custom-label {
  font: 700 10px/1 "Inter", system-ui;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}
.tp-url-row { display: flex; gap: 8px; align-items: stretch; }
.tp-url-row input {
  flex: 1 1 auto;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font: 400 13px "Inter", system-ui;
  color: var(--ink);
  background: var(--bg);
  transition: border-color .13s, box-shadow .13s;
  min-width: 0;
}
.tp-url-row input::placeholder { color: var(--ink-muted); }
.tp-url-row input:focus {
  outline: none;
  border-color: var(--acc-border);
  box-shadow: 0 0 0 3px var(--acc-tint);
}
.tp-go {
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--acc);
  color: #fff;
  font: 600 13px "Inter", system-ui;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s, box-shadow .13s;
  flex: 0 0 auto;
}
.tp-go:hover { background: var(--acc-h); box-shadow: 0 0 0 3px var(--acc-tint); }

/* ════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUT OVERLAY
   ════════════════════════════════════════════════════════════ */
#shortcut-overlay {
  border: 0; padding: 0; background: transparent;
  box-shadow: none; overflow: visible;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(440px, 94vw);
}
#shortcut-overlay::backdrop {
  background: rgba(4,4,6,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes overlayIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#shortcut-overlay[open] { animation: overlayIn .2s cubic-bezier(.22,1,.36,1) both; }

.sc-inner {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}
.sc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.sc-head strong {
  font: 600 16px/1.2 "EB Garamond", Georgia, serif;
  color: var(--ink);
}
.sc-close {
  border: 0; background: transparent; color: var(--ink-3);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-md); cursor: pointer;
  transition: background .12s, color .12s;
}
.sc-close:hover { background: var(--surface-2); color: var(--ink); }
.sc-body { padding: 16px 20px 20px; }
.sc-list { display: flex; flex-direction: column; gap: 10px; }
.sc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sc-desc {
  font: 400 13px/1.3 "Inter", system-ui;
  color: var(--ink-2);
}
.sc-keys { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.sc-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font: 600 11px/1 "Inter", system-ui;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

/* ── Toast ── */
.split-toast {
  position: fixed;
  bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(18,18,20,.95);
  color: #f5f5f7;
  font: 500 12.5px/1 "Inter", system-ui;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.split-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tp-row, #split-divider, .split-tool-btn, .split-icon-btn,
  .split-sync, .tp-go, .split-toast, .tp-foot-toggle svg,
  #tool-picker, #shortcut-overlay, .split-pane, .split-reload-btn { transition: none; animation: none !important; }
}

/* ── Mobile improvements ────────────────────────────────────── */

/* Tool picker: slide up from bottom on mobile phones */
@media (max-width: 640px) {
  #tool-picker {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: min(90vh, 90dvh);
  }
  @keyframes pickerIn {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  #tool-picker[open] { animation: pickerIn .18s cubic-bezier(.22,1,.36,1) both; }
  .tp-inner {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: min(90vh, 90dvh);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tp-head { padding: 16px 16px 12px; }
  .tp-body { padding: 12px 12px 4px; }
  .tp-foot { padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0)); }
  /* Tool rows: slightly taller touch targets */
  .tp-row { padding: 13px 12px; }
  /* URL input: prevent iOS zoom */
  .tp-url-row input { font-size: 16px; }
}

/* Shortcut overlay: on small screens show as bottom sheet too */
@media (max-width: 520px) {
  #shortcut-overlay {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
  }
  @keyframes overlayIn {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .sc-inner {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .sc-body { padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0)); }
}

/* Touch targets: split bar buttons */
@media (pointer: coarse) {
  .split-tool-btn { min-height: 44px; min-width: 44px; }
  .split-icon-btn { min-width: 44px; min-height: 44px; }
  .tp-close { width: 44px; height: 44px; flex: 0 0 44px; }
  .sc-close  { width: 44px; height: 44px; }
  .tp-row    { min-height: 52px; }
  .tp-go     { min-height: 44px; }
  .tp-foot-toggle { min-height: 40px; }
}

/* Toast: above safe-area on phones */
@media (max-width: 640px) {
  .split-toast { bottom: calc(16px + env(safe-area-inset-bottom, 0)); }
}

/* ════════════════════════════════════════════════════════════
   PARALLEL PASSAGE STRIP (Scholar tier)
   ════════════════════════════════════════════════════════════ */
#parallel-strip {
  overflow: hidden;
  max-height: 0;
  transition: max-height .2s ease;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--bar-border);
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  z-index: 15;
  position: relative;
}
#parallel-strip.pp-active {
  max-height: 44px;
}
#parallel-strip.pp-collapsed {
  max-height: 4px;
  background: var(--acc);
  border-bottom: none;
  cursor: pointer;
}

.pp-body {
  flex: 1 1 auto;
  overflow-x: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 12px;
  scrollbar-width: none;
  min-height: 44px;
}
.pp-body::-webkit-scrollbar { display: none; }

.pp-label {
  flex: 0 0 auto;
  font: 700 9px/1 "Inter", system-ui;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--bar-ink-3);
  white-space: nowrap;
  padding-right: 2px;
}

.pp-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--acc-border);
  background: var(--acc-tint);
  color: var(--bar-ink);
  font: 500 11.5px/1 "Inter", system-ui;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.pp-pill:hover {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.pp-pill:active { transform: scale(.96); }

.pp-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font: 400 12px/1 "Inter", system-ui;
  color: var(--bar-ink-3);
}
.pp-locked-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--acc-tint);
  color: var(--acc);
  border: 1px solid var(--acc-border);
  font: 700 9px/1 "Inter", system-ui;
  letter-spacing: .08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.pp-locked-text { color: var(--bar-ink-2); }
.pp-locked-link {
  color: var(--acc);
  text-decoration: none;
  font-weight: 600;
}
.pp-locked-link:hover { text-decoration: underline; }

.pp-collapse-btn {
  flex: 0 0 28px;
  width: 28px;
  align-self: stretch;
  border: none;
  background: transparent;
  color: var(--bar-ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .12s, transform .2s;
  flex-shrink: 0;
}
.pp-collapse-btn:hover { color: var(--bar-ink); }

#parallel-strip.pp-collapsed .pp-body,
#parallel-strip.pp-collapsed .pp-collapse-btn {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #parallel-strip, .pp-pill, .pp-collapse-btn { transition: none !important; animation: none !important; }
}

/* ════════════════════════════════════════════════════════════
   TRANSLATION COMPARE OVERLAY (Phase 4)
   Mirrors the adjacent KJV Reader pane with public-domain
   translations from /api/compare-verse.
   ════════════════════════════════════════════════════════════ */
.split-compare {
  position: absolute; inset: 0; z-index: 14;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  overflow: hidden;
}
.split-compare.show { opacity: 1; transform: none; }

.sc2-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.sc2-head-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sc2-title { font: 600 12px/1 "Inter", system-ui; color: var(--ink); white-space: nowrap; }
.sc2-ref {
  font: 600 11px/1 "Inter", system-ui; color: var(--acc);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc2-head-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.sc2-icon {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-3);
  border-radius: var(--r-md); cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.sc2-icon:hover { color: var(--ink); border-color: var(--acc-border); background: var(--acc-tint); }

.sc2-pills {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 5px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.sc2-pill {
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2);
  font: 600 11px/1 "Inter", system-ui; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.sc2-pill:hover { border-color: var(--acc-border); color: var(--ink); }
.sc2-pill.active { background: var(--acc-tint); border-color: var(--acc-border); color: var(--acc); }

.sc2-body {
  flex: 1 1 auto; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.sc2-block {
  padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.sc2-ver {
  font: 700 9px/1 "Inter", system-ui; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 5px;
}
.sc2-text {
  font: 400 15px/1.7 "EB Garamond", Georgia, serif; color: var(--ink);
  white-space: pre-line;
}
.sc2-muted { color: var(--ink-3); }
.sc2-empty { color: var(--ink-3); font: 400 13px/1.5 "Inter", system-ui; padding: 8px 2px; }

/* ════════════════════════════════════════════════════════════
   WORKSPACES DIALOG (Phase 4)
   ════════════════════════════════════════════════════════════ */
#workspace-dialog {
  border: 0; padding: 0; background: transparent; box-shadow: none;
  overflow: visible;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%); margin: 0;
  width: min(560px, 94vw);
  max-height: min(88vh, 720px);
}
#workspace-dialog::backdrop {
  background: rgba(4,4,6,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@keyframes wsIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#workspace-dialog[open] { animation: wsIn .18s cubic-bezier(.22,1,.36,1) both; }

.ws-inner {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-2xl);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-dialog); overflow: hidden;
  max-height: min(88vh, 720px);
}
.ws-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.ws-head strong { font: 600 16px/1.2 "EB Garamond", Georgia, serif; color: var(--ink); }
.ws-close {
  border: 0; background: transparent; color: var(--ink-3);
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: var(--r-md); cursor: pointer;
  transition: background .12s, color .12s;
}
.ws-close:hover { background: var(--surface-2); color: var(--ink); }
.ws-body { padding: 14px 18px 18px; overflow-y: auto; }
.ws-label {
  font: 700 10px/1 "Inter", system-ui; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 7px;
}
.ws-share { margin-bottom: 16px; }
.ws-share-row, .ws-save-row { display: flex; gap: 8px; align-items: stretch; }
.ws-share-row input, .ws-save-row input {
  flex: 1 1 auto; min-width: 0;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); color: var(--ink); font: 400 13px "Inter", system-ui;
}
.ws-share-row input { color: var(--ink-2); }
.ws-share-row input:focus, .ws-save-row input:focus {
  outline: none; border-color: var(--acc-border); box-shadow: 0 0 0 3px var(--acc-tint);
}
.ws-save-row input::placeholder { color: var(--ink-muted); }
.ws-hint { margin-top: 6px; font: 400 11.5px/1.4 "Inter", system-ui; color: var(--ink-muted); }
.ws-hint code { font: 500 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-3); }
.ws-btn {
  padding: 0 16px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
  font: 600 13px "Inter", system-ui; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.ws-btn:hover { border-color: var(--acc-border); }
.ws-btn-primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.ws-btn-primary:hover { background: var(--acc-h); border-color: var(--acc-h); box-shadow: 0 0 0 3px var(--acc-tint); }
.ws-list-head {
  font: 700 10px/1 "Inter", system-ui; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted); margin: 4px 0 8px;
}
.ws-list { display: flex; flex-direction: column; gap: 6px; }
.ws-empty { color: var(--ink-3); font: 400 13px/1.5 "Inter", system-ui; padding: 10px 2px; }
.ws-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
}
.ws-row-main { min-width: 0; }
.ws-row-name {
  font: 600 13.5px/1.2 "Inter", system-ui; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-row-meta {
  font: 400 11.5px/1.3 "Inter", system-ui; color: var(--ink-3);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-row-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.ws-mini {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font: 600 11px "Inter", system-ui; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.ws-mini:hover { border-color: var(--acc-border); color: var(--ink); }
.ws-mini-danger:hover { border-color: var(--acc); color: var(--acc); }

@media (max-width: 520px) {
  #workspace-dialog { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; }
  @keyframes wsIn {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .ws-inner { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom, 0); }
  .ws-body { padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0)); }
}

@media (pointer: coarse) {
  .sc2-icon { width: 34px; height: 34px; }
  .ws-close { width: 44px; height: 44px; }
  .ws-btn { min-height: 44px; }
  .ws-mini { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .split-compare, #workspace-dialog, .sc2-icon, .sc2-pill, .ws-btn, .ws-mini { transition: none !important; animation: none !important; }
}
