/* Design tokens — BUILD_SPEC §4.2. Fonts are self-hosted in /static/fonts (added with the dashboard). */
:root {
  --parchment: #F5F1E8;
  --paper: #FFFDF8;
  --ink: #1D2528;
  --lapis: #18334F;
  --lapis-deep: #10273D;
  --gold: #B28A3B;
  --gold-soft: #D4B363;
  --rule: #D8D0C2;
  --shadow: 0 14px 34px rgba(16, 39, 61, .08);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(212, 179, 99, .13), transparent 28rem),
    linear-gradient(180deg, #faf8f2 0, var(--parchment) 28rem);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
}
.topbar, .content, .footer { width: 1280px; max-width: 100%; margin: 0 auto; padding: 0 16px; }
.topbar { display: flex; align-items: center; gap: 24px; min-height: 68px; border-bottom: 1px solid var(--rule); }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--lapis); text-decoration: none; flex: 0 0 auto; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 46% 54%;
  background: var(--lapis);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(178, 138, 59, .35), 0 5px 14px rgba(16, 39, 61, .16);
}
.brand { display: block; font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: .9; color: var(--lapis); }
.brand-tagline { display: block; margin-top: 4px; color: #6b6256; font-size: 10px; letter-spacing: .055em; text-transform: uppercase; }
.content { padding-top: 32px; padding-bottom: 32px; }
.footer { border-top: 1px solid var(--rule); font-size: 12px; color: #5c5548; padding-top: 12px; padding-bottom: 24px; }
h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 44px); line-height: 1; font-weight: 600; margin: 0 0 10px; color: var(--lapis-deep); }
.muted { color: #5c5548; }
.card { background: rgba(255, 253, 248, .96); border: 1px solid var(--rule); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.login { max-width: 520px; margin: 56px auto; padding: clamp(24px, 6vw, 42px); border-top: 3px solid var(--gold); }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-intro { max-width: 42ch; margin: 14px 0; color: #3e4648; font-size: 17px; line-height: 1.5; }
.authority-line { margin: 18px 0; padding: 12px 0 12px 15px; border-left: 2px solid var(--gold); color: var(--lapis); font-family: var(--font-display); font-size: 19px; line-height: 1.25; }
label { display: block; margin: 12px 0 4px; font-size: 14px; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(178, 138, 59, .22); border-color: var(--gold); }
button { margin-top: 16px; min-height: 44px; padding: 10px 18px; background: var(--lapis); color: #fff; border: 0; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:hover { background: var(--lapis-deep); box-shadow: 0 5px 14px rgba(16, 39, 61, .16); transform: translateY(-1px); }
button:active { transform: translateY(0); }

/* ---- Phase 2: accounts (login, MFA, invite, profile, admin users) ---- */
.login.wide { max-width: 560px; }
.profile { max-width: 720px; margin: 0 auto; }
.error { color: #8b1a1a; background: #fbeaea; border: 1px solid #e5b9b9; border-radius: 4px; padding: 8px 12px; font-size: 14px; }
.ok { color: #1f5e2e; background: #e9f5ec; border: 1px solid #b9dcc2; border-radius: 4px; padding: 8px 12px; font-size: 14px; }
.small { font-size: 12px; }
select, textarea { width: 100%; padding: 10px; border: 1px solid var(--rule); border-radius: 6px; font: inherit; background: var(--paper); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > label { flex: 1 1 240px; }
.codes { columns: 2; padding-left: 20px; font-size: 16px; }
.secret code { font-size: 20px; letter-spacing: 2px; }
code.wrap { word-break: break-all; }
a.button { display: inline-block; margin-top: 16px; padding: 10px 18px; background: var(--lapis); color: #fff; border-radius: 6px; text-decoration: none; }
form.inline { display: inline; }
button.link { background: none; color: var(--lapis); padding: 8px 0; margin: 8px 0 0; text-decoration: underline; min-height: 44px; }
button.link:hover { background: none; color: #17307a; }
button.small { padding: 6px 10px; font-size: 13px; margin: 0 4px 0 0; }
button.danger { background: #8b1a1a; }
button.danger:hover { background: #6e1414; }
.topbar a { color: var(--lapis); text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar button.link { margin: 0; }
.admin-users table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-users th, .admin-users td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.admin-users tr.disabled td { color: #8a8272; }
.admin-users h2 { font-family: var(--font-display); font-size: 20px; margin: 24px 0 8px; }
.admin-users .row > label { flex: 1 1 200px; }
.admin-users .row > button { align-self: flex-end; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 14px; }
@media (max-width: 480px) { .codes { columns: 1; } .admin-users th:nth-child(3), .admin-users td:nth-child(3) { display: none; } }

/* Phase 2 — mobile fit and 44px tap targets */
input, select, textarea, button, a.button { min-height: 44px; box-sizing: border-box; }
button.small { min-height: 44px; }
.secret code, code.wrap { display: block; overflow-wrap: anywhere; word-break: break-all; white-space: normal; }
.codes { columns: 1; }
@media (min-width: 480px) { .codes { columns: 2; } }

/* ===== Phase 1: Ancient Words + /about/sources — start ===== */
.ancient-words h2 { font-family: var(--font-display); margin: 0 0 4px; }
.aw-hint { margin: 0 0 12px; font-size: 14px; }
.aw-hint code { background: var(--parchment); padding: 1px 4px; border-radius: 3px; }
.aw-label { font-size: 14px; margin: 0 0 4px; }
.aw-row { display: flex; gap: 8px; }
.aw-row input { flex: 1; min-width: 0; min-height: 44px; }
.aw-row button { margin-top: 0; min-height: 44px; }
.aw-status { min-height: 20px; margin: 8px 0; font-size: 14px; }
.aw-results { list-style: none; margin: 0; padding: 0; }
.aw-result-btn { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; width: 100%; min-height: 44px; margin: 0 0 6px; padding: 10px 12px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; }
.aw-result-btn:hover, .aw-result-btn:focus { background: var(--parchment); border-color: var(--gold); }
.aw-result-btn .aw-brief { grid-column: 1 / -1; font-size: 13px; color: #5c5548; }
.aw-lemma { font-family: var(--font-display); font-size: 20px; color: var(--lapis); }
.aw-xlit { font-style: italic; }
.aw-id { font-size: 12px; color: #5c5548; letter-spacing: 0.04em; }
.aw-entry { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.aw-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.aw-entry-head h3 { margin: 0; font-size: 28px; }
.aw-fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; font-size: 15px; }
.aw-fields dt { color: #5c5548; }
.aw-fields dd { margin: 0; }
.aw-entry h4 { margin: 16px 0 6px; font-family: var(--font-display); }
.aw-verses, .aw-related { margin: 0; padding-left: 18px; }
.aw-verses li { margin-bottom: 6px; line-height: 1.45; }
.aw-related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.aw-link { margin: 0; min-height: 44px; padding: 8px 12px; background: #fff; color: var(--lapis); border: 1px solid var(--rule); border-radius: 4px; }
.aw-link:hover { background: var(--parchment); border-color: var(--gold); }
.aw-ask { min-height: 44px; }
.aw-esv-btn { display: block; margin-top: 4px; font-size: 14px; }
.aw-esv { margin: 6px 0 0; padding-left: 10px; border-left: 2px solid var(--gold); }
.aw-notice { font-style: italic; color: #5c5548; }
.esv-notice { font-style: italic; }
.sources h2 { font-family: var(--font-display); margin: 24px 0 8px; }
.sources dt { font-weight: 600; margin-top: 12px; }
.sources dd { margin: 4px 0 0; line-height: 1.5; }
.sources .notice { font-style: italic; }
.sources a { display: inline-block; padding: 12px 2px; margin: -12px -2px; color: var(--lapis); }
@media (max-width: 600px) {
  .aw-fields { grid-template-columns: 1fr; gap: 2px; }
  .aw-fields dd { margin-bottom: 8px; }
  .aw-result-btn { grid-template-columns: 1fr; }
}
/* ===== Phase 1: Ancient Words + /about/sources — end ===== */

/* ---- Phase 4: admin (start) ---- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 24px; }
.admin-card { min-width: 0; }
.admin-card h2 { font-family: var(--font-display); margin: 0 0 12px; font-size: 22px; }
.admin-banner { background: #a12626; color: #fff; padding: 14px 18px; border-radius: 6px; margin-bottom: 16px; }
.admin-flash { background: #eef2ff; border: 1px solid var(--rule); padding: 10px 14px; border-radius: 4px; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table td { overflow-wrap: break-word; }
.admin-table .nowrap { white-space: nowrap; }
.admin-table .msg { min-width: 14em; }
.admin-table th, .admin-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
.admin-kv dt { color: #5c5548; } .admin-kv dd { margin: 0; }
.admin-list { padding-left: 18px; font-size: 14px; }
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-actions button { min-height: 44px; }
button.secondary { background: #fff; color: var(--lapis); border: 1px solid var(--lapis); }
.sev-critical { color: #a12626; } .sev-warning { color: #8a5a00; }
textarea { width: 100%; padding: 10px; border: 1px solid var(--rule); border-radius: 4px; font: inherit; }
@media (max-width: 480px) { .admin-grid { grid-template-columns: 1fr; } .admin-card { padding: 16px; } }
/* ---- Phase 4: admin (end) ---- */

/* ===== Phase 3 — fonts (self-hosted, OFL) and dashboard ===== */
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramond.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramond-Italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/SourceSans3.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/SourceSans3-Italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

.topnav { display: flex; align-items: center; gap: 16px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.who { font-size: 14px; }
.dot { color: var(--gold); font-size: 10px; vertical-align: middle; animation: quiet-pulse 3s ease-in-out infinite; }
.menu summary { cursor: pointer; list-style: none; font-size: 14px; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.menu { position: relative; }
.menu-body { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; min-width: 200px; font-size: 14px; z-index: 5; box-shadow: var(--shadow); }
.menu-body a { display: flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.account-menu summary { display: flex; align-items: center; min-height: 44px; }
.account-menu .menu-body { top: 100%; left: auto; right: 0; min-width: 160px; }
.account-menu a, .account-menu button { display: flex; align-items: center; min-height: 44px; }
.account-menu form { margin: 0; }
.link-btn { margin: 0; padding: 6px 8px; background: none; color: var(--lapis); border: 0; font: inherit; font-size: 16px; cursor: pointer; text-decoration: none; min-height: 44px; }
.link-btn:hover { background: none; text-decoration: underline; }

.workspace-page { background: #f3f2ed; }
.workspace-page .topbar { width: 100%; padding: 12px max(24px, calc((100vw - 1320px) / 2)); background: var(--lapis-deep); border: 0; gap: 28px; }
.workspace-page .topbar .brand, .workspace-page .topbar > nav, .workspace-page .topbar .link-btn, .workspace-page .account-menu > summary { color: var(--paper); }
.workspace-page .brand-tagline { color: #c4c9cc; }
.workspace-page .brand-mark { background: #294158; box-shadow: none; border: 1px solid #73818b; }
.workspace-page .topbar .menu-body { color: var(--ink); }
.workspace-page .topbar .chat-launch { border: 1px solid #7c8b98; padding: 8px 16px; border-radius: 6px; }
.workspace-page .content, .workspace-page .footer { width: 1368px; padding-left: 24px; padding-right: 24px; }
#dashboard { animation: content-arrival .4s ease-out; }
.workspace-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; padding: 4px 0 8px; }
.workspace-intro h1 { font-size: clamp(32px, 4vw, 42px); margin-bottom: 10px; }
.workspace-intro p:last-child { margin: 0; color: #626861; font-size: 16px; }
.workspace-intro .eyebrow { color: #756034; font-size: 11px; }
.workspace-jumps { display: flex; gap: 8px; flex: 0 0 auto; }
.workspace-jumps a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 6px; color: var(--lapis); text-decoration: none; font-size: 14px; background: #faf9f5; }
.workspace-jumps a:hover { border-color: var(--lapis); background: #fff; }
.workspace-jumps span { font-size: 11px; color: #80724f; }
#dashboard h2 { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin: 0; color: var(--lapis); }
.workbench { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 28px; align-items: start; }
.preparation { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--paper); border: 1px solid #dedfd8; border-radius: 12px; padding: 24px; min-width: 0; }
.section-heading { display: flex; align-items: center; gap: 10px; }
.section-number { font: 12px var(--font-ui); color: #7d704f; }
.section-description { color: #646960; font-size: 14px; line-height: 1.5; margin: 8px 0 18px; }
#prepare, #workspace, #study { scroll-margin-top: 20px; }
.note { width: 100%; min-height: 230px; padding: 14px; border: 1px solid #d9dcd4; background: #fff; border-radius: 6px; font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; margin-top: 2px; font-size: 13px; }
.save-row .link-btn { padding-left: 6px; padding-right: 6px; }
.save-status { color: #5c5548; font-size: 13px; }
.save-status.unsaved { background: #f6e7a1; color: #5a4a00; padding: 2px 8px; border-radius: 10px; }
.assistant-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 10px; font-size: 12px; color: #646960; }
.assistant-caption span:first-child { color: var(--lapis); font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions [data-call="structure"] { grid-column: 1 / -1; }
.pr-btn { margin: 0; min-height: 48px; padding: 10px; background: var(--lapis); font-size: 16px; }
.pr-btn.secondary { background: transparent; color: var(--lapis); border: 1px solid #b8c1c7; font-weight: 500; }
.pr-btn.small { min-height: 44px; padding: 8px 14px; }
.pr-btn:disabled { opacity: .6; cursor: wait; }
#call-status { margin: 12px 0 0; font-size: 14px; line-height: 1.5; }
#call-status:empty { display: none; }
.banner { background: #fbf3d6; border: 1px solid var(--gold); padding: 10px 14px; border-radius: 4px; }
.import-notes { margin-top: 12px; padding: 4px 0; border-top: 1px solid #e5e5de; border-bottom: 1px solid #e5e5de; }
.import-notes summary { cursor: pointer; min-height: 44px; align-content: center; color: var(--lapis); font-size: 14px; }
.import-notes .dropzone { margin-top: 8px; }
.translation-label { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: #5c5548; white-space: nowrap; }
.translation-label select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; font: inherit; font-size: 16px; background: #fff; }
.outline { margin-top: 12px; }
.outline > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 15px; color: var(--lapis); }
.ws-empty { margin: 8px 0 16px; font-size: 15px; line-height: 1.5; }
.dropzone { border: 2px dashed var(--rule); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; text-align: center; background: rgba(16, 39, 61, .025); }
.dropzone.over { border-color: var(--lapis); background: rgba(16, 39, 61, .07); }
.dropzone.busy { opacity: .7; cursor: wait; }
.dropzone > p { margin: 0 0 8px; color: #5c5548; font-size: 15px; }
.dz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dz-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; margin: 0; border: 1px solid #b8c1c7; border-radius: 6px; color: var(--lapis); background: #fff; cursor: pointer; }
.dz-btn:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
#dz-status { margin: 8px 0 0; min-height: 1em; }

.study-panel { background: #e9ede8; border-color: #d7dfd5; }
.study-panel .eyebrow { color: #5b705d; font-size: 11px; }
.study-panel .aw-hint { margin-top: 10px; line-height: 1.5; }
.study-panel .aw-row { flex-wrap: wrap; }
.study-panel .aw-row input { flex-basis: 170px; background: #fff; }
.study-panel .aw-row button { flex-grow: 1; }
.aw-entry { overflow-wrap: anywhere; }
.aw-fields { grid-template-columns: 1fr; gap: 3px; }
.aw-fields dd { margin-bottom: 6px; }
.writing-panel { padding: 0 36px 24px; border-top: 3px solid var(--gold); box-shadow: 0 8px 30px rgba(29, 37, 40, .04); }
.ws-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 0; border-bottom: 1px solid #e7e6df; }
.ws-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.export-menu { color: var(--lapis); }
.export-menu .menu-body { left: auto; right: 0; }
.draft-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; }
.draft-status > span:first-child { color: #74776e; font-size: 10px; letter-spacing: .12em; }
.cards { display: grid; gap: 12px; margin-bottom: 16px; }
.cards:empty { display: none; }
.sug-card { border: 1px solid var(--gold); border-left-width: 4px; border-radius: 6px; padding: 14px 16px; background: #fffdf7; }
.sug-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sug-title { font-family: var(--font-display); font-size: 20px; margin: 0; }
.sug-body p, .sug-body h4 { margin: 6px 0; }
.sug-body textarea { width: 100%; font: inherit; margin: 4px 0; }
.sug-body .hidden-field { display: none; }
.sug-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.scripture { font-family: var(--font-display); font-size: 18px; }
.scripture.kjv { font-style: italic; }

.sermon-form label { font-size: 14px; color: #5e665d; margin-top: 18px; }
.sermon-form textarea, .sermon-form input { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 1px solid #dedfd8; background: #fffefa; border-radius: 6px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink); }
.sermon-form .draft-title { margin: 0 0 20px; }
.sermon-form .draft-title textarea { resize: none; overflow-wrap: anywhere; font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3vw, 38px); border: 0; border-radius: 0; padding: 4px 0 12px; background: transparent; color: var(--lapis-deep); }
.draft-title textarea::placeholder { color: #858778; opacity: 1; }
.sermon-form .big-idea { margin-bottom: 28px; }
.big-idea textarea { border-left: 3px solid var(--gold); background: #f8f5ec; }
.draft-section { border-top: 1px solid #e1e2d9; }
.draft-section > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; cursor: pointer; color: var(--lapis); font-size: 18px; font-family: var(--font-display); font-weight: 600; list-style: none; }
.draft-section > summary::-webkit-details-marker { display: none; }
.draft-section > summary::after { content: "+"; margin-left: auto; font: 22px var(--font-ui); color: #69746b; }
.draft-section[open] > summary::after { content: "−"; }
.draft-section .section-number { width: 20px; flex-shrink: 0; }
.section-hint { margin-left: auto; color: #72796e; font: 12px var(--font-ui); }
.draft-section > summary:has(.section-hint)::after { margin-left: 12px; }
.draft-section-body { padding-bottom: 20px; }
.draft-section-body > label:first-child { margin-top: 0; }
.sermon-form fieldset { min-width: 0; border: 1px solid #dedfd8; border-radius: 6px; margin: 12px 0 16px; padding: 8px 16px 16px; background: #fafaf5; }
.sermon-form legend { font-family: var(--font-display); font-size: 20px; padding: 0 6px; color: var(--lapis); }
.points-empty { color: #72796e; line-height: 1.6; font-size: 15px; margin: 0 0 8px; max-width: 48ch; }
#points:not(:empty) + .points-empty { display: none; }
#add-point { padding: 8px 18px; border: 1px solid #b8c1c7; border-radius: 6px; }
.sermon-form .duration { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid #e1e2d9; padding-top: 18px; margin-top: 0; }
.sermon-form .duration input { width: 76px; margin: 0; }
.duration > span { color: #72796e; }
.draft-footnote { margin: 24px 0 0; text-align: center; color: #74776e; font-size: 12px; }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.drawer { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: 420px; max-width: 100%; background: #fff; border-left: 1px solid var(--rule); box-shadow: -8px 0 24px rgba(30,27,22,.08); padding: 16px 20px; z-index: 10; display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.msg { padding: 10px 12px; border-radius: 6px; max-width: 92%; white-space: pre-wrap; line-height: 1.45; }
.msg.me { align-self: flex-end; background: #eef1fa; }
.msg.ray { align-self: flex-start; background: var(--parchment); }
.chat-form textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--rule); border-radius: 4px; }
.chat-form button { margin-top: 8px; min-height: 44px; }
.version-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; }
.version { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.version p { margin: 4px 0; font-size: 14px; }
.small { font-size: 12px; }

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; gap: 24px; }
  .preparation { display: contents; }
  .prepare-panel { order: 1; }
  .writing-panel { order: 2; }
  .study-panel { order: 3; }
  .workspace-intro { align-items: flex-start; flex-direction: column; gap: 18px; }
  .workspace-page .topbar { padding: 12px 24px; gap: 8px 16px; }
  .topbar { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px 16px; }
  .brand-tagline { display: none; }
  .topnav { order: 3; width: 100%; border-top: 1px solid #6d7b87; padding-top: 4px; }
  .drawer { width: 100%; }
  .panel { padding: 24px; }
  .writing-panel { padding-top: 0; }
}

@media (max-width: 520px) {
  .content { padding-top: 22px; }
  .login { margin: 20px auto; }
  .topbar { gap: 8px 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand { font-size: 22px; }
  .topbar-right { gap: 8px; }
  .who { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-page .content, .workspace-page .footer { padding-left: 16px; padding-right: 16px; }
  .workspace-page .topbar { padding: 10px 16px; gap: 8px; }
  .workspace-page .topbar .chat-launch { padding: 6px 8px; font-size: 13px; }
  .workspace-page .account-menu > summary { max-width: 100px; overflow-wrap: anywhere; font-size: 13px; }
  .workspace-page .topbar-right { gap: 6px; }
  .workspace-intro { margin-bottom: 20px; }
  .workspace-intro p:last-child { font-size: 15px; line-height: 1.5; max-width: 30ch; }
  .workspace-jumps { width: 100%; gap: 6px; }
  .workspace-jumps a { flex: 1; justify-content: center; padding: 8px; font-size: 13px; }
  .panel { padding: 20px; }
  .writing-panel { padding-top: 0; }
  .ws-head { align-items: flex-start; }
  .export-menu .menu-body { left: 0; right: auto; }
  .section-hint { display: none; }
  .draft-section > summary { font-size: 18px; gap: 8px; }
  .draft-section > summary:has(.section-hint)::after { margin-left: auto; }
  .draft-status { flex-wrap: wrap; gap: 4px 12px; }
  .drawer-head { flex-wrap: wrap; }
}

@keyframes quiet-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes content-arrival {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  button:hover { transform: none; }
}

/* ---- Report issue modal ---- */
.modal { position: fixed; inset: 0; background: rgba(29, 37, 40, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; z-index: 20; padding: 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { width: 460px; max-width: 100%; min-width: 0; }
.modal-card h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 12px; color: var(--lapis-deep); }
.modal-actions { display: flex; gap: 12px; align-items: center; }
.report-btn { flex: 0 0 auto; }

/* ---- Voice controls ---- */
.chat-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.chat-actions button[type="submit"] { margin-top: 0; }
.mic-btn[aria-pressed="true"] { color: #8b1a1a; text-decoration: none; }

.guide { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: step; }
.guide li { flex: 1; counter-increment: step; padding: 8px 4px; border-top: 4px solid var(--rule); font-size: 13px; line-height: 1.3; color: #646960; text-align: center; }
.guide li::before { content: counter(step); display: block; font-weight: 700; font-size: 16px; }
.guide li.done { border-color: #8fa58f; color: #3d5a3f; }
.guide li.current { border-color: var(--lapis); color: var(--lapis-deep); font-weight: 700; }
.next-step { display: block; width: 100%; min-height: 56px; margin: 18px 0 0; padding: 14px 16px; background: var(--lapis-deep, #1d3557); color: #fff; border: 0; border-radius: 8px; font: inherit; font-size: 18px; font-weight: 600; text-align: left; cursor: pointer; }
.next-step::after { content: " \2192"; }
.plan-worship { display: block; width: 100%; margin-top: 20px; }
.powered { display: block; font-family: inherit; font-size: 12px; font-weight: 400; color: #646960; letter-spacing: .04em; }
.cards.tuck-ideas > [data-kind="topic"] { display: none; }
