:root {
  --bg-paper: #f6f5ef;
  --bg-surface: #ffffff;
  --bg-elevated: #ebe9e0;
  --bg-spotlight: #fdfaf3;
  --rule: #dadfd9;
  --rule-strong: #bfc9c3;
  --ink: #182423;
  --ink-2: #4e5e5c;
  --ink-3: #788886;
  --teal: #1f5c58;
  --crimson: #c9643b;
  --gold: #cf8e2e;
  --forest: #2d6e5e;
  --topbar-bg: rgba(246, 245, 239, 0.88);
  --shadow-soft: 0 8px 24px rgba(24, 36, 35, 0.06);
  --shadow-drawer: 0 20px 60px rgba(18, 28, 27, 0.24);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --text-scale: 1;
}

html[data-theme="sepia"] {
  --bg-paper: #f2e8d5;
  --bg-surface: #faf3e6;
  --bg-elevated: #e7dac2;
  --bg-spotlight: #fcf6eb;
  --rule: #d7c7ad;
  --rule-strong: #bfa98a;
  --ink: #1f2623;
  --ink-2: #545b52;
  --ink-3: #7d8073;
  --teal: #1c524e;
  --crimson: #bf5b32;
  --gold: #b5781a;
  --forest: #2b6353;
  --topbar-bg: rgba(242, 232, 213, 0.9);
}

html[data-theme="dark"] {
  --bg-paper: #0f1717;
  --bg-surface: #172222;
  --bg-elevated: #1f2e2e;
  --bg-spotlight: #1b2828;
  --rule: #2a3c3b;
  --rule-strong: #3a5250;
  --ink: #eaf0ee;
  --ink-2: #a3b8b5;
  --ink-3: #738a87;
  --teal: #66bab3;
  --crimson: #ea8a5c;
  --gold: #e8b259;
  --forest: #77c2a8;
  --topbar-bg: rgba(15, 23, 23, 0.88);
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.36);
  --shadow-drawer: 0 22px 56px rgba(0, 0, 0, 0.62);
}

html[data-theme="amber"] {
  --bg-paper: #13110e;
  --bg-surface: #1c1813;
  --bg-elevated: #262019;
  --bg-spotlight: #211c15;
  --rule: #362e23;
  --rule-strong: #4b3f30;
  --ink: #f0d8b4;
  --ink-2: #bfa47e;
  --ink-3: #8c7556;
  --teal: #78b8ad;
  --crimson: #e07b4f;
  --gold: #e6a94e;
  --forest: #7fb89b;
  --topbar-bg: rgba(19, 17, 14, 0.88);
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.42);
  --shadow-drawer: 0 22px 56px rgba(0, 0, 0, 0.68);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: calc(15px * var(--text-scale));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  font-variation-settings: "WONK" 0, "SOFT" 0;
}
.prose p, .verse, .entry-text, .composer textarea, .journal-box textarea, .quote, .facts dd, .excerpt p, .switch-btn, .welcome-headline, .answer-note {
  font-variation-settings: "WONK" 0, "SOFT" 0;
}
.muted { color: var(--ink-3); font-size: 13px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Welcome Gate ---------- */
.welcome-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-paper);
}
.welcome-topbar {
  border-bottom: 1px solid var(--rule);
  padding: 14px 24px;
}
.welcome-topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.welcome-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 36px 20px;
}
.dawn-welcome-card {
  max-width: 560px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 34px 32px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.dawn-horizon-art {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}
.welcome-headline {
  font-size: 32px;
  line-height: 1.2;
  margin: 10px 0 12px;
}
.welcome-lead {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0 0 24px;
}
.welcome-auth-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  color: var(--ink);
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, border-color 0.2s;
}
.btn-google-signin:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-1px);
}
.btn-google-signin:disabled {
  opacity: 0.65;
  cursor: wait;
}
.google-g { width: 18px; height: 18px; }
.welcome-status {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 34px; height: 34px; }
.brand-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
}
.brand-cross {
  width: 17px;
  height: 24px;
  color: var(--crimson);
  margin: 0 1px;
  transform: translateY(-1px);
}
.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-2);
}
.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.sync-chip:hover { border-color: var(--rule-strong); }
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}
.sync-dot[data-state="synced"] { background: var(--forest); }
.sync-dot[data-state="syncing"] { background: var(--gold); }
.sync-dot[data-state="error"] { background: var(--crimson); }
.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}
.btn-ghost {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink-3);
  font-size: 13px;
}
.btn-ghost:hover { border-color: var(--rule); color: var(--ink); }

.switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 4px;
}
.switch-btn {
  position: relative;
  z-index: 1;
  background: none;
  border: 0;
  padding: 7px 26px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .25s;
}
.switch-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(24,36,35,.1);
  transition: transform .35s var(--ease);
}
body[data-view="tell"] .switch-thumb { transform: translateX(100%); }
body[data-view="pray"] .switch-btn[data-view="pray"],
body[data-view="tell"] .switch-btn[data-view="tell"] { color: var(--ink); }

.btn {
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
}
html[data-theme="dark"] .btn,
html[data-theme="amber"] .btn { color: #101818; }
.btn:hover { filter: brightness(1.08); }
.btn-soft {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
}
.btn-soft:hover { filter: brightness(0.97); }
.btn-full { width: 100%; text-align: center; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-danger {
  background: none;
  border: 1px solid rgba(201, 100, 59, 0.35);
  color: var(--crimson);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.btn-danger:hover { background: rgba(201, 100, 59, 0.1); }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--teal);
  font-weight: 600;
  font-size: 13px;
}
.link:hover { text-decoration: underline; }

/* ---------- Views ---------- */
.view { display: none; animation: fadeIn .32s var(--ease); }
body[data-view="pray"] .view-pray { display: block; }
body[data-view="tell"] .view-tell { display: grid; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.column { max-width: 720px; margin: 0 auto; padding: 38px 24px 120px; }
.greeting { margin-bottom: 34px; }
.greeting h1 { font-size: 36px; margin: 6px 0 8px; }
.verse { font-family: var(--serif); font-style: italic; color: var(--ink-2); margin: 0; }
.verse span { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: 6px; }

.block { margin-bottom: 44px; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.block-head-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.block-head h2 { font-size: 22px; }
.filter-pills { display: inline-flex; gap: 4px; }
.filter-pill {
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.filter-pill:hover { color: var(--ink); }
.filter-pill.active {
  background: var(--bg-elevated);
  color: var(--ink);
  font-weight: 600;
}

.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input, .form-input, .form-select, .form-textarea {
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ink);
}
.add-row input { flex: 1; }
.add-row input:focus, .form-input:focus, .form-select:focus, .form-textarea:focus, textarea:focus {
  outline: 2px solid rgba(31, 92, 88, .25);
  border-color: var(--teal);
}
.btn-options-toggle { padding: 0 13px; font-size: 16px; }

.options-tray {
  background: var(--bg-spotlight);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.options-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
}
.field-label select, .field-label input {
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13.5px;
}
.field-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  padding-bottom: 7px;
  cursor: pointer;
}
.options-details {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
}

.req-list { list-style: none; margin: 0; padding: 0; }
.req {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 13px 4px;
  border-bottom: 1px solid var(--rule);
}
.req:last-child { border-bottom: 0; }
.check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  background: none;
  margin-top: 2px;
  display: grid;
  place-items: center;
  transition: all .2s;
}
.check:hover { border-color: var(--teal); }
.req.prayed .check { background: var(--teal); border-color: var(--teal); }
.req.prayed .check::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.req.prayed .req-text { color: var(--ink-3); }
.req-text { font-size: 15.5px; font-weight: 500; }
.req-details { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.req-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.urgent-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--crimson);
  background: rgba(201, 100, 59, 0.12);
  padding: 1px 7px;
  border-radius: 999px;
  margin-right: 6px;
}
.req-actions {
  display: flex;
  gap: 4px;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.req:hover .req-actions { opacity: 1; }
.req-act-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  color: var(--ink-3);
}
.req-act-btn:hover {
  border-color: var(--rule);
  background: var(--bg-elevated);
  color: var(--ink);
}

