* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.ib { border: 0; background: transparent; cursor: pointer; border-radius: 6px;
  width: 30px; height: 30px; display: inline-grid; place-items: center; color: var(--muted); }
.ib:hover { background: var(--hover); color: var(--ink); }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px; }
input, select { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, .btn:focus-visible, .ib:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.02em; }
.brand.big { font-size: 22px; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  -webkit-mask: none; position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 5px 4px; border: 2px solid var(--accent-ink);
  border-top: 0; border-radius: 0 0 3px 3px; }
.brand.big .logo { width: 30px; height: 30px; }

/* Auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.auth-card p { margin: 0 0 6px; }
.auth-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-card input { color: var(--ink); font-size: 15px; }

/* Layout */
.app { height: 100%; display: grid;
  grid-template: "top top top" 52px "side main bible" 1fr / 270px 1fr auto; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--paper); }
.status { font-size: 12.5px; color: var(--muted); }
.status.bad { color: var(--danger); }
.stats { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sidebar { grid-area: side; border-right: 1px solid var(--line); padding: 14px; display: flex;
  flex-direction: column; gap: 10px; overflow: auto; background: var(--bg); }
.sermon-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; align-content: start; gap: 2px; }
.sermon-list button { width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; display: grid; gap: 1px; }
.sermon-list button:hover { background: var(--hover); }
.sermon-list .active button { background: var(--paper); box-shadow: var(--shadow); }
.sermon-list .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sermon-list .s { font-size: 12px; color: var(--muted); }
.import { font-size: 13px; color: var(--muted); }

.main { grid-area: main; min-width: 0; overflow: auto; position: relative; }
.empty { text-align: center; padding: 15vh 16px; }

/* Toolbar */
.toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 2px;
  padding: 6px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); overflow-x: auto; }
.toolbar button { border: 0; background: transparent; min-width: 32px; height: 32px; border-radius: 6px;
  cursor: pointer; font-size: 14px; padding: 0 6px; }
.toolbar button:hover { background: var(--hover); }
.toolbar button.on { background: var(--hover); color: var(--accent); }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }
.hl-swatch { background: var(--hl); color: #222; padding: 0 4px; border-radius: 3px; }

/* Document */
.doc { max-width: 780px; margin: 0 auto; padding: 28px 24px 120px; }
.title { width: 100%; border: 0; background: transparent; padding: 4px 0; font: 700 32px/1.2 var(--font-read); letter-spacing: -.02em; }
.title:focus { outline: none; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.meta input { flex: 1 1 160px; background: transparent; font-size: 14px; }
.meta input[type=date] { flex: 0 1 160px; }

.blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.block { min-width: 0; }
.block { --c: var(--c-text); background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--c); border-radius: var(--r); box-shadow: var(--shadow); }
.block.active { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); border-left-color: var(--c); }
.block.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.block.drop-after { box-shadow: 0 3px 0 var(--accent); }
.block.dragging { opacity: .4; }
.t-scripture { --c: var(--c-scripture); } .t-point { --c: var(--c-point); }
.t-subpoint { --c: var(--c-subpoint); } .t-illustration { --c: var(--c-illustration); }
.t-application { --c: var(--c-application); } .t-text { --c: var(--c-text); }
.block.t-subpoint { margin-left: 28px; }

.bhead { display: flex; align-items: center; gap: 6px; padding: 6px 8px 0 6px; }
.handle { cursor: grab; color: var(--muted); padding: 2px 4px; user-select: none; font-size: 15px; }
.badge { font: 650 11.5px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em;
  color: var(--c); white-space: nowrap; }
