/* ==========================================================================
   OutlineNest — design system
   Palette: navy, gold, pearl white, slate
   ========================================================================== */

:root {
  --navy: #0b1b34;
  --navy-2: #122647;
  --navy-3: #1c3a63;
  --navy-ink: #071427;
  --gold: #c19a52;
  --gold-2: #e3c58b;
  --gold-soft: #f4e9d2;
  --pearl: #faf8f3;
  --pearl-2: #f2ece1;
  --pearl-3: #e9e2d4;
  --ink: #17202e;
  --ink-2: #3c4b5e;
  --slate: #55677d;
  --slate-2: #7d8b9c;
  --line: #e2dbcd;
  --line-2: #d3cab8;
  --bg: var(--pearl);
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --danger: #a33224;
  --danger-soft: #fbeae7;
  --ok: #2f6b4f;
  --ok-soft: #e8f3ec;
  --warn: #8a6412;
  --warn-soft: #fbf1da;
  --shadow-sm: 0 1px 2px rgba(11, 27, 52, .06), 0 1px 1px rgba(11, 27, 52, .04);
  --shadow-md: 0 8px 24px -12px rgba(11, 27, 52, .28), 0 2px 6px rgba(11, 27, 52, .06);
  --shadow-lg: 0 30px 70px -30px rgba(11, 27, 52, .5), 0 8px 24px -12px rgba(11, 27, 52, .2);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --ui-font: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reading-font: Georgia, "Times New Roman", serif;
  --reading-size: 17px;
  --reading-line: 1.7;
  --sidebar-w: 272px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  --navy: #0a1526;
  --navy-2: #11203a;
  --navy-3: #1b3155;
  --pearl: #0d1521;
  --pearl-2: #121c2b;
  --pearl-3: #1a2638;
  --ink: #e9eef7;
  --ink-2: #c3cedd;
  --slate: #9daeC4;
  --slate-2: #8494a9;
  --line: #22314a;
  --line-2: #2c3f5e;
  --bg: #0b1420;
  --surface: #111c2c;
  --surface-2: #152235;
  --gold-soft: #2c2618;
  --danger: #f08a7c;
  --danger-soft: #33201e;
  --ok: #7fd0a3;
  --ok-soft: #16291f;
  --warn: #e6c179;
  --warn-soft: #2c2417;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 10px 30px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(193, 154, 82, .28); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, .btn, .chip, .navitem, .iconbtn, .avatar, .secnav, .menu button, .tabsline button { touch-action: manipulation; -webkit-tap-highlight-color: rgba(193, 154, 82, .18); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 20% 0%, #16305a 0%, var(--navy) 55%, var(--navy-ink) 100%);
  color: #f6f2e8; z-index: 300;
}
.boot__inner { text-align: center; }
.boot__name { margin: 14px 0 4px; font-family: var(--reading-font); font-size: 30px; letter-spacing: .04em; }
.boot__slogan { margin: 0; color: var(--gold-2); font-size: 12px; letter-spacing: .34em; text-transform: uppercase; }
.boot__bar { width: 132px; height: 2px; margin: 28px auto 0; background: rgba(255, 255, 255, .14); overflow: hidden; border-radius: 2px; }
.boot__bar i { display: block; width: 40%; height: 100%; background: var(--gold-2); animation: bootslide 1.15s var(--ease) infinite; }
@keyframes bootslide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.boot__fallback { margin: 26px auto 4px; max-width: 32ch; font-size: 14px; line-height: 1.6; color: #f6f2e8; }
.boot__detail { max-width: 40ch; margin: 10px auto 0; font-size: 11px; line-height: 1.5; color: rgba(246, 242, 232, .55); white-space: pre-wrap; word-break: break-word; }
.boot__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.boot__actions button { min-height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .08); color: #f8f4ea; font: 600 13px/1 var(--ui-font); }
.boot__actions button.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a2008; border-color: transparent; }
.boot__hint { max-width: 34ch; margin: 16px auto 0; font-size: 11.5px; line-height: 1.65; color: rgba(246, 242, 232, .55); }

/* ---------- brand mark ---------- */
.brandmark { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; }
.brandmark__ring {
  position: absolute; border-radius: 50%; border: 1.6px solid var(--gold-2);
  inset: 6px; opacity: .9;
}
.brandmark__ring:nth-child(2) { inset: 13px; border-color: rgba(227, 197, 139, .6); }
.brandmark__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 4px rgba(227, 197, 139, .16); }
.brandmark--lg { width: 76px; height: 76px; }
.brandmark--lg .brandmark__ring { inset: 4px; border-width: 2px; }
.brandmark--lg .brandmark__ring:nth-child(2) { inset: 17px; }
.brandmark--lg .brandmark__dot { width: 9px; height: 9px; }

/* ---------- generic controls ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-size: 14px; font-weight: 600; letter-spacing: .005em; text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s, border-color .18s, opacity .18s;
  white-space: nowrap; user-select: none;
}
.btn:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn--primary { --btn-bg: linear-gradient(180deg, var(--navy-2), var(--navy)); --btn-fg: #f8f4ea; --btn-bd: transparent; box-shadow: 0 10px 24px -14px rgba(11, 27, 52, .85); }
.btn--gold { --btn-bg: linear-gradient(180deg, var(--gold-2), var(--gold)); --btn-fg: #2a2008; --btn-bd: transparent; box-shadow: 0 10px 24px -14px rgba(193, 154, 82, .9); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--slate); }
.btn--ghost:hover { --btn-bg: rgba(85, 103, 125, .08); }
.btn--outline { --btn-bg: transparent; }
.btn--danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { min-height: 38px; width: 38px; padding: 0; border-radius: 11px; }

.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--slate);
  transition: background .16s, color .16s, border-color .16s;
}
.iconbtn:hover { background: rgba(85, 103, 125, .1); color: var(--ink); }
.iconbtn--active { background: rgba(193, 154, 82, .16); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--slate); letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--slate-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(193, 154, 82, .18); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); background-position: calc(100% - 19px) 19px, calc(100% - 14px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input::placeholder, .textarea::placeholder { color: var(--slate-2); }
.hint { font-size: 12px; color: var(--slate-2); line-height: 1.5; }
.err { font-size: 13px; color: var(--danger); display: flex; gap: 7px; align-items: flex-start; }
.err:empty { display: none; }

.searchbox { position: relative; display: flex; align-items: center; flex: 1; max-width: 460px; }
.searchbox svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--slate-2); pointer-events: none; }
.searchbox input { width: 100%; height: 40px; padding: 0 14px 0 39px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.searchbox input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(193, 154, 82, .15); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--slate); font-size: 12.5px; font-weight: 600;
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip--on { background: var(--navy); color: #f6f1e6; border-color: var(--navy); }
.chip--gold { background: rgba(193, 154, 82, .14); border-color: rgba(193, 154, 82, .4); color: var(--gold); }
[data-theme="dark"] .chip--gold { color: var(--gold-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--pearl-3); color: var(--slate); }
.badge--gold { background: rgba(193, 154, 82, .16); color: #8a6412; }
[data-theme="dark"] .badge--gold { color: var(--gold-2); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .18s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.switch input:checked + .switch__track { background: var(--navy-3); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: var(--gold-2); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth__hero {
  position: relative; overflow: hidden; padding: clamp(32px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background: radial-gradient(120% 90% at 10% 0%, #1a3a66 0%, var(--navy) 48%, var(--navy-ink) 100%);
  color: #f6f2e8;
}
.auth__hero::after {
  content: ""; position: absolute; inset: auto -20% -45% 30%; height: 75%;
  background: radial-gradient(closest-side, rgba(193, 154, 82, .22), transparent 70%);
  pointer-events: none;
}
.auth__hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 72px 72px; -webkit-mask-image: radial-gradient(80% 70% at 30% 20%, #000, transparent 90%);
  pointer-events: none;
}
.auth__brand { position: relative; display: flex; align-items: center; gap: 14px; }
.auth__brandname { font-family: var(--reading-font); font-size: 25px; letter-spacing: .02em; }
.auth__kicker { display: block; font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold-2); margin-top: 2px; }
.auth__headline { position: relative; font-family: var(--reading-font); font-weight: 400; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.08; letter-spacing: -.015em; margin: 0; max-width: 15ch; }
.auth__headline em { font-style: italic; color: var(--gold-2); }
.auth__lead { position: relative; margin: 18px 0 0; max-width: 42ch; color: rgba(246, 242, 232, .74); font-size: 15px; line-height: 1.65; }
.auth__points { position: relative; list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 14px; max-width: 44ch; }
.auth__points li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(246, 242, 232, .82); }
.auth__points svg { width: 18px; height: 18px; color: var(--gold-2); flex: none; margin-top: 1px; }
.auth__foot { position: relative; font-size: 11.5px; color: rgba(246, 242, 232, .48); line-height: 1.6; max-width: 46ch; }
.auth__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: clamp(24px, 4vw, 56px); background: var(--bg); }
.auth__card { width: 100%; max-width: 416px; }
.auth__mobilebrand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth__title { font-family: var(--reading-font); font-size: 30px; margin: 0 0 6px; }
.auth__sub { margin: 0 0 26px; color: var(--slate); font-size: 14px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--pearl-2); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 22px; }
.tabs button { height: 38px; border: 0; background: transparent; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--slate); transition: all .16s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.authform { display: grid; gap: 16px; }
.authform__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy-3); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .linkbtn { color: var(--gold-2); }
.authmeta { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--slate-2); line-height: 1.6; }
.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i { height: 3px; flex: 1; background: var(--line-2); border-radius: 2px; transition: background .2s; }
.strength[data-score="1"] i:nth-child(1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-score="3"] i:nth-child(-n+3) { background: #6f8f3a; }
.strength[data-score="4"] i { background: var(--ok); }

/* ---------- app shell ---------- */
.app-root { min-height: 100vh; min-height: 100dvh; }
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-2), var(--navy) 55%, var(--navy-ink));
  color: rgba(246, 242, 232, .9); padding: 18px 14px 14px; z-index: 40;
}
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0e1b2e, #0a1320); border-right: 1px solid var(--line); }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.sidebar__name { font-family: var(--reading-font); font-size: 19px; letter-spacing: .02em; color: #f8f4ea; line-height: 1.1; }
.sidebar__slogan { display: block; font-size: 8.6px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); margin-top: 3px; }
.sidebar__welcome { margin: 0 8px 16px; padding: 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.sidebar__welcome strong { display: block; font-family: var(--reading-font); font-size: 14.5px; font-weight: 500; color: #f8f4ea; }
.sidebar__welcome span { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.5; color: rgba(246, 242, 232, .62); }
.sidebar__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 12px; scrollbar-width: thin; }
.sidebar__section { margin-top: 18px; }
.sidebar__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 7px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(246, 242, 232, .45); }
.sidebar__label button { background: none; border: 0; color: rgba(246, 242, 232, .55); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; }
.sidebar__label button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.navitem {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px;
  background: transparent; border: 0; color: rgba(246, 242, 232, .78); font-size: 13.5px; text-align: left;
  transition: background .15s, color .15s;
}
.navitem:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.navitem--on { background: rgba(227, 197, 139, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(227, 197, 139, .22); }
.navitem svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.navitem__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem__count { font-size: 11px; color: rgba(246, 242, 232, .45); font-variant-numeric: tabular-nums; }
.navitem--on .navitem__count { color: var(--gold-2); }
.navdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.navrow { display: flex; align-items: center; gap: 2px; }
.navrow > .navitem { flex: 1; min-width: 0; }
.navitem__menu {
  width: 26px; height: 26px; flex: none; border: 0; border-radius: 6px; background: transparent;
  color: rgba(246, 242, 232, .55); font-size: 15px; line-height: 1; display: grid; place-items: center;
  opacity: .55; transition: opacity .15s, background .15s;
}
.navrow:hover .navitem__menu, .navitem__menu:focus-visible { opacity: 1; }
.navitem__menu:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sidebar__foot { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; display: grid; gap: 6px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: #2a2008; flex: none; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }
.sidebar__userinfo { min-width: 0; flex: 1; }
.sidebar__username { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__userrole { font-size: 10.5px; color: rgba(246, 242, 232, .5); }
.sidebar__sync { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(246, 242, 232, .45); padding: 4px 10px 0; }
.sidebar__sync i { width: 6px; height: 6px; border-radius: 50%; background: #7fd0a3; box-shadow: 0 0 0 3px rgba(127, 208, 163, .16); }
.sidebar__sync.is-saving i { background: var(--gold-2); box-shadow: 0 0 0 3px rgba(227, 197, 139, .18); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px clamp(16px, 2.4vw, 32px);
  background: rgba(250, 248, 243, .86); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .topbar { background: rgba(11, 20, 32, .82); }
.topbar__title { font-family: var(--reading-font); font-size: 19px; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__search { flex: 1; display: flex; justify-content: center; }
.mobile-only { display: none !important; }
.view { padding: clamp(18px, 2.4vw, 32px) clamp(16px, 3vw, 40px) 90px; width: 100%; max-width: 1280px; margin: 0 auto; }

/* ---------- library ---------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h1 { font-family: var(--reading-font); font-weight: 400; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.015em; }
.pagehead p { margin: 6px 0 0; color: var(--slate); font-size: 13.5px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filters__spacer { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 178px;
  padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  overflow: hidden;
}
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold); opacity: 0; transition: opacity .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card__top { display: flex; align-items: flex-start; gap: 10px; }
.card__title { font-family: var(--reading-font); font-size: 18.5px; line-height: 1.28; flex: 1; min-width: 0; word-break: break-word; }
.card__excerpt { color: var(--slate); font-size: 12.8px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--slate-2); padding-top: 4px; border-top: 1px dashed var(--line); }
.card__menu { opacity: 0; transition: opacity .15s; }
.card:hover .card__menu, .card:focus-within .card__menu { opacity: 1; }
/* A visible, reversible delete shortcut on every outline and notebook card. */
.card__delete { color: var(--slate-2); opacity: .72; }
.card__delete:hover, .card__delete:focus-visible { color: var(--danger); background: var(--danger-soft); opacity: 1; }
@media (hover: none), (max-width: 720px) {
  .card__menu { opacity: 1; }
  .card__delete { opacity: 1; }
}
.card--new { align-items: center; justify-content: center; border-style: dashed; background: transparent; color: var(--slate); box-shadow: none; text-align: center; gap: 8px; }
.card--new:hover { color: var(--ink); border-color: var(--gold); }
.card--new .card__plus { width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; }
.empty { text-align: center; padding: 70px 24px; color: var(--slate); }
.empty__mark { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--pearl-2); color: var(--slate-2); }
.empty h3 { font-family: var(--reading-font); font-size: 21px; font-weight: 400; color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 38ch; font-size: 13.5px; }

.rowlist { display: grid; gap: 8px; }
.rowitem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.rowitem:hover { border-color: var(--line-2); background: var(--surface-2); }
.rowitem__main { flex: 1; min-width: 0; }
.rowitem__title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem__meta { font-size: 11.5px; color: var(--slate-2); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 26px; align-items: start; }
.editor__main { min-width: 0; }
.editor__nav { position: sticky; top: 84px; display: grid; gap: 6px; min-width: 0; }
.editor__navhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 4px; }
.editor__navhead label { flex: 1; }
.editor__nav label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate-2); padding: 0 4px 4px; }
.editor__navhide { border: 1px solid var(--line); background: var(--surface); color: var(--slate-2); border-radius: 6px; height: 24px; padding: 0 7px; font-size: 10.5px; font-weight: 600; }
.editor__navhide:hover { border-color: var(--gold); color: var(--ink); }
.editor--navhidden { grid-template-columns: minmax(0, 1fr); }
.editor--navhidden .editor__nav { display: none !important; }
.editor--navhidden .editor__main { width: 100%; }
.sec { scroll-margin-top: 136px; }
.secnav { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; background: transparent; border: 1px solid transparent; text-align: left; font-size: 13px; color: var(--slate); width: 100%; }
.secnav:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.secnav--on { background: var(--surface); border-color: var(--gold); color: var(--ink); box-shadow: var(--shadow-sm); }
.secnav__num { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: var(--pearl-2); color: var(--slate); flex: none; }
.secnav--on .secnav__num { background: var(--navy); color: var(--gold-2); }
.secnav__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor__navfoot { display: grid; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }

.docmeta { display: grid; gap: 14px; margin-bottom: 22px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.docmeta__title { font-family: var(--reading-font); font-size: clamp(24px, 2.8vw, 32px); line-height: 1.2; border: 0; background: transparent; width: 100%; padding: 2px 0; }
.docmeta__title:focus { outline: none; }
.docmeta__title::placeholder { color: var(--slate-2); }
.docmeta__row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.docmeta__row .select, .docmeta__row .input { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.docmeta__row .select { padding-right: 32px; background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; }
.taginput { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 180px; }
.taginput .tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 6px 0 9px; border-radius: 999px; background: var(--pearl-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--slate); }
.taginput .tag button { border: 0; background: none; color: var(--slate-2); display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; }
.taginput .tag button:hover { background: rgba(0,0,0,.08); color: var(--danger); }
.taginput input { border: 0; background: transparent; min-width: 90px; flex: 1; height: 26px; font-size: 12.5px; }
.taginput input:focus { outline: none; }

.editor--paged .editor__main { width: min(var(--page-width), 100%); min-height: var(--page-height); margin: 0 auto; padding: var(--page-pad-top) var(--page-pad-right) var(--page-pad-bottom) var(--page-pad-left); box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 18px 48px rgba(10, 20, 35, .14); }
.editor--paged .docmeta { padding: 0 0 18px; border: 0; border-radius: 0; box-shadow: none; background: transparent; margin-bottom: 4px; }
.editor--paged .sec { background: transparent; border: 0; border-radius: 0; box-shadow: none; margin-bottom: 0; overflow: visible; }
.editor--paged .sec__head { padding-left: 0; padding-right: 0; }
.editor--paged .prose { padding-left: 0; padding-right: 0; }
.editor--paged .toolbar { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 4px; }
.editor--paged .sec__foot { padding-left: 0; padding-right: 0; }

.sec { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.sec:focus-within { border-color: rgba(193, 154, 82, .55); box-shadow: 0 0 0 3px rgba(193, 154, 82, .1); }
.sec__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid transparent; }
.sec--open .sec__head { border-bottom-color: var(--line); }
.sec__grip { width: 26px; height: 30px; display: grid; place-items: center; color: var(--slate-2); cursor: grab; flex: none; }
.sec__toggle { width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; display: grid; place-items: center; color: var(--slate-2); flex: none; transition: transform .18s var(--ease); }
.sec--open .sec__toggle { transform: rotate(90deg); }
.sec__toggle:hover { background: var(--pearl-2); }
.sec__title { flex: 1; border: 0; background: transparent; font-family: var(--reading-font); font-size: 18px; font-weight: 600; padding: 4px 2px; min-width: 0; }
.sec__title:focus { outline: none; }
.sec__title::placeholder { color: var(--slate-2); font-weight: 400; }
.sec__num { font-size: 11px; font-weight: 700; color: var(--slate-2); font-variant-numeric: tabular-nums; flex: none; }
.sec__body { padding: 0; }
.sec--closed .sec__body { display: none; }
.sec__time { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--slate-2); flex: none; }
.sec__time input { width: 46px; border: 1px solid var(--line); border-radius: 6px; height: 26px; text-align: center; background: var(--surface); font-size: 11.5px; }
.sec__time input:focus { outline: none; border-color: var(--gold); }

.toolbar { position: sticky; top: var(--editor-sticky-top, 64px); z-index: 12; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.toolbar__btn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background .14s, color .14s; }
.toolbar__btn:hover { background: rgba(85, 103, 125, .12); }
.toolbar__btn.is-on { background: var(--gold-soft, rgba(201, 162, 39, .16)); color: var(--navy); box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .5); }
[data-theme="dark"] .toolbar__btn.is-on { background: rgba(201, 162, 39, .2); color: var(--gold-2); }
.charmenu .spacingmenu__chips { flex-wrap: wrap; }
.toolbar__btn--text { width: auto; padding: 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.toolbar__btn svg { width: 15px; height: 15px; }
.toolbar__sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 5px; flex: none; }
.toolbar__label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-2); padding: 0 4px 0 8px; }