/* the light connection: a quiet "from Tell" thread */
.thread {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.thread::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.thread:hover { color: var(--teal); }
.new-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-weight: 600;
}
.new-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(207, 142, 46, .18);
}

.answered summary {
  cursor: pointer;
  color: var(--ink-3);
  font-size: 13px;
  padding: 12px 4px;
  list-style: none;
}
.answered summary::-webkit-details-marker { display: none; }
.answered summary::before { content: "\25B8  "; }
.answered[open] summary::before { content: "\25BE  "; }
.req.is-answered .check { border-color: var(--gold); background: var(--gold); }
.req.is-answered .check::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.answer-note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 4px;
}

.journal-box {
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
}
.journal-box textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
  padding: 14px 16px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}
.journal-box textarea:focus { outline: none; }
.journal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 8px 14px;
  min-height: 46px;
}
.mentions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.mention-chip {
  border: 1px solid var(--rule);
  background: var(--bg-spotlight);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  animation: fadeIn .3s var(--ease);
}
.mention-chip:hover { border-color: var(--teal); color: var(--teal); }
.journal-list { margin-top: 18px; }
.entry {
  padding: 16px 4px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.entry-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.entry-text {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-2);
  margin-top: 4px;
  white-space: pre-wrap;
}
.name-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.name-link:hover { color: var(--teal); text-decoration-color: var(--teal); }

/* ---------- Tell View ---------- */
.view-tell {
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 61px);
}
.tell-index {
  border-right: 1px solid var(--rule);
  padding: 20px 14px 40px;
  position: sticky;
  top: 61px;
  height: calc(100vh - 61px);
  overflow: auto;
}
.tell-index-actions {
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}
.index-group {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 18px 10px 8px;
}
.index-group:first-child { margin-top: 4px; }
.index-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
}
.index-item:hover { background: var(--bg-elevated); }
.index-item.active {
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
}
.index-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.index-sub { font-size: 12px; color: var(--ink-3); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }
.unseen {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.reader {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 64px 140px;
}
.reader-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.reader-head-main {
  display: flex;
  gap: 14px;
  align-items: center;
}
.reader-head h1 { font-size: 26px; }
.reader-sub { color: var(--ink-3); font-size: 13.5px; }
.reader-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.letter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  align-items: center;
}
.letter-tab {
  border: 1px solid var(--rule);
  background: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.letter-tab.active {
  background: var(--ink);
  color: var(--bg-paper);
  border-color: var(--ink);
}
.letter-title {
  font-size: 29px;
  margin-bottom: 18px;
  line-height: 1.22;
}
.prose p {
  position: relative;
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.75;
  margin: 0 0 1.1em;
  color: var(--ink);
}
.prose h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 28px 0 6px;
}
.prose h3:first-child { margin-top: 0; }

/* Gutter dots: subtle hint that a paragraph contains a prayer need or answer */
.prose p.has-ask::before, .prose p.has-answer::before {
  content: "";
  position: absolute;
  left: -24px;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  opacity: .55;
}
.prose p.has-answer::before { background: var(--gold); opacity: .85; }

