/* ══════════════════════════════════════════════════════════
   SORTING TORAH — sortingtorah.css
   SortingTorah-specific component styles.
   Shared tokens and utilities live in /assets/css/main.css.
   ══════════════════════════════════════════════════════════ */

/* ── 0. LUCIDE ICON DEFAULTS ─────────────────────────────── */
[data-lucide] {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── 1. INTRO OVERLAY & COLLAPSED BAR ───────────────────── */
#st-intro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: var(--navy-deep);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

#st-intro-inner {
  text-align: center;
  max-width: 960px;
  padding: 0 64px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
#st-intro-inner .st-verse p {
  font-size: clamp(34px, 5.2vw, 48px);
  color: var(--parchment);
  line-height: 1.75;
}
#st-intro-inner .st-verse-label { color: rgba(184,137,60,0.75); }
#st-intro-inner .st-verse-sub   { color: rgba(245,237,216,0.55); font-size: 28px; }
#st-intro-inner .st-verse-sub em { color: var(--gold); }

.st-intro-skip {
  margin-top: 40px;
  font-size: 20px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245,237,216,0.3);
}

/* Pause button */
#st-intro-pause {
  position: absolute;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245,237,216,0.35);
  cursor: default;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
#st-pause-ring {
  position: absolute;
  inset: 0;
  /* Start at 12 o'clock; scaleX(-1) makes it drain counter-clockwise */
  transform: rotate(-90deg) scaleX(-1);
  pointer-events: none;
}
#st-intro-pause:hover {
  background: rgba(184,137,60,0.14);
  border-color: var(--gold);
  color: var(--gold);
}
#st-intro-pause.paused {
  background: rgba(184,137,60,0.14);
  border-color: var(--gold);
  color: var(--gold);
}

#st-intro-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  padding: 0 120px;
  pointer-events: none;
  transition: background 0.2s;
}
/* After collapse, pointer-events re-enabled via JS and bar becomes clickable */
#st-intro-bar.clickable {
  pointer-events: auto;
  cursor: pointer;
}
#st-intro-bar.clickable:hover { background: rgba(255,255,255,0.04); }
.st-bar-quote {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(12px, 1.4vw, 15px);
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-bar-sep {
  color: var(--gold);
  opacity: 0.5;
  flex-shrink: 0;
  font-size: 10px;
}
.st-bar-ref {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  flex-shrink: 0;
}

/* Left/right groups in the collapsed bar */
#st-bar-left,
#st-bar-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
}
#st-bar-left  { left: 24px; }
#st-bar-right { right: 24px; }

#st-help-link,
#st-publish-btn,
#st-export-btn,
#st-directory-btn,
#st-tour-btn,
#st-list-link,
#st-copyright {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--ff-sans);
}
#st-help-link:hover,
#st-publish-btn:hover,
#st-export-btn:hover,
#st-directory-btn:hover,
#st-tour-btn:hover,
#st-list-link:hover,
#st-copyright:hover { color: var(--gold); }

.st-bar-left-sep {
  color: rgba(255,255,255,0.3);
  font-size: 8px;
  line-height: 1;
}

/* ── GUIDE MODAL ─────────────────────────────────────────── */
#st-guide-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-guide-modal.visible { display: flex; }

#st-guide-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#st-guide-header {
  background: var(--navy-deep);
  padding: 24px 28px 20px;
  flex-shrink: 0;
  position: relative;
}
#st-guide-eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
#st-guide-title {
  font-family: var(--ff-serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--parchment);
  margin: 0;
}
#st-guide-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(245,237,216,0.5);
  transition: background 0.15s, color 0.15s;
}
#st-guide-close:hover { background: rgba(255,255,255,0.14); color: var(--parchment); }

