:root {
  --bg: #FDF9F3;
  --bg-elevated: #FDF9F3;
  --bg-card: #F4EEE4;
  --text: #111111;
  --ink: #111111;
  --text-muted: #6B5E52;
  --card: #F4EEE4;
  --muted: #6B5E52;
  --accent: #612A8A;
  --accent-hover: #7a3aad;
  --cyan: #612A8A;
  --border: rgba(17, 17, 17, 0.14);
  --danger: #e85d5d;
  --radius: 4px;
  --font: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --max: 96ch;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--bg);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ---- Gate ---- */
#gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.gate-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.gate-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gate-card .sub {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.gate-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.gate-card input[type="password"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.gate-card input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(97, 42, 138, 0.35);
}

.gate-card button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.gate-card button:hover { background: var(--accent-hover); }

.gate-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.3em;
}

/* ---- App shell ---- */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand span {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.85;
}

.nav a:hover { opacity: 1; color: var(--cyan); text-decoration: none; }

/* ---- Index ---- */
.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(97, 42, 138, 0.45);
  color: #e8d9f5;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---- Viewer ---- */
.viewer-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.viewer-header h1 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.viewer-header .meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.prose {
  max-width: var(--max);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-top: 1.75em;
  margin-bottom: 0.55em;
}

.prose h1 { font-size: 1.55rem; }
.prose h2 { font-size: 1.3rem; color: var(--ink); }
.prose h3 { font-size: 1.12rem; color: var(--ink); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.35em; }
.prose li { margin: 0.3em 0; }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem 1.1rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: 0 0 1em;
  padding: 0.4em 0 0.4em 1em;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.prose a { color: var(--cyan); }
.prose strong { color: var(--ink); font-weight: 650; }

.loading, .error-msg {
  color: var(--text-muted);
  padding: 2rem 0;
}

.error-msg { color: var(--danger); }

/* ---- Rail labels (live 3-pane) ---- */
.rail-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.details-toggle {
  margin-top: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(97, 42, 138, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.details-toggle:hover {
  background: rgba(97, 42, 138, 0.55);
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.section-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  scroll-margin-top: 5.5rem;
  max-width: 100%;
}

.section-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.section-num {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c9a6e8;
  background: rgba(97, 42, 138, 0.35);
  border: 1px solid rgba(97, 42, 138, 0.45);
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
  line-height: 1;
  margin-top: 0.2rem;
}

.section-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}

.time-badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.section-dek {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.section-note {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid rgba(46, 196, 214, 0.55);
  background: rgba(46, 196, 214, 0.06);
  border-radius: 0 4px 4px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.5;
}

.section-beats {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink);
  font-weight: 500;
}

.beat-list {
  margin: 0 0 0.65rem;
  padding-left: 1.25em;
}

.beat-list > li {
  margin: 0.4em 0;
}

.beat-sub {
  margin: 0.35em 0 0.45em;
  padding-left: 1.15em;
  list-style: circle;
}

.beat-group {
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #e8d9f5;
}

.beat-prose {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.7;
}

/* Meta cards */
.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.meta-card-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d4b8ef;
  font-weight: 700;
}

.meta-card-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
}

.meta-card-body ul {
  margin: 0;
  padding-left: 1.1em;
}

.meta-card-body li {
  margin: 0.3em 0;
}

.meta-lead {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.55;
}

.meta-kv {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.7rem;
}

.meta-kv:last-child { margin-bottom: 0; }

.meta-k {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c5d0da;
  font-weight: 700;
}