.ask {
  cursor: pointer;
  border-radius: 3px;
  background-image: linear-gradient(to right, rgba(201, 100, 59, .6) 45%, transparent 45%);
  background-size: 6px 1.5px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  transition: background-color .2s;
}
.ask:hover { background-color: rgba(201, 100, 59, .1); }
.ask.linked {
  background-image: linear-gradient(rgba(31, 92, 88, .4), rgba(31, 92, 88, .4));
  background-size: 100% 1px;
}
.ask.linked:hover { background-color: rgba(31, 92, 88, .08); }
.answer {
  cursor: pointer;
  background: linear-gradient(transparent 62%, rgba(207, 142, 46, .28) 62%);
  border-radius: 2px;
  transition: background .2s;
}
.answer:hover { background: linear-gradient(transparent 0%, rgba(207, 142, 46, .22) 0%); }
.answer.is-answered { background: linear-gradient(transparent 62%, rgba(207, 142, 46, .14) 62%); }

.coach {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--bg-spotlight);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 24px;
}
.coach i { font-style: normal; border-bottom: 1.5px dotted var(--crimson); }
.coach b { font-weight: 600; background: linear-gradient(transparent 60%, rgba(207,142,46,.3) 60%); }
.coach button { background: none; border: 0; color: var(--ink-3); font-size: 16px; }
.signoff { font-family: var(--serif); font-style: italic; color: var(--ink-2); }

/* ---------- Edge tabs (light calls) ---------- */
.edge-tab {
  position: fixed;
  top: 50%;
  z-index: 20;
  display: none;
  writing-mode: vertical-rl;
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  padding: 14px 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  box-shadow: var(--shadow-soft);
  transition: padding .25s var(--ease), color .2s;
}
.edge-tab:hover { color: var(--ink); padding-left: 11px; padding-right: 11px; }
.edge-tab .count { display: inline-block; color: var(--crimson); font-weight: 500; }
.edge-left {
  left: 0;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  transform: translateY(-50%);
}
.edge-right {
  right: 0;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  transform: translateY(-50%);
}
#edgeTell .count { color: var(--gold); }
body[data-view="pray"] #edgeTell.show { display: block; }
body[data-view="tell"] #edgePray.show { display: block; }

/* ---------- Drawers ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 36, 35, .2);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: min(460px, 100vw);
  background: var(--bg-paper);
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .36s var(--ease), visibility .36s;
  visibility: hidden;
}
.drawer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--crimson));
}
.drawer-left { left: 0; transform: translateX(-102%); border-right: 1px solid var(--rule); }
.drawer-right { right: 0; transform: translateX(102%); border-left: 1px solid var(--rule); }
.drawer.open { transform: none; visibility: visible; }
.drawer-head {
  padding: 22px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.drawer-head h2 { font-size: 22px; margin-top: 3px; }
.drawer-head .sub { color: var(--ink-3); font-size: 13px; }
.x {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  padding: 2px 4px;
}
.x:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px 30px; }
.drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.d-section { margin-bottom: 24px; }
.d-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.composer {
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
}
.composer textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  color: var(--ink);
}
.composer textarea:focus { outline: none; }
.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 6px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.quote {
  border-left: 2px solid var(--rule-strong);
  padding: 2px 0 2px 12px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: 14.5px;
  margin: 0 0 12px;
}

.callout {
  background: linear-gradient(180deg, rgba(207,142,46,.12), rgba(207,142,46,.04));
  border: 1px solid rgba(207,142,46,.35);
  border-radius: 12px;
  padding: 14px 16px;
}
.callout .d-label { color: var(--gold); }
.callout-req { font-weight: 600; margin-bottom: 6px; }
.callout .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 1px solid var(--rule-strong);
}
.tl { position: relative; padding: 0 0 18px 14px; }
.tl::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-paper);
  border: 1.5px solid var(--rule-strong);
}
.tl.answered::before { background: var(--gold); border-color: var(--gold); }
.tl.focus { animation: focusFlash 1.8s var(--ease); border-radius: 8px; }
@keyframes focusFlash { 0%, 40% { background: rgba(207,142,46,.18); } 100% { background: transparent; } }
.tl-date { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.tl-text { font-size: 14.5px; font-weight: 500; }
.tl-status { font-size: 12px; color: var(--ink-3); }
.tl.answered .tl-status { color: var(--gold); font-weight: 600; }
.tl-year {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  margin: 4px 0 10px -16px;
  padding-left: 0;
  color: var(--ink-2);
  list-style: none;
}

.excerpt p { font-family: var(--serif); font-size: 16px; line-height: 1.65; margin: 0 0 .9em; }
.excerpt p.has-ask::before, .excerpt p.has-answer::before { left: -15px; }
.facts { margin: 0; }
.facts dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 16px;
}
.facts dd {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.6;
}
.feed-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  width: 100%;
  text-align: left;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
.feed-item:hover .index-name { color: var(--teal); }
p.flash { animation: focusFlash 2s var(--ease); border-radius: 6px; }

/* ---------- Drawer Forms & Settings ---------- */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.form-input, .form-select, .form-textarea { width: 100%; font-size: 14.5px; }
.form-textarea { font-family: var(--serif); font-size: 16px; line-height: 1.55; resize: vertical; }
.form-hint { font-size: 12px; color: var(--ink-3); }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.theme-opt {
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
}
.theme-opt.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(31, 92, 88, 0.2);
}