#st-guide-tabs {
  display: flex;
  background: var(--navy-deep);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0 28px;
  gap: 4px;
  flex-shrink: 0;
}
.stg-tab {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,237,216,0.45);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.stg-tab:hover { color: rgba(245,237,216,0.8); }
.stg-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.stg-panel {
  overflow-y: auto;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stg-panel[hidden] { display: none; }

.stg-ol {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  margin: 4px 0 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stg-ol li strong { color: var(--ink); font-weight: 600; }
.stg-ol li em { color: var(--gold); font-style: italic; }

.stg-verse {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  padding: 14px 16px;
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
}
.stg-verse span {
  font-style: normal;
  font-size: 11px;
  font-family: var(--ff-sans);
  color: var(--ink-light);
  display: block;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.stg-section { display: flex; flex-direction: column; gap: 6px; }
.stg-heading {
  font-family: var(--ff-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--navy-deep);
  margin: 0;
}
.stg-section p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
.stg-section p em { color: var(--gold); font-style: italic; }
.stg-section p strong { color: var(--ink); font-weight: 600; }

.stg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.stg-table tr { border-bottom: 1px solid var(--border); }
.stg-table tr:last-child { border-bottom: none; }
.stg-table td {
  padding: 7px 0;
  color: var(--ink);
  line-height: 1.4;
}
.stg-table td:first-child {
  font-weight: 600;
  color: var(--navy-deep);
  width: 110px;
  padding-right: 12px;
}

.stg-full-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-decoration: none;
  text-align: right;
  padding-top: 4px;
  transition: opacity 0.15s;
}
.stg-full-link:hover { opacity: 0.7; }

/* ── VERSE MODAL ─────────────────────────────────────────── */
#st-verse-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-verse-modal.visible { display: flex; }

#st-verse-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 32px 32px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#st-verse-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-light);
  transition: color 0.15s, border-color 0.15s;
}
#st-verse-close:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }

.stv-ref {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.stv-quote {
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--gold);
}
.stv-quote p {
  font-family: var(--ff-serif);
  font-size: clamp(16px, 2.2vw, 20px);
  font-style: italic;
  line-height: 1.75;
  color: var(--navy-deep);
  margin: 0;
}
.stv-quote p strong {
  font-style: normal;
  font-weight: 600;
  color: var(--navy-deep);
}

.stv-divider {
  height: 1px;
  background: var(--border);
}

.stv-note {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stv-note p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  margin: 0;
}
.stv-note p em { color: var(--gold); font-style: italic; }

.stv-reflection-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.stv-reflection-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
#st-verse-note {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--ff-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
#st-verse-note:focus { border-color: var(--gold); }
#st-verse-note::placeholder { color: var(--ink-light); opacity: 0.6; }
#st-verse-saved {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.3s;
}
#st-verse-saved.visible { opacity: 1; }

/* ── SHARED WORKSPACE MODAL ──────────────────────────────── */
#st-shared-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.65);
  backdrop-filter: blur(6px);
  z-index: 3500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-shared-modal.visible { display: flex; }

#st-shared-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#st-shared-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-light);
  transition: color 0.15s, border-color 0.15s;
}
#st-shared-close:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }
.sts-eyebrow {
  font-size: 9px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
}
.sts-name {
  font-family: var(--ff-serif); font-size: 26px; font-weight: 500;
  color: var(--navy-deep); margin: 0; line-height: 1.2;
}
.sts-meta {
  font-size: 11px; color: var(--ink-light); letter-spacing: 0.03em;
}
.sts-welcome {
  font-size: 13px; line-height: 1.7; color: var(--ink);
  padding: 12px 14px; background: var(--cream);
  border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0;
}
.sts-divider { height: 1px; background: var(--border); margin: 4px 0; }
.sts-reflection-label {
  font-size: 9px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.sts-reflection-text {
  font-size: 13px; line-height: 1.75; color: var(--ink); margin: 0;
  font-style: italic;
}
.sts-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sts-btn-primary {
  background: var(--navy-deep); color: var(--parchment);
  border: none; border-radius: 8px; padding: 12px 20px;
  font-family: var(--ff-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; cursor: pointer;
  transition: opacity 0.15s;
}
.sts-btn-primary:hover { opacity: 0.85; }
.sts-btn-secondary {
  text-align: center; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--ink-light); text-decoration: none;
  padding: 6px; transition: color 0.15s;
}
.sts-btn-secondary:hover { color: var(--ink); }

/* ── PUBLISH MODAL ───────────────────────────────────────── */
#st-publish-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-publish-modal.visible { display: flex; }

#st-publish-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  position: relative;
}

#stp-step-form, #stp-step-success {
  padding: 32px 32px 28px;
  display: flex; flex-direction: column; gap: 18px;
}

#st-publish-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: 1px solid var(--border);
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-light);
  transition: color 0.15s, border-color 0.15s;
}
#st-publish-close:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }

.stp-eyebrow {
  font-size: 9px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
}
.stp-title {
  font-family: var(--ff-serif); font-size: 24px; font-weight: 500;
  color: var(--navy-deep); margin: 0;
}
.stp-desc { font-size: 13px; line-height: 1.65; color: var(--ink-light); margin: 0; }