.label { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 600; padding: 4px 6px; }
.label:focus { outline: none; background: var(--hover); }
.bwc { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bactions { display: flex; opacity: .55; }
.block:hover .bactions, .block.active .bactions { opacity: 1; }
.bactions .ib { width: 26px; height: 26px; font-size: 13px; }
.block.collapsed .body, .block.collapsed .refrow { display: none; }
.block.collapsed [data-act=collapse] { transform: rotate(-90deg); }

.refrow { display: flex; gap: 6px; padding: 6px 14px 0; flex-wrap: wrap; align-items: center; }
.refrow .ref { flex: 1 1 170px; }
.refrow .tr { max-width: 210px; }
.refrow .ver { flex: 0 1 150px; min-width: 110px; }
.mode-seg button { padding: 4px 10px; }
.block:not(.mode-manual) .only-manual, .block.mode-manual .only-lookup { display: none; }

.body { padding: 8px 18px 14px; min-height: 2.4em; font: 400 17px/1.7 var(--font-read); outline: none; overflow-wrap: anywhere; }
.body:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.body p { margin: 0 0 .7em; } .body > :last-child { margin-bottom: 0; }
.body h3 { font: 700 19px/1.35 var(--font-read); margin: .4em 0 .3em; }
.body blockquote { margin: .4em 0 .7em; padding-left: 14px; border-left: 3px solid var(--line); color: color-mix(in srgb, var(--ink) 80%, var(--muted)); }
.body ul, .body ol { margin: 0 0 .7em; padding-left: 1.4em; }
.body sup { color: var(--muted); font: 600 .62em var(--font-ui); margin-right: 2px; }
.body .cite { color: var(--muted); font-style: italic; font-size: .92em; }
.body span[style*="background"] { color: #26221d; border-radius: 2px; }

.addbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px;
  padding: 12px; border: 1px dashed var(--line); border-radius: var(--r); }
.chip { --c: var(--c-text); border: 1px solid var(--line); background: var(--paper); border-radius: 99px;
  padding: 5px 12px 5px 10px; cursor: pointer; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip:hover { border-color: var(--c); }

/* Bible */
.bible { grid-area: bible; width: 360px; border-left: 1px solid var(--line); background: var(--paper);
  display: flex; flex-direction: column; min-height: 0; }
.bible-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bible-form { display: flex; gap: 6px; padding: 12px 14px; flex-wrap: wrap; }
.bible-form input { flex: 1 1 140px; }
.bible-out { flex: 1; overflow: auto; padding: 4px 18px 14px; font: 16px/1.65 var(--font-read); }
.bible-out h4 { font: 650 14px var(--font-ui); margin: 8px 0; }
.bible-out sup { color: var(--muted); font: 600 .62em var(--font-ui); margin-right: 2px; }
.bible-actions { display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Theme switch */
.theme-btn .i-sun { display: none; }
:root[data-mode="dark"] .theme-btn .i-sun { display: block; }
:root[data-mode="dark"] .theme-btn .i-moon { display: none; }
.menu-seg { display: flex; gap: 3px; margin: 2px 6px 6px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.menu-seg button { flex: 1; text-align: center !important; padding: 6px 4px !important; font-size: 13px; }
.menu-seg button.on { background: var(--hover); font-weight: 600; }
.menu-label { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }

/* Menu */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 6px; display: grid; }
.menu-pop button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--hover); }
.menu-pop .danger { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-user { font-size: 12px; color: var(--muted); padding: 4px 10px; }

.toast { z-index: 200 !important; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.only-mobile { display: none; }
.scrim { display: none; }

/* Narrow screens */
@media (max-width: 1100px) {
  .bible { position: fixed; right: 0; top: 52px; bottom: 0; z-index: 25; box-shadow: -10px 0 30px rgba(0,0,0,.12); width: min(380px, 100%); }
  .app { grid-template-columns: 250px minmax(0, 1fr) 0; }
}
@media (max-width: 760px) {
  .only-mobile { display: inline-grid; }
  .hide-sm { display: none; }
  .app { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .sidebar { position: fixed; left: 0; top: 52px; bottom: 0; width: 280px; z-index: 26;
    transform: translateX(-100%); transition: transform .2s; }
  body.show-sidebar .sidebar { transform: none; }
  body.show-sidebar .scrim { display: block; position: fixed; inset: 52px 0 0; background: rgba(0,0,0,.3); z-index: 24; }
  .doc { padding: 18px 16px 100px; }
  .title { font-size: 26px; }
  .block.t-subpoint { margin-left: 14px; }
  .bactions [data-act=up], .bactions [data-act=down] { display: inline-grid; }
  .handle { display: none; }
  .bwc { display: none; }
  .bactions .ib { width: 30px; height: 30px; }
  .refrow .ref { flex-basis: 100%; }
  .refrow .mode-seg { flex-basis: 100%; }
  .mode-seg button { flex: 1; }
  .refrow .tr { max-width: none; flex: 1; }
  .refrow .ver { flex: 1; }
  .refrow .btn { flex: 1; }
  .stats { font-size: 12px; }
}

/* ================= Library (landing page) ================= */
.view-library .app { grid-template-columns: 0 minmax(0, 1fr) auto; }
.view-library .sidebar, .view-library .sermon-only, .view-library #saveStatus,
.view-library #wordStats, .view-library #menuBtn, .view-library .scrim { display: none !important; }
.brand-btn { border: 0; background: none; cursor: pointer; padding: 5px 8px; margin-left: -8px; border-radius: 8px; color: inherit; font: inherit; font-weight: 650; }
.brand-btn:hover { background: var(--hover); }
.lib-back { justify-content: flex-start; color: var(--muted); }

.library { max-width: 860px; margin: 0 auto; padding: 48px 24px 96px; }
.lib-hero { display: grid; justify-items: center; gap: 18px; margin-bottom: 30px; }
.lib-new { font-size: 16px; font-weight: 650; padding: 12px 30px; border-radius: 12px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
.lib-search { width: 100%; max-width: 640px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--muted); cursor: text; }
.lib-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.lib-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 14px 0; font-size: 16px; color: var(--ink); }
.lib-search input:focus { outline: none; }
.lib-tools { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; background: var(--paper); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--hover); color: var(--ink); font-weight: 600; }

.lib-group { margin: 0 0 22px; }
.lg-head { width: 100%; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; border: 0; background: none; cursor: pointer;
  padding: 6px 4px; text-align: left; color: var(--ink); border-radius: 8px; }
.lg-head:hover .lg-title { color: var(--accent); }
.lg-head .chev { align-self: center; color: var(--muted); transition: transform .2s; flex: none; }
.lib-group.closed .chev { transform: rotate(-90deg); }
.lib-group.closed .lg-items { display: none; }
.lg-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.lg-sub { font-size: 13px; color: var(--muted); }
.lg-items { list-style: none; margin: 6px 0 0; padding: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.lib-item { display: flex; align-items: center; border-top: 1px solid var(--line); transition: background .12s; }
.lib-item:first-child { border-top: 0; }
.lib-item:hover { background: var(--hover); }
.lc-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; border: 0; background: none; cursor: pointer;
  text-align: left; padding: 12px 14px; color: var(--ink); }
.lc-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r); }
.lc-tile { flex: none; width: 52px; display: grid; justify-items: center; padding: 6px 0; border-radius: 10px; line-height: 1.1;
  background: color-mix(in srgb, var(--accent) 13%, var(--paper)); color: var(--accent); font-variant-numeric: tabular-nums; }
