/* ==========================================================
   GFJ app shell — the frame around every staff screen.

   Desktop (≥ 960px): a fixed left rail carries the mark, the
   navigation and the person; the work area sits to its right at
   a readable measure. Phones (< 960px): a compact top bar and a
   bottom tab bar with the four places a coordinator lives, plus
   "More" for the rest. Same panes, same ids, one showTab().

   Brand rules hold: square corners, hairlines not shadows, gold
   only as an accent, Outfit for labels, Source Serif for reading.
   ========================================================== */

:root{
  --rail-w: 236px;
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --measure: 1120px;
}

/* ---------- ground ----------
   viewport-fit=cover lets the page run under the status bar, the
   Dynamic Island / notch and the home indicator. Every piece of
   chrome then pads itself by the safe-area insets, so the glass
   fills those regions and the content never sits beneath them. */
:root{
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
body.app-shell{ min-height: 100dvh; }
body.app-shell .wrap{ max-width: none; padding: 0; }
body.app-shell #login{ margin: calc(12vh + var(--sat)) auto calc(48px + var(--sab)); }
body.app-shell .wrap{ padding-left: var(--sal); padding-right: var(--sar); }
body.app-shell #portal{ display: flex; min-height: 100dvh; }

/* ---------- the rail ---------- */
.rail{
  position: fixed; inset: 0 auto 0 0; width: calc(var(--rail-w) + var(--sal));
  background: var(--card); border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; z-index: 60;
  padding: calc(22px + var(--sat)) 16px calc(16px + var(--sab)) calc(16px + var(--sal));
}
.rail .brand{ display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; }
.rail .brand img{ width: 30px; height: 30px; object-fit: contain; }
.rail .brand .name{ font-family: var(--sans); font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; line-height: 1.15; }
.rail .brand .name small{ display: block; font-weight: 500; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--caption); margin-top: 2px; }

.rail nav{ display: flex; flex-direction: column; gap: 2px; }
.rail .navbtn{
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; color: var(--ink-soft, var(--ink)); border: none; text-align: left;
  font-family: var(--sans); font-weight: 500; font-size: 14px; letter-spacing: 0;
  padding: 10px 10px; min-height: 42px; position: relative;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rail .navbtn:hover{ background: var(--surface-2); color: var(--ink); }
.rail .navbtn.on{ background: var(--surface-2); color: var(--ink); font-weight: 600; }
.rail .navbtn.on::before{ content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--gold); }
.rail .navbtn svg{ width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; opacity: .85; }
.rail .navbtn.on svg{ opacity: 1; }
.rail .navbtn .n{ margin-left: auto; }
.rail .sep{ height: 1px; background: var(--hair); margin: 12px 8px; }
.church-switch{ width: 100%; margin: -10px 0 14px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; padding: 8px 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
.sheet-church{ padding: 4px 10px 10px; } .sheet-church .church-switch{ margin: 0; }

.rail .foot{ margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hair); }
.rail .who{ display: block; padding: 6px 10px 10px; }
.rail .who .em{ font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .who .rl{ font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--caption); margin-top: 2px; }
.rail .foot .navbtn{ min-height: 38px; font-size: 13px; }

/* badge counts share one look wherever they sit */
.n{ display: inline-block; background: var(--gold); color: #1A1A1A; font-family: var(--sans);
    font-size: 10.5px; line-height: 18px; min-width: 18px; text-align: center; padding: 0 6px; font-weight: 700; }

/* ---------- work area ---------- */
.app-main{ flex: 1; min-width: 0; margin-left: calc(var(--rail-w) + var(--sal)); display: flex; flex-direction: column; }
.topbar{
  position: sticky; top: 0; z-index: 50; min-height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--sat)) calc(36px + var(--sar)) 10px 36px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid transparent; transition: border-color var(--t-mid) var(--ease);
}
body.is-scrolled .topbar{ border-bottom-color: var(--hairline); }
.topbar h1{ font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -.015em; margin: 0; line-height: 1.1; }
.topbar .kick{ font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--olive); margin-bottom: 3px; }
.topbar .acts{ display: none; }  /* the rail and the phone sheet carry these */
.topbar .mbrand{ display: none; }
.content{ padding: 8px calc(36px + var(--sar)) calc(48px + var(--sab)) 36px; max-width: calc(var(--measure) + var(--sar)); width: 100%; }
.content .card:first-child{ margin-top: 12px; }