.stp-fields { display: flex; flex-direction: column; gap: 14px; }
.stp-field { display: flex; flex-direction: column; gap: 5px; }
.stp-field label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink);
}
.stp-field label span { font-weight: 400; color: var(--ink-light); text-transform: none; letter-spacing: 0; }
.stp-field input,
.stp-field textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-family: var(--ff-sans); font-size: 13px;
  line-height: 1.5; color: var(--ink); background: var(--cream);
  outline: none; resize: vertical; transition: border-color 0.2s;
}
.stp-field input:focus,
.stp-field textarea:focus { border-color: var(--gold); }
.stp-field input::placeholder,
.stp-field textarea::placeholder { color: var(--ink-light); opacity: 0.6; }

.stp-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.stp-error { font-size: 11px; color: #B91C1C; flex: 1; }
#stp-submit {
  background: var(--navy-deep); color: var(--parchment);
  border: none; border-radius: 8px; padding: 10px 24px;
  font-family: var(--ff-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.15s;
}
#stp-submit:hover { opacity: 0.85; }
#stp-submit:disabled { opacity: 0.4; cursor: default; }

/* Success step */
.stp-success-icon {
  color: var(--gold); display: flex; justify-content: center; padding: 8px 0 4px;
}
.stp-url-row {
  display: flex; gap: 8px; align-items: stretch;
}
#stp-url-output {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-family: var(--ff-sans); font-size: 11px;
  color: var(--ink); background: var(--cream); outline: none;
  min-width: 0;
}
#stp-copy-btn {
  background: var(--navy-deep); color: var(--parchment);
  border: none; border-radius: 8px; padding: 9px 16px;
  font-family: var(--ff-sans); font-size: 11px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: opacity 0.15s;
}
#stp-copy-btn:hover { opacity: 0.85; }
.stp-copied-msg { font-size: 11px; color: var(--gold); min-height: 16px; margin: 0; text-align: center; }
.stp-done-btn {
  align-self: center; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 24px; font-family: var(--ff-sans);
  font-size: 12px; font-weight: 500; color: var(--ink-light); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.stp-done-btn:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }

.stp-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
}
.stp-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.stp-checkbox-row label {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-light);
  cursor: pointer;
}

/* ── DIRECTORY MODAL ─────────────────────────────────────── */
#st-directory-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-directory-modal.visible { display: flex; }

#st-directory-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#st-directory-header {
  background: var(--navy-deep);
  padding: 22px 24px 18px;
  flex-shrink: 0;
  position: relative;
}
.std-eyebrow {
  font-size: 9px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.std-title {
  font-family: var(--ff-serif); font-size: 22px; font-weight: 500;
  color: var(--parchment); margin: 0;
}
#st-directory-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(245,237,216,0.5);
  transition: background 0.15s, color 0.15s;
}
#st-directory-close:hover { background: rgba(255,255,255,0.14); color: var(--parchment); }

#std-list {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}

.std-loading,
.std-empty {
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-light);
}

.std-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
}
.std-item:last-child { border-bottom: none; }
.std-item:hover { background: var(--cream); }

.std-item-name {
  font-family: var(--ff-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-deep);
  grid-column: 1;
  grid-row: 1;
  line-height: 1.3;
}
.std-item-meta {
  font-size: 11px;
  color: var(--ink-light);
  grid-column: 1;
  grid-row: 2;
  margin-top: 2px;
}
.std-item-arrow {
  font-size: 14px;
  color: var(--gold);
  grid-column: 2;
  grid-row: 1 / 3;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
}
.std-item:hover .std-item-arrow { opacity: 1; transform: translateX(2px); }

/* ── 1. CANVAS & BODY RESET ──────────────────────────────── */
.st-body {
  margin: 0;
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--ff-sans);
  color: var(--ink);
  transition: background 1.2s ease;
}
.st-body.act-iii-active { background: var(--parchment); }

#st-canvas {
  position: relative;
  min-height: 100vh;
  padding-right: var(--st-deck-w);
  transition: padding-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.deck-expanded #st-canvas { padding-right: 600px; }

/* ── 1b. STAGE (scaleable inner canvas) ──────────────────── */
#st-stage {
  position: relative;
  width: 100%;
  min-height: 100%;
  transform-origin: top left;
  cursor: grab;
}

/* Override cursor for everything during active pan */
#st-canvas.panning,
#st-canvas.panning * { cursor: grabbing !important; }

/* Marquee zoom — Cmd/Ctrl + drag */
#st-canvas.marquee-mode,
#st-canvas.marquee-mode * { cursor: crosshair !important; }

#st-marquee {
  position: fixed;
  border: 1.5px dashed rgba(184,137,60,0.75);
  background: rgba(184,137,60,0.07);
  border-radius: 3px;
  pointer-events: none;
  z-index: 9000;
}