.lc-tile .m { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.lc-tile .d { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.lc-tile .y { font-size: 10.5px; opacity: .8; }
.lc-tile.none { background: var(--hover); color: var(--muted); }
.lc-tile.none .d { font-size: 16px; }
.lc-main { min-width: 0; display: grid; gap: 2px; }
.lc-title { font-weight: 650; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.005em; }
.lc-part { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-right: 8px; }
.lc-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-snip { font-size: 13.5px; line-height: 1.5; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-snip mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.lc-podium { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--accent); border-radius: 999px; font-size: 13px; font-weight: 600;
  opacity: 0; transition: opacity .15s, background .15s; }
.lib-item:hover .lc-podium, .lc-podium:focus-visible { opacity: 1; }
.lc-podium:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (hover: none) { .lc-podium { opacity: 1; } }
.lib-empty { text-align: center; padding: 36px 16px; }
.lib-empty h2 { margin: 0 0 8px; letter-spacing: -.02em; }
.lib-empty p { max-width: 460px; margin: 0 auto; }
.lib-import { display: block; width: max-content; margin: 30px auto 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
@media (max-width: 760px) {
  .library { padding: 26px 14px 80px; }
  .lc-open { gap: 11px; padding: 11px 10px; }
  .lc-tile { width: 44px; }
  .lc-tile .d { font-size: 17px; }
  .lc-podium { padding: 8px; margin-right: 8px; }
  .lc-podium span { display: none; }
}

/* ================= Podium mode ================= */
.preach { --psize: 32px; position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--ink); }

.p-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3; background: transparent; }
.p-progress div { height: 100%; width: 0; background: var(--accent); opacity: .8; transition: width .15s; }

/* Floating clock + timer */
.p-pill { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 4px 4px 16px; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-clock { color: var(--muted); font-size: 15px; font-weight: 500; padding-right: 6px; }
.p-timer { display: flex; align-items: baseline; gap: 8px; border: 0; background: transparent; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; }
.p-timer:hover { background: var(--line); }
.p-clock:not([hidden]) + .p-timer { border-left: 1px solid var(--line); border-radius: 0 999px 999px 0; }
.p-time { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.p-remain { font-size: 13.5px; color: var(--muted); }
.p-pill.idle .p-time { color: var(--muted); }
.p-pill.paused .p-time { opacity: .55; }
.p-pill.warn .p-time, .p-pill.warn .p-remain { color: #e2a338; }
.p-pill.over .p-time, .p-pill.over .p-remain { color: #ef5f55; }
.p-pill.timer-only { padding-left: 4px; }

/* Corner controls: faint until you move */
.p-corner { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 4px; opacity: .16; transition: opacity .35s; }
.preach.show-controls .p-corner, .p-corner:hover, .p-corner:focus-within { opacity: 1; }
@media (hover: none) { .p-corner { opacity: .55; } }
.p-ic { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 85%, transparent); color: var(--ink); cursor: pointer; }
.p-ic:hover { background: var(--line); }
.preach button:focus-visible, .preach input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.preach.shared #pExit { display: none; }

/* Reading column */
.p-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; outline: none; }
.p-doc { max-width: 34em; margin: 0 auto; padding: 96px 28px 65vh; font: 400 var(--psize)/1.55 var(--font-read); letter-spacing: -.005em; }
.p-doc h1 { font-size: 1.4em; line-height: 1.15; margin: 0 0 .2em; letter-spacing: -.02em; }
.p-meta { color: var(--muted); font: 500 max(15px, .55em)/1.4 var(--font-ui); margin: 0 0 1.6em; }
.p-sec { --c: var(--c-text); border-left: 4px solid var(--c); padding: .1em 0 .1em .8em; margin: 0 0 1.4em;
  scroll-margin-top: 88px; transition: opacity .3s; }
.preach.fade .p-sec.passed { opacity: .4; }
.p-sec.t-scripture { --c: var(--c-scripture); } .p-sec.t-point { --c: var(--c-point); } .p-sec.t-subpoint { --c: var(--c-subpoint); margin-left: 1em; }
.p-sec.t-illustration { --c: var(--c-illustration); } .p-sec.t-application { --c: var(--c-application); }
.p-kicker { font: 700 max(11px, .42em)/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .09em; color: var(--c); }
.preach.no-labels .p-kicker { display: none; }
.p-sec h2 { font-size: 1.08em; line-height: 1.25; margin: .05em 0 .35em; }
.p-sec.t-point h2, .p-sec.t-subpoint h2 { color: var(--c); }
.p-body p { margin: 0 0 .6em; } .p-body > :last-child { margin-bottom: 0; }
.p-body h3 { font-size: 1em; margin: .3em 0; }
.p-body ul, .p-body ol { margin: 0 0 .6em; padding-left: 1.2em; }
.p-body blockquote { margin: .3em 0 .6em; padding-left: .7em; border-left: 3px solid var(--line); }
.p-body sup { color: var(--muted); font: 600 .5em var(--font-ui); margin-right: 2px; }
.p-body .cite { color: var(--muted); font-style: italic; font-size: .8em; }
.p-body span[style*="background"] { color: #1d1a16; border-radius: 3px; padding: 0 2px; }
.p-empty { color: var(--muted); text-align: center; padding-top: 20vh; }

/* Settings panel */
.p-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 4; width: min(360px, 100%); overflow-y: auto; overflow-x: hidden;
  background: var(--paper); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(0,0,0,.25);
  font: 15px/1.45 var(--font-ui); padding: 0 18px 24px; }
.p-panel-head { position: sticky; top: 0; background: var(--paper); display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 10px; z-index: 1; }
.p-panel section > * { min-width: 0; }
.p-panel section { grid-template-columns: minmax(0, 1fr); padding: 12px 0 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.p-panel h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.p-row { display: flex; align-items: center; gap: 10px; }
.p-row input[type=range] { flex: 1; accent-color: var(--accent); }
.p-row output { min-width: 36px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-row input[type=number] { width: 72px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); text-align: center; }
.p-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.p-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.p-seg { display: flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.p-seg button { flex: 1; border: 0; background: transparent; color: var(--ink); padding: 7px 6px; border-radius: 6px; cursor: pointer; font: inherit; }
.p-seg button.on { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.p-buttons { display: flex; gap: 8px; }
.p-btn { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.p-btn:hover { background: var(--line); }
.p-btn.p-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.p-nav { display: grid; gap: 2px; }
.p-nav button { --c: var(--c-text); display: flex; gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; color: var(--ink);
  padding: 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.p-nav button:hover, .p-nav button.current { background: var(--line); }
.p-nav .k { color: var(--c); font: 700 11px var(--font-ui); text-transform: uppercase; letter-spacing: .06em; min-width: 82px; flex: none; }
.p-nav button { min-width: 0; }
.p-nav span:last-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-nav .t-scripture { --c: var(--c-scripture); } .p-nav .t-point { --c: var(--c-point); } .p-nav .t-subpoint { --c: var(--c-subpoint); padding-left: 24px; }
.p-nav .t-illustration { --c: var(--c-illustration); } .p-nav .t-application { --c: var(--c-application); }
.p-note { margin: 0; color: var(--muted); font-size: 13px; }
.p-panel > .p-note { border-top: 1px solid var(--line); padding-top: 12px; }
.p-share { display: flex; gap: 6px; }
.p-share input { flex: 1; min-width: 0; background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-size: 13px; }
.p-share .p-btn { flex: none; padding: 0 14px; }
.p-link { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 2px 0; font: 13px var(--font-ui); justify-self: start; }

@media (max-width: 760px) {
  .p-doc { padding: 84px 18px 65vh; }
  .p-pill { left: 12px; transform: none; padding-left: 12px; }
  .p-clock { font-size: 13px; }
  .p-time { font-size: 19px; }
  .p-remain { font-size: 12px; }
  .p-corner { top: 10px; right: 10px; }
  .p-corner #pPrint, .p-corner #pFull { display: none; }
  .p-ic { width: 38px; height: 38px; }
  .p-sec { scroll-margin-top: 76px; }
}
@media (max-width: 380px) { .p-clock { display: none; } }

/* Print */
@media print {
  @page { margin: 18mm; }
  body { background: #fff; color: #000; }
  .app { display: block; height: auto; }
  .topbar, .sidebar, .toolbar, .addbar, .bible, .bactions, .handle, .bwc, .refrow, .scrim, .toast, .empty { display: none !important; }
  .main { overflow: visible; }
  .doc { max-width: none; padding: 0; }
  .meta input { border: 0; padding: 0; color: #555; }
  .meta input:placeholder-shown { display: none; }
  .block { box-shadow: none; border: 0; border-left: 3px solid var(--c); border-radius: 0; break-inside: avoid; margin-bottom: 6px; }
  .block.collapsed .body { display: block; }
  .label:placeholder-shown { visibility: hidden; }
  .body:empty::before { content: none; }
}

@media print {
  body:not(.podium-open) .preach { display: none !important; }
  body.podium-open .app, body.podium-open .auth { display: none !important; }
  body.podium-open .preach { position: static; background: #fff; color: #000; }
  body.podium-open .p-pill, body.podium-open .p-corner, body.podium-open .p-panel, body.podium-open .p-progress { display: none !important; }
  body.podium-open .p-scroll { position: static; overflow: visible; }
  body.podium-open .p-doc { max-width: none; padding: 0; font-size: 16pt; }
  body.podium-open .p-sec { opacity: 1 !important; break-inside: avoid; }
}
