:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --panel: #151513;
  --panel-2: #1d1d1a;
  --line: #32322e;
  --ink: #f5f3eb;
  --muted: #9c9b94;
  --accent: #f6bd16;
  --accent-ink: #171307;
  --danger: #ff756f;
  --radius: 20px;
  --preach-size: 32px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
body.locked { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.hidden { display: none !important; }

.auth-screen { position: fixed; inset: 0; z-index: 500; display: none; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 5%, #302910 0, #0b0b0a 42%); }
.auth-screen.active { display: grid; }
.auth-card { width: min(440px, 100%); padding: clamp(26px, 6vw, 42px); border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 32px 90px #000b; }
.auth-mark { display: grid; place-items: center; width: 58px; aspect-ratio: 1; margin-bottom: 28px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font: 900 32px Georgia, serif; }
.auth-card h1 { font-size: clamp(36px, 8vw, 52px); }
.auth-card > p:not(.eyebrow), .auth-card > small { color: var(--muted); line-height: 1.5; }
.auth-form { display: grid; gap: 15px; margin: 26px 0 18px; }
.auth-form label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-form input { display: block; width: 100%; height: 50px; margin-top: 7px; padding: 0 14px; font-size: 16px; text-transform: none; }
.auth-error { min-height: 22px; color: var(--danger) !important; font-size: 13px; }
.auth-message { min-height: 22px; color: #8ed27c !important; font-size: 13px; }
.auth-link { min-height: 38px; border: 0; background: transparent; color: var(--accent); font-weight: 750; }

.app-header {
  height: 76px; padding: env(safe-area-inset-top) clamp(18px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
}
.brand { border: 0; color: var(--ink); background: transparent; display: flex; gap: 12px; align-items: center; text-align: left; padding: 0; }
.brand-mark { width: 38px; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-family: Georgia, serif; font-size: 22px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.account-name { max-width: 150px; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.save-state { color: var(--muted); font-size: 12px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: #b9c6ad; font-size: 11px; font-weight: 750; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: #73b95e; box-shadow: 0 0 0 3px #73b95e22; }
.connection-state.offline { color: #f1c96d; }
.connection-state.offline i { background: #f1c04d; box-shadow: 0 0 0 3px #f1c04d22; }
.icon-button, .preach-icon { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 13px; width: 42px; height: 42px; }

main { min-height: calc(100vh - 76px); }
.view { display: none; }
.view.active { display: block; }
#libraryView, #editorView { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 54px) 80px; }
.module-hub, .module-page { max-width: 1160px; margin: 0 auto; padding: clamp(38px, 7vw, 86px) clamp(18px, 5vw, 54px) 90px; }
.hub-heading > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 42px; }
.module-card { min-height: 180px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--ink); text-align: left; transition: transform .2s, border-color .2s, background .2s; }
.module-card:hover { transform: translateY(-3px); border-color: #676451; background: var(--panel-2); }
.module-card.preaching { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.module-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent); font-size: 28px; font-weight: 900; }
.module-copy strong, .module-copy small { display: block; }
.module-copy strong { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.025em; }
.module-copy small { max-width: 280px; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.module-arrow { color: var(--accent); font-size: 24px; }
.module-page > h1 { margin-bottom: 36px; }
.module-page > .text-button, .section-back { margin-bottom: 32px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary-grid article { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.summary-grid span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.summary-grid strong { color: var(--accent); font-size: 44px; }
.management-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.module-empty { margin-top: 28px; padding: clamp(34px, 6vw, 62px); border: 1px dashed #46453d; border-radius: 22px; background: var(--panel); text-align: center; }
.module-empty > span { color: var(--accent); font-size: 38px; }
.module-empty h2 { margin: 14px 0 8px; font-size: 26px; }
.module-empty p { margin: 0 auto; max-width: 480px; color: var(--muted); line-height: 1.55; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
h1 { font-size: clamp(40px, 7vw, 78px); max-width: 800px; letter-spacing: -.055em; line-height: .95; margin: 0; }
h1 em { color: var(--accent); font-style: normal; }
.hero p:not(.eyebrow) { color: var(--muted); max-width: 550px; font-size: 17px; line-height: 1.55; }
.primary, .secondary, .text-button, .block-buttons button { border-radius: 13px; min-height: 45px; padding: 0 18px; border: 1px solid transparent; font-weight: 750; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.06); }
.secondary, .block-buttons button { background: var(--panel); border-color: var(--line); color: var(--ink); }
.text-button { background: transparent; color: var(--muted); padding-left: 0; }
.library-toolbar { display: flex; gap: 12px; margin: 54px 0 24px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 18px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips button { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 800; }
.filter-chips button.active { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.offline-banner { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid #2d412a; border-radius: 14px; background: #111810; }
.offline-banner > span { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #73b95e; color: #0a1308; font-weight: 950; }
.offline-banner strong, .offline-banner small { display: block; }
.offline-banner strong { font-size: 13px; }
.offline-banner small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.search-field { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 0 16px; }
.search-field:focus-within { border-color: var(--accent); }
.search-field input { width: 100%; height: 50px; background: transparent; border: 0; color: var(--ink); outline: 0; }
.sermon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sermon-card { min-height: 245px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 24px; display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.sermon-card:hover { transform: translateY(-3px); border-color: #5e5c4c; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.tag { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border-radius: 99px; padding: 6px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.card-date { color: var(--muted); font-size: 12px; }
.sermon-card h2 { font-size: 25px; letter-spacing: -.03em; margin: 26px 0 8px; line-height: 1.08; }
.sermon-card p { color: var(--muted); margin: 0; }
.offline-status { display: inline-flex; align-items: center; align-self: flex-start; gap: 5px; margin-top: 14px; padding: 5px 8px; border-radius: 99px; background: #152014; color: #8ed27c; font-size: 10px; font-weight: 800; }
.card-actions { display: flex; margin-top: auto; gap: 8px; }
.card-actions button { flex: 1; border-radius: 11px; min-height: 40px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-weight: 700; }
.card-actions .preach { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { color: var(--accent); font-size: 34px; }
.empty-state h2 { color: var(--ink); }

.editor-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.editor-actions { display: flex; gap: 10px; }
.editor-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 38px; align-items: start; }
.outline-panel { position: sticky; top: 106px; }
.outline-panel nav { display: flex; flex-direction: column; gap: 7px; }
.outline-link { border: 0; border-left: 2px solid var(--line); color: var(--muted); background: transparent; text-align: left; padding: 10px 13px; font-size: 13px; }
.outline-link:hover { border-color: var(--accent); color: var(--ink); }
.editor-canvas { max-width: 800px; }
.message-meta { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 26px; }
.message-meta label, .block-label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.title-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
input, textarea, select { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.message-meta input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin-top: 7px; }
.message-meta .title-input { display: block; width: 100%; max-width: 100%; resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; field-sizing: content; border: 0; background: transparent; padding: 0; font-size: clamp(34px, 5vw, 55px); font-weight: 800; line-height: 1.06; letter-spacing: -.045em; min-height: 74px; text-transform: none; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 16px; }
.meta-grid label { position: relative; }
.input-suffix { position: absolute; right: 12px; bottom: 13px; color: var(--muted); font-size: 12px; text-transform: none; }
.duration-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.duration-presets > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-right: 5px; }
.duration-presets button { min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 750; }
.duration-presets button.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.duration-planner { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #171712, #11110f); }
.planner-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.planner-heading strong, .planner-kicker { display: block; }
.planner-heading strong { margin-top: 4px; font-size: 18px; }
.planner-kicker { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.target-stepper { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.target-stepper button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--panel-2); color: var(--ink); font-size: 19px; }
.target-stepper output { min-width: 58px; text-align: center; color: var(--accent); font-weight: 850; font-variant-numeric: tabular-nums; }
.planner-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 20px; }
.planner-metrics div { padding: 12px; border-radius: 12px; background: #20201c; }
.planner-metrics strong, .planner-metrics span { display: block; }
.planner-metrics strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.planner-metrics span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.duration-track { height: 7px; margin-top: 16px; overflow: hidden; border-radius: 99px; background: #34332d; }
.duration-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s; }
.duration-track i.over { background: var(--danger); }
.duration-planner p { margin: 12px 0 4px; color: var(--ink); font-size: 13px; line-height: 1.45; }
.duration-planner small { color: var(--muted); font-size: 10px; }
.clarity-review { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.clarity-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.clarity-heading strong { display: block; margin-top: 4px; font-size: 16px; }
.clarity-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; background: #39261f; color: #ffb28d; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.clarity-status.good { background: #152414; color: #8ed27c; }
.clarity-metrics { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.clarity-metrics strong { color: var(--ink); font-size: 15px; }
.clarity-review ul { margin: 12px 0 0; padding-left: 18px; color: #d8d5ca; font-size: 12px; line-height: 1.5; }
.clarity-review li + li { margin-top: 5px; }
.block-list { display: flex; flex-direction: column; gap: 12px; }
.editor-block { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); overflow: hidden; }
.block-head { display: flex; align-items: center; gap: 9px; padding: 9px 10px 0 15px; }
.block-kind { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; margin-right: auto; }
.block-head button { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; }
.block-head button:hover { background: var(--panel-2); color: var(--ink); }
.block-head .delete:hover { color: var(--danger); }
.editor-block textarea { display: block; width: 100%; min-height: 94px; resize: vertical; padding: 10px 15px 16px; border: 0; background: transparent; line-height: 1.55; outline: none; }
.editor-block[data-type="topic"] textarea { font-size: 23px; font-weight: 850; min-height: 70px; color: var(--accent); }
.editor-block[data-type="topic"] { margin-top: 12px; border-color: #5a4b19; background: linear-gradient(145deg, #211d0f, #15140e); box-shadow: 0 12px 32px #0003; }
.editor-block[data-type="scripture"] { border-left: 3px solid var(--accent); }
.editor-block[data-type="quote"] textarea { font-family: Georgia, serif; font-size: 20px; font-style: italic; }
.editor-block[data-type="note"] { background: #111823; border-color: #27394d; }
.add-block { margin-top: 24px; padding: 19px; border: 1px dashed #46453e; border-radius: 15px; }
.add-block p { color: var(--muted); margin: 0 0 12px; font-size: 12px; }
.block-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.block-buttons button { min-height: 38px; padding: 0 12px; font-size: 12px; }

.app-header:has(~ main #preachView.active) { display: none; }
main:has(#preachView.active) { min-height: 100vh; }
.preach-view.active { --preach-bg: #050505; min-height: 100vh; background: var(--preach-bg); padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.preach-header { min-height: calc(80px + env(safe-area-inset-top)); padding: calc(14px + env(safe-area-inset-top)) clamp(14px, 3vw, 34px) 14px; display: grid; grid-template-columns: 52px 1fr 1fr 52px; gap: 10px; align-items: center; border-bottom: 1px solid #282828; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--preach-bg) 92%, transparent); backdrop-filter: blur(20px); }
.preach-icon { width: 52px; height: 52px; border-radius: 17px; background: #191919; border-color: #242424; font-weight: 850; }
.clock-card, .timer-card { height: 52px; border-radius: 18px; background: #191919; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; font-size: clamp(19px, 3vw, 28px); font-weight: 800; }
.timer-card { border: 0; color: var(--ink); gap: 15px; }
.timer-card i { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: #111; border-radius: 50%; font-size: 14px; }
.preach-context { max-width: 860px; margin: 0 auto; padding: 20px clamp(22px, 5vw, 54px) 10px; }
.preach-sermon-title { display: block; margin-bottom: 13px; overflow-wrap: anywhere; color: #f4f1e8; font-size: clamp(17px, 2.2vw, 24px); line-height: 1.2; letter-spacing: -.02em; }
.topic-strip { padding: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; color: #8b8b92; font-size: 13px; }
.topic-strip label { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topic-strip select { max-width: 440px; min-width: 0; background: #181818; color: #efefef; height: 42px; padding: 0 36px 0 13px; border-color: #282828; }
.preach-content { max-width: 860px; margin: 0 auto; padding: 12px clamp(22px, 5vw, 54px) 180px; font-size: var(--preach-size); overflow-x: hidden; }
.preach-block { margin: 0 0 1.25em; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.preach-block.topic { color: var(--accent); font-weight: 900; font-size: 1.28em; line-height: 1.05; letter-spacing: -.035em; text-transform: uppercase; margin-top: .2em; scroll-margin-top: 170px; }
.preach-block.paragraph { color: #ededed; }
.preach-block.scripture { padding: .95em 1em; border-left: .14em solid var(--accent); background: #12110b; color: #f0e8ce; border-radius: 0 18px 18px 0; font-family: Georgia, serif; }
.preach-block.quote { color: var(--accent); border-left: .12em solid var(--accent); padding: .8em 1em; font-family: Georgia, serif; font-style: italic; background: #0f0e07; }
.preach-block.note { color: #98b7d6; background: #101722; padding: .75em 1em; border-radius: 14px; font-size: .72em; }
.preach-block.list { padding-left: 1.2em; }
.preach-block.list li { padding-left: .25em; margin-bottom: .48em; }
.preach-block.list li::marker { color: var(--accent); }
.next-topic { position: fixed; right: clamp(14px, 3vw, 32px); bottom: calc(86px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--accent); color: #111; font-size: 32px; z-index: 25; box-shadow: 0 8px 30px #0009; transition: opacity .2s; }
.verse-tray { position: fixed; left: 50%; bottom: 0; z-index: 26; width: min(880px, 100%); transform: translateX(-50%); border: 1px solid #3d3827; border-bottom: 0; border-radius: 20px 20px 0 0; background: #15140f; box-shadow: 0 -10px 38px #000b; }
.verse-tray > button { width: 100%; min-height: 70px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 9px 20px calc(9px + env(safe-area-inset-bottom)); border: 0; background: transparent; color: var(--ink); text-align: left; }
.verse-tray > button span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.verse-tray > button .verse-summary { min-width: 0; color: inherit; letter-spacing: 0; text-transform: none; }
.verse-summary strong, .verse-summary small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.verse-summary strong { color: #f5f1e3; font-size: 13px; }
.verse-summary small { margin-top: 3px; color: #9f9b8e; font: 12px/1.25 Georgia, serif; }
.verse-tray > button i { color: var(--muted); font-style: normal; transition: transform .2s; }
.verse-tray-body { display: none; max-height: 42vh; overflow: auto; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); }
.verse-tray.open .verse-tray-body { display: block; }
.verse-chips { display: flex; gap: 8px; overflow-x: auto; padding: 3px 0 14px; scrollbar-width: none; }
.verse-chips button { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid #494434; border-radius: 99px; background: #211f17; color: #b8b3a4; font-size: 11px; font-weight: 800; }
.verse-chips button.active { border-color: var(--accent); color: var(--accent); background: #2b250f; }
.verse-text { color: #f0e8ce; white-space: pre-wrap; font: 19px/1.58 Georgia, serif; }
.verse-tray.open > button i { transform: rotate(180deg); }
.verse-tray.open + .next-topic { opacity: 0; pointer-events: none; }
.preach-view.high-contrast { --preach-bg: #000; }
.preach-view.high-contrast .preach-block.paragraph { color: #fff; }

dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px #000c; }
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 30px; }
.dialog-card h2 { font-size: 29px; margin: 0 0 9px; }
.dialog-card > p:not(.eyebrow), .dialog-card small { color: var(--muted); line-height: 1.5; }
.dialog-close { position: absolute; right: 14px; top: 14px; background: transparent; border: 0; color: var(--muted); font-size: 28px; }
.dialog-actions { display: flex; gap: 10px; margin: 24px 0 14px; }
.font-control { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 10px; margin: 8px 0 20px; }
.font-control button { height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink); font-weight: 850; }
.font-control input { width: 100%; }
.admin-dialog { width: min(720px, calc(100% - 28px)); }
.admin-create-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.admin-create-form label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.admin-create-form input { display: block; width: 100%; height: 44px; margin-top: 6px; padding: 0 12px; text-transform: none; }
.admin-create-form button { align-self: end; }
.admin-user-list { display: grid; gap: 9px; }
.admin-user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.admin-user-row strong, .admin-user-row small { display: block; }
.admin-user-row small { margin-top: 3px; color: var(--muted); }
.admin-user-row div:last-child { display: flex; gap: 7px; }
.admin-user-row button { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-size: 11px; font-weight: 800; }
.file-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.file-button input { display: none; }
.range-label, .toggle-label { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0; color: var(--muted); }
.range-label { flex-wrap: wrap; }
.range-label input { width: 100%; accent-color: var(--accent); }
.toggle-label input { width: 22px; height: 22px; accent-color: var(--accent); }
.full { width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 12px 18px; color: var(--ink); background: #282822; border: 1px solid #45453c; border-radius: 99px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@media (max-width: 820px) {
  .sermon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .outline-panel { display: none; }
  .hero { display: block; }
  .hero .primary { margin-top: 18px; }
  #libraryView, #editorView, .module-hub, .module-page { padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 80; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 67px; padding: 7px; border: 1px solid #3c3b35; border-radius: 20px; background: color-mix(in srgb, #171714 94%, transparent); box-shadow: 0 12px 36px #000b; backdrop-filter: blur(18px); }
  .mobile-nav button { min-width: 0; display: grid; place-items: center; gap: 3px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; }
  .mobile-nav button span { color: var(--ink); font-size: 19px; line-height: 1; }
  .mobile-nav button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
  .app-shell:has(#preachView.active) .mobile-nav { display: none; }
  .editor-topbar { position: sticky; top: calc(76px + env(safe-area-inset-top)); z-index: 15; margin: -12px -8px 20px; padding: 10px 8px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); }
  .block-buttons { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .block-buttons button { flex: 0 0 auto; }
  .verse-tray { width: min(880px, 100%); }
}
@media (max-width: 560px) {
  .app-header { height: calc(66px + env(safe-area-inset-top)); align-items: end; padding-bottom: 10px; }
  .brand small, .save-state { display: none; }
  .account-name { display: none; }
  .connection-state { max-width: 126px; line-height: 1.15; }
  #libraryView, #editorView, .module-hub, .module-page { padding: 28px 16px 70px; }
  .module-grid { grid-template-columns: 1fr; margin-top: 30px; }
  .module-card { min-height: 128px; padding: 19px; }
  .module-icon { width: 50px; height: 50px; border-radius: 15px; font-size: 24px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid article:last-child { grid-column: 1 / -1; }
  h1 { font-size: 43px; }
  .hero > .primary { width: 100%; }
  .library-toolbar { margin-top: 36px; flex-direction: column; }
  .offline-banner { align-items: flex-start; }
  .sermon-grid { grid-template-columns: 1fr; }
  .sermon-card { min-height: 220px; }
  .editor-topbar { align-items: flex-start; }
  .editor-actions .secondary { display: none; }
  .meta-grid { grid-template-columns: 1fr; }
  .duration-presets > span { width: 100%; }
  .planner-heading { align-items: flex-start; }
  .planner-metrics { grid-template-columns: 1fr 1fr; }
  .planner-metrics div:last-child { grid-column: 1 / -1; }
  .message-meta .title-input { font-size: 36px; }
  .duration-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
  .duration-presets > span { position: sticky; left: 0; z-index: 1; flex: 0 0 auto; width: auto; padding-right: 8px; background: var(--bg); }
  .duration-presets button { flex: 0 0 auto; }
  .editor-block { border-radius: 14px; }
  .block-head { gap: 3px; }
  .block-head button { width: 36px; height: 36px; }
  .editor-block textarea { font-size: 16px; }
  .preach-header { grid-template-columns: 45px 1fr 1fr 45px; gap: 7px; }
  .preach-icon { width: 45px; height: 48px; }
  .clock-card, .timer-card { height: 48px; font-size: 18px; border-radius: 15px; }
  .timer-card { gap: 8px; }
  .timer-card i { width: 28px; height: 28px; }
  .topic-strip { grid-template-columns: 1fr; gap: 8px; }
  .topic-strip label { margin-left: 0; width: 100%; }
  .topic-strip select { flex: 1; }
  .preach-content { padding-left: 20px; padding-right: 20px; }
  .dialog-actions { flex-direction: column; }
  .admin-create-form { grid-template-columns: 1fr; }
  .admin-user-row { grid-template-columns: 1fr; }
  .preach-context { padding: 16px 20px 8px; }
  .preach-sermon-title { font-size: 18px; }
  .verse-tray { width: 100%; border-radius: 16px 16px 0 0; }
  .verse-tray > button { min-height: 68px; padding-left: 15px; padding-right: 15px; gap: 10px; }
  .verse-tray-body { padding-left: 16px; padding-right: 16px; }
  .next-topic { width: 56px; height: 56px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