/* ── 2. ACT I — PILLARS ──────────────────────────────────── */
.st-verse-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.st-verse { margin: 0 0 14px; padding: 0; }
.st-verse p {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 21px);
  line-height: 1.7;
  color: var(--ink);
}
.st-verse-sub { font-size: 13px; color: var(--ink-light); letter-spacing: 0.02em; line-height: 1.6; }
.st-verse-sub em { font-style: italic; color: var(--gold); }

/* Pillar row */
#act-pillars {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 48px 40px 0;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
}

.st-pillar {
  position: relative;
  width: 260px;
  min-height: 160px;
  background: var(--navy-deep);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 28px 24px 52px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(20,43,71,0.18);
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.st-pillar-label {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(184,137,60,0.7);
  margin-bottom: 10px;
}
.st-pillar-title {
  font-family: var(--ff-serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  color: var(--parchment);
  line-height: 1.2;
  margin-bottom: 8px;
}
.st-pillar-title em { font-style: italic; color: var(--gold-light); }
.st-pillar-sub { font-size: 11px; color: rgba(245,237,216,0.5); letter-spacing: 0.04em; }

/* Pillar hook */
.st-hook {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  z-index: 10;
  transition: filter 0.3s;
}
.st-hook.glow {
  color: var(--gold-light);
  filter: drop-shadow(0 0 8px rgba(184,137,60,0.7));
  animation: none;
}
@keyframes hookPulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(184,137,60,0.3)); }
  50%       { filter: drop-shadow(0 0 10px rgba(184,137,60,0.65)); }
}
.st-hook { animation: hookPulse 2.8s ease-in-out infinite; }

/* ── 3. SVG CONNECTORS ───────────────────────────────────── */
#connector-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── 4. ACT II — COMMANDMENT DECK ───────────────────────── */
:root { --st-deck-w: 168px; }

#act-deck {
  position: fixed;
  top: 56px;        /* sits below the collapsed intro bar */
  right: 0;
  bottom: 0;
  width: var(--st-deck-w);
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.deck-expanded #act-deck { width: 600px; }

#deck-toggle {
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 52px;
  background: var(--white);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  transition: color 0.2s, background 0.2s;
  z-index: 1;
}
#deck-toggle:hover {
  color: var(--gold);
  background: rgba(184,137,60,0.06);
}
#deck-toggle svg {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.deck-expanded #deck-toggle svg { transform: rotate(180deg); }

.st-deck-col-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-shrink: 0;
}
.st-deck-col-title {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.st-deck-col-count {
  font-family: var(--ff-serif);
  font-size: 13px;
  color: var(--gold);
}

.st-deck-hint {
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 10px 12px 6px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.4s;
  flex-shrink: 0;
}
.st-deck-hint.visible { opacity: 1; }

.st-deck-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.st-deck-row::-webkit-scrollbar { width: 4px; }
.st-deck-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

body.deck-expanded .st-deck-row {
  flex-flow: row wrap;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 12px 24px;
  gap: 16px;
}

body.deck-expanded #deck-search-section {
  flex-direction: row;
  align-items: center;
  gap: 7px;
}
body.deck-expanded #deck-search-input { flex: 1; min-width: 0; }
body.deck-expanded #deck-book-filter  { flex: 0 0 110px; }

#deck-search-section {
  padding: 8px 10px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
#deck-search-input,
#deck-book-filter {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--white);
  font-family: var(--ff-sans);
  font-size: 10px;
  color: var(--ink);
  padding: 5px 7px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
#deck-book-filter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  padding-right: 20px;
  cursor: pointer;
}
#deck-search-input:focus,
#deck-book-filter:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184,137,60,0.15);
}
#deck-search-input::placeholder { color: var(--ink-light); }

/* Commandment tile */
.st-cmd-tile {
  position: relative;
  width: 136px;
  min-height: 86px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 12px 24px;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, border-color 0.2s, background 0.3s ease, color 0.3s ease;
  touch-action: none;
}
.st-cmd-tile:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: rgba(184,137,60,0.4);
}
.st-cmd-tile.dragging {
  cursor: grabbing;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  border-color: var(--gold);
  z-index: 500;
}
.st-cmd-tile.placed {
  position: absolute;
  cursor: grab;
}
.st-cmd-tile.st-selected {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(184,137,60,0.18), 0 2px 8px rgba(0,0,0,0.06);
}