.meta-v {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.meta-v a { color: var(--cyan); }

.runtime-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.runtime-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.runtime-list li:last-child { border-bottom: none; padding-bottom: 0; }
.runtime-list li:first-child { padding-top: 0; }

.runtime-list strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.runtime-list span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Desktop TOC */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-list a {
  display: flex;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.toc-list a:hover {
  background: rgba(97, 42, 138, 0.25);
  border-color: rgba(97, 42, 138, 0.4);
  text-decoration: none;
}

.toc-num {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #c9a6e8;
  margin-top: 0.15rem;
}

.toc-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.toc-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.toc-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Desktop ≥1100px — live section type sizes */
@media (min-width: 1100px) {
  .section-card {
    scroll-margin-top: 4.5rem;
  }

  .section-head h2 {
    font-size: 1.35rem;
  }

  .section-beats {
    font-size: 1.08rem;
  }
}

/* Mid tablets: stack meta below, keep chips */
@media (max-width: 1099px) {
  .section-card {
    scroll-margin-top: 7.5rem;
  }
}

@media (max-width: 900px) {
  .viewer-header h1 {
    font-size: 1.45rem;
  }

  .section-head h2 {
    font-size: 1.12rem;
  }

  .section-beats {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .topbar { padding: 0.75rem 1rem; }
  .viewer-header h1 { font-size: 1.35rem; }
  .prose { font-size: 1rem; }
}


html, body {
  height: 100%;
}
/* ---- Studio three-pane shell ---- */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow: hidden;
}
.studio {
  flex: 1 1 auto;
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}
.left-rail,
.right-rail {
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
.center-col {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
#reader {
  max-width: 96ch;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.spoken-prose {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}
.spoken-prose p { margin: 0 0 1.15em; }
.spoken-chapter,
.section-card { scroll-margin-top: 6.5rem; }

.channel-pills {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.channel-pill {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.channel-pill:hover { text-decoration: none; border-color: var(--cyan); color: #fff; }
.channel-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.script-list { display: flex; flex-direction: column; gap: 0.4rem; }
.script-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.75rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
}
.script-row:hover { border-color: var(--accent); text-decoration: none; color: inherit; }
.script-row.is-active {
  border-color: var(--cyan);
  background: rgba(46, 196, 214, 0.1);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.script-row-title { font-size: 0.9rem; font-weight: 650; line-height: 1.3; }
.script-row-meta {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.type-chip {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(97, 42, 138, 0.45);
  color: #e8d9f5;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-chrome {
  position: sticky;
  top: 0;
  z-index: 16;
  padding: 0.75rem 0.9rem 0.7rem;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.mobile-actions {
  display: flex;
  gap: 0.5rem;
}
.scripts-toggle,
.details-toggle {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.scripts-toggle span { color: var(--cyan); font-size: 0.72rem; margin-left: 0.35rem; }
.details-toggle { flex: 0 0 auto; text-align: center; background: rgba(97, 42, 138, 0.4); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 30;
}
.slide-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(360px, 92vw);
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-elevated);
  z-index: 40;
  padding: 1rem;
  box-shadow: 0 0 40px rgba(0,0,0,0.4);
}
#script-drawer { left: 0; }
#details-drawer { right: 0; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.drawer-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cue-list { margin: 0; padding-left: 1.1em; }
.cue-list li { margin: 0.4em 0; }
.cue-sec { display: block; font-size: 0.7rem; color: #9aaabb; margin-top: 0.15rem; }

@media (min-width: 1100px) {
  .studio { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .left-rail, .right-rail {
    display: block;
    padding: 1.1rem 0.75rem 3.5rem;
    max-height: 100%;
  }
  .left-rail { border-right: 1px solid var(--border); }
  .right-rail { border-left: 1px solid var(--border); }
  .mobile-chrome { display: none; }
  #reader { padding: 1.75rem 1.5rem 4rem; }
  .spoken-chapter, .section-card { scroll-margin-top: 1.25rem; }
}
@media (max-width: 1099px) {
  .right-rail, .left-rail { display: none; }
}




/* ---- Dark readable lock: 3 colors, 4px corners ---- */
#app[data-channel="neurapod"] {
  --bg: #FDF9F3;
  --bg-elevated: #FDF9F3;
  --bg-card: #F4EEE4;
  --accent: #612A8A;
  --accent-hover: #7a3aad;
}
#app[data-channel="holey-moly"] {
  --bg: #FDF9F3;
  --bg-elevated: #FDF9F3;
  --bg-card: #F4EEE4;
  --accent: #C9862A;
  --accent-hover: #e0a03a;
}
html, body, #app, .studio, .center-col, .left-rail, .right-rail, .topbar, .slide-drawer, .mobile-chrome, .gate-card {
  background: var(--bg);
  color: var(--text);
}
body { background: var(--bg); }
.topbar, .mobile-chrome {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}
.brand strong, .brand span, .nav a { color: var(--text); opacity: 1; }
.nav a:hover { color: var(--accent); }
.left-rail, .right-rail { background: var(--bg-elevated); color: var(--text); }
.rail-label, .meta-card-title, .meta-k, .cue-sec, .toc-time, .script-row-meta, .viewer-header .meta {
  color: var(--text-muted);
}
.channel-pills { gap: 0.4rem; }
.channel-pill {
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  width: 100%;
}
.channel-pill:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.channel-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.script-row {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.script-row-title { color: var(--text); }
.script-row.is-active {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: inset 3px 0 0 var(--accent);
}
.type-chip, .badge, .section-num, .time-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-radius: 4px;
}
.section-card, .spoken-chapter, .meta-card, .gate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: none;
  color: var(--text);
}
.section-head h2, .viewer-header h1, .toc-title, .prose h1, .prose h2, .prose h3 {
  color: var(--text);
}
.spoken-prose, .beat-prose, .section-beats, .prose, .prose p, .meta-card-body, .meta-v, .meta-lead {
  color: var(--text);
  font-weight: 500;
}
.spoken-prose { font-size: 0.84rem; line-height: 1.5; }
.section-dek, .section-note { color: var(--text-muted); }
.section-note { background: var(--bg-card); border-left-color: var(--accent); }
.beat-group { color: var(--text); }
a, .toc-list a, .toc-num { color: var(--text); }
a:hover, .toc-list a:hover { color: var(--accent); }
.scripts-toggle, .details-toggle, .drawer-close {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  border-radius: 4px;
}
.scripts-toggle span { color: var(--accent); }
.slide-drawer { background: var(--bg); box-shadow: none; }
.gate-card input[type="password"] {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  border-radius: 4px;
}
.gate-card button { border-radius: 4px; }


/* LOCK 2026-08-26: text never touches or bleeds a card/border. Default 1.6rem / 1.75rem. 4px. */
.spoken-chapter,
.section-card,
.meta-card,
.hibbaan-notes,
.gate-card {
  padding: 1.6rem 1.75rem 1.5rem;
  border-radius: 4px;
  overflow: visible;
  box-sizing: border-box;
}
.spoken-chapter .section-head,
.section-card .section-head {
  margin-top: 0;
  margin-bottom: 1rem;
}
.spoken-chapter .spoken-prose p:last-child,
.section-card .section-beats > :last-child,
.spoken-chapter > :last-child,
.section-card > :last-child {
  margin-bottom: 0;
}
.meta-card {
  padding: 1.6rem 1.75rem 1.5rem;
  border-radius: 4px;
}
.channel-pill,
.script-row {
  padding: 0.75rem 0.85rem;
  border-radius: 4px;
}
@media (max-width: 600px) {
  .spoken-chapter,
  .section-card {
    padding: 1.25rem 1.2rem 1.15rem;
  }
}


/* ---- left-rail click lock ---- */
.left-rail, .left-rail a, .script-row, .channel-pill {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}


/* ---- Data Tracker ---- */
#reader.is-tracker {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-tracker {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-tracker { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}
.tracker-row.is-active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.left-rail .tools-block { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.left-rail .tracker-row { margin-bottom: 0; }
#reader.is-videos {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-videos {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-videos { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}
#reader.is-elon-ai {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-elon-ai {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-elon-ai { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .studio.is-elon-nlx { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}

#reader.is-elon-nlx {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-elon-nlx {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-elon-nlx { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}
#reader.is-nl-hard-facts {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-nl-hard-facts {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-nl-hard-facts { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}
#reader.is-x-takeover {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.35rem 3rem;
}
.studio.is-x-takeover {
  grid-template-columns: 250px minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .studio.is-x-takeover { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}

/* ---- numbered left-rail scripts (per channel) ---- */
.script-row-main {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
}
.script-num {
  flex: 0 0 auto;
  min-width: 1.2em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-muted);
}
.script-row-title {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.left-rail, .right-rail, .center-col, #reader, .script-row {
  overflow-x: hidden;
}
.studio {
  overflow-x: hidden;
}


/* ---- Studio ship lock 20260826aa: rail overflow + July highlighters + native edit ---- */
.left-rail {
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 3.5rem;
  min-width: 0;
  max-width: 100%;
}
.left-rail .channel-pills,
.left-rail .script-list,
.left-rail .script-row,
.left-rail .channel-pill {
  max-width: 100%;
  min-width: 0;
}
.channel-pills {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}
.channel-pill {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  box-sizing: border-box;
  border-radius: 4px;
  text-align: left;
}
.channel-pills.is-mobile {
  flex-direction: row;
  flex-wrap: wrap;
}
.channel-pills.is-mobile .channel-pill {
  width: auto;
  flex: 1 1 auto;
}

/* July 2026 Episode 176 highlight map — exact hex, do not invent */
.hl-notes, mark.hl-notes { background: #00ff00; color: #111111; }
.hl-title, mark.hl-title { background: #ff00ff; color: #111111; }
.hl-talk, mark.hl-talk { background: #ff9900; color: #111111; }
.hl-broll, mark.hl-broll { background: #ffff00; color: #111111; }
.hl-visual, mark.hl-visual { background: #3bfffc; color: #111111; }
.hl-onscreen, mark.hl-onscreen { background: #00ffff; color: #111111; }
.spoken-prose mark,
.section-beats mark,
.hibbaan-notes mark,
.prose mark {
  border-radius: 4px;
  padding: 0.05em 0.28em;
  font-weight: 650;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.is-update .spoken-chapter .section-head h2,
.is-update .section-card .section-head h2 {
  background: #ff00ff;
  color: #111111;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.2em 0.45em;
  display: inline;
  line-height: 1.45;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* LOCK: page title is NOT pink — match YouTube Neuralink Update — Month Year */
#reader.is-update .viewer-header h1.page-title,
#reader.is-update h1.page-title {
  background: none;
  color: var(--text);
  font-weight: 700;
  border-radius: 0;
  padding: 0;
  display: block;
  line-height: 1.25;
}
.cue-mark {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.7em;
  border-radius: 4px;
  padding: 0.12em 0.35em;
  line-height: 1.4;
  font-size: 0.82rem;
  font-weight: 650;
  color: #111111;
}

/* LOCK 2026-08-26 Ryan: links/strong/em on highlighter fills + .cue-mark stay #111
   including hover/visited. Do not revert. Do not change July hexes. */
#app mark,
#app .cue-mark,
#app [class^="hl-"],
#app [class*=" hl-"],
#reader mark,
#reader .cue-mark {
  color: #111111;
}
#app mark a,
#app mark a:link,
#app mark a:hover,
#app mark a:focus,
#app mark a:visited,
#app mark a:active,
#app .cue-mark a,
#app .cue-mark a:link,
#app .cue-mark a:hover,
#app .cue-mark a:focus,
#app .cue-mark a:visited,
#app .cue-mark a:active,
#app .hl-notes a, #app .hl-title a, #app .hl-talk a,
#app .hl-broll a, #app .hl-visual a, #app .hl-onscreen a,
#app .hl-notes a:hover, #app .hl-title a:hover, #app .hl-talk a:hover,
#app .hl-broll a:hover, #app .hl-visual a:hover, #app .hl-onscreen a:hover,
#app .hl-notes a:visited, #app .hl-title a:visited, #app .hl-talk a:visited,
#app .hl-broll a:visited, #app .hl-visual a:visited, #app .hl-onscreen a:visited,
#reader mark a, #reader mark a:link, #reader mark a:hover, #reader mark a:visited, #reader mark a:active,
#reader .cue-mark a, #reader .cue-mark a:link, #reader .cue-mark a:hover, #reader .cue-mark a:visited, #reader .cue-mark a:active,
#app mark strong, #app mark em, #app .cue-mark strong, #app .cue-mark em,
#reader mark strong, #reader mark em, #reader .cue-mark strong, #reader .cue-mark em {
  color: #111111 !important;
}

.hibbaan-notes {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.6rem 1.75rem 1.5rem;
  margin: 0 0 1.25rem;
}
.hibbaan-notes .hibbaan-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.hibbaan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.hibbaan-legend mark {
  font-size: 0.78rem;
}
.hibbaan-body { font-size: 0.88rem; line-height: 1.45; }
.hibbaan-body p { margin: 0 0 0.45em; }
.hibbaan-body p:last-child { margin-bottom: 0; }
.hibbaan-body mark { font-size: 0.88rem; font-weight: 600; }

.viewer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 1rem;
}
.viewer-header-main { flex: 1 1 16rem; min-width: 0; }
.editor-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.save-btn,
.save-status {
  border-radius: 4px;
  font-family: inherit;
}
.save-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.save-btn:hover { border-color: var(--accent); }
.save-status {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 4.5rem;
}
.save-status.is-saving { color: #ff9900; }
.save-status.is-saved { color: #00ff00; }
.save-status.is-error { color: var(--danger); }


@media (min-width: 1100px) {
  .studio { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .studio.is-tracker { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .studio.is-elon-ai { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .studio.is-nl-hard-facts { grid-template-columns: 250px minmax(0, 1fr) 240px; }
  .studio.is-x-takeover { grid-template-columns: 250px minmax(0, 1fr) 240px; }
}

/* LOCK 20260827a: body text is never flush to the card border.
   1.6rem / 1.75rem on spoken-chapter, spoken-prose, and contenteditable.
   4px corners. 0.84rem spoken. overflow:hidden clips highlighter marks. */
#reader article.spoken-chapter,
#reader .spoken-chapter,
#reader .section-card,
#reader .meta-card,
#reader .hibbaan-notes,
#reader .gate-card,
#doc-body article.spoken-chapter,
#doc-body .spoken-chapter,
#doc-body .section-card,
.spoken-chapter,
.section-card,
.meta-card,
.hibbaan-notes,
.gate-card {
  padding: 1.6rem 1.75rem 1.5rem !important;
  border-radius: 4px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}
#reader article.spoken-chapter > .spoken-prose,
#reader article.spoken-chapter > .spoken-prose[contenteditable],
#reader article.spoken-chapter > .spoken-prose[contenteditable="true"],
#reader .spoken-prose,
#reader .spoken-prose[contenteditable],
#reader .spoken-prose[contenteditable="true"],
#reader .section-beats,
#reader .section-beats[contenteditable],
#reader .section-beats[contenteditable="true"],
#reader .hibbaan-body,
#reader .hibbaan-body[contenteditable],
#reader .hibbaan-body[contenteditable="true"],
#reader .meta-card-body,
#doc-body .spoken-prose,
#doc-body .spoken-prose[contenteditable],
#doc-body .spoken-prose[contenteditable="true"],
#doc-body .section-beats,
#doc-body .section-beats[contenteditable="true"],
#doc-body .hibbaan-body,
#doc-body .hibbaan-body[contenteditable="true"],
.spoken-prose,
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"],
.section-beats,
.section-beats[contenteditable],
.section-beats[contenteditable="true"],
.hibbaan-body,
.hibbaan-body[contenteditable],
.hibbaan-body[contenteditable="true"],
.meta-card-body {
  padding: 1.6rem 1.75rem 1.5rem !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
  min-width: 0 !important;
  font-size: 0.84rem !important;
  line-height: 1.5;
}
#reader .hibbaan-notes .hibbaan-body,
#reader .hibbaan-notes .hibbaan-body[contenteditable="true"] {
  padding: 0.15rem 0 !important;
  font-size: 0.88rem !important;
}
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"],
.section-beats[contenteditable],
.section-beats[contenteditable="true"],
.hibbaan-body[contenteditable],
.hibbaan-body[contenteditable="true"] {
  outline: none !important;
  caret-color: var(--text);
  border-radius: 4px !important;
}
.spoken-prose[contenteditable]:focus,
.spoken-prose[contenteditable="true"]:focus,
.section-beats[contenteditable]:focus,
.section-beats[contenteditable="true"]:focus,
.hibbaan-body[contenteditable]:focus,
.hibbaan-body[contenteditable="true"]:focus {
  box-shadow: none !important;
  outline: none !important;
  border: none !important;
}
@media (max-width: 600px) {
  #reader article.spoken-chapter,
  #reader .spoken-chapter,
  #reader .section-card,
  #reader .spoken-prose,
  #reader .spoken-prose[contenteditable="true"],
  #reader .section-beats,
  #reader .section-beats[contenteditable="true"],
  #reader .hibbaan-notes,
  #reader .meta-card,
  #doc-body .spoken-chapter,
  #doc-body .spoken-prose,
  #doc-body .spoken-prose[contenteditable="true"] {
    padding: 1.25rem 1.2rem 1.15rem !important;
  }
}


/* LOCK 20260827b: inner spoken text fills the outer display card.
   Padding lives on the OUTER card only (1.6rem / 1.75rem). Do not nest a
   second padded card. Highlights wrap with the wider text measure. */
#reader article.spoken-chapter > .spoken-prose,
#reader article.spoken-chapter > .spoken-prose[contenteditable],
#reader article.spoken-chapter > .spoken-prose[contenteditable="true"],
#reader .spoken-prose,
#reader .spoken-prose[contenteditable],
#reader .spoken-prose[contenteditable="true"],
#reader .section-beats,
#reader .section-beats[contenteditable],
#reader .section-beats[contenteditable="true"],
#doc-body .spoken-prose,
#doc-body .spoken-prose[contenteditable],
#doc-body .spoken-prose[contenteditable="true"],
#doc-body .section-beats,
#doc-body .section-beats[contenteditable],
#doc-body .section-beats[contenteditable="true"],
.spoken-prose,
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"],
.section-beats,
.section-beats[contenteditable],
.section-beats[contenteditable="true"] {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  font-size: 0.84rem !important;
  line-height: 1.5;
  min-width: 0 !important;
}
#reader article.spoken-chapter,
#reader .spoken-chapter,
#reader .section-card,
#doc-body article.spoken-chapter,
#doc-body .spoken-chapter,
#doc-body .section-card,
.spoken-chapter,
.section-card {
  padding: 1.6rem 1.75rem 1.5rem !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
}
@media (max-width: 600px) {
  #reader .spoken-prose,
  #reader .spoken-prose[contenteditable="true"],
  #reader .section-beats,
  #reader .section-beats[contenteditable="true"],
  #doc-body .spoken-prose,
  #doc-body .spoken-prose[contenteditable="true"] {
    padding: 0 !important;
  }
}

/* LOCK 20260827b: spoken / notes / rail content links are underlined and clickable.
   Highlight-fill links stay #111 via the earlier lock. */
.spoken-chapter a,
.spoken-prose a,
.spoken-prose[contenteditable] a,
.spoken-prose[contenteditable="true"] a,
.section-card a,
.section-beats a,
.section-beats[contenteditable] a,
.hibbaan-notes a,
.hibbaan-body a,
.hibbaan-body[contenteditable] a,
.meta-card a,
.meta-card-body a,
.meta-v a,
.right-rail .meta-card a,
.prose a {
  text-decoration: underline !important;
  text-underline-offset: 0.14em;
  pointer-events: auto !important;
  cursor: pointer;
  color: currentColor;
}
.spoken-chapter a:hover,
.spoken-prose a:hover,
.section-beats a:hover,
.hibbaan-notes a:hover,
.meta-card a:hover,
.prose a:hover {
  text-decoration: underline !important;
}
#app mark a,
#app mark a:link,
#app mark a:hover,
#app mark a:focus,
#app mark a:visited,
#app mark a:active,
#app .cue-mark a,
#reader mark a,
#reader mark a:hover,
#reader .cue-mark a,
#app .hl-notes a, #app .hl-title a, #app .hl-talk a,
#app .hl-broll a, #app .hl-visual a, #app .hl-onscreen a {
  color: #111111 !important;
  text-decoration: underline !important;
  pointer-events: auto !important;
}

/* LOCK 20260827f: spoken marks are INLINE word-width. Kill bleed.
   No display:block, no width:100%, no margin-inline:-1.75rem.
   Width = the words + 0.05em 0.28em. Jump hit-target is the mark.
   Card outline pad stays on the OUTER card (1.6rem / 1.75rem).
   .spoken-prose pad stays 0 so glyph x does not move inward. */
.spoken-chapter .spoken-prose mark.hl-title,
.spoken-chapter .spoken-prose mark.hl-visual,
.spoken-chapter .spoken-prose mark.hl-broll,
.spoken-chapter .spoken-prose mark.hl-notes,
.spoken-chapter .spoken-prose mark.hl-talk,
.spoken-chapter .spoken-prose mark.hl-onscreen,
.section-card .section-beats mark.hl-title,
.section-card .section-beats mark.hl-visual,
.section-card .section-beats mark.hl-broll,
.section-card .section-beats mark.hl-notes,
.section-card .section-beats mark.hl-talk,
.section-card .section-beats mark.hl-onscreen,
.spoken-chapter .spoken-prose p.hl-title-row > mark,
.spoken-chapter .spoken-prose li.hl-title-row > mark,
.spoken-chapter .spoken-prose p.hl-bleed-row > mark,
.spoken-chapter .spoken-prose li.hl-bleed-row > mark,
.spoken-chapter .spoken-prose p.hl-title-row > a.hl-jump > mark,
.spoken-chapter .spoken-prose li.hl-title-row > a.hl-jump > mark,
.spoken-chapter .spoken-prose p.hl-bleed-row > a.hl-jump > mark,
.spoken-chapter .spoken-prose li.hl-bleed-row > a.hl-jump > mark,
.section-card .section-beats p.hl-title-row > mark,
.section-card .section-beats li.hl-title-row > mark,
.section-card .section-beats p.hl-bleed-row > mark,
.section-card .section-beats li.hl-bleed-row > mark,
.section-card .section-beats p.hl-title-row > a.hl-jump > mark,
.section-card .section-beats li.hl-title-row > a.hl-jump > mark,
.section-card .section-beats p.hl-bleed-row > a.hl-jump > mark,
.section-card .section-beats li.hl-bleed-row > a.hl-jump > mark,
.spoken-chapter .spoken-prose p:has(> mark.hl-title:only-child) > mark.hl-title,
.spoken-chapter .spoken-prose li:has(> mark.hl-title:only-child) > mark.hl-title,
.spoken-chapter .spoken-prose p:has(> mark.hl-visual:only-child) > mark.hl-visual,
.spoken-chapter .spoken-prose li:has(> mark.hl-visual:only-child) > mark.hl-visual,
.spoken-chapter .spoken-prose p:has(> mark.hl-broll:only-child) > mark.hl-broll,
.spoken-chapter .spoken-prose li:has(> mark.hl-broll:only-child) > mark.hl-broll,
.spoken-chapter .spoken-prose p:has(> mark.hl-notes:only-child) > mark.hl-notes,
.spoken-chapter .spoken-prose li:has(> mark.hl-notes:only-child) > mark.hl-notes,
.spoken-chapter .spoken-prose p:has(> mark.hl-talk:only-child) > mark.hl-talk,
.spoken-chapter .spoken-prose li:has(> mark.hl-talk:only-child) > mark.hl-talk,
.spoken-chapter .spoken-prose p:has(> mark.hl-onscreen:only-child) > mark.hl-onscreen,
.spoken-chapter .spoken-prose li:has(> mark.hl-onscreen:only-child) > mark.hl-onscreen,
.section-card .section-beats p:has(> mark.hl-title:only-child) > mark.hl-title,
.section-card .section-beats li:has(> mark.hl-title:only-child) > mark.hl-title,
.section-card .section-beats p:has(> mark.hl-visual:only-child) > mark.hl-visual,
.section-card .section-beats li:has(> mark.hl-visual:only-child) > mark.hl-visual,
.section-card .section-beats p:has(> mark.hl-broll:only-child) > mark.hl-broll,
.section-card .section-beats li:has(> mark.hl-broll:only-child) > mark.hl-broll,
.section-card .section-beats p:has(> mark.hl-notes:only-child) > mark.hl-notes,
.section-card .section-beats li:has(> mark.hl-notes:only-child) > mark.hl-notes,
.section-card .section-beats p:has(> mark.hl-talk:only-child) > mark.hl-talk,
.section-card .section-beats li:has(> mark.hl-talk:only-child) > mark.hl-talk,
.section-card .section-beats p:has(> mark.hl-onscreen:only-child) > mark.hl-onscreen,
.section-card .section-beats li:has(> mark.hl-onscreen:only-child) > mark.hl-onscreen {
  display: inline !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding: 0.05em 0.28em !important;
  border-radius: 4px !important;
  box-sizing: content-box !important;
}

.spoken-chapter .spoken-prose a.hl-jump,
.section-card .section-beats a.hl-jump,
.spoken-chapter .spoken-prose p.hl-title-row > a.hl-jump,
.spoken-chapter .spoken-prose li.hl-title-row > a.hl-jump,
.spoken-chapter .spoken-prose p.hl-bleed-row > a.hl-jump,
.spoken-chapter .spoken-prose li.hl-bleed-row > a.hl-jump,
.section-card .section-beats p.hl-title-row > a.hl-jump,
.section-card .section-beats li.hl-title-row > a.hl-jump,
.section-card .section-beats p.hl-bleed-row > a.hl-jump,
.section-card .section-beats li.hl-bleed-row > a.hl-jump {
  display: inline !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding: 0 !important;
}

#app a.hl-jump,
#app a.hl-jump:link,
#app a.hl-jump:hover,
#app a.hl-jump:focus,
#app a.hl-jump:visited,
#app a.hl-jump:active,
#app a.hl-jump mark,
#app a.hl-jump mark a,
#app a.hl-jump mark a:hover,
#reader a.hl-jump,
#reader a.hl-jump:hover,
#reader a.hl-jump mark {
  color: #111111 !important;
  text-decoration: underline !important;
  text-underline-offset: 0.14em;
}

/* Card outline sits 1.75rem away from glyphs. Pad is on the OUTER
   card only. Inner prose stays padding:0 so text x does not shift. */
#reader article.spoken-chapter,
#reader .spoken-chapter,
#doc-body article.spoken-chapter,
#doc-body .spoken-chapter,
.spoken-chapter {
  padding: 1.6rem 1.75rem 1.5rem !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
}
#reader article.spoken-chapter > .spoken-prose,
#reader article.spoken-chapter > .spoken-prose[contenteditable],
#reader article.spoken-chapter > .spoken-prose[contenteditable="true"],
#reader .spoken-prose,
#reader .spoken-prose[contenteditable],
#reader .spoken-prose[contenteditable="true"],
#doc-body .spoken-prose,
#doc-body .spoken-prose[contenteditable],
#doc-body .spoken-prose[contenteditable="true"],
.spoken-prose,
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"] {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0.84rem !important;
  line-height: 1.5;
}
@media (max-width: 600px) {
  #reader article.spoken-chapter,
  #reader .spoken-chapter,
  #doc-body article.spoken-chapter,
  .spoken-chapter {
    padding: 1.25rem 1.2rem 1.15rem !important;
  }
}


/* LOCK 20260827h: inner spoken FRAME gone altogether.
   No border, no focus-ring, no inset box-shadow on .spoken-prose /
   [contenteditable]. Glyph x stays (padding 0). Outer .spoken-chapter /
   .section-card chrome is unchanged (4px, 1.6rem / 1.75rem). */
#reader article.spoken-chapter > .spoken-prose,
#reader article.spoken-chapter > .spoken-prose[contenteditable],
#reader article.spoken-chapter > .spoken-prose[contenteditable="true"],
#reader .spoken-prose,
#reader .spoken-prose[contenteditable],
#reader .spoken-prose[contenteditable="true"],
#doc-body .spoken-prose,
#doc-body .spoken-prose[contenteditable],
#doc-body .spoken-prose[contenteditable="true"],
.spoken-prose,
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"] {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  font-size: 0.84rem !important;
  line-height: 1.5;
}
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"],
.spoken-prose[contenteditable]:focus,
.spoken-prose[contenteditable="true"]:focus,
.spoken-prose[contenteditable]:focus-visible,
.spoken-prose[contenteditable="true"]:focus-visible {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
@media (max-width: 600px) {
  #reader article.spoken-chapter > .spoken-prose,
  #reader .spoken-prose,
  #reader .spoken-prose[contenteditable="true"],
  #doc-body .spoken-prose,
  #doc-body .spoken-prose[contenteditable="true"],
  .spoken-prose,
  .spoken-prose[contenteditable="true"] {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
  }
}

/* LOCK 20260827g: About / right-rail — kill nested body pad (the empty
   left column), put label+value on one row, tighten vertical rhythm. */
.right-rail .meta-card,
#details-drawer .meta-card,
.slide-drawer .meta-card {
  padding: 1.15rem 1.2rem 1.05rem !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
}
.right-rail .meta-card-body,
#details-drawer .meta-card-body,
.slide-drawer .meta-card-body,
#reader .meta-card-body,
.meta-card-body {
  padding: 0 !important;
  margin: 0 !important;
}
.right-rail .meta-card-title,
#details-drawer .meta-card-title {
  margin: 0 0 0.45rem !important;
}
.right-rail .meta-kv,
#details-drawer .meta-kv,
.slide-drawer .meta-kv,
.meta-kv {
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: baseline;
  gap: 0.28rem 0.5rem;
  margin: 0 0 0.28rem !important;
  grid-template-columns: none !important;
}
.right-rail .meta-kv:last-child,
#details-drawer .meta-kv:last-child,
.meta-kv:last-child {
  margin-bottom: 0 !important;
}
.right-rail .meta-k,
#details-drawer .meta-k,
.meta-k {
  flex: 0 0 auto;
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.right-rail .meta-v,
#details-drawer .meta-v,
.meta-v {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}


/* LOCK 20260827i: cream paper Studio. Whole shell (rails + center + gate). */
:root, #app, #app[data-channel="neurapod"], #app[data-channel="holey-moly"] {
  --bg: #FDF9F3;
  --bg-elevated: #FDF9F3;
  --bg-card: #F4EEE4;
  --card: #F4EEE4;
  --text: #111111;
  --ink: #111111;
  --text-muted: #6B5E52;
  --muted: #6B5E52;
  --border: rgba(17, 17, 17, 0.14);
}
html, body, #app, .studio, .center-col, .left-rail, .right-rail, .topbar, .slide-drawer, .mobile-chrome, .gate-card, #gate, #reader {
  background: #FDF9F3 !important;
  color: #111111 !important;
}
.left-rail, .right-rail { background: #FDF9F3 !important; color: #111111 !important; }
.spoken-chapter, .section-card, .meta-card, .hibbaan-notes, .gate-card, .script-row, .channel-pill {
  background: #F4EEE4;
  color: #111111;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 4px;
  box-shadow: none;
}
.channel-pill.is-active, .type-chip, .badge, .section-num, .time-badge { color: #fff; }
.rail-label, .meta-card-title, .meta-k, .cue-sec, .toc-time, .script-row-meta, .viewer-header .meta, .section-dek, .brand span { color: #6B5E52 !important; }
.spoken-prose, .beat-prose, .section-beats, .prose, .prose p, .prose h1, .prose h2, .prose h3, .prose strong, .meta-card-body, .meta-v, .meta-lead, .script-row-title, .section-head h2, .viewer-header h1, .toc-title, .brand strong, .nav a, .page-title { color: #111111; }
#reader.is-update .viewer-header h1.page-title, #reader.is-update h1.page-title { color: #111111; }

/* Inner spoken outline GONE. No border/focus-ring/inset shadow on .spoken-prose or [contenteditable]. */
#reader article.spoken-chapter > .spoken-prose,
#reader article.spoken-chapter > .spoken-prose[contenteditable],
#reader article.spoken-chapter > .spoken-prose[contenteditable="true"],
#reader .spoken-prose,
#reader .spoken-prose[contenteditable],
#reader .spoken-prose[contenteditable="true"],
#doc-body .spoken-prose,
#doc-body .spoken-prose[contenteditable],
#doc-body .spoken-prose[contenteditable="true"],
.spoken-prose,
.spoken-prose[contenteditable],
.spoken-prose[contenteditable="true"],
.section-beats[contenteditable],
.section-beats[contenteditable="true"],
.hibbaan-body[contenteditable],
.hibbaan-body[contenteditable="true"],
#reader [contenteditable],
#reader [contenteditable="true"],
#doc-body [contenteditable],
#doc-body [contenteditable="true"] {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  margin-inline: 0 !important;
}
.spoken-prose[contenteditable]:focus,
.spoken-prose[contenteditable="true"]:focus,
.spoken-prose[contenteditable]:focus-visible,
.spoken-prose[contenteditable="true"]:focus-visible,
#reader [contenteditable]:focus,
#reader [contenteditable="true"]:focus,
#reader [contenteditable]:focus-visible,
#doc-body [contenteditable]:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.x-embed { display: block; margin: 0.7rem 0 1.05rem; max-width: 34rem; width: 100%; border-radius: 4px; overflow: hidden; background: #FDF9F3; color: #111111; }
.x-embed, .x-embed * { box-sizing: border-box; }
.x-embed blockquote.twitter-tweet { margin: 0 !important; border-radius: 4px !important; }
.x-embed iframe { border-radius: 4px !important; max-width: 100%; }
.x-embed-fallback { margin: 0; padding: 0.65rem 0.75rem; border: 1px solid rgba(17, 17, 17, 0.14); border-radius: 4px; background: #F4EEE4; color: #111111; font-size: 0.84rem; }
.x-embed-fallback a { color: #111111; }

/* Selection highlight picker — designated Studio colors only */
.hl-picker {
  position: fixed;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(17, 17, 17, 0.12);
  color: var(--ink);
}
.hl-picker.is-on { display: flex; }
.hl-picker-swatch,
.hl-picker-clear {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(17, 17, 17, 0.22);
  cursor: pointer;
  background: #fff;
}
.hl-picker-swatch[data-hl="notes"] { background: #00ff00; }
.hl-picker-swatch[data-hl="title"] { background: #ff00ff; }
.hl-picker-swatch[data-hl="broll"] { background: #ffff00; }
.hl-picker-swatch[data-hl="visual"] { background: #3bfffc; }
.hl-picker-swatch[data-hl="talk"] { background: #ff9900; }
.hl-picker-swatch:hover,
.hl-picker-clear:hover { outline: 2px solid #111; outline-offset: 1px; }
.hl-picker-clear {
  font-size: 0.85rem;
  line-height: 1;
  color: #111;
  background: #F4EEE4;
}

/* Empty highlight marks must never render as pills */
#reader mark[class*="hl-"]:empty,
#app mark[class*="hl-"]:empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
}

.save-btn.purge-btn { font-weight: 600; }
.purge-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  background: rgba(17, 17, 17, 0.28);
}
.purge-modal[hidden] { display: none; }
.purge-modal-card {
  width: min(28rem, 100%);
  padding: 1.6rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card, #FDF9F3);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.12);
}
.purge-modal-card p {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.purge-modal-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.save-btn.purge-confirm {
  border-color: var(--danger);
  color: #111;
  background: #fdecec;
}
.save-btn.purge-confirm:hover { border-color: #c43c3c; }