.prose {
  font-family: var(--reading-font); font-size: var(--reading-size); line-height: var(--reading-line);
  padding: 20px clamp(16px, 2.4vw, 26px) 18px; color: var(--ink); min-height: 116px;
  outline: none; overflow-wrap: break-word;
}
.prose:empty::before { content: attr(data-placeholder); color: var(--slate-2); }
.prose p, .prose > div { margin: var(--doc-space-before, 0) 0 var(--doc-space-after, .72em); }
.prose h2 { font-family: var(--reading-font); font-size: 1.34em; margin: .9em 0 .4em; line-height: 1.25; }
.prose h3 { font-size: 1.14em; margin: .8em 0 .35em; }
.prose ul, .prose ol { margin: .35em 0 .8em; padding-left: 1.4em; }
.prose li { margin-bottom: .26em; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: .6em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--gold); color: var(--ink-2); font-style: italic; }
.prose u { text-underline-offset: 2px; }
.prose mark, .prose .hl { background: linear-gradient(180deg, transparent 8%, rgba(227, 197, 139, .62) 8%); color: inherit; padding: 0 .1em; border-radius: 2px; }
[data-theme="dark"] .prose mark, [data-theme="dark"] .prose .hl { background: linear-gradient(180deg, transparent 8%, rgba(193, 154, 82, .38) 8%); }
.prose a { color: var(--navy-3); text-decoration-color: rgba(28, 58, 99, .35); text-underline-offset: 2px; }
[data-theme="dark"] .prose a { color: var(--gold-2); }
.prose .scripture {
  display: inline; padding: 0 .18em; border-radius: 4px; cursor: pointer;
  color: #7a5a17; background: rgba(193, 154, 82, .13); border-bottom: 1px solid rgba(193, 154, 82, .55);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
[data-theme="dark"] .prose .scripture { color: var(--gold-2); background: rgba(193, 154, 82, .16); }
.prose .scripture:hover { background: rgba(193, 154, 82, .26); }
.prose .scripture::after { content: "↗"; font-size: .66em; margin-left: .18em; opacity: .7; vertical-align: super; font-family: var(--ui-font); }
.prose .scripture--bare::after { content: none; }
.prose .scripture--bare:hover { background: rgba(193, 154, 82, .26); }

.sec__notes { border-top: 1px dashed var(--line); }
.sec__notes summary { cursor: pointer; padding: 10px 22px; font-size: 12px; font-weight: 600; color: var(--slate); list-style: none; display: flex; align-items: center; gap: 8px; }
.sec__notes summary::-webkit-details-marker { display: none; }
.sec__notes summary::before { content: "▸"; font-size: 10px; transition: transform .18s; }
.sec__notes[open] summary::before { transform: rotate(90deg); }
.sec__notes textarea { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 12px 22px; min-height: 80px; background: var(--surface-2); font-family: var(--ui-font); font-size: 13px; resize: vertical; }
.sec__notes textarea:focus { outline: none; }
.sec__foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--slate-2); flex-wrap: wrap; }
.sec__foot .sp { flex: 1; }
.ghostbtn { background: none; border: 0; color: var(--slate); font-size: 11.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.ghostbtn:hover { background: rgba(85, 103, 125, .1); color: var(--ink); }
.ghostbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.editor__foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- modal / sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(7, 20, 39, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 210; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: min(88dvh, 780px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); animation: pop .2s var(--ease); overflow: hidden;
}
@keyframes pop { from { transform: translateY(10px) scale(.99); opacity: 0; } }
.modal--wide { max-width: 760px; }
.modal--tall { max-height: 90dvh; }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.modal__title { font-family: var(--reading-font); font-size: 21px; flex: 1; line-height: 1.25; }
.modal__sub { margin: 4px 0 0; font-size: 12.5px; color: var(--slate); }
.modal__body { padding: 6px 22px 20px; overflow-y: auto; display: grid; gap: 16px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.modal__foot .sp { flex: 1; }

.menu { position: fixed; z-index: 240; min-width: 212px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .14s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 9px 11px; border: 0; background: none; border-radius: 8px; font-size: 13px; text-align: left; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--pearl-2); }
.menu button svg, .menu a svg { width: 15px; height: 15px; color: var(--slate); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .danger { color: var(--danger); }
.menu .danger svg { color: var(--danger); }
.menu__hint { font-size: 10.5px; color: var(--slate-2); padding: 6px 11px 3px; text-transform: uppercase; letter-spacing: .1em; }

.toast-root { position: fixed; z-index: 260; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--navy); color: #f7f3e9; box-shadow: var(--shadow-lg); font-size: 13px; animation: toastin .22s var(--ease); pointer-events: auto; }
.toast--error { background: #6d2318; }
.toast--ok { background: #14372a; }
.toast svg { width: 16px; height: 16px; flex: none; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

/* ---------- settings ---------- */
.tabsline { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 22px; }
@media (max-width: 640px) { .tabsline { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .tabsline::-webkit-scrollbar { display: none; } }
.tabsline button { position: relative; border: 0; background: none; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--slate); white-space: nowrap; }
.tabsline button[aria-selected="true"] { color: var(--ink); }
.tabsline button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }
.setrow { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow__main { flex: 1; min-width: 0; }
.setrow__title { font-size: 13.5px; font-weight: 600; }
.setrow__desc { font-size: 12px; color: var(--slate-2); margin-top: 2px; line-height: 1.5; }
.setrow__ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--pearl-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--slate); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.range { width: 130px; accent-color: var(--gold); }

/* ---------- admin ---------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat__k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-2); }
.stat__v { font-family: var(--reading-font); font-size: 30px; margin-top: 6px; line-height: 1; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.data th { text-align: left; padding: 11px 14px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-2); border-bottom: 1px solid var(--line); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }
.celluser { display: flex; align-items: center; gap: 10px; }
.celluser__name { font-weight: 600; }
.celluser__mail { font-size: 11.5px; color: var(--slate-2); }
.codebox { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .12em; background: var(--navy); color: var(--gold-2); padding: 14px 16px; border-radius: 11px; text-align: center; word-break: break-all; }

/* ---------- scripture modal ---------- */
.scripture-ref { font-family: var(--reading-font); font-size: 30px; line-height: 1.15; color: var(--ink); }
.scripture-links { display: grid; gap: 8px; }
.scripture-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--ink); font-size: 13px; transition: border-color .15s, background .15s; }
.scripture-link:hover { border-color: var(--gold); background: rgba(193, 154, 82, .07); }
.scripture-link svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.scripture-link b { display: block; font-size: 13px; }
.scripture-link span { font-size: 11.5px; color: var(--slate-2); }

/* ---------- presentation ---------- */
.present {
  --p-bg: radial-gradient(130% 100% at 50% -20%, var(--navy-3), var(--navy) 42%, var(--navy-ink) 100%);
  --p-ink: #f7f4ec;
  --p-head: #fdfbf5;
  --p-muted: rgba(247, 244, 236, .68);
  --p-body: rgba(250, 248, 243, .93);
  --p-line: rgba(255, 255, 255, .1);
  --p-line-strong: rgba(255, 255, 255, .16);
  --p-surface: rgba(255, 255, 255, .06);
  --p-surface-2: rgba(255, 255, 255, .12);
  --p-strip: rgba(255, 255, 255, .03);
  --p-gold: var(--gold-2);
  --p-notes-bg: rgba(0, 0, 0, .18);
  --p-panel-bg: #0f2138;
  --p-input-bg: rgba(0, 0, 0, .25);
  --p-danger: #ff8a7c;
  position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column;
  background: var(--p-bg); color: var(--p-ink);
}
.present[data-theme="light"] {
  --p-bg: radial-gradient(120% 100% at 50% -10%, #ffffff, #faf8f3 45%, #efe8db 100%);
  --p-ink: #17202e;
  --p-head: #0b1b34;
  --p-muted: rgba(23, 32, 46, .66);
  --p-body: rgba(23, 32, 46, .92);
  --p-line: rgba(23, 32, 46, .12);
  --p-line-strong: rgba(23, 32, 46, .2);
  --p-surface: rgba(255, 255, 255, .75);
  --p-surface-2: rgba(11, 27, 52, .07);
  --p-strip: rgba(255, 255, 255, .62);
  --p-gold: #a97f33;
  --p-notes-bg: rgba(255, 255, 255, .58);
  --p-panel-bg: #fffdf8;
  --p-input-bg: #ffffff;
  --p-danger: #a33224;
}
.present[data-theme="warm"] {
  --p-bg: #f3ead9;
  --p-ink: #2c2118;
  --p-head: #1f1711;
  --p-muted: rgba(44, 33, 24, .68);
  --p-body: rgba(44, 33, 24, .94);
  --p-line: rgba(66, 45, 25, .16);
  --p-line-strong: rgba(66, 45, 25, .24);
  --p-surface: rgba(255, 252, 244, .72);
  --p-surface-2: rgba(92, 62, 28, .09);
  --p-strip: rgba(255, 252, 244, .72);
  --p-gold: #8d641d;
  --p-notes-bg: rgba(255, 250, 239, .58);
  --p-panel-bg: #fbf4e6;
  --p-input-bg: #fffdf7;
  --p-danger: #9b3526;
}
.present__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px clamp(14px, 2vw, 26px); border-bottom: 1px solid var(--p-line); background: var(--p-strip); }
.present__clock { font-variant-numeric: tabular-nums; font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; letter-spacing: .02em; padding: 3px 14px; border-radius: 999px; background: var(--p-surface); border: 1px solid var(--p-line-strong); white-space: nowrap; color: var(--p-ink); }
.present__clock.is-low { color: var(--p-danger); border-color: var(--p-danger); }
.present__clock.is-over { color: var(--p-danger); }
.present__ctrl { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.present__ctrl:hover { background: var(--p-surface-2); }
.present__ctrl svg { width: 15px; height: 15px; }
.present__ctrl--primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a2008; border-color: transparent; }
.present__ctrl--primary:hover { filter: brightness(1.05); }
.present__status { font-size: 12.5px; color: var(--p-muted); margin-left: 4px; }
.present__btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-ink); display: grid; place-items: center; flex: none; transition: background .15s; }
.present__btn:hover { background: var(--p-surface-2); }
.present__btn svg { width: 17px; height: 17px; }
.present__stage { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; }
.present__slidewrap { overflow-y: auto; display: flex; justify-content: center; padding: clamp(18px, 4vh, 44px) clamp(16px, 4vw, 56px); }
.present__slide { width: min(980px, 100%); }
.present__kicker { display: flex; align-items: center; gap: 10px; font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--p-gold); margin-bottom: 14px; }
.present__kicker i { height: 1px; width: 26px; background: var(--p-line-strong); display: inline-block; }
.present__h { font-family: var(--reading-font); font-weight: 400; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 clamp(14px, 2.4vh, 26px); color: var(--p-head); }
.present .prose { font-size: clamp(17px, 1.9vw, 25px); line-height: 1.62; padding: 0; color: var(--p-body); min-height: 0; }
.present .prose p { margin: 0 0 .8em; }
.present .prose h2 { font-size: 1.15em; }
.present .prose h3 { font-size: 1.03em; color: var(--p-gold); }
.present .prose ul, .present .prose ol { padding-left: 1.15em; }
.present .prose li { margin-bottom: .42em; }
.present .prose mark, .present .prose .hl { background: linear-gradient(180deg, transparent 12%, rgba(227, 197, 139, .3) 12%); }
.present .prose blockquote { border-left-color: var(--p-gold); color: var(--p-body); }
.present .prose a { color: var(--p-gold); }
.present .prose .scripture { color: var(--p-gold); background: rgba(193, 154, 82, .14); border-bottom-color: rgba(193, 154, 82, .45); }
.present__notes { width: 316px; border-left: 1px solid var(--p-line); padding: 22px; overflow-y: auto; background: var(--p-notes-bg); }
.present__notes h4 { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--p-gold); margin-bottom: 10px; }
.present__notes p { font-size: 13.5px; line-height: 1.65; color: var(--p-body); white-space: pre-wrap; margin: 0 0 12px; }
.present__notesmeta { margin-top: 16px; font-size: 11.5px; line-height: 1.7; color: var(--p-muted); }
.present__foot { display: flex; align-items: center; gap: 12px; padding: 12px clamp(14px, 2vw, 26px); padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--p-line); }
.present__progress { flex: 1; display: flex; gap: 5px; }
.present__progress button { flex: 1; height: 5px; border-radius: 3px; border: 0; background: rgba(255, 255, 255, .16); padding: 0; transition: background .2s, transform .2s; }
.present__progress button:hover { transform: scaleY(2); }
.present__progress button.done { background: rgba(227, 197, 139, .45); }
.present__progress button.on { background: var(--gold-2); }
.present__nav { display: flex; align-items: center; gap: 8px; }
.present__navbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-ink); font-size: 13px; font-weight: 600; }
.present__navbtn:hover { background: var(--p-surface-2); }
.present__navbtn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a2008; border-color: transparent; }
.present__timerpanel { position: absolute; right: clamp(14px, 2vw, 26px); top: 118px; width: 280px; padding: 16px; border-radius: 14px; background: var(--p-panel-bg); border: 1px solid var(--p-line-strong); box-shadow: var(--shadow-lg); z-index: 5; color: var(--p-ink); }
.present__timerpanel h5 { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--p-gold); margin: 0 0 10px; }
.present__timerpanel .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 12.5px; color: var(--p-body); border-bottom: 1px solid var(--p-line); }
.present__timerpanel .row:last-child { border: 0; }
.present__timerpanel input { width: 66px; height: 30px; text-align: center; border-radius: 7px; border: 1px solid var(--p-line-strong); background: var(--p-input-bg); color: var(--p-ink); font-size: 12.5px; }
.present__timerpanel .mini { height: 26px; min-width: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-ink); font-size: 12px; }

/* ---------- misc ---------- */
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: 0 1px 0 var(--line-2); }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--slate); }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy); color: #fff; padding: 24px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.offline-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 9px; border-radius: 999px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .editor { grid-template-columns: 1fr; }
  .present__notes { width: 268px; }
}
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { display: none; }
  .auth__mobilebrand { display: flex; }
  .auth__panel { padding: 26px 20px 40px; align-items: stretch; justify-content: flex-start; min-height: 100vh; min-height: 100dvh; }
  .auth__card { margin: 0 auto; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); height: 100vh; height: 100dvh;
    transform: translateX(-102%); transition: transform .26s var(--ease); box-shadow: 0 0 60px rgba(0,0,0,.4);
  }
  .app--navopen .sidebar { transform: none; }
  .navscrim { position: fixed; inset: 0; background: rgba(7, 20, 39, .45); z-index: 35; animation: fade .18s; }
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  .topbar { min-height: 58px; gap: 8px; }
  .topbar__title { font-size: 16px; }
  .present__stage { grid-template-columns: 1fr; }
  .present__notes { position: absolute; inset: auto 0 0 0; width: 100%; max-height: 46dvh; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); background: #0b1a2d; border-radius: 16px 16px 0 0; z-index: 4; box-shadow: 0 -20px 50px rgba(0,0,0,.5); }
  .present__timerpanel { left: 14px; right: 14px; width: auto; top: 64px; }
  .view { padding-bottom: 56px; }
  .grid { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .card { min-height: 0; }
  .modal { max-height: 92dvh; }
  .modal__head { padding: 18px 18px 10px; }
  .modal__body { padding: 4px 18px 18px; }
  .modal__foot { padding: 12px 18px; }
  .tabsline { padding: 0 14px; }
  .setrow { align-items: flex-start; }
  .setrow__ctl { flex-wrap: wrap; justify-content: flex-end; }
  .present__navbtn span { display: none; }
  .present__navbtn { padding: 0 12px; }
  .present__foot { gap: 8px; }
  .docmeta { padding: 14px; }
}