/* ── BULK COLOR PANEL ────────────────────────────────────── */
#st-bulk-color-panel {
  position: fixed;
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  z-index: 600;
}
.stbc-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.stbc-swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.stbc-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  background: var(--white);
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.stbc-swatch:hover  { transform: scale(1.15); border-color: rgba(0,0,0,0.25); }
.stbc-swatch.active { border-color: var(--gold); border-width: 2px; box-shadow: 0 0 0 1.5px var(--gold); }
.st-cmd-tile.has-children {
  background: #1E3F62;
  border-color: #4A80A8;
}
.st-cmd-tile.has-children .st-cmd-roman,
.st-cmd-tile.has-children .st-law-ref { color: #7DB4D4; }
.st-cmd-tile.has-children .st-cmd-title { color: #D8EAF4; }
.st-cmd-tile.has-children .st-cmd-text,
.st-cmd-tile.has-children .st-law-text { color: rgba(216,234,244,0.7); }
.st-cmd-tile.has-children .st-loop,
.st-cmd-tile.has-children .st-tile-hook { color: #7DB4D4; }

/* Loop ring (top of tile) */
.st-loop {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  transition: filter 0.2s;
}
.st-cmd-tile.near-hook .st-loop,
.st-cmd-tile.dragging .st-loop {
  filter: drop-shadow(0 0 5px rgba(184,137,60,0.6));
}

/* Hook (bottom of placed tile — accepts children) */
.st-tile-hook {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s, filter 0.2s;
  pointer-events: none;
}
.st-cmd-tile.placed .st-tile-hook {
  opacity: 0.45;
  pointer-events: auto;
}
.st-tile-hook.glow {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(184,137,60,0.65));
  animation: none;
}

.st-tile-note-dot {
  position: absolute;
  bottom: 8px;
  left: 10px;
  width: 12px;
  height: 12px;
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Trash button — only visible on hover of a placed tile */
.st-tile-trash {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 0;
  cursor: pointer;
  color: var(--ink-light);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, color 0.15s, background 0.15s;
}
.st-cmd-tile.placed:hover .st-tile-trash {
  opacity: 1;
  pointer-events: auto;
}
.st-tile-trash:hover {
  color: #C0392B;
  background: rgba(192,57,43,0.08);
}
.st-cmd-tile:hover .st-tile-note-dot { opacity: 1; }

.st-cmd-roman {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: var(--ff-serif);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.st-cmd-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 4px;
}
.st-cmd-text { font-size: 10px; color: var(--ink-light); line-height: 1.5; }

/* Law tile variant */
.st-law-tile { background: var(--parchment); border: 1.5px solid rgba(184,137,60,0.5); }
.st-law-ref {
  position: static;
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.st-law-text {
  font-size: 10px;
  color: var(--ink);
  line-height: 1.5;
  font-style: italic;
}

/* ── 5. ACT III — CASCADE & BEADS ────────────────────────── */
.st-cascade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}
.st-bead {
  position: absolute;
  height: 24px;
  padding: 0 10px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-pale);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
  pointer-events: all;
  cursor: default;
  opacity: 0;
  transition: background 0.2s, border-color 0.2s;
}
.st-bead:hover { background: var(--gold-pale); border-color: var(--gold); }
.st-bead-ref { font-weight: 600; margin-right: 5px; }

/* ── 6. TOOLTIP ──────────────────────────────────────────── */
.st-tooltip {
  position: fixed;
  max-width: 240px;
  background: var(--white);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.st-tooltip.visible { opacity: 1; }
.st-tooltip-ref {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

/* ── 7. COMPLETION BANNER ────────────────────────────────── */
.st-complete-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-deep);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 12px 24px;
  text-align: center;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
}
.st-complete-banner.visible { opacity: 1; }
.st-complete-banner p {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--parchment);
  margin: 0;
}
.st-complete-banner cite {
  display: block;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}

/* ── 8. ANIMATIONS ───────────────────────────────────────── */
@keyframes stSettle {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(6px); }
  70%  { transform: translateY(2px); }
  100% { transform: translateY(5px); }
}

/* ── 9. TILE MODAL ───────────────────────────────────────── */
#st-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 41, 0.72);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
#st-modal.visible { display: flex; }

#st-modal-card {
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: min(580px, calc(100vw - 48px));
  width: calc(100vw - 48px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
}
#st-modal-card.has-verse {
  max-width: min(800px, calc(100vw - 48px));
}

.stm-main {
  flex: 1;
  min-width: 0;
  padding: 44px 48px 40px;
  text-align: center;
}

#st-modal-verse {
  display: flex;
  flex-direction: column;
  width: 130px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--cream);
  padding: 20px 14px 20px;
  overflow-y: auto;
  text-align: left;
}
#st-modal-card.has-verse #st-modal-verse {
  width: 300px;
  padding: 44px 28px 24px;
}

.stmv-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.stmv-ref {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 16px;
}
.stmv-text {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  margin: 0;
}

#st-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--ink-light);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
#st-modal-close:hover { color: var(--ink); background: var(--cream); }