/* ---------- Letter Ingest Drop Zone, Draft Strip, Gallery & Lightbox ---------- */
.drop-zone {
  border: 1.5px dashed var(--rule-strong);
  border-radius: 12px;
  background: var(--bg-spotlight);
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--teal);
  background: rgba(31, 92, 88, 0.06);
}
.drop-zone-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}
.drop-zone-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}
.ingest-status {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--teal);
  min-height: 16px;
}
.draft-media-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}
.draft-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-surface);
}
.draft-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.draft-thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(24, 36, 35, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.draft-thumb-tag {
  position: absolute;
  left: 3px;
  bottom: 3px;
  background: rgba(24, 36, 35, 0.72);
  color: #fff;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
}

.letter-tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.letter-tabs-row .letter-tabs { margin-bottom: 0; }
.letter-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 18px;
}
.letter-gallery.empty { display: none; padding: 0; }
.letter-media-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s var(--ease), border-color 0.2s;
}
.letter-media-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}
.letter-media-card img {
  height: 128px;
  width: auto;
  max-width: 210px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}
.letter-media-cap {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px 2px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px 56px;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 23, 0.88);
  backdrop-filter: blur(4px);
}
.lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  background: #fff;
}
.lightbox-caption {
  color: #eaf0ee;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}
.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(24, 36, 35, 0.7);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.lightbox-close { top: 18px; right: 20px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--teal); border-color: var(--teal); }

/* ---------- Selection pop & toast ---------- */
.sel-pop {
  position: absolute;
  z-index: 35;
  background: var(--ink);
  color: var(--bg-paper);
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-drawer);
  transform: translate(-50%, -100%);
  animation: fadeIn .2s var(--ease);
}
.sel-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom: 0;
  border-top-color: var(--ink);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--ink);
  color: var(--bg-paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  transition: all .3s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 840px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 10px 14px; gap: 8px; }
  .switch { justify-self: center; }
  .switch-btn { padding: 6px 18px; font-size: 16px; }
  .brand-wordmark, .pill, .sync-label { display: none; }
  .view-tell { grid-template-columns: 1fr; }
  .tell-index {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 10px 12px;
  }
  .tell-index-actions { border-bottom: 0; margin-bottom: 6px; padding: 0; }
  #tellIndexList {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .index-group { display: none; }
  .index-item {
    grid-template-columns: 30px auto auto;
    flex: 0 0 auto;
    width: auto;
  }
  .index-item .avatar { width: 30px; height: 30px; font-size: 12px; }
  .index-sub { display: none; }
  .reader { padding: 26px 24px 120px; }
  .prose p.has-ask::before, .prose p.has-answer::before { left: -14px; }
  .column { padding-top: 26px; }
  .greeting h1 { font-size: 30px; }
  .options-grid { grid-template-columns: 1fr; }
}