@media print {
  .sidebar, .topbar, .toolbar, .sec__notes, .sec__foot, .editor__nav, .editor__foot, .card__menu, .toast-root { display: none !important; }
  .editor--paged .editor__main { width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; }
  .editor--paged .docmeta { padding-bottom: 12mm; background: #fff; }
  .editor--paged .sec { border: 0; background: #fff; }
  .app { grid-template-columns: 1fr; }
  .sec { break-inside: avoid; box-shadow: none; border-color: #ccc; }
  body { background: #fff; }
}

/* ---------- language switcher & feedback (added 1.1.0) ---------- */
.langbtn__code { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.langbtn { min-width: 42px; }
.auth__lang { display: flex; gap: 6px; justify-content: flex-end; margin: 0 0 12px; }
.auth__lang button { border: 1px solid var(--line); background: var(--surface); color: var(--slate); border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 600; }
.auth__lang button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.auth__report { display: block; margin: 14px auto 0; font-size: 12.5px; }
.langgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 4px 0 10px; }
.langcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); text-align: left; }
.langcard strong { font-size: 14px; }
.langcard__code { font-size: 10.5px; letter-spacing: .08em; color: var(--slate-2); font-weight: 700; }
.langcard[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft); }
.langcard[aria-pressed="true"] .langcard__code { color: var(--gold); }
.report__lead { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--slate); }
.report__tech { margin: 8px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--slate); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 130px; overflow: auto; }
.report .switch { margin: 2px 0; }
.prose h1 { font-family: var(--reading-font); font-size: 1.55em; line-height: 1.25; margin: .7em 0 .35em; }
.prose h5, .prose h6 { font-family: var(--ui-font); font-size: 1em; margin: .6em 0 .3em; }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; font-size: .92em; }
@media (max-width: 520px) {
  .auth__lang { justify-content: center; }
  .langgrid { grid-template-columns: 1fr 1fr; }
}

/* ---------- announcements, admin dashboard, feature flags ---------- */
.announce { display: flex; align-items: center; gap: 12px; padding: 10px clamp(14px, 3vw, 28px); padding-top: calc(10px + env(safe-area-inset-top)); font-size: 13px; line-height: 1.5; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.announce__text { flex: 1; min-width: 0; }
.announce--info { background: rgba(59, 108, 168, .1); border-bottom-color: rgba(59, 108, 168, .22); }
.announce--warn { background: var(--warn-soft); border-bottom-color: rgba(163, 50, 36, .22); }
.announce--ok { background: rgba(45, 122, 90, .1); border-bottom-color: rgba(45, 122, 90, .22); }
.announce--update { background: rgba(193, 154, 82, .15); border-bottom-color: rgba(193, 154, 82, .32); }
.announce__x { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; flex: none; opacity: .65; cursor: pointer; }
.announce__x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.announce__x svg { width: 15px; height: 15px; }

.admin__h { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--slate); margin: 30px 0 10px; }
.admin__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px 20px; margin-bottom: 8px; }
.admin__card .field:last-of-type { margin-bottom: 6px; }
.stat__desc { font-size: 11.5px; color: var(--slate-2); margin-top: 4px; line-height: 1.4; }
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.langcard[aria-pressed="true"] { border-color: var(--gold); background: rgba(193, 154, 82, .12); }
.langcard[aria-pressed="false"] { opacity: .55; }
.admin__card .hint { display: block; font-size: 12px; color: var(--slate); line-height: 1.5; }

/* features an administrator has turned off */
html[data-no-present="1"] [data-act="present"],
html[data-no-present="1"] [data-act="present-top"],
html[data-no-imports="1"] [data-act="import"] { display: none !important; }

@media (max-width: 560px) {
  .present__controls { gap: 6px; padding: 8px 12px; }
  .present__ctrl { height: 36px; padding: 0 11px; font-size: 12.5px; }
  .present__ctrl svg { width: 14px; height: 14px; }
  .present__status { display: none; }
  .present__clock { font-size: 19px; padding: 2px 11px; }
}

/* ---------- brand icon + about page ---------- */
.brandmark--img { object-fit: cover; border-radius: 24%; display: block; background: #0b1b34; box-shadow: 0 6px 18px rgba(11, 27, 52, .24); }
.brandmark--lg.brandmark--img { width: 76px; height: 76px; }
.about { margin: 4px 0 6px; }
.about p { font-size: 13px; line-height: 1.72; color: var(--slate); margin: 0 0 12px; }
.about p.about__lead { font-size: 14.5px; line-height: 1.65; color: var(--ink); margin-bottom: 16px; }
.about h3 { font-family: var(--reading-font); font-weight: 400; font-size: 17px; letter-spacing: -.01em; color: var(--ink); margin: 22px 0 10px; }
.about__rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0 16px; }
.about p.about__tagline { font-family: var(--reading-font); font-size: 17px; line-height: 1.5; text-align: center; color: var(--ink); margin: 6px 0 4px; }

/* ---------- what's-new banner ---------- */
.announce--news { align-items: flex-start; gap: 14px; }
.announce--news .announce__title { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.announce__list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2, var(--ink)); max-height: 34vh; overflow-y: auto; }
.announce__list li { margin-bottom: 3px; }
.announce--news .btn { flex: none; margin-top: 2px; }
@media (max-width: 560px) {
  .announce--news { flex-wrap: wrap; }
  .announce--news .btn { width: 100%; }
  .announce__list { font-size: 12px; max-height: 30vh; }
}