.stm-roman {
  font-family: var(--ff-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 10px;
}
.stm-ref {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.stm-title {
  font-family: var(--ff-serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  color: var(--navy-deep);
  line-height: 1.25;
  margin: 0 0 18px;
}
.stm-text {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

.stm-note-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: left;
  position: relative;
}
.stm-note-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
#st-modal-note {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--ff-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
#st-modal-note:focus { border-color: var(--gold); }
#st-modal-note::placeholder { color: var(--ink-light); opacity: 0.6; }

#st-modal-saved {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.3s;
}
#st-modal-saved.visible { opacity: 1; }

/* ── 9b. TILE COLOR PICKER ───────────────────────────────── */
.stm-color-section {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stm-color-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.stm-color-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}
.stm-color-swatch {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  padding: 0;
}
.stm-color-swatch:hover {
  transform: scale(1.12);
  border-color: rgba(0,0,0,0.25);
}
.stm-color-swatch.active {
  border-color: var(--gold);
  border-width: 2px;
  box-shadow: 0 0 0 1.5px var(--gold);
}

/* Tile highlight — all text goes black */
.st-cmd-tile.has-highlight .st-cmd-roman,
.st-cmd-tile.has-highlight .st-law-ref,
.st-cmd-tile.has-highlight .st-cmd-title,
.st-cmd-tile.has-highlight .st-cmd-text,
.st-cmd-tile.has-highlight .st-law-text { color: var(--ink); }
/* Fix has-children overrides too */
.st-cmd-tile.has-highlight.has-children .st-cmd-roman,
.st-cmd-tile.has-highlight.has-children .st-law-ref,
.st-cmd-tile.has-highlight.has-children .st-cmd-title,
.st-cmd-tile.has-highlight.has-children .st-cmd-text,
.st-cmd-tile.has-highlight.has-children .st-law-text { color: var(--ink); }
.st-cmd-tile.has-highlight.has-children .st-loop,
.st-cmd-tile.has-highlight.has-children .st-tile-hook { color: var(--ink); }

/* ── 10. RESET CONTROLS ──────────────────────────────────── */
/* ── COLOR LEGEND ────────────────────────────────────────── */
#st-legend {
  position: fixed;
  top: 68px;
  left: 24px;
  z-index: 1400;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  min-width: 160px;
  max-width: 220px;
  overflow: hidden;
}

#st-legend-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  transition: color 0.15s;
}
#st-legend-header:hover { color: var(--ink); }
#st-legend-header [data-lucide] { width: 13px; height: 13px; flex-shrink: 0; }
#st-legend-header span { flex: 1; text-align: left; }
#st-legend-chevron { transition: transform 0.25s ease; }

#st-legend-body {
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.stl-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stl-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.08);
}

.stl-input {
  flex: 1;
  font-family: var(--ff-sans);
  font-size: 11px;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.stl-input::placeholder { color: var(--ink-light); opacity: 0.55; }
.stl-input:focus { border-bottom-color: var(--border); }

.stl-label-text {
  font-family: var(--ff-sans);
  font-size: 11px;
  color: var(--ink);
}

.stl-eye-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-light);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.stl-row:hover .stl-eye-btn,
.stl-row-hidden .stl-eye-btn { opacity: 1; }
.stl-eye-btn:hover { color: var(--ink); }
.stl-row-hidden .stl-eye-btn { color: var(--ink-light); }
.stl-row-hidden .stl-swatch { opacity: 0.35; }
.stl-row-hidden .stl-input  { opacity: 0.4; }

.stl-toggle-all {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 5px 0 0;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  font-family: var(--ff-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  cursor: pointer;
  text-align: center;
  transition: color 0.15s;
}
.stl-toggle-all:hover { color: var(--ink); }

/* ── RESET CONTROLS ──────────────────────────────────────── */
#st-reset-controls {
  display: none; /* shown after intro collapses */
  position: fixed;
  bottom: 74px;
  left: 24px;
  align-items: center;
  gap: 8px;
  z-index: 1500;
}

#st-undo-btn,
#st-redo-btn,
#st-reset-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-light);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: color 0.15s, border-color 0.15s, background 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
#st-undo-btn:hover:not(:disabled),
#st-redo-btn:hover:not(:disabled),
#st-reset-btn:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }
#st-undo-btn:disabled,
#st-redo-btn:disabled { opacity: 0.3; cursor: default; }

#st-reset-confirm {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
#st-reset-controls.confirming #st-reset-confirm { display: flex; }
#st-reset-controls.confirming #st-reset-btn {
  color: var(--gold);
  border-color: var(--gold);
}

.st-reset-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
}