/* ---------- Today ---------- */
.today-grid{ display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.today-grid .card{ margin: 0 0 20px; }
.attn{ border: 1px solid var(--hair); background: var(--card); }
.attn .arow{
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--hair);
  cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.attn .arow:last-child{ border-bottom: none; }
.attn .arow:hover{ background: var(--surface-2); }
.attn .cnt{ font-family: var(--sans); font-weight: 700; font-size: 26px; letter-spacing: -.02em; min-width: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.attn .arow.hot .cnt{ color: var(--gold-ink); }
.attn .what{ flex: 1; min-width: 0; }
.attn .what strong{ font-family: var(--sans); font-weight: 600; font-size: 14.5px; display: block; }
.attn .what span{ font-size: 13px; color: var(--caption); }
.attn .go{ font-family: var(--sans); font-size: 18px; color: var(--caption); }
.attn .calm{ padding: 22px 18px; color: var(--caption); font-style: italic; }
.attn .calm strong{ font-style: normal; font-family: var(--sans); color: var(--ink); display: block; margin-bottom: 2px; }

.sessrow{ display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.sessrow:last-child{ border-bottom: none; }
.sessrow:hover .who{ text-decoration: underline; text-underline-offset: 3px; }
.sessrow .t{ font-family: var(--sans); font-weight: 700; font-size: 14px; min-width: 76px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.sessrow .t small{ display: block; font-weight: 500; font-size: 10.5px; color: var(--caption); letter-spacing: .08em; text-transform: uppercase; }
.sessrow .who{ font-family: var(--sans); font-weight: 600; font-size: 14.5px; }
.sessrow .meta{ font-size: 13px; color: var(--caption); margin-top: 2px; }
.sessrow .badge{ margin-left: auto; flex: none; }

.stats{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 20px; }
.stat{ border: 1px solid var(--hair); background: var(--card); padding: 14px 14px; min-width: 0; cursor: pointer; transition: border-color var(--t-fast) var(--ease); }
.stat:hover{ border-color: var(--ink); }
.stat .v{ font-family: var(--sans); font-weight: 700; font-size: 24px; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .k{ font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--caption); margin-top: 5px; }

/* ---------- Journey ---------- */
.jstrip{ display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; margin: 16px 0 20px; position: relative; border: 1px solid var(--hair); background: var(--card); }
.jcell{ background: none; color: var(--ink); border: none; border-right: 1px solid var(--hair); padding: 16px 14px 14px; text-align: left; min-height: 0;
  display: flex; flex-direction: column; gap: 4px; position: relative; transition: background var(--t-fast) var(--ease); }
.jcell:last-child{ border-right: none; }
.jcell:hover{ background: var(--surface-2); }
.jcell.on{ background: var(--surface-2); }
.jcell.on::after{ content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.jcell .jn{ font-family: var(--sans); font-weight: 700; font-size: 26px; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.jcell.zero .jn{ color: var(--gray); }
.jcell .jl{ font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--caption); }
.jcell.on .jl{ color: var(--ink); }

.jstage{ background: var(--card); border: 1px solid var(--hair); padding: 22px 26px 24px; margin: 0 0 14px; scroll-margin-top: calc(var(--topbar-h) + 12px); transition: border-color var(--t-mid) var(--ease); }
.jstage.focus{ border-color: var(--gold); }
.jstage.empty-stage{ padding: 14px 26px; }
.jhead{ display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 14px; }
.jhead h2{ margin: 0; display: flex; align-items: baseline; gap: 10px; }
.jhead .sub{ margin: 2px 0 0; }
.jcount{ font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--caption); font-variant-numeric: tabular-nums; }
.jnext{ font-family: var(--sans); font-size: 12.5px; color: var(--caption); max-width: 300px; text-align: right; padding-top: 4px; }
.empty-stage .jhead{ margin-bottom: 0; align-items: center; }
.empty-stage .jhead .sub{ display: none; }
.empty-stage h2{ font-size: 15px; color: var(--caption); }
.jnone{ display: none; }
.pgrid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pcard{ background: var(--paper); border: 1px solid var(--hair); padding: 13px 15px; cursor: pointer; min-width: 0; }
.pcard:hover{ border-color: var(--ink); }
.pcard .pn{ font-family: var(--sans); font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pm{ font-family: var(--sans); font-size: 12px; color: var(--caption); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pcard .pt{ margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Emails ---------- */
.emails{ display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.email-list{ border: 1px solid var(--hair); background: var(--card); position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100dvh - var(--topbar-h) - 24px); overflow: auto; }
.email-group{ padding: 12px 0 4px; border-bottom: 1px solid var(--hair); }
.email-group:last-child{ border-bottom: none; }
.email-group .label{ padding: 0 16px 6px; }
.email-row{ display: flex; flex-direction: column; gap: 2px; width: 100%; background: none; border: none; text-align: left; color: var(--ink);
  padding: 9px 16px; min-height: 0; position: relative; }
.email-row:hover{ background: var(--surface-2); }
.email-row.on{ background: var(--surface-2); }
.email-row.on::before{ content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--gold); }
.email-row .er-l{ font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.email-row .er-s{ font-family: var(--serif); font-size: 12.5px; color: var(--caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.email-row.missing .er-s, .email-row.off .er-s{ font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.email-edit .card{ margin-top: 0; }
.email-fields input, .email-fields textarea{ width: 100%; font-size: 14.5px; }
.email-fields textarea{ min-height: 260px; font-family: var(--serif); padding: 11px 13px; border: 1px solid var(--line); background: var(--field); color: var(--ink); resize: vertical; line-height: 1.55; }
.chips{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.chip-btn{ background: var(--surface-2); color: var(--ink); border: 1px solid var(--hair); font-family: var(--sans); font-size: 11.5px; font-weight: 600; padding: 4px 8px; min-height: 0; }
.chip-btn:hover{ background: var(--surface-ok); }
.email-actions{ display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.tog{ display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--ink); }
.tog input{ width: 16px; height: 16px; accent-color: var(--olive); }
.email-preview{ border: 1px solid var(--hair); background: var(--surface-2); padding: 18px; margin-top: 8px; }
.ep-meta{ font-family: var(--sans); font-size: 12.5px; color: var(--caption); display: grid; gap: 4px; margin-bottom: 14px; }
.ep-meta span{ display: inline-block; width: 60px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.ep-meta strong{ color: var(--ink); }
.ep-body{ background: #F7F7F5; color: #1A1A1A; max-width: 560px; margin: 0 auto; padding: 32px 24px; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.6; }
.ep-church{ font-family: Helvetica, Arial, sans-serif; font-size: 11px; font-weight: bold; letter-spacing: .16em; text-transform: uppercase; color: #4B533A; margin-bottom: 8px; }
.ep-rule{ width: 32px; border-top: 2px solid #C4A24D; margin: 0 0 22px; }
.ep-body p{ margin: 0 0 15px; } .ep-body a{ color: #4B533A; text-decoration: underline; word-break: break-all; }
.ep-foot{ border-top: 1px solid #E9E6E0; margin-top: 28px; padding-top: 14px; font-family: Helvetica, Arial, sans-serif; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: #75716A; }

/* ---------- Playbook ---------- */
.playbook{ display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.pb-index{ border: 1px solid var(--hair); background: var(--card); padding: 12px 0; position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100dvh - var(--topbar-h) - 24px); overflow: auto; }
.pb-link{ display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; text-align: left; color: var(--ink);
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; padding: 8px 14px; min-height: 0; position: relative; }
.pb-link:hover{ background: var(--surface-2); }
.pb-link.on{ background: var(--surface-2); font-weight: 600; }
.pb-link.on::before{ content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--gold); }
.pb-link .pb-n{ font-size: 10.5px; font-weight: 700; color: var(--caption); min-width: 34px; letter-spacing: .06em; text-transform: uppercase; }
.pb-mine{ display: flex; gap: 8px; align-items: center; margin: 12px 14px 4px; font-family: var(--sans); font-size: 12px; color: var(--caption); text-transform: none; letter-spacing: 0; }
.pb-mine input{ accent-color: var(--olive); }
.pb-card{ margin-top: 0; max-width: 760px; }
.pb-card h2{ font-size: 24px; }
.pb-prompt{ font-size: 15.5px; color: var(--ink-soft); border-left: 2px solid var(--gold); padding: 6px 16px; margin: 14px 0 6px; }
.pb-sec{ padding: 16px 0; border-top: 1px solid var(--hair); }
.pb-sec:first-of-type{ border-top: none; }
.pb-sec-h{ display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-family: var(--sans); font-size: 14px; }
.pb-kind{ font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.pb-chairs{ margin-left: auto; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--caption); }
.pb-text{ font-size: 15px; line-height: 1.7; }
.kind-prayer .pb-text, .kind-guided_prayer .pb-text{ border-left: 2px solid var(--olive); padding-left: 16px; }
.kind-guided_prayer .pb-text{ font-style: italic; }
.kind-scripture .pb-text{ color: var(--ink-soft); font-size: 14.5px; }
.kind-scripture .pb-kind{ color: var(--gold-ink); }
.kind-watchfor{ background: var(--surface-warn); padding: 14px 16px; margin: 10px 0; border-top: none; }
.kind-watchfor .pb-kind{ color: var(--gold-ink); }
.kind-questions .pb-text{ font-family: var(--sans); font-size: 14px; }
.pb-nav{ display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hair); }

/* ---------- Prayers ---------- */
.prayers{ max-width: 780px; margin-top: 8px; }
.pr-bar{ position: sticky; top: var(--topbar-h); z-index: 20; background: var(--paper); padding: 10px 0 8px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 1px solid var(--hair); }
.pr-bar input{ margin: 0; font-size: 15px; }
.pr-filters{ grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pr-filters button{ min-height: 0; padding: 6px 12px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--hair); background: var(--card); color: var(--ink-soft); }
.pr-filters button.on{ background: var(--olive); border-color: var(--olive); color: #fff; }
.pr-jump{ display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.pr-jump a{ font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); text-decoration: none; border: 1px solid var(--hair); padding: 5px 9px; background: var(--card); }
.pr-jump a:hover{ border-color: var(--olive); }
.pr-group{ scroll-margin-top: calc(var(--topbar-h) + 110px); margin-top: 22px; }
.pr-group-h{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.pr-group-h .link{ font-size: 12px; }
.prayer{ margin: 0 0 12px; padding: 18px 22px 20px; border-left: 3px solid var(--olive); }
.prayer.guest{ border-left-color: var(--gold); }
.pr-h{ display: flex; align-items: baseline; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pr-h h3{ font-size: 18px; margin: 0; }
.pr-who{ font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.prayer.guest .pr-who{ color: var(--gold-ink); }
.pr-text{ font-size: 17px; line-height: 1.75; }
.prayer.guest .pr-text{ font-style: italic; }
.pr-text mark{ background: var(--surface-warn); color: inherit; padding: 0 3px; font-style: normal; font-weight: 600; }
.pr-text em{ color: var(--caption); }
.pr-text b.hit, .pr-h b.hit{ background: var(--surface-warn); font-weight: inherit; }

/* ---------- move a session ---------- */
.mv .label{ margin-bottom: 4px; }
.mv-hint{ font-family: var(--sans); font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.mv-days{ display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mv-day{ border: 1px solid var(--hair); background: var(--card); padding: 8px; }
.mv-d{ font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--caption); margin-bottom: 6px; }
.mv-slot{ display: block; width: 100%; text-align: left; min-height: 0; padding: 7px 9px; margin: 0 0 4px; background: var(--surface-2); border: 1px solid transparent; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 600; }
.mv-slot span{ display: block; font-weight: 400; font-size: 11.5px; color: var(--caption); }
.mv-slot:hover{ border-color: var(--olive); }
.mv-custom{ display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.mv-custom label{ flex-basis: 100%; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--caption); }
.mv-custom input{ margin: 0; font-family: var(--sans); font-size: 14px; }
.mv-msg{ margin-top: 10px; font-family: var(--sans); font-size: 13px; padding: 8px 10px; }
.mv-msg.ok{ background: var(--surface-2); color: var(--olive); }
.mv-msg.bad{ background: var(--surface-warn); color: var(--gold-ink); }

/* ---------- Session mode ---------- */
.rm-bar, .rm-strip, .rm-notes, .rm-foot, .rm-sheet{ display: none; }
body.session-mode .rail{ display: none; }
body.session-mode .app-main{ margin-left: 0 !important; padding-bottom: calc(84px + var(--sab)); }
body.session-mode .topbar, body.session-mode .tabbar{ display: none; }
body.session-mode .content{ max-width: none; padding-top: 0; }
body.session-mode .pb-index{ display: none; }
body.session-mode .playbook{ grid-template-columns: minmax(0, 1fr); margin-top: 0; max-width: 820px; margin-left: auto; margin-right: auto; }
body.session-mode.rm-notes-open .playbook{ max-width: none; }
@media (min-width: 1100px){
  body.session-mode.rm-notes-open .playbook{ grid-template-columns: minmax(0, 1fr) 380px; }
  body.session-mode.rm-notes-open .rm-notes{ display: flex; position: sticky; top: calc(var(--sat) + 132px); max-height: calc(100dvh - var(--sat) - 220px); }
}
body.session-mode .rm-bar{ display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 40;
  padding: calc(10px + var(--sat)) 4px 10px; background: var(--paper); border-bottom: 1px solid var(--hair); }
.rm-exit{ background: none; border: 1px solid var(--hair); color: var(--ink); min-height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 600; }
.rm-who{ flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--sans); }
.rm-who .rm-k{ font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--olive); }
.rm-who strong{ font-size: 20px; letter-spacing: -.01em; }
.rm-who .rm-m{ font-size: 12.5px; color: var(--caption); }
.rm-acts{ display: flex; gap: 8px; }
.rm-btn{ min-height: 40px; padding: 0 16px; background: var(--card); color: var(--ink); border: 1px solid var(--hair); font-family: var(--sans); font-size: 13.5px; font-weight: 600; }
.rm-notes-btn b{ display: inline-block; min-width: 20px; margin-left: 4px; color: var(--gold-ink); }
body.rm-notes-open .rm-notes-btn{ background: var(--olive); border-color: var(--olive); color: #F7F7F5; }
body.rm-notes-open .rm-notes-btn b{ color: var(--gold); }
body.session-mode .rm-strip{ display: flex; gap: 6px; overflow-x: auto; padding: 10px 4px; position: sticky; top: calc(var(--sat) + 61px); z-index: 39; background: var(--paper); scrollbar-width: none; max-width: 820px; margin: 0 auto; }
body.session-mode.rm-notes-open .rm-strip{ max-width: none; }
.rm-strip::-webkit-scrollbar{ display: none; }
.rm-strip button{ flex: none; min-width: 44px; min-height: 40px; padding: 0 12px; background: var(--card); border: 1px solid var(--hair); color: var(--ink-soft, var(--ink)); font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.rm-strip button.on{ background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rm-card{ max-width: none; }
.rm-card h2{ font-size: 28px; margin-top: 2px; }
.rm-sub{ font-size: 16px; color: var(--caption); margin: 8px 0 4px; line-height: 1.5; }
.rm-card .pb-text{ font-size: 17px; line-height: 1.7; }
.rm-card .kind-questions .pb-text{ font-size: 16px; }
.rm-card .pb-sec-h-wrap{ margin-bottom: 6px; }
.rm-card .pb-sec-h{ display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--sans); font-size: 15px; width: 100%; }
.rm-card .pb-chairs{ font-size: 10px; opacity: .8; }
.rm-name{ font-weight: 600; font-style: normal; }
details.rm-fold{ padding: 0; }
details.rm-fold > summary{ list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 0; min-height: 52px; }
details.rm-fold > summary::-webkit-details-marker{ display: none; }
details.rm-fold > summary::after{ content: "+"; margin-left: auto; font-family: var(--sans); font-size: 22px; line-height: 1; color: var(--caption); width: 24px; text-align: center; }
details.rm-fold[open] > summary::after{ content: "–"; }
details.rm-fold > .pb-text{ padding: 0 0 18px; }
.rm-carry{ border: 1px solid var(--gold); background: var(--surface-warn); padding: 16px 18px; margin: 18px 0 8px; }
.rm-carry-h{ display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--sans); margin-bottom: 10px; }
.rm-carry-h strong{ font-size: 17px; }
.rm-carry-n{ margin-left: auto; font-size: 12px; color: var(--gold-ink); font-weight: 600; }
.rm-check{ display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid rgba(196,162,77,.35); font-family: var(--serif); font-size: 17px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; margin: 0; }
.rm-check input{ width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--olive); }
.rm-check.done span{ text-decoration: line-through; color: var(--caption); }
.rm-carry-empty{ font-size: 14.5px; color: var(--gold-ink); }
.rm-carry-add{ display: flex; gap: 8px; margin-top: 10px; }
.rm-carry-add input{ flex: 1; margin: 0; font-size: 16px; }
/* the bottom bar: big previous / next */
body.session-mode .rm-foot{ display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 10px calc(14px + var(--sar)) calc(10px + var(--sab)) calc(14px + var(--sal)); background: var(--glass, var(--paper)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-top: 1px solid var(--hair); }
.rm-foot button{ flex: 1; min-height: 52px; font-family: var(--sans); font-weight: 600; font-size: 15px; background: var(--card); color: var(--ink); border: 1px solid var(--hair); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 14px; }
.rm-foot .rm-next{ background: var(--olive); border-color: var(--olive); color: #F7F7F5; }
.rm-foot button[disabled]{ visibility: hidden; }
.rm-foot .rm-prev{ text-align: left; } .rm-foot .rm-next{ text-align: right; }
/* notes panel */
.rm-notes{ flex-direction: column; border: 1px solid var(--hair); background: var(--card); overflow: hidden; }
.rm-n-head{ display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--hair); font-family: var(--sans); }
.rm-n-head strong{ font-size: 16px; }
.rm-n-head span{ font-size: 13px; color: var(--caption); }
.rm-n-x{ margin-left: auto; background: none; border: none; color: var(--caption); font-size: 18px; min-height: 36px; min-width: 36px; }
.rm-add{ padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.rm-kinds{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rm-kinds button{ min-height: 32px; padding: 0 10px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-soft, var(--ink)); border: 1px solid var(--hair); }
.rm-kinds button.on{ background: var(--gold); border-color: var(--gold); color: #1A1A1A; }
.rm-add textarea, .rm-body textarea{ width: 100%; margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.45; resize: none; min-height: 52px; padding: 10px 12px; }
.rm-carry-add input{ font-family: var(--serif); }
.rm-add-row{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.rm-add-row span{ font-family: var(--sans); font-size: 12px; } .rm-add-row .ok{ color: var(--olive); } .rm-add-row .bad{ color: var(--gold-ink); }
.rm-filter{ display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 0; scrollbar-width: none; }
.rm-filter button{ flex: none; min-height: 30px; padding: 0 10px; font-family: var(--sans); font-size: 12px; font-weight: 600; background: none; border: 1px solid var(--hair); color: var(--caption); }
.rm-filter button.on{ color: var(--ink); border-color: var(--ink); }
.rm-list{ overflow-y: auto; padding: 6px 16px 16px; flex: 1; -webkit-overflow-scrolling: touch; }
.rm-item{ display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.rm-item input{ width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--olive); }
.rm-dot{ width: 6px; height: 6px; background: var(--caption); margin: 9px 7px 0; flex: none; }
.rm-main{ flex: 1; min-width: 0; }
.rm-meta{ display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-family: var(--sans); font-size: 11px; color: var(--caption); margin-bottom: 3px; }
.rm-pill{ background: var(--surface-warn); color: var(--gold-ink); font-weight: 600; padding: 1px 6px; }
.rm-body{ font-size: 15.5px; line-height: 1.5; cursor: text; word-wrap: break-word; }
.rm-item.done .rm-body{ text-decoration: line-through; color: var(--caption); }
.rm-body textarea{ width: 100%; font-size: 16px; margin: 0; }
.rm-edit-row{ display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; } .rm-edit-row button{ min-height: 34px; font-size: 13px; }
.rm-del{ margin-left: auto; color: var(--gold-ink) !important; }
.rm-empty{ font-size: 14px; color: var(--caption); padding: 14px 0; line-height: 1.55; }
/* under 1100px the notes slide over from the right; on phones they fill the screen */
@media (max-width: 1099px){
  body.session-mode.rm-notes-open .rm-notes{ display: flex; position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
    padding-top: var(--sat); padding-bottom: var(--sab); box-shadow: -18px 0 40px rgba(0,0,0,.25); border: none; border-left: 1px solid var(--hair); }
}
/* the prayers sheet */
body.session-mode .rm-sheet.open{ display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); }
.rm-sheet-in{ position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 24px); bottom: 0; width: min(820px, 100%); background: var(--paper); border: 1px solid var(--hair); display: flex; flex-direction: column; }
#rmPrList{ overflow-y: auto; padding: 8px 18px calc(24px + var(--sab)); -webkit-overflow-scrolling: touch; }
.rm-pr-g{ margin-top: 16px; } .rm-pr-gh{ display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
#rmPrList .prayer{ margin: 0 0 10px; padding: 16px 18px; border-left: 3px solid var(--olive); }
#rmPrList .prayer.guest{ border-left-color: var(--gold); }
#rmPrList .pr-h{ display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
#rmPrList .pr-h h3{ font-size: 17px; margin: 0; }
#rmPrList .pr-who{ font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
#rmPrList .pr-text{ font-size: 17px; line-height: 1.7; }
#rmPrList .guest .pr-text{ font-style: italic; }
#rmPrList mark{ background: var(--surface-warn); color: inherit; padding: 0 3px; font-weight: 600; font-style: normal; }
.rm-start{ font-weight: 600; }
@media (max-width: 700px){
  .rm-who strong{ font-size: 17px; } .rm-who .rm-m{ display: none; }
  .rm-exit span{ display: none; }
  .rm-btn{ padding: 0 11px; }
  .rm-card h2{ font-size: 23px; }
  .rm-card .pb-text, .rm-check{ font-size: 16.5px; }
  body.session-mode .rm-strip{ top: calc(var(--sat) + 61px); }
  .rm-sheet-in{ top: var(--sat); border: none; }
}

/* ---------- phone chrome ---------- */
.tabbar{ display: none; }
.sheet{ display: none; }

@media (max-width: 959px){
  :root{ --rail-w: 0px; }
  .rail{ display: none; }
  .app-main{ margin-left: 0; padding-bottom: calc(var(--tabbar-h) + var(--sab)); }
  .topbar{ padding: calc(8px + var(--sat)) calc(16px + var(--sar)) 8px calc(16px + var(--sal)); min-height: calc(56px + var(--sat)); }
  .topbar h1{ font-size: 19px; }
  .topbar .kick{ font-size: 9.5px; margin-bottom: 2px; }
  .topbar .mbrand{ display: block; width: 26px; height: 26px; object-fit: contain; margin-right: 10px; }
  .topbar .lead{ display: flex; align-items: center; }
  .topbar .acts .themetoggle, .topbar .acts #bellBtn{ display: none; }
  .content{ padding: 4px calc(16px + var(--sar)) 32px calc(16px + var(--sal)); max-width: none; }
  .today-grid{ grid-template-columns: 1fr; gap: 0; margin-top: 12px; }
  .today-grid .card{ margin: 0 0 14px; }
  .stats{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .attn .arow{ padding: 13px 14px; }
  .jstrip{ grid-template-columns: repeat(3, 1fr); margin: 10px 0 14px; }
  .emails{ grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
  .playbook{ grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
  .mv-days{ grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mv-custom input{ font-size: 16px; flex: 1; }
  .pr-bar{ top: calc(56px + var(--sat)); grid-template-columns: 1fr; gap: 6px; padding-top: 8px; }
  .pr-bar input{ font-size: 16px; }
  .pr-group{ scroll-margin-top: calc(56px + var(--sat) + 150px); }
  .prayer{ padding: 14px 16px 16px; }
  .pr-text{ font-size: 16.5px; }
  .pr-h h3{ font-size: 17px; }
  .pb-index{ position: static; max-height: none; display: flex; overflow-x: auto; padding: 8px; gap: 4px; scrollbar-width: none; }
  .pb-index::-webkit-scrollbar{ display: none; }
  .pb-index .label{ display: none; }
  .pb-link{ width: auto; flex: none; padding: 8px 12px; border: 1px solid var(--hair); font-size: 12.5px; }
  .pb-link .pb-n{ min-width: 0; }
  .pb-link span:last-child{ display: none; }
  .pb-link.on span:last-child{ display: inline; }
  .pb-link.on::before{ display: none; }
  .pb-mine{ flex: none; margin: 0 6px; white-space: nowrap; }
  .pb-card h2{ font-size: 21px; }
  .pb-nav{ flex-direction: column; }
  .pb-nav button{ width: 100%; }
  .email-list{ position: static; max-height: none; }
  .email-fields textarea{ min-height: 200px; }
  .ep-body{ padding: 22px 16px; }
  .jcell{ padding: 12px 12px 10px; border-bottom: 1px solid var(--hair); }
  .jcell:nth-child(3n){ border-right: none; }
  .jcell:nth-child(n+4){ border-bottom: none; }
  .jcell .jn{ font-size: 22px; }
  .jcell .jl{ font-size: 9.5px; letter-spacing: .1em; }
  .jstage{ padding: 16px 16px 18px; }
  .jstage.empty-stage{ padding: 12px 16px; }
  .jhead{ flex-direction: column; gap: 6px; align-items: flex-start; }
  .empty-stage .jhead{ flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; }
  .jnext{ text-align: left; max-width: none; padding-top: 0; }
  .pgrid{ grid-template-columns: 1fr 1fr; gap: 8px; }
  .jstage.focus{ scroll-margin-top: calc(56px + var(--sat) + 8px); }
  .attn .cnt{ font-size: 22px; min-width: 34px; }

  .tabbar{
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: calc(var(--tabbar-h) + var(--sab));
    padding: 0 var(--sar) var(--sab) var(--sal);
    background: var(--glass-solid); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--hairline);
  }
  .tabbar.four{ grid-template-columns: repeat(4, 1fr); }
  .tabbar.three{ grid-template-columns: repeat(3, 1fr); }
  .tabbar button{
    background: none; color: var(--caption); border: none; padding: 8px 2px 6px; min-height: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; position: relative;
  }
  .tabbar button:hover{ background: none; }
  .tabbar button.on{ color: var(--ink); }
  .tabbar button.on::after{ content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--gold); }
  .tabbar button svg{ width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
  .tabbar button .n{ position: absolute; top: 6px; left: calc(50% + 6px); font-size: 9.5px; line-height: 16px; min-width: 16px; padding: 0 4px; }

  .sheet{ position: fixed; inset: 0; z-index: 80; display: block; pointer-events: none; }
  .sheet .scrim{ position: absolute; inset: 0; background: rgba(26,26,26,.42); opacity: 0; transition: opacity var(--t-mid) var(--ease); }
  .sheet .panel{
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--hair);
    padding: 10px calc(12px + var(--sar)) calc(16px + var(--sab)) calc(12px + var(--sal)); transform: translateY(100%);
    transition: transform var(--t-mid) var(--ease); box-shadow: var(--lift-3);
  }
  .sheet.open{ pointer-events: auto; }
  .sheet.open .scrim{ opacity: 1; }
  .sheet.open .panel{ transform: none; }
  .sheet .handle{ width: 36px; height: 3px; background: var(--line); margin: 2px auto 10px; }
  .sheet .navbtn{
    display: flex; align-items: center; gap: 14px; width: 100%; background: none; color: var(--ink); border: none;
    text-align: left; font-family: var(--sans); font-weight: 500; font-size: 15px; padding: 13px 10px; min-height: 48px;
  }
  .sheet .navbtn:hover{ background: var(--surface-2); }
  .sheet .navbtn.on{ font-weight: 600; }
  .sheet .navbtn svg{ width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
  .sheet .navbtn .n{ margin-left: auto; }
  .sheet .who{ padding: 8px 10px 4px; font-family: var(--sans); font-size: 12px; color: var(--caption); border-top: 1px solid var(--hair); margin-top: 6px; }
  .sheet .who strong{ display: block; color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (min-width: 960px) and (max-width: 1180px){
  :root{ --rail-w: 200px; }
  .rail{ padding: 18px 10px 12px; }
  .topbar, .content{ padding-left: 26px; padding-right: 26px; }
}