/* ---------- presentation scrolling ---------- */
.present__divider { width: 1px; height: 26px; background: var(--p-line-strong); margin: 0 2px; flex: none; }
.present__ctrl--toggle[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--p-surface-2); }
.present__ctrl--icon { padding: 0 10px; }
.present__speed { font-size: 12px; color: var(--p-muted); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.present__hint { font-size: 12px; color: var(--p-muted); }
.present__stage { scroll-behavior: auto; }

/* ---------- broadcast messages ---------- */
.announce--broadcast .announce__text { white-space: pre-line; }

/* ---------- bible library ---------- */
.bible { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .bible { grid-template-columns: minmax(0, 1fr); } }
.bible__side { background: var(--card, #fff); border: 1px solid var(--line, #e5e2d9); border-radius: 16px; padding: 14px; display: grid; gap: 8px; }
.bible__sidelabel { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--slate, #6b7686); font-weight: 700; padding: 2px 4px 6px; }
.bible__item { border: 1px solid transparent; border-radius: 12px; padding: 8px; background: var(--wash, #f7f6f2); }
.bible__item.is-on { border-color: var(--gold, #c9a227); background: rgba(201, 162, 39, .1); }
.bible__pick { display: grid; gap: 3px; text-align: left; background: none; border: 0; width: 100%; cursor: pointer; color: inherit; font: inherit; }
.bible__pick strong { font-size: 14px; line-height: 1.35; }
.bible__pick span { font-size: 11.5px; color: var(--slate, #6b7686); }
.bible__tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.bible__pane { background: var(--card, #fff); border: 1px solid var(--line, #e5e2d9); border-radius: 16px; padding: 16px; }
.bible__toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.bible__toolbar .input { flex: 1 1 200px; min-width: 140px; }
.bible__verses { display: grid; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 6px; line-height: 1.62; font-size: 15.5px; font-family: Georgia, 'Times New Roman', serif; }
.bible__verse { margin: 0; }
.bible__num { display: inline-block; min-width: 1.6em; font-size: 11px; font-weight: 700; color: var(--gold, #a8871f); font-family: system-ui, sans-serif; vertical-align: super; }
.bible__results { margin-top: 14px; display: grid; gap: 8px; }
.bible__resulthead { font-size: 12px; font-weight: 700; color: var(--slate, #6b7686); text-transform: uppercase; letter-spacing: .06em; }
.bible__result { text-align: left; background: var(--wash, #f7f6f2); border: 1px solid var(--line, #e5e2d9); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: grid; gap: 3px; font: inherit; color: inherit; }
.bible__result:hover { border-color: var(--gold, #c9a227); }
.bible__result strong { font-size: 13px; color: var(--navy, #12305a); }
.bible__result span { font-size: 13px; color: var(--slate, #55606e); line-height: 1.5; }
.bible-empty { display: grid; gap: 12px; max-width: 640px; padding: 26px; }
.bible-empty h2 { margin: 0; font-size: 19px; }
.bible-empty__steps { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; color: var(--slate, #55606e); }
.importprogress { height: 8px; border-radius: 999px; background: var(--wash, #eeece6); overflow: hidden; }
.importprogress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold, #c9a227), var(--navy, #12305a)); transition: width .2s ease; }
[data-theme="dark"] .bible__side, [data-theme="dark"] .bible__pane { background: #122033; border-color: #24374f; }
[data-theme="dark"] .bible__item, [data-theme="dark"] .bible__result { background: #0e1a2a; border-color: #24374f; }
[data-theme="dark"] .bible__result strong { color: #f3e7c8; }

/* ---------- scripture reader ---------- */
.scripturepop { position: fixed; inset: 0; z-index: 420; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(5, 13, 24, .66); backdrop-filter: blur(5px); }
.scripturepop--full { padding: 0; }
.scripturepop__panel { width: min(820px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: #fbfaf5; color: #17212e; border-radius: 18px; box-shadow: 0 32px 80px rgba(4, 12, 24, .45); overflow: hidden; border: 1px solid rgba(201, 162, 39, .35); }
.scripturepop--full .scripturepop__panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
.scripturepop__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid rgba(23, 33, 46, .1); }
.scripturepop__ref { font-size: 18px; font-weight: 700; letter-spacing: .01em; color: #12305a; }
.scripturepop__tr { font-size: 12px; color: #6b7686; margin-top: 2px; }
.scripturepop__headtools { display: flex; gap: 6px; }
.scripturepop__icon { width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(23, 33, 46, .14); background: transparent; cursor: pointer; font-size: 14px; color: inherit; }
.scripturepop__icon:hover { background: rgba(18, 48, 90, .08); }
.scripturepop__body { padding: 14px 24px 20px; overflow: auto; line-height: 1.55; font-family: Georgia, 'Times New Roman', serif; }
.scripturepop__verse { margin: 0 0 14px; }
.scripturepop__num { font-family: system-ui, sans-serif; font-size: .55em; font-weight: 700; color: #a8871f; vertical-align: super; margin-right: .35em; }
.scripturepop__empty, .scripturepop__note { font-family: system-ui, sans-serif; font-size: 13.5px; color: #6b7686; }
.scripturepop__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid rgba(23, 33, 46, .1); background: rgba(18, 48, 90, .04); }
.scripturepop__group { display: flex; gap: 6px; }
.scripturepop__btn { border: 1px solid rgba(23, 33, 46, .16); background: #fff; border-radius: 9px; padding: 6px 11px; font-size: 13px; cursor: pointer; color: inherit; }
.scripturepop__btn.is-on { background: #12305a; color: #fdf8ea; border-color: #12305a; }
.scripturepop__select { margin-left: auto; border-radius: 9px; border: 1px solid rgba(23, 33, 46, .16); padding: 6px 8px; font-size: 12.5px; max-width: 220px; }
.scripturepop__link { font-size: 12.5px; color: #12305a; text-decoration: underline; }
[data-theme="dark"] .scripturepop__panel { background: #0d1829; color: #f2eee2; border-color: rgba(201, 162, 39, .4); }
[data-theme="dark"] .scripturepop__ref { color: #f3e7c8; }
[data-theme="dark"] .scripturepop__head, [data-theme="dark"] .scripturepop__foot { border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .scripturepop__foot { background: rgba(255, 255, 255, .04); }
[data-theme="dark"] .scripturepop__btn { background: #14243a; border-color: #27405c; color: #f2eee2; }
[data-theme="dark"] .scripturepop__btn.is-on { background: #c9a227; border-color: #c9a227; color: #10203a; }
[data-theme="dark"] .scripturepop__select { background: #14243a; color: #f2eee2; border-color: #27405c; }
[data-theme="dark"] .scripturepop__link { color: #e8cf87; }

/* ---------- tabbed editor toolbar ---------- */
.toolbar { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px 6px; }
.toolbar__head { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.toolbar__always { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.toolbar__tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.toolbar__tabs::-webkit-scrollbar { display: none; }
.toolbar__tab { border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-2); padding: 4px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.toolbar__tab:hover { background: rgba(85, 103, 125, .1); color: var(--ink-2); }
.toolbar__tab.is-on { background: rgba(18, 48, 90, .1); color: var(--navy); }
[data-theme="dark"] .toolbar__tab.is-on { background: rgba(201, 162, 39, .18); color: var(--gold); }
.toolbar__panels { display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.toolbar__panel { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; width: 100%; min-width: 0; max-width: 100%; flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding: 3px 2px 2px; }
.ribbon__group { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; padding: 0 8px; border-right: 1px solid var(--line); min-width: max-content; }
.ribbon__group:last-child { border-right: 0; }
.ribbon__controls { display: flex; align-items: center; gap: 2px; flex: 1; }
.ribbon__label { font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-2); text-align: center; padding-bottom: 1px; white-space: nowrap; }
.toolbar__panel[hidden] { display: none !important; }
.toolbar__select { height: 28px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; padding: 0 4px; max-width: 130px; cursor: pointer; }
.toolbar__fontbtn { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; width: 132px; max-width: 132px; text-align: left; white-space: nowrap; overflow: hidden; }
.toolbar__fontbtn [data-role="font-name"] { overflow: hidden; text-overflow: ellipsis; }
.toolbar__caret { color: var(--slate-2); font-size: 9px; flex: none; }
.toolbar__sizegroup { display: inline-flex; align-items: center; gap: 2px; }
.toolbar__sizebtn { width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.toolbar__step { height: 28px; min-width: 27px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.toolbar__step:hover, .toolbar__fontbtn:hover, .toolbar__sizebtn:hover { background: var(--surface-2); border-color: var(--gold); }
.fontmenu, .sizemenu, .spacingmenu { position: fixed; z-index: 500; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px rgba(10, 20, 35, .24); padding: 8px; }
.spacingmenu { width: 340px; display: grid; gap: 9px; }
.spacingmenu__head { display: flex; align-items: baseline; justify-content: space-between; padding: 3px 4px 2px; }
.spacingmenu__head strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.spacingmenu__head span { font-size: 10px; color: var(--slate-2); }
.spacingmenu__row { display: grid; gap: 4px; }
.spacingmenu__row > span { font-size: 10.5px; color: var(--slate-2); padding-left: 4px; }
.spacingmenu__row > span em { font-style: normal; color: var(--gold); }
.spacingmenu__chips { display: flex; flex-wrap: wrap; gap: 3px; }
.spacingmenu__chips button { min-width: 39px; height: 27px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-2); font-size: 11px; cursor: pointer; }
.spacingmenu__chips button:hover, .spacingmenu__chips button.is-on { border-color: var(--gold); background: var(--gold-soft, rgba(201, 162, 39, .14)); color: var(--ink); }
.spacingmenu__custom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 5px; border-top: 1px solid var(--line); padding-top: 8px; }
.spacingmenu__custom label { display: grid; gap: 3px; font-size: 9.5px; color: var(--slate-2); }
.spacingmenu__custom input { width: 100%; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; font: inherit; font-size: 11px; background: var(--surface); color: var(--ink); }
.spacingmenu__reset { border: 0; background: transparent; color: var(--slate-2); text-align: left; padding: 3px 4px; font: inherit; font-size: 11px; text-decoration: underline; cursor: pointer; }
.spacingmenu__reset:hover { color: var(--ink); }
.spacingmenu__hint { margin: 0 4px 2px; font-size: 10.5px; line-height: 1.4; color: var(--slate-2); }
.fontmenu { width: 300px; max-height: min(72vh, 560px); display: flex; flex-direction: column; gap: 6px; }
.fontmenu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 4px; }
.fontmenu__head strong, .sizemenu__head strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.fontmenu__search { flex: 1; min-width: 0; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 8px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); }
.fontmenu__body { overflow-y: auto; min-height: 0; display: grid; gap: 2px; }
.fontmenu__group { display: grid; gap: 1px; }
.fontmenu__group h4 { margin: 7px 6px 3px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-2); }
.fontmenu__item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; border: 0; border-radius: 7px; background: transparent; color: var(--ink); padding: 7px 8px; font-size: 15px; text-align: left; cursor: pointer; }
.fontmenu__item small { font-family: var(--ui-font); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-2); flex: none; }
.fontmenu__item:hover, .fontmenu__item:focus-visible { background: var(--surface-2); outline: none; }
.fontmenu__item--doc { font-family: var(--reading-font); }
.fontmenu__hint { margin: 4px 5px 2px; font-size: 10.5px; line-height: 1.4; color: var(--slate-2); }
.sizemenu { width: 252px; display: grid; gap: 8px; }
.sizemenu__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.sizemenu__head span, .sizemenu__recent > span { font-size: 10px; color: var(--slate-2); }
.sizemenu__recent { border-bottom: 1px solid var(--line); padding-bottom: 7px; display: grid; gap: 5px; }
.sizemenu__recent > span { padding-left: 4px; text-transform: uppercase; letter-spacing: .08em; }
.sizemenu__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.sizemenu__grid button { height: 27px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-2); font-size: 11px; cursor: pointer; }
.sizemenu__grid button:hover, .sizemenu__grid button.is-on { border-color: var(--gold); background: var(--gold-soft, rgba(201, 162, 39, .14)); color: var(--ink); }
.sizemenu__custom { display: flex; align-items: end; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.sizemenu__custom label { flex: 1; display: grid; gap: 4px; font-size: 10px; color: var(--slate-2); }
.sizemenu__custom input { height: 30px; width: 100%; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 7px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); }
.toolbar__btn--color { position: relative; }
.toolbar__glyph-a { font-size: 13px; font-weight: 700; line-height: 1.1; }
.toolbar__bar { position: absolute; bottom: 4px; left: 7px; right: 7px; height: 3px; border-radius: 2px; }
.toolbar__btn--color svg { width: 15px; height: 15px; }

/* colour picker */
.colormenu { position: fixed; z-index: 500; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px rgba(10, 20, 35, .24); padding: 10px; display: grid; gap: 9px; max-height: min(70vh, 560px); overflow-y: auto; }
.colormenu__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.colormenu__head strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.colormenu__head span { font-size: 10.5px; color: var(--slate-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colormenu__group { display: grid; gap: 4px; }
.colormenu__group h4 { margin: 2px 2px 0; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-2); }
.colormenu__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.colormenu__sw { position: relative; height: 27px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .16); cursor: pointer; }
.colormenu__sw:hover { outline: 2px solid var(--gold); outline-offset: 1px; }
.colormenu__sw.is-on { outline: 2px solid var(--gold); outline-offset: 1px; box-shadow: inset 0 0 0 2px var(--surface); }
.colormenu__check { display: none; position: absolute; inset: 0; place-items: center; color: var(--navy); font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px rgba(255, 255, 255, .9); }
.colormenu__sw.is-on .colormenu__check { display: grid; }
.colormenu__custom { display: flex; align-items: center; gap: 5px; border-top: 1px solid var(--line); padding-top: 8px; }
.colormenu__picker { width: 32px; height: 30px; flex: none; padding: 2px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); cursor: pointer; }
.colormenu__hex { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); }
.colormenu__clear { border: 0; background: transparent; color: var(--slate-2); font-size: 12px; text-align: left; cursor: pointer; padding: 2px 0; }
.colormenu__clear:hover, .colormenu__clear.is-on { color: var(--gold); }
[data-theme="dark"] .colormenu__check { color: #10203a; text-shadow: 0 1px 2px rgba(255, 255, 255, .65); }

/* lists and paragraph formatting */
.toolbar__liststyle { display: inline-flex; align-items: center; gap: 1px; padding: 0 6px; width: auto; }
.toolbar__liststyle svg { width: 15px; height: 15px; }
.toolbar__liststyle .toolbar__caret { font-size: 9px; }
.listmenu { position: fixed; z-index: 500; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px rgba(10, 20, 35, .24); padding: 10px; display: grid; gap: 10px; max-height: min(70vh, 560px); overflow-y: auto; }
.listmenu__head { display: grid; gap: 2px; }
.listmenu__head strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.listmenu__head span { font-size: 10.5px; color: var(--slate-2); }
.listmenu__group { display: grid; gap: 4px; }
.listmenu__group h4 { margin: 2px 2px 0; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-2); }
.listmenu__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.liststyle { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11.5px; text-align: left; cursor: pointer; }
.liststyle:hover { border-color: var(--gold); }
.liststyle.is-on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft); }
.liststyle__glyph { flex: none; width: 22px; text-align: center; font-family: var(--reading-font); font-size: 15px; }
.listmenu__hint { margin: 0; font-size: 10px; line-height: 1.45; color: var(--slate-2); }
.paraform { display: grid; gap: 12px; padding: 2px 0 4px; }
.paraform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paraform__field { display: grid; gap: 5px; font-size: 11.5px; color: var(--slate); }
.paraform__field span { font-weight: 600; color: var(--ink-2); }
.paraform__field input, .paraform__field select { height: 34px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; font-size: 12px; }
.paraform__field small { color: var(--slate-2); font-size: 10.5px; line-height: 1.35; }
.paraform__check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--slate); line-height: 1.4; }
.paraform__check input { margin-top: 2px; }

/* page setup */
.pageform { display: grid; gap: 12px; padding: 2px 0 4px; }
.pageform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pageform__row--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pageform__field { display: grid; gap: 5px; font-size: 11.5px; color: var(--slate); }
.pageform__field span { font-weight: 600; color: var(--ink-2); }
.pageform__field input, .pageform__field select { height: 34px; width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; font-size: 12px; }
.pageform__preview { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 600; }
.pageform__hint { margin: 0; color: var(--slate-2); font-size: 10.5px; line-height: 1.45; }
@media (max-width: 520px) { .pageform__row--four { grid-template-columns: 1fr 1fr; } }

/* document styles */
.toolbar__stylebtn { width: 104px; max-width: 104px; display: inline-flex; align-items: center; justify-content: space-between; gap: 5px; text-align: left; white-space: nowrap; }
.toolbar__stylebtn [data-role="style-name"] { overflow: hidden; text-overflow: ellipsis; }
.stylemenu { position: fixed; z-index: 500; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px rgba(10, 20, 35, .24); padding: 10px; display: grid; gap: 9px; max-height: min(70vh, 560px); overflow-y: auto; }
.stylemenu__head { display: grid; gap: 2px; }
.stylemenu__head strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.stylemenu__head span { font-size: 10.5px; color: var(--slate-2); }
.stylemenu__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stylecard { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 7px 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.stylecard:hover { border-color: var(--gold); }
.stylecard.is-on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft); }
.stylecard__sample { flex: none; width: 34px; display: grid; place-items: center; font-family: var(--reading-font); line-height: 1; color: var(--ink); }
.stylecard__name { min-width: 0; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stylemenu__hint { margin: 0; font-size: 10px; line-height: 1.45; color: var(--slate-2); }

/* heading levels 4–6 */
.prose h4 { font-family: var(--reading-font); font-size: 1.06em; margin: .7em 0 .3em; line-height: 1.3; }
.prose h5 { font-family: var(--reading-font); font-size: .98em; font-weight: 700; margin: .65em 0 .25em; }
.prose h6 { font-family: var(--ui-font); font-size: .86em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); margin: .6em 0 .2em; }
.present .prose h4 { font-size: 1.0em; }
.present .prose h5 { font-size: .95em; }
.present .prose h6 { font-size: .88em; color: var(--p-gold); }

/* ---------- sign-in at startup ---------- */
.auth__alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 9px; justify-items: center; }
.auth__alt > span { font-size: 12.5px; color: var(--slate-2); }
.auth__alt .btn { width: 100%; }
.auth__alt .hint { text-align: center; line-height: 1.5; }
.auth__alt--restore { margin-top: 18px; }

/* ---------- bible import warnings ---------- */
.bible__warn { display: block; margin-top: 4px; font-size: 11px; line-height: 1.45; color: #8c5a12; background: rgba(201, 162, 39, .16); border-radius: 6px; padding: 4px 6px; }
[data-theme="dark"] .bible__warn { color: #f0d79a; background: rgba(201, 162, 39, .16); }

/* ==========================================================================
   Support this project
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn--lg { min-height: 46px; padding: 0 22px; font-size: 15px; gap: 10px; }

.support { max-width: 900px; margin: 0 auto; padding: 8px 0 48px; display: grid; gap: 22px; }
.support__head { text-align: center; padding: 26px 18px 6px; }
.support__mark {
  width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  margin-bottom: 12px;
}
.support__mark svg { width: 26px; height: 26px; }
.support__head h1 { font-family: var(--reading-font); font-weight: 400; font-size: clamp(28px, 4vw, 40px); margin: 0 0 6px; color: var(--ink); letter-spacing: -.01em; }
.support__lead { margin: 0; color: var(--gold); font-size: 16px; letter-spacing: .01em; }

.supcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 34px); box-shadow: var(--shadow-md);
}
.supcard p { margin: 0 0 13px; color: var(--ink-2); line-height: 1.75; font-size: 15.5px; }
.supcard p:last-child { margin-bottom: 0; }
.supcard__note { color: var(--slate) !important; font-size: 14.5px; }
.supcard__thanks { color: var(--ink) !important; font-family: var(--reading-font); font-size: 17px; }
.supcard__rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.coffee { text-align: center; }
.coffee__icon {
  width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--gold); background: var(--gold-soft);
}
.coffee__icon svg { width: 26px; height: 26px; }
.coffee h2 { font-family: var(--reading-font); font-weight: 400; font-size: clamp(21px, 2.6vw, 26px); margin: 0 0 6px; }
.coffee__lead { max-width: 560px; margin: 0 auto 18px !important; }
.amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; text-align: left; }
.amount {
  display: grid; gap: 3px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink); cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s;
  font: inherit; text-align: left;
}
.amount strong { font-family: var(--reading-font); font-size: 20px; color: var(--navy-2); font-weight: 600; }
[data-theme="dark"] .amount strong { color: var(--gold-2); }
.amount span { font-size: 12.5px; color: var(--slate); line-height: 1.4; }
.amount em { font-style: normal; font-size: 11.5px; color: var(--gold); }
.amount:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.amount.is-on { border-color: var(--gold); background: var(--gold-soft); }
.amount--custom { border-style: dashed; }
.customrow { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 0 0 14px; flex-wrap: wrap; }
.customrow .input { max-width: 180px; }
.coffee__hint { font-size: 12.5px !important; color: var(--slate) !important; margin: 0 0 14px !important; }
.coffee__pay { max-width: 340px; margin: 0 auto 18px; }
.coffee__pay.is-picked { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }
.coffee__secure { display: flex; gap: 7px; align-items: flex-start; justify-content: center; max-width: 520px; margin: 14px auto 0 !important; font-size: 12px !important; color: var(--slate) !important; line-height: 1.6 !important; }
.coffee__secure svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--gold); }

.payqr, .shareqr {
  display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2);
  margin: 0 auto 6px; max-width: 560px;
}
.payqr__frame { background: #fff; padding: 8px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.payqr__img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0; border-radius: 10px; }
.payqr__img img { width: 148px; height: 148px; object-fit: contain; border-radius: 8px; display: block; }
.payqr__copy { display: grid; gap: 4px; text-align: left; }
.payqr__copy strong { font-size: 14.5px; color: var(--ink); }
.payqr__copy span { font-size: 12.5px; color: var(--slate); line-height: 1.55; max-width: 240px; }
.payqr__copy .btn { justify-self: start; margin-top: 4px; }

.supcard--share .sharehead { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.sharehead__mark { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); background: var(--gold-soft); flex: none; }
.sharehead__mark svg { width: 19px; height: 19px; }
.sharehead h2 { font-family: var(--reading-font); font-weight: 400; font-size: clamp(20px, 2.4vw, 25px); margin: 0; }
.shareactions { display: flex; gap: 10px; margin: 18px 0 16px; flex-wrap: wrap; }
.support__fine { font-size: 11.5px !important; line-height: 1.65 !important; color: var(--slate-2) !important; border-top: 1px solid var(--line); padding-top: 14px; }

.sharemodal .textarea { width: 100%; min-height: 130px; font-size: 13.5px; line-height: 1.6; }
.sharegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.sharebtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; font: inherit; font-size: 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.sharebtn:hover { border-color: var(--gold); color: var(--gold); }
.sharebtn svg { width: 15px; height: 15px; }

.qrmodal { text-align: center; }
.qrmodal img { width: min(78vw, 380px); height: auto; background: #fff; padding: 12px; border-radius: 16px; }

.sitefoot {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
  margin-top: 26px; padding: 18px 12px 6px; border-top: 1px solid var(--line);
  color: var(--slate-2); font-size: 12px;
}
.sitefoot__brand { display: inline-flex; align-items: center; gap: 6px; color: var(--slate); font-weight: 600; }
.sitefoot__brand svg { width: 14px; height: 14px; color: var(--gold); }
.sitefoot__links { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.sitefoot__link { background: none; border: 0; padding: 0; font: inherit; color: var(--slate); cursor: pointer; }
.sitefoot__link:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.sitefoot__note { color: var(--slate-2); }

.supportpromo { text-align: center; padding: 10px 4px 16px; }
.supportpromo__icon { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); background: var(--gold-soft); margin-bottom: 8px; }
.supportpromo__icon svg { width: 24px; height: 24px; }
.supportpromo h3 { font-family: var(--reading-font); font-weight: 400; font-size: 21px; margin: 0 0 6px; }
.supportpromo p { margin: 0 auto 10px; max-width: 470px; color: var(--ink-2); line-height: 1.7; font-size: 14.5px; }
.supportpromo .hint { color: var(--slate); font-size: 12.5px; }

@media (max-width: 640px) {
  .support { padding-bottom: 32px; }
  .amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payqr { flex-direction: column; text-align: center; }
  .payqr__copy { text-align: center; }
  .payqr__copy .btn { justify-self: center; }
  .shareactions .btn { flex: 1 1 100%; }
}

.amount--static { cursor: default; }
.amount--static:hover { border-color: var(--line-2); transform: none; box-shadow: none; }
.qrsteps { max-width: 460px; margin: 16px auto 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.qrsteps strong { font-size: 13.5px; color: var(--ink); }
.qrsteps ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }

/* Small coffee button in the main top bar */
.coffeebtn { color: var(--gold); }
.coffeebtn:hover { color: var(--gold-2); background: var(--gold-soft); }
.coffeebtn svg { width: 18px; height: 18px; }
[data-theme="dark"] .coffeebtn:hover { background: rgba(227, 197, 139, .14); }

/* ========================================================================== 
   Images in the editor
   ========================================================================== */
.prose::after { content: ""; display: block; clear: both; }
.prose .imgfig { margin: 1.1em 0; max-width: 100%; border-radius: 4px; }
.prose .imgfig img { max-width: 100%; height: auto; display: block; }
.imgfig--center { display: block; text-align: center; }
.imgfig--center img { margin-left: auto; margin-right: auto; }
.imgfig--left { float: left; margin: .15em 1.1em .7em 0; }
.imgfig--right { float: right; margin: .15em 0 .7em 1.1em; }
.imgfig--inline { display: inline-block; vertical-align: middle; margin: .2em .7em; }
.imgfig--wrap.imgfig--center { float: left; margin: .15em 1.1em .7em 0; }
.imgfig figcaption { font-size: 12.5px; line-height: 1.5; color: var(--slate-2); font-style: italic; margin-top: 7px; text-align: center; }
.imgfig figcaption[hidden] { display: none; }
.imgfig--bordered img { box-shadow: 0 1px 2px rgba(10, 20, 35, .08); }
.imgfig.is-sel { position: relative; outline: 2px solid var(--gold); outline-offset: 5px; }
.imghandle {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gold); z-index: 4; touch-action: none;
}
.imghandle--nw { left: -9px; top: -9px; cursor: nwse-resize; }
.imghandle--ne { right: -9px; top: -9px; cursor: nesw-resize; }
.imghandle--sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.imghandle--se { right: -9px; bottom: -9px; cursor: nwse-resize; }
[data-theme="dark"] .imghandle { background: var(--navy); }

.imgtools {
  position: fixed; z-index: 62; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(1120px, calc(100vw - 20px));
  display: flex; flex-direction: column; gap: 6px; padding: 9px 11px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 20px 44px rgba(10, 20, 35, .26);
}
.imgtools[hidden] { display: none; }
.imgtools__row { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.imgtools__row--secondary { border-top: 1px solid var(--line); padding-top: 7px; }
.imgtools__title { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate-2); margin-right: 4px; white-space: nowrap; }
.imgtools__num { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--slate-2); white-space: nowrap; }
.imgtools__num input { width: 62px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); padding: 0 6px; font-size: 12px; }
.imgtools__select { height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 12px; padding: 0 6px; }
.imgtools__color { width: 34px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); padding: 2px; }
.imgtools__icon, .imgtools__btn {
  height: 30px; min-width: 30px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.imgtools__btn svg { width: 14px; height: 14px; }
.imgtools__icon { justify-content: center; padding: 0; font-size: 14px; }
.imgtools__icon svg { width: 15px; height: 15px; }
.imgtools__icon--flip svg { transform: scaleX(-1); }
.imgtools__icon:hover, .imgtools__btn:hover { background: var(--surface-2); }
.imgtools__icon.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--navy); }
.imgtools__btn--danger { color: #a33224; border-color: rgba(163, 50, 36, .35); }
.imgtools__sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; flex: none; }

.imgmenu {
  position: fixed; z-index: 500; width: 250px; padding: 8px; display: grid; gap: 4px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(10, 20, 35, .26);
}
.imgmenu__title { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate-2); padding: 4px 6px 6px; }
.imgmenu button { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.imgmenu button:hover { background: var(--surface-2); }
.imgmenu button svg { width: 17px; height: 17px; color: var(--gold); flex: none; }
.imgmenu__hint { margin: 4px 6px 2px; font-size: 11.5px; line-height: 1.5; color: var(--slate-2); }

.imgdialog { position: fixed; inset: 0; z-index: 520; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(7, 20, 39, .55); backdrop-filter: blur(3px); }
.imgdialog__panel { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-lg); }
.imgdialog__title { margin: 0 0 6px; font-family: var(--reading-font); font-size: 21px; font-weight: 500; }
.imgdialog__hint { margin: 0 0 12px; font-size: 13px; color: var(--slate-2); line-height: 1.55; }
.imgdialog__input { width: 100%; }
.imgdialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.imgcrop__stage { display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.imgcrop__stage img { max-width: 100%; max-height: 46vh; }
.imgcrop__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.imgcrop__field { display: grid; gap: 4px; font-size: 12px; color: var(--slate-2); }
.imgcrop__field input { width: 100%; }

/* ==========================================================================
   Continuous presentation
   ========================================================================== */
.present--doc { --p-size: clamp(18px, 1.3vw + 9px, 24px); }
.present__top {
  position: relative; display: flex; align-items: center; gap: 4px; flex: none; flex-wrap: nowrap;
  min-height: 52px; padding: 6px clamp(8px, 1.4vw, 16px); padding-top: calc(6px + env(safe-area-inset-top));
  padding-left: max(clamp(8px, 1.4vw, 16px), env(safe-area-inset-left));
  padding-right: max(clamp(8px, 1.4vw, 16px), env(safe-area-inset-right));
  border-bottom: 1px solid rgba(227, 197, 139, .3);
  background: linear-gradient(180deg, #142a49, #0b1b34); color: #f7f4ec;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}
.present__top .present__btn, .present__top .present__size { color: #f7f4ec; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
.present__top .present__btn:hover, .present__top .present__size:hover { background: rgba(255, 255, 255, .15); }
.present__top .present__clock { color: #f7f4ec; background: transparent; border-color: rgba(255, 255, 255, .22); }
.present__top .present__nowtitle { color: #fdfbf5; }
.present__top .present__nowmeta { color: rgba(247, 244, 236, .62); }
.present__top .present__btn--primary { color: #2a2008; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; }
.present__top .present__btn--primary:hover { background: linear-gradient(180deg, #efd39c, #d0a95f); }
.present__top::-webkit-scrollbar { height: 0; }
.present--doc .present__btn { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; font-weight: 700; flex: none; }
.present--doc [data-act="bigger"], .present--doc [data-act="smaller"] { font-size: 15px; font-weight: 800; }
.present__speedbtn { width: 42px !important; font-size: 11px !important; font-variant-numeric: tabular-nums; }
.present__exitdock {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 15px 0 12px; border-radius: 999px; border: 1px solid rgba(255, 183, 170, .5);
  background: rgba(11, 27, 52, .9); color: #f7f4ec; font: inherit; font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(3, 9, 18, .32); backdrop-filter: blur(10px);
  cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
}
.present__exitdock svg { width: 16px; height: 16px; flex: none; color: #ffb7aa; }
.present__exitdock:hover { background: #142a49; border-color: #ffb7aa; transform: translateY(-1px); }
.present__exitdock:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.present__exitdock kbd { font: inherit; font-size: 10px; line-height: 1; letter-spacing: .04em; padding: 4px 6px; border-radius: 5px; border: 1px solid rgba(247, 244, 236, .25); color: rgba(247, 244, 236, .75); background: rgba(255, 255, 255, .06); }
.present__btn--primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a2008; border-color: transparent; }
.present__btn.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--navy); }
.present--doc[data-theme="dark"] .present__btn.is-on { background: rgba(227, 197, 139, .22); color: var(--gold-2); }
.present__now { flex: 1 1 auto; min-width: 82px; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.present__nowtitle { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--p-ink); }
.present__nowmeta { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--p-muted); }
.present--doc .present__clock { font-size: 15px; padding: 4px 10px; background: transparent; border-color: var(--p-line-strong); }
.present__group { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.present__size {
  min-width: 52px; height: 34px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-ink);
  font-family: var(--ui-font); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.present__size:hover { background: var(--p-surface-2); }
.present__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; padding: 0; border: 0; pointer-events: none; background: var(--p-line); }
.present__bar i { display: block; height: 100%; width: 0; background: var(--p-gold); transition: width .2s linear; }
.present__pill {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--p-surface); border: 1px solid var(--p-line-strong); color: var(--p-ink);
  box-shadow: var(--shadow-lg); opacity: .72;
}
.present__pill:hover { opacity: 1; }
.present__pill[hidden] { display: none; }
.present__pill svg { width: 18px; height: 18px; }

.present__scroller { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-behavior: auto; overflow-anchor: none; }
.present__doc {
  --p-scale: 1;
  width: min(var(--p-width, 1120px), 100%); margin: 0 auto; box-sizing: border-box;
  padding: clamp(14px, 2.2vh, 24px) max(var(--p-edge, 20px), env(safe-area-inset-right)) clamp(92px, 12vh, 112px) max(var(--p-edge, 20px), env(safe-area-inset-left));
  padding-bottom: calc(clamp(92px, 12vh, 112px) + env(safe-area-inset-bottom));
  font-size: calc(var(--p-size, 20px) * var(--p-scale, 1)); line-height: var(--p-line, 1.7); color: var(--p-body);
  overflow-wrap: break-word;
  font-family: var(--reading-font);
}
.present__head { padding-bottom: clamp(12px, 1.8vh, 20px); border-bottom: 1px solid var(--p-line); margin-bottom: clamp(10px, 1.6vh, 18px); }
.present__title { font-family: inherit; font-weight: 400; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 6px; color: var(--p-head); }
/* Only the body text follows A− / A+. The title, the small label, section
   headings, the meta line and the presenter notes keep their set size. */
.present--doc .present__title { font-size: clamp(28px, 3.4vw, 42px); }
.present--doc .present__meta { font-size: 13px; }
.present--doc .present__h { font-size: clamp(20px, 2.3vw, 31px); }
.present--doc .present__notes { font-size: 14px; }
/* At very large sizes a heading is a flex row: without this its longest word sets a
   minimum width wider than a phone screen and the whole stage scrolls sideways. */
.present--doc .present__h { flex-wrap: wrap; }
.present--doc .present__kicker { flex-wrap: wrap; }
.present--doc .present__kicker > span { min-width: 0; overflow-wrap: anywhere; }
.present--doc .present__h > span { min-width: 0; overflow-wrap: anywhere; }
.present--doc .present__title { overflow-wrap: anywhere; }
.present--doc .present__kicker { font-size: 10.5px; }
.present--doc .present__resume p { font-size: 13px; }
.present--doc .present__end p { font-size: 13px; }
.present__meta { margin: 0; font-size: .82em; color: var(--p-muted); font-family: var(--ui-font); }
.present__sec { padding: 0 0 clamp(6px, 1vh, 12px); margin: 0 0 clamp(4px, .8vh, 8px); border-bottom: 1px solid var(--p-line); }
.present__sec:last-of-type { border-bottom: 0; }
.present__h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 .25em; font-family: inherit; font-weight: 400; font-size: 1.34em; line-height: 1.2; color: var(--p-head); }
.present__hnum { font-family: var(--ui-font); font-size: .46em; letter-spacing: .22em; color: var(--p-gold); flex: none; }
/* A− / A+ changes the body font size once. Paragraph rhythm is expressed in em
   from the document's own spacing, so it scales with the type exactly once and
   never multiplies a second time through browser zoom. */
.present--doc .present__body.prose { font-size: inherit; }
.present__body.prose { font-size: 1em; line-height: inherit; min-height: 0; }
.present__body.prose p, .present__body.prose > div { margin: var(--p-before, 0) 0 var(--p-after, .72em); }
.present__body.prose h1, .present__body.prose h2, .present__body.prose h3,
.present__body.prose h4, .present__body.prose h5, .present__body.prose h6 {
  margin: var(--p-h-before, .9em) 0 var(--p-h-after, .4em); line-height: 1.22;
}
.present__body.prose h1 { font-size: 1.55em; color: var(--p-head); }
.present__body.prose h2 { font-size: 1.34em; color: var(--p-head); }
.present__body.prose h3 { font-size: 1.14em; color: var(--p-gold); }
.present__body.prose h4 { font-size: 1.06em; color: var(--p-head); }
.present__body.prose h5 { font-size: .98em; color: var(--p-head); }
.present__body.prose h6 { font-size: .86em; color: var(--p-gold); }
.present__body.prose ul, .present__body.prose ol { padding-left: 1.3em; margin: var(--p-list-before, .35em) 0 var(--p-list-after, .8em); }
.present__body.prose li { margin-bottom: var(--p-li-gap, .26em); }
.present__body.prose li::marker { color: var(--p-gold); }
.present__body.prose mark, .present__body.prose .hl { background: linear-gradient(180deg, transparent 12%, rgba(227, 197, 139, .3) 12%); }
.present__body.prose blockquote { border-left-color: var(--p-gold); color: var(--p-body); margin: var(--p-before, .6em) 0 var(--p-after, .6em); padding: .1em 0 .1em 1em; }
.present__body.prose a { color: var(--p-gold); }
.present__body.prose .scripture {
  display: inline; padding: 0 .1em; border-radius: 3px; cursor: pointer;
  color: var(--p-gold); background: rgba(193, 154, 82, .14); border-bottom: 1px solid rgba(193, 154, 82, .45);
  line-height: inherit; font-size: inherit; vertical-align: baseline; white-space: normal;
}
.present__body.prose .scripture::after { content: none; }
.present__body.prose table { width: 100%; border-collapse: collapse; font-size: .95em; }
.present__body.prose td, .present__body.prose th { border: 1px solid var(--p-line-strong); padding: 6px 8px; }
.present__body.prose hr { border: 0; border-top: 1px solid var(--p-line-strong); margin: 1.2em 0; }
.present__body.prose img { max-width: 100%; height: auto; object-fit: contain; border-radius: 4px; cursor: zoom-in; }
.present__body.prose .imgfig { max-width: 100%; margin: 1.1em 0; }
.present__body.prose .imgfig figcaption { color: var(--p-muted); }
.present__notes { margin: .6em 0 0; padding: 7px 10px; border-left: 2px solid var(--p-gold); background: var(--p-strip); border-radius: 0 8px 8px 0; font-family: var(--ui-font); font-size: .74em; line-height: 1.55; color: var(--p-muted); }
.present__notes[hidden] { display: none; }
.present__notes b { display: block; font-size: .9em; letter-spacing: .14em; text-transform: uppercase; color: var(--p-gold); margin-bottom: 4px; }
.present__notes p { margin: 0; white-space: pre-wrap; }
.present__end { padding: clamp(16px, 3vh, 30px) 0 32px; text-align: center; color: var(--p-muted); border-top: 1px solid var(--p-line); margin-top: 6px; }
.present__end .present__kicker { justify-content: center; }
.present__end p { font-size: .95em; margin: 0 0 14px; }
.present__resume { margin-top: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--p-line-strong); background: var(--p-surface); font-family: var(--ui-font); }
.present__resume[hidden] { display: none; }
.present__resume p { margin: 0 0 10px; font-size: 13px; color: var(--p-body); }
.present__resumebtns { display: flex; gap: 8px; flex-wrap: wrap; }

.present__toc {
  position: fixed; z-index: 6; top: var(--p-bar-h, 52px); right: 0; bottom: 0; width: min(330px, 88vw);
  display: flex; flex-direction: column; gap: 8px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  padding-top: calc(18px + env(safe-area-inset-top));
  background: var(--p-panel-bg); border-left: 1px solid var(--p-line-strong); box-shadow: -20px 0 50px rgba(0, 0, 0, .3);
}
.present__toc[hidden] { display: none; }
.present__tochead { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--p-gold); }
.present__toclist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.present__tocitem { display: flex; gap: 10px; align-items: baseline; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--p-body); font-size: 13px; text-align: left; line-height: 1.35; }
.present__tocitem span { font-size: 10px; letter-spacing: .1em; color: var(--p-muted); flex: none; }
.present__tocitem:hover { background: var(--p-surface-2); }
.present__tocitem.is-on { background: var(--p-surface-2); color: var(--p-head); }
.present__tocrow { display: flex; align-items: center; gap: 2px; }
.present__tocrow .present__tocitem { flex: 1; min-width: 0; }
.present__tocitem.is-done { color: var(--p-muted); }
.present__tocitem.is-done span { text-decoration: line-through; }
.present__tocdone { flex: none; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--p-muted); font-size: 13px; opacity: .45; cursor: pointer; }
.present__tocdone:hover { opacity: 1; border-color: var(--p-line); }
.present__tocdone.is-on { opacity: 1; color: var(--gold, #c9a227); }
.present__tocfoot { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--p-line); padding-top: 10px; }
.present__tocbtn { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-body); font-size: 12px; }

.present__panel {
  position: fixed; z-index: 7; top: var(--p-bar-h, 52px); right: 0; bottom: 0;
  width: min(390px, 94vw); display: flex; flex-direction: column;
  background: var(--p-panel-bg); color: var(--p-ink); border-left: 1px solid var(--p-line-strong);
  box-shadow: -18px 0 45px rgba(0, 0, 0, .24);
}
.present__panel[hidden] { display: none; }
.present__panelhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--p-line); }
.present__panelhead b { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--p-gold); }
.present__panelbody { flex: 1; overflow-y: auto; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 5px; align-content: start; }
.present__setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 6px 0; border-bottom: 1px solid var(--p-line); font-size: 12.5px; color: var(--p-body); }
.present__setrow > span { flex: 0 0 auto; max-width: 46%; }
.present__setrow select { max-width: 58%; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid var(--p-line-strong); background: var(--p-input-bg); color: var(--p-ink); padding: 0 7px; font-size: 12px; }
.present__setrow--range { flex-wrap: wrap; }
.present__setrow--range input[type="range"] { flex: 1 1 120px; accent-color: var(--p-gold); min-width: 100px; }
.present__setrow--range output { min-width: 43px; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--p-muted); }
.present__themegrid { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.present__themebtn { height: 28px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-body); font-size: 10.5px; }
.present__themebtn[aria-pressed="true"] { border-color: var(--p-gold); background: var(--gold-soft); color: var(--navy); }
.present__switch { min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--p-line-strong); background: var(--p-surface); color: var(--p-body); font-size: 11px; }
.present__switch[aria-pressed="true"] { border-color: var(--p-gold); background: var(--gold-soft); color: var(--navy); }
.present__setactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.present__savednote { margin: 6px 0 4px; font-size: 11px; line-height: 1.5; color: var(--p-muted); }
.present__empty { margin: 10px 0; font-size: 12.5px; line-height: 1.6; color: var(--p-muted); }
.present__biblecontrols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.present__biblecontrols label { display: grid; gap: 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--p-muted); }
.present__biblecontrols label:first-child:nth-last-child(3) { grid-column: 1 / -1; }
.present__biblecontrols select { width: 100%; height: 33px; border-radius: 8px; border: 1px solid var(--p-line-strong); background: var(--p-input-bg); color: var(--p-ink); padding: 0 7px; font-size: 12px; }
.present__bibletitle { margin: 12px 0 4px; font-family: var(--reading-font); font-size: 20px; color: var(--p-head); }
.present__verses { display: grid; gap: 8px; font-family: var(--reading-font); font-size: 16px; line-height: 1.55; color: var(--p-body); }
.present__verses p { margin: 0; }
.present__verses p > span { font-family: var(--ui-font); font-size: 9px; font-weight: 700; color: var(--p-gold); vertical-align: super; margin-right: 4px; }
.present__reflist { display: grid; gap: 6px; }
.present__refitem { display: grid; gap: 3px; text-align: left; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--p-line); background: var(--p-surface); color: var(--p-body); }
.present__refitem b { font-size: 12.5px; color: var(--p-head); }
.present__refitem span { font-size: 12px; line-height: 1.45; color: var(--p-muted); }
.present__refitem:hover { border-color: var(--p-gold); }

@media (max-width: 1100px) {
  .present__top { gap: 3px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .present__top [data-act="toc"], .present__top [data-act="hide"] { display: none; }
}
@media (max-width: 360px) {
  .present__top [data-act="references"] { display: none; }
}
@media (max-width: 640px) {
  .present__panel { width: 100%; }
  .present__setrow { font-size: 12px; }
  .present__top { flex-wrap: wrap; overflow-x: hidden; align-content: center; }
  .present__now { flex: 1 1 74px; }
  .present__top .present__divider { display: none; }
  .present__top [data-act="toc"], .present__top [data-act="hide"] { display: none; }
  .present__doc { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .present__exitdock { left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); min-height: 46px; }
}

.present__light { position: fixed; inset: 0; z-index: 440; display: flex; flex-direction: column; background: rgba(3, 9, 18, .96); touch-action: none; }
.present__lightbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
.present__lightbar .present__btn { width: 38px; height: 38px; }
.present__lightzoom { font-size: 12px; color: rgba(255, 255, 255, .8); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.present__lightstage { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 6px; }
.present__lightstage img { max-width: 96vw; max-height: 84vh; transform-origin: center center; transition: transform .08s linear; user-select: none; -webkit-user-drag: none; }

@media (max-width: 760px) {
  :root { --editor-sticky-top: 58px; }
  .sec { scroll-margin-top: 126px; }
  /* The text-size controls must stay within reach on a phone or tablet:
     someone who needs larger type is most likely holding one of these. */
  .present--doc .present__group { display: inline-flex; }
  .present__nowmeta { display: none; }
  .present--doc .present__clock { font-size: 14px; padding: 3px 8px; }
  .present__top { gap: 4px; }
  .present--doc .present__btn { width: 38px; height: 38px; }
  .present--doc .present__size { height: 38px; min-width: 48px; }
  .present__doc { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .present__exitdock { left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); min-height: 46px; }
  .imgtools__num span { display: none; }
  .imgcrop__grid { grid-template-columns: 1fr; }
}

/* Room for the floating image toolbar above the last section */
.editor { padding-bottom: 120px; }

/* Narrow screens: the editor stacks, the section rail turns into a strip and
   nothing may scroll sideways. */
@media (max-width: 1080px) {
  .editor { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .editor--paged .editor__main { width: 100%; min-height: 0; padding: 18px 16px 28px; box-shadow: 0 8px 22px rgba(10, 20, 35, .1); }
  .editor__nav { position: static; display: block; }
  .editor--navhidden .editor__nav { display: none !important; }
  .editor__nav [data-role="nav"] { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .editor__nav .secnav { width: auto; flex: none; max-width: 220px; }
  .editor__navfoot { display: flex; align-items: center; gap: 10px; }
  .editor > div { min-width: 0; }
  .docmeta, .docmeta__row { min-width: 0; max-width: 100%; }
  .docmeta__title { min-width: 0; }
  .docmeta__row .select, .docmeta__row .input { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .sec, .sec__head, .sec__body, .prose { min-width: 0; max-width: 100%; }
  .sec__head { flex-wrap: wrap; }
}
/* The reading column is controlled separately from text size. */
.present__doc { width: min(var(--p-width, 1120px), 100%); }

/* App updates — full release history in Settings → About */
.updates { display: grid; gap: 12px; max-height: 560px; overflow-y: auto; padding: 2px 6px 2px 0; }
.updates__row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.updates__row:first-child { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 22%, transparent); }
.updates__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.updates__ver { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.updates__latest { font-style: normal; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 1px; }
.updates__when { font-size: 11.5px; color: var(--slate-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.updates__items { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: var(--slate); }
.updates__items li { margin-bottom: 3px; }
.updates__items li::marker { color: var(--gold); }
@media (max-width: 600px) {
  .updates { max-height: none; }
  .updates__head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---------- cloud storage & backups ---------- */
.cloudhost { display: grid; gap: 4px; }
.cloud { display: grid; gap: 22px; }
.cloud__intro { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.cloud__title { font-family: var(--reading-font); font-weight: 400; font-size: 20px; margin: 0 0 4px; }
.cloud__sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); margin: 0 0 10px; }
.cloudgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 12px; }
.cloudcard { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 14px 15px 13px; display: grid; gap: 12px; align-content: start; }
.cloudcard__top { display: flex; align-items: flex-start; gap: 11px; }
.cloudlogo { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--brand, var(--navy)); border: 1.5px solid var(--brand, var(--navy)); background: var(--surface); }
.cloudcard__id { flex: 1; min-width: 0; }
.cloudcard__id h4 { margin: 0; font-size: 14.5px; }
.cloudcard__note { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--slate-2); }
.cloudcard__meta { margin: 0; display: grid; gap: 6px; }
.cloudcard__meta > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.cloudcard__meta dt { color: var(--slate-2); margin: 0; }
.cloudcard__meta dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.cloudcard__meta--wide { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface-2); }
.cloudcard__policy { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--warn); background: var(--warn-soft); border-radius: var(--r-sm); padding: 7px 9px; }
.cloudcard__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.cloudcard__actions .btn { flex: 1 1 auto; justify-content: center; }
.cloud__privacy { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 11px 13px; background: var(--surface-2); }
.cloud__privacy p { margin: 0; font-size: 11.8px; line-height: 1.55; color: var(--slate); }
.cloud__privacy p + p { margin-top: 6px; }
.cloudsec { display: grid; gap: 8px; }
.modegrid { display: grid; gap: 8px; }
.modecard { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; background: var(--surface); cursor: pointer; }
.modecard.is-disabled { opacity: .62; cursor: not-allowed; }
.modecard input { margin-top: 2px; accent-color: var(--gold); }
.modecard__body { display: grid; gap: 2px; flex: 1; }
.modecard__body strong { font-size: 13.5px; }
.modecard__body span { font-size: 11.8px; line-height: 1.5; color: var(--slate-2); }
.cloudrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cloudrow > label { font-size: 13px; font-weight: 600; min-width: 150px; }
.cloudrow .select { max-width: 280px; }
.cloudrow--stack { align-items: flex-start; }
.cloudchecks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checkline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.checkline input { accent-color: var(--gold); }
.cloud__env { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; font-size: 12px; }
.cloud__env .mono { font-size: 11px; color: var(--slate-2); }
@media (max-width: 560px) {
  .cloudcard__meta > div { flex-direction: column; gap: 1px; }
  .cloudcard__meta dd { text-align: left; }
}

/* ---------- revision history ---------- */
.revlist { display: grid; gap: 10px; }
.revrow { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 13px; background: var(--surface); display: grid; gap: 7px; }
.revrow__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.revrow__when { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.revrow__meta { font-size: 11.5px; color: var(--slate-2); }
.revrow__title { margin: 0; font-weight: 600; font-size: 13.5px; }
.revrow__snippet { margin: 0; font-size: 12px; line-height: 1.55; color: var(--slate-2); }
.revrow__actions { display: flex; gap: 7px; flex-wrap: wrap; }
.revempty { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }

/* ---------- trash ---------- */
.trashlist { display: grid; gap: 10px; }
.trashrow {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white);
}
.trashrow__main { flex: 1 1 260px; min-width: 0; display: grid; gap: 4px; }
.trashrow__main strong { font-family: var(--reading-font); font-weight: 500; font-size: 17px; overflow-wrap: anywhere; }
.trashrow__actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .trashrow { align-items: flex-start; }
  .trashrow__actions { width: 100%; }
}
/* Backup restore preview: account, date and size before anything is replaced. */
.backupmeta { display: grid; gap: 7px; margin: 0; }
.backupmeta > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 13px; }
.backupmeta dt { color: var(--slate-2); }
.backupmeta dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; }

/* Offline status chip (Improvement 06) */
.netchip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #8a6412; background: rgba(193, 154, 82, .18);
}
.netchip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
[data-theme="dark"] .netchip { color: var(--gold-2); background: rgba(193, 154, 82, .22); }
@media (max-width: 420px) {
  .netchip { padding: 4px 8px; font-size: 10.5px; }
  .topbar__actions { gap: 4px; }
  .topbar__actions .langbtn, .topbar__actions .coffeebtn { display: none; }
}

/* ---------- notebooks (Improvement 46) ---------- */
.nbcard__top { display: flex; align-items: flex-start; gap: 12px; }
.nbcard__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none;
  background: color-mix(in srgb, var(--nb, #14263e) 13%, transparent); border: 1px solid color-mix(in srgb, var(--nb, #14263e) 28%, transparent); }
.nbcard__head { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nbcard__cat { font-size: 11px; color: var(--slate-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbicons { flex-wrap: wrap; gap: 6px; }
.nbpick { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.nbpick:hover { border-color: var(--line-2); background: var(--surface-2); }
.nbpick--on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(193, 154, 82, .16); }

.notebook { display: grid; grid-template-columns: 274px minmax(0, 1fr); gap: 24px; align-items: start; }
.notebook__main { min-width: 0; }
.notebook__pages { position: sticky; top: 84px; display: flex; flex-direction: column; min-width: 0; max-width: 100%; max-height: calc(100dvh - 140px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.notebook__pageshead { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.notebook__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none;
  background: color-mix(in srgb, var(--nb, #14263e) 13%, transparent); border: 1px solid color-mix(in srgb, var(--nb, #14263e) 28%, transparent); }
.notebook__heading { flex: 1; min-width: 0; display: grid; gap: 1px; }
.notebook__heading strong { font-family: var(--reading-font); font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notebook__heading span { font-size: 11px; color: var(--slate-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notebook__pagelist { flex: 1; min-width: 0; overflow-y: auto; padding: 6px; min-height: 60px; }
.notebook__pagesfoot { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-top: 1px solid var(--line); }
.notebook__pagesfoot .ghostbtn { font-size: 12px; padding: 7px 8px; border-radius: 8px; }

.nbpage { display: flex; align-items: center; gap: 2px; border-radius: 9px; padding-left: calc(var(--depth, 0) * 14px); transition: background .15s; }
.nbpage:hover { background: var(--surface-2); }
.nbpage--on { background: var(--gold-soft); }
.nbpage.is-drop { outline: 2px dashed var(--gold); outline-offset: -2px; }
.nbpage.is-dragging { opacity: .45; }
.nbpage__open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; font-size: 13px; color: var(--ink-2); }
.nbpage--on .nbpage__open { color: var(--ink); font-weight: 600; }
.nbpage__mark { width: 14px; flex: none; font-size: 11px; color: var(--gold); text-align: center; }
.nbpage__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbpage__menu { border: 0; background: transparent; color: var(--slate-2); padding: 3px 7px; border-radius: 6px; font-size: 14px; line-height: 1; }
.nbpage__menu:hover { background: var(--pearl-2); color: var(--ink); }

/* The notebook page editor drops the outline-only chrome. */
.editor--page { grid-template-columns: minmax(0, 1fr); padding-bottom: 40px; }
.editor--page .docmeta { padding: 16px 18px; }
.editor--page > div, .editor--page .toolbar, .editor--page .toolbar__panels, .editor--page .toolbar__panel { min-width: 0; max-width: 100%; }
.editor--page .toolbar__select { max-width: 118px; }
.sec--page { overflow: visible; }
.sec--page .toolbar { border-radius: var(--radius) var(--radius) 0 0; }
.pagefiles { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pagefiles__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pagefiles__title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-2); }
.pagefiles__list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.pagefile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.pagefile__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--navy-3); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .pagefile__name { color: var(--gold-2); }
.pagefile__size { flex: none; font-size: 11px; color: var(--slate-2); }
.pagefiles .hint { font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .notebook { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .notebook__pages { position: static; max-height: none; }
  .notebook__pagelist { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px; scrollbar-width: none; }
  .notebook__pagelist::-webkit-scrollbar { display: none; }
  .nbpage { flex: none; padding-left: 0; }
  .nbpage__open { width: auto; max-width: 230px; }
  .notebook__pagesfoot { justify-content: space-between; }
  .nbpage.is-drop { outline-offset: -2px; }
}
@media (max-width: 520px) {
  .notebook__pageshead { padding: 10px; }
  .notebook__pagesfoot .ghostbtn { flex: 1; justify-content: center; }
  .nbpage__open { max-width: 170px; }
  .nbcard__icon { width: 36px; height: 36px; font-size: 17px; }
}

/* ---------- home dashboard ---------- */
.home { display: flex; flex-direction: column; gap: 26px; }
.homehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.homehead__eyebrow { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate-2); }
.homehead h1 { font-family: var(--reading-font); font-weight: 400; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.015em; }
.homehead p { margin: 6px 0 0; color: var(--slate); font-size: 13.5px; max-width: 52ch; }
.homeblock { display: flex; flex-direction: column; }
.homeblock__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.homeblock__head h2 { font-family: var(--reading-font); font-weight: 400; font-size: 19.5px; letter-spacing: -.01em; }
.homelink { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--slate); padding: 4px 2px; border-radius: 6px; }
.homelink:hover { color: var(--ink); }
.homelink svg { width: 14px; height: 14px; }
.homecard { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.homecard--hero { padding: 24px; border: 0; border-radius: var(--radius); background: linear-gradient(135deg, #14263e 0%, #1d3550 62%, #24405e 100%); color: #f6f2e8; box-shadow: var(--shadow-md); }
.homecard__eyebrow { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #d9bd8b; }
.homecard__title { margin: 0 0 8px; font-family: var(--reading-font); font-weight: 400; font-size: clamp(22px, 2.7vw, 31px); line-height: 1.2; color: #f8f4ea; word-break: break-word; }
.homecard--hero .hint { color: rgba(246, 242, 232, .74); }
.homecard--hero .btn--primary { background: var(--gold); border-color: var(--gold); color: #172a44; }
.homecard--hero .btn--primary:hover { background: #efcb8d; border-color: #efcb8d; }
.homecard--hero .btn:not(.btn--primary) { background: transparent; border-color: rgba(246, 242, 232, .34); color: #f6f2e8; }
.homecard--hero .btn:not(.btn--primary):hover { border-color: rgba(246, 242, 232, .6); background: rgba(255, 255, 255, .06); }
.homeactions { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 10px; }
.homeaction { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .15s; }
.homeaction:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.homeaction__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--pearl-2); color: var(--navy); }
[data-theme="dark"] .homeaction__icon { background: var(--surface-2); color: var(--gold-2); }
.homeaction__icon svg { width: 18px; height: 18px; }
.homeaction__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.homeaction__main strong { font-size: 13.5px; }
.homeaction__main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--slate-2); }
.homerows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.homerows > li { min-width: 0; }
.homerow { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 10px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.homerow:hover { border-color: var(--line-2); background: var(--surface-2); }
.homerow__mark { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--pearl-2); color: var(--slate-2); }
[data-theme="dark"] .homerow__mark { background: var(--surface-2); }
.homerow__mark svg { width: 16px; height: 16px; }
.homerow__main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.homerow__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.homerow__main span { font-size: 11.5px; color: var(--slate-2); }
.homerow__go { flex: none; display: flex; color: var(--slate-2); }
.homerow__go svg { width: 15px; height: 15px; }
.homerow--edit { gap: 8px; border-style: dashed; background: transparent; }
.homerow__check { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; cursor: pointer; }
.homerow__check input { width: 16px; height: 16px; accent-color: var(--navy); }
.homerow__spacer { flex: 1; }
.homelist { display: grid; gap: 8px; margin-top: 4px; }
.homecard--status { display: grid; gap: 0; padding: 4px 18px; }
.statusrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.statusrow:last-child { border-bottom: 0; }
.statusrow__label { flex: 0 0 120px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-2); }
.statusrow .hint { flex: 1; min-width: 0; font-size: 12px; }
.statusrow .badge { flex: none; }
@media (max-width: 760px) {
  .home { gap: 22px; }
  .homehead { align-items: flex-start; }
  .homehead .inline { width: 100%; }
  .homehead .inline .btn { flex: 1; justify-content: center; }
  .homeaction { padding: 11px 12px; }
}
@media (max-width: 560px) {
  .homeactions { grid-template-columns: 1fr 1fr; }
  .homecard--hero { padding: 19px; }
  .statusrow__label { flex-basis: 100%; }
  .homerow { padding: 10px 11px; gap: 10px; }
  .homecard--status { padding: 4px 13px; }
}
@media (max-width: 380px) {
  .homeactions { grid-template-columns: 1fr; }
}

/* ---------- quick capture & inbox ---------- */
.inbox { display: flex; flex-direction: column; gap: 16px; }
.inboxlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inboxrow { display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.inboxrow:hover { border-color: var(--line-2); }
.inboxrow__mark { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--pearl-2); font-size: 17px; }
[data-theme="dark"] .inboxrow__mark { background: var(--surface-2); }
.inboxrow__main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inboxrow__type { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.inboxrow__text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.inboxrow__meta { font-size: 11.5px; color: var(--slate-2); }
.inboxrow__actions { flex: none; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.inboxrow__actions .iconbtn { color: var(--slate-2); }
.inboxrow__actions .iconbtn:hover { color: var(--ink); }
.caplist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.capfile { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 10px; border: 1px dashed var(--line); border-radius: 9px; font-size: 12.5px; }
.capfile span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .inboxrow { flex-wrap: wrap; }
  .inboxrow__actions { width: 100%; justify-content: flex-start; border-top: 1px dashed var(--line); padding-top: 7px; }
}

/* ---------- personal study center ---------- */
.study { display: flex; flex-direction: column; gap: 18px; }
.studystats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.studystat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); display: grid; gap: 2px; min-width: 0; }
.studystat strong { font-size: 24px; line-height: 1.15; color: var(--navy); }
[data-theme="dark"] .studystat strong { color: var(--gold-2); }
.studystat span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.studygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.studygrid--topic { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.studytopic { display: flex; flex-direction: column; gap: 7px; min-width: 0; text-align: left; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s; }
.studytopic:hover { transform: translateY(-1px); border-color: var(--line-2); }
.studytopic--new { justify-content: center; align-items: flex-start; border-style: dashed; background: transparent; box-shadow: none; }
.studytopic__plus { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--pearl-2); color: var(--navy); }
.studytopic__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.studytopic__top h3 { margin: 0; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studytopic__mark { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.studytopic__mark svg { width: 18px; height: 18px; }
.studytopic__desc { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--slate); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.studytopic__counts { display: flex; flex-wrap: wrap; gap: 5px; font-size: 11px; color: var(--slate-2); }
.studytopic__counts span { background: var(--pearl-2); border-radius: 999px; padding: 2px 8px; }
[data-theme="dark"] .studytopic__counts span { background: var(--surface-2); }
.studytopic__foot { margin-top: auto; font-size: 11px; color: var(--slate-2); }
.studyblock { display: grid; gap: 6px; }
.studymeta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; color: var(--slate-2); }
.studymeta .spacer { flex: 1; }
.homelink.danger { color: #b3261e; }
.studytags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chip--static { cursor: default; }
.studypanel { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.studypanel--wide { grid-column: 1 / -1; }
.studypanel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.studypanel__head h2 { margin: 0; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-2); }
.studynotes { min-height: 160px; }
.studylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.studyitem { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.studyitem:last-child { border-bottom: 0; padding-bottom: 0; }
.studyitem__main { display: grid; gap: 3px; min-width: 0; }
.studyitem__note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--slate); }
.studyitem__actions { display: flex; gap: 2px; flex: none; }
.studyitem__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studyref { padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--navy); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .studyref { color: var(--gold-2); }
.studyquestion { display: grid; gap: 6px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.studyquestion:last-child { border-bottom: 0; }
.studyquestion__head { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.studyquestion__head input { margin-top: 3px; accent-color: var(--navy); }
.studyquestion--done .studyquestion__head span { color: var(--slate-2); text-decoration: line-through; }
.studyanswer { min-height: 54px; font-size: 13px; }
.studysessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.studysession { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.studysession:last-child { border-bottom: 0; }
.studysession__minutes { flex: none; width: 52px; text-align: center; font-size: 17px; font-weight: 700; color: var(--navy); }
[data-theme="dark"] .studysession__minutes { color: var(--gold-2); }
.studysession__minutes small { display: block; font-size: 9.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.studysession__main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.studysession__main strong { font-size: 13px; }
.studysession__main span { font-size: 11.5px; color: var(--slate-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homestudy { display: grid; gap: 8px; }
.homestudystats { display: flex; flex-wrap: wrap; gap: 8px; }
.homestudystats span { padding: 5px 11px; border-radius: 999px; background: var(--pearl-2); font-size: 12px; color: var(--slate-2); }
[data-theme="dark"] .homestudystats span { background: var(--surface-2); }
.homestudystats strong { font-size: 14px; color: var(--ink); }
@media (max-width: 860px) { .studygrid--topic { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .studystats { grid-template-columns: 1fr 1fr; } .studygrid { grid-template-columns: minmax(0, 1fr); } }

/* Narrow editor chrome: keep the document title readable and the section
   heading from squeezing its timing and menu off the row. */
@media (max-width: 480px) {
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .topbar__actions { gap: 4px; }
  .topbar__actions .btn--primary { width: 34px; min-width: 34px; padding: 0; justify-content: center; }
  .sec__head { flex-wrap: wrap; row-gap: 6px; }
  .sec__title { min-width: 120px; }
}
@media (max-width: 420px) {
  .topbar #savechip { display: none; }
}
@media (max-width: 360px) {
  .topbar__actions [data-act="capture"] { display: none; }
}
.editor--navhidden.editor--paged .editor__main { width: 100%; }

/* Editable document title and section-heading styling */
.docmeta__titlewrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.docmeta__titlewrap .docmeta__title { flex: 1; min-width: 0; }
.title-style-btn, .sec__style {
  flex: none; width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--slate-2);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.title-style-btn:hover, .sec__style:hover { border-color: var(--gold); color: var(--ink); }
.sec__style { width: 26px; height: 26px; font-size: 10px; }
.titlemenu {
  position: fixed; z-index: 500; width: 286px; max-height: min(78vh, 600px);
  overflow-y: auto; display: grid; gap: 10px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(10, 20, 35, .24);
}
.titlemenu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.titlemenu__head strong { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-2); }
.titlemenu__close { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--slate-2); font-size: 17px; line-height: 1; }
.titlemenu__close:hover { background: var(--pearl-2); color: var(--ink); }
.titlemenu__field { display: grid; gap: 5px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.titlemenu__field select { width: 100%; height: 32px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 0 8px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.titlemenu__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-2); }
.titlemenu__toggles { display: flex; gap: 5px; }
.titlemenu__toggle { width: 34px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; }
.titlemenu__toggle.is-on { border-color: var(--gold); background: var(--gold-soft, rgba(201, 162, 39, .16)); color: var(--navy); }
[data-theme="dark"] .titlemenu__toggle.is-on { color: var(--gold-2); }
.titlemenu__colourow { display: flex; align-items: center; gap: 8px; }
.titlemenu__colourow input[type="color"] { width: 44px; height: 30px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.titlemenu__link { border: 0; background: none; color: var(--navy-3); font-size: 11px; text-align: left; padding: 0; }
[data-theme="dark"] .titlemenu__link { color: var(--gold-2); }
.titlemenu__reset { height: 31px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--slate); font-size: 11px; }
.titlemenu__reset:hover { border-color: var(--gold); color: var(--ink); }
@media (max-width: 480px) {
  .sec__style { width: 24px; height: 24px; }
  .title-style-btn { width: 28px; height: 28px; }
}

/* ---------- assignment planner ---------- */
.planner { max-width: 1420px; margin: 0 auto; padding-bottom: 48px; }
.planner-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.planner-eyebrow { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0 0 5px; }
.planner-head h1 { font-family: var(--reading-font); font-size: clamp(30px, 4vw, 42px); line-height: 1.05; margin: 0 0 6px; color: var(--ink); }
.planner-sub { color: var(--slate); font-size: 13.5px; line-height: 1.5; margin: 0; }
.planner-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.planner-stats > span { min-width: 112px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--slate); font-size: 11.5px; }
.planner-stats b { display: block; font-family: var(--reading-font); font-size: 24px; line-height: 1; color: var(--ink); margin-bottom: 3px; }
.planner-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.planner-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.planner-toolbar__right { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.planner-heading { font-family: var(--reading-font); color: var(--ink); font-size: 14px; font-weight: 600; min-width: 128px; padding: 0 5px; }
.planner-navgroup { display: inline-flex; align-items: center; gap: 2px; }
.planner-navgroup .iconbtn { width: 30px; height: 30px; font-size: 18px; line-height: 1; }
.planner-filter select { max-width: 155px; }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 350px); gap: 16px; align-items: start; }
.planner-main { min-width: 0; }
.planner-detail { position: sticky; top: calc(var(--editor-sticky-top, 58px) + 12px); max-height: calc(100vh - var(--editor-sticky-top, 58px) - 24px); overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 15px; box-shadow: 0 8px 28px rgba(11, 27, 52, .05); }
.planner-detail__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.planner-detail__top .iconbtn { margin-left: auto; }
.planner-detail__cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--gold)) 12%, transparent); color: var(--cat, var(--gold)); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.planner-detail__cat::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.planner-detail h2 { font-family: var(--reading-font); font-size: 23px; line-height: 1.18; color: var(--ink); margin: 0 0 4px; overflow-wrap: anywhere; }
.planner-detail__date { color: var(--slate); font-size: 12.5px; margin: 0 0 12px; }
.planner-detail__line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.planner-detail__line span { color: var(--slate-2); }
.planner-detail__line b { color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.planner-map { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 2px; font-size: 12px; font-weight: 600; color: var(--gold); text-decoration: none; }
.planner-map:hover { text-decoration: underline; }
.planner-badge { display: inline-flex; align-items: center; width: fit-content; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--slate); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.planner-badge--prep { background: rgba(193, 154, 82, .12); color: #8a651f; }
.planner-badge--overdue { background: rgba(163, 50, 36, .12); color: #a33224; }
.planner-badge--done { background: rgba(47, 107, 94, .12); color: #2f6b5e; }
.planner-badge--ok { background: rgba(47, 107, 94, .12); color: #2f6b5e; }
.planner-conflict, .planner-travel, .planner-complete, .planner-notes { margin: 12px 0; padding: 10px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; }
.planner-conflict { border-color: rgba(163, 50, 36, .32); background: rgba(163, 50, 36, .06); color: var(--ink); }
.planner-conflict b, .planner-travel b, .planner-complete b, .planner-notes b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); margin-bottom: 4px; }
.planner-conflict span, .planner-travel span, .planner-complete span { display: block; margin-top: 3px; color: var(--ink); }
.planner-conflict p, .planner-complete p, .planner-notes p { margin: 5px 0 0; color: var(--slate); line-height: 1.5; white-space: pre-wrap; }
.planner-conflict p { color: var(--slate); font-size: 11px; }
.planner-actions { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.planner-actions .btn { min-height: 32px; }
.planner-prep { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.planner-prep__head, .planner-checklist__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.planner-prep h3, .planner-checklist__head h3 { margin: 0; font-size: 13px; color: var(--ink); }
.planner-prep__status { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.planner-prep__status .chip { font-size: 10px; padding: 5px 8px; }
.planner-checklist { margin-top: 10px; }
.planner-checklist__head > span { font-size: 11px; color: var(--slate); }
.planner-check { display: flex; align-items: center; gap: 7px; padding: 6px 0; font-size: 12px; color: var(--ink); cursor: pointer; }
.planner-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); flex: none; }
.planner-check span { line-height: 1.4; }
.planner-check--custom { flex-wrap: wrap; }
.planner-check--custom .input { width: 88px; min-height: 30px; padding: 4px 7px; }
.planner-addrow { display: flex; gap: 5px; margin-top: 6px; }
.planner-addrow .input { min-height: 32px; font-size: 12.5px; }
.planner-notes { border-color: var(--line-strong); background: var(--surface); }
.planner-calendar { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.planner-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.planner-weekdays span { padding: 8px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-2); text-align: center; }
.planner-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.planner-day { position: relative; min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .12s; }
.planner-day:nth-child(7n) { border-right: 0; }
.planner-day:hover { background: var(--surface-2); }
.planner-day.is-outside { background: color-mix(in srgb, var(--surface-2) 60%, transparent); opacity: .62; }
.planner-day.is-today .planner-day__num { background: var(--gold); color: #1a1205; }
.planner-day.is-selected { box-shadow: inset 0 0 0 2px var(--gold); background: rgba(193, 154, 82, .07); }
.planner-day__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.planner-day__count { position: absolute; right: 6px; top: 7px; font-size: 9px; color: var(--slate-2); }
.planner-dot { display: flex; gap: 4px; align-items: center; margin: 2px 0; padding: 2px 3px; border-radius: 4px; color: var(--ink); font-size: 10px; line-height: 1.3; overflow: hidden; background: color-mix(in srgb, var(--dot) 10%, transparent); }
.planner-dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--dot); flex: none; }
.planner-dot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-more { display: block; font-size: 9px; color: var(--slate-2); padding-left: 3px; }
.planner-daylist { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.planner-daylist h3 { font-family: var(--reading-font); font-size: 16px; margin: 0 0 7px; color: var(--ink); }
.planner-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.planner-weekday { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.planner-weekday.is-today { border-color: var(--gold); }
.planner-weekday__head { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4px; padding: 7px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.planner-weekday__head b { font-size: 10.5px; }
.planner-weekday__head span { font-size: 10px; color: var(--slate-2); }
.planner-weekday__list { padding: 5px; display: grid; gap: 4px; }
.planner-weekday__list .planner-card { padding: 7px 7px 7px 9px; }
.planner-weekday__list .planner-card__main strong { font-size: 11px; }
.planner-weekday__list .planner-card__meta, .planner-weekday__list .planner-card__cat { font-size: 9.5px; }
.planner-agenda, .planner-list, .planner-history { display: grid; gap: 12px; }
.planner-group { display: grid; gap: 5px; }
.planner-group h3 { margin: 0 0 2px; font-family: var(--reading-font); font-size: 16px; color: var(--ink); }
.planner-group--overdue h3 { color: #a33224; }
.planner-card { display: flex; gap: 7px; width: 100%; padding: 10px 10px 10px 12px; position: relative; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.planner-card:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.planner-card__bar { width: 3px; border-radius: 999px; background: var(--gold); flex: none; align-self: stretch; }
.planner-card__main { min-width: 0; display: grid; gap: 2px; flex: 1; }
.planner-card__main strong { font-size: 12.5px; line-height: 1.35; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-card__meta, .planner-card__cat { color: var(--slate); font-size: 10.5px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-card__cat { color: var(--slate-2); }
.planner-card__badges { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.planner-card.is-completed { opacity: .68; }
.planner-card.is-cancelled { opacity: .55; }
.planner-card.is-cancelled .planner-card__main strong { text-decoration: line-through; }
.planner-card--compact { display: flex; border: 0; border-left: 2px solid var(--line-strong); background: var(--surface-2); padding: 5px 6px; }
.planner-card--compact .planner-card__badges { display: none; }
.planner-empty { text-align: center; padding: 32px 18px; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--slate); }
.planner-empty__mark { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 10px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: var(--reading-font); font-size: 20px; }
.planner-empty p { margin: 0 0 11px; font-size: 12.5px; }
.planner-hint { color: var(--slate-2); font-size: 11.5px; line-height: 1.55; margin: 5px 0; }
.planner-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; color: var(--slate); font-size: 12px; }
.planner-summary b { color: var(--ink); }
.planner-search { display: grid; gap: 4px; margin-bottom: 5px; }
.planner-search span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-2); }
.planner-history__item { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.planner-history__extra { padding: 2px 0 0 12px; display: grid; gap: 3px; color: var(--slate); font-size: 11px; }
.planner-history__extra p { margin: 0; color: var(--slate); line-height: 1.5; }

/* form */
.planner-form { display: grid; gap: 15px; }
.planner-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.planner-form__section { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.planner-form__section h3 { margin: 0; font-size: 13px; color: var(--ink); }
.planner-form__inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink); }
.planner-form__inline .select { max-width: 260px; }
.planner-form__checks { display: grid; gap: 1px; }
.planner-field--check { display: flex; align-items: center; gap: 7px; min-height: 37px; }
.planner-field--check input { width: 16px; height: 16px; accent-color: var(--gold); flex: none; }
.planner-textarea { min-height: 86px; resize: vertical; line-height: 1.5; padding: 9px 10px; }
.planner-reminders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.planner-reminderbox { display: grid; gap: 9px; }
.planner-reminderbox p { color: var(--slate); font-size: 12.5px; line-height: 1.55; margin: 0; }
.planner-reminderbox hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.planner-manager { display: grid; gap: 13px; }
.planner-categorylist, .planner-congregationlist { display: grid; gap: 5px; }
.planner-categoryrow, .planner-congregationrow { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.planner-categoryrow input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; flex: none; }
.planner-categoryrow__name { flex: 1; min-width: 80px; font-size: 12px; }
.planner-categoryrow__group { font-size: 10px; color: var(--slate-2); }
.planner-addcategory { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.planner-addcategory input[type="color"] { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; }
.planner-addcategory .input { width: min(190px, 100%); }
.planner-congregationrow > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.planner-congregationrow b { font-size: 12px; color: var(--ink); }
.planner-congregationrow span { font-size: 10.5px; color: var(--slate); overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .planner-layout { grid-template-columns: minmax(0, 1fr); }
  .planner-detail { position: static; max-height: none; }
  .planner-day { min-height: 96px; }
}
@media (max-width: 760px) {
  .planner { padding-bottom: 30px; }
  .planner-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .planner-head h1 { font-size: 32px; }
  .planner-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planner-stats > span { min-width: 0; }
  .planner-toolbar { display: block; padding: 8px; }
  .planner-toolbar__right { margin: 8px 0 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; justify-content: stretch; }
  .planner-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; padding-bottom: 0; }
  .planner-tabs .chip { width: 100%; justify-content: center; flex: none; }
  .planner-navgroup { grid-column: 1 / -1; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; width: 100%; }
  .planner-heading { grid-column: 1 / -1; min-width: 0; text-align: center; font-size: 13px; padding: 2px 0; }
  .planner-filter { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .planner-filter select { max-width: none; width: 100%; }
  .planner-toolbar__right > .iconbtn { width: 36px; height: 34px; justify-self: center; }
  .planner-toolbar__right > [data-pact="new"] { display: none; }
  .planner-week { grid-template-columns: repeat(7, minmax(78px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .planner-weekday { min-width: 78px; }
  .planner-weekdays span { font-size: 9px; padding: 6px 2px; }
  .planner-day { min-height: 62px; padding: 3px; }
  .planner-day__num { width: 19px; height: 19px; font-size: 10px; margin-bottom: 2px; }
  .planner-day__count { right: 3px; top: 4px; font-size: 8px; }
  .planner-dot { margin: 1px 0; padding: 0; font-size: 0; background: transparent; }
  .planner-dot i { width: 5px; height: 5px; display: inline-block; }
  .planner-dot span { display: none; }
  .planner-more { font-size: 8px; }
  .planner-card__main strong { font-size: 12px; }
  .planner-form__grid, .planner-reminders { grid-template-columns: minmax(0, 1fr); }
  .planner-form__section { padding-top: 10px; }
  .planner-categoryrow__group { display: none; }
  .planner-congregationrow { align-items: flex-start; flex-wrap: wrap; }
  .planner-detail { border-radius: 11px; padding: 12px; }
  .planner-actions .btn { flex: 1 1 auto; }
  .planner-daylist { padding: 9px; }
}
@media (max-width: 390px) {
  .planner-head h1 { font-size: 29px; }
  .planner-stats b { font-size: 21px; }
  .planner-card__meta, .planner-card__cat { font-size: 9.5px; }
  .planner-detail h2 { font-size: 21px; }
}

/* Meeting program import and chairman outlines */
.planner-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.planner-tools .planner-map { margin-left: auto; }
.meeting-tool { display: flex; flex-direction: column; gap: 12px; }
.meeting-tool__source { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.meeting-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.meeting-field--wide { grid-column: 1 / -1; }
.meeting-paste { min-height: 150px; }
.meeting-preview-wrap { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
.meeting-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.meeting-preview-head span { font-size: 12px; opacity: .72; }
.meeting-preview { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; padding-right: 4px; }
.meeting-preview__row { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: flex-start; gap: 8px; padding: 6px 6px; border-radius: 7px; cursor: pointer; }
.meeting-preview__row:hover { background: rgba(255,255,255,.05); }
.meeting-preview__row small { display: block; margin-top: 2px; font-size: 11.5px; opacity: .72; }
.meeting-warning { margin: 0; padding: 8px 10px; border-radius: 7px; background: rgba(185,138,148,.12); border: 1px solid rgba(185,138,148,.35); font-size: 12.5px; }
.meeting-assignment-preview { display: flex; flex-direction: column; gap: 4px; }
.meeting-assignment-preview > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.meeting-assignment-preview span { font-size: 12px; opacity: .75; }
.meeting-date-preview { border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; }
@media (max-width: 640px) {
  .meeting-form-grid { grid-template-columns: minmax(0, 1fr); }
  .meeting-field--wide { grid-column: auto; }
  .planner-tools .planner-map { margin-left: 0; flex-basis: 100%; }
  .meeting-preview { max-height: 220px; }
}

/* ==========================================================================
   Everyday usability additions (v1.30.0)
   Safe updates, quick actions, health, index, references, timing, comparison,
   workspace modes and the presentation additions.
   ========================================================================== */

.navitem--muted { color: var(--slate); }
.navitem--muted .navitem__text { font-weight: 500; }

/* Safe update notice */
.appupdate {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 10px 18px 0; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.appupdate__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.appupdate__main { display: grid; gap: 2px; flex: 1; min-width: 200px; }
.appupdate__main b { font-size: 13.5px; color: var(--ink); }
.appupdate__main span { font-size: 12.5px; color: var(--slate); line-height: 1.5; }
.appupdate__note { color: var(--warn) !important; }

/* Quick actions */
.quickfab {
  position: fixed; right: 20px; bottom: 22px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-md); cursor: pointer;
  font: 600 13px/1 var(--ui-font);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.quickfab:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.quickfab svg { width: 18px; height: 18px; color: var(--gold); }
.quickfab span { white-space: nowrap; }
@media (max-width: 640px) {
  .quickfab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 0; width: 46px; height: 46px; justify-content: center; }
  .quickfab span { display: none; }
}
@media print { .quickfab { display: none; } }

/* Scripture index */
.sindex { display: grid; gap: 8px; }
.sindex__row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; color: inherit;
}
.sindex__row:hover { border-color: var(--gold); }
.sindex__ref { font: 600 14px/1.3 var(--ui-font); color: var(--gold); min-width: 130px; }
.sindex__main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.sindex__main b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sindex__main span { font-size: 12px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Saved references */
.refgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.refcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.refcard__head { display: flex; gap: 6px; flex-wrap: wrap; }
.refcard h3 { margin: 0; font: 600 15px/1.35 var(--ui-font); }
.refcard__ref { margin: 0; font-size: 13px; }
.refcard__link { font-size: 12.5px; color: var(--navy-3); word-break: break-all; }
.refcard__notes { margin: 0; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.refcard__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }

/* Health check */
.health { display: grid; gap: 8px; }
.health__row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.health__main { display: grid; gap: 2px; }
.health__main b { font-size: 13.5px; }
.health__main span { font-size: 12.5px; color: var(--slate); line-height: 1.55; }

/* Meeting timing */
.timing-list { display: grid; gap: 8px; }
.timing-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.timing-row__main { display: grid; gap: 2px; flex: 1; min-width: 170px; }
.timing-row__main b { font-size: 13.5px; }
.timing-row__main span { font-size: 12px; color: var(--slate); }
.timing-row__time { display: grid; gap: 4px; font-size: 11.5px; color: var(--slate); }
.timing-row__time .input { width: 118px; }
@media (max-width: 520px) { .timing-row__time { flex: 1; } .timing-row__time .input { width: 100%; } }

/* Public talk use */
.talkuse-list { display: grid; gap: 10px; }
.talkuse-row { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.talkuse-row__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.talkuse-row__head b { font-size: 14px; }
.talkuse-row__meta { margin: 4px 0 0; font-size: 12.5px; color: var(--slate); }
.talkuse-row__notes { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.talkuse-row__notes p { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }

/* Version comparison */
.dc-summary { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.dc-section { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.dc-section header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.dc-body { padding: 12px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.dc-add { background: var(--ok-soft); color: var(--ok); text-decoration: none; padding: 1px 2px; border-radius: 3px; }
.dc-del { background: var(--danger-soft); color: var(--danger); padding: 1px 2px; border-radius: 3px; }

/* Section highlight when opening an indexed reference */
.sec--flash { animation: secflash 1.8s var(--ease); }
@keyframes secflash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 154, 82, 0); }
  20% { box-shadow: 0 0 0 3px rgba(193, 154, 82, .45); }
}

/* Presentation additions — the Exit control is deliberately untouched. */
.present__rule { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); margin: 10px 0; }
.present__setactions--wrap { flex-wrap: wrap; }
.present__setactions--wrap .btn { flex: 1 1 auto; }
.present__chairnow { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: rgba(193, 154, 82, .1); border: 1px solid rgba(193, 154, 82, .3); margin-bottom: 12px; }
.present__chaireyebrow { font: 600 11px/1 var(--ui-font); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.present__chairclock { font: 600 30px/1.1 var(--ui-font); letter-spacing: .02em; }
.present__chairdrift { font-size: 12.5px; opacity: .85; }
.present__chairdrift.is-late, .present__chairgrid .is-late { color: #e9a08f; }
.present__chairgrid { display: grid; gap: 10px; }
.present__chairgrid > div { display: grid; gap: 2px; padding: 10px 12px; background: rgba(255, 255, 255, .05); border-radius: 10px; }
.present__chairgrid span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.present__chairgrid b { font-size: 14px; font-weight: 600; }
.present__chairgrid small { font-size: 11.5px; opacity: .65; }
.present__refitem--row { display: flex; align-items: center; gap: 6px; padding: 4px; }
.present__refjump { flex: 1; display: grid; gap: 2px; text-align: left; padding: 8px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 8px; }
.present__refjump:hover { background: rgba(255, 255, 255, .07); }

/* ==========================================================================
   Speaker tools, emergency reading and optional presentation layouts
   ========================================================================== */

.tooltabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.tooltab { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--slate); border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.tooltab svg { width: 15px; height: 15px; }
.tooltab:hover { border-color: var(--line-2); color: var(--ink); }
.tooltab.is-on { background: var(--navy); border-color: var(--navy); color: #f6f2e8; }
.toolpanel { display: grid; gap: 16px; }
.toolcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.toolcard > h2, .toolcard__head h2 { margin: 0 0 6px; font-size: 16.5px; letter-spacing: -.01em; }
.toolcard__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.toolcard__head .inline { align-items: flex-end; }
.toolgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.toolgrid--tight { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.toolcard--wide { grid-column: 1 / -1; }
.toolstats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 4px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--slate); }
.toolstats b { color: var(--ink); font-size: 15px; }
.toolstats .is-late b { color: var(--danger); }
.toolstats .is-early b { color: var(--ok); }
.toollist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.toollist__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.toollist__row--stack { display: grid; gap: 6px; }
.toollist__row .hint { margin: 0; }
.toollist__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.toollist__main strong { font-size: 13px; overflow-wrap: anywhere; }
.toollist__row.is-done .toolcheck span { text-decoration: line-through; color: var(--slate-2); }
.toolcheck { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; flex: 1; min-width: 0; }
.toolcheck input { accent-color: var(--navy); }
.toolpoints { margin: 8px 0 0; padding-left: 18px; color: var(--slate); font-size: 12.5px; line-height: 1.8; }
.weekgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.weekday { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; min-height: 92px; background: var(--surface-2); }
.weekday.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.weekday header { display: grid; gap: 1px; margin-bottom: 6px; }
.weekday header strong { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.weekday header span { font-size: 11px; color: var(--slate-2); }
.weekday ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.weekitem { display: flex; gap: 5px; font-size: 11px; line-height: 1.35; color: var(--ink-2); }
.weekitem__dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 4px; background: var(--slate-2); flex: none; }
.weekitem--assignment .weekitem__dot { background: #3f6fa8; }
.weekitem--rehearsal .weekitem__dot { background: #8a5a9b; }
.weekitem--study .weekitem__dot { background: #2f6b5e; }
.weekitem--reading .weekitem__dot { background: #c19a52; }
.weekitem__main { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.weekitem__main small { color: var(--slate-2); font-size: 10px; }
.weekday .hint { font-size: 11px; }
.materiallist { display: grid; gap: 6px; margin-top: 8px; }
.materialrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.materialrow__num { font-family: var(--ui-font); font-size: 11px; color: var(--slate-2); width: 20px; }
.materialrow__title { flex: 1; min-width: 130px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.field--inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.field--inline > span { font-size: 11px; color: var(--slate-2); text-transform: uppercase; letter-spacing: .05em; }
.select--sm { padding: 4px 7px; font-size: 12px; min-height: 30px; width: auto; }
.cuechip { display: inline-flex; align-items: center; justify-content: center; min-width: 66px; padding: 3px 7px; border-radius: 4px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--cue, #c9c2b2); }
.toolchecklist { display: grid; gap: 7px; margin-top: 6px; }
.toolcheckrow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.toolcheckrow > div { display: grid; gap: 2px; }
.toolcheckrow strong { font-size: 13px; }
.toolcheckrow__icon { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--line); color: var(--slate); font-size: 12px; font-weight: 800; }
.toolcheckrow.is-ok .toolcheckrow__icon { background: var(--ok-soft); color: var(--ok); }
.toolcheckrow.is-warn .toolcheckrow__icon { background: var(--warn-soft); color: var(--warn); }
.langgroups { display: grid; gap: 12px; }
.langgroup { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.langgroup header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.langgroup .toollist { margin: 8px 0 10px; }
.langgroup .toollist__row { background: var(--surface); }
.toolsearch { margin: 10px 0; }
.searchresults { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.searchresult { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 9px 11px; font: inherit; cursor: pointer; }
.searchresult:hover { border-color: var(--line-2); background: var(--surface); }
.searchresult__mark { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--pearl-2); color: var(--slate); }
.searchresult__mark svg { width: 16px; height: 16px; }
.searchresult__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.searchresult__main strong { font-size: 13px; overflow-wrap: anywhere; }
.searchresult__main span { font-size: 11.5px; color: var(--slate); }
.toolcard .searchbox { max-width: none; }

@media (max-width: 900px) {
  .weekgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .materialrow { align-items: stretch; }
  .materialrow__title { flex-basis: calc(100% - 30px); }
}
@media (max-width: 560px) {
  .weekgrid { grid-template-columns: 1fr; }
  .toolcard { padding: 14px; }
  .tooltabs { padding-bottom: 8px; }
  .materialrow .field--inline { flex: 1; }
}

/* ---------- emergency reading mode ---------- */
.emergency { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: var(--pearl); color: var(--ink); font-family: var(--reading-font); }
.emergency__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); color: #f6f2e8; }
.emergency__title { flex: 1; min-width: 170px; display: grid; gap: 1px; }
.emergency__title strong { font-family: var(--ui-font); font-size: 14px; }
.emergency__title span { font-family: var(--ui-font); font-size: 11px; opacity: .7; }
.emergency__clock { font-family: var(--ui-font); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.emergency__bar .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #f6f2e8; }
.emergency__bar .btn--primary { background: var(--gold); border-color: var(--gold); color: #1b1408; }
.emergency__note { padding: 7px 16px; background: var(--gold-soft); color: var(--ink-2); font-family: var(--ui-font); font-size: 11.5px; }
.emergency__scroll { flex: 1; overflow: auto; overscroll-behavior: contain; }
.emergency__doc { max-width: 820px; margin: 0 auto; padding: 34px 26px 80px; }
.emergency__sec { margin: 0 0 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.emergency__sec h2 { font-size: 22px; line-height: 1.25; margin: 0 0 12px; }
.emergency__sec h2 span { display: inline-block; font-family: var(--ui-font); font-size: 11px; color: var(--gold); margin-right: 8px; vertical-align: 3px; }
.emergency__sec .prose { font-size: 19px; line-height: 1.75; }
.emergency__sec .prose img { max-width: 100%; height: auto; }
.emergency__notes { margin-top: 12px; padding: 9px 12px; border-left: 3px solid var(--gold); background: var(--surface-2); font-family: var(--ui-font); font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.emergency__notes b { display: block; margin-bottom: 2px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.emergency__notes p { margin: 0; }
.emergency__foot { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface); font-family: var(--ui-font); font-size: 11.5px; color: var(--slate); }
.emergency__foot span { margin-left: auto; }
@media (max-width: 600px) {
  .emergency__doc { padding: 22px 16px 70px; }
  .emergency__sec .prose { font-size: 17.5px; }
}

/* ---------- optional presentation material, cues and layouts ---------- */
.present__sec[hidden], .present__tocitem[hidden] { display: none !important; }
.present__cue { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 8px; padding: 2px 8px; border-radius: 4px; background: var(--cue, #6b6b6b); color: #fff; font-family: var(--ui-font, sans-serif); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; line-height: 1.7; }
.present__cue::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .8; }
.present[data-cues="0"] .present__cue { display: none; }
.present[data-layout="large"] .present__doc { --p-scale: 1.45 !important; --p-width: 900px !important; }
.present[data-layout="large"] .present__body { --p-line: 1.8; }
.present[data-layout="manuscript"] .present__doc { --p-line-scale: 1.2 !important; --p-width: 980px !important; }
.present[data-layout="manuscript"] .present__notes[hidden] { display: block !important; }
.present[data-layout="manuscript"] .present__notes { border-left: 3px solid var(--gold); padding-left: 12px; }
.present__layoutnote { margin: 18px auto 0; max-width: 620px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--slate); font-family: var(--ui-font, sans-serif); font-size: 13px; line-height: 1.6; text-align: center; }

/* ==========================================================================
   v1.32.0 — speaker studio, command palette and stage extras
   Existing document, presentation and Exit styles are unchanged above.
   ========================================================================== */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { border: 1px solid var(--line, rgba(120,110,90,.22)); border-radius: 10px; padding: 10px 12px; background: var(--paper-2, rgba(255,255,255,.55)); }
.stat b { display: block; font-size: 19px; line-height: 1.2; }
.stat span { display: block; margin-top: 3px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--slate, #6b665c); }
.warnline { margin: 12px 0 0; padding: 9px 11px; border-radius: 8px; background: rgba(163, 74, 58, .1); color: #8d3a2e; font-size: 13px; line-height: 1.5; }
.badge--danger { background: rgba(163, 74, 58, .14); color: #8d3a2e; }
.commandlist { max-height: min(54vh, 440px); overflow: auto; margin-top: 12px; }
.commandlist .btn--link { width: 100%; justify-content: space-between; text-align: left; }
.commandlist .btn--link .hint { margin-left: 12px; white-space: nowrap; }
.revpick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line, rgba(120,110,90,.18)); cursor: pointer; }
.revpick input { margin-top: 4px; }
.revpick > span { display: block; min-width: 0; }
.revpick__text { display: block; margin-top: 3px; color: var(--slate, #6b665c); font-size: 12.5px; line-height: 1.45; }
.present__alert { position: fixed; z-index: 80; top: 74px; left: 50%; transform: translateX(-50%); max-width: min(560px, 86vw); padding: 10px 18px; border-radius: 999px; background: rgba(28, 27, 24, .9); color: #f6f2e8; font-size: 14px; line-height: 1.35; letter-spacing: .01em; box-shadow: 0 8px 24px rgba(0,0,0,.18); pointer-events: none; text-align: center; }
.present__alert[data-kind="over"] { background: rgba(132, 54, 42, .94); }
.present__alert[data-kind="cue"] { background: rgba(58, 68, 54, .94); }
.present__bicols { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.present__bi { border-left: 1px solid rgba(120,110,90,.24); padding-left: 20px; min-width: 0; }
.present__bilabel { display: block; margin: 0 0 6px; font-family: var(--font-ui, inherit); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate, #6b665c); }
.present[data-bi="other"] .present__body { display: none; }
.present[data-bi="main"] .present__bi { display: none; }
@media (min-width: 1000px) {
  .present[data-bi="both"] .present__bicols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .present[data-bi="main"] .present__bicols, .present[data-bi="other"] .present__bicols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .present__alert { top: 62px; font-size: 13px; padding: 9px 14px; }
  .present__bi { border-left: 0; padding-left: 0; border-top: 1px solid rgba(120,110,90,.24); padding-top: 16px; }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Personal toolkit additions */
.qe-form { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; display: grid; gap: 8px; }
.qe-form legend { padding: 0 6px; font-family: var(--font-ui, inherit); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.qe-form label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.qe-form input { accent-color: var(--gold); }
.pacingbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pacingbar > span { display: block; height: 100%; background: var(--gold); transition: width .25s linear; }
.present__pace { position: fixed; z-index: 40; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 8px; color: var(--slate, #6b665c); font: 600 10.5px/1 var(--font-ui, inherit); letter-spacing: .1em; text-transform: uppercase; opacity: .72; pointer-events: none; }
.present__pace i { width: 12px; height: 12px; border-radius: 50%; background: var(--gold, #c9a227); animation: onpulse 1s ease-in-out infinite; }
.present__pace[hidden] { display: none; }
@keyframes onpulse { 0%, 100% { transform: scale(.7); opacity: .35; } 50% { transform: scale(1); opacity: 1; } }
.present__return[hidden] { display: none; }
@media (max-width: 640px) { .present__pace { bottom: 74px; left: 12px; } }
.toolcheck { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; cursor: pointer; }
.toolcheck input { margin-top: 2px; accent-color: var(--gold); }
.toolkit-empty { padding: 26px 18px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--slate); }
@media (max-width: 640px) {
  .toolcheck { padding: 9px 10px; font-size: 13.5px; }
}

/* ---------- assignment usability (v1.34.0) ---------- */
.planner-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex: none; }
.planner-filterbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.planner-filterbar .planner-search { margin: 0; flex: 1 1 210px; min-width: 160px; }
.planner-filterbar .planner-search input { min-height: 34px; font-size: 12.5px; }
.planner-filterbar .select { min-height: 34px; font-size: 12px; max-width: 190px; }
.planner-filterbar .btn { min-height: 34px; }
.planner-bulk { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.planner-selectedcount { font-size: 11.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.planner-trashbtn { margin-left: auto; }
.planner-item { display: flex; align-items: stretch; gap: 4px; border-radius: 9px; min-width: 0; }
.planner-item.is-selected .planner-card { border-color: var(--gold); background: rgba(193, 154, 82, .08); }
.planner-item .planner-card { flex: 1; min-width: 0; }
.planner-pick { display: flex; align-items: center; padding: 0 2px 0 4px; flex: none; cursor: pointer; }
.planner-pick input { width: 20px; height: 20px; accent-color: var(--gold); }
.planner-quick { display: flex; align-items: center; justify-content: flex-end; gap: 1px; flex-wrap: nowrap; max-width: 160px; opacity: .5; transition: opacity .12s; }
.planner-item:hover .planner-quick, .planner-item:focus-within .planner-quick { opacity: 1; }
.planner-quick .iconbtn { width: 30px; height: 30px; font-size: 14px; color: var(--slate); }
.planner-quick .iconbtn:hover { color: var(--ink); background: var(--surface-2); }
.planner-quick__danger:hover { color: #a33224 !important; border-color: rgba(163, 50, 36, .4) !important; }
.planner-typerow { display: flex; align-items: center; gap: 5px; }
.planner-typerow .select { flex: 1; min-width: 0; }
.planner-typerow .btn { flex: none; white-space: nowrap; }
.planner-newcat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-2); }
.planner-newcat .input { width: min(190px, 100%); min-height: 34px; }
.planner-newcat input[type="color"] { width: 34px; height: 34px; padding: 0; border: 0; background: transparent; }
.planner-newcat .select { max-width: 170px; }
.planner-trashlist { display: grid; gap: 6px; }
.planner-trashrow { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.planner-trashrow__main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.planner-trashrow__main b { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.planner-trashrow__main span { font-size: 11px; color: var(--slate); }
.toast__action { margin-left: 8px; padding: 4px 10px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; font: 700 11.5px/1.2 var(--ui-font); cursor: pointer; white-space: nowrap; }
.toast__action:hover { background: rgba(255, 255, 255, .12); }

@media (hover: none) { .planner-quick { opacity: 1; max-width: none; } }
@media (max-width: 760px) {
  .planner-head__actions { width: 100%; }
  .planner-head__actions .btn { flex: 1 1 auto; justify-content: center; }
  .planner-filterbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; }
  .planner-filterbar .planner-search { grid-column: 1 / -1; }
  .planner-filterbar .select { max-width: none; width: 100%; }
  .planner-bulk { grid-column: 1 / -1; margin-left: 0; }
  .planner-bulk .btn { flex: 1 1 auto; }
  .planner-trashbtn { grid-column: 1 / -1; margin-left: 0; }
  .planner-item { flex-wrap: wrap; }
  .planner-pick { order: 0; padding: 0 4px; }
  .planner-item .planner-card { order: 1; flex: 1 1 100%; }
  .planner-quick { order: 2; width: 100%; max-width: none; justify-content: flex-start; padding: 0 2px 2px 8px; opacity: 1; }
  .planner-quick .iconbtn { width: 38px; height: 36px; font-size: 16px; }
  .planner-typerow .btn { padding: 0 8px; font-size: 11px; }
  .planner-trashrow { align-items: flex-start; }
  .planner-trashrow .inline { width: 100%; }
  .planner-trashrow .inline .btn { flex: 1 1 auto; }
}