#st-reset-yes,
#st-reset-no {
  background: none;
  border: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#st-reset-yes {
  background: #B91C1C;
  color: #fff;
}
#st-reset-yes:hover { background: #991B1B; }
#st-reset-no { color: var(--ink-light); }
#st-reset-no:hover { background: var(--cream); color: var(--ink); }

/* ── 11. ZOOM CONTROLS ───────────────────────────────────── */

#st-zoom-controls {
  display: none; /* shown after intro collapses */
  position: fixed;
  bottom: 24px;
  left: 24px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  z-index: 1500;
  overflow: hidden;
}
#st-zoom-controls button {
  background: none;
  border: none;
  padding: 7px 14px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s;
}
#st-zoom-controls button:hover:not(:disabled) { background: var(--cream); }
#st-zoom-controls button:disabled { opacity: 0.3; cursor: default; }
#st-zoom-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  min-width: 38px;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 7px 4px;
  user-select: none;
  cursor: pointer;
  background: none;
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  font-family: var(--ff-sans);
  transition: background 0.15s, color 0.15s;
}
#st-zoom-label:hover { background: var(--cream); color: var(--ink); }
#st-zoom-label[aria-expanded="true"] { background: var(--cream); color: var(--ink); }

/* Zoom preset popup */
#st-zoom-presets {
  display: none;
  position: fixed;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 1600;
  min-width: 80px;
}
#st-zoom-presets.open { display: flex; }
#st-zoom-presets button {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-family: var(--ff-sans);
  color: var(--ink-light);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}
#st-zoom-presets button:hover { background: var(--cream); color: var(--ink); }
#st-zoom-presets button.active { color: var(--gold); font-weight: 600; }
.st-zoom-sep {
  display: block;
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 5px 0;
}

#st-mobile-wall {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy-deep);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px;
}
#st-mobile-wall .st-mw-icon {
  color: var(--gold);
  margin-bottom: 28px;
  opacity: 0.7;
}
#st-mobile-wall .st-mw-title {
  font-family: var(--ff-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--parchment);
  line-height: 1.3;
  margin-bottom: 16px;
}
#st-mobile-wall .st-mw-body {
  font-size: 14px;
  color: rgba(245,237,216,0.6);
  line-height: 1.7;
  max-width: 300px;
  margin-bottom: 32px;
}
#st-mobile-wall .st-mw-ref {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.6;
}

/* Show wall on narrow screens or touch/pointer-coarse devices */
@media (max-width: 1024px) {
  #st-mobile-wall { display: flex; }
}
@media (pointer: coarse) {
  #st-mobile-wall { display: flex; }
}

/* ── PUBLISH MODAL — editable edit code field ────────────── */
.stp-editcode-wrap {
  margin-top: 2px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stp-editcode-reminder {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #FBF5E8;
  border: 1px solid rgba(184,137,60,0.25);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink);
}
.stp-editcode-reminder svg { margin-top: 1px; flex-shrink: 0; }
.stp-editcode-reminder strong { color: var(--navy-deep); }

/* ── EDIT UNLOCK MODAL ───────────────────────────────────── */
#st-edit-unlock-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,43,71,0.55);
  backdrop-filter: blur(4px);
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-edit-unlock-modal.visible { display: flex; }

#st-edit-unlock-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

#st-edit-unlock-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-light);
  transition: color 0.15s, border-color 0.15s;
}
#st-edit-unlock-close:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }

.steu-eyebrow {
  font-size: 9px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
}
.steu-title {
  font-family: var(--ff-serif); font-size: 22px; font-weight: 500;
  color: var(--navy-deep); margin: 0;
}
.steu-desc { font-size: 12px; line-height: 1.65; color: var(--ink-light); margin: 0; }

.steu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.steu-error { font-size: 11px; color: #B91C1C; flex: 1; }

#st-edit-unlock-submit {
  background: var(--navy-deep); color: var(--parchment);
  border: none; border-radius: 8px; padding: 10px 22px;
  font-family: var(--ff-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.15s;
}
#st-edit-unlock-submit:hover    { opacity: 0.85; }
#st-edit-unlock-submit:disabled { opacity: 0.4; cursor: default; }

/* ── Guide: Deep Thinkers callout ───────────────────────── */
.stg-deep {
  background: rgba(20,43,71,0.05);
  border-left: 3px solid var(--navy-mid, #2d5086);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}
.stg-deep .stg-heading {
  color: var(--navy-deep);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Tour ────────────────────────────────────────────────── */
#st-tour-spotlight {
  display: none;
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(10, 20, 35, 0.62);
  z-index: 8000;
  pointer-events: none;
  transition: top 0.32s cubic-bezier(0.4,0,0.2,1),
              left 0.32s cubic-bezier(0.4,0,0.2,1),
              width 0.32s cubic-bezier(0.4,0,0.2,1),
              height 0.32s cubic-bezier(0.4,0,0.2,1);
}

#st-tour-tooltip {
  display: none;
  position: fixed;
  z-index: 8100;
  background: var(--parchment);
  border: 1px solid rgba(184,148,80,0.22);
  border-radius: 12px;
  padding: 18px 20px 14px;
  width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.1);
  transition: top 0.32s cubic-bezier(0.4,0,0.2,1),
              left 0.32s cubic-bezier(0.4,0,0.2,1);
}

.stt-step {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 5px;
}

.stt-title {
  font-family: var(--ff-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 8px;
  line-height: 1.25;
}

.stt-body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-light);
  margin-bottom: 14px;
}

.stt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#stt-skip {
  font-size: 11px;
  font-family: var(--ff-sans);
  color: var(--ink-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
}
#stt-skip:hover { opacity: 1; }

#stt-next {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-sans);
  letter-spacing: 0.05em;
  background: var(--navy-deep);
  color: var(--parchment);
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}
#stt-next:disabled { opacity: 0.45; cursor: default; }
#stt-next:not(:disabled):hover { opacity: 0.82; }

/* ── NT CONNECTIONS PANEL ────────────────────────────────── */
#stm-connections-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
}

.stmc-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stmc-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: var(--ff-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.stmc-back-btn:hover { background: var(--cream); color: var(--ink); }

.stmc-panel-title {
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

#stm-connections-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#stm-connections-body::-webkit-scrollbar { width: 4px; }
#stm-connections-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.stmc-tile-ref {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 4px;
}

.stmc-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
}

.stmc-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.stmc-nt-ref {
  font-family: var(--ff-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.stmc-book-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.stmc-nt-content {
  font-family: var(--ff-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

.stmc-torah-content {
  font-family: var(--ff-serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-light);
  margin: 0;
  padding: 8px 12px;
  border-left: 2px solid var(--gold-pale);
  background: var(--gold-tint);
  border-radius: 0 6px 6px 0;
}

.stmc-torah-verse-label {
  display: block;
  font-style: normal;
  font-family: var(--ff-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.stmc-explanation {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-light);
  margin: 0;
}

.stmc-confidence {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.stmc-confidence-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.stmc-confidence-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
}

.stm-more-details {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  text-align: right;
  transition: color 0.15s;
}
.stm-more-details:hover { color: var(--gold-dark); }

/* ── ACHIEVEMENT MODAL ───────────────────────────────────── */
#st-achievement-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,26,41,0.72);
  backdrop-filter: blur(4px);
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#st-achievement-modal.visible { display: flex; }

#st-achievement-card {
  background: var(--white);
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24);
  text-align: center;
}

.stach-trophy-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--gold-tint);
  border: 1px solid rgba(184,137,60,0.2);
  border-radius: 50%;
  margin: 0 auto 16px;
}

.stach-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.stach-title {
  font-family: var(--ff-serif);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: var(--navy-deep);
  line-height: 1.2;
  margin-bottom: 14px;
}

.stach-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-light);
  white-space: pre-line;
  margin-bottom: 20px;
}

.stach-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 28px;
}

.stach-next-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.stach-next span:last-child {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}

.stach-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stach-btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--navy-deep);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.stach-btn-primary:hover { opacity: 0.85; }

.stach-btn-secondary {
  width: 100%;
  padding: 10px;
  background: none;
  color: var(--ink-light);
  border: none;
  font-family: var(--ff-sans);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.stach-btn-secondary:hover { color: var(--ink); }

/* ── PROGRESS PANEL ──────────────────────────────────────── */
#st-progress {
  position: fixed;
  bottom: 24px;
  left: 24px; /* overridden by JS to sit right of zoom controls */
  z-index: 1400;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  min-width: 164px;
  max-width: 210px;
  overflow: hidden;
}

#st-progress-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  transition: color 0.15s;
}
#st-progress-header:hover { color: var(--ink); }
#st-progress-header > span:first-of-type { flex: 1; text-align: left; }

#st-progress-compact {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

#st-progress-chevron { transition: transform 0.25s ease; }

#st-progress-body {
  padding: 2px 12px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#st-progress-count {
  font-family: var(--ff-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#st-progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

#st-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  width: 0%;
  transition: width 0.45s ease;
}

.stpg-rows { display: flex; flex-direction: column; gap: 0; }

.stpg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}

.stpg-label {
  font-size: 11px;
  color: var(--ink-light);
}

.stpg-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stpg-divider {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}
